function slideDownHandler(div){
	Effect.SlideDown(div);
	Effect.Shake(div, { distance: 10});
	return false;
}

function slideUpHandler(div){
	Effect.Shake(div, { distance: 10});
	Effect.SlideUp(div);
	return false;
}

function showTagsForm(){
	document.getElementById('tagsform').style.visibility='visible';	
	document.getElementById('tags_keywords').focus();
}
function showLoader(){
	document.getElementById('loader').style.visibility='visible';
}

function saveCoupon(code){	
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
		   var htmlstr=xmlHttp.responseText;
		   document.getElementById('coupon').innerHTML=htmlstr;
		   var arrHtml=htmlstr.split("input");
		   if(arrHtml.length==1){
		   		setTimeout(cartStub(),1000); 
		   }
		  }
		}
	  xmlHttp.open("GET","/ajax/Cart.php?passed=saveCoupon&code="+code,true);
	  xmlHttp.send(null);
}

function showCoupon(){
	var xmlHttp;
	try{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	  // Internet Explorer
	  try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e){
		try{
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e){
		  alert("Your browser does not support AJAX!");
		  return false;
		}
	  }
	 }
	 xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		    document.getElementById('coupon').innerHTML=xmlHttp.responseText; 
		}
		else{
			document.getElementById('coupon').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif align=middle>&nbsp;Loading coupon form</span>";	
		}
	}
	xmlHttp.open("GET","/ajax/Cart.php?passed=showCoupon",true);
	xmlHttp.send(null);
}

function createAnAccount(){
	var xmlHttp;
	try{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	  // Internet Explorer
	  try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e){
		try{
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e){
		  alert("Your browser does not support AJAX!");
		  return false;
		}
	  }
	 }
	 xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		    document.getElementById('test').innerHTML=xmlHttp.responseText; 
		}
		else{
			document.getElementById('test').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif align=middle>&nbsp;Looking Up Account Information</span>";	
		}
	}
	xmlHttp.open("GET","/ajax/Cart.php?passed=createNewAccount",true);
	xmlHttp.send(null);
}

function continueAsGuest(){
	var xmlHttp;
	try{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	  // Internet Explorer
	  try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e){
		try{
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e){
		  alert("Your browser does not support AJAX!");
		  return false;
		}
	  }
	 }
	 xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		    document.getElementById('test').innerHTML=xmlHttp.responseText; 
		}
		else{
			document.getElementById('test').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif align=middle>&nbsp;Looking Up Account Information</span>";	
		}
	}
	xmlHttp.open("GET","/ajax/Cart.php?passed=continueAsGuest",true);
	xmlHttp.send(null);
}

function editInformation(){
	var xmlHttp;
	try{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	  // Internet Explorer
	  try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e){
		try{
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e){
		  alert("Your browser does not support AJAX!");
		  return false;
		}
	  }
	 }
	 xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		    document.getElementById('checkoutForm').innerHTML=xmlHttp.responseText; 
		}
		else{
			document.getElementById('checkoutForm').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif align=middle>&nbsp;Looking Up Information</span>";	
		}
	}
	var url=buildURL(2);
	xmlHttp.open("GET","/ajax/Cart.php?passed=editInformation"+url,true);
	xmlHttp.send(null);
}


function completeOrder(){
	var xmlHttp;
	try{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	  // Internet Explorer
	  try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e){
		try{
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e){
		  alert("Your browser does not support AJAX!");
		  return false;
		}
	  }
	 }
	 xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		    window.location.href='/kaz/thank-you-for-your-order/';
		}
		else{
			document.getElementById('page').innerHTML="<br><br><Br><div align=center><span class=\"loaderStyle\"><img src=/images/bigAjaxLoader3.gif align=middle>&nbsp;Processing Order.  Please DO NOT REFRESH the Page OR CLICK the BACK BUTTON.</span></div>";	
		}
	}
	var url=buildURL(2);
	xmlHttp.open("GET","/ajax/Cart.php?passed=completeOrder"+url,true);
	xmlHttp.send(null);
}



