<!--
var newwin = 0;
function popWin(URL, WIDTH,HEIGHT) {

    newwin=window.open(URL,'help','left=100,top=100,width='+WIDTH +',height='+HEIGHT+',resizable=1,status=0,scrollbars=1,toolbar=0,menubar=0,location=0,directories=0');

}
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function launchReel(){
	popWin("/customer/reelhousereel/showreel.html", 550,500);
}
/*
* function validate
* Validate non null on desired fields and do a little 
* more for fields which should have some structure 
* such as zip and email
*/
function validate(form) {
var strMsg = "";

if (form.Your_Name.value == "") {
strMsg += "Please enter your name \n";
}
if (form.email.value == "") {
strMsg += "Please enter your email address \n";
}
if (form.email.value != "" && (!validateEmail(form.email.value))) {
strMsg += "Please correct your email address \n";
}

if (strMsg.length > 0) {
alert(strMsg);
}
return (strMsg.length == 0);
}

/*
* function validateEmail
* A very simple function to determine if an email address is 
* completely wrong or at least has all the functional parts - 
* that is, a '.' and an '@'.
*/
function validateEmail(emailAddress) {
if (emailAddress.indexOf('@') == -1 || emailAddress.indexOf('.') == -1) {
return false;
}
return true;
}


function validateEducational(form) {
		var strMsg = "";
		if (form.Your_Name.value == "") {
			strMsg += "Please enter your name \n";
		}
		if (form.email.value == "") {
			strMsg += "Please enter your email address \n";
		}
		if (form.email.value != "" && (!validateEmail(form.email.value))) {
			strMsg += "Please correct your email address \n";
		}
		if (strMsg.length > 0) {
			alert(strMsg);
		}
		return (strMsg.length == 0);
}

function validateFeedback(form) {
		var strMsg = "";
		if (form.Your_Name.value == "") {
			strMsg += "Please enter your name \n";
		}
		if (form.email.value == "") {
			strMsg += "Please enter your email address \n";
		}
		if (form.email.value != "" && (!validateEmail(form.email.value))) {
			strMsg += "Please correct your email address \n";
		}
		if (strMsg.length > 0) {
			alert(strMsg);
		}
		return (strMsg.length == 0);
}

// for search page
function validateSearch(){
	f = document.productsearchbyprice_form;
	if(f.elements['substring'].value== "" && f.elements['in_category'].options[f.elements['in_category'].selectedIndex].value == ""){
		alert("Please Enter a Product Title or Choose a Category")
		return false;
	}
	document.productsearchbyprice_form.submit()
}
function validateDists(url){
	var err = 0;
	form = document.forms['cartform'];
	/*for(i=0;i<form.elements.length; i++){
		if(form.elements[i].name.indexOf("distribution")!=-1 && form.elements[i].value ==""){
			err = 1;
			//return false;
			//alert(form.elements[i].name +" "+ form.elements[i].value)
		}
	}*/
	// updated this to just check the global format setting --Luke 92506
	if(form.elements['kitFormat'].value == ""){
		err = 1;
	}
	
	if(err == 0){
		//document.location=url;
		form.submit();
	}else{
		alert("Please select a format for all items in your cart");
	}
}

function validateAgreement(el){	
	if(el.checked == false){ 
		alert("You must agree to the licensing and purchasing terms for these products before placing an order");
		return false; 
	}
	return true;
}
function clearCart(url){
	document.location = url;
}
// -->

