// JavaScript Document

var getOrderObj;
	function getOrderStatus()
	{
		var orderStatusId= document.getElementById('orderStatusId');
		if(orderStatusId=='')
		{
			alert('Plz Enter Order Status Id');
			return 0;
		}
		
		if(window.ActiveXObject)//for identify explorer
		{
			getOrderObj=new ActiveXObject('Microsoft.XMLHTTP');
		}
		else
		{			
			if (window.XMLHttpRequest) 
			{ 
				getOrderObj = new XMLHttpRequest();						
			} 
		}
		
		if(getOrderObj)
		{
			try
			{
				getOrderObj.onreadystatechange=putOrderInfo;
			}
			catch(ex)
			{
				//alert('exception in state change')
			}
			
			url = "/servlet/AddPro?proId="+proId+'&quantity=1&randomNum='+Math.random()*5;
			//alert(url);
			getOrderObj.open('POST',url,false);
			
			try
			{								
				if(window.XMLHttpRequest)
				{					
					getOrderObj.send();
				}
				else
				{							
					getOrderObj.send("");
				}				
			}
			catch(ajaxEx)
			{
				//alert(ajaxEx);
			}
		}
	}
	function putOrderInfo(){
		if(getOrderObj.readyState==4){
			//alert('getOrderObj.status:-> '+getOrderObj.status);
            //alert('response:-> '+getOrderObj.responseText);
			if(getOrderObj.status==200){				
				var response = getOrderObj.responseText;
				if(response=='proAdded'){
					//alert("This Product is Successfully Added in your Cart");
				}else{
					//alert("Product not added in your Cart. Please try again.");		
				}
				alert("This Product is Successfully Added in the cart. \n Click on \"Shopping Cart\" to Confirm.");
			}else{
				//alert("Product not added in your Cart. Please try again.");
			}
		}
	}