function pauza(p) {
	d = new Date()
	while (1) {
		ms=new Date()
		if( ms-d > p ) {break;}
	}
}

function verif_home (url_1, ref123) {
// script care seteaza url_1 ca HomePage in IE, DACA referrerul este google; daca vizitatorul a acceptat, se apeleaza scriptul de incrementare a contorului de HomePages ;)
	if (!ref123 || ref123=='') ref123=document.referrer.toString();
	var a=navigator.userAgent;
	var db=document.body;
	var lochref=window.location.href;
	//var radacina=((lochref.indexOf("/www.")>0)?("http://www."):("http://"));		// vede daca e canonica sau nu
	
	url_1 = url_1.toString();
	if (!url_1.indexOf("www.")) return false;
	var url_2 = "http://"+url_1.substring(11,url_1.length);
	
	db.style.behavior='url(#default#homepage)';
	var was_hp=(db.isHomePage(url_1) || db.isHomePage(url_2));
	
	if (a.indexOf('MSIE')>=0 && !was_hp && document.all['fr_homepage']!=undefined)
	{
		db.setHomePage(url_1)
		if (db.isHomePage(url_1) || db.isHomePage(url_2)) {
			//alert ('yes');
			document.all.fr_homepage.src='http://systemplus.info/promoplus/inreghp.php?url='+url_1+'&count=yes'
			pauza(500)
		}
		else {
			//alert ('no')
			var today = new Date()
			var expires = new Date()
			expires.setTime(today.getTime() + 1000*60*60*24*7)
			setCookie("hp_no", 1, expires)
			document.all.fr_homepage.src='http://systemplus.info/promoplus/inreghp.php?url='+url_1+'&count=no'
			pauza(500)
		}
	}
}
