function getCookie(name) {
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1) return null;
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}
function _setCookie(name, value, expires) {
	//document.cookie = name + "=" + escape(value) + ((expires) ? ("; expires=" + expires.toGMTString()) : "");
var lastcookie=getCookie(name);
var allcookies = document.cookie;
allcookies=allcookies.replace(name+"="+lastcookie,"");  
document.cookie = name + "=" + escape(value) + ";"+allcookies+";path=/; domain=.priceleap.com";

}

var StatHtml="";

function get_statistics(PID,AISID)
{
 try{
	if(getCookie("lastpage")!=PID){
	  var counter_link="http://www.priceleap.com/counter3.php?ais_id="+AISID;
	  StatHtml+="<iframe  height='1' width='1' src='"+counter_link+"'></iframe>";
	}
	else{
	}	 
}
catch(e) {}
  return true;
}

function get_statistics_total(PID)
{
	  document.getElementById('id_stat').innerHTML=StatHtml;
	  document.domain="priceleap.com";	
	  StatHtml="";
	_setCookie("lastpage", PID);
	return true;
}



function reset_status() {
   window.status = "http://www.priceleap.com";
   return true;
}

function blockErr()
{return true;}

window.onerror=blockErr;
setInterval('reset_status()',100);