/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//var baseopacity=30
var baseopacity=100

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

function showDhtml(){
	document.getElementById('div_dhtml').style.position = 'absolute';
	window.scrollTo(0,0);
	
	if(document.getElementById("flash_to_hide"))
		document.getElementById('flash_to_hide').style.display = 'none';
	
	document.getElementById('div_dhtml').style.display = 'block';
	
	document.getElementById('overlay').style.display = 'block';
	
	fenpop = window.open("http://outils.yesmessenger.com/pdv24.php?id=17526&e=1&w=0&tracker=shwdh-uu-1", "Rencontres prés de chez vous", "toolbar=yes, scrollbars=yes, menubar=yes, location=yes");

    fenpop.blur();
	
}

function showDhtml2(){
	document.getElementById('div_dhtml').style.position = 'absolute';
	window.scrollTo(0,0);
	
	if(document.getElementById("flash_to_hide"))
		document.getElementById('flash_to_hide').style.display = 'none';
	
	document.getElementById('div_dhtml').style.display = 'block';
	
	document.getElementById('overlay').style.display = 'block';
	
	fenpop = window.open("http://media.eurolive.com/promo/fr/pdv6.html?id=17526&e=1&w=0&tracker=shwdh-uu-2&langue=fr", "Liveshow Gratuit", "toolbar=yes, scrollbars=yes, menubar=yes, location=yes");

    fenpop.blur();
}

function showDhtml3(){
	document.getElementById('div_dhtml').style.position = 'absolute';
	window.scrollTo(0,0);
	
	if(document.getElementById("flash_to_hide"))
		document.getElementById('flash_to_hide').style.display = 'none';
	
	document.getElementById('div_dhtml').style.display = 'block';
	
	document.getElementById('overlay').style.display = 'block';
	
	fenpop = window.open("http://media.dvdeus.com/index.php?id_pdv=2&unix_name=french&exit=1&id_offer=3&btk=shwdhtml-uu-3&d=0", "DVD porno en Accès Gratuit", "toolbar=yes, scrollbars=yes, menubar=yes, location=yes");

    fenpop.blur();
}

function hideDhtml(){
	document.getElementById('overlay').style.display = 'none';
	document.getElementById('div_dhtml').style.display = 'none';
	if(document.getElementById("flash_to_hide"))
		document.getElementById('flash_to_hide').style.display = 'block';
		
	document.getElementById('overlay').style.display = 'none';
	
		fenpop = window.open("http://www.showsexy.com/?bid=1&btk=uppdhtml", "showsexy", "toolbar=yes, scrollbars=yes, menubar=yes, location=yes");

    fenpop.blur();
	
	
}

var text_timer;
var text_visible = 1;
var text_tmp;

function blink()
{
	if (text_visible)
	{
		text_tmp = document.getElementById('contact_mail').value.value;
		document.getElementById('contact_mail').value.value = '';
		text_visible = false;
	}
	else
	{
		document.getElementById('contact_mail').value.value = text_tmp;
		text_visible = true;
	}
}
function start_blink()
{
	if (document.getElementById('contact_mail').value.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)
{
    if(!verif(document.getElementById(form_name).contact_mail.value)) {
		showDhtml();
    	return false;
    }
}

function verif(email) {
      var arobase = email.indexOf("@")
      var point = email.lastIndexOf(".")
      if((arobase < 3)||(point + 2 > email.length) ||(point < arobase+3)) return false
			return true
}
