var noteaser;
var noteaserHTML;
function display_video(player,fake)
{
	var txt;
	var theID = player;
	player = eval(player);
	var AutoStart="yes";
	var url_video=player['url'];
	var w;
	var h;
	if (player['format']=="56kb")  { 
		w=190;
		h=160;
	} else if (player['format']=="256kb") { 
		w=330;
		h=240;
	}
	else if (player['format']=="500kb") { 
		w=490;
		h=384;
	} else if (player['format']=="800kb") { 
		w=640;
		h=540;
	} else { 
		player['format']="256kb"; 
		w=330;
		h=240;
	}
	var img = "http://www.pornattitude.com/media/players/"+player['langue']+"/"+player['theme']+"/player-"+player['format']+".gif";
	if (noteaser=='1') fake=false;
	if (fake) {
		player['fake']=false;
		txt="<a href=\"javascript:display_video('"+theID+"',false);\">";
		txt+="<img src=\""+img+"\" border=0></a>";
		document.getElementById(theID).innerHTML=txt;
		return;
	} 

	var WMP7;

	txt = "";

	if ( navigator.appName != "Netscape" ) {   
		try  {  WMP7 = new ActiveXObject('WMPlayer.OCX'); }
		catch(e) {}
	}
	// Windows Media Player 7 Code
	if ( WMP7 )	{
		txt += '<OBJECT ID=MediaPlayer ';
		txt += ' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6';
		txt += ' standby="Loading Microsoft Windows Media Player components..."';
		txt += ' TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="url" VALUE="'+ url_video +'">';
		if (AutoStart=="yes") {
			txt += '<PARAM NAME="AutoStart" VALUE="true">';
		} else {
			txt += '<PARAM NAME="AutoStart" VALUE="false">';
		}
		txt += '<PARAM NAME="ShowControls" VALUE="1">';
		txt += '<PARAM NAME="uiMode" VALUE="mini">';
		txt += '</OBJECT>';
	}
	// Windows Media Player 6.4 Code
	else {
		//IE Code
		txt += '<OBJECT ID=MediaPlayer ';
		txt += 'CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
		txt += 'CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
		txt += 'standby="Loading Microsoft Windows Media Player components..." ';
		txt += 'TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="FileName" VALUE="'+ url_video +'">';
		if (AutoStart=="yes") {
			txt += '<PARAM NAME="AutoStart" VALUE="true">';
		} else {
			txt += '<PARAM NAME="AutoStart" VALUE="false">';
		}
		txt += '<PARAM NAME="ShowControls" VALUE="1">';
		//Netscape code
		txt += '    <Embed type="application/x-mplayer2"';
		txt += '        pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
		txt += '        filename="'+ url_video +'"';
		txt += '        src="'+ url_video +'"';
		txt += '        Name=MediaPlayer';
		if (AutoStart=="yes") {
			txt += '        Autostart=1';
		} else {
			txt += '        Autostart=0';
		}
		txt += '        ShowControls=1';
		txt += '        ShowDisplay=0';
		txt += '        ShowStatusBar=0';
		txt += '        width='+ w;
		txt += '        height='+ h +'>';
		txt += '    </embed>';
		txt += '</OBJECT>';
	}
	if (noteaser=='1') {
		document.getElementById(theID).innerHTML=noteaserHTML;
	} else {
		document.getElementById(theID).innerHTML=txt;
	}
}

/*
   Preview de la vidéo :
*/	
function PopPaiement(url)
{
  winwidth = screen.availWidth - 10;
	winheight = screen.availHeight - 30;
	window.open(url, '_blank', 'scrollbars=yes, width=' + winwidth + ', height=' + winheight + ', top=0, left=0, resizable');
} 