function saveOrderInfo(){
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			document.getElementById('checkoutForm').innerHTML=xmlHttp.responseText; 
			setTimeout(cartStub(),1000);
		}
		else{
			document.getElementById('test').innerHTML="<img src=/images/bigAjaxLoader2.gif align=middle>&nbsp;Saving Your Information.";	
		}
	   }
	   
	   var url=buildURL(1);
	   xmlHttp.open("GET","/ajax/Cart.php?passed=saveOrderInfo"+url,true);
	   xmlHttp.send(null);
}

	function buildURL(flag){
	   var email='';
	   var password='';
	   var bFirstName='';
	   var bLastName='';
	   var bAddress1='';
	   var bAddress2='';
	   var bCity='';
	   var bState='';
	   var bZip='';
	   var bCountry='';
	   var sFirstName='';
	   var sLastName='';
	   var sAddress1='';
	   var sAddress2='';
	   var sCity='';
	   var sState='';
	   var sZip='';
	   var sCountry='';
	   var UserShippingSame='';
	   var dayPhone='';
	   var eveningPhone='';
	   var fax='';
	   var filterClubMember='';
	   var SalesOrderCCType='';
	   var SalesOrderCCExpMonth='';
	   var SalesOrderCCExpYear='';
	   var SalesOrderCCExp='';
	   var SalesOrderCCNameOnCard='';
	   var SalesOrderCCNumber='';
	   var SalesOrderCCCVV='';
	   var SalesOrderId='';
	   	   
	   if (document.UserProfileForm.UserUsername){
			email=document.UserProfileForm.UserUsername.value;
	   }
	   else if(document.UserProfileForm.UserUsername2){
			email=document.UserProfileForm.UserUsername2.value;
	   }
	   if(document.UserProfileForm.UserPassword){
	   	   password=document.UserProfileForm.UserPassword.value;
	   }
	   if(document.UserProfileForm.UserBillingFirstName){
			bFirstName=document.UserProfileForm.UserBillingFirstName.value;   
	   }
	   if(document.UserProfileForm.UserBillingLastName){
			bLastName=document.UserProfileForm.UserBillingLastName.value;   
	   }
	   if(document.UserProfileForm.UserBillingAddress1){
			bAddress1=document.UserProfileForm.UserBillingAddress1.value;   
	   }
	   if(document.UserProfileForm.UserBillingAddress2){
			bAddress2=document.UserProfileForm.UserBillingAddress2.value;   
	   }
	   if(document.UserProfileForm.UserBillingCity){
			bCity=document.UserProfileForm.UserBillingCity.value;   
	   }
	   	   
	   if(document.UserProfileForm.UserBillingState){
			bState=document.UserProfileForm.UserBillingState.value;   
	   }
	   if(document.UserProfileForm.UserBillingPostalCode){
			bZip=document.UserProfileForm.UserBillingPostalCode.value;   
	   }
	   if(document.UserProfileForm.UserBillingCountry){
			bCountry=document.UserProfileForm.UserBillingCountry.value;   
	   }
	   if(document.UserProfileForm.UserShippingFirstName){
			sFirstName=document.UserProfileForm.UserShippingFirstName.value;   
	   }
	   if(document.UserProfileForm.UserShippingLastName){
			sLastName=document.UserProfileForm.UserShippingLastName.value;   
	   }
	   if(document.UserProfileForm.UserShippingAddress1){
			sAddress1=document.UserProfileForm.UserShippingAddress1.value;   
	   }
	   if(document.UserProfileForm.UserShippingAddress2){
			sAddress2=document.UserProfileForm.UserShippingAddress2.value;   
	   }
	   if(document.UserProfileForm.UserShippingCity){
			sCity=document.UserProfileForm.UserShippingCity.value;   
	   }
	   if(document.UserProfileForm.UserShippingState){
			sState=document.UserProfileForm.UserShippingState.value;   
	   }
	   if(document.UserProfileForm.UserShippingPostalCode){
			sZip=document.UserProfileForm.UserShippingPostalCode.value;   
	   }
	   if(document.UserProfileForm.UserShippingCountry){
			sCountry=document.UserProfileForm.UserShippingCountry.value;   
	   }
	   if(document.UserProfileForm.UserDayPhone){
			dayPhone=document.UserProfileForm.UserDayPhone.value;   
	   }
	   if(document.UserProfileForm.UserNightPhone){
			eveningPhone=document.UserProfileForm.UserNightPhone.value;   
	   }
	   if(document.UserProfileForm.UserFax){
			fax=document.UserProfileForm.UserFax.value;   
	   }
	   if(flag==1){
		   if(document.UserProfileForm.UserShippingSame && document.UserProfileForm.UserShippingSame.checked){
				UserShippingSame=document.UserProfileForm.UserShippingSame.value;   
		   }
	   }

	   if(flag==1){
		   if(document.UserProfileForm.filterClubMember && document.UserProfileForm.filterClubMember.checked){
				filterClubMember=document.UserProfileForm.filterClubMember.value;   
		   }
	   }
	   else{
			filterClubMember=document.UserProfileForm.filterClubMember.value;   
	   }
	   
	   if(flag==1){
		  if(document.UserProfileForm.SalesOrderCCType){
				SalesOrderCCType=document.UserProfileForm.SalesOrderCCType.options[document.UserProfileForm.SalesOrderCCType.selectedIndex].value;
		   }
	   }
	   else{
			SalesOrderCCType=document.UserProfileForm.SalesOrderCCType.value;	
		}
	   if(flag==1){
		   if(document.UserProfileForm.SalesOrderCCExpMonth){
				SalesOrderCCExpMonth=document.UserProfileForm.SalesOrderCCExpMonth.options[document.UserProfileForm.SalesOrderCCExpMonth.selectedIndex].value;
		   }
		   if(document.UserProfileForm.SalesOrderCCExpYear){
				SalesOrderCCExpYear=document.UserProfileForm.SalesOrderCCExpYear.options[document.UserProfileForm.SalesOrderCCExpYear.selectedIndex].value;
		   }
	   }
	   else{
			SalesOrderCCExpMonth=document.UserProfileForm.SalesOrderCCExpMonth.value;
			SalesOrderCCExpYear=document.UserProfileForm.SalesOrderCCExpYear.value;
	   }
	   
	   if(document.UserProfileForm.SalesOrderCCNameOnCard){
			SalesOrderCCNameOnCard=document.UserProfileForm.SalesOrderCCNameOnCard.value;   
	   }
	   if(document.UserProfileForm.SalesOrderCCNumber){
			SalesOrderCCNumber=document.UserProfileForm.SalesOrderCCNumber.value;   
	   }
	   if(document.UserProfileForm.SalesOrderCCCVV){
			SalesOrderCCCVV=document.UserProfileForm.SalesOrderCCCVV.value;   
	   }
	   if(document.UserProfileForm.SalesOrderId){
			SalesOrderId=document.UserProfileForm.SalesOrderId.value;   
	   }
	   if(document.UserProfileForm.profilecreator){
			var profilecreator=document.UserProfileForm.profilecreator.value;   
	   }
	   
	   if(profilecreator){
			SalesOrderId=SalesOrderId+"&profilecreator=true";   
	   }
	   	 	   
	   var url="&email="+email+"&password="+password+"&bFirstName="+bFirstName+"&bLastName="+bLastName+"&bAddress1="+bAddress1+"&bAddress2="+bAddress2+"&bCity="+bCity+"&bState="+bState+"&bZip="+bZip+"&bCountry="+bCountry+"&sFirstName="+sFirstName+"&sLastName="+sLastName+"&sAddress1="+sAddress1+"&sAddress2="+sAddress2+"&sCity="+sCity+"&sState="+sState+"&sZip="+sZip+"&sCountry="+sCountry+"&UserShippingSame="+UserShippingSame+"&dayPhone="+dayPhone+"&eveningPhone="+eveningPhone+"&fax="+fax+"&filterClubMember="+filterClubMember+"&SalesOrderCCType="+SalesOrderCCType+"&SalesOrderCCExpMonth="+SalesOrderCCExpMonth+"&SalesOrderCCExpYear="+SalesOrderCCExpYear+"&SalesOrderCCNameOnCard="+SalesOrderCCNameOnCard+"&SalesOrderCCNumber="+SalesOrderCCNumber+"&SalesOrderCCCVV="+SalesOrderCCCVV+"&SalesOrderId="+SalesOrderId;
	   return url;
}

