var xmlHttpcountimp;
function count_impression(ty,aid)
{
	
	xmlHttpcountimp=GetXmlHttpObject()
	if (xmlHttpcountimp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	}
	
	//alert(surl);
	
	
	
	var url = "process_r/advertise_count.php?ty="+ty+"&aid="+aid;
	//alert(url);
	xmlHttpcountimp.onreadystatechange=stateChangedcountimp 
	xmlHttpcountimp.open("GET",url,true)
	xmlHttpcountimp.send(null)
	
	
}

function stateChangedcountimp() 
{ 
	if (xmlHttpcountimp.readyState==1)
	{
		//document.getElementById("event_show").innerHTML = "&nbsp;<img src='images/ajax-loader.gif' hspace='160' vspace='30'>";
	}
	if (xmlHttpcountimp.readyState==4 || xmlHttpcountimp.readyState=="complete")
	{ 
		/*//alert(xmlHttpcountimp.responseText);
		//prmt(xmlHttpresp.responseText);
		var t = new Array();
		var res = xmlHttpcountimp.responseText;
		t = res.split("##**");
		
		if(t[2] != "0")
		{
		document.location= "discussion_detail.php?tid="+t[0];
		}else
		{
			document.getElementById("frmqcjoin").style.display = "";
		document.getElementById("frmqcjoin").innerHTML = t[1];	
		}*/
		
	}
}


function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 

function get_clickurl(churl,adid)
{
	count_impression('C',adid);
	window.open(churl);
}

