//Check if configuration array is present
if (typeof MurThumbsCD == 'undefined') var MurThumbsCD = new Array();
var imagesBase = 'http://tools.pornattitude.com/thumbs_generator/images/';

//Variabes used by mailcatchers
var config_synergie 	= null;
var config_niche 		= null;
var config_tracked 		= null;
var config_id			= null;

function murThumbs(MurThumbsCD) {
	//Functions
	this.version			= '20110131';
	this.randStr 			= murThumbsRandStr;
	this.updateProgress 	= murThumbsUpdateProgress;
	this.buildThumbs 		= murThumbsBuildThumbs;
	this.loadContent 		= murThumbsloadContent;
	this.popHandle			= 2;
	if (typeof MurThumbsCD['pophtml'] != 'undefined') {
		this.popHandle = parseInt(MurThumbsCD['pophtml']);
	}

	//Fill the options by default or read from user input
	this.instance 					= typeof MurThumbsCD['rand'] != 'undefined' ? MurThumbsCD['rand'] : this.randStr();;
	this.murThumbsOptions			= new Array();
	this.murThumbsImages			= new Array();


	this.murThumbsOptions['id'] 			= typeof MurThumbsCD['id'] != 'undefined' ? MurThumbsCD['id'] : 10000;
	this.murThumbsOptions['tracker'] 		= typeof MurThumbsCD['tracker'] != 'undefined' ? MurThumbsCD['tracker'] : '';
	this.murThumbsOptions['lines'] 			= typeof MurThumbsCD['lines'] != 'undefined' ? parseInt(MurThumbsCD['lines']) : 1;
	this.murThumbsOptions['cols'] 			= typeof MurThumbsCD['cols'] != 'undefined' ? parseInt(MurThumbsCD['cols']) : 1;
	this.murThumbsOptions['count']			= this.murThumbsOptions['cols'] * this.murThumbsOptions['lines'];
	this.murThumbsOptions['synergy'] 		= typeof MurThumbsCD['synergy'] != 'undefined' ? MurThumbsCD['synergy'] : 'hetero';
	this.murThumbsOptions['niche'] 			= typeof MurThumbsCD['niche'] != 'undefined' ? MurThumbsCD['niche'] : 173;
	this.murThumbsOptions['langue'] 		= typeof MurThumbsCD['langue'] != 'undefined' ? MurThumbsCD['langue'] : 'fr';
	this.murThumbsOptions['niche_letter']	= 'H';
	this.murThumbsOptions['size'] 			= typeof MurThumbsCD['size'] != 'undefined' ? MurThumbsCD['size'] : '120x90';
	this.murThumbsOptions['popunder'] 		= typeof MurThumbsCD['popunder'] != 'undefined' ? MurThumbsCD['popunder'] : true;
	this.murThumbsOptions['rand'] 			= this.instance;
	this.murThumbsOptions['opacity'] 		= typeof MurThumbsCD['opacity'] != 'undefined' ? MurThumbsCD['opacity'] : 50;
	this.murThumbsOptions['dhtmlpop'] 		= typeof MurThumbsCD['dhtmlpop'] != 'undefined' ? MurThumbsCD['dhtmlpop'] : 0;

	//Update mailcatchers variables
	config_synergie = this.murThumbsOptions['synergy'];
	config_niche	= this.murThumbsOptions['niche'];
	config_tracked	= this.murThumbsOptions['tracker'];
	config_id		= this.murThumbsOptions['id'];

	//Create div holder
	document.write('<div class="MurThumbsCD_'+this.instance+'" id="MurThumbsCD_'+this.instance+'"></div>');

	//Define progress bar sizes
	this.murThumbsPlayerSizes = {
		small: {p_height: 15, p_left:"small_left", p_left_width: 23, p_center: "small_center", p_right: "small_right", p_right_width: 43, p_slider_top: 6, p_slider_height: 3, p_slider_fix: 0, p_play: "small_play", p_play_size: 33},
		big: {p_height: 25, p_left:"left", p_left_width: 59, p_center: "center", p_right: "right", p_right_width: 71, p_slider_top: 10, p_slider_height: 5, p_slider_fix: 0, p_play: "play", p_play_size: 51}
	}

	//Split sizes
	this.murTempSizes 				= this.murThumbsOptions['size'].split("x");
	this.murThumbsOptions['width'] 	= parseInt(this.murTempSizes[0]);
	this.murThumbsOptions['height'] = parseInt(this.murTempSizes[1]);

	//Check if using webmaster thumbs or CD thumbs
	//Change: always load pa thumbs for the catchers
	/*if (typeof MurThumbsCD['thumbs'] == 'undefined') {*/
		//Read from server
		var time 	= new Date();
		var head	= document.getElementsByTagName('head')[0];
		var script	= document.createElement('SCRIPT');
		script.type	= 'text/javascript';
		script.id	= this.instance;
		script.src	= 'http://www.pornattitude.com/index.php/module_client_pornofolies_thumbs_helper?size='+this.murThumbsOptions['size']+'&niche='+this.murThumbsOptions['niche']+'&synergie='+this.murThumbsOptions['synergy']+'&limit='+this.murThumbsOptions['count']+'&r='+time.getTime()+'&rand='+this.instance;
		head.appendChild(script);
	/*}else*/ if (typeof MurThumbsCD['thumbs'] != 'undefined') {
		//Read from configuration
		this.murThumbsImages = MurThumbsCD['thumbs'];

		//Build layout
		this.buildThumbs();
	}
}

function murThumbsloadContent() {
	this.murThumbsOptions['niche_letter'] = eval('niche_letter_'+this.instance);
	if (typeof this.murThumbsImages == 'undefined' || this.murThumbsImages == false) {
		this.murThumbsImages = thumbs;
		this.buildThumbs();
	}
}

function murThumbsRandStr() {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 8;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}

function murThumbsUpdateProgress(id, step) {
	var maxWidth = this.murThumbsOptions['width'] - this.murThumbsPlayerSizes[this.plsize].p_left_width - this.murThumbsPlayerSizes[this.plsize].p_right_width  + this.murThumbsPlayerSizes[this.plsize].p_slider_fix ;
	document.getElementById('MurThumbsCD_play_'+id+'_'+this.instance).style.visibility='visible';
	var elem = document.getElementById('MurThumbsCD_progress_'+id+'_'+this.instance);
	var width = parseInt((parseInt(elem.style.width.replace("px", "")) + parseInt(step)));
	elem.style.width = width + 'px';

	if (width > maxWidth) {
		elem.style.width = maxWidth;
	}

	if (width < maxWidth) {
		setTimeout("murThumb"+this.instance+".updateProgress('" + id + "', '" + step + "')", 50);
	}
}

