function onSearchEnter( evt, frm ) {
  var keyCode = null;
  if( evt.which ) {
    keyCode = evt.which;
  }
  else
    if( evt.keyCode ) {
      keyCode = evt.keyCode;
    }
    if( 13 == keyCode ) {
      alert('Search coming soon');
      return false;
  }
  return true;
}

function onHomeEnter( evt, frm ) {
  var keyCode = null;
  if( evt.which ) {
    keyCode = evt.which;
  }
  else
    if( evt.keyCode ) {
      keyCode = evt.keyCode;
    }
    if( 13 == keyCode ) {
      frm.cmdSignUp1.click();
      return false;
  }
  return true;
}

function PostTrans(gc_activepg) {
 var lc_payment = document.frmVar.optPayment.value;
  if (document.frmVar.optPayment[0].checked==true) document.frmVar.action="https://www.paypal.com/cgi-bin/webscr";
  if (document.frmVar.optPayment[1].checked==true) {
    document.frmVar.action="bioonline.asp";
    document.frmVar.gc_action.value="AuthCstCrd";
    document.frmVar.gc_gotopg.value="AuthCstCrd";
  }
  document.frmVar.gc_activepg.value=(gc_activepg);
  document.frmVar.cmd.value="_cart";
  document.frmVar.business.value="orders@biomedicalintl.com";
  document.frmVar.page_style.value="Primary";
  document.frmVar.no_shipping.value="1";
  document.frmVar.address_override.value="0";
  document.frmVar.cancel_return.value="http://www.biomedicalintl.com/bioonline.asp?gc_navpg=T&gc_activepg=accttrancancel.asp";
  document.frmVar.submit();
}

function signin_search(){
  if (document.getElementById('acctsignin').style.display == 'none')
  {
        document.getElementById('acctsignin').style.display = 'block';
        document.getElementById('search').style.display     = 'none';
        document.getElementById('lblsearch').style.display  = 'block';
        document.getElementById('lblsignin').style.display  = 'none';
  }
  else
  {
        document.getElementById('acctsignin').style.display = 'none';
        document.getElementById('search').style.display     = 'block';
        document.getElementById('lblsearch').style.display  = 'none';
        document.getElementById('lblsignin').style.display  = 'block';
  }
}

function shwclassgrp(lc_plndesc,lc_plinid,lc_grpid,ln_grpcount){
  var ln_loop=1;  
  for (ln_loop=1;ln_loop<=ln_grpcount;ln_loop++)
  {
  	var lc_tmpplnid = "plin"+ln_loop
  	var lc_tmpgrpid = "class"+ln_loop
    document.getElementById(lc_tmpplnid).style.fontweight = 'normal';
  	document.getElementById(lc_tmpgrpid).style.display = 'none';
  }
  document.getElementById(lc_plinid).style.fontweight = 'bold';
  document.getElementById(lc_grpid).style.display = 'block';
}

function itmdesc_view(lc_itmdesc){
  var lc_sitmdesc = "s"+lc_itmdesc
  var lc_fitmdesc = "f"+lc_itmdesc
  if (document.getElementById(lc_sitmdesc).style.display == 'none')
  {
        document.getElementById(lc_sitmdesc).style.display = 'block';
        document.getElementById(lc_fitmdesc).style.display = 'none';
  }
  else
  {
        document.getElementById(lc_sitmdesc).style.display = 'none';
        document.getElementById(lc_fitmdesc).style.display = 'block';
  }
}

function usrLogon(gc_activepg) {
  var gc_userid = document.frmVar.email.value;
  var gc_passwd = document.frmVar.password.value;
  var gc_action = "UserLogon";
  SetCookieVar('gc_userid',gc_userid,'30');
  SetCookieVar('gc_passwd',gc_passwd,'30');
  SetCookieVar('gc_action',gc_action,'30');
  document.frmVar.gc_prvactpg.value=(gc_activepg);
  document.frmVar.action="bioonline.asp";
  document.frmVar.submit();
}

function usrCheckoutLogon(gc_activepg) {
  var gc_userid = document.frmVar.email1.value;
  var gc_passwd = document.frmVar.password1.value;
  var gc_action = "UserLogon";
  SetCookieVar('gc_userid',gc_userid,'30');
  SetCookieVar('gc_passwd',gc_passwd,'30');
  SetCookieVar('gc_action',gc_action,'30');
  document.frmVar.gc_prvactpg.value=(gc_activepg);
  document.frmVar.action="bioonline.asp";
  document.frmVar.submit();
}

