<!--

function windowtest() {
alert ('hello');
return false;
}


function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "Please enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;    
}

function checkName (strng) {
var error = "";
if (strng == "") {
   error = "Please enter your name\n";
}
return error;
}
function checkPropertyValue (strng) {
var error = "";
if (strng == "") {
   error = "Please enter a property value. Enter '1' in the box if not required\n";
   return error;
}

var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); 
    if (isNaN(parseInt(stripped))) {
       error = "The property value contains illegal characters. Please use digits only";
  }
return error;
}

function checkTelephone (strng) {
var error = "";
if (strng == "") {
   	error = "To enable us to contact you with your free quotation, please enter a valid phone number\n";
	return error;
 	}
	

var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); 
    if (isNaN(parseInt(stripped))) {
        error = "The phone number contains illegal characters.";
    	}
    if (!(stripped.length == 11)) {
		error = "The phone number is the wrong length. Make sure you included an area code.\n";
    	} 
return error;
}

function checkLoanAmount (strng) {
var error = "";
if (strng == "") {
   error = "Please enter a loan amount. Enter '1' in the box if unknown\n";
   return error;
}

var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); 
    if (isNaN(parseInt(stripped))) {
       error = "The loan amount contains illegal characters. Please use digits only";
  }
return error;
}



function checkPassword (strng) {
var error = "";
if (strng == "") {
   error = "You didn't enter a password.\n";
}

    var illegalChars = /[\W_]/; // allow only letters and numbers
    
    if ((strng.length < 6) || (strng.length > 8)) {
       error = "The password is the wrong length.\n";
    }
    else if (illegalChars.test(strng)) {
      error = "The password contains illegal characters.\n";
    } 
    else if (!((strng.search(/(a-z)+/)) && (strng.search(/(A-Z)+/)) && (strng.search(/(0-9)+/)))) {
       error = "The password must contain at least one uppercase letter, one lowercase letter, and one numeral.\n";
    }  
return error;    
}    




function checkDOB (strng) {
var error = "";
if (strng == "") {
   error = "Please enter your name\n";
}
    
var illegalChars = /\W/; // allow letters, numbers, and underscores
if (illegalChars.test(strng)) {
    error = "The text contains illegal characters.\n";
    } 
return error;
}       



function isEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "The mandatory text area has not been filled in.\n"
  }
return error;	  
}


function isDifferent(strng) {
var error = ""; 
  if (strng != "Can\'t touch this!") {
     error = "You altered the inviolate text area.\n";
  }
return error;
}

// exactly one radio button is chosen

function checkRadio(checkvalue) {
var error = "";
   if (!(checkvalue)) {
       error = "Please select .\n";
    }
return error;
}



function checkLoanType(choice) {
var error = "";
    if (choice == 0) {
    error = "Please choose a loan type.\n";
    }    
return error;
}    

function checkCallbackForm(theForm) {
    var why = "";
    why += checkName(theForm.input_name.value);
    why += checkTelephone(theForm.input_telephone.value);
    why += checkPropertyValue(theForm.input_property_value.value);
	why += checkLoanAmount(theForm.input_loan_amount.value);
    /*why += checkLoanType(theForm.input_loan_type.selectedIndex);*/
    
	if (why != "") {
       alert(why);
       return false;
    }
	
	
return true;
}

function checkQuotationForm(theForm) {
	
	
    var why = "";
	var why2 = "";
    why += checkName(theForm.input_name.value);
	if (why != "") {
       alert(why);
       return false;
    }
    why += checkTelephone(theForm.input_telephone.value);
	if (why != "") 
		{
		why2 = checkTelephone(theForm.input_telephone2.value);
			if (why2 != "") 
			{
			alert(why);
       		return false;
			}
       why = "";
    }
	why += checkTelephone(theForm.input_telephone2.value);
	if (why != "") 
		{
		why2 = checkTelephone(theForm.input_telephone.value);
			if (why2 != "") 
			{
			alert(why);
       		return false;
			}
        why = "";
    }

  /*  why += checkSelfCert(checkvalue);
    why += checkDropdown(theForm.choose.selectedIndex); */
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

-->