<!--

//NEW ADDED STUFF



// JScript source code


//Checks form on Product search form

function ErrorCheckSearch(){

var tmpValid = "0"

	if (isWhitespace(document.FrontPage_Search.Keywords.value)){
	alert("Please type in a keyword before submitting this search.")
	document.FrontPage_Search.Keywords.focus();
	tmpValid++
	}

if (tmpValid == "0")
{
document.FrontPage_Search.submit();
}

}

//*******************************

function ErrorCheckMailingList(){

var tmpValid = "0"

    if (!(isEmail(document.FrontPage_MailingList.Email.value))){
	alert("You have not entered a valid email address.\nPleae try again.")
	document.FrontPage_MailingList.Email.focus();
	tmpValid++
	}

if (tmpValid == "0")
{
document.FrontPage_MailingList.submit();
}

}



function submitenter2(myfield,e)
{
var keycode;
var tmpValid = "0";

if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
    if (!(isEmail(document.FrontPage_MailingList.Email.value))){
	alert("You have not entered a valid email address.\nPleae try again.")
	document.FrontPage_MailingList.Email.focus();
	tmpValid++
	}


if (tmpValid == "0")
{
document.FrontPage_MailingList.submit();
}
   return false;
   }
else
   return true;
}

//*********************
 function showInfoBox(name) {
				var r='';
				var rowObj=name.parentElement;
				for(x=0; x<rowObj.childNodes.length;x++) {
					r += '<b>' + rowObj.parentElement.childNodes[0].childNodes[x].innerText + '</b> ' + rowObj.childNodes[x].innerText + ', ';
				}
				rowObj.childNodes[0].className = 'tdHighlight';
				rowObj.childNodes[1].className = 'tdHighlight';
				buildInfoBox(r);
	        }
	        function showHighlight(name) {
				var rowObj=name.parentElement;
				rowObj.childNodes[0].className = 'tdHighlight';
				rowObj.childNodes[1].className = 'tdHighlight';
	        }
	        function clearHighlight(row) {
				document.all.mainTable.childNodes[0].childNodes[row].childNodes[0].className = 'tdNormal';
				document.all.mainTable.childNodes[0].childNodes[row].childNodes[1].className = 'tdNormal';
	        }
	        function clearInfoBox(row) {
		        infoBox.style.visibility = "hidden";
	        }
	        function buildInfoBox(text) {
		        document.all.infoBox.innerHTML = text;
		        infoBox.style.visibility = "visible";
	        }	
	        

function JSRedirect(vSubCatID){

window.location = "ProductList.asp?SubCatID=" + vSubCatID;

}
//********************************


 function showInfoBox(name) {
				var r='';
				var rowObj=name.parentElement;
				for(x=0; x<rowObj.childNodes.length;x++) {
					r += '<b>' + rowObj.parentElement.childNodes[0].childNodes[x].innerText + '</b> ' + rowObj.childNodes[x].innerText + ', ';
				}
				rowObj.childNodes[0].className = 'tdHighlight';
				rowObj.childNodes[1].className = 'tdHighlight';
				buildInfoBox(r);
	        }
	        function showHighlight(name) {
				var rowObj=name.parentElement;
				rowObj.childNodes[0].className = 'tdHighlight';
				rowObj.childNodes[1].className = 'tdHighlight';
	        }
	        function clearHighlight(row) {
				document.all.mainTable.childNodes[0].childNodes[row].childNodes[0].className = 'tdNormal';
				document.all.mainTable.childNodes[0].childNodes[row].childNodes[1].className = 'tdNormal';
	        }
	        function clearInfoBox(row) {
		        infoBox.style.visibility = "hidden";
	        }
	        function buildInfoBox(text) {
		        document.all.infoBox.innerHTML = text;
		        infoBox.style.visibility = "visible";
	        }	
	        

function JSRedirect(vSubCatID){

window.location = "ProductList.asp?SubCatID=" + vSubCatID;

}

//*************************
//Chekcs form on contact us

