menu_status = new Array(); 
page_status = new Array(); 

function showHide(theid){
 if (document.getElementById){
  var switch_id = document.getElementById(theid);
  if(menu_status[theid] != 'show'){
   switch_id.className = 'show';
   menu_status[theid] = 'show';
  }else{
   switch_id.className = 'hide';
   menu_status[theid] = 'hide';
  }
 }
}


function showHideP(theid){
 document.getElementById('custom_boxed_sets').className = 'hide'
 document.getElementById('stock_boxed_sets').className = 'hide'
 document.getElementById('choice_boxed_sets').className = 'hide'
 document.getElementById('personalized_custom_sets').className = 'hide'
 if (document.getElementById){
  var switch_id = document.getElementById(theid);
  if(page_status[theid] != 'show'){
   switch_id.className = 'show';
   page_status[theid] = 'show';
  }else{
   switch_id.className = 'hide';
   page_status[theid] = 'hide';
  }
 }
 page_status = new Array();
}


function popUp(URL) {
 day = new Date();
 id = 'zoomin';
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=525,height=725'); ");
 pagezoomin.focus();
}


function numCheck(calledby,decs,lval,hval,chk,ordinc){
 nval = calledby.value.replace(/\,/g,'');
 if(nval==""||isNaN(nval)){
  alert('Your entry was not valid, please enter a valid number');
  nval=lval;
  setTimeout("document.form1."+calledby.getAttribute('name')+".focus()",1);
 }
 var nvar = parseFloat(nval);
 fmtvar = nvar.toFixed(decs);
 if(fmtvar < lval || fmtvar > hval){
  if (fmtvar < lval){alert('The amount entered is less than the minimum order quantity. Please enter and amount of ' + lval + ' or more.')};
  if (fmtvar > hval){alert('Please call customer support to order this large of a quantity.')};
  nval=lval;fmtvar=lval.toFixed(decs)
  setTimeout("document.form1."+calledby.getAttribute('name')+".focus()",1);
 }
 if (ordinc > 0){
  if (parseInt(fmtvar)%parseInt(ordinc) != 0){
   tmp = (parseFloat(fmtvar)+parseFloat(ordinc))/parseFloat(ordinc);
   tmp = parseFloat(tmp)-parseFloat(.5);
   tmp = tmp.toFixed(0);
   fmtvar = parseInt(tmp)*parseInt(ordinc)
   alert('The quantity must be in increments of '+ordinc+', quantity round up to '+fmtvar);
  }
 }
 if(isNaN(fmtvar)){fmtvar = ''}
 var s=""+fmtvar;
 fmtvar='';
 while(s.length>3){
  l=s.length;
  t=s.substring(l-3);
  s=s.substring(0,l-3);
  fmtvar=','+t+fmtvar;
 }
 fmtvar=s+fmtvar;
 calledby.value=fmtvar;
 return;
}

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("side_menu_nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}

var cz=30;
var tz;

function scrollingTextz(){
 cz=cz+1;
 tz=setTimeout("scrollingText()",1000);
 if(cz > 20){
  cz=0
  var t1=setTimeout("message='Convenient Online Ordering Available!'; pos=1; maxlength=message.length+1; writemsg();",2000);
 }
}

function writemsgz(){
 if (pos<maxlength){
  txt=message.substring(pos,0);
  document.getElementById('messz').innerHTML=txt
  pos++;
  timer=setTimeout("writemsgz()",50);
 }
}
