var iscook = readCookie('popup');
if (!iscook || single<1) {

	document.write('<meta http-equiv="imagetoolbar" content="no" />');
	document.write('<div id="sponsorAdDiv" style="visibility:hidden;position:absolute; z-index:99;height:1; width:1px;top:0;left:0;">');
	document.write('<table cellpadding="0" border="0" cellspacing="0" width="100">');
	document.write('<tr><td height="5"><a href="javascript:closeAd();"><img src="http://www.cameras-voyeurs.com/popup/0002/images/top.jpg" border="0"></a><br><a href="http://' + sousdomaine + '.cameras-voyeurs.com/cameras-voyeurs.php" target="_blank"><img src="http://www.cameras-voyeurs.com/popup/0002/images/main' + de() + '.jpg" border="0"></a></td></tr></table>');
	document.write('</div>');


	var agt=navigator.userAgent.toLowerCase();
	adTime=30;
	
	var ns=(document.layers);
	var ie=(document.all);
	var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
	adCount=0;
	
	if (single>0) {
		createCookie('popup','1',1)
	}
}

function de()
{
	decubique = Math.ceil(9 *  Math.random());
	return decubique;
}

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}


function initAd(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sponsorAdDiv.style');
	else if(ns)	adDiv=eval('document.layers["sponsorAdDiv"]');
	else if(w3)	adDiv=eval('document.getElementById("sponsorAdDiv").style');
	randAd=Math.ceil(Math.random()*1);
        if (ie||w3)
        adDiv.visibility="visible";
        else
        adDiv.visibility ="show";
	if(randAd==1) showAd();
}

function showAd(){
if(adCount<adTime*10){
adCount+=1;
	if (agt.indexOf("opera")!=-1){
	documentWidth= documentWidth=window.innerWidth/2+window.pageXOffset-(600/2);
	documentHeight= window.innerHeight/2+window.pageYOffset-(400/2);
	}
	else if (ie){
	documentWidth  = (truebody().offsetWidth)/2+truebody().scrollLeft-(600/2);
	documentHeight = (truebody().offsetHeight)/2+truebody().scrollTop-(400/2);
	}
	else if (ns){ // Netscape 4
	documentWidth=window.innerWidth/2+window.pageXOffset-(600/2);
	documentHeight=window.innerHeight/2+window.pageYOffset-(400/2);
	}
	else if (w3){ // Netscape 6&7
	documentWidth=self.innerWidth/2+window.pageXOffset-(600/2);
	documentHeight=self.innerHeight/2+window.pageYOffset-(400/2);
	}
	adDiv.left=documentWidth+calunit;
	adDiv.top =documentHeight+calunit;
	setTimeout("showAd()",100);
	}else closeAd();
}
function closeAd(){
if (ie||w3) {
adDiv.display="none";
} else {
adDiv.visibility ="hide";
}
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

initAd();