function murThumbsBuildThumbs () {
	this.popup = new dhtmlpop(this.instance, this.murThumbsOptions);

	var murThumbsCount = 0;
	var murThumbsHTML = '';
	var murThumbsClear = false;
	for (image in this.murThumbsImages) {
		//Check limits
		if (murThumbsCount > this.murThumbsOptions['count'])
			break;

		var rand = Math.floor(Math.random() * 5) + 1;
		var murThumbsLiCSS = '';

		//By default use big player
		this.plsize = 'big';
		if (this.murThumbsOptions['width'] < 320) { //If width less than 320px use the small player
			this.plsize = 'small';
		}

		//Set new line flag
		if ((murThumbsCount % this.murThumbsOptions['cols']) === 0 && murThumbsCount > 0) {
			murThumbsHTML += "</tr><tr>";
		}

		//Update all the html to use tables
		var tdStyle = 'width:'+this.murThumbsOptions['width']+'px;padding:2px;position:relative';
		var controlsExtra = ' style="border: none"';

		//Generate html
		var playerStyle = 'float:left;width:'+(this.murThumbsOptions['width'] + 2 )+'px;position: relative';
		murThumbsHTML += '<td style="'+tdStyle+'" class="MurThumbsCD_td_'+this.murThumbsOptions['rand']+'" id="MurThumbsCD_td_'+murThumbsCount+'_'+this.murThumbsOptions['rand']+'"><div style="position:relative">'+

		//Play button
		'<a href="#" onclick="return murThumb'+this.instance+'.popup.show(\''+this.murThumbsImages[image]+'\')" style="visibility:hidden;position:absolute;top: '+(this.murThumbsOptions['height']/2-this.murThumbsPlayerSizes[this.plsize].p_play_size/2 +2)+'px;left: '+(this.murThumbsOptions['width']/2-this.murThumbsPlayerSizes[this.plsize].p_play_size/2 +2) + 'px;opacity:'+(this.murThumbsOptions['opacity']/100)+';filter:alpha(opacity='+this.murThumbsOptions['opacity']+');z-index:1000;" id="MurThumbsCD_play_'+murThumbsCount+'_'+this.murThumbsOptions['rand']+'"><img src="' + imagesBase + this.murThumbsPlayerSizes[this.plsize].p_play + '.gif" border="0" /></a>' +
		//Image
		'<a href="#" onclick="return murThumb'+this.instance+'.popup.show(\''+this.murThumbsImages[image]+'\')"><img src=\"'+this.murThumbsImages[image]+'\" alt="" width="'+this.murThumbsOptions['width']+'" height="'+this.murThumbsOptions['height']+'" style="display: block" class="MurThumbsCD_img_'+this.murThumbsOptions['rand']+'" onload="murThumb'+this.instance+'.updateProgress('+murThumbsCount+', '+rand+')" border="0" /></a>' +
		//Progress bar
		'<div style="'+playerStyle+'" class="MurThumbsCD_player_'+this.murThumbsOptions['rand']+'" id="MurThumbsCD_player_'+murThumbsCount+'_'+this.murThumbsOptions['rand']+'"><a href="#" onclick="return murThumb'+this.instance+'.popup.show(\''+this.murThumbsImages[image]+'\')"><img src="' + (imagesBase) + this.murThumbsPlayerSizes[this.plsize].p_left + '.gif" alt="" width="'+this.murThumbsPlayerSizes[this.plsize].p_left_width+'" height="'+this.murThumbsPlayerSizes[this.plsize].p_height+'" border="0" '+controlsExtra+' /></a>'+
		'<img src="'+imagesBase+ this.murThumbsPlayerSizes[this.plsize].p_center + '.gif" width="'+ (this.murThumbsOptions['width'] - this.murThumbsPlayerSizes[this.plsize].p_right_width - this.murThumbsPlayerSizes[this.plsize].p_left_width) + '" height="'+this.murThumbsPlayerSizes[this.plsize].p_height+'" '+controlsExtra+' />' +
		'<a href="#" onclick="return murThumb'+this.instance+'.popup.show(\''+this.murThumbsImages[image]+'\')"><img src="' + (imagesBase) + this.murThumbsPlayerSizes[this.plsize].p_right + '.gif" alt="" width="'+this.murThumbsPlayerSizes[this.plsize].p_right_width+'" height="'+this.murThumbsPlayerSizes[this.plsize].p_height+'" border="0" '+controlsExtra+' /></a>' +
		'<div style="position:absolute;left:'+(this.murThumbsPlayerSizes[this.plsize].p_left_width)+'px;top:'+this.murThumbsPlayerSizes[this.plsize].p_slider_top+'px; height: '+this.murThumbsPlayerSizes[this.plsize].p_slider_height+'px; width:0px; background-color:#FF7F7F;font-size:1px" id="MurThumbsCD_progress_'+murThumbsCount+'_'+this.murThumbsOptions['rand']+'"></div>' +
		'</div>' +
		// End progress bar
		'<div style="text-align: center; display: none" class="MurThumbsCD_text_'+this.murThumbsOptions['rand']+'"><a href="#" onclick="return murThumb'+this.instance+'.popup.show()">T&eacute;l&eacute;charger la vid&eacute;o</a></div>'
		"</div></td>";

		murThumbsCount++;
	}

	var tableStyle = 'margin:0;padding:0;border-collapse:collapse;width: '+(this.murThumbsOptions['cols']*(this.murThumbsOptions['width']+4))+'px';
	var html = "<table style=\"" + tableStyle + "\" class=\"MurThumbsCD_table_" + this.murThumbsOptions['rand'] + "\"><tr>" + murThumbsHTML + "</tr></table>";
	document.getElementById("MurThumbsCD_" + this.instance).innerHTML = html;
}

eval('var murThumb'+ MurThumbsCD['rand']+' = new murThumbs(MurThumbsCD);');

/** DHTML Popup **/


function dhtmlpop(randData, thumbsObject) {
	this.init 				= dhtmlpop_init;
	this.dimension_detect 	= dhtmlpop_dimension_detect;
	this.reloadThumbs 		= dhtmlpop_reloadThumbs;
	this.show 				= dhtmlpop_show;
	this.initData 			= dhtmlpop_data;
	this.close	 			= dhtmlpop_close;
	this.formSubmit			= dhtmlpop_formSubmit;
	this.tr					= dhtmlpop_get_translation;

	this.blink_bg			= dhtmlpop_blink_bg;

	this.start_blink	 	= dhtmlpop_start_blink;
	this.blink	 			= dhtmlpop_blink;
	this.stop_blink	 		= dhtmlpop_stop_blink;
	this.email_focus	 	= dhtmlpop_email_focus;
	this.email_blur	 		= dhtmlpop_email_blur;

	this.size 			= '176x136';
	this.randData 		= randData;
	this.popunder		= 0;
	this.thumbsObject 	= thumbsObject;

	//Blink
	this.text_timer;
	this.text_visible = 1;
	this.text_tmp;

	//create
	this.initData();
	this.init();
}

