// this is the survey
var w = 0;
var h = 0;

function deadCenter(w,h) {
	if (window.screen) {
var chasm = screen.availWidth;
var mount = screen.availHeight;
  subWindow = window.open('../../../broker/english/broker.html','sub','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',menubar=yes,scrollbars=yes,resizable=yes,titlebar=no, top=' + ((mount - h - 30) * .5));
	}
}

function validateform(thisform){
	
	if (thisform.firstname.value == ""){
		alert("Please enter your first name!");
		thisform.firstname.focus();
		return false;
		}
	   else if (empty(stripSpaces(thisform.firstname.value))){
	     alert("Please enter your first name!");
	     thisform.firstname.focus();
	     thisform.firstname.select();
	     return false;
	  }  

	if (thisform.lastname.value == ""){
		alert("Please enter your last name!");
		thisform.lastname.focus();
		return false;
	}
	   else if (empty(stripSpaces(thisform.lastname.value))){
	     alert("Please enter your last name!");
	     thisform.lastname.focus();
	     thisform.lastname.select();
	     return false;
	  }  
	if (thisform.phone1.value == ""){
		alert("Please enter your phone area code!");
		thisform.phone1.focus();
		return false;
	}
	   else if(thisform.phone1.value.length!= 3){
		alert("Please enter a valid telephone area code!");
		thisform.phone1.focus();
		thisform.phone1.select();
		return false;
	}
	   else if (empty(stripSpaces(thisform.phone1.value))){
	     alert("Please enter a valid telephone area code!");
	     thisform.phone1.focus();
	     thisform.phone1.select();
	     return false;
	  }  
	else{
	var n1 = thisform.phone1.value;
	 if (isNaN(n1) == true){
		alert("Invalid phone number! Please enter your correct phone area code");
		thisform.phone1.focus();
		thisform.phone1.select();
		return false;}
	}
	if (thisform.phone2.value == ""){
		alert("Please enter your phone number!");
		thisform.phone2.focus();
		return false;
		}
	else if(thisform.phone2.value.length!= 3){
		alert("Please enter a valid telephone number!")
		thisform.phone2.focus();
		thisform.phone2.select();
		return false;
	}
	   else if (empty(stripSpaces(thisform.phone2.value))){
	     alert("Please enter a valid telephone number!");
	     thisform.phone2.focus();
	     thisform.phone2.select();
	     return false;
	  }  
	else{
		var n2 = thisform.phone2.value;
	if(isNaN(n2) == true){
		alert("Invalid phone number! Please enter your correct phone number");
		thisform.phone2.focus();
		thisform.phone2.select();
		return false;}
	}
	
	if (thisform.phone3.value == ""){
		alert("Please enter your phone number!");
		thisform.phone3.focus();
		return false;
		}
	   else if(thisform.phone3.value.length!= 4){
		alert("Please enter a valid telephone number!");
		thisform.phone3.focus();
		thisform.phone3.select();
		return false;
	}
	   else if (empty(stripSpaces(thisform.phone3.value))){
	     alert("Please enter a valid telephone number!");
	     thisform.phone3.focus();
	     thisform.phone3.select();
	     return false;
	  }  
	else{
		var n3 = thisform.phone3.value;
	if(isNaN(n3) == true){
		alert("Invalid phone number! Please enter your correct phone number");
		thisform.phone3.focus();
		thisform.phone3.select();
		return false;}
	}
	if (thisform.email.value == "" ){
        alert("Please enter your email address!");
		thisform.email.focus();
        return false;
        }else {
             var emailexp = /.*\@.*\..*/;
        if (!emailexp.test(thisform.email.value)) {
            window.alert("Invalid email address! Please enter your correct email address!");
			thisform.email.focus();
			thisform.email.select();
            return false;}   
        }
	if (thisform.comments.value == ""){
		alert("Please enter your comments or questions!");
		thisform.comments.focus();
		return false;
	}
	   else if(empty(stripSpaces(thisform.comments.value))){
		alert("Please enter your comments or questions!");
		thisform.comments.focus();
		thisform.comments.select();
		return false;
	}
	return true;
}











// =================================================================
// gov_replaceIFR()
// - replaces elements with Inman Flash Replacement SWFs
// - if you have more elements to replace, then create a javascript 
//   function in your web page header call it before 
//   gov_setupPage() in the OnLoad() Event
// =================================================================
function gov_replaceIFR() {

/* Replacement calls. Please see documentation for more information. */
if(typeof sIFR == "function"){
	sIFR.replaceElement(named({sSelector:"div#banners ul li", sFlashSrc:resourcePath+"swf/banner_ifr.swf", sWmode:"transparent", sFlashVars:"", sWidth:"207", sHeight:"60"}));
	sIFR.replaceElement(named({sSelector:"#organization", sFlashSrc:resourcePath+"swf/title_ifr.swf", sWmode:"transparent",sFlashVars:"", sWidth:"620", sHeight:"38"}));
	sIFR.replaceElement(named({sSelector:"#menuheading", sFlashSrc:resourcePath+"swf/above_sidemenu_ifr.swf", sWmode:"transparent",sFlashVars:"", sWidth:"189", sHeight:"60"}));
};

}
