<!--
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.0
  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 && document.getElementById) x=document.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];}
}
//-->

<!-- hide from JavaScript-challenged browsers
function openWin(url, name) { popupWin = window.open(url,name,"resizable,width=640,height=400,left=10,top=50,scrollbars=yes");}    
// done hiding -->

<!--
function zoom (url) {
	z = window.open('','zoom_popUp','width=640,height=480,status=0,directories=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,location=0,left=10,top=50');
	z.document.write('<html>\n<head>\n<title>Large Picture</title>\n</head>\n<body>\n<div align="center">\n<img src="' +url+ '"><br>\n<form><input type="button" value="Close Window" onClick="self.close(true)"></form>\n</div>\n</body>\n</html>\n');
	z.document.close();
	z.focus(true);
}
//-->

<!--

var zoomfactor=0.05 //Enter factor (0.05=5%)
var origWidth=1
var origHeight=1

function setorig(what,url){
var a = document.images[what]
origWidth=a.width
origHeight=a.height
}

function zoomhelper(){
if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){
whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefix
whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix
}
}

function zoom(originalW, originalH, what, state){
if (!document.all&&!document.getElementById)
return
whatcache=eval("document.images."+what)
prefix=(state=="in")? 1 : -1
if (whatcache.style.width==""||state=="restore"){
whatcache.style.width=originalW
whatcache.style.height=originalH
if (state=="restore")
return
}
else{
zoomhelper()
}
beginzoom=setInterval("zoomhelper()",100)
}

function clearzoom(){
if (window.beginzoom)
clearInterval(beginzoom)
}

function mainzoom(what, state){
if(state=="restore"){
zoom(origWidth,origHeight,what,state)
}
else{
var a = document.images[what]
zoom(a.width,a.height,what,state)
}
}
//-->

<!-- Begin
function a_times_b(form) {
a=eval(form.quantity.value)
b=eval(form.price.value)
if(a == null) { a=0 }
if(b == null) { b=0 }
c=a*b
form.subtotal.value=c
}
// End -->

<!-- Begin
function invoice_total(form) {
a=eval(form.subtotal.value)
b=eval(form.shipping.value)
c=eval(form.handling.value)
d=eval(form.salestax.value)
if(a == null) { a=0 }
if(b == null) { b=0 }
if(c == null) { c=0 }
if(d == null) { d=0 }
e=a+b+c+d
f=Math.round(e*100)/100
form.total_cost.value=f
}
// End -->

function openAnyWindow(url, name) {

  // store number of arguments passed in
  var l = openAnyWindow.arguments.length;

  // initialize w (width)
  var w = "";
  // initialize h (height)
  var h = "";
  // initialize features (comma-delineated list of window features)
  var features = "";

  // loop through array of arguments to build list of features
  // begin loop with 2 (third element of array) to skip url and name
  for (i=2; i<l; i++) {

    // store current argument in variable param
    var param = openAnyWindow.arguments[i];

    // if param isn't a number, it's not width or height
    // in that case, append to features with comma
    if ( (parseInt(param) == 0) || (isNaN(parseInt(param))) ) {
      features += param + ',';

    // else param is a number; must be width or height
    } else {

      // if w hasn't been set yet, param must be the width
      // otherwise, w has been set, so param must be the height
      (w == "") ? w = "width=" + param + "," : h = "height=" + param;
    }
  }

  // append width and height strings to list of features
  features += w + h;

  // begin building statement to open window
  var code = "popupWin = window.open(url, name";

  // if l>2, there were more than two arguments
  // in that case, append comma, parenthesis, and list of features
  if (l > 2) code += ", '" + features;

  // finish building statement to open window
  code += "')";

  // execute statement to open window
  eval(code);
}
