//Ajax Actions

function viewCategory(id,divID,p){
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="/include/modules/catalog/ajaxViewCat.php";
	url=url+"?moduleName=catalog";
	url=url+"&catID="+id;
	url=url+"&p="+p;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange= function () { stateChanged (divID); }
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);

}
 
function viewRecord(id,divID){
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="/include/modules/catalog/ajaxViewRecord.php";
	url=url+"?moduleName=catalog";
	url=url+"&pid="+id;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange= function () { stateChanged (divID); }
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);

}

function  checkQty(){
	var  qty=document.frmAddToBasket.orderQty.value;	
	document.getElementById('orderQtyMsg').innerHTML='';
	if (qty>parseInt(curStock)){
		document.getElementById('orderQtyMsg').innerHTML='Our stock only has '+' '+curStock+' item(s)';
		document.getElementById('addToBasket').disabled=true;
	}else {
		document.getElementById('addToBasket').disabled=false;
	}
}	
