
function disclaimer(){if(getCookie('checkAge')=="1")return;else{var body=$('body')[0];div=document.createElement("div");div.setAttribute("id","overlay");body.appendChild(div);div.className="overlay";div=document.createElement("div");div.setAttribute("id","disclaimer");div.className="disclaimer";body.appendChild(div);if(url_disclaimer!="")target="_blank";else target="_self";$("#disclaimer").html("<div class='disclaimerClose'><a href=\"javascript:closeDisclaimer();\"><img src='"+url_site+"/img/disclaimer_close.gif' width='94' heiht='48' alt='Fermer'></a></div><div class='disclaimerOpen'><a href=\"#\" onclick=\"openDisclaimer();\"><img src='"+url_site+"/img/disclaimer_open.gif' width='94' heiht='48' alt='Entrer' title='Entrer'></a></div>");}
return false;}
function openDisclaimer(){setCookie("checkAge");var elm=document.getElementById("disclaimer");elm.parentNode.removeChild(elm);var elm=document.getElementById("overlay");elm.parentNode.removeChild(elm);if(url_disclaimer!="")openSiteDiclaimer();}
function openSiteDiclaimer1(){window.open(url_disclaimer,'_blank',"top=10, left=10, width=700, height=500, scrollbars=1, resizable=1, toolbar=1, location=1, menubar=1, status=1, directories=1").focus;}
function openSiteDiclaimer(){var url=url_disclaimer;var width=700;var height=500;var c=document.createElement("div");c.innerHTML="<!--[if IE]><![endif]-->";IsIE=c.innerHTML.length==0?true:false;PopWin=self.window.open("about:blank","rand_"+Math.floor(89999999*Math.random()+10000000),"toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width="+width+",height="+height+"");if(PopWin){PopWin.blur();PopWin.Init=function(e){with(e){this.Params=e.Params;this.Main=function(){if(typeof window.mozPaintCount!="undefined"){var x=this.window.open("about:blank");x.close();}var a=this.Params.PopURL;try{opener.window.focus();}catch(err){}window.location=a;};this.Main();}};PopWin.Params={PopURL:url};PopWin.Init(PopWin);}
return PopWin;};function closeDisclaimer(){window.location.replace(url_exit);}
function validSuppr(theForm){var chaine="Supprimer définitive ?";return(confirm(chaine));}
function showPlayer(id,flv,file,width,height){var vid=new SWFObject(url_site+"/player/player.swf","player"+id,width,height,"8");vid.useExpressInstall(url_site+"/player/expressinstall.swf");vid.addParam("allowscriptaccess","always");vid.addParam("allowfullscreen","true");vid.addParam("wmode","transparent");vid.addParam("flashvars","file="+flv+"&image="+file+"&overstretch=false&autostart=1");vid.write(id);}
function showVideoDay(id,xml,width,height){file=url_site+"/"+xml;var vid=new SWFObject(url_site+"/player/player.swf","player"+id,width,height,"8");vid.useExpressInstall(url_site+"/player/expressinstall.swf");vid.addParam("allowscriptaccess","always");vid.addParam("allowfullscreen","true");vid.addVariable("width",width);vid.addVariable("height",height);vid.addVariable("file",file);vid.addVariable("bufferlength","1");vid.addVariable("displaywidth",width);vid.addVariable("displayheight",height);vid.addVariable("autostart","true");vid.addVariable("shownavigation","true");vid.addVariable("javascriptid",id);vid.addVariable("enablejs","true");vid.addVariable("linkfromdisplay","true");vid.addVariable("linktarget","_blank")
vid.addVariable("shuffle","false");vid.addVariable("repeat","list");vid.write(id);}
function addToFavorites(anchor){if(window.external){window.external.AddFavorite(anchor.getAttribute('href'),anchor.getAttribute('title'));}}
function popup(url,nom,h,l,scroll,top){var PosX=(screen.availWidth-h)/2;var PosY=(screen.availHeight-l)/2;if(top==1){PosX=1;PosY=1;}
var option="resizable=yes,location=no,menubar=no,scrollbars="+scroll+",status=no,directories=no,top="+PosY+",left="+PosX+",width="+h+",height="+l;win=window.open(url,nom,option);if(window.focus)win.window.focus();}
function popUpExterne(url){window.open(url,"Site porno","width=300, height=400, resizable=yes, scrollbars=yes");}
function setCookie(name,value,expires,path,domain,secure){if(expires==undefined){var expires=new Date();expires.setTime(expires.getTime()+(24*3600*1000));}
if(path==undefined)path="/";document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");}
function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}
else{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));}
function openDvdImg(url){var win=window.open(url,'popdvd',"top=140, left=140, width=380, height=520, scrollbars=1, resizable=1, toolbar=1, location=1, menubar=1, status=1, directories=1");if(window.focus){win.focus()};}
function countClick(id){$.ajax({url:url_site+"/server.php",data:"action=countIn&id="+id,cache:false,success:function(html){}});}
function fullscreen(url,id,direct){params='width='+screen.width;params+=', height='+screen.height;params+=', top=0, left=0';params+=', location=yes';params+=', resizable=yes';params+=', menubar=yes';params+=', toolbar=yes';params+=', scrollbars=yes';params+=', status=yes';if(direct==undefined){newwin=window.open(url,'',params);}
else{newwin=window.open(url_site+'/telecharger.php?'+url,'',params);}
if(window.focus){newwin.focus()}}
var divw=0;var divh=0;function initInfoBulle(id){div=document.createElement("div");div.setAttribute("id",id);div.style.display='none';var body=document.getElementsByTagName('body')[0];body.appendChild(div);}
function URLdecode(psEncodeString){var lsRegExp=/\+/g;return unescape(String(psEncodeString).replace(lsRegExp," "));}
function truebody(){return(!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function followmouse(e){var docwidth=document.all?truebody().scrollLeft+truebody().clientWidth:pageXOffset+window.innerWidth-15
var docheight=document.all?Math.min(truebody().scrollHeight,truebody().clientHeight):Math.min(document.body.offsetHeight,window.innerHeight)
if(typeof e!="undefined")
{if(docwidth<15+e.pageX+divw)
xcoord=e.pageX-divw-5;else
xcoord=15+e.pageX;if(docheight<15+e.pageY+divh)
ycoord=15+e.pageY-Math.max(0,(divh+e.pageY-docheight-truebody().scrollTop-30));else
ycoord=15+e.pageY;}
else if(typeof window.event!="undefined")
{if(docwidth<15+truebody().scrollLeft+event.clientX+divw)
xcoord=truebody().scrollLeft-5+event.clientX-divw;else
xcoord=truebody().scrollLeft+15+event.clientX;if(docheight<15+truebody().scrollTop+event.clientY+divh)
ycoord=15+truebody().scrollTop+event.clientY-Math.max(0,(divh+event.clientY-docheight-30));else
ycoord=truebody().scrollTop+15+event.clientY;}
$("#infoBulle").css({left:xcoord});$("#infoBulle").css({top:ycoord});}
function bulleOff(){if($("infoBulle")!=null){$("#infoBulle").html="";document.onmousemove='';$("#infoBulle").css({display:"none"});}}
function bulleOn(url,nom,desc){if($("infoBulle")!=null){$("#infoBulle").toggle();$("#infoBulle").css({left:-500});data="<img src='"+url+"'><br><strong>"+nom+"</strong><p>"+desc+"</p>";$('#infoBulle').html(data);divw=parseInt(270);divh=parseInt(250);document.onmousemove=followmouse;}}
var idTimer="";var images=new Array();function animeThumb(i,thumb,id,total){if(i>=total)i=0;document.getElementById(thumb).src=images[id][i].src;idTimer=setTimeout("animeThumb("+(i+1)+", '"+thumb+"', '"+id+"', '"+total+"')",800);}
function startRot(thumb,total){rep="cache";if(total==undefined)total=10;var id=thumb.replace("thumb_","");if(images[id]==null){images[id]=new Array(total);for(var j=0;j<total;j++){images[id][j]=new Image();images[id][j].src=""+url_site+"/"+rep+"/"+id+"_"+(j+1)+".jpg";}}
animeThumb(0,thumb,id,total);}
function endRot(){clearTimeout(idTimer);}
$(document).ready(function(){initInfoBulle("infoBulle");$('a[href*=#body]').click(function(){$('html').animate({scrollTop:0},'slow');return false;})
$("#body").click(function(){if(getCookie('partenaire')==null&&url_pop_up!=""){var win=window.open(url_pop_up+"?referer="+nom_site,'_blank',"top=140, left=140, width=700, height=500, scrollbars=1, resizable=1, toolbar=1, location=1, menubar=1, status=1, directories=1");win.blur();window.focus();setCookie('partenaire',1);return true;}})
$(".thumb").mouseover(function(){img=$(this).find("a").attr("rel");cat=$(this).find("a").attr("title");desc=$(this).find("img").attr("alt");if(cat==""||img=="")return;else bulleOn(img,cat,'');})
$(".thumb").mouseout(function(){bulleOff();})
$("#amateur").click(function(){return true;})
$("#newsletter").click(function(){popup(url_newsletter,"Newsletter",600,230,0,0);return false;})
$('a[rel=external]').attr('target','_blank');});