function dhtmlpop_data() {
	this.translations_generic = {
		'fr':["FERMER LA FEN&Ecirc;TRE"],
		'en':["CLOSE WINDOW"],
		'it':["CHIUDERE LA FINESTRA"],
		'es':["CERRAR LA VENTANA"]
	}

	this.data = new Array();
	this.data[0] = new Object();
	this.data[0].size = '176x136';
	this.data[0].css = '.popme'+this.randData+' {position:fixed; _position:absolute; text-align:center; background:#fff; width:755px; height:550px; left:50%; top:50%; margin-left:-377px; margin-top:-275px;z-index:5000;border:3px solid #000000;}'+
	'.blink {border:3px solid #FF0000;}'+
	'.popme'+this.randData+' {top:-400px;}'+
	'.popme'+this.randData+' * {margin: auto; padding: auto}'+
	'.popme'+this.randData+' h1 {font: normal 26px arial, tahoma; color: #070101; text-align:center; padding: 0; margin: 10px 0 0 0;}'+
	'.popme'+this.randData+' input#mailme'+this.randData+' {	width:281px;padding: 7px 0 0 0;height: 26px;*height: 33px;background:#FED97E url(http://media-z.pornattitude.com/media/pdvs/special/pdv4/input.gif);background-repeat:no-repeat;border:0px;font: 15px Arial;color: #000;font-weight: bold;text-decoration: none;text-align:center;}'+
	'.popme'+this.randData+' #offerte {width: 738px; height: 32px; background: url(http://media-z.pornattitude.com/media/pdvs/special/pdv3/images/offerte.gif) no-repeat; text-align: right; padding: 0 0 60px 0;}'+
	'.popme'+this.randData+' .pic {border: 1px solid #606060;}';
	this.data[0].html = '<form onsubmit="murThumb'+this.randData+'.popup.formSubmit(); return false;" style="margin: auto; padding: auto"> \
<a class="popme_close" href="javascript:murThumb'+this.randData+'.popup.close()" style="position:absolute;top:10px;right:10px;"> \
<img height="31" border="0" width="31" src="http://media-z.pornattitude.com/media/pdvs/special/pdv3/images/close.gif"/> \
</a> \
<table width="628" border="0" align="center" cellpadding="0" cellspacing="8"> \
			<tr align="center"> \
			  <td height="60"> \
				  <img src="http://media-z.pornattitude.com/media/pdvs/special/pdv4/'+this.thumbsObject.langue+'/accim.gif" width="634" height="38" /></td> \
			</tr> \
			<tr> \
			  <td align="center"><table width="93%"  border="0" cellspacing="0" cellpadding="0"> \
				<tr align="center"> \
				  <td align="right"><a href="#" class="brdr"><img src="" id="image1'+this.randData+'" width="176" height="132" border="0" /></a></td> \
				  <td><a href="#" class="brdr"><img src="" id="image2'+this.randData+'" width="176" height="132" border="0" /></a></td> \
				  <td align="left"><a href="#" class="brdr"><img src="" id="image3'+this.randData+'" width="176" height="132" border="0" /></a></td> \
				</tr> \
			  </table></td> \
			</tr> \
			<tr> \
			  <td><table width="628"  border="0" align="center" cellpadding="0" cellspacing="0"> \
				<tr> \
				  <td><img src="http://media-z.pornattitude.com/media/pdvs/special/pdv4/tab1_t.gif" width="628" height="8" /></td> \
				  </tr> \
				<tr> \
				  <td bgcolor="#FED97E"><table width="600" border="0" align="center" cellpadding="0" cellspacing="0"> \
					<tr align="center"> \
					  <td height="55" colspan="3" valign="top"><img src="http://media-z.pornattitude.com/media/pdvs/special/pdv4/'+this.thumbsObject.langue+'/accgr.gif" width="599" height="45" /></td> \
					</tr> \
					<tr> \
					  <td width="150" rowspan="2" align="right" valign="top"><img src="http://media-z.pornattitude.com/media/pdvs/special/pdv4/arrow1.gif" width="142" height="80" /></td> \
					  <td width="300" align="center"><input name="mailme" type="text" value="@" id="mailme'+this.randData+'" onfocus="murThumb'+this.randData+'.popup.email_focus()" onblur="murThumb'+this.randData+'.popup.email_blur()"></td> \
					  <td width="150" rowspan="2" valign="top"><img src="http://media-z.pornattitude.com/media/pdvs/special/pdv4/arrow2.gif" width="142" height="80" /></td> \
					</tr> \
					<tr> \
					  <td width="300" align="center"><input name="Submit" type="image" value="Submit" src="http://media-z.pornattitude.com/media/pdvs/special/pdv4/'+this.thumbsObject.langue+'/valider.gif" border="0"></td> \
					</tr> \
				  </table></td> \
				  </tr> \
				<tr> \
				  <td><img src="http://media-z.pornattitude.com/media/pdvs/special/pdv4/tab1_b.gif" width="628" height="8" /></td> \
				  </tr> \
			  </table></td> \
			  </tr> \
			<tr> \
			  <td align="center"><table width="93%"  border="0" cellspacing="0" cellpadding="0"> \
				<tr align="center"> \
				  <td align="right"><a href="#" class="brdr"><img src="" id="image4'+this.randData+'" width="176" height="132" border="0" /></a></td> \
				  <td><a href="#" class="brdr"><img src="" id="image5'+this.randData+'" width="176" height="132" border="0" /></a></td> \
				  <td align="left"><a href="#" class="brdr"><img src="" id="image6'+this.randData+'" width="176" height="132" border="0" /></a></td> \
				</tr> \
			  </table></td> \
			</tr> \
			<tr align="center"> \
			  <td height="20"><a class="popme_close" href="javascript:murThumb'+this.randData+'.popup.close()">'+this.tr(0)+'</a></td> \
			</tr> \
		</table> \
</form>';

	this.data[1] = new Object();
	this.data[1].translations = {
		'fr': ['D&eacute;couvrez la zone r&eacute;serv&eacute;e aux abonn&eacute;s.', 'Plus de 1200 vid&eacute;os &agrave; t&eacute;l&eacute;charger !', 'Identifiez-vous avec votre email :'],
		'en': ['Discover the member zone.', 'Over 1200 videos to download!', 'Log in with your e-mail address:'],
		'it': ['Scoprite la zona riservata agli abbonati.', 'Pi&ugrave; di 1200 video da scaricare !', 'Identificatevi con la vostra email :'],
		'es': ['Descubre la zona reservada a los miembros.', '&iexcl;M&aacute;s de 1200 vídeos para descargar!', 'Identifícate con tu correo electr&oacute;nico:']
	};
	this.data[1].size = '120x90';
	this.data[1].css = '.popme'+this.randData+' { background:transparent url(http://media-z.pornattitude.com/media/H/images/popup/bg.gif) no-repeat; width:647px; height:295px; font-family:tahoma,arial,sans-serif; position:fixed; _position:absolute; left:50%; top:50%; margin-left:-323px; margin-top:-147px; z-index: 9999} \
.popme'+this.randData+' {top:-400px;} \
.popme'+this.randData+' * {margin: auto; padding: auto} \
.popme'+this.randData+' table { border-collapse: separate; border-spacing: 10px; } \
.popme'+this.randData+' form {padding:0; margin:0; margin-bottom:10px} \
.pop_img'+this.randData+' img {margin-bottom:2px;} \
.pop_blue'+this.randData+', .pop_orange'+this.randData+' {font-size:14px; font-weight:bold; color:#074D81} \
.pop_orange'+this.randData+' {color:#DC020A} \
.pop_form'+this.randData+' {margin:10px; display:block;} \
.pop_form'+this.randData+' span {display:block; font-size:14px; font-weight:bold; margin-bottom:5px;} \
.pop_form'+this.randData+' .pop_text { padding:10px; width:80%; text-align:center; font-weight:normal; font-size:18px;}';
	this.data[1].html = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="10"> \
	<tr> \
	  <td width="120" valign="top" class="pop_img'+this.randData+'"> \
		  <img src="" id="image1'+this.randData+'" alt="" width="120" height="90" /> \
		  <img src="" id="image2'+this.randData+'" alt="" width="120" height="90" /> \
		  <img src="" id="image3'+this.randData+'" alt="" width="120" height="90" /> \
	  </td> \
	  <td align="center"> \
		  <img src="http://media-z.pornattitude.com/media/H/images/popup/access_'+this.thumbsObject.langue+'.gif" alt="" /><br /> \
		  <span class="pop_blue'+this.randData+'">'+this.tr(1, 0)+'</span><br /> \
		  <span class="pop_orange'+this.randData+'">'+this.tr(1, 1)+'</span> \
		  <form onsubmit="murThumb'+this.randData+'.popup.formSubmit(); return false;"> \
			  <label class="pop_form'+this.randData+'"><span>'+this.tr(1, 2)+'</span> \
			  <input type="text" name="mailme" id="mailme'+this.randData+'" value="@" onfocus="murThumb'+this.randData+'.popup.email_focus()" onblur="murThumb'+this.randData+'.popup.email_blur()" class="pop_text" /> \
			  </label> \
			  <input type="image" src="http://media-z.pornattitude.com//media/H/images/popup/button_'+this.thumbsObject.langue+'.gif" /> \
		  </form> \
		  <a class="popme_close" href="javascript:murThumb'+this.randData+'.popup.close()">'+this.tr(0)+'</a> \
	  </td> \
	  <td width="120" valign="top" class="pop_img'+this.randData+'"> \
		  <img src="" id="image4'+this.randData+'" alt="" width="120" height="90" /> \
		  <img src="" id="image5'+this.randData+'" alt="" width="120" height="90" /> \
		  <img src="" id="image6'+this.randData+'" alt="" width="120" height="90" /> \
	  </td> \
	</tr> \
</table>';

	this.data[2] = new Object();
	this.data[2].translations = {
		'fr': ['Acc&egrave;s <b>gratuit !</b>', 'Si vous plus de 18 ans, veuillez donner votre e-mail pour entrer','Entrer'],
		'en': ['Free <b>access!</b>', 'If you are over 18 years of age, please indicate your e-mail address to enter', 'Enter'],
		'es': ['&iexcl;Acceso <b>gratis!</b>', 'Si tienes m&aacute;s de 18 a&ntilde;is, introduce tu correo electr&oacute;nico para entrar', 'Entrar'],
		'it': ['Accesso <b>gratuito!</b>', 'Se avete pi&ugrave; di 18 anni, vogliate inserire la vostra e-mail per entrare', 'Entrare']
	};
	this.data[2].css = '.popme'+this.randData+' {position:fixed; _position:absolute; text-align:center; background:url(http://media.petitcoquin.com/images/pop/bg.png) no-repeat; width:695px; height:393px; left:50%; top:50%; margin-left:-347px; margin-top:-180px; z-index: 5000} \
.popme'+this.randData+' {top:-400px;} \
.popme'+this.randData+' {_background-image:url(http://media.petitcoquin.com/images/pop/ie6.gif);} \
.popme'+this.randData+' h1 {font-size:60px; letter-spacing:-2px; text-transform:uppercase; color:#17608b; padding:0; margin:0; line-height:56px;} \
.popme'+this.randData+' h1 b {color:#e92929;} \
.popme'+this.randData+' h2 {color:#333; font-size:18px; padding:0; margin:0;} \
.popme'+this.randData+' input {padding:10px; text-align:center; width:500px; font-size:18px; background:#FFC; margin:20px auto;} \
.popme'+this.randData+' .button {display:block; background:url(http://media.petitcoquin.com/images/pop/button.gif) left bottom; width:258px; height:54px; text-align:center; font-size:24px; color:white; font-weight:bold; text-transform:uppercase; text-decoration:none; line-height:54px; margin:0 auto; border: none} \
.popme'+this.randData+' .button:hover {background-position:left top;} \
.popme'+this.randData+' .padd {padding:80px 60px 0 60px; *padding-top:70px;} \
.popme_close'+this.randData+' {text-align:left; position:absolute; width:500px; *left:0; padding:40px 0 0 625px;} \
.popme_close'+this.randData+' a {display:block; background:url(http://media.petitcoquin.com/images/pop/close.gif) center center; width:25px; height:25px; filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;} \
.popme_close'+this.randData+' a span {display:none;} \
.popme_close'+this.randData+' a:hover {filter:alpha(opacity=100);-moz-opacity:1;opacity:1;}';
	this.data[2].html = '<div class="popme_close'+this.randData+'"><a href="javascript:murThumb'+this.randData+'.popup.close()"><span>Fermer</span></a></div> \
	<div class="padd"> \
		<form id="form'+this.randData+'" onsubmit="murThumb'+this.randData+'.popup.formSubmit(); return false;"> \
			<h1>'+this.tr(2, 0)+'</h1> \
			<h2><label for="mailme'+this.randData+'">'+this.tr(2, 1)+'</label></h2> \
			<span><input type="text" name="mailme" id="mailme'+this.randData+'" value="@" onfocus="murThumb'+this.randData+'.popup.email_focus()" onblur="murThumb'+this.randData+'.popup.email_blur()" /></span> \
			<span><button type="submit" class="button">'+this.tr(2,2)+'</button></span> \
		</form> \
	</div>';

	this.data[3] = new Object();
	this.data[3].translations = {
		'fr': ['<em>Stop !</em> Tu es &agrave; quelques secondes du bonheur', 'Pour avoir ton <em>acc&egrave;s complet <br/>&agrave; TOUT le site</em>, <br/>donne ton adresse email :', 'Valider', 'Attention, ton adresse email doit &ecirc;tre correcte pour <br/> que tu re&ccedil;oives ton acc&egrave;s complet.', 'Viens vite, elles t&acute;attendent'],
		'en': ['<em>Stop !</em> Happiness is only a few seconds away ', 'To get <em>full access <br>to the WHOLE site</em>, <br>enter your e-mail address:', 'Validate', 'Attention, you must enter a valid e-mail address in order to get full access.', 'Join them now, they are waiting for you'],
		'it': ['<em>Stop !</em> Sei a qualche secondo dal piacere ', 'Per avere il tuo <em>accesso completo <br>a TUTTO il sito</em>, <br>inserisci il tuo indirizzo email :', 'Validare', 'Attenzione, il tuo indirizzo email deve essere corretto per potere ricevere il tuo accesso completo. ', 'Vieni presto, ti aspettano'],
		'es': ['<em>&iexcl;Para!</em>&iexcl;Tu felicidad esta solo unos segundos atr&aacute;s!', 'Para tener <em>acceso completo<br> al sitio por ENTERO </em>, <br>introduzca su correo electr&oacute;nico:', 'Validar', 'Atenci&oacute;n, debes introducir un correo electr&oacute;nico corecto para poder recibir tu acceso completo. ', 'Ven r&aacute;pido , ellas te est&aacute;n esperando']
	};
	this.data[3].size = '120x90';
	this.data[3].css  = '.popme'+this.randData+' {width:670px; text-align:center; font-family:Arial, Helvetica, sans-serif; height:370px; font-family:tahoma,arial,sans-serif; position:fixed; _position:absolute; left:50%; top:50%; margin-left:-335px; margin-top:-185px; z-index: 9999; background: #B90000;} \
.popme'+this.randData+' {top:-400px;} \
.popme'+this.randData+' * {padding:0; margin:0;} \
.popme'+this.randData+' em {font-family:inherit; text-transform:inherit; letter-spacing:inherit; font-size:inherit; text-decoration:inherit; font-style:normal;} \
.popme'+this.randData+' .main_table { margin:10px; background:white; width:650px;} \
.ktu_top {padding:5px 10px 0 10px;} \
.ktu_close span {display:none;} \
.ktu_pics {width:140px;} \
.ktu_pics img {display:block; margin:10px; font-size:0;} \
.popme'+this.randData+' td.align_center {text-align:center;} \
.popme'+this.randData+' button {cursor:pointer; cursor:hand;} \
.popme'+this.randData+' { height:370px; } \
.popme'+this.randData+' .ktu_close {float:right; display:block; background:url(close.gif) no-repeat; width:21px; height:21px; margin-top:8px;} \
.popme'+this.randData+' .ktu_close:hover {filter:alpha(opacity=70);-moz-opacity:.70;opacity:.70;} \
.popme'+this.randData+' .left_top {background:url(http://ktu.sv2.biz/media/new_ktu/7/left_top.gif) no-repeat left top; width:5px; height:5px;} \
.popme'+this.randData+' .left_bottom {background:url(http://ktu.sv2.biz/media/new_ktu/7/left_bottom.gif) no-repeat left bottom; width:5px; height:5px;} \
.popme'+this.randData+' .right_top {background:url(http://ktu.sv2.biz/media/new_ktu/7/right_top.gif) no-repeat right top; width:5px; height:5px;} \
.popme'+this.randData+' .right_bottom {background:url(http://ktu.sv2.biz/media/new_ktu/7/right_bottom.gif) no-repeat right bottom; width:5px; height:5px;} \
.popme'+this.randData+' .empty {font-size:0px; height:5px; width:5px; line-height:0;} \
.popme'+this.randData+' .ktu_button {background:none; border:none; display:block; text-align:center; cursor:pointer; cursor:hand; margin:0 auto;} \
.popme'+this.randData+' h1 {font-size:28px; letter-spacing:-1px; color:white;} \
.popme'+this.randData+' h1 em {color:#ffd700;} \
.popme'+this.randData+' .cb_label, .popme'+this.randData+' h3 {font-size:24px; font-weight:bold; letter-spacing:-1px; line-height:26px;} \
.popme'+this.randData+' .big_input {padding:10px; width:280px; font-size:18px; margin:10px auto; text-align:center;} \
.popme'+this.randData+' .attention_cb {background:url(warn.gif) no-repeat left top; padding-left:25px; font-size:11px; text-align:left; font-weight:bold; margin:10px 20px;} \
.popme'+this.randData+' .round_color, .popme'+this.randData+' .ktu_close {background-color: #b40000;} \
.popme'+this.randData+' .ktu_button {font-size:18px; font-weight:bold; text-transform:uppercase; color:white; width:180px; height:35px;} \
.popme'+this.randData+' {color: #ff0000;} \
.popme'+this.randData+' em { color: black;}';
	this.data[3].html = '<div style="position:absolute;right: 0; top: 0"><a href="javascript:murThumb'+this.randData+'.popup.close()"><img src="'+imagesBase+'close.png" border="0" /></a></div> \
	<div class="ktu_top"><h1>'+this.tr(3, 0)+'</h1></div> \
	<table width="100%" cellspacing="0" cellpadding="0" border="0" class="main_table"> \
	  <tr> \
		<td class="ktu_pics"> \
		<img width="120" height="90" alt="" id="image1'+this.randData+'" src="" /> \
		<img width="120" height="90" alt="" id="image2'+this.randData+'" src="" /> \
		<img width="120" height="90" alt="" id="image3'+this.randData+'" src="" /> \
		</td> \
		<td align="center"> \
				<!-- CB --> \
				<form onsubmit="murThumb'+this.randData+'.popup.formSubmit(); return false;" name="email_form"> \
					<label class="cb_label" for="ktu_email">'+this.tr(3, 1)+'</label> \
					<input type="text" style="text-align: center;" class="big_input" name="mailme" id="mailme'+this.randData+'" value="@" onfocus="murThumb'+this.randData+'.popup.email_focus()" onblur="murThumb'+this.randData+'.popup.email_blur()" /> \
					<!-- button --> \
					<table cellspacing="0" cellpadding="0" border="0" style="margin: 0pt auto;" class="round_color"> \
						<tbody><tr><td class="left_top"/><td class="empty"/><td class="right_top"/></tr><tr><td class="empty"/> \
						<td><button class="ktu_button" type="submit">'+this.tr(3, 2)+'</button></td> \
						<td class="empty"/></tr><tr><td class="left_bottom"/><td class="empty"/><td class="right_bottom"/></tr> \
					</tbody></table> \
					<!-- button --> \
				</form> \
				<p class="attention_cb">'+this.tr(3, 3)+'</p> \
				<h3><center><em>'+this.tr(3, 4)+'</em></center></h3> \
				<!-- CB END --> \
		</td> \
		<td class="ktu_pics"> \
		<img width="120" height="90" alt="" id="image4'+this.randData+'" src="" /> \
		<img width="120" height="90" alt="" id="image5'+this.randData+'" src="" /> \
		<img width="120" height="90" alt="" id="image6'+this.randData+'" src="" /> \
		</td> \
	  </tr> \
	</table>';

	this.data[4] = new Object();
	this.data[4].translations = {
		'fr': ['VID&Eacute;O GRATUITE ET T&Eacute;L&Eacute;CHARGEMENT ILLIMIT&Eacute;', 'ENTRE TON EMAIL POUR RECEVOIR LA VID&Eacute;O IMM&Eacute;DIATEMENT :', 'T&Eacute;L&Eacute;CHARGE LA VID&Eacute;O'],
		'en': ['FREE VIDEO AND UNLIMITED DOWNLOAD', 'ENTER YOUR E-MAIL TO INSTANTLY GET THE VIDEO:', 'DOWNLOAD VIDEO'],
		'it': ['VIDEO GRATUITO E DOWNLOAD ILLIMITATO', 'INSERISCI LA TUA EMAIL PER RICEVERE IMMEDIATAMENTE IL VIDEO :', 'SCARICA IL VIDEO'],
		'es': ['V&Iacute;DEO GRATUITO Y DESCARGA ILIMITADA', 'INTRODUCE TU E-MAIL PARA RECIBIR EL V&Iacute;DEO DE INMEDIATO:', 'DESCARGAR EL V&Iacute;DEO']
	};
	this.data[4].size = '120x90';
	this.data[4].css  = '.popme'+this.randData+' {width:710px; height:300px; font-family:tahoma,arial,sans-serif; position:fixed; _position:absolute; left:50%; top:50%; margin-left:-355px; margin-top:-150px; z-index: 9999; background: #B90000;} \
.popme'+this.randData+' {top:-400px;} \
.popme'+this.randData+' .catcher1 {font-family: Arial, Helvetica, sans-serif; width:710px; height:300px; background-color:#FFF; position:relative; text-align:center;}\
.popme'+this.randData+' .catcher1 img {border:0px;}\
.popme'+this.randData+' .catcher1 .close {position:absolute; background:url('+imagesBase+'catchers/close.gif); width:13px; height:13px; right:12px; top:10px; display:block;}\
.popme'+this.randData+' .catcher1 .pic {margin:19px 0 0 21px; float:left; position:relative; width:320px; display:inline;}\
.popme'+this.randData+' .catcher1 .pic a span {background:url('+imagesBase+'catchers/play.png); width:89px; height:72px; position:absolute; left:115px; top:83px; cursor:pointer;}\
.popme'+this.randData+' .catcher1 .close span {display:none;}\
.popme'+this.randData+' .catcher1 form {float:right; width:327px; margin:0 21px 0 0; display:inline; padding-top:25px;}\
.popme'+this.randData+' .catcher1 form h1 {font-size:30px; color:#1c489a; margin:0 0 16px 0; padding:0px; line-height:32px;}\
.popme'+this.randData+' .catcher1 form h2 {font-size:16px; color:#000; margin:0 0 8px 0; padding:0; text-transform:uppercase;}\
.popme'+this.randData+' .catcher1 form p {margin:0 0 10px 0; padding:0;}\
.popme'+this.randData+' .catcher1 .p_input {background:url('+imagesBase+'catchers/input_2.gif) no-repeat; width:327px; height:43px;}\
.popme'+this.randData+' .catcher1 .p_input input {text-align:center; height:28px; margin-top:7px; border:0px; line-height:24px; font-size:18px; font-weight:bold; width:320px; margin-left:3px; background:none;}\
.popme'+this.randData+' .catcher1 .button {background:url('+imagesBase+'catchers/button1.gif); width:262px; height:43px; display:block; margin:0px auto; text-decoration:none; line-height:43px; font-size:16px; font-weight:bold; color:#FFF;}';
	this.data[4].html = '<div class="catcher1">\
	<a href="javascript:murThumb'+this.randData+'.popup.close()" class="close"><span>close</span></a>\
	<div class="pic"><a href="#" onclick="murThumb'+this.randData+'.popup.blink_bg(\'p_input\')"><span class="png"></span><img src="" id="murThumbCatcherPic" alt="" /><br /><img src="'+imagesBase+'catchers/player.gif" alt="" /></a></div>\
	<form onsubmit="murThumb'+this.randData+'.popup.formSubmit(); return false;" name="email_form">\
		<input type="submit" style="display: none" />\
		<h1>'+this.tr(4, 0)+'</h1>\
		<h2>'+this.tr(4, 1)+'</h2>\
		<p class="p_input"><input name="mailme" id="mailme'+this.randData+'" value="@" onfocus="murThumb'+this.randData+'.popup.email_focus()" onblur="murThumb'+this.randData+'.popup.email_blur()" type="text" /></p>\
		<p><a href="#" class="button" onclick="murThumb'+this.randData+'.popup.formSubmit(); return false;">'+this.tr(4, 2)+'</a></p>\
	</form>\
</div>';

	this.data[5] = new Object();
	this.data[5].translations = {
		'fr': ['VID&Eacute;O TR&Egrave;S HARD!! INTERDIT AU MOINS DE 18 ANS!!', 'Entre ton email D&eacute;bloque toutes les vid&eacute;os !', 'ACC&Egrave;S AUX VID&Eacute;OS'],
		'en': ['<span style="font-size:25px">HARDCORE VIDEO! FORBIDDEN TO PEOPLE UNDER 18 YEARS OF AGE!</span>', 'Enter your e-mail  Unlock all videos!', 'GET ACCESS TO THE VIDEOS'],
		'it': ['VIDEO SUPER HARD!! VIETATO AI MINORI DI 18 ANNI!!', 'Inserisci la tua email sblocca tutti i video !', 'ACCESSO AI VIDEO'],
		'es': ['<span style="font-size:25px">&iexcl;V&Iacute;DEO MUY DURO! &iexcl;PROHIBIDO A LOS MENORES DE 18 A&Ntilde;OS!</span>', '&iexcl;Introduce tu e-mail! &iexcl;Desbloquea todos los v&iacute;deos!', 'ACCESO A LOS V&Iacute;DEOS']
	};
	this.data[5].size = '120x90';
	this.data[5].css  = '.popme'+this.randData+' {width:710px; height:300px; font-family:tahoma,arial,sans-serif; position:fixed; _position:absolute; left:50%; top:50%; margin-left:-355px; margin-top:-150px; z-index: 9999; background: #B90000;} \
.popme'+this.randData+' {top:-400px;} \
.popme'+this.randData+' .catcher2 {font-family: Arial, Helvetica, sans-serif; width:710px; height:300px; background-color:#FFF; position:relative; text-align:center;}\
.popme'+this.randData+' .catcher2 img {border:0px;}\
.popme'+this.randData+' .catcher2 .close {position:absolute; background:url('+imagesBase+'catchers/close.gif); width:13px; height:13px; right:12px; top:10px; display:block;}\
.popme'+this.randData+' .catcher2 .close span {display:none;}\
.popme'+this.randData+' .catcher2 .pic {margin:19px 0 0 21px; float:left; position:relative; width:320px; display:inline;}\
.popme'+this.randData+' .catcher2 .pic a span {background:url('+imagesBase+'catchers/18.png); width:104px; height:104px; position:absolute; left:104px; top:71px; cursor:pointer;}\
.popme'+this.randData+' .catcher2 form {float:right; width:327px; margin:0 21px 0 0; display:inline; padding-top:25px;}\
.popme'+this.randData+' .catcher2 form h1 {font-size:30px; color:#de1919; margin:0 0 16px 0; padding:0px; line-height:32px;}\
.popme'+this.randData+' .catcher2 form h2 {font-size:16px; color:#000; margin:0 0 8px 0; padding:0; text-transform:uppercase;}\
.popme'+this.randData+' .catcher2 form p {margin:0 0 10px 0; padding:0;}\
.popme'+this.randData+' .catcher2 .p_input {background:url('+imagesBase+'catchers/input.gif) no-repeat; width:327px; height:43px;}\
.popme'+this.randData+' .catcher2 .p_input input {text-align:center; height:28px; margin-top:7px; border:0px; line-height:24px; font-size:18px; font-weight:bold; width:320px; margin-left:3px; background:none;}\
.popme'+this.randData+' .catcher2 .button {background:url('+imagesBase+'catchers/button2.gif); width:265px; height:43px; display:block; margin:0px auto; text-decoration:none; line-height:43px; font-size:16px; font-weight:bold; color:#FFF;}\
';
	this.data[5].html = '<div class="catcher2">\
	<a href="javascript:murThumb'+this.randData+'.popup.close()" class="close"><span>close</span></a>\
	<div class="pic"><a href="#" onclick="murThumb'+this.randData+'.popup.blink_bg(\'p_input\')"><span class="png"></span><img src="" id="murThumbCatcherPic" alt="" /><br /><img src="'+imagesBase+'catchers/player.gif" alt="" /></a></div>\
	<form onsubmit="murThumb'+this.randData+'.popup.formSubmit(); return false;" name="email_form">\
		<input type="submit" style="display: none" />\
		<h1>'+this.tr(5, 0)+'</h1>\
		<h2>'+this.tr(5, 1)+'</h2>\
		<p class="p_input"><input name="mailme" id="mailme'+this.randData+'" value="@" onfocus="murThumb'+this.randData+'.popup.email_focus()" onblur="murThumb'+this.randData+'.popup.email_blur()" type="text"  /></p>\
		<p><a href="#" class="button" onclick="murThumb'+this.randData+'.popup.formSubmit(); return false;">'+this.tr(5, 2)+'</a></p>\
	</form>\
</div>';

	this.data[6] = new Object();
	this.data[6].translations = {
		'fr': ['SUPER PROMO! DEVIENS MEMBRE GRATUITEMENT', 'Entre ton email pour mater les 2000 vid&eacute;os :', 'LANCER LA VID&Eacute;O', 'ACC&Egrave;S LIMIT&Eacute; AUX MEMBRES'],
		'en': ['SUPER OFFER! SIGN UP FOR FREE', 'Enter your e-mail to watch all 2000 videos:', 'PLAY VIDEO', 'MEMBERS ONLY'],
		'it': ['SUPER PROMO! DIVENTA MEMBRO GRATUITAMENTE', 'Inserisci la tua email per guardare 2000 video :', 'AVVIARE IL VIDEO', 'ACCESSO LIMITATO AI MEMBRI'],
		'es': ['&iexcl;S&Uacute;PER OFERTA! HAZTE MIEMBRO GRATIS', '&iexcl;Introduce tu e-mail para ver los 2000 v&iacute;deos!', 'VER EL V&Iacute;DEO', 'ACCESO LIMITADO A LOS MIEMBROS']
	};
	this.data[6].size = '120x90';
	this.data[6].css  = '.popme'+this.randData+' {width:710px; height:300px; font-family:tahoma,arial,sans-serif; position:fixed; _position:absolute; left:50%; top:50%; margin-left:-355px; margin-top:-150px; z-index: 9999; background: #B90000;} \
.popme'+this.randData+' {top:-400px;} \
.popme'+this.randData+' .catcher3 {font-family: Arial, Helvetica, sans-serif; width:710px; height:300px; background-color:#FFF; position:relative; text-align:center;}\
.popme'+this.randData+' .catcher3 img {border:0px;}\
.popme'+this.randData+' .catcher3 .close {position:absolute; background:url('+imagesBase+'catchers/close.gif); width:13px; height:13px; right:12px; top:10px; display:block;}\
.popme'+this.randData+' .catcher3 .pic {margin:19px 0 0 21px; float:left; position:relative; width:320px; display:inline;}\
.popme'+this.randData+' .catcher3 .pic a {text-decoration:none;}\
.popme'+this.randData+' .catcher3 .pic a span {background:url('+imagesBase+'catchers/exclamation.png); width:104px; height:93px; position:absolute; left:104px; top:71px; cursor:pointer;}\
.popme'+this.randData+' .catcher3 .pic b {position:absolute; background:url('+imagesBase+'catchers/pic_bg.png); width:320px; display:block; bottom:22px; left:0px; color:#FFF; font-size:14px; padding:14px 0; cursor:pointer;}\
.popme'+this.randData+' .catcher3 .close span {display:none;}\
.popme'+this.randData+' .catcher3 form {float:right; width:327px; margin:0 21px 0 0; display:inline; padding-top:25px;}\
.popme'+this.randData+' .catcher3 form h1 {font-size:30px; color:#141414; margin:0 0 16px 0; padding:0px; line-height:32px;}\
.popme'+this.randData+' .catcher3 form h2 {font-size:16px; color:#000; margin:0 0 8px 0; padding:0; text-transform:uppercase;}\
.popme'+this.randData+' .catcher3 form p {margin:0 0 10px 0; padding:0;}\
.popme'+this.randData+' .catcher3 .p_input {background:url('+imagesBase+'catchers/input.gif) no-repeat; width:327px; height:43px;}\
.popme'+this.randData+' .catcher3 .p_input input {text-align:center; height:28px; margin-top:7px; border:0px; line-height:24px; font-size:18px; font-weight:bold; width:320px; margin-left:3px; background:none;}\
.popme'+this.randData+' .catcher3 .button {background:url('+imagesBase+'catchers/button3.gif); width:203px; height:43px; display:block; margin:0px auto; text-decoration:none; line-height:43px; font-size:16px; font-weight:bold; color:#FFF;}\
.popme'+this.randData+' .catcher3 .button span {display:block; padding-left:28px;}';
	this.data[6].html = '<div class="catcher3">\
	<a href="javascript:murThumb'+this.randData+'.popup.close()" class="close"><span>close</span></a>\
	<div class="pic"><a href="#" onclick="murThumb'+this.randData+'.popup.blink_bg(\'p_input\')"><span class="png"></span><b class="png">'+this.tr(6, 3)+'</b><img src="" alt="" id="murThumbCatcherPic" /><br /><img src="'+imagesBase+'catchers/player.gif" alt="" /></a></div>\
	<form onsubmit="murThumb'+this.randData+'.popup.formSubmit(); return false;" name="email_form">\
		<input type="submit" style="display: none" />\
		<h1>'+this.tr(6, 0)+'</h1>\
		<h2>'+this.tr(6, 1)+'</h2>\
		<p class="p_input"><input name="mailme" id="mailme'+this.randData+'" value="@" onfocus="murThumb'+this.randData+'.popup.email_focus()" onblur="murThumb'+this.randData+'.popup.email_blur()" type="text" /></p>\
		<p><a href="#" class="button" onclick="murThumb'+this.randData+'.popup.formSubmit(); return false;"><span>'+this.tr(6, 2)+'</span></a></p>\
	</form>\
</div>';
}

