
function Nova()
{
	alert("asdf");
}


// 11/13/2002 HLI
// 

function cookietest()
{
	if (document.cookie) {
	   	return true;
	}
	else {
 		window.navigate("cciform.asp?WCI=HelpUser#Enable Cookies");
	  	return false;
  	}
}

function Netcookietest()
{
	if (document.cookie) {
	   	return true;
	}
	else {
 		window.navigate("HelpUser.aspx#Enable Cookies");
	  	return false;
  	}
}

// ???test hli

function validatePassword() {
	//var numberChars = "0123456789";
	//var lowerChars = "abcdefghijklmnopqrstuvwxyz";
	//var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	//var otherChars = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? ";
	var allPwdChars ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?";
	//check each number
}


// open Helpwindow 

var hw = ""
var nhw = ""

function openHelpWindow(path) {
	hw = window.open(path, "helpwin", "height=280,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,titlebar=no");
	hw.focus();
	return false;
}

// open PopupWindow
// Called by: users_processtag

function openPopupWindow(path) {
	var hw = ""
	var nhw = ""
	var w = 480, h = 340;

	w = screen.availWidth;
	h = screen.availHeight;
	
	var popW = 800, popH = 600;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;

	hw = window.open(path, "helpwin", 'width=' + popW + ',height=' + popH + ',top=' +topPos + ',left=' + leftPos+', status=yes,toolbar=no,menubar=no,location=no,resizable=no, scrollbars=yes,titlebar=no');
	hw.focus();
	return false;
}


// Validate Number Field: just can type in numbers.
// Called by: 
//	Template: 1) newAccount 2) changeAgency 3) uniqueAgency 4) createAgency

function validateNumberField(field) {
       	if (Number(field.value)*0 != 0) 
       	{
       		alert("Just numbers permitted!"); 
       		field.focus();
              field.select();
              event.returnValue = false;            
       	}	
}


// Enable county by if state is LA or not.

function enableCounty() {
       	if (document.frmRegistration.State.value == "LA") 
       	{
       		document.frmRegistration.LACounty.disabled = 0; // disabled false
       		document.frmRegistration.OtherCounty.disabled = 1; // disabled true
       	}	
       	else
       	{
       		document.frmRegistration.LACounty.disabled = 1; // disabled true
       		document.frmRegistration.OtherCounty.disabled = 0; // disabled false
       	}
}

// ASP.NET: Enable county by if state is LA or not.
function NetEnableCounty() {
       	if (document.getElementById("SelectState").value == "LA") 
       	{
       		if (document.getElementById("SelectLACounty").value == "") {
       			document.getElementById("SelectLACounty").value = "(Select from list)"; // disabled false
       		}
       		document.getElementById("CompareValidator1").disabled = 0; // disabled false
       		document.getElementById("SelectLACounty").disabled = 0; // disabled false
       		document.getElementById("TextOtherCounty").disabled = 1; // disabled true
       	}	
       	else
       	{
       		document.getElementById("SelectLACounty").value = ""; // disabled false
       		//document.getElementById("CompareValidator1").disabled = 1; // disabled true
       		document.getElementById("SelectLACounty").disabled = 1; // disabled true
       		document.getElementById("TextOtherCounty").disabled = 0; // disabled true
       	}
}

//Ignore RequiredFieldValidator
function NetCancelPwd(){
	document.getElementById("PasswordNew").value="c";
	document.getElementById("PasswordConfirm").value="c";
	if (document.getElementById("TextQuestion").value=="") {
		document.getElementById("TextQuestion").value="c";
	}
	if (document.getElementById("TextAnswer").value=="") {
		document.getElementById("TextAnswer").value="c";
	}
}

//Ignore RequiredFieldValidator
function NetCancelRetrievePwd(){
	if (document.getElementById("TextBoxSecretAnswer").value=="") {
		document.getElementById("TextBoxSecretAnswer").value=".";
	}
}

//Ignore RequiredFieldValidator
function NetCancelRFV(field){
	if (field.value=="") {
		field.value=".";
	}
}

// Validate Email address
function validateEmail(field) {
	var emailLength;
   	emailLength = field.value.length;
   			  
   	if (emailLength > 0 ) {
	        if ((-1 == field.value.indexOf("@")) || (-1 == field.value.indexOf("."))) {
   		        field.focus();
   		        field.select();
       			alert("Your email must have a '.' or '@'.");
              	  	return false;
               	}
	       	if ( (-1 != field.value.indexOf("#")) ||
   		    (-1 != field.value.indexOf("!")) ||
       	     	    (-1 != field.value.indexOf(" ")) ||
          	    (-1 != field.value.indexOf(","))            	 ){
	               field.focus();
   		       field.select();
   		       alert("Your email must not have an '#' or '!' or space  "," in it." );
	    	       return false;
		}
		if (emailLength < 6) {
			field.focus();
   		        field.select();
			alert("Your Email address is not correct!");
			return false;
		}
            	if (emailLength == (field.value.indexOf("@")+1) ) {
               		field.focus();
   		        field.select();
   		        alert("Your email must have a domain name after the '@'.");
               		return false;
               	}
        }
        return true;
}


// Check Same password for confirm
function checkSamePwd() {
            if ( document.frmRegistration.Password.value != document.frmRegistration.ConfirmPassword.value) 
            {
                alert("Password must be the same");
                document.frmRegistration.Password.focus();
                event.returnValue = false;            
            }
        }

