// rotate image function
function rotateImg(maxVal,loop) {
  if (currentImg == maxVal ) currentImg = 1
  else  currentImg++
  document.prods.src='images/img'+currentImg+'.jpg'
  tmpFV = "setTimeout(\"rotateImg("+maxVal+","+loop+")\","+loop+")"
  eval(tmpFV)
}

// 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 (missing != "") {
    alert("The following information is required:\n"+missing)
        df.item(focusVal).focus()
        return false
  }
}

// function for shipping address info
var schk = 0
function doShipping() {
 df=document.forms[0]
 if ( schk == 0 ) {
    schk = 1
    df.sname.value=df.name.value
    df.saddress.value=df.address.value
    df.scity.value=df.city.value
    df.sstate.value=df.state.value
    df.szip.value=df.zip.value
    df.sphone.value=df.phone.value
 } else {
    schk = 0
    df.sname.value=''
    df.saddress.value=''
    df.scity.value=''
    df.sstate.value=''
    df.szip.value=''
    df.sphone.value=''
 }
}

// function to pop a window
function popWin(lnk,w,h) {
  wlnk="newWin=window.open('"+lnk+"','NW','width="+w+",height="+h+",left=150,top=150,screenX=150,screenY=150,menubar=yes,toolbar=yes,scrollbar=yes')"
  eval(wlnk)
  newWin.focus()
}