function dhtmlpop_blink_bg(className, count) { //43
	if (typeof count == 'undefined') count = 0;

	if (count >5) return;

	if (count % 2)
		jQuery("."+className).css("background-position", "0 0");
	else
		jQuery("."+className).css("background-position", "0 -43px");

	setTimeout("murThumb"+this.randData+".popup.blink_bg('"+className+"', "+(count+1)+")", 100);

}

function dhtmlpop_get_translation(popupId, stringId) {
	if (typeof stringId == 'undefined') {
		return this.translations_generic[this.thumbsObject.langue][popupId];
	}
	return this.data[popupId].translations[this.thumbsObject.langue][stringId];
}

function dhtmlpop_init() {
	var d = document;

	var rnum = Math.floor(Math.random() * 3) + 4;
	this.template = typeof this.thumbsObject['dhtmlpop'] != 'undefined' && parseInt(this.thumbsObject['dhtmlpop']) > 0 ? parseInt(this.thumbsObject['dhtmlpop']) - 1 : rnum;
	if (typeof this.data[this.template] == 'undefined')
		this.template = rnum;

	//Include jquery from http://media-z.pornattitude.com/media/pdvs/special/pdv_dynamic/jquery-1.3.1.js
	if (!document.getElementById('jquery')) {
		var head	= document.getElementsByTagName('head')[0];
		var script	= document.createElement('SCRIPT');
		script.type	= 'text/javascript';
		script.id	= 'jquery';
		script.src	= 'http://media-z.pornattitude.com/media/pdvs/special/pdv_dynamic/jquery-1.3.1.js';
		head.appendChild(script);
	}

	//Build dimmer if not already set
	if (d.getElementById('overlay') == null) {
		var div = document.createElement('DIV');
		div.id = 'overlay';
		//div.setAttribute('style', 'height:1005px;filter:alpha(opacity=80); ZOOM: 1');
		div.style.backgroundColor 	= '#000000';
		div.style.display			= 'none';
		div.style.left				= '0';
		div.style.top				= '0';
		div.style.opacity			= '0.8';
		div.style.width				= '100%';
		div.style.zIndex			= '5000';
		if (document.all)
			div.style.position		= 'absolute';
		else
			div.style.position		= 'fixed';
		div.style.filter			= "alpha(opacity=80)";

		document.body.appendChild(div);

		//Iframe hack
		/*var iframe = document.createElement("IFRAME");
		iframe.id = 'murthumbs_iframe';
		iframe.style.display			= 'none';
		iframe.style.left				= '0';
		iframe.style.top				= '0';
		//iframe.style.opacity			= '0.1';
		iframe.style.width				= '100%';
		iframe.style.zIndex				= '4999';
		iframe.frameBorder 				= 0;
		iframe.style.background		 	= 'transparent';
		iframe.style.filter				= 'alpha(opacity=0)';


		if (document.all)
			iframe.style.position		= 'absolute';
		else
			iframe.style.position		= 'fixed';

		document.body.appendChild(iframe);*/
	}

	//CSS
	if (!document.all) {
		var cssText = document.createTextNode(this.data[this.template].css);
		var cssHolder = document.createElement("style");
		cssHolder.type = 'text/css';
		cssHolder.appendChild(cssText);
		document.body.appendChild(cssHolder);
	}else {
		var cssHolder = document.createElement("DIV");
		cssHolder.setAttribute("style", "display: none");
		cssHolder.innerHTML = "&nbsp;<style type='text/css'>"+this.data[this.template].css+"</style>";
		document.body.appendChild(cssHolder);
	}


	var div = d.createElement("DIV");
	div.id = 'dhtmlpop'+this.randData;
	div.className = 'popme'+this.randData;
	div.innerHTML = this.data[this.template].html;
	document.body.appendChild(div);

	this.start_blink();
}

