// JavaScript Document

function checkFields2() {
missinginfo = "";
if ((document.form.Email.value == "") || 
(document.form.Email.value.indexOf('@') == -1) || 
(document.form.Email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  Email address";
}

if (missinginfo != "") {
missinginfo ="Please fill in your :" +
missinginfo +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

function newWindow(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
} 

function popup(src) {
  win = window.open(src,"","top=20,left=20,height=300,width=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")
}
function openshipwin() {
  popupWin = window.open('freeshipping.html', 'freeship', 'scrollbars=no,width=400,height=360')
}
function openwincoupon() {
  popupWin = window.open('freeshipping.html', 'Coupon', 'scrollbars=no,width=500,height=400')
}
function ClearEmailBox(txt) {
txt.value="";							    
}

function tabStatus(tabBox){
//clearInterval(intervalID);	
var tabCount = 6;
   	for (var i = 1; i <= tabCount; i++)
    	{
			var tabID = i;
			var tabName = "tab" + tabID;
			var tabBlock = "tabBlock" + tabID;

          if (tabBox == tabName)
          	{          		document.getElementById(tabName).className='btnon';    document.getElementById(tabBlock).className='showDiv';
          	}
          	else
          	{
document.getElementById(tabName).className='btnoff';
document.getElementById(tabBlock).className='hideDiv';
          }
       	}
       }

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false;}
}
}
function showMenuDiv(divName) {
	hideAllMenuDiv();
	document.getElementById(divName).style.display = "block";
	}
function menubg(divName) {
	document.getElementById(divName).className = "menuCurrent";
	}
function hideAllMenuDiv() {
	document.getElementById('kitchenMenuDiv').style.display = "none";
	document.getElementById('homeMenuDiv').style.display = "none";
	document.getElementById('tablewareMenuDiv').style.display = "none";
	document.getElementById('bodyMenuDiv').style.display = "none";
	document.getElementById('healthMenuDiv').style.display = "none";
	document.getElementById('giftsMenuDiv').style.display = "none";
	document.getElementById('noodlesMenuDiv').style.display = "none";
	document.getElementById('snacksMenuDiv').style.display = "none";
	document.getElementById('cookingMenuDiv').style.display = "none";
	document.getElementById('coffeeMenuDiv').style.display = "none";
	document.getElementById('teaMenuDiv').style.display = "none";
	document.getElementById('riceMenuDiv').style.display = "none";
	document.getElementById('drinksMenuDiv').style.display = "none";
	}
function clearClassName() {
	document.getElementById('menu1').className = "topMenuList";
	document.getElementById('menu2').className = "topMenuList";
	document.getElementById('menu3').className = "topMenuList";
	document.getElementById('menu4').className = "topMenuList";
	document.getElementById('menu5').className = "topMenuList";
	document.getElementById('menu6').className = "topMenuList";
	document.getElementById('menu7').className = "topMenuList";
	document.getElementById('menu71').className = "topMenuList";
	document.getElementById('menu8').className = "topMenuList";
	document.getElementById('menu9').className = "topMenuList";
	document.getElementById('menu10').className = "topMenuList";
	document.getElementById('menu101').className = "topMenuList";
	document.getElementById('menu11').className = "topMenuList";
	}
function mouseoutMenuDiv() {
	hideAllMenuDiv();
	clearClassName();
	}


