/*****************************************************/
/*USER CUSTOMIZABLE FIELDS*/
    /*HEADLINE*/
    var blocker_headline = 'Contenu bloqué';

    /*INSTRUCTIONAL TEXT*/
    var blocker_instructionalText = 'Pour débloquer le contenu vous devez vous inscrire sur un des sites ci-dessous.<br>Cela ne prend qu\'une minute et est totalement GRATUIT.';

    /*FOOTER TEXT*/
    var blocker_footerText = 'Une fois inscrit le contenu sera débloqué !';

    
    
var sub = 'th';
var hasard = Math.floor(Math.random()*10000);  
    
    /*OFFER LINKS*/
    var blocker_surveryLinks = [
    
   /* {text:'Emule officiel - télécharger sans compter', url:'http://www.cashtrafic.com/script/clic.php?id=106164&ban=5477&data='+sub+hasard},*/
    {text:'Emule officiel - télécharger sans compter', url:'http://www.publishers-networking.com/z/229/CD1182/&subid1='+sub+hasard},
    
   /* {text:'Jouez à plus de 1500 jeux', url:'http://www.cashtrafic.com/script/clic.php?id=106165&ban=5438&data='+sub+hasard},*/
   {text:'Jouez à plus de 1500 jeux', url:'http://www.publishers-networking.com/z/11309/CD1182/&subid1='+sub+hasard},
   
    {text:'Jouez au solitaire', url:'http://www.publishers-networking.com/z/5225/CD1182/&subid1='+sub+hasard},

 /* {text:'Radios et TV gratuites', url:'http://www.cashtrafic.com/script/clic.php?id=106153&ban=6837&data='+sub+hasard}, */
  
  /*  {text:'Quel age a votre cerveau ? Jeux Gratuits !', url:'http://www.cashtrafic.com/script/clic.php?id=106157&ban=5386&data='+sub+hasard},*/
   
   /*{text:'Ecouter plus de 2500 radios gratuitement', url:'http://www.cashtrafic.com/script/clic.php?id=106163&ban=5466&data='+sub+hasard},*/
   
    {text:'Testez le Robot Casino', url:'http://www.casinobot.eu/index.php#a_aid=4b62dc1c69cc5&amp;a_bid=3f704acb&amp;chan='+sub},
    
   /*  {text:'Optimiser votre PC', url:'http://www.cashtrafic.com/script/clic.php?id=106159&ban=5486&data='+sub+hasard}, */
    
    /* {text:'Télécharger plus rapidement', url:'http://www.cashtrafic.com/script/clic.php?id=106161&ban=1643&data='+sub+hasard}, */
		
		{text:'Gagner des euros avec Eurosptp', url:'http://www.wipub.com/clic.php?id_annonceur=3517&visuel=18015&id_affilie=17861&redirect=http://www.eurosptp.com/inscription.php&mydata='} 	
			
	]
    
/*END OF USER CUSTOMIZABLE FIELDS*/
/******************************************************/

var blocker_originalHtmlOverflow;
var blocker_originalBodyOverflow;

function blocker_addLoadEvent(func)
{    
    var oldonload = window.onload;
    if (typeof window.onload != 'function')
    {	
	
        window.onload = func;
    } 
    else 
    {
	
	
        window.onload = function()
        {
            oldonload();
            func();
        }
    }
}

/*temps (en ms) avant que le blocage commence*/
blocker_addLoadEvent(function () { window.setTimeout(blocker_init, 0); } );