function dhtmlpop_reloadThumbs() {
	if (document.getElementById("image1"+this.randData) == null) return;

	document.getElementById("image1"+this.randData).src = thumbs_catcher[this.randData][0].replace("120x90", this.data[this.template].size);
	document.getElementById("image2"+this.randData).src = thumbs_catcher[this.randData][1].replace("120x90", this.data[this.template].size);
	document.getElementById("image3"+this.randData).src = thumbs_catcher[this.randData][2].replace("120x90", this.data[this.template].size);
	document.getElementById("image4"+this.randData).src = thumbs_catcher[this.randData][3].replace("120x90", this.data[this.template].size);
	document.getElementById("image5"+this.randData).src = thumbs_catcher[this.randData][4].replace("120x90", this.data[this.template].size);
	document.getElementById("image6"+this.randData).src = thumbs_catcher[this.randData][5].replace("120x90", this.data[this.template].size);
}

function dhtmlpop_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;
}

function dhtmlpop_show(picUrl) {
	if (typeof picUrl != 'undefined' && document.getElementById("murThumbCatcherPic") != null) {
		document.getElementById("murThumbCatcherPic").src = picUrl.replace("120x90", "320x240").replace("176x136", "320x240").replace("220x170", "320x240").replace("510x384", "320x240").replace("640x480", "320x240");
		jQuery("#murThumbCatcherPic").css({width: '320px', height: "240px"});
	}else {
		this.reloadThumbs();
	}

	var d = this.dimension_detect();
	var browserName = navigator.appName;
	document.getElementById("overlay").style.height = d.docH + "px";
	//document.getElementById("murthumbs_iframe").style.height = d.docH + "px";
	if (d.viewH > d.docH) {
		document.getElementById("overlay").style.height = d.viewH + "px";
		//document.getElementById("murthumbs_iframe").style.height = d.viewH + "px";
	}
	document.getElementById("overlay").style.display = "block";
	//document.getElementById("murthumbs_iframe").style.display = "block";
	jQuery('embed, object').css("visibility", "hidden");

	var height = jQuery('.popme'+this.randData).height()/6;
	if (document.all) {
		//var newTop = d.top + ((d.viewH - height) / 2);
		var newTop = (d.viewH - height) / 2;
	} else {
		var newTop = (d.viewH - height) / 2;
	}
	jQuery(".popme"+this.randData).animate({top: newTop}, 600);

	if(this.thumbsObject['popunder'] == true && this.popunder == 0){
		var rotationIds = {"hetero":{"fr":10,"en":98,"es":100,"it":99},"gay":{"fr":39,"en":102,"es":104,"it":103}};

		var syn = this.thumbsObject.synergy;
		var langue = this.thumbsObject.langue

		exit_url = "http://www.espace-plus.net/redir/rotation_redir.php?id_rotation="+(rotationIds[syn][langue])+"&w=0&id="+this.thumbsObject.id+"&tracker="+this.thumbsObject.tracker+"_topdv02&lg="+this.thumbsObject.langue+"&synergie="+this.thumbsObject.synergy+"&soft=0&content_niche=&c=0&cat="

		var exit_win = window.open(exit_url, 'popunder_WallOfThumb', 'width=1024, height=900 , toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');
		exit_win.blur();
		window.focus();
		this.popunder = 1;
	}
}