/*
   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>');
  
}


var cd_disclaimer = {
	'id':42855,
	'synergie':'hetero',
	'lg':'fr',
	'opacity':8,
	'tracker':'ex',
	'letter':'N',
	'noexit':1,
	'skin':11,
	'bgcolor':'#b33d7e',
	'showhost':1,
	'sortir':'http://www.yes-messenger.com/?id=42855&e=1&w=0'
}
var DHTMLpop = {};
var scrollDiff = 0;
var DHTMLpopVer = '1.07c';
var DHTMLpopTimer = new Array;
var DHTMLdebugMode = false;
var DHTMLpromoAddon = false;
var add_onload=function(func){
	var oldonload=window.onload;
	if (typeof(window.onload)!='function') { window.onload=func; } 
	else { window.onload=function(){ oldonload(); func(); }; }
};
function initDHTMLpop(Obj) 
{
	if (!Obj)
	{
		Obj = {};
		if (!Obj.autorun) Obj.autorun = true;
	}
	if (typeof(Obj.opacity)=="undefined") Obj.opacity = 6;
	if (!Obj.height) Obj.height	= 300;
	if (!Obj.width)	Obj.width = 500;
	if (!Obj.bgcolor) Obj.bgcolor = '#000000';
	if (!Obj.url) Obj.url = 'http://www.yes-messenger.com/?id=42855&e=1&w=0';
	DHTMLpop = Obj;
	if (DHTMLpop.autorun) showHideInnerPopUp();
	return DHTMLpop;
}
function runDHTMLpop(obj) { 
	obj.autorun=true; 
	DHTMLpop = initDHTMLpop(obj); 
	return false;
}
function debugDHTMLpop() {
	if (DHTMLdebugMode===false) return;
	var d = dimension_detect();
	var output = 
	' viewW='+d.viewW+' viewH='+d.viewH+' docH='+d.docH+' docW='+d.docW+
	' left='+d.left+' top='+d.top+' scrollDiff='+scrollDiff+'<hr>';
		output +='Ver : '+DHTMLpopVer;
		output +=' - Powered by JulienCD ;)';
	var bod = document.getElementsByTagName('body')[0];
	if (document.getElementById('debugSpan')) {
		document.getElementById('debugSpan').innerHTML=output;
	} else {
		var div = document.createElement('div');
		div.id = "debugSpan";
		div.style.position = "absolute";
		div.style.display="block";
		div.style.top="0px";
		div.style.width="500px";
		div.style.backgroundColor='lightgreen';
		div.style.zIndex=10000000;
		div.innerHTML = output;
		bod.appendChild(div);
	}
}
function alwaysInTop() {
	window.scrollTo(0,0);
	DHTMLpopTimer[0]=setTimeout("alwaysInTop()",1000);
}
function replaceInnerPopUp(width,height)
{
	window.scrollTo(0,0);
	if (width)	DHTMLpop.width = width;
	if (height) DHTMLpop.height = height;
	var d 		= dimension_detect();
	var newTop 	= (d.viewH-DHTMLpop.height)/2 ;
	var newLeft = (d.viewW-DHTMLpop.width)/2;
	// on repositionne le div au centre de la page
	var innerPopUp = document.getElementById("innerpopup_iframe");
	innerPopUp.allowTransparency = true;
	innerPopUp.style.top 	= parseInt(newTop)+"px";
	innerPopUp.style.left 	= parseInt(newLeft)+"px";
	innerPopUp.style.width 	= DHTMLpop.width+"px";
	innerPopUp.style.height = DHTMLpop.height+"px";
	// on réagrandit le background	
	if (document.body.style.overflow=='hidden' || document.body.style.overflow=='') {
		var back = document.getElementById("innerpopup_background");
		back.style.width = (d.docW>d.viewW)?d.docW+'px':d.viewW+'px';
		back.style.height = (d.docH>d.viewH)?d.docH+'px':d.viewH+'px';
		back.style.height = '5000px';
	} else {
		var back = document.getElementById("innerpopup_background");
		back.style.width = '1px';
		back.style.height = '1px';
	}
	scrollDiff = d.viewW-d.docW;
	if (scrollDiff<1) document.body.style.width=d.viewW+'px';
	if (DHTMLpop.debug) debugDHTMLpop();
};
function showHideInnerPopUp()
{
	if (document.getElementById("innerpopup_background")) {
		alwaysInTop();
		var back = document.getElementById("innerpopup_background");
	} else {
		window.status = "Back is undefined. Disclaimer is stopped.";
		return;
	}
	// On applique une opacité
	back.style.filter = 'alpha(opacity='+DHTMLpop.opacity*10+')';
	back.style.MozOpacity = DHTMLpop.opacity/100;
	back.style.KHTMLOpacity = DHTMLpop.opacity/100;
	back.style.opacity = DHTMLpop.opacity/10;

	// Chargement du contenu de l'iframe
	var innerpopup_iframe = document.getElementById("innerpopup_iframe");
	frames['innerpopup_iframe'].location.href = DHTMLpop.url;
	innerpopup_iframe.style.width=DHTMLpop.width+'px';
	innerpopup_iframe.style.height=DHTMLpop.height+'px';

	// On vérifie l'etat de l'innerPopUp pour determiner si on doit l'afficher ou la cacher
	var innerpopup = document.getElementById("innerpopup");
	// si caché on affiche
	if (innerpopup.style.visibility == 'hidden' || DHTMLpop.showonly)
	{
		document.getElementById("innerpopup_background").style.backgroundColor=DHTMLpop.bgcolor;
		document.body.style.overflow = 'hidden';
		document.getElementsByTagName('html')[0].style.overflow = 'hidden';
		innerpopup.style.visibility = 'visible';
	// si affiché on cache
	} else {
		innerpopup.style.width='1px';
		document.body.style.overflow = 'auto';
		document.getElementsByTagName('html')[0].style.overflow = 'auto';
		innerpopup.style.visibility = 'hidden';
	}
	replaceInnerPopUp();
	DHTMLpopTimer[1]=setTimeout("replaceInnerPopUp()",200);
}
// Dimension_detect
function dimension_detect(){
	var d={'viewW':0,'viewH':0,'docH':0,'docW':0,'left':0,'top':0};
	if (document.body.scrollHeight>document.body.offsetHeight){
		d.docW=document.body.scrollWidth;
		d.docH=document.body.scrollHeight;
	} else {
		d.docW=document.body.offsetWidth;
		d.docH=document.body.offsetHeight;
	}
	if (self.innerWidth){
		d.viewW=self.innerWidth;
		d.viewH=self.innerHeight;
		d.left=window.pageXOffset;
		d.top=window.pageYOffset;
	} else {
		var ie=(document.compatMode&&document.compatMode!='BackCompat')?document.documentElement:document.body;
		d.viewW=ie.clientWidth;
		d.viewH=ie.clientHeight;
		d.left=ie.scrollLeft;
		d.top=ie.scrollTop;
	}
	return d;
};

/* Disclaimer Redirect version DHTML */

