<!--
function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") {
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   //while (retValue.indexOf("  ") != -1) {
   //   retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);
   //}
   return retValue;
}
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center"){
		LeftPosition=(screen.width)?(screen.width-600)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	}else if((pos!="center" && pos!="random") || pos==null){
		LeftPosition=0;TopPosition=20
	}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}
function NewWindow1(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center"){
		LeftPosition=(screen.width)?(screen.width-600)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	}else if((pos!="center" && pos!="random") || pos==null){
		LeftPosition=0;TopPosition=20
	}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}
function NewWindow2(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center"){
		LeftPosition=(screen.width)?(screen.width-750)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	}else if((pos!="center" && pos!="random") || pos==null){
		LeftPosition=0;TopPosition=20
	}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}
function gotoresults(){
	frmbrsearch.submit();	
}
//<a href="http://www.test.com/text.htm" onclick="NewWindow(this.href,'testwindow','300','300','no','center');return false" onfocus="this.blur()">YourLinkText</a>
function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Sorry, Invalid Email Address")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Sorry, Invalid Email Address")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Sorry, Invalid Email Address")
		    return false
		}
    	if (str.indexOf(at,(lat+1))!=-1){
		   alert("Sorry, Invalid Email Address")
		    return false
		}
        if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Sorry, Invalid Email Address")
		    return false
		}
        if (str.indexOf(dot,(lat+2))==-1){
		   alert("Sorry, Invalid Email Address")
		    return false
		}
		if (str.indexOf(" ")!=-1){
		   alert("Sorry, Invalid Email Address")
		    return false
		}
        return true					
	}
function checkpubfields(tform){
	if(trim(tform.txtfirstname.value=="")){
		alert("Please Enter Your First Name");
		tform.txtfirstname.value="";
		tform.txtfirstname.focus();
		return false;
	}
	if(trim(tform.txtlastname.value=="")){
		alert("Please Enter Your Last Name");
		tform.txtlastname.value="";
		tform.txtlastname.focus();
		return false;
	}
	if(trim(tform.txtmailingaddress.value=="")){
		alert("Please Enter Your Mailing Address");
		tform.txtmailingaddress.value="";
		tform.txtmailingaddress.focus();
		return false;
	}
	if(trim(tform.txtcity.value=="")){
		alert("Please Enter Your City");
		tform.txtcity.value="";
		tform.txtcity.focus();
		return false;
	}
	if(trim(tform.txtstate.value=="")){
		alert("Please Enter Your State");
		tform.txtstate.value="";
		tform.txtstate.focus();
		return false;
	}
	if(trim(tform.txtzip.value=="")){
		alert("Please Enter Your Zip Code");
		tform.txtzip.value="";
		tform.txtzip.focus();
		return false;
	}
	if (trim(tform.txtemail.value)!= ""){
		if (echeck(tform.txtemail.value)==false){
			tform.txtemail.focus();
			return false;
		}
	}
}
function DirectConnectFields(tform){
	if (trim(tform.txtfirstname.value) == ""){
		alert("Please Enter Your First Name");
		tform.txtfirstname.value="";
		tform.txtfirstname.focus();
		return false;
	}
	if (trim(tform.txtlastname.value) == ""){
		alert("Please Enter Your Last Name");
		tform.txtlastname.value="";
		tform.txtlastname.focus();
		return false;
	}
	if (trim(tform.txtmailingaddress.value) == ""){
		alert("Please Enter Your Mailing Address");
		tform.txtmailingaddress.value="";
		tform.txtmailingaddress.focus();
		return false;
	}
	if (trim(tform.txtcity.value) == ""){
		alert("Please Enter City");
		tform.txtcity.value="";
		tform.txtcity.focus();
		return false;
	}
	if (trim(tform.txtstate.value) == ""){
		alert("Please Enter State");
		tform.txtstate.value="";
		tform.txtstate.focus();
		return false;
	}
	if (trim(tform.txtzip.value) == ""){
		alert("Please Enter Zip");
		tform.txtzip.value="";
		tform.txtzip.focus();
		return false;
	}
	if (trim(tform.txtemail.value)!=""){
		if (echeck(tform.txtemail.value)==false){
			tform.txtemail.focus();
			return false;
		}
	}
}
// -->