function SignOut() {
  var gc_action = "SignOut";
  SetCookieVar('gc_action',gc_action,'30');
  SetCookieVar('gc_cid','','30');
  SetCookieVar('gc_dbrand','','30');
  document.frmVar.action="bioonline.asp";
  document.frmVar.submit();
}

function usrAcctCreate(gc_activepg) {
  document.frmVar.gc_prvactpg.value=(gc_activepg);
  document.frmVar.gc_action.value="AcctCreate";
  document.frmVar.action="bioonline.asp";
}

function UsrMain(gc_activepg,gc_action) {
  document.frmVar.gc_activepg.value=(gc_activepg);
  document.frmVar.gc_action.value=(gc_action);
  document.frmVar.action="bioonline.asp";
  document.frmVar.submit();
}

function displayiconnewwindow(ImageName) {
		WinTop = 100;  
		WinLeft = 150;
		winFeatures = "toolbar=0,location=0,directories=0,status=0";
		winFeatures += ",menubar=0,scrollbars=1,resizable=yes";
		winFeatures += ",screenX="+WinLeft+",screenY="+WinTop;
		winFeatures += ",left="+WinLeft+",top="+WinTop;
		winFeatures += ",height=420,width=300";
		PopUpWindow=window.open("","PopUpWindow",winFeatures);
		PopUpWindow.document.writeln('<html>');
		PopUpWindow.document.writeln('<head>');
		PopUpWindow.document.writeln('<title>Product Image</title>');
		PopUpWindow.document.writeln('</head>');
		if (navigator.appName == "Microsoft Internet Explorer")
		   PopUpWindow.document.writeln('<body topmargin="10" leftmargin="0"	marginwidth="0" marginheight="0" onLoad="window.resizeTo(document.images[0].width+40,document.images[0].height+150)">');
		else
		     PopUpWindow.document.writeln('<body topmargin="10" leftmargin="0" marginwidth="0" marginheight="10" onLoad="window.resizeTo(document.images[0].width+40,document.images[0].height+130)">');
		PopUpWindow.document.writeln('<center><img  src="'+ImageName+' " border="0" ></center>');
		PopUpWindow.document.writeln("<br><center><form id=form1 name=form1><input type=button onClick='self.close();' value='Close Picture' id=button1 name=button1></form></center>");
		PopUpWindow.document.writeln('</body>');
		PopUpWindow.document.writeln('</html>');
		PopUpWindow.document.close();
		PopUpWindow.focus();
}

function usrSetDefCID(gc_activepg,lc_cntrylnk,lc_cid) {
  SetCookieVar('gc_cid',lc_cid,'30');
  document.frmVar.gc_prvactpg.value=(gc_activepg);
  document.frmVar.gc_cid.value=(lc_cid);
  document.frmVar.action=(lc_cntrylnk);
  document.frmVar.submit();
}

function setDBrand(gc_activepg,lc_lnkbrdlst) {
  var lc_dbrand = (document.frmVar.lc_dbrand.value);
  var lc_dblink = (lc_lnkbrdlst+"&gc_dbrand="+lc_dbrand);
  SetCookieVar('gc_dbrand',lc_dbrand,'30');
  document.frmVar.gc_prvactpg.value=(gc_activepg);
  document.frmVar.gc_dbrand.value=(lc_dbrand);
  document.frmVar.action=(lc_dblink);
  document.frmVar.submit();
}

function mnuCall(gc_activepg,lc_action,lc_par) {
  document.frmVar.gc_prvactpg.value=(gc_activepg);
  document.frmVar.gc_action.value=(lc_action);
  document.frmVar.gc_par.value=(lc_par);
  document.frmVar.action="bioonline.asp";
  document.frmVar.submit();
}

function valCartItm(gc_activepg, gc_plinid, lc_item, lc_caseqty, lc_objqtyord, lc_price) {
  document.frmVar.gc_prvactpg.value=(gc_activepg);
  document.frmVar.gc_plinid.value=(gc_plinid);
  document.frmVar.gc_item.value=(lc_item);
  document.frmVar.gc_itmcaseqty.value=(lc_caseqty);
  document.frmVar.gc_itmprice.value=(lc_price);
  document.frmVar.gc_objqtyord.value=(lc_objqtyord);
  document.frmVar.gc_action.value="addCartItm";
  document.frmVar.action="bioonline.asp";
  document.frmVar.submit();
}

function SetCookieVar(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function CartAddLine(tranLine,cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = "cartcnt="+escape(tranLine)
                 + ";expires="+expire.toGMTString();
 document.cookie = tranLine+cookieName+"="+escape(tranLine+cookieValue)
                 + ";expires="+expire.toGMTString();
}
