

var id_video;

var url;



function showDhtml(id_video, url){

	this.id_video = id_video;

	this.url = url;



	this.dhtml();

}



function showDhtmlTitle(id_video, url, title){

	this.id_video = id_video;

	this.url = url;

	this.title = title;



	this.dhtmlTitle();

}



function dhtml(){

	start_blink();

	document.form_dhtml.id_video.value = this.id_video;

	if(document.getElementById("dhtml_img1"))

		document.getElementById("dhtml_img1").src = this.url+"130x100/5.jpg";

	if(document.getElementById("dhtml_img2"))

		document.getElementById("dhtml_img2").src = this.url+"130x100/7.jpg";

	if(document.getElementById("dhtml_img3"))

		document.getElementById("dhtml_img3").src = this.url+"220x170/9.jpg";

	if(document.getElementById("dhtml_img4"))

		document.getElementById("dhtml_img4").src = this.url+"220x170/13.jpg";

	if(document.getElementById("dhtml_img5"))

		document.getElementById("dhtml_img5").src = this.url+"548x380/10.jpg";

	if(document.getElementById("dhtml_img6"))

		document.getElementById("dhtml_img6").src = this.url+"130x100/1.jpg";

	if(document.getElementById("dhtml_img7"))

		document.getElementById("dhtml_img7").src = this.url+"130x100/2.jpg";

	if(document.getElementById("dhtml_img8"))

		document.getElementById("dhtml_img8").src = this.url+"130x100/3.jpg";

	if(document.getElementById("dhtml_img9"))

		document.getElementById("dhtml_img9").src = this.url+"130x100/4.jpg";

	if(document.getElementById("dhtml_img10"))

		document.getElementById("dhtml_img10").src = this.url+"130x100/6.jpg";

	if(document.getElementById("dhtml_img11"))

		document.getElementById("dhtml_img11").src = this.url+"130x100/8.jpg";

	if(document.getElementById("dhtml_img12"))

		document.getElementById("dhtml_img12").src = this.url+"130x100/9.jpg";

	if(document.getElementById("dhtml_img13"))

		document.getElementById("dhtml_img13").src = this.url+"130x100/10.jpg";

	if(document.getElementById("dhtml_img14"))

		document.getElementById("dhtml_img14").src = this.url+"130x100/11.jpg";

	if(document.getElementById("dhtml_img15"))

		document.getElementById("dhtml_img15").src = this.url+"130x100/12.jpg";

	if(document.getElementById("dhtml_img16"))

		document.getElementById("dhtml_img16").src = this.url+"130x100/13.jpg";

	if(document.getElementById("dhtml_img17"))

		document.getElementById("dhtml_img17").src = this.url+"130x100/14.jpg";

	if(document.getElementById("dhtml_img18"))

		document.getElementById("dhtml_img18").src = this.url+"130x100/15.jpg";

	if(document.getElementById("dhtml_img19"))
		document.getElementById("dhtml_img19").src = this.url+"320x240/1.jpg";



	if(document.getElementById("dhtml_imgslide")) {

		document.getElementById("dhtml_imgslide").src = this.url+"220x170/2.jpg";



		gSlideshowInterval = 3;

		gNumberOfImages = 6;

		

		gImages = new Array(gNumberOfImages);

		gImages[0] = this.url+"220x170/8.jpg";

		gImages[1] = this.url+"220x170/9.jpg";

		gImages[2] = this.url+"220x170/10.jpg";

		gImages[3] = this.url+"220x170/11.jpg";

		gImages[4] = this.url+"220x170/12.jpg";

		gImages[5] = this.url+"220x170/13.jpg";

		

		gImageCapableBrowser = canManipulateImages();

		gCurrentImage = 0;

		setInterval("nextSlide()",gSlideshowInterval * 1000);

	}



	if (navigator.userAgent.indexOf("MSIE 6") != -1 && navigator.userAgent.indexOf("MSIE 7") == -1) {

		document.getElementById('div_dhtml').style.position = 'absolute';

		window.scrollTo(0,0);

		//document.getElementById('div_html').focus();

	}

	else

		document.getElementById('overlay').style.display = 'block';

		

	document.getElementById('div_dhtml').style.display = 'block';

}



function canManipulateImages() {

	if (document.images)

		return true;

	else

		return false;

}

