// JavaScript Document
function addtocasket() {
destination = "subcat_div"
whatisit2 = document.product.selecter.value


whatisit = whatisit2.replace(/ /g, "~")


if (whatisit != "Click~For~Sizes")
{
poststring = "prod=" + document.product.prod.value + "&"
poststring =poststring + "code=" + document.product.code.value + "&"
poststring =poststring + "styleof=" + document.product.cat.value + "&"
poststring =poststring + "design=" +  document.product.titleprod.value + "&"
poststring =poststring + "brand=" + document.product.brand.value + "&"

poststring =poststring + "size=" + whatisit + "&"

poststring =poststring + "gbp=" + document.product.gbp.value + "&"
poststring =poststring + "euros=" + document.product.euro.value + "&"
poststring =poststring + "usd=" + document.product.usd.value + "&"
poststring =poststring + "can=" + document.product.can.value + "&"
poststring =poststring + "gbppost=" + document.product.gbppost.value + "&"
poststring =poststring + "europost=" + document.product.europost.value + "&"
poststring =poststring + "usdpost=" + document.product.usdpost.value + "&"
poststring =poststring + "canpost=" + document.product.canpost.value + "&"
poststring =poststring + "rowpost=" + document.product.rowpost.value + "&"
poststring =poststring + "thumber=" + document.product.thumb.value + "&"
poststring =poststring + "vendor=BSI"


   
 if (doc){ 	 
		doc.open('POST',"add-to-casket.asp",false)
				 doc.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
		 
	   doc.send (poststring)
	  

	 alert("Item Added To Shopping Cart")
	
		}else{
	document.getElementById(destination).innerHTML ='Browser unable to create XMLHttp Object'
		} 
		
		
 if (doc){ 	 
	checky = "checkcart.asp?time=" + new Date().getTime()
    doc.open("GET", checky , false);
    doc.send(null);
    document.getElementById("shopping-casket").innerHTML   = doc.responseText;

		
		}else{

	document.getElementById(destination).innerHTML ='Browser unable to create XMLHttp Object'
		} 
}
else 
   { 
       alert("Please select size above")
   }

}