<!--
var xmlHttp;
var r;

function FindImg()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

CheckImg(xmlHttp,1);
}

function CheckImg(xmlHttp,str) 
{ 
var url="getimg.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateImg
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateImg() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
   document.getElementById("txtHint").value=xmlHttp.responseText;
 } 
}

var cm=null;
document.onclick = new Function("show(null)")

function show(el,m) {
	if (m) {
		m.style.display='';
		m.style.pixelLeft = getPos(el,"Left")
		m.style.pixelTop = getPos(el,"Top") + el.offsetHeight
	}
	if ((m!=cm) && (cm)) cm.style.display='none'
	cm=m
}

var submitcount=0;

function checkClicks()
{
   if (submitcount == 0)
   {
      submitcount++;
      return true;
   } else {
      return false;
   }
}

function ChangePayment()
{
	document.checkout.Card_Number.value      = '';
	document.checkout.Payment_Card_Number.value      = '';
	document.checkout.Payment_Card_Exp_Month.value      = '';
	document.checkout.Payment_Card_Exp_Year.value      = '';
	document.checkout.Payment_Card_cid.value      = '';
}

function shipToChange()
{
   if (document.checkout.shipto.checked == true)
   {
      document.checkout.s_company.value   = document.checkout.b_company.value;
      document.checkout.s_name.value      = document.checkout.b_name.value;
      document.checkout.s_address_1.value = document.checkout.b_address_1.value;
      document.checkout.s_address_2.value = document.checkout.b_address_2.value;
      document.checkout.s_city.value      = document.checkout.b_city.value;
      document.checkout.s_state.value     = document.checkout.b_state.value;
      document.checkout.s_zip.value       = document.checkout.b_zip.value;
      document.checkout.s_country.value   = document.checkout.b_country.value;
      document.checkout.s_phone.value     = document.checkout.b_phone.value;
   } else {
      document.checkout.s_company.value   = '';
      document.checkout.s_name.value      = '';
      document.checkout.s_address_1.value = '';
      document.checkout.s_address_2.value = '';
      document.checkout.s_city.value      = '';
      document.checkout.s_state.value     = '';
      document.checkout.s_zip.value       = '';
      document.checkout.s_country.value   = '';
      document.checkout.s_phone.value     = '';
   }
}

function FR_shipToChange()
{
   if (document.formrequest.shipto.checked == true)
   {
      document.formrequest.ins_shiptocompany.value   = document.formrequest.ins_company.value;
      document.formrequest.ins_shiptoname.value      = document.formrequest.ins_name.value;
      document.formrequest.ins_shiptostreet_1.value  = document.formrequest.ins_address_1.value;
      document.formrequest.ins_shiptostreet_2.value  = document.formrequest.ins_address_2.value;
      document.formrequest.ins_shiptocity.value      = document.formrequest.ins_city.value;
      document.formrequest.ins_shiptostate.value     = document.formrequest.ins_state.value;
      document.formrequest.ins_shiptozip.value       = document.formrequest.ins_zip.value;
      document.formrequest.ins_shiptocountry.value   = document.formrequest.ins_country.value;
      document.formrequest.ins_ship_phone.value      = document.formrequest.ins_phone.value;
   } else {
      document.formrequest.ins_shiptocompany.value   = '';
      document.formrequest.ins_shiptoname.value      = '';
      document.formrequest.ins_shiptostreet_1.value  = '';
      document.formrequest.ins_shiptostreet_2.value  = '';
      document.formrequest.ins_shiptocity.value      = '';
      document.formrequest.ins_shiptostate.value     = '';
      document.formrequest.ins_shiptozip.value       = '';
      document.formrequest.ins_shiptocountry.value   = '';
      document.formrequest.ins_ship_phone.value      = '';
   }
}

function confirmTaxId() 
{ 
   var newid = document.customer.newtaxid.value;
   var oldid = document.customer.oldtaxid.value;
   var newlen = document.customer.newtaxid.value.length;
   var message = newid + " " + oldid + " " + newlen + " " + " Do you want to Email the Password to this Customer?";
   var message = " Do you want to Email the Password to this Customer?";
   if (newid != oldid) {
      if (newlen > 0) {
	if (confirm(message)) { 
		document.customer.emailpass.value = "Y";
	} else {
		document.customer.emailpass.value = "N";
	}
      }
   }	
}

function GetQtyPrice(pid,qty,ptype) 
{
 var i=ptype;
 var itm;
 var newitm;
 var dctprice;
 var qtylevel;
 var idname = document.getElementById(pid).name;
 itm=idname.split("|");

while (i<=ptype) 
{
	if (i == 0) { break; }
	qtylevel = Number(document.getElementById("qtylevel"+i+pid).value);
	if (qty >= qtylevel) {	
		dctprice = Number(document.getElementById("plevel"+i+pid).value);
		itm[2] = dctprice.toFixed(2);
		break;
	}
	i--;
}
 newitm = itm.join("|");
 document.getElementById(pid).name = newitm;
// document.getElementById(pid).value = newitm;
}

//-->