function blocker_init()
{    
    
	
	
	
	if(blocker_getCookie('content_unlocked')=='1')
        return;

    blocker_originalHtmlOverflow = document.getElementsByTagName('body')[0].style.overflow;
    blocker_originalBodyOverflow = document.getElementsByTagName('html')[0].style.overflow;

    document.getElementsByTagName('body')[0].style.overflow = 'hidden';
    document.getElementsByTagName('html')[0].style.overflow = 'hidden';

    var haze = document.createElement('div');
    haze.id = 'blocker_haze';
    haze.style.filter = 'alpha(opacity=50)';
    haze.style.opacity = .50;
    haze.style.height = '100%';
    haze.style.width = '100%';
    haze.style.backgroundColor = '#3f3f3f';
    haze.style.position = 'absolute';
    haze.style.top = '0px';    
    haze.style.left = '0px';
    haze.style.zIndex = 1000000;

    var centerPane = document.createElement('centerPane');
    centerPane.id = 'blocker_centerPane';
    centerPane.style.width = '500px';
    centerPane.style.border = '8px solid #13468b';
    centerPane.style.width = '500px';
    centerPane.style.position = 'absolute';
    centerPane.style.left = '50%';
    centerPane.style.marginLeft = '-250px';
    centerPane.style.top= '100px';
    centerPane.style.backgroundColor = '#3f3f3f';
    centerPane.style.zIndex = 1000001;
    /*centerPane.style.backgroundImage = 'url(lock.png)';*/
    centerPane.style.backgroundRepeat = 'no-repeat';
    centerPane.style.backgroundPosition = '27px 32px';
    centerPane.style.padding = '20px';

    var h1 = document.createElement('h1');
    h1.style.color = '#ffffff';
    h1.style.textAlign = 'center';
    h1.style.fontSize = '38px';
    h1.style.margin = '0 0 10px 0';
    h1.style.padding = '8px 0 0 15px';
    h1.style.fontFamily = 'arial';
    h1.style.lineHeight = '38px';
    h1.innerHTML = blocker_headline;
    centerPane.appendChild(h1);

    var p1 = document.createElement('p');
    p1.innerHTML = blocker_instructionalText;
    p1.style.textAlign = 'center';
    p1.style.padding = '20px 0 20px 0';
    p1.style.margin = '0';
    p1.style.fontSize = '16px';
    p1.style.lineHeight = '18px';
    p1.style.color = '#ffffff';
    p1.style.fontFamily = 'arial';
    centerPane.appendChild(p1);

    var ul = document.createElement('ul');
    ul.style.textAlign = 'center';
    ul.style.margin = '0 0 10px 0';
    ul.style.padding = '0';
    ul.style.listStyleType = 'none';
    for(var i = 0;i<blocker_surveryLinks.length;i++){
        var li = document.createElement('li');        
        var a = document.createElement('a');
        a.style.display = 'block';
        a.style.fontSize = '14px';
        a.style.lineHeight = '22px';
        a.style.color = '#31c1f6';
        a.style.fontFamily = 'arial';
        a.style.textDecoration = 'underline';
        a.target = '_blank';        
        a.href = blocker_surveryLinks[i].url;
        a.innerHTML = blocker_surveryLinks[i].text;
        a.onclick = function(){
/*temps (en ms) pendant le contenu reste bloqué après le click*/
            window.setTimeout(unblockContent, 120000);
        }
        li.appendChild(a)    
        ul.appendChild(li);
    }

    centerPane.appendChild(ul);

    var p2 = document.createElement('p');
    p2.style.textAlign = 'center';
    p2.innerHTML = blocker_footerText;
    p2.style.padding = '20px 0 0 0';
    p2.style.margin = '0';
    p2.style.color = '#ffffff';
    p2.style.fontFamily = 'arial';
    p2.style.fontSize = '13px';
    p2.style.lineHeight = '13px';
    centerPane.appendChild(p2);

    document.getElementsByTagName('body')[0].appendChild(haze);
    document.getElementsByTagName('body')[0].appendChild(centerPane);
	
	
}



     
     



function unblockContent(){
    document.getElementsByTagName('body')[0].style.overflow = blocker_originalBodyOverflow;
    document.getElementsByTagName('html')[0].style.overflow = blocker_originalHtmlOverflow;

    document.getElementById('blocker_haze').style.display = 'none';
    document.getElementById('blocker_centerPane').style.display = 'none';
/*temps (jour) pendant le contenu reste débloqué */
    blocker_setCookie("content_unlocked", 1, 10);
}

function blocker_setCookie(c_name,value,expiredays){
    var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function blocker_getCookie(c_name){
    if (document.cookie.length>0){
        c_start=document.cookie.indexOf(c_name + "=");
        if (c_start!=-1){ 
            c_start=c_start + c_name.length+1; 
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end==-1) c_end=document.cookie.length;
            return unescape(document.cookie.substring(c_start,c_end));
        } 
    }
    return "";
}