// function to handle checkbox
 var cbOn = false
 function setCheckbox() {
   if ( cbOn ) {
      document.forms[0].cbAccountEdit.value='ON'
      document.cb.src='images/checkbox.gif'
	  cbOn = false
   } else {
      document.forms[0].cbAccountEdit.value='ON'
      document.cb.src='images/checkbox_on.gif'
	  cbOn = true
   }
 }

// Function to launch event window
function popWin(lnk,w,h,r,s) {
  if ( (!h || h == "") || (!w || w == "") ) {
     eventSrc="newWin=window.open(lnk,'EVENT','width=775,height=550,left=1,top=1,screenX=1,screenY=1"
  } else {
     eventSrc="newWin=window.open(lnk,'EVENT','width="+w+",height="+h+",left=1,top=1,screenX=1,screenY=1,status=no"
  }
// add scrolling if needed
  if ( s != "" ) {
    eventSrc+=",scrollbars=yes"
  }
// make resizable if needed
  if ( !r || r == "" ) {
    eventSrc+="')"
  } else {
    eventSrc+=",resizable=yes')"
  }
  eval(eventSrc)
}

//Function to force Enter Key to submit forms

function checkEnter(e){ 
var characterCode

if(e && e.which){
e = e
characterCode = e.which 
}
else{
e = event
characterCode = e.keyCode
}
if((characterCode == 13) && (document.forms[0].Password.value != "") && (document.forms[0].LoginID.value != "")){ 
document.forms[0].submit()
return false 
}
else if((characterCode == 13) && (document.forms[0].Password.value == "") && (document.forms[0].LoginID.value != "")){ 
{ alert ('You must enter your password'); }
return true 
}
else if((characterCode == 13) && (document.forms[0].Password.value != "") && (document.forms[0].LoginID.value == "")){ 
{ alert ('You must enter your username'); }
return true 
}
else if((characterCode == 13) && (document.forms[0].Password.value == "") && (document.forms[0].LoginID.value == "")){ 
{ alert ('You must enter your login information'); }
return true 
}
else {
return true 
}

}

//Function for form Validation

function validate_and_submit_Form() {
if ((document.forms[0].Password.value  == "") && (document.forms[0].LoginID.value  != ""))
	{ alert ('You must enter your password'); }
else

if ((document.forms[0].LoginID.value  == "") && (document.forms[0].Password.value  != ""))
	{ alert ('You must enter your username'); }
	
else
	
if ((document.forms[0].LoginID.value  == "") && (document.forms[0].LoginID.value  == ""))
	{ alert ('You must enter your login information'); }
	
else

	{ document.forms[0].submit() }
}