function cancelCoupon(id, quant){
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		    document.getElementById('cartStub').innerHTML= xmlHttp.responseText; 
		}
		else{
			document.getElementById('cartStub').innerHTML="<img src=/images/bigAjaxLoader2.gif align=middle>&nbsp;Saving Your Information";	
		}
	   }
	   xmlHttp.open("GET","/ajax/Cart.php?passed=cancelCoupon",true);
	   xmlHttp.send(null);
}


function updateCart(id, quant){
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			//alert('before');
		    cartStub(); 
		}
		else{
			document.getElementById('cartStub').innerHTML="<img src=/images/bigAjaxLoader2.gif align=middle>&nbsp;Saving Your Information";	
		}
	   }
	   xmlHttp.open("GET","/ajax/Cart.php?passed=updateCart&productId="+id+"&quant="+quant,true);
	   xmlHttp.send(null);
}


function login()
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4){
			/*document.getElementById('cartStub').style.visibility='hidden';
			document.getElementById('cartStub').style.innerHTML='';
			document.getElementById('cartStub').style.height='0px';*/
			document.getElementById('test').innerHTML=xmlHttp.responseText; 
			setTimeout(cartStub(),1000);
			
		}
		else{
			document.getElementById('test').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif align=middle>&nbsp;Looking Up Account Information</span>";	
		}
		}
		var password=document.UserProfileForm.LoginPassword.value;
		var username=document.UserProfileForm.LoginUsername.value;	  	
		xmlHttp.open("GET","/ajax/Cart.php?passed=login&username="+username+"&password="+password,true);
	  	xmlHttp.send(null);
}


