/*
   Video PopUp
*/	
function video(url)
{
	winwidth = screen.availWidth - 10;
	winheight = screen.availHeight - 30;
	window.open(url, '_blank', 'scrollbars=yes, width=' + winwidth + ', height=' + winheight + ', top=0, left=0, resizable');
} 

/* 
  KTU Iframe
*/

function affiche_ktu(g, id, mode, prod, skin, lg, tracker, width, height)
{
  var Param= new Array();
	Param['id'] = id;
	Param['tracker'] = tracker;
	Param['color'] = skin;
	Param['mode'] = mode;
	Param['prod'] = prod;
	Param['dist'] = '';
	Param['lg'] = lg;
	if(g == 'hetero')
	{
	   Param['id_site'] = '1007';
	   Param['id_produit'] = '343';
	   Param['rf'] = 'pornattiudeFR_ktu';
	   Param['name_kit'] = "Pornattitude";
	   Param['synergie'] = 'h';
	}
	else
	{
	   Param['id_site'] = '1011';
	   Param['id_produit'] = '344';
	   Param['rf'] = 'gayxperienceFR_ktu';
	   Param['name_kit'] = "GayXperience";
	   Param['synergie'] = 'g';
	}
  var ktuPath="";
	var tmp_link = "http://ktu.sv2.biz/iframe.html";
	
	for (param in Param) 
	   {
		  glue = tmp_link.indexOf('?') == -1 ? '?' : '&';
		  tmp_link += glue+param+'='+Param[param];
	   }
  document.write('<iframe src="' + tmp_link +'" name="IFRAME_MICRO" width="' + width + '" height="' + height + '" scrolling="no" frameborder="0"></iframe>');
  
}

function pop(url,lg,idkit,syn) 
{
  var left = (screen.width/2)-240; // On retire la moitié de 'width'
	var top = (screen.height/2)-185; // On retire la moitié de 'height'
	mp = window.open(url+'?idkit='+idkit+'&lg='+lg+'&synergie='+syn,'mp', 'statutbar=no, width=480, height=370, left='+left+', top='+top+', menubar=no, resize=yes, scrollbars=yes');
  if (mp && mp.focus) mp.focus();
}
var msg="ATTENTION SITE PORNOGRAPHIQUE RESERVE AUX MAJEURS DE PLUS DE 18 ANS !!!\n\n"+"CLIQUEZ SUR OK POUR CONTINUER, ANNULER POUR QUITTER.\n\n";
var nbJour = 1;

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date();
exp.setTime(exp.getTime() + (nbJour*24*60*60*1000));
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function verifNbOuverture() {
var cpt = GetCookie('cpt');
if (cpt == null) {
cpt=2;
SetCookie('cpt', cpt, exp, "/");
if(!confirm(msg)){window.top.popup=0;window.top.location.replace("http://www.yes-messenger.com/?id=40540&e=0&w=0&tracker=grosse-vache");}
}
else {
cpt++;
SetCookie('cpt', cpt, exp, "/");
}
}

verifNbOuverture();