// validateAgency
//	1. AgencyName
//	2. FirstName
//	3. LastName
//	4. Address1
//	5. City
// 	6. State
//	7. Zip
//	8. LACounty
//	9. PhoneAC
//	10 PhoneFirst
//	11 PhoneSecond
//	12 Email
function validateAgency()
        {

          if (document.frmRegistration.AgencyName.value == "")
          {
              alert("Please enter Agency Name.");
              document.frmRegistration.AgencyName.focus();
              event.returnValue = false;
          }
          else
              if (document.frmRegistration.FirstName.value == "")
              {
                  alert("Please enter contact person First Name.");
                  document.frmRegistration.FirstName.focus();
                  event.returnValue = false;
              }
          else
              if (document.frmRegistration.LastName.value == "")
              {
                  alert("Please enter contact person Last Name.");
                  document.frmRegistration.LastName.focus();
                  event.returnValue = false;
              }
          else
              if (document.frmRegistration.Address1.value == "")
              {
                  alert("Please enter your Address.");
                  document.frmRegistration.Address1.focus();
                  event.returnValue = false;
              }
          else
              if (document.frmRegistration.City.value == "")
              {
                  alert("Please enter your City.");
                  document.frmRegistration.City.focus();
                  event.returnValue = false;
              }
          else
              if (document.frmRegistration.State.value == "")
              {
                  alert("Please select your State.");
                  document.frmRegistration.State.focus();
                  event.returnValue = false;
             }
          else
              if (document.frmRegistration.Zip.value == "")
              {
                  alert("Please enter your Zip Code.");
                  document.frmRegistration.Zip.focus();
                  event.returnValue = false;
              }
          else
              if (!document.frmRegistration.LACounty.disabled && document.frmRegistration.LACounty.value == "")
              {
                  alert("Please select your County since you are in Louisiana.");
                  document.frmRegistration.LACounty.focus();
                  event.returnValue = false;
             }
          else
              if (document.frmRegistration.PhoneAC.value == "")
              {
                  alert("Please enter your Phone Area Code.");
                  document.frmRegistration.PhoneAC.focus();
                  event.returnValue = false;
              }
          else
             if (document.frmRegistration.PhoneFirst.value == "")
              {
                  alert("Please enter your Phone Number.");
                  document.frmRegistration.PhoneFirst.focus();
                  event.returnValue = false;
              }
          else
              if (document.frmRegistration.PhoneSecond.value == "")
              {
                  alert("Please enter your phone number.");
                  document.frmRegistration.PhoneSecond.focus();
                  event.returnValue = false;
              }
          else
              if (document.frmRegistration.Email.value == "")
              {
                    alert("Please enter your Email.");
                    document.frmRegistration.Email.focus();
	            event.returnValue = false;
              }
	else
		return true;
}


// Validate Password Fields

function validatePwdFields()
{
        if (document.frmRegistration.Password.value == "")
        {
                    alert("Please enter your password.");
                    document.frmRegistration.Password.focus();
                    event.returnValue = false;
        }
        else
                if (document.frmRegistration.Password.value.length < 4 )
        {
                    alert("Password needs to be at least 4 characters.");
                    document.frmRegistration.Password.focus();
                    event.returnValue = false;
        }
        else
                if (document.frmRegistration.ConfirmPassword.value == "")
                {
                    alert("Please enter your confirm password.");
                    document.frmRegistration.ConfirmPassword.focus();
	            event.returnValue = false;
                }
        else 
	        if ( document.frmRegistration.Password.value != document.frmRegistration.ConfirmPassword.value) 
   		{
       	        	alert("Password must be the same");
                	document.frmRegistration.Password.focus();
                	event.returnValue = false;            
            	}
       else
                if (document.frmRegistration.SecretQuestion.value == "")
                {
                    alert("Please enter your Secret Question.");
                    document.frmRegistration.SecretQuestion.focus();
	                event.returnValue = false;
                }

        else 
	        if ( document.frmRegistration.SecretQuestion.value.toUpperCase() == "HOW ARE YOU?" ||
		     document.frmRegistration.SecretQuestion.value.toUpperCase() == "HOW ARE YOU")
   		{
       	         	alert("Sorry, please don't use sample question!");
                	document.frmRegistration.SecretQuestion.focus();
                	document.frmRegistration.SecretQuestion.select();
                    	event.returnValue = false;            
            	}
	else
                if (document.frmRegistration.SecretAnswer.value == "")
                {
                    alert("Please enter your Secret Answer.");
                    document.frmRegistration.SecretAnswer.focus();
	                event.returnValue = false;
                }            	  

        else 
	        if ( document.frmRegistration.SecretAnswer.value.toUpperCase() == "I AM FINE?" ||
		     document.frmRegistration.SecretAnswer.value.toUpperCase() == "I AM FINE") 
   		{
       	        	alert("Sorry, please don't use sample answer!");
                	document.frmRegistration.SecretAnswer.focus();
                	document.frmRegistration.SecretAnswer.select();
                    	event.returnValue = false;            
            	}
}


// Validate to see if field is blank

function validateBlank(field, description)
{
	if (field.value == "")
        {
        	alert("Please enter your " + description);
		field.focus();
	        event.returnValue = false;
        }
}


// To Swap images onMouseOver

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}