// L3 cOté 0bsCuR dU J5 !!!

var Fpopunder=0;
var Fdisclaimerreload=1;
var Fcountout=1;
var FshiftLinkAndPop=0;
var FchoosePop='';
var Fexiturl='';
var Fdebug = 0;

var timeForClock = 5;
timeForClock *= 5;
function popUnderDiscl(me) {
if (Fpopunder==1) popo2006(); // ca cest la vraie popunder. IE6 only?
if (Fdisclaimerreload==1) {
	var t='acomapopUnder.php';// notez que popunder est en fait un refresh discl
	t=t.replace(/a/g,'/');
	if (FchoosePop!='') t=FchoosePop;
	var shlaguefluck = t;
	if (postfix!='') shlaguefluck = shlaguefluck+'?'+postfix;
	if (FshiftLinkAndPop==1 && me) {
		shlaguefluck = me.href;
		me.href = t;
	}
	setTimeout(" document.location.href = '"+shlaguefluck+"' ", timeForClock*200);
}
return true;
}
function popo2006() {
var exit_win = window.open(popunderurl, '', 'width=548,height=387' );
exit_win.blur();
window.focus();
}

function adoudoudou(string) { document.write(string.replace(/@/,"<")); }
function exit2006() {
	var url1 = '/com/redir.php?exit=1&'+postfix;
	if (parent.frames.length < 1) {// only qd pas dans frame
		var url = window.location.href;
		if(url.indexOf("?") == -1) { url += "?re=1"; } else { url +="&re=1"; }
		adoudoudou("@frameset cols=\"*,0\" scrolling=no border=0 frameborder=no framespacing=0>");
		adoudoudou("@frame src=\""+url+"\" name=frame1>");
		adoudoudou("@frame src=\"/com/exitA.php?");
		adoudoudou("urlexit="+escape(url1)+"\" name=frame2 noresize>");
		adoudoudou("@/frameset>");
	}
}

function aaa_ber() {
	var popURL = escape('http://'+location.hostname+'/com/redir.php?exit=1&'+postfix);
	var hhh;
	if (Fexiturl != '') popURL = escape(Fexiturl);
	if (navigator.userAgent.indexOf("Firefox") != -1)
		hhh = "<embed src='/com/exit/nwsexit.asx.php?url="+popURL+"' autostart=true width=0 height=0></embed>";
	else
		hhh = "<embed src='http://www.videos-gratuites.net/exitpop2/pop.swf?popURL="+popURL+"' autostart=true width=0 height=0></embed>";
	document.body.innerHTML+=hhh;
	if (Fdebug==1) alert (" => "+hhh);
	alert("Merci de votre visite !");
}
function exit2007() {
	if (navigator.userAgent.indexOf("Firefox") != -1)
		aaa_ber();
	else
		eval("window.attachEvent('onunload',aaa_ber);");
}


/////////////////////////////////////////////////////////

function prepareAllLinks3() {
	var allLinks = document.getElementsByTagName('a');
	var ezilfez=0;
	m = allLinks.length; if (m>1000) m=1000;
	for (i=0; i<m; i++) {
		if ( 0 == allLinks[i].href.indexOf('http://') && 0 != allLinks[i].href.indexOf('http://'+location.hostname) ) {
			if (allLinks[i].onclick) {
				var old = allLinks[i].onclick;
				//if (0==ezilfez++) alert(old);
				//allLinks[i].onclick = function() { old(); ct3(this);};
			}
			else {
				allLinks[i].onclick = function() { ct3(this); }
			}
		}
	}
}
function ct3(zis) {
	var url = '/com/countOut.php?to='+escape(zis.href)+'&fromServ='+escape(location.hostname)+'&fromUri='+escape(veryFromUri);
	if (document.images) (new Image()).src=url;
	return true;
}
function toDoOnLoad() {
	if (Fcountout) prepareAllLinks3();
}
if(window.addEventListener) window.addEventListener("load", function(){ toDoOnLoad(); }, false);
else if(window.attachEvent) window.attachEvent("onload", function(){ toDoOnLoad(); } );

function bookmark() {
	var url = 'http://'+location.hostname+veryFromUri+'?bm=1';
	if (document.all && window.external) window.external.AddFavorite(url, siteTitre);
	else alert("Fait control+d pour créer un bookmark !")
}
function event2caller(e) {
	var targ;
	if (!e) var e = window.event; 
	if (!e) return false;
	if (e.target) targ = e.target; 
	else if (e.srcElement) targ = e.srcElement; 
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
	return targ;
}

//////////////////////

function my_get_cookie(Name) {
	var search = Name + "=";
	var returnvalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search);
		if (offset != -1) { // if cookie exists
			offset += search.length;
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset);
			// set index of end of cookie value
			if (end == -1) end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end));
		}
	}
	return returnvalue;
}
function load_popunderurls(){
	if (my_get_cookie('popunder')!='') return;

	win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"",
			"width=800,height=600,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0");
	win2.blur();
	window.focus();
	document.cookie="popunder=yes";
}


