function gotoPage(x,y) {
  document.FGEN.func.value='9';
  document.FGEN.page.value=x;
  document.FGEN.part.value=y;
  document.FGEN.submit();
}
function gotoPart(t) {
  document.FGEN.func.value='30';
  document.FGEN.part.value=t;
  document.FGEN.submit();
}
function goTo(x) {
  document.FGEN.func.value=x;
  document.FGEN.submit();
}
function onDlvCost(f) {
  var i=f.destid.selectedIndex;

  if (i<0)
	return;

  document.FGEN.destid.value=f.destid.options[i].value;
  document.FGEN.func.value='5';
  document.FGEN.submit(); 
}
function zoomItem(a) {
  document.FGEN.zcode.value=a;
  document.FGEN.func.value='10';
  document.FGEN.submit(); 
}
function memberInput(useSSL) {
  window.name='ishop';
  
  if (useSSL)
   dest="https://";
  else
   dest="http://";

  dest+=window.location.host+"/x/ishop.cgi?fu%3d41+me%3d"+
  		document.FGEN.merchant.value+"+lang%3d"+document.FGEN.lang.value;
  a=window.open(dest,'imember','toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,height=400,width=600');
}
function doZoomImg(imgFile) {
  zoomWin=window.open('','zoomWin','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,height=300,width=300');
  var nobigURL="/ishop/noimg_big.gif";
  var dz=zoomWin.document;
  dz.writeln('<'+'html'+'>');
  dz.writeln('<'+'head'+'>');
  dz.writeln('<'+'script'+'>');
  dz.writeln('var big=0;');
  dz.writeln('function myRefresh(){ if (!big)');
  dz.writeln('document.myImg.src="'+nobigURL+'";');
  dz.writeln('else self.resizeTo(document.myImg.width+50,document.myImg.height+80);');
  dz.writeln('}</'+'script'+'></'+'head'+'>');
  dz.write('<'+'body bgcolor=#FFFFFF text=#000000 ');
  dz.writeln(' onBlur="self.close();" onLoad="myRefresh();" marginwidth=10 marginheight=10>');
  dz.writeln('<'+'img src="'+imgFile+'" name="myImg" onLoad="big=1;"'+'>');
  dz.writeln('<'+'img src="'+nobigURL+'" height=1 width=1>');
  dz.writeln('</body></html>');
  dz.close();
  return;
}
function onAction(myForm,myFunc,myItem,myQua) {
  myForm.func.value=myFunc;
  myForm.code.value=myItem;
  myForm.quantity.value=myQua;
  myForm.submit();
}
function onRdLabel(x) {
  document.FF.findhow[x].checked=true;
}
function onGoSearch() {
  document.FGEN.func.value='30';
  document.FGEN.findtext.value=document.FF.findtext.value;
  document.FGEN.findhow.value=(document.FF.findhow[1].checked?'1':'0');
  document.FGEN.ffromprice.value=document.FF.ffromprice.value;
  document.FGEN.ftoprice.value=document.FF.ftoprice.value;
  document.FGEN.submit();
}
function onAdmin(merchant)
{
  var url='/ishop/'+merchant+'/adm';
  var features='hotkey=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no';
  win2=window.open(url,"imerchant",features);
}
function onAdmin2(ssl,merch)
{
  // newer implementation of onAdmin()
  var ssi=parseInt(ssl);
  if (ssi) {
  	 var url="https://";
  }
  else {
  	 var url="http://";
  }
  //url += window.location.host + "/x/ishopm1.cgi?merchant=" + merch + "&FUNCTION=1";
  url += window.location.host + "/ishop/ishopm.php?merchant=" + merch;
  var features='hotkey=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no';
  win2=window.open(url,"imerchant",features);
}
