var xmlHttp;

function couponDownload(user,coupon)
{ 

//window.alert(coupon);

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="/user/coupon_ajax.amp";
url=url+"?coupon="+coupon;
url=url+"&user="+user;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=couponStateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function couponStateChanged() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	
	var text=xmlHttp.responseText
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 	xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
	window.alert('IE1');
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
	window.alert('IE1');
  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
