function cacherCategories() {
	for (i=0; i<document.getElementsByTagName("li").length; i++)
		if (document.getElementsByTagName("li").item(i).className == 'nonimportant')
			document.getElementsByTagName("li").item(i).style.display = 'none';
}
function afficherCategories() {
	for (i=0; i<document.getElementsByTagName('li').length; i++)
		if (document.getElementsByTagName('li').item(i).className == 'nonimportant')
			document.getElementsByTagName('li').item(i).style.display = 'inline';
	document.getElementById('afficherCategories').style.display = 'none';
}
function formulaire(page, largeur, hauteur) {
	gauche = (screen.availWidth - largeur) / 2;
	haut = (screen.availHeight - hauteur) / 2;
	win = window.open(page, '_blank', 'menubar=0,scrollbars=0,toolbar=0,location=0,resizable=1,directories=0,top='+haut+',left='+gauche+',width='+largeur+',height='+hauteur);
	win.focus();
	return false;
}
function rechercheCookie(variable) {
	cookies = document.cookie;
	variable += '=';
	place = cookies.indexOf(variable, 0);
	if (place <= -1) {
		return 0;
	} else {
		fin = cookies.indexOf(';', place)
		if (fin <= -1)
			return unescape(cookies.substring(place+variable.length, cookies.length));
		else
			return unescape(cookies.substring(place+variable.length, fin));
	}
}
function creationCookie(nom, valeur, permanent) {
	if (permanent) {
		dateExpiration = new Date(2015, 1, 1);
		dateExpiration = dateExpiration.toGMTString();
		valeurExpiration = '; expires='+dateExpiration;
	} else {
		valeurExpiration = '';
	}
	document.cookie = nom+'='+escape(valeur)+valeurExpiration+'; path=/';
}
function Entrer()
{
	creationCookie('disclaimer', 1, false);
	if (document.getElementById)
		document.getElementById("disclaimer").style.display='none'
	 top.location.href = location.href;
}
if (navigator.cookieEnabled) {
	if (!rechercheCookie('disclaimer')) {
		document.write('<style>');
		document.write('div#disclaimer-fond{position:absolute;z-index:1000;width:100%;height:2650px;background:white;-moz-opacity:0.95;opacity:0.95;filter:alpha(opacity=95);text-align:center;clear:both;}');
		document.write('div#disclaimer-conteneur{position:absolute;z-index:1001;width:100%;clear:both;}');
		document.write('div#disclaimer-cadre{background-color:#fde5f8;box-shadow: 0 0 65px #fff inset, 0 0 20px #fd42f8 inset, 0 0 5px #333;width:530px;margin:auto;color:black;font-size:13px;text-align:center;margin-top:200px;padding:30px;border-radius:12px / 105px;}');
		document.write('div#disclaimer-cadre h1{font-size:14px;background-color:#fd9bf8;padding:5px}');
		document.write('div#disclaimer-cadre p{text-align:justify;margin:20px 0;}');
		document.write('div#disclaimer-cadre #choix a{margin:auto 0;text-decoration:none;font-weight:bold;color:black;}');
		document.write('div#disclaimer-cadre #choix a#entrer{font-size:25px;}');
		document.write('div#disclaimer-cadre #postScriptum{font-size:14px;font-weight:bold;text-transform:uppercase;color:#fd60f8;margin:20px 0;}');
		document.write('div#disclaimer-cadre #contacterSupport{margin:0;}');
		document.write('div#disclaimer-cadre #contacterSupport span{cursor:pointer;text-decoration:underline;}');
		document.write('embed,object,select,iframe{display:none;visibility:hidden}');
		document.write('</style>');
		document.write('<!--[if lte IE 8]><style>');
		document.write('div#disclaimer-cadre{border:2px #fd9bf8 solid}');
		document.write('</style><![endif]-->');
		document.write('<div id="disclaimer"><div id="disclaimer-fond"></div><div id="disclaimer-conteneur"><div id="disclaimer-cadre">');
		document.write('<h1>ATTENTION: CONTENU STRICTEMENT RÉSÉRVÉ AUX ADULTES</h1>');
		document.write('<p>Le contenu de ce site ne convient pas à un public mineur. Les photos, vidéos, et textes pornographiques disponibles ici peuvent choquer certaines sensibilités. En entrant, vous déclarez prendre vos responsabilités vis-à-vis de ce contenu.</p>');
		document.write('<div id="choix"><a id="entrer" href="#" onclick="Entrer();">ENTRER</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://google.com">SORTIR</a></div>');
		document.write('<div id="postScriptum">Site garanti SANS publicité ou redirection abusive</div>');
		document.write('<div id="contacterSupport">Contact / Aide : <span onclick="javascript: contacterSupport();">'+emailSupport+'</span> (7j/7)</div>');
		document.write('</div></div></div>');
	}
}
function contacterSupport() {
	location.href = 'mailto:'+emailSupport;
}
function verifierCode(code, sponsor, film) {
	var codeValide = /^[A-Z0-9]{8}$/i;
	if (!codeValide.test(code)) {
		var msg = "Veuillez entrer un code valide pour accéder au téléchargement.\n\n"
		        + "En cas de problème, contactez-nous à "+emailSupport+"\n\n"
		        + "Merci pour votre compréhension."
		alert(msg);
		return false;
	} else {
		switch (sponsor) {
			case 'IV': prixMoyen = 0x50/100; break;
			case 'TD': prixMoyen = 0x50/100; break;
		}
		codeProduit = sponsor+film;
		if (rechercheCookie('dernierAchat') != codeProduit) {
			creationCookie('dernierAchat', codeProduit, true);
			transaction = Math.ceil(Math.random() * 10000000);
			pageTracker._addTrans(transaction, '', prixMoyen, '', '', '', '', '');
			pageTracker._addItem(transaction, codeProduit, 'Film', '', prixMoyen, '1');
			pageTracker._trackTrans();
		}
	}
	return true;
}
function changerImage(image) {
	document.getElementById('imageVendeuse').src = image;
}

