function GetXmlHttpObject()
{ 
	var xmlHttp=null; 
	try 
	{ 
		xmlHttp = new XMLHttpRequest(); 
	} 
	catch (e) 
	{ 
		try  
		{ 
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
		} 
		catch (e) 
		{ 
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
	} 
	return xmlHttp; 
}

function update_ad_clicks(ad_num,ad_link,ad_name)
{
	xmlHttp = GetXmlHttpObject();
		
	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	} 
	
	////////////////////////////////////////////////////////////////
	// send it off to the php file in the ajax_php folder
	var   url = "http://www.allentheatresinc.com/includes/ads_ajax.php";
	url	= url+"?ad_num="+ ad_num;
	url	= url+"&sid="+Math.random();
	//prompt ("",url);
	 
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{ 			
			var result = xmlHttp.responseText;

			if(ad_link)
			{
				//window.open(ad_link,ad_name,'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')		
			}
		}  
	}   
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null); 
}