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_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_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];}
}

var tabCount = 6
// style background change
function changeBG(cid){
	for ( t=1; t<=tabCount; t++ ) {
    //thisbrowser="NN4";
    if(document.layers) alert("document.layers['t"+t+"'].className='producttabblue'");
    //thisbrowser="ie"
    if(document.all) 		eval("document.all.t"+t+".className='producttabblue'")
    //thisbrowser="NN6";          
    if(!document.all && document.getElementById) eval("document.getElementById('t"+t+"').className='producttabblue'")
  }
  //thisbrowser="NN4";
  if(document.layers) alert("document.layers['t"+cid+"'].className='producttabwhite'");
  //thisbrowser="ie"
  if(document.all) 		eval("document.all.t"+cid+".className='producttabwhite'")
  //thisbrowser="NN6";          
  if(!document.all && document.getElementById) eval("document.getElementById('t"+cid+"').className='producttabwhite'")           
}


// function to switch between product page layers
function Toggle(item) {
	for ( i=1; i<=tabCount; i++ ) {
   obj=document.getElementById('ppl'+i);
   if (i==item) {
     obj.style.display="block";
   } else {
     obj.style.display="none";
   }
  }
}


// products page layer toggling
function showIt(lv) {
  for ( i=1; i<=tabCount; i++ ) {
	if ( i != lv ) hideLayer('ppl'+i)
  }
  eval("showLayer('ppl"+lv+"')")
}

function showLayer(layerName) {
 	eval(layerRef+layerName+styleSwitch+'.visibility="visible"');
 	if ( layerName == "ppl3" || layerName == "ppl5" ) eval(layerRef+layerName+styleSwitch+'.position="relative"');
}

function hideLayer(layerName) {
	eval(layerRef+layerName+styleSwitch+'.visibility="hidden"');
 	if ( layerName == "ppl3" || layerName == "ppl5" ) eval(layerRef+layerName+styleSwitch+'.position="absolute"');
}   

ns=0;
layerRef="document.all['"
styleSwitch="'].style"
if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)<5) {
	ns=1;
	layerRef="document.layers['"
  	styleSwitch="']"
} else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)>=5) {
	ns=1;
	layerRef="document.getElementById('"
    styleSwitch="').style"
}

// function for shipping address info
var schk = 0
function doShipping(val) {
 df=document.forms[0]
 if ( schk == 0 ) {
    schk = 1
    df.s_name.value=df.name.value
    df.s_address.value=df.address.value
    df.s_city.value=df.city.value
    df.s_zip.value=df.zip.value
		if ( val == "United States of America" )
      df.s_state.selectedIndex=df.state1.selectedIndex
		else 
      df.s_province.value=df.province1.value
 } else {
    schk = 0
    df.s_name.value=''
    df.s_address.value=''
    df.s_city.value=''
		if ( val == "United States of America" )
      df.s_state.selectedIndex=0
		else
      df.s_state.value=''
    df.s_zip.value=''
 }
}

// function to validate input
function checkInput() {
  var missing=focusVal=""
  df=document.forms[0]
  arg_num = arguments.length
  j=1
  for(i=0;i<arg_num;i=i+2) {
     current_val = eval("df."+arguments[i]+".value")
     if ( current_val == "" ) {
            missing += "- " + arguments[j] + "\n"
        if ( focusVal=="" ) focusVal = arguments[i]
         }
         j=j+2
  }

  if ( df.confirm ) {
     if ( df.confirm.value != df.password.value ) missing =+ "- Passwords do not match"
  }
  if (missing != "") {
    alert("The following information is required:\n"+missing)
    eval("df."+focusVal+".focus()")
    return false
  } else {
    return true
  }
}

// process coupon request
  function proc_Coupon(type,coupon,vc) {
   if ( coupon == "" && type == "A" ) {
      alert("You must enter a coupon value")
      return
   }
   lnk = "proc_coupon.php?type="+type+"&coupon="+coupon+"&vc="+vc
   window.location = lnk
  }
  
