
//================================================
//			GetXmlHttpObject()
//  This function retrieves XmlHttpObject 
//================================================
function GetXmlHttpObject()
{
//this function retrieves an XmlHttpObject
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

//================================================
//			LogPromoCode()
//  This function passes the Promo Code as a string to
//	asp through AJAX
//================================================

function LogPromoCode(){

	var params
	params = "spromocode=FBshare&ip=" + ip;
	params = encodeURI(params);
	
	xmlHttp=GetXmlHttpObject();
	
	xmlHttp.open("POST","../includes2001/LogPromoCode.asp",true);
	 
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	
	xmlHttp.send(params); 

}//function LogPromoCode