function testLogin()
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4){
			if(document.getElementById('test')){
		    	document.getElementById('test').innerHTML=xmlHttp.responseText; 
			}
		}
		else{
			if(document.getElementById('test')){
				document.getElementById('test').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif align=middle>&nbsp;Checking login status.</span>";	
			}
		}
		}
	  	xmlHttp.open("GET","/ajax/Cart.php?passed=testLogin",true);
	  	xmlHttp.send(null);
}

function testLoginClean()
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		   // window.refresh(); 
			//document.getElementById('newUserBox').innerHTML='<br clear="all" />';
			//document.getElementById('newUserBox').style.border='solid 0px black';
		}
	  }
	  	xmlHttp.open("GET","/ajax/Cart.php?passed=testLogin",true);
	  	xmlHttp.send(null);
}

function showAllTags()
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		  if(xmlHttp.readyState==4)
			{
			document.getElementById('productPageTags').innerHTML=xmlHttp.responseText;  
			}
		  else{
			document.getElementById('productPageTags').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif></span>";  
		  }
		}
	  var htmlATM=document.getElementById('productPageTags').innerHTML;
	  var arrHTML=htmlATM.split("<div id=\"tagsform\" style=\"visibility: hidden;\">");
	  var showall=0;
	  if(arrHTML.length==1){
		var showall=1;
	  }
	  var tag='';
	  if (document.tags.tags_keywords){
			tag=document.tags.tags_keywords.value;
	   }
	  var id=document.productId.productId.value;
	  xmlHttp.open("GET","/ajax/Cart.php?passed=showAllTags&productId="+id+"&tag="+tag+"&showall="+showall,true);
	  xmlHttp.send(null);
}

