// add p_ to beginning of html filename and redirect to that
// printer friendly page

function go2prtpg() {
 var path = location.pathname;
 var pn = path.substring(0,path.lastIndexOf("/")+1);
 var fn = path.substring(path.lastIndexOf("/")+1,path.length);
 if ( path.indexOf(".cgi") > 1 )
 {
   if ( location.search.length > 1 )
   {
     location = location.href + "&PC=1";
   }
   else
   {
     location = location.href + "?PC=1";
   }
 }
 else
 {
   if ( fn.length == 0 )
   {
     fn = "index.htm";
   }
   location = pn + "p_" + fn;
 }
}

// redirect to a specific page on the web site

function go_redirect(form) {
 var V_TOTAL=49;

 // start at 1 so we always skip the default
 for ( I = 1; I < V_TOTAL; I++ )
 {
  if ( document.redirect1.TOPSELECT.options[I].selected )
  {
    location.href = document.redirect1.TOPSELECT.options[I].value;
    return;
  }
  else if ( document.redirect2.BOTSELECT.options[I].selected )
  {
    location.href = document.redirect2.BOTSELECT.options[I].value;
    return;
  }
 }
}

function submitonce(form){
 if ( document.all || document.getElementById ) {
  for (i = 0; i < form.length; i++ ) {
    var tobj = form.elements[i]
    if ( tobj.type.toLowerCase() == "submit" ||
         tobj.type.toLowerCase() == "reset" )
      tobj.disabled = true
  }
 }
}

function showtip(current,e,text,text2,text3) {
  t2=text2
  t3=text3
  
  if (document.all||document.getElementById) {
    thetitle=text.split('<br>')
  
    if (thetitle.length>1) {
      thetitles=''
      for (i=0;i<thetitle.length;i++)
        thetitles+=thetitle[i]
      current.title=thetitles+'   '+t2+'   '+t3
    }
    else
      alltext=text

    if ((t2 != "") && ( t2 != null))
      alltext = alltext + '\no ' + t2
    if ((t3 != "") && ( t3 != null))
      alltext = alltext + '\no ' + t3
    current.title=alltext
  }
  else if (document.layers) {
    document.tooltip.document.write('<layer width=100% background=#FFFFCC bgColor=#FFFFCC style="border:2px solid navy; background-color: #FFFFCC; font-size: 13pt;">'+text+t2+t3+'</layer>')
    document.tooltip.document.close()
    document.tooltip.left=e.pageX+5
    document.tooltip.top=e.pageY+5
    document.tooltip.visibility="show"
  }

}

function hidetip() {
  if (document.layers)
    document.tooltip.visibility="hidden"
}

var ie4=document.all
var ns6=document.getElementById&&!document.all

function showcart() {
//  cart_cnt();
  var items = getCookie('SCC_CNT');
  if (( items == null ) || ( items.length == 0 ))
  { items = 0;
    document.cartlayer.visibility="hidden";
    return; }

//  if (ie4||ns6) {
//    document.cartinfo.document.write('<layer style="font-size: 8pt"><nobr>Items in Cart: ' + items + '</nobr></layer>');
//    document.cartinfo.document.close();
//    document.cartinfo.left=document.cartdiv.pageX+1
//    document.cartinfo.top=document.cartdiv.pageY+1
//    document.cartinfo.visibility="show";
//  }
cartcontent="<nobr>Items in Cart: " + items + "</nobr>";

if (document.all||document.getElementById){
  cart_el=document.getElementById ? document.getElementById("cartdiv") : document.all.cartdiv;
  cart_el.innerHTML=cartcontent;
  co_el=document.getElementById ? document.getElementById("codiv") : document.all.cartdiv;
  co_el.innerHTML="Checkout";
}
else if (document.layers){
  document.cartlayer.document.write(cartcontent);
  document.cartlayer.document.close();
  document.colayer.document.write("Checkout");
  document.colayer.document.close();
}
document.cartlayer.visibility='show';

}

function popwin(url,name) {
  if ( name == null ) { name = "popwin" }
  window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=900,height=600,screenX=50,screenY=50,top=50,left=50')
}
