/* Title: Tell a friend
   Description: Pops up window and passes script name as url variable
*/

//function tellafriend(script_name, query_string) {
//  	NewWin=window.open('/scripts/tellafriend.cfm?scriptname=' + script_name + '&' + query_string, 'tellafriend','scrollbars=no,toolbar=no,status=no,width=350,height=300,top=50,left=50'); 
//}  

function tellafriend(script_name, query_string) {
alert("Sorry this feature is unavailable for a short time.\r\rWe are currently updating our website");
}

function UpdatingSite() {
alert("Sorry this feature is unavailable for a short time.\r\rWe are currently updating the website.\r\rPlease bookmark the site\r\rAll features will be available within a few days");
}
/* Title: Printer friendly
   Description: Displays printer friendly product details
*/ 
function pfriendly(pid) {
  	NewWin=window.open('/scripts/pfriendly.cfm?pid=' + pid, 'PrinterFriendly','scrollbars=yes,toolbar=no,status=no,width=590,height=600,top=50,left=50'); 
  
} 
 
 
  
// change background and text color of form fields
function changeBG(targ, action) {
if (action==1){
targ.style.color="black";
targ.style.background="#FFFFFF";
}
else {
targ.style.color="#666666";
targ.style.background="FFCC00";
}
}

function ValidateGenForm()
{
//check the name field
if (document.contactform.yourname.value.length<4){
	alert("Please make is easier for us to contact you by giving your full name");
	document.contactform.yourname.focus();
	return false;
	}
if (document.contactform.companyname.value.length<4){
	alert("Please make is easier for us to contact you by giving your company name");
	document.contactform.companyname.focus();
	return false;
	}
if (document.contactform.telnum.value.length<11){
	alert("Please make is easier for us to contact you by giving your telephone number");
	document.contactform.telnum.focus();
	return false;
	}
if (document.contactform.emailadd.value.length<4){
	alert("Please make is easier for us to contact you by giving your email address");
	document.contactform.emailadd.focus();
	return false;
	}
if ((document.contactform.contact_pref[0].checked==false) && (document.contactform.contact_pref[1].checked==false)){
	alert("Please select your contact preference - email or telephone, thanks");
	return false;
	}
if ((document.contactform.contact_pref[0].checked==true) && (document.contactform.contact_pref[1].checked==true)){
	alert("Please select only one contact preference, either email or telephone, thanks");
	return false;
	}
return true;
}



function ValidateCBForm() {
//check the name field
if (document.contactform.yourname.value.length<4){
	alert("Please make is easier for us to contact you by giving your full name");
	document.contactform.yourname.focus();
	return false;
	}

if (document.contactform.telnum.value.length<11){
	alert("Please make is easier for us to contact you by giving your telephone number");
	document.contactform.telnum.focus();
	return false;
	}
return true;
}