function dhtmlpop_close() {
	jQuery('.popme'+this.randData).animate({top: "-400px"}, 600);
	document.getElementById('overlay').style.display = "none";
	if (jQuery("#murThumbCatcherPic")) {
		jQuery("#murThumbCatcherPic").attr("src", "");
	}
	//document.getElementById('murthumbs_iframe').style.display = "none";
	jQuery('embed, object').css("visibility", "visible");
}

function dhtmlpop_blink(){
	if (this.text_visible){
		this.text_tmp = document.getElementById('mailme'+this.randData).value;
		document.getElementById('mailme'+this.randData).value = '';
		this.text_visible = false;
	}
	else{
		document.getElementById('mailme'+this.randData).value = this.text_tmp;
		this.text_visible = true;
	}
}

function dhtmlpop_start_blink(){
	if (document.getElementById('mailme'+this.randData)) {
		if (document.getElementById('mailme'+this.randData).value=='@'){
			this.text_timer = setInterval('murThumb'+this.randData+'.popup.blink()', 500);
		}
	}
}

function dhtmlpop_stop_blink(){
	if (this.text_timer){
		clearInterval(this.text_timer);
	}
}

function dhtmlpop_email_focus(){
	this.stop_blink();
	e = document.getElementById('mailme'+this.randData);
	if (e.value == '@') e.value = '';
}

