function lquery(qstring) {
   myUrl = 'http://catalog.eautopartscatalog.com/zionsville/' + qstring;
   document.write("<div style='margin-left:10px;'>");
   document.write("<iframe name='iframeName' id='iframeName' onResize='ResizeTable();' SRC='" + myUrl + "' frameborder='no' border='0' MARGINWIDTH='0' MARGINHEIGHT='0' SCROLLING='auto' width = '100%' height='1200'></iframe>");
   document.write("</div>");
}
function ResizeTable() {
   document.all.mainTable.style.height='100%';
   document.all.mainTable.style.width='100%';
}
function getHeight() {
    iframeHeight = document.height;
}
function newWindow(url,popW,popH,scroll,status) {
   var w = 640, h = 480;
   if (document.all || document.layers) {
      w = screen.availWidth;
      h = screen.availHeight;
   }
   var leftPos = (w-popW)/2, topPos = (h-popH)/2;
      window.open(url,'popup','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',directories=no,toolbar=no,resizable=no,menubar=no,scrollbars=' + scroll + ',status=' + status);
}
function checkqty(me) {
   var a = parseInt(me.Available.value);
   var q = parseInt(me.Quantity.value);
   if ( (q > a) && (me.Available.value != '*') ) { 
      alert('Input Error: ' + me.Available.value + ' available. Please reduce the quantity selected.');
      return false; 
   } else {
      return true;
   }
}
function validateMe(me) {
   if ( (me.Product_Name.value == '') || (me.Product_Price.value == '') || (me.Product_Price.value < 1) || (me.Product_Weight.value == '') || (me.Product_Weight.value < 1) ) { 
      alert('Please fill in a value for every field.\n\nHint: Both Weight and Price must be 1 or greater.');
      return false; 
   } else {
      return true;
   }
}
function combineAddress(prefix) {
   window.location='mailto:' + prefix + '@zionsvilleautosport.com';
}
function ClearFields(frm){
	frm.BillFirstName.value = ""
	frm.BillLastName.value = ""
	frm.BillEmail.value = ""
	frm.BillPhone.value = ""
	frm.BillFax.value = ""
	frm.BillCompany.value = ""
	frm.BillAddress.value = ""
	frm.BillCity.value = ""
	frm.BillStateSelect.selectedIndex = 0
	frm.BillZip.value = ""
	frm.BillState.value = ""
	frm.BillCountry.selectedIndex = 0
	frm.ShipFirstName.value = ""
	frm.ShipLastName.value = ""
	frm.ShipEmail.value = ""
	frm.ShipPhone.value = ""
	frm.ShipFax.value = ""
	frm.ShipCompany.value = ""
	frm.ShipAddress.value = ""
	frm.ShipCity.value = ""
	frm.ShipStateSelect.selectedIndex = 0
	frm.ShipZip.value = ""
	frm.ShipState.value = ""
	frm.ShipCountry.selectedIndex = 0
}