function checkcontact(which_field,email_address) 
	{
		var display = "All Fields are required\n"
		var failed=false	
		var AtSign = 0;
			
		if (document.form1.name.value=='')
			 {
	  			failed=true	
			}
		
		
		if (document.form1.comments.value=='')
			 {
	  			failed=true	
			}
			
		for (i = 0;  i < email_address.length;  i++)	
		if (email_address.charAt(i) == '@')
		{
			
			AtSign++;
			}
			
		if(AtSign != 1 ){
			display = display + "Please enter a valid email address\n"
			failed=true	
			document.getElementById(which_field).value="";
                document.getElementById(which_field).focus();
			}
			
		
		if (failed==true)
			{
				alert(display)
				return(false)
				
			}
	
		else
		 {
			
			document.getElementById("contactSubmit").disabled = true
		return(true)	
		}
	
	}
		
		function showInfoBox(name) {
				var r='';
				var rowObj=name.parentElement;
				for(x=0; x<rowObj.childNodes.length;x++) {
					r += '<b>' + rowObj.parentElement.childNodes[0].childNodes[x].innerText + '</b> ' + rowObj.childNodes[x].innerText + ', ';
				}
				rowObj.childNodes[0].className = 'tdHighlight';
				rowObj.childNodes[1].className = 'tdHighlight';
				buildInfoBox(r);
	        }
	        function showHighlight(name) {
				var rowObj=name.parentElement;
				rowObj.childNodes[0].className = 'tdHighlight';
				rowObj.childNodes[1].className = 'tdHighlight';
	        }
	        function clearHighlight(row) {
				document.all.mainTable.childNodes[0].childNodes[row].childNodes[0].className = 'tdNormal';
				document.all.mainTable.childNodes[0].childNodes[row].childNodes[1].className = 'tdNormal';
	        }
	        function clearInfoBox(row) {
		        infoBox.style.visibility = "hidden";
	        }
	        function buildInfoBox(text) {
		        document.all.infoBox.innerHTML = text;
		        infoBox.style.visibility = "visible";
	        }	
	        

function JSRedirect(vSubCatID){

window.location = "ProductList.asp?SubCatID=" + vSubCatID;

}

//************** shopping cart

function SubmitCart(vOrderNum, vAttributeID,formName){

var tmpValid = "0"

if (tmpValid == "0")
{
document.FrontPage_Cart.OrderNum.value = vOrderNum;
document.FrontPage_Cart.AttributeID.value = vAttributeID;
document.FrontPage_Cart.submit();
}

}	


//*****************************
function ErrorCheckPaging(){

var tmpValid = "0"
	
    if ((document.FrontPage_ProductPaging.recs.value == "select")){
	alert("You must specify the number of products to display on a single page.")
	document.FrontPage_ProductPaging.recs.focus();
	tmpValid++
	}
	
    else if ((document.FrontPage_ProductPaging.SortBy.value == "select")){
	alert("You must specify how to sort your product list.")
	document.FrontPage_ProductPaging.SortBy.focus();
	tmpValid++
	}
	

if (tmpValid == "0")
{
document.FrontPage_ProductPaging.submit();
}

}

//**************************

function submitenter2(myfield,e)
{
var keycode;
var tmpValid = "0";

if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
    if (!(isEmail(document.FrontPage_MailingList.Email.value))){
	alert("You have not entered a valid email address.\nPleae try again.")
	document.FrontPage_MailingList.Email.focus();
	tmpValid++
	}


if (tmpValid == "0")
{
document.FrontPage_MailingList.submit();
}
   return false;
   }
else
   return true;
}



function popUpChart() {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open('PackageChart.asp', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=625,height=580');");
}

//**********CARt Scripts
function ErrorCheck(vNumItems){
var tmpValid = "0"

if (vNumItems == 0)
{
alert("There are no items in your shopping cart.")
tmpValid++
}

if (tmpValid == "0")
{
document.FrontPage_Form1.action = "/shoppingcart/ShoppingCart_Update.asp"
document.FrontPage_Form1.submit();
}

}


function Checkout(vNumItems){
var tmpValid = "0"

if (vNumItems == 0)
{
alert("There are no items in your shopping cart.  You may not check out at this time.")
tmpValid++
}

if (tmpValid == "0")
{
document.FrontPage_Form1.action = "/shoppingcart/ShoppingCartAppend.asp"
document.FrontPage_Form1.submit();
}

}
//************end cart scripts
//************** shopping cart

function SubmitCart(vOrderNum, vAttributeID,formName){

var tmpValid = "0"

if (tmpValid == "0")
{
document.FrontPage_Cart.OrderNum.value = vOrderNum;
document.FrontPage_Cart.AttributeID.value = vAttributeID;
document.FrontPage_Cart.submit();
}

}

//-->