function dhtmlpop_email_blur(){
	e = document.getElementById('mailme'+this.randData);
	if (e.value == '@' || e.value == ''){
		e.value = '@';
		this.start_blink();
	}
}

function dhtmlpop_formSubmit(){
	var msgspan = document.getElementById("errorSpan") == null ? false : true;
	var REG_MAIL = /^[\w-\.]{2,}@[\w-]{1,}\./;
	var invalidMailMsg = "Votre email doit &ecirc;tre valable";
	if (this.thumbsObject.langue == 'en')
		invalidMailMsg = "You must enter a valid email!";
	else if (this.thumbsObject.langue == 'it')
		invalidMailMsg = "Inserite uni'ndirizzo email valido !";
	else if (this.thumbsObject.langue == 'es')
		invalidMailMsg = "¡Entre un e-mail válido !";

	if(!REG_MAIL.test(document.getElementById("mailme"+this.randData).value))
	{
		if( msgspan )
		{
			document.getElementById("errorSpan").innerHTML = invalidMailMsg;
			document.getElementById("errorSpan").style.display = "inline";
		}
		else
		{
			alert(invalidMailMsg);
		}
		document.getElementById("mailme"+this.randData).focus();
	}
	else
	{
		if( msgspan )
		{
			document.getElementById("errorSpan").style.display = "none";
		}
		var trackerSuffix = "_r1_murth"+(this.template+1)+""+(this.thumbsObject['synergy'] == "hetero" ? "H" : "G");
		var url = "https://secure.securitetotale.com/cb.php?module=guest_cbsys_preform&w=0&force_step1=1&action=step2&email=" + document.getElementById("mailme"+this.randData).value + "&id=" + this.thumbsObject['id'] + "&tracker=" + this.thumbsObject['tracker'] + "_Gtmb"+(this.template+1)+trackerSuffix+"&synergie=" + this.thumbsObject['synergy'] + "&param=&num_facturation=1&oldrf=pva" + eval('niche_letter_'+this.randData) + "_xxx&langue="+this.thumbsObject.langue+"&rf=pornattitude&id_site="+ (this.thumbsObject['synergy'] == 'hetero' ? 1007 : 1012) + '&name_kit=pornattitude&e=1&legales_color=&id_facturation=';
		window.open(url, 'securitotale');
		this.close();
	}
}
