<!--
// this page will going to store the commonly use javascript functions.
function VTopFrName(){
	var theform=document.frmExplorertop
	var theKeyword = trim(theform.frName.value)
	 
	if (theKeyword == "Company Name Search") {
		 theKeyword = ""
		} 			 	 
	if (theKeyword == "") { 
		alert("For better matches, please enter a Company Name before submit.");
		theform.frName.focus();  
		return false;  
	}
	else
		return true; 
}

function VTopDivEmail(){
	var theform=document.frmSubnews
	var theKeyword = trim(theform.Email.value)
	 
	if (theKeyword == "Enter your email addresss") {
		theKeyword = ""
	} 
			 
		 
	if ((theKeyword != "") && (VEmaileasy(theKeyword) == true)) { 
		return true; 
	}
	else 
	{
		alert("Please enter a valid Email Address.");
		theform.Email.focus();  
		return false;  
	}
}

function VEmaileasy(EmailValue){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(EmailValue.match(emailExp)){
		return true;
	}else{
		return false;
	}
}

function trim(strText) { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
} 

function Bustframe(){
	if (self != top) {
	top.location = self.location
	}
}

function Bustframenew(){
if(top.location!= document.location){
top.location = document.location; 
}
}
function pageOffset() {
    if (document.layers) {
        document.layers['layerName'].pageX = window.pageXOffset + 599;
        document.layers['layerName'].pageY = window.pageYOffset + 115;
    }
    else if (document.all) {
        document.all['layerName'].style.posLeft = document.body.scrollLeft + 599;
        document.all['layerName'].style.posTop = document.body.scrollTop + 115;
    }
    setTimeout('pageOffset()',100);
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function munge(cookie) {
	cookie += "; path=/;"
	document.cookie = cookie;
}

function VSLen(fieldLength){ //this func validates how may records has been selected
	var multireceive=document.multireceive

	if (fieldLength == 0) {fieldLength = 5}
	var k=0;

	if (!multireceive.ZorID.length){	//(!undefined) will evalue to true
		var numclients=1;
		if (multireceive.ZorID.checked) k=1;
	}else{
		var numclients=multireceive.ZorID.length;	
		for (var n=0; n<numclients; n++){
			if(multireceive.ZorID[n].checked) k=k+1;
		}
	}

	if (k>fieldLength){
		alert("Please limit your selection up to " + fieldLength + ". You have selected " + k);
		return false;
		}
	else if(k==0){
		alert("Please make at least one selection.");
		return false;
		}
	return true;
}
function VSLenFind(fieldLength){ //this func validates how may records has been selected
	var frmRequest=document.frmRequest

	if (fieldLength == 0) {fieldLength = 5}
	var k=0;

	if (!frmRequest.ZorID.length){	//(!undefined) will evalue to true
		var numclients=1;
		if (frmRequest.ZorID.checked) k=1;
	}else{
		var numclients=frmRequest.ZorID.length;	
		for (var n=0; n<numclients; n++){
			if(frmRequest.ZorID[n].checked) k=k+1;
		}
	}

	if (k>fieldLength){
		alert("Please limit your selection up to " + fieldLength + ". You have selected " + k);
		return false;
		}
	else if(k==0){
		alert("Please make at least one selection.");
		return false;
		}
	if (trim(frmRequest.FName.value) == "") {alert("Please enter a First Name."); frmRequest.FName.focus(); return false;}
	if (trim(frmRequest.LName.value) == "") {alert("Please enter a Last Name."); frmRequest.LName.focus(); return false;}
	if (trim(frmRequest.Phone.value) == "") {alert("Please enter telephone number."); frmRequest.Phone.focus(); return false;}
	if (trim(frmRequest.Phone.value).length <10) {alert("Please enter telephone number with area code."); frmRequest.Phone.focus(); return false;} 	
	if (frmRequest.CountryID.selectedIndex == 0){alert("Please enter your country."); frmRequest.CountryID.focus(); return false;}
	if ((frmRequest.CountryID.selectedIndex == 1) && (frmRequest.StateID.selectedIndex == 0)){alert("Please enter your state."); frmRequest.StateID.focus(); return false;}
	if (trim(frmRequest.feZip.value) == "") {alert("Please enter your zip code / postal code."); frmRequest.feZip.focus(); return false;}
	if ((frmRequest.CountryID.selectedIndex == 1) && (trim(frmRequest.feZip.value).length <5)) {alert("Please enter your zip code."); frmRequest.feZip.focus(); return false;}
	if ((frmRequest.CountryID.selectedIndex == 1) && (trim(frmRequest.Phone.value).length <10)) {alert("Please enter the phone number with area code."); frmRequest.Phone.focus(); return false;} 
	if (trim(frmRequest.Address.value) == "") {alert("Please enter your address."); frmRequest.Address.focus(); return false;}
	if (trim(frmRequest.City.value) == "") {alert("Please enter your city."); frmRequest.City.focus(); return false;} 
	if (frmRequest.CapitalID.selectedIndex == 0) {alert("Please select an available Investment option."); frmRequest.CapitalID.focus(); return false;} 
if (frmRequest.authusage.checked == false) {alert("Alert! In order to send your information to the franchisors you've wished to contac, please review and agree with the Terms and Conditions."); frmRequest.authusage.focus(); return false;}
	var feemail=trim(frmRequest.Email.value)
	if (feemail == "") {alert("Please enter an e-mail address."); frmRequest.Email.focus(); return false;}
	if (feemail != "") {return emailCheck(feemail);}
	return true;
}

function showProvince(theProvince) {
var province = document.getElementById("prov");
//alert(theProvince.options[theProvince.selectedIndex].value);
	if (theProvince.options[theProvince.selectedIndex].value != "203") {
	province.style.display = "";
	}
	else {
	province.value="";
	province.style.display = "none";
	}
}
function verifygen(button)	{
	var formhere=document.frmLeads
	{
		button.value = 'Please Wait';
		button.disabled = true;
		//return true;
		formhere.submit();
	}
}

function VFranName(){
	var theform=document.frmFran
	var theKeyword = trim(theform.mFrn.value)
	 
	if (theKeyword == "Enter Keyword") {
		 theKeyword = ""
		} 			 	 
	if (theKeyword == "") { 
		alert("For better matches, please enter a keyword before submit.");
		theform.mFrn.focus();  
		return false;  
	}
	else
		return true; 
}
function ValidateFrantarget(){
	var theform=document.frmFranMatch
	var theCategoryID = theform.CategoryID.value 	
	var theCapRangeID = theform.CapRangeID.value 
	var theStateID =  theform.StateID.value 
	
	if (theCategoryID == "") {
		theCategoryID = "0"
		} 
	if (theCapRangeID == "") {
		 theCapRangeID = "0"
		} 	
	if (theStateID == "") {
		 theStateID = "0"
		} 
	if ((theCategoryID == "0") && (theCapRangeID == "0") && (theStateID == "0") )  { 
		alert("For better matches, please pick an industry or an investment range or a state or enter a keyword before submit.");
		theform.CategoryID.focus();  
		return false;  
	}
	else
		return true; 
}

function textClear()
    {
       document.getElementById("myForm").myemail.value="";
    }

function ajaxFunctionEmail()
{
	var emailstr;
	var xmlHttp; 


	
try{     // Opera 8.0+, Firefox, Safari     
	xmlHttp = new XMLHttpRequest(); } 
	catch (e){     // Internet Explorer Browsers     
		try{         xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");     
		} catch (e) {         
		try{             xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");         
			} catch (e){             // Something went wrong             
		alert("browser error!");             
		return false;         
	}     
	} 
} 

       
	emailstr =  document.getElementById("myForm").myemail.value;
       
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
		//alert(xmlHttp.responseText);

			if (xmlHttp.responseText == "") {
				var strresptext ="You have successfully subscribed to our newsletter. Please continue to browse our site."
								 
				document.getElementById("emailForm").emailMessage.value= strresptext;
				pausecomp(2000);
			} 
			else {
				document.getElementById("emailForm").emailMessage.value=xmlHttp.responseText;
			} 
		}
	}
	
	xmlHttp.open("GET", "euprocess.asp?e=" + emailstr, true);
	//xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(null); 
}
function pausecomp(millis) 
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); } 
while(curDate-date < millis);
} 

function xmlhttpPost() {
    var xmlHttpReq = false;
    var self = this;
    var strURL = "euprocess.asp";
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {
    var form     = document.forms['myForm'];
    var word = form.myemail.value;
    if (word == "Enter your email addresss"){
		word = "";
		}  
    qstr = 'e=' + escape(word);  // NOTE: no '?' before querystring
   //alert(qstr);
    return qstr;
}

function updatepage(str){
    document.getElementById("euresult").innerHTML = str;
}

-->
