// JavaScript Document

<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		top_04_top_12_over = newImage("images/top_04-top_12_over.jpg");
		top_05_top_13_over = newImage("images/top_05-top_13_over.jpg");
		top_10_over = newImage("images/top_10-over.jpg");
		top_11_over = newImage("images/top_11-over.jpg");
		top_12_over = newImage("images/top_12-over.jpg");
		top_13_over = newImage("images/top_13-over.jpg");
		top_14_over = newImage("images/top_14-over.jpg");
		top_15_over = newImage("images/top_15-over.jpg");
		preloadFlag = true;
	}
}

function ShowReturn() 
{ 
window.open('return.html','jav','width=550,height=575,resizable=no,scrollbars=yes'); 
}

function ShowShipInfo() 
{ 
window.open('shipinfo.html','jav','width=550,height=550,resizable=no,scrollbars=yes'); 
}

function ShowPrivacy() 
{ 
window.open('privacy.html','jav','width=550,height=550,resizable=no,scrollbars=yes'); 
}

function ShowInstructions() 
{ 
window.open('instructions.html','jav','width=550,height=550,resizable=no,scrollbars=yes'); 
}

function ShowContact() 
{ 
window.open('contact.html','jav','width=550,height=575,resizable=no,scrollbars=yes'); 
}

function ShowBulk() 
{ 
window.open('bulk.html','jav','width=550,height=600,resizable=no,scrollbars=yes'); 
}

function ShowHow() 
{ 
window.open('how.html','jav','width=550,height=550,resizable=no,scrollbars=yes'); 
}

function ShowCobrand() 
{ 
window.open('cobrand_sample.html','jav','width=750,height=600,resizable=no,scrollbars=yes'); 
}

function ShowRepLocator() 
{ 
window.open('rep_locator.php','jav','width=725,height=500,resizable=no,scrollbars=yes'); 
}

function validatesoon()
{
 	if (!document.frmMain.Name.value){
 		alert("Please enter your name");
		document.frmMain.Name.focus();
		return false;
 	}
 	if (!document.frmMain.email.value){
 		alert("Please enter your email address");
		document.frmMain.email.focus();
		return false;
 	}
		//make sure is a real email address
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.frmMain.email.value)){
		return true;
	}
	else{
		alert("Please enter a valid email address.");
		document.frmMain.email.focus();
		return false;
	}
	
}

function validate()
{
 	if (!document.frmMain.Name.value){
 		alert("Please enter your name");
		document.frmMain.Name.focus();
		return false;
 	}
 	if (!document.frmMain.email.value){
 		alert("Please enter your email address");
		document.frmMain.email.focus();
		return false;
 	}
		//make sure is a real email address
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.frmMain.email.value)){
		return true;
	}
	else{
		alert("Please enter a valid email address.");
		document.frmMain.email.focus();
		return false;
	}
	
}

function validate_rma()
{
	var valid = true;
	f = document.frmRMA;
	for(var i=0; i < 10; i++){      // BEGIN loop through form elements
	   	var el = f.elements[i];
		if(!isEmpty(el)){
			alert(el.name + " is a required field");
			el.focus();
			return false;}	       // END loop through form elements
	}//for
	//make sure is a real email address
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.frmRMA.email.value)){
		return true;
	}
	else{
		alert("Please enter a valid email address.");
		document.frmRMA.email.focus();
		return false;
	}
}
function isEmpty(field){                         // test to see if field is empty
	str = field.value;
	if(str == ""){
		return false;}
		else {return true;}
}//isEmpty

function validate_bulk()
{
 	if (!document.frmMain.Name.value){
 		alert("Please enter your name");
		document.frmMain.Name.focus();
		return false;
 	}
 	if (!document.frmMain.email.value){
 		alert("Please enter your email address");
		document.frmMain.email.focus();
		return false;
 	}
		//make sure is a real email address
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.frmMain.email.value)){
		return true;
	}
	else{
		alert("Please enter a valid email address.");
		document.frmMain.email.focus();
		return false;
	}
	
}


// -->