
function logout(){
  if(confirm('Are You Sure You Want To Log Out?')){
    top.location = 'logout.asp';
  }
}

function cancelEdit(returnURL){
  if(confirm('Are you sure you want to leave this page?\nYou will lose any changes you haven\'t saved.')){
    top.location = returnURL;
  }
}

function confirmDelete(strConf,returnPage,returnQuery){
  if(confirm('Are you sure want to delete this item?\nThis CANNOT be undone!')){
    top.location=returnPage+'?action=delete&id='+strConf+'&QReturn='+returnQuery;
  }
}

if(document.all && !document.getElementById) {
  document.getElementById = function(id) {
    return document.all[id];
  }
}

function sendMsg(a,b){
  message = window.open('messagepopup.asp?to='+a+'&n='+b,'message','width=400,height=300,toolbar=no,menubar=no,statusbar=no');
}

function reportError(a,b){
  message = window.open('errorreport.asp?url='+a+'&bug='+b,'message','width=400,height=400,toolbar=no,menubar=no,statusbar=no');
}

function checkStrength(what){
  var iStrength = 0;
  strPassword = what;
  var regexp = new RegExp("[a-z]");

  if (regexp.test(strPassword)){
    iStrength++;
  }

  var regexp = new RegExp("[0-9]");

  if (regexp.test(strPassword)){
    iStrength++;
  }

  var regexp = new RegExp("[\.\!\?\@\'\"\#\*\<\>\,\$\£\%\^\&\(\)\~\_\-]");

  if (regexp.test(strPassword)){
    iStrength++;
  }

  if(strPassword.length > 4 && iStrength> 0)
  {
    iStrength++;
  }

  if(strPassword.length > 7 && iStrength> 0)
  {
    iStrength++;
  }
  if(iStrength > 5){iStrength = 5;};
  imgBar = document.getElementById("bar")
  imgBar.src = 'images/rating' + iStrength + '.gif'

}





if (document.getElementsByTagName) {
  var inputElements = document.getElementsByTagName("input");
  for (i=0; inputElements[i]; i++) {
    if (inputElements[i].className && (inputElements[i].className.indexOf("disableAutoComplete") != -1)) {
      inputElements[i].setAttribute("autocomplete","off");
    }//if current input element has the disableAutoComplete class set.
  }//loop thru input elements
}//basic DOM-happiness-check