if (typeof cd_disclaimer == "undefined") var cd_disclaimer = {'id':10000,'synergie':'hetero','lg':'fr','opacity':9}

var DHTMLpopParam = {'width':564,'height':377,'url':'http://www.securitetotale.com/index.php?module=guest_pornattitude_disclaimer'};

if (!cd_disclaimer.id) cd_disclaimer.id=10000;
if (!cd_disclaimer.tracker) cd_disclaimer.tracker="";
if (!cd_disclaimer.synergie) cd_disclaimer.synergie="hetero";

DHTMLpopParam.url+='&id='+cd_disclaimer.id;
DHTMLpopParam.url+='&synergie='+cd_disclaimer.synergie;
DHTMLpopParam.url+='&tracker='+cd_disclaimer.tracker;
DHTMLpopParam.autorun=false;

if (typeof(cd_disclaimer.opacity)!="undefined") DHTMLpopParam.opacity = cd_disclaimer.opacity;
if (cd_disclaimer.lg) DHTMLpopParam.url+="&langue="+cd_disclaimer.lg;

if (cd_disclaimer.letter) {
	DHTMLpopParam.url+="&letter="+cd_disclaimer.letter;
} else if (typeof(cd_disclaimer.id_niche)!="undefined") {
	DHTMLpopParam.url+="&c="+cd_disclaimer.id_niche;
}
if (cd_disclaimer.dob) DHTMLpopParam.url+="&dob=1";
if (cd_disclaimer.id_site) DHTMLpopParam.url+="&id_site="+cd_disclaimer.id_site;
if (cd_disclaimer.bgcolor) DHTMLpopParam.bgcolor = cd_disclaimer.bgcolor;
if (cd_disclaimer.showhost) DHTMLpopParam.url+='&showhost=1';
if (cd_disclaimer.skin) DHTMLpopParam.url+="&skin="+cd_disclaimer.skin;
if (cd_disclaimer.noexit==1) DHTMLpopParam.url+="&noexit=1";
if (cd_disclaimer.post==1) DHTMLpopParam.url+="&post=1";
if (cd_disclaimer.sortir) DHTMLpopParam.url+="&sortir="+escape(cd_disclaimer.sortir);

