// Visit http://www.mikenew.net/downloads/scripts.asp for more scripts.
// by Mike New, with special thanks to
// Jeff Phillips of http://classadrivers.com, for some good mods
// If you use this script, or make it better, I'd love to see it in action! webmaster@mikenew.net

// Begin. Specify URLs to randomly select from and pop-under. Add or take away freely.
var popunder=new Array();
popunder[0] = "http://www.newzy.fr/";

// Specify the width and height of new popunder window (in pixels).
var width = '1050';
var height = '800';

var p = 'scrollbars=yes,resizable=yes,toolbar=yes,' + //these are obvious variables. set "yes" or "no".
'menubar=yes,status=yes,location=yes,left=0,top=0,height=' + //the location on the user's screen
height + ',width=' + width+',fullscreen=yes';

// Load new PopUnder only once per browser session? (0=no, 1=yes)
// Putting 0 will cause the Popunder to load every time page is loaded
// Specifying 1 will cause it to load only once per session
var one_time=1;

// That's it! Don't edit the code below unless you're really good. :-P //
function ScanCookie(variable)
	{
	cook = document.cookie;
	variable += "=";
	place = cook.indexOf(variable,0);
	if (place <= -1)
		return("0");
	else
		{
		end = cook.indexOf(";",place)
		if (end <= -1)
			return(unescape(cook.substring(place+variable.length,cook.length)));
		else
			return(unescape(cook.substring(place+variable.length,end)));
		}
	}

function CreationCookie(nom,valeur,permanent)
	{
	if(permanent)
		{
		dateExp = new Date(2020,11,11);
		dateExp = dateExp.toGMTString();
		ifpermanent = '; expires=' + dateExp + ';';
		}
	else {
	dateExp = new Date();
	dateExp.setDate(dateExp.getDate() + 7);
	dateExp = dateExp.toGMTString();
		ifpermanent = '; expires=' + dateExp + ';';
		}
	document.cookie = nom + '=' + escape(valeur) + ifpermanent;
	}
	

function loadornot(){
    if (ScanCookie("popunder")==0){
        load_pop_power();
        CreationCookie("popunder",1,false);
    }
}
function load_pop_power(){
    win2=window.open(popunder[0],"bw",p);
    win2.blur();
    window.focus();
}
