// JavaScript Document
var gurl="";
function Ajax(){
	var http_obj;
	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    	http_obj = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
    	http_obj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return http_obj;
}
function sendhitcount(ownerid,tagid,keyword,locationid){
	ajax=new Ajax();

	//alert(ownerid+":"+tagid+":"+locationid)
	ajax.open('GET','/php_files/catch_banner_hit_count.php?ownerid='+ownerid+'&tagid='+tagid+'&keyword='+keyword+'&location='+locationid,true)
	ajax.onreadystatechange=sCA ;
	ajax.send(null);
}
function sCA()
{
	
	if (ajax.readyState==4 || ajax.readyState==200){ }
	// alert(ajax.responseText);


}
function sendSponsorhitcount(ownerid,tagid,keyword){
	ajax=new Ajax();


	var url ='/php_files/catch_sponsor_link_hit_count.php?ownerid='+ownerid+'&tagid='+tagid+'&keyword='+keyword;

	ajax.open('GET',url,true)
	ajax.send(null);

	
}

function sendSponsorLogohitcount(ownerid,tagid,keyword,locationid){


	ajax=new Ajax();

if(tagid=='13')
{
 tagid='99';
}

if(tagid=='12')
{
 tagid='100';
}

	var url ='/php_files/catch_sponsor_hit_count.php?ownerid='+ownerid+'&tagid='+tagid+'&keyword='+keyword+'&locationid='+locationid;

	ajax.open('GET',url,true)
	ajax.onreadystatechange=sLA ;
	ajax.send(null);

}

function sLA()
{
   	if (ajax.readyState==4 || ajax.readyState==200){ 

 		//alert(ajax.responseText);
		}


}
function redirectto(url,ownerid,tagid,newwin,keyword,locationid){
		re=sendhitcount(ownerid,tagid,keyword,locationid);
//alert('hi');		
//added by Ram from 23 to 27 lines 
		ind=url.indexOf("http");
		//if(tagid==6){
			if(ind==0){
			 url=url;
			}else {
			  url="http://"+url;
			}
		//}
		if(url!=''){
			if (!newwin)
				window.open(url,"_blank","wiidth="+screen.availWidth+"height="+screen.availHeight+",status=no,resizable=yes,scrollbars=yes");
			else 
				window.open(url,"_blank","width="+screen.availWidth+"height="+screen.availHeight+",location=yes,status=yes,resizable=yes,scrollbars=yes,toolbar=yes");
		}
		
}
	
function swfredirectto(url,ownerid,tagid,newwin){
		re=sendhitcount(ownerid,tagid,'','conjungo');
		//added by Ram from 23 to 27 lines 
		ind=url.indexOf("http");
		//if(tagid==6){
			if(ind==0){
			 url=url;
			}else {
			  url="http://"+url;
			}
		//}
	/*	if(url!=''){
			if (!newwin)
				window.open(url,"_blank","wiidth="+screen.availWidth+"height="+screen.availHeight+",status=no,resizable=yes,scrollbars=yes");
			else 
				window.open(url,"_blank","width="+screen.availWidth+"height="+screen.availHeight+",location=yes,status=yes,resizable=yes,scrollbars=yes,toolbar=yes");
		}
	*/	
}