if (cd_disclaimer.popunder==1) DHTMLpopParam.url+="&popunder=1";
if (cd_disclaimer.popover==1) DHTMLpopParam.url+="&popover=1";
if (cd_disclaimer.img) DHTMLpopParam.url+="&disclaimer_img="+escape(cd_disclaimer.img);
if (cd_disclaimer.popover==1 || cd_disclaimer.popunder==1) {
	var d = dimension_detect();
	DHTMLpopParam.url+="&viewH="+d.docH;
	DHTMLpopParam.url+="&viewW="+d.docW;
}
if (cd_disclaimer.exitcd) DHTMLpopParam.url+="&exitcd="+cd_disclaimer.exitcd;
if (cd_disclaimer.timer) DHTMLpopParam.url+="&timer="+cd_disclaimer.timer;
if (cd_disclaimer.debug) DHTMLpopParam.debug=1;
if (cd_disclaimer.dispromo) DHTMLpromoAddon=cd_disclaimer.dispromo;

// Carpe Diem Barre
if (typeof(cd_disclaimer.cdbar)=='object') {
	DHTMLpromoAddon = (cd_disclaimer.cdbar.type) ? cd_disclaimer.cdbar.type : 'all';
}

var exp = /(&|\?)(w|warning)=1/g;
if (exp.test(window.location)) {
	DHTMLpopParam.autorun=true;
	if (cd_disclaimer.post!=1) document.cookie = 'dhtmlclaimer=1;path=/;';
} else if (cd_disclaimer.preview==1) {
	DHTMLpopParam.autorun=true;
} else if (cd_disclaimer.preview===0) {
	DHTMLpopParam.autorun=false;
} else if (document.cookie.indexOf('dhtmlclaimer') == -1) { 
	document.cookie = 'dhtmlclaimer=1;path=/;'; 
	DHTMLpopParam.autorun=true;
}
// Disclaimer disable
var exp = /(&|\?)(w|warning)=0/g;
if (exp.test(window.location)) DHTMLpopParam.autorun=false;

// Promo add-on
var exp = /(&|\?)dispromo=0/g;
if (exp.test(window.location)) DHTMLpromoAddon='0';
var exp = /(&|\?)dispromo=1/g;
if (exp.test(window.location)) DHTMLpromoAddon='1';
var exp = /(&|\?)dispromo=2/g;
if (exp.test(window.location)) DHTMLpromoAddon='2';
var exp = /(&|\?)dispromo=3/g;
if (exp.test(window.location)) DHTMLpromoAddon='3';
var exp = /(&|\?)dispromo=all/g;
if (exp.test(window.location)) DHTMLpromoAddon='all';

// Show Debug
var exp = /(&|\?)debug=1/g;
if (exp.test(window.location)) DHTMLpopParam.debug=1;

// noexit option
var exp = /(&|\?)(noexit=1|e=0|md==19)/g;
if (exp.test(window.location)) DHTMLpopParam.url+="&noexit=1";

DHTMLpopParam.url+="&wparent="+escape(window.location);

document.write('<style type="text/css">');
document.write('#innerpopup_iframe { overflow:hidden; z-index:5000; position:absolute; top:0; left:0; border:0; }');
document.write('#innerpopup_background { z-index:4998; position:absolute; top:0; left:0; width:100%; height:100%; }');
if (DHTMLpopParam.autorun===true) {
	document.write('embed,object,select,#pop_up { display:none; visibility:hidden }');
}
document.write('</style>');
document.write('<div id="innerpopup" style="visibility:hidden;">');
document.write('	<div id="innerpopup_background">&nbsp;</div>');
document.write('	<iframe id="innerpopup_iframe" name="innerpopup_iframe" frameborder="0" scrolling="no" src="about:blank" style="width:5px;height:5px" autocomplete="Off"></iframe>');
document.write('</div>');

