// preload images
var mnuimgs=new Array(14);
mnuimgs[0]=new Image();
mnuimgs[0].src="images/index_07.jpg"									
mnuimgs[1]=new Image();
mnuimgs[1].src="images/menu_home_on.gif"
mnuimgs[2]=new Image();
mnuimgs[2].src="images/index_08.jpg"									
mnuimgs[3]=new Image();
mnuimgs[3].src="images/menu_about_on.gif"
mnuimgs[4]=new Image();
mnuimgs[4].src="images/index_09.jpg"									
mnuimgs[5]=new Image();
mnuimgs[5].src="images/menu_bestsellers_on.gif"
mnuimgs[6]=new Image();
mnuimgs[6].src="images/index_10.jpg"									
mnuimgs[7]=new Image();
mnuimgs[7].src="images/menu_newitems_on.gif"
mnuimgs[8]=new Image();
mnuimgs[8].src="images/index_11.jpg"									
mnuimgs[9]=new Image();
mnuimgs[9].src="images/menu_order_on.gif"
mnuimgs[10]=new Image();
mnuimgs[10].src="images/index_12.jpg"									
mnuimgs[11]=new Image();
mnuimgs[11].src="images/menu_contact_on.gif"
mnuimgs[12]=new Image();
mnuimgs[12].src="images/index_13.jpg"									
mnuimgs[13]=new Image();
mnuimgs[13].src="images/menu_cart_on.gif"
									
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function popPass(){
	var myWin;
	myWin=window.open('forgotPassword.cfm', 'thisWin', 'width=350,height=350');
}

function setSize(which){
	document.cart.product_size.value=which;
	sdiv = document.getElementById("sizeDiv");
	sdiv.innerText=which;	
}
function setColor(which){
	document.cart.product_style.value=which;
	sdiv = document.getElementById("colorDiv");
	sdiv.innerText=which;	
}
function showShipping(which){
	sdiv = document.getElementById("shipToAddrDiv");
	sdiv.style.display=which;	
}
function setShipping(which){
	if(which == 1){
		document.info.sName.value=document.info.bName.value;
		document.info.sAddress.value=document.info.bAddress.value;
		document.info.sAddress2.value=document.info.bAddress2.value;
		document.info.sCity.value=document.info.bCity.value;
		document.info.sState.value=document.info.bState.value;
		document.info.soState.value=document.info.boState.value;
		document.info.sZip.value=document.info.bZip.value;
		document.info.sCountry.value=document.info.bCountry.value;
		document.info.sPhone.value=document.info.bPhone.value;
		document.info.sEmailAddress.value=document.info.bEmailAddress.value;		
	}
	if(which == 0){
		document.info.sName.value='';
		document.info.sAddress.value='';
		document.info.sAddress2.value='';
		document.info.sCity.value='';
		document.info.sState.value='';
		document.info.soState.value='';
		document.info.sZip.value='';
		document.info.sCountry.value='';
		document.info.sPhone.value='';
		document.info.sEmailAddress.value='';		
	}
}

function validateEmail(thisForm){
	if( thisForm.emailAddress.value == "" ){
		window.alert("Please enter your email address!");
		thisForm.emailAddress.focus();
		return false;
	}
	else {
		var emailexp = /.*\@.*\..*/;
		if (!emailexp.test(thisForm.emailAddress.value)) {
			window.alert("Invalid email address! Please enter your correct email address!");
			thisForm.emailAddress.focus();
			return false;
		}   
	}
	return true;
}

function validateLogin(thisForm){
	if( thisForm.emailAddress2.value == "" ){
		window.alert("Please enter your email address!");
		thisForm.emailAddress2.focus();
		return false;
	}
	else {
		var emailexp = /.*\@.*\..*/;
		if (!emailexp.test(thisForm.emailAddress2.value)) {
			window.alert("Invalid email address! Please enter your correct email address!");
			thisForm.emailAddress2.focus();
			return false;
		}   
	}
	if( thisForm.password.value == "" ){
		window.alert("Please enter your password!");
		thisForm.password.focus();
		return false;
	}
	return true;
}

function popWin(which){
	var myWin;
	myWin=window.open('largePic.cfm?p=' + which, 'thisWin', 'width=520,height=390');
}

function popWinSub(which){
	var myWin;
	myWin=window.open('../largePic.cfm?p=' + which, 'thisWin', 'width=520,height=390');
}

function validateNewsEmail(thisForm){
	if( thisForm.thisemail.value == "" ){
		window.alert("Please enter your email address!");
		thisForm.thisemail.focus();
		return false;
	}
	else {
		var emailexp = /.*\@.*\..*/;
		if (!emailexp.test(thisForm.thisemail.value)) {
			window.alert("Invalid email address! Please enter your correct email address!");
			thisForm.thisemail.focus();
			return false;
		}   
	}
	return true;
}
