function favoris(site,name) {
	if (document.all)
		window.external.addfavorite(site,name);	
	else if (typeof window.sidebar.addPanel=="function") 
		window.sidebar.addPanel(name,site,'');
	else
		alert('Faites CTRL+D pour ajouter ce site dans vos favoris !');
}

var popup_start=1;
var popup_page="/out.php";
//var popup_props="width=800,height=600,resizable=yes";
var popup_props="resizable=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes";
var popup_expire=new Date();
popup_expire.setTime(popup_expire.getTime()+(86400*1000)); //86400
function GetCookieVal(offset) {
	var endstr=document.cookie.indexOf (";",offset);
	if (endstr==-1)
		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}

function GetCookie(name) {
	var arg=name+"=";
  	var alen=arg.length;
  	var clen=document.cookie.length;
  	var i=0;
	while (i<clen) {
		var j=i+alen;
		if (document.cookie.substring(i,j)==arg)
    			return GetCookieVal(j);
    		i=document.cookie.indexOf(" ",i)+1;
    		if (i==0) break;
  	}
	return null;
}

function SetCookie(name,value) {
	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc>2)?argv[2]:null;
	var path=(argc>3)?argv[3]:null;
	var domain=(argc>4)?argv[4]:null;
	var secure=(argc>5)?argv[5]:false;
	document.cookie=name+"="+escape (value)+((expires == null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
}

function DeleteCookie(name) {
	var exp=new Date();
	exp.setTime(exp.getTime()-1);
	document.cookie=name+"="+GetCookie(name)+"; expires="+exp.toGMTString();
}

/*function amt() {
	var count=GetCookie('count')
	if (count==null) {
		SetCookie('count','1')
		return 1
	}
	else {
		var newcount=parseInt(count)+1;
		DeleteCookie('count')
		SetCookie('count',newcount,exp)
		return count
	}
}*/

function $sP() {
	var count=GetCookie('count');
	if (count==null) {
		SetCookie('count',1,popup_expire);
		var win=window.open(popup_page, "trade", popup_props);
		win.blur();
	}	
	//}
	/* else {
		count++;
		SetCookie('count', count, popup_expire);
	}*/
}

function reset() {
	DeleteCookie('count');
}

if (top.location!=self.document.location)	top.location=self.document.location;	
