//*********************************************************          
//               RECUPERATION DES PARAMETRES
//*********************************************************          
var params = window.document.location.href.substr((window.document.location.href.indexOf("?")+1));
var tab_params = params.split("&");

for (i=0; i<tab_params.length;i++)
{
	tab_params[i] = tab_params[i].split("=");	
	if(tab_params[i][0] == 'l') { lang = tab_params[i][1]; }
	if(tab_params[i][0] == 'w') { w = tab_params[i][1]; }
}

//*********************************************************          
//              RECUPERATION DU NOM DU SERVEUR
//*********************************************************          
// Recupere l'URL en cours
var strStartingUrl = location.href;
// Extrait le protocole ( http:// )
var intUrlLength = strStartingUrl.length
var strParsedUrl = strStartingUrl.substring(7,intUrlLength);
// Extrait le nom du serveur
var regexpDot = /\./;
var regexpSlash = new RegExp("/");
var strCurrentServerIndex = strParsedUrl.search(regexpSlash);
var strCurrentServer = strParsedUrl.substring(0, strCurrentServerIndex);

var url_http = 'http://'+strCurrentServer+'/';
var url_coco = url_http+'liens_sexe.html';

if(!lang) { lang = "en"; }
if( ScanCookie("avertissement")==0 ) {
  warning(lang);
} else {
  // alert(url_http+' - '+window.top.location)
  if(window.top.location!=url_coco&&window.top.location!=url_http) window.top.location.replace(url_coco);
  // window.top.location.replace("/liens_sexe.html");
}

function warning(lang) {
	var msg  = new Array;
	msg['fr'] = "ATTENTION: SITE PORNOGRAPHIQUE RESERVE AUX MAJEURS DE PLUS DE 18 ANS\n\n" + 
"Ce site Internet est réservé à un public majeur et averti et est conforme\n" + 
"à toutes les règlementations françaises en vigueur. Il contient des textes,\n" + 
"des photos et des vidéos classées X qui peuvent être choquantes pour\n" + 
"certaines sensibilités. \n\n" + 
"CLIQUEZ SUR OK POUR CONTINUER, ANNULER POUR QUITTER.\n\n";
	msg['es'] = "ATENCIÓN: SITIO PORNOGRAFICO RESERVADO PARA MAYORES DE 18 AÑOS\n\n" + 
"Este sitio internet está reservado a un público mayor y conciente y está en conformidad\n" + 
"con todas las reglamentaciones francesas en vigor. Contiene textos,\n" + 
"fotos y videos clasificados X que pueden ser chocantes para\n" + 
"ciertas sensibilidades. \n\n" + 
"HAGA CLICK SOBRE OK PARA CONTINUAR,O ANULAR PARA ABANDONAR.\n\n";
	msg['it'] = "ATTENZIONE: SITO PORNOGRAFICO RISERVATO AD UN PUBBLICO MAGGIORENE DI PIU' DI 18 ANNI\n\n" + 
"Questo sito Internet é riservato ad un pubblico maggiorenne e consenziente ed é conforme\n" + 
"alla legislazione francese in vigore. Contiene dei testi,\n" + 
"delle foto e dei videos classificati X che possono urtare certe\n" + 
"sensibilità ed sopratutto vietato ai minori. \n\n" + 
"CLICCATE OK PER CONTINUARE, ANNULLA PER USCIRE.\n\n"
	msg['en'] = "WARNING: PORNOGRAPHIC WEBSITE--STRICTLY PROHIBITED TO ANYONE UNDER 18\n\n" + 
"This site is strictly reserved for a mature and cautioned audience as required\n" + 
"by current law. This site contains X rated text, photographic and video images\n" + 
"which might be found offensive.  \n\n" + 
"CLICK OK TO ENTER, CANCEL TO LEAVE.\n\n"; 
	msg['de'] = "ACHTUNG: PORNOGRAFISCHE WEBSEITE MINDERJÄHRIGEN STRENG VERBOTEN\n\n" +
"Diese Web-Site ist Ausschließlich für ein volljähriges Publikum bestimmt und ist nach\n" +
"den Richtlinien der derzeit gültigen französischen Gesetze gestaltet. Diese Webseite\n" +
"ist mit Texten und Fotografien aufgebaut. Diese Website hat einen eindeutig\n"+
"pornographischen Charakter und ist X- klassifiziert, daher kann sie von bestimmten\n" +
"Personengruppen als Abstoßend oder schockierend empfunden werden.\n\n" +
"BESTÄTIGEN SIE MIT OK, ABBRECHEN ZURUCK";
	// if (! confirm(msg[lang])) { error = 1; window.location = "http://www.google.fr/";}
	if (! confirm(msg[lang])) { window.top.popup=0; window.top.location.replace("http://www.google.fr/"); }
    else { CreationCookie("avertissement","oui",false); window.top.location.replace("/liens_sexe.html"); }
	// else { CreationCookie("avertissement","oui",false); window.top.location.replace("/annuaire/"); }
}

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 
    ifpermanent = ''; 
  document.cookie = nom + '=' + escape(valeur) + ifpermanent; 
}