<!-- The Invisible Add-to-Cart Javascript with Cart Variable Functionality, Minimum Order and Validation Features  v 2.0
// ©2001-2002 G.E. Masana
// The posting, transmission, leasing, selling, rewriting and/or sharing of this script or portions thereof without the express written permission of the author is prohibited. You may modify it for your own use. Use of this script is for your sole use only. "Mal's" is the term used by Mal's e-commerce with which this script is encoded to support. This script has been tested for compatibility on IE5 and NetScape.

userid="5710349";

returnURL="";

//returnURL=document.referrer.split("//")[1];

minimum="yes";
//minimum="no";

minOrderAmt = "29.00" ;

//validate="yes";
validate="no";

//No need to change anything below this line. 

if (returnURL==""){returnURL=self.location.href.split("//")[1];}
function currency(anynum) {
   anynum=eval(anynum)
   workNum=Math.abs((Math.round(anynum*100)/100));workStr=""+workNum
   if (workStr.indexOf(".")==-1){workStr+=".00"}
   dStr=workStr.substr(0,workStr.indexOf("."));dNum=dStr-0
   pStr=workStr.substr(workStr.indexOf("."))
   while (pStr.length<3){pStr+="0"}
      if (dNum>=1000) {
      dLen=dStr.length
      dStr=parseInt(""+(dNum/1000))+","+dStr.substring(dLen-3,dLen)
   }
   if (dNum>=1000000) {
      dLen=dStr.length
      dStr=parseInt(""+(dNum/1000000))+","+dStr.substring(dLen-7,dLen)
   }
   retval = dStr + pStr 
   //-- Put numbers in parentheses if negative.
   if (anynum<0) {retval="("+retval+")"}
   return "$"+retval
}
function addCart(what) {

  if (validate=="yes") {
 
 	for (var i = 0; i<what.elements.length; i++) {
 			
 	  if (what.elements[i].name !="price"){
 if (what.elements[i].name !="sd"){
 if (what.elements[i].name !="product"){
 if (what.elements[i].name !="hash"){
 if (what.elements[i].name !="shipping"){
 if (what.elements[i].name !="message"){
 if (what.elements[i].name !="units"){
 if (what.elements[i].name !="return"){
 if (what.elements[i].name !="userid"){
 if (what.elements[i].name !="price"){
  
   if (what.elements[i].name =="qty"&& !what.elements[i].value){
  alert('What is the Quantity?');what.elements[i].focus(); 				return false;} 
 
 if (what.elements[i].selectedIndex== 0 && what.elements[i].name != "productpr"){
 alert('Please select a '+what.elements[i].name+'.');what.elements[i].focus(); 				return false;
 				}
if (what.elements[i].selectedIndex== 0 &&  what.elements[i].name == "productpr"){alert('Please make a selection.');what.elements[i].focus(); 					return false;
 					}
 	}}}}}}}}}
 }		
 	 }		
 	
}   
   if (true||validate=="no"){
   
cart="http://ww3.aitsafe.com/cf/add.cfm?userid="+userid;   
   
if (what.productpr){
cart += "&productpr={b}"+escape(what.productpr.value)+"{/b}{br}";
}

else {
cart += "&price="+what.price.value+"&product[]={b}"+escape(what.product.value)+"{/b}{br}";
}


 for (var i = 0; i<what.elements.length-1; i++) {
   if (what.elements[i].options && what.elements[i].name != "productpr")  {
   	if (what.elements[i].selectedIndex!=0)  {
   	cart += "&product[]="+escape(what.elements[i].options[what.elements[i].selectedIndex].value);
   	}
   }
}

}
if (what.sd){
cart += "&sd="+escape(what.sd.value);
}

if (what.message){
cart += "&message="+escape(what.message.value);
}
if (what.qty){
cart += "&qty="+what.qty.value;
}

if (what.hash){
cart += "&hash="+what.hash.value;
}

if (what.shipping){
cart += "&shipping="+what.shipping.value;
}

if (returnURL){
cart += "&return="+returnURL;
}

if (what.units){
cart += "&units="+what.units.value;
}
window.open(cart,"","width=1,height=1");
self.focus();
}
function minOrder(){

if (minimum=="yes"){
amount="0.00";
  if (document.cookie !=""){
 thisCookie=document.cookie.split("; ")
 for (i=0; i<thisCookie.length; i++) {
 if (thisCookie[i].split("=")[0]=="qty"){
 querystring=thisCookie[i];
 querystring=querystring.split("&");
amount=querystring[1].split("=")[1]; if (amount==""){amount="0.00";}
			}
		}
  }
		if (eval(amount)< eval(minOrderAmt)){
		
		minWin=window.open("", "","menubar=no,alwaysRaised=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent,width=200,height=110,left=200,top=50");
		minWin.document.write("<html><head><title>Minimum Order is "+minOrderAmt+"</title></head><body bgcolor='#F4F5DE' onLoad=\"setTimeout('self.close()',2000)\"><center></p></p></p><b>The minimum order is "+minOrderAmt+".<br><br>You currently have "+currency(amount)+"</b></body></html>");
		
		minWin.document.close();
		}
		 
		else if (eval(amount)>= eval(minOrderAmt)){
		location.href="http://ww3.aitsafe.com/cf/review.cfm?userid="+userid+"&return="+returnURL;
		}
}		  
		 if (minimum=="no"){
		  location.href="http://ww3.aitsafe.com/cf/review.cfm?userid="+userid+"&return="+returnURL;
		  }
}
//-->
