function ValidatePassword_customer(theForm)
{

	if(theForm.old_password.value=="")
	{
			alert("You must enter your Current Password.    ");
			theForm.old_password.focus();
			return false;
	}

	if(theForm.password.value=="")
	{
			alert("You must enter a New Password.    ");
			theForm.password.focus();
			return false;
	}

	if(theForm.password.value.length < 4)
	{
			alert("You must enter at least 4 characters for the New Password.    ");
			theForm.password.focus();
			return false;
	}

	if(theForm.confirm.value=="")
	{
			alert("You must confirm the New Password.    ");
			theForm.confirm.focus();
			return false;
	}

	if(theForm.confirm.value != theForm.password.value)
	{
		alert("Your Confirm Password doesn't match.    ");
		theForm.confirm.focus();
		return false;
	}
	
	return true;
}


function ValidatePassword(theForm)
{


	if(theForm.password.value=="")
	{
			alert("You must enter a new password. ");
			theForm.password.focus();
			theForm.password.select();
			return false;
	}
	if(theForm.confirm.value != theForm.password.value)
	{
		alert("Your login passwords did not match");
		theForm.confirm.focus();
		theForm.confirm.select();
		return false;
	}
	
	return true;
}


function autoGeneratePwd(theForm)
{
    if (parseInt(navigator.appVersion) <= 3) { 
        alert("Sorry this only works in 4.0 browsers"); 
        return true; 
    }
    
    var length=8;
    var sPassword = "";
//    length = document.aForm.charLen.options[document.aForm.charLen.selectedIndex].value;
    
    var noPunction = true;
    var randomLength = false;
    
    if (randomLength) { 
        length = Math.random(); 
        
        length = parseInt(length * 100);
        length = (length % 7) + 6
    }
    
    
    for (i=0; i < length; i++) {
    
        numI = getRandomNum();
        if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } }
        
        sPassword = sPassword + String.fromCharCode(numI);
    }

		theForm.password.value = sPassword;
		theForm.confirm.value = sPassword;
		
    return true;

}


function getRandomNum() {
        
    // between 0 - 1
    var rndNum = Math.random()

    // rndNum from 0 - 1000    
    rndNum = parseInt(rndNum * 1000);

    // rndNum from 33 - 127        
    rndNum = (rndNum % 94) + 33;
            
    return rndNum;
}

function checkPunc(num) {
    
    if ((num >=33) && (num <=47)) { return true; }
    if ((num >=58) && (num <=64)) { return true; }    
    if ((num >=91) && (num <=96)) { return true; }
    if ((num >=123) && (num <=126)) { return true; }
    
    return false;
}

function ValidateForgotPassword(theForm)
{


	if(theForm.email.value=="")
	{
			alert("You must enter your current account username. ");
			theForm.email.focus();
			theForm.email.select();
			return false;
	}
	if(theForm.secret_answer.value=="")
	{
			alert("You must enter the secret answer that you entered when you registered in order to help the system to identify you. ");
			theForm.secret_answer.focus();
			theForm.secret_answer.select();
			return false;
	}



	
	return true;
}

