/*****************************************************************************************************************/
var xmlHttp1;
function addUser(qty,billing_cust_name,billing_cust_address,billing_cust_city,billing_cust_state,billing_zip_code,billing_cust_tel,billing_cust_email,delivery_cust_name,delivery_cust_address,delivery_cust_city,delivery_cust_state,delivery_zip_code,delivery_cust_tel,amount,Order_Id,Merchant_Id,deli_var,count_num,str1)
{ 
//alert(deli_var);

if((deli_var=="gift")||(deli_var=="self")||(deli_var==""))
{ 
	if(deli_var=="gift")
		{
			if((delivery_cust_name!="Receivers Name")&&(delivery_cust_address!="Address")&&(delivery_cust_city!="City")&&(delivery_cust_state!="State")&&(delivery_zip_code!="Pincode")&&(delivery_cust_tel!="Telephone"))
			{
			var pan="AA";	
			}
			
		}
	else if(deli_var=="self")
	{
	var pan="AA";
	}
	else if(deli_var=="")
	{
	var pan="AA";
	}
}
if((qty!="Qty")&&(billing_cust_name!="Your Name")&&(billing_cust_address!="Address")&&(billing_cust_city!="City")&&(billing_cust_state!="State")&&(billing_zip_code!="Pincode")&&(billing_cust_tel!="Telephone")&&(billing_cust_email!="Email")&&(pan=="AA"))
{

xmlHttp1=GetXmlHttpObject();
if (xmlHttp1==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="order/order_add.php";
url=url+"?qty="+qty+"&billing_cust_name="+billing_cust_name+"&billing_cust_address="+billing_cust_address+"&billing_cust_city="+billing_cust_city+"&billing_cust_state="+billing_cust_state+"&billing_zip_code="+billing_zip_code+"&billing_cust_tel="+billing_cust_tel+"&billing_cust_email="+billing_cust_email+"&delivery_cust_name="+delivery_cust_name+"&delivery_cust_address="+delivery_cust_address+"&delivery_cust_city="+delivery_cust_city+"&delivery_cust_state="+delivery_cust_state+"&delivery_zip_code="+delivery_zip_code+"&delivery_cust_tel="+delivery_cust_tel+"&amount="+amount+"&Order_Id="+Order_Id+"&Merchant_Id="+Merchant_Id+"&count_num="+count_num+"&str="+str1;
url=url+"&sid="+Math.random();
xmlHttp1.onreadystatechange=stateChanged1;
xmlHttp1.open("GET",url,true);
xmlHttp1.send(null);
if(delivery_cust_name=="Receivers Name")
{
delivery_cust_name=billing_cust_name;
delivery_cust_address=billing_cust_address;
delivery_cust_city=billing_cust_city;
delivery_cust_state=billing_cust_state;
delivery_zip_code=billing_zip_code;
delivery_cust_tel=billing_cust_tel;
//delivery_cust_email=billing_cust_email;	
}
window.location.href="http://www.redsandmango.com/PHP/checkout.php?qty="+qty+"&billing_cust_name="+billing_cust_name+"&billing_cust_address="+billing_cust_address+"&billing_cust_city="+billing_cust_city+"&billing_cust_state="+billing_cust_state+"&billing_zip_code="+billing_zip_code+"&billing_cust_tel="+billing_cust_tel+"&billing_cust_email="+billing_cust_email+"&delivery_cust_name="+delivery_cust_name+"&delivery_cust_address="+delivery_cust_address+"&delivery_cust_city="+delivery_cust_city+"&delivery_cust_state="+delivery_cust_state+"&delivery_zip_code="+delivery_zip_code+"&delivery_cust_tel="+delivery_cust_tel+"&amount="+amount+"&Order_Id="+Order_Id+"&Merchant_Id="+Merchant_Id+"&str="+str1;
}
else 
{
validate_form ();   
}
}
function stateChanged1() 
{ 
if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
 { 
 document.getElementById("dis_adv").innerHTML=xmlHttp1.responseText;
 } 
} 
function GetXmlHttpObject()
{
var xmlHttp1=null;
try
 {
 xmlHttp1=new XMLHttpRequest();
 }
catch (e)
 {
 try
  {
  xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp1;
}