function ie6_fix_cdbar(string) {
	if (string=='100%') {
		return (document.compatMode&&document.compatMode!="BackCompat")?document.documentElement.clientWidth+"px":document.body.clientWidth+"px";
	}
	if (string=='top') {
		return (document.compatMode&&document.compatMode!="BackCompat")?document.documentElement.scrollTop+"px":document.body.scrollTop+"px";
	}
}

if (DHTMLpopParam.autorun===true) {
	if (document.cookie.indexOf('deja1vu') != -1)		document.cookie = 'deja1vu=0;path=/;';
	if (document.cookie.indexOf('yes_cookie') != -1)	document.cookie = 'yes_cookie=0;path=/;';
	if (document.cookie.indexOf('myko_cookie') != -1)	document.cookie = 'myko_cookie=0;path=/;';
	if (document.cookie.indexOf('dhtml_cookie') != -1)	document.cookie = 'dhtml_cookie=0;path=/;';
	if (document.cookie.indexOf('live_cookie') != -1)	document.cookie = 'live_cookie=0;path=/;';
	if (document.cookie.indexOf('jstools_mail') != -1)	document.cookie = 'jstools_mail=0;path=/;';
	if (document.cookie.indexOf('jstools_dhtml') != -1)	document.cookie = 'jstools_dhtml=0;path=/;';
} else {
	if (cd_disclaimer.lg && DHTMLpromoAddon!==false)	{ // if(cd_disclaimer.lg)
		if (typeof(cd_disclaimer.cdbar)=='object') { var cd_bar = cd_disclaimer.cdbar; } 
		else { var cd_bar = {}; }
		cd_bar.synergie = cd_disclaimer.synergie;
		cd_bar.type = DHTMLpromoAddon;
		cd_bar.lg = cd_disclaimer.lg;
		if (cd_bar.lg=='us') cd_bar.lg='en'; 
		cd_bar.id = cd_disclaimer.id;
		cd_bar.tracker = cd_disclaimer.tracker+'_DisRedir';
		document.write('<scr'+'ipt language="JavaScript" type="text/javascript" src="http://www.extrait-x.com/webmaster_cdbar.js"></scr'+'ipt>');
	}
}

var DHTMLdisclaimer = initDHTMLpop(DHTMLpopParam);

if (cd_disclaimer.uacct && DHTMLpopParam.autorun===true) {
	var _uacct = cd_disclaimer.uacct;
	urchinTracker("/disclaimer");
}

window.onresize=function(){
	var innerpopup = document.getElementById("innerpopup");
	if (innerpopup.style.visibility == 'hidden') return;
	var innerpopup_iframe = document.getElementById("innerpopup_iframe");
	replaceInnerPopUp( 
		parseInt(innerpopup_iframe.style.width,10), 
		parseInt(innerpopup_iframe.style.height,10) 
	);
};

/*
	Permet de cacher des Elements qui pourraient passer par dessus le disclaimer
	Use : cd_disclaimer.hide = new Array('pika','poke','pichu');
*/
add_onload(function(){
	if (typeof(cd_disclaimer.hide) == 'object' && DHTMLpopParam.autorun===true) {
		for(i=0;i<cd_disclaimer.hide.length;i++) {
			if (document.getElementById(cd_disclaimer.hide[i])) {
				document.getElementById(cd_disclaimer.hide[i]).style.display='none';
				document.getElementById(cd_disclaimer.hide[i]).style.visibility = 'hidden';
			}
		}
	}
});

if (DHTMLpopParam.autorun===false && cd_disclaimer.popunder==1) {
	add_onload(function(){window.focus();});
	window.focus();
}
add_onload(function(){
	DHTMLdebugMode=true;
	if (DHTMLpop.debug) debugDHTMLpop();
});




