// JavaScript Document

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function externalLink(theURL)
{
	MM_openBrWindow('external.html?link='+theURL,'popup','width=500,height=250,toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,left=200,top=200');
}


function externalLink2(theURL)
{
	MM_openBrWindow('external2.html?link='+theURL,'popup','width=500,height=250,toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,left=200,top=200');
}



/**
* Validate contact us form at /contact_us.html
*
* ensures that info is provided for first name, last name and email address
*
**/

function validate_contactUs(){
	var go = true; // flag to ensure we can go to the next page
	
	firstName = document.getElementById("firstName");
	with(firstName){
		if(value == null || value == ""){
			go = false;
		}
	}
	
	lastName = document.getElementById("lastName");
	with(lastName){
		if(value == null || value == ""){
			go = false;
		}
	}
	
	email = document.getElementById("email");
	with(email){
		if(value == null || value == ""){
			go = false;
		}
		if(go){
			apos = value.indexOf('@');
			dotpos = value.lastIndexOf(".");
			if(apos<1 || dotpos-apos<2){
				go = false;
			}
		}
	}
	
	// redirect to success page
	if(go){
		window.location = "contact_us_complete.html";
	}
	else {
		return false;
	}
}