/**
 * @author alexanderia_lover
 * @copyright 2007
 */


// creating ajax object

	if (window.ActiveXObject) {
	
	 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	else  {
	
	 xmlHttp = new XMLHttpRequest();
	}		
			
	function updateOrderItem(productID)
			 {
				 var quantity;
				 	this.productID = productID ;
				 	quantity = document.getElementById("quantity["+productID+"]").value;	
					
							if (quantity=="" || isNaN(quantity))
								{
									alert("please enter a valid quantity");	
									return ;
								}
							if (quantity==0)
								{
									alert("zero is not a valid .. you can remove the item instead by clicking on the remove icon");
									return ;	
								}
			
					
					xmlHttp.open("GET","order_updateItem.php?productID="+productID+"&quantity="+quantity, true);
					xmlHttp.onreadystatechange = updateOrderItem_Handler;
					xmlHttp.send(null);
					
			 }
		
		function updateOrderItem_Handler()
			{
				if (xmlHttp.readyState == 1)
					{
						document.getElementById("quantityTable"+productID).style.display='none';
						document.getElementById("quantityBlackDiv"+productID).style.display='block';
					}
				
				if (xmlHttp.readyState == 4) 
					{ 
						document.getElementById("myCartdiv").innerHTML = xmlHttp.responseText ;	
						
					}	
					
			}	
			
		function showUpdateButton(productID)
			{
			document.getElementById("updateButton["+productID+"]").style.display='block';	
			document.getElementById("updateButton2["+productID+"]").style.display='none';
			}	
			
			
		