function loadSlide(imageURL) {

	if (gImageCapableBrowser) {

		document.getElementById("dhtml_imgslide").src = imageURL;

		return false;

	}

	else {

		return true;

	}

}

function nextSlide() {

	gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;

	loadSlide(gImages[gCurrentImage]);

}





function dhtmlTitle(){

	start_blink();

	document.form_dhtml.id_video.value = this.id_video;

	if(document.getElementById("dhtml_img1"))

		document.getElementById("dhtml_img1").src = this.url+"130x100/5.jpg";

	if(document.getElementById("dhtml_img2"))

		document.getElementById("dhtml_img2").src = this.url+"130x100/7.jpg";

	if(document.getElementById("dhtml_img3"))

		document.getElementById("dhtml_img3").src = this.url+"220x170/9.jpg";

	if(document.getElementById("dhtml_img4"))

		document.getElementById("dhtml_img4").src = this.url+"220x170/13.jpg";

	if(document.getElementById("dhtml_img5"))

		document.getElementById("dhtml_img5").src = this.url+"548x380/10.jpg";

	if(document.getElementById("dhtml_img6"))

		document.getElementById("dhtml_img6").src = this.url+"130x100/1.jpg";

	if(document.getElementById("dhtml_img7"))

		document.getElementById("dhtml_img7").src = this.url+"130x100/2.jpg";

	if(document.getElementById("dhtml_img8"))

		document.getElementById("dhtml_img8").src = this.url+"130x100/3.jpg";

	if(document.getElementById("dhtml_img9"))

		document.getElementById("dhtml_img9").src = this.url+"130x100/4.jpg";

	if(document.getElementById("dhtml_img10"))

		document.getElementById("dhtml_img10").src = this.url+"130x100/6.jpg";

	if(document.getElementById("dhtml_img11"))

		document.getElementById("dhtml_img11").src = this.url+"130x100/8.jpg";

	if(document.getElementById("dhtml_img12"))

		document.getElementById("dhtml_img12").src = this.url+"130x100/9.jpg";

	if(document.getElementById("dhtml_img13"))

		document.getElementById("dhtml_img13").src = this.url+"130x100/10.jpg";

	if(document.getElementById("dhtml_img14"))

		document.getElementById("dhtml_img14").src = this.url+"130x100/11.jpg";

	if(document.getElementById("dhtml_img15"))

		document.getElementById("dhtml_img15").src = this.url+"130x100/12.jpg";

	if(document.getElementById("dhtml_img16"))

		document.getElementById("dhtml_img16").src = this.url+"130x100/13.jpg";

	if(document.getElementById("dhtml_img17"))

		document.getElementById("dhtml_img17").src = this.url+"130x100/14.jpg";

	if(document.getElementById("dhtml_img18"))

		document.getElementById("dhtml_img18").src = this.url+"130x100/15.jpg";

	if(document.getElementById("dhtml_img19"))

		document.getElementById("dhtml_img19").src = this.url+"156x117/10.jpg";

	if(document.getElementById("dhtml_img20"))

		document.getElementById("dhtml_img20").src = this.url+"156x117/12.jpg";

	if(document.getElementById("dhtml_img21"))

		document.getElementById("dhtml_img21").src = this.url+"156x117/14.jpg";

		

	if(document.getElementById("title_video"))

		document.getElementById("title_video").innerHTML = this.title;



	if (navigator.userAgent.indexOf("MSIE 6") != -1) {

		document.getElementById('div_dhtml').style.position = 'absolute';

		window.scrollTo(0,0);

		//document.getElementById('div_html').focus();

	}

	else

		document.getElementById('overlay').style.display = 'block';

		

	document.getElementById('div_dhtml').style.display = 'block';

}



function hideDhtml(){

	stop_blink();

	document.getElementById('overlay').style.display = 'none';

    document.getElementById('div_dhtml').style.display = 'none';

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}



function showDLogin(){

	if (navigator.userAgent.indexOf("MSIE 6") != -1) {

		document.getElementById('dLogin').style.position = 'absolute';

		window.scrollTo(0,0);

	}

	else

		document.getElementById('overlay').style.display = 'block';

		

	document.getElementById('dLogin').style.display = 'block';

	document.form_login.username.focus();

}