function showAllReviews()
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		  if(xmlHttp.readyState==4)
			{
			document.getElementById('reviews').innerHTML=xmlHttp.responseText; 
			}
		  else{
			document.getElementById('reviews').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif></span>";	  
		  }
		}
	  var id=document.productId.productId.value;
	  xmlHttp.open("GET","/ajax/Cart.php?passed=showAllReviews&productId="+id);
	  xmlHttp.send(null);
}

function addTag()
{
	showLoader();
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		  if(xmlHttp.readyState==4)
			{
			document.getElementById('productPageTags').innerHTML=xmlHttp.responseText; 
			document.getElementById('tags_keywords').focus();
			}
		  else{
			document.getElementById('productPageTags').innerHTML="<span class=\"loaderStyle\"><img src=/images/bigAjaxLoader.gif></span>";	  
		  }
		}
	  var htmlATM=document.getElementById('productPageTags').innerHTML;
	  var arrHTML=htmlATM.split("View All");
	  var showall=0;
	  if(arrHTML.length==1){
		var showall=1;
	  }
	  var tag=document.tags.tags_keywords.value;
	  var id=document.productId.productId.value;
	  xmlHttp.open("GET","/ajax/Cart.php?passed=addTag&productId="+id+"&tag="+tag+"&showall="+showall,true);
	  xmlHttp.send(null);
}

  function querySt() {
	  hu = window.location.href.substring(1);
	  gy = hu.split("/");
	  if(gy[gy.length-1]=='#descTitle'){
	  	id=gy[gy.length-2];
	  }
	  else{
		  idarr=gy[gy.length-1].split('#descTitle');
		  id=idarr[0];
	  }
	  return id;
  }


function addToCart(id)
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {  
		  	if(document.getElementById('cartStub')){
				cartStub();  
		  	}
			else{
				document.getElementById('cart').innerHTML=xmlHttp.responseText; 
				slideDownHandler('cart');
			}
		  }
		}
	  xmlHttp.open("GET","/ajax/Cart.php?passed=addToCart&productId="+id,true);
	  xmlHttp.send(null);
}

function cartStub()
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
		  document.getElementById('cartStub').innerHTML=xmlHttp.responseText;  
		}
		else{
			document.getElementById('cartStub').innerHTML="<div align=center><span class=\"loaderStyle\"><img src=/images/bigAjaxLoader2.gif><span class=\"loaderStyle\"></div>";	  
		}
	  }
	  xmlHttp.open("GET","/ajax/Cart.php?passed=getStub",true);
	  xmlHttp.send(null);
}

function deleteItem(id)
{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4){
		  	if(document.getElementById('cartStub')){
				cartStub();  
		  	}
			else{
				document.getElementById('cart').innerHTML=xmlHttp.responseText;
    			slideDownHandler('cart');
			}
		  }
		}
	  xmlHttp.open("GET","/ajax/Cart.php?passed=deleteItem&productId="+id,true);
	  xmlHttp.send(null);
}
function ViewCart()
{	
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
			//alert(document.getElementById('cart'));
		  document.getElementById('cart').innerHTML=xmlHttp.responseText;  
		  }
		}
	  xmlHttp.open("GET","/ajax/Cart.php?passed=viewcart",true);
	  xmlHttp.send(null);
}
function deleteCart()
{	
  slideUpHandler('cart');
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
		  document.getElementById('cart').innerHTML=xmlHttp.responseText;  
		  }
		}
	  xmlHttp.open("GET","/ajax/Cart.php?passed=deleteWholeCart",true);
	  xmlHttp.send(null);
}