function showNext(param){
	id_video = document.getElementById("select_next").value;
	//window.open("index.php?p=7&id_video="+id_video+param, "_parent");
	window.open("index.php?p=22#id"+id_video, "_parent");
}

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

var id_video;
var url;
var scene;

function showDhtml(id_video, url, scene){
	
	if(!id_video)
		this.id_video = 1;
	else
		this.id_video = id_video;
	
	if(!url)
		this.url = '';
	else
		this.url = url;
	
	if(!scene)
		this.scene = 1;
	else
		this.scene = scene;

	this.dhtml();
}

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+this.scene+"/160/1.jpg";
	if(document.getElementById("dhtml_img2"))
		document.getElementById("dhtml_img2").src = this.url+this.scene+"/160/2.jpg";
	if(document.getElementById("dhtml_img3"))
		document.getElementById("dhtml_img3").src = this.url+this.scene+"/160/3.jpg";
	if(document.getElementById("dhtml_img4"))
		document.getElementById("dhtml_img4").src = this.url+this.scene+"/160/4.jpg";
	if(document.getElementById("dhtml_img5")){
		document.getElementById("dhtml_img5").src = this.url+this.scene+"/160/5.jpg";
	}
	if(document.getElementById("dhtml_img6")){
		document.getElementById("dhtml_img6").src = this.url+this.scene+"/160/6.jpg";
	}
	if(document.getElementById("dhtml_cover")){
		document.getElementById("dhtml_cover").src = this.url+"150-1.jpg";
	}
	
	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';
	
	
	if(document.getElementById("flash_to_hide"))
		document.getElementById('flash_to_hide').style.visibility = 'hidden';
		
	document.getElementById('div_dhtml').style.display = 'block';
}

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.visibility = 'visible';
}


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;
    }
    if (document.getElementById(form_name).majorite.checked == false) {
    	dhtml();
    	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
}