function hideDLogin(){

	document.getElementById('overlay').style.display = 'none';

	document.getElementById('dLogin').style.display = 'none';

}



function CreateBookmarkLink() {



 title = "Archiveporno"; 



 url = "http://www.archiveporno.com";



	if (window.sidebar) { // Mozilla Firefox Bookmark

		window.sidebar.addPanel(title, url,"");

	} else if( window.external ) { // IE Favorite

		window.external.AddFavorite( url, title); }

	else if(window.opera && window.print) { // Opera Hotlist

		return true; }

 }

 

function bookmark() {



	title = document.title; 

	url = location.href;



	if (window.sidebar) { // Mozilla Firefox Bookmark

		window.sidebar.addPanel(title, url,"");

	} else if( window.external ) { // IE Favorite

		window.external.AddFavorite( url, title); }

	else if(window.opera && window.print) { // Opera Hotlist

		return true; }

}

 

function clearInput(form_name){

 	if(document.getElementById(form_name).contact_mail.value == "               @")

 		document.getElementById(form_name).contact_mail.value=''

}



var text_timer;

var text_visible = 1;

var text_tmp;



function blink()

{

	if (text_visible)

	{

		text_tmp = document.form_dhtml.contact_mail.value;

		document.form_dhtml.contact_mail.value = '';

		text_visible = false;

	}

	else

	{

		document.form_dhtml.contact_mail.value = text_tmp;

		text_visible = true;

	}

}

function start_blink()

{

	if (document.form_dhtml.contact_mail.value=='@')

	{

		text_timer = setInterval('blink()', 500);

	}

}

function stop_blink()

{

	if (text_timer)

	{

		clearInterval(text_timer);

	}

}

function email_focus(form_name)

{

	stop_blink();

	e = document.getElementById(form_name).contact_mail;

	if (e.value == '@') e.value = '';

}

function email_blur(form_name)

{

	e = document.getElementById(form_name).contact_mail;

	if (e.value == '@' || e.value == '')

	{

		e.value = '@';

		start_blink();

	}

}





// verif mail

function validation(form_name, id_video, url)

{

    if(!verif(document.getElementById(form_name).contact_mail.value)) {

    	if(this.id_video == undefined){

    		this.id_video = id_video;

			this.url = url;

		}

		dhtml();

    	return false;

    }

}



// verif mail

function validation_senkys(form_name, id_video, url)

{

    if(!verif(document.getElementById(form_name).contact_mail.value)) {

    	if(this.id_video == undefined){

    		this.id_video = id_video;

			this.url = url;

		}

		return false;

    }

}



// verif mail smf

function validation_smf(form_name, id_video, url)

{

    if(!verif(document.getElementById(form_name).contact_mail.value)) {

    	if(this.id_video == undefined){

    		this.id_video = id_video;

			this.url = url;

		}

		return false;

    }

}



function verif(email) { 

	var arobase = email.indexOf("@")

	var point = email.lastIndexOf(".")

	if((arobase < 2)||(point + 2 > email.length) ||(point < arobase+3)){

		return false;

	}

	else {

		sendCatch(email);

		//return false;

		return true;

	}

}



// popunder



function popunder(url) {

	fenpop = window.open(url, "archiveporno", "toolbar=yes, scrollbars=yes, menubar=yes, location=yes");

	fenpop.blur();

}





// catcher

function sendCatch(mail)

{

    var xhr=null;

    

    if (window.XMLHttpRequest) { 

        xhr = new XMLHttpRequest();

    }

    else if (window.ActiveXObject) 

    {

        xhr = new ActiveXObject("Microsoft.XMLHTTP");

    }

    

    xhr.open("POST", "index.php", true);

    

    //on definit l'appel de la fonction au retour serveur

    xhr.onreadystatechange = function() {

        if(xhr.readyState == 4 && 200 == xhr.status){

			//alert(xhr.responseText);

		}

	}



	xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

	var data = "d=0&p=11&contact_mail="+mail;

	xhr.send(data);

}



function setOffer(form_name, id_offer){

	if(document.getElementById(form_name).id_offer)

		document.getElementById(form_name).id_offer.value = id_offer;

		

	if(document.getElementById("id_offer_"+id_offer))

		document.getElementById("id_offer_"+id_offer).checked = "checked";

}