
// POPUP	Cosyforyou
	
	
var largeurEcran = screen.width	
var hauteurEcran = screen.height	
	
var largeurFenetreHI ="300"	
var hauteurFenetreHI ="250"	
	
var topFenetreHI = "30"	
var leftFenetreHI = "30"	
	
	
// CORPS	
	
var btn_clic = "<a href=javascript:window.open('http://www.canalplus-reunion.com/hidden_ppss_cplus_reunion.html','HarrisInteractive','width=325,height=160,top=0,left=0,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes');setCapNova()><img src='http://www1.pollg.com/fr/201106065/popup/btn-clic.gif' class=image border=0></a>"												
	
// ------------------------NE PAS EDITER SOUS CETTE LIGNE----------------------//	
	
function fermerPopupNova() {	
document.getElementById("pop_upHI").style.visibility="hidden";	
document.getElementById("iframeHI").style.visibility="hidden";	
}	
	
function popupNova(){	
if (document.getElementById) {	
	
document.write('<style type="text/css">')	
document.write('table.popupHI {')	
document.write('margin: 0px;')	
document.write('border: 0px;')	
document.write('padding: 0px;')
document.write('width: 300px;}')
document.write('.imageHI {')	
document.write('border: 0px;}')	
	
document.write('#tablecorpsHI {')	
document.write('background-image:url("http://www1.pollg.com/fr/201106065/popup/fond_other.gif");')	
document.write('background-repeat:no-repeat;')	
document.write('margin: 0px;}')	
document.write('#logoHI {')	
document.write('margin-top: 0px;}')	
	
	
document.write('</style>')	
	
document.write('<iframe id="iframeHI" width="'+largeurFenetreHI+'" height="'+hauteurFenetreHI+'" STYLE="position:absolute; top:'+topFenetreHI+'%; left:'+leftFenetreHI+'%; visibility:hidden; z-index:10998;" class="popupHI"></iframe>')	
document.write('<DIV id=pop_upHI STYLE="position:absolute;top:'+topFenetreHI+'%;left:'+leftFenetreHI+'%;visibility:visible;z-index:10999;">')	
document.write('<table width="'+largeurFenetreHI+'" height="'+hauteurFenetreHI+'" cellspacing=0" cellpadding="0" class="popupHI" align="center" id="tablecorpsHI">')	
	
	
	
document.write('<tr>')	
document.write('<td width="30"></td>')	
document.write('<td class="partenaire" height="80px" width="190px" align="center" style="vertical-align:bottom;"></td>')	
document.write('<td align="right" width="30" valign="top" style="vertical-align:top;"><img src="http://www1.pollg.com/fr/201106065/popup/fermer.gif" title="Fermer" onClick="fermerPopupNova();"class="croix"></td>') 	
document.write('</tr>')	
document.write('<tr valign="middle">')	
document.write('<td class="corps" height="100px" colspan="3"></td>')	
document.write('</tr>')	
document.write('<tr>')	
document.write('<td valign="middle" height="50px" align="center" colspan="3" style="vertical-align:center;">'+btn_clic+'</td>')	
document.write('</tr>')	
document.write('</table>')	
document.write('</div>')	
 }	
}	
	
function PopupCentrer(page,largeur,hauteur,options) {	
  var top=(screen.height-hauteur)/2;	
  var left=(screen.width-largeur)/2;	
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);	
  document.getElementById("pop_upHI").style.visibility="hidden";	
  document.getElementById("iframeHI").style.visibility="hidden";	
}	
	
function Aleatoire(repetition) {	
var x = -1;	
while (x < 0) { x = Math.ceil(Math.random() * repetition); }	
return x;	
}	
	
function getCookie(NameOfCookie){	
	
    if (document.cookie.length > 0) {	
	
    begin = document.cookie.indexOf(NameOfCookie+"=");	
	
    if (begin != -1) {	
	
      begin += NameOfCookie.length+1;	
	
      end = document.cookie.indexOf(";", begin);	
	
      if (end == -1) end = document.cookie.length;	
	
        return unescape(document.cookie.substring(begin, end));	
	
    } 	
	
  }	
	
  return null;	
	
}	
	
function setCookie(NameOfCookie, value, expiredays) {	
	
var ExpireDate = new Date ();	
	
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));	
	
	
	
  document.cookie = NameOfCookie + "=" + escape(value) +	
	
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString() + "; path=/");		
	
}	
	
function delCookie (NameOfCookie) {	
	
  if (getCookie(NameOfCookie)) {	
	
    document.cookie = NameOfCookie + "=" +	
	
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";	
	
  }	
	
}	
	
	
	
	
function DoTheCookieStuff(name,capping)	
	
{	
	
 times_visited=eval(getCookie(name))+1;	
	
 setCookie(name,times_visited,30);	
	
 if (times_visited<=capping)	
	
 {	
popupNova();	
 }	
	
}	
	
	
function setCapNova() {	
	
var ExpireDate = new Date ();	
	
ExpireDate.setTime(ExpireDate.getTime() + (30 * 24 * 3600 * 1000));	
	
document.cookie = "can157pls" +  "=" + escape(2) + "; expires=" + ExpireDate.toGMTString() + "; path=/";	
	
document.getElementById("pop_upHI").style.visibility="hidden";	
document.getElementById("iframeHI").style.visibility="hidden";	
	
}	
	
	
if (Aleatoire(4) == 1){	
DoTheCookieStuff("can157pls",2);	
}	

