// JavaScript Document
var pas=1;
var pos= 0;
var vit = 5;
var pause = 2000;
var incr = 0;
var hauteur = 102;
var page = 0;
var tem;
	
function move(){
	var obj = document.getElementById("Layer2");
	pos -= pas;
	
	obj.style.top = pos + 'px';
	incr++;
	
	if(page >= nb_page){
	page=0;
	pos=hauteur;
	} 
	
	if(incr >= hauteur) {
		stop_defil();
	} else {
		tem = setTimeout("move()", vit);
	}
}

function stop_defil(){
	incr=0;
	page++;
	clearTimeout(tem);
	if(nb_page>1){
		tem = setTimeout("move()", pause);
	}
}


function menu(etat, no){
	var obj2 = document.getElementById("im_" + no);
	if(etat == 1) {
		obj2.style.visibility="visible";
	} else {
		obj2.style.visibility="hidden";
	}
}

function open_pop_actu(id_actu){
	var no_img=no+1;
	var url = 'pop_actu.php?no_img=' + no_img + '&id_actu=' + id_actu;
	window.open(url, 'zoom', 'toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=450, height=450');
}

function open_pop(page){
	window.open(page, 'pop', 'toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=600, height=450');
}
function open_pop2(path){
	var url = 'view_photo.php?path=images/' + path;
	window.open(url, 'zoom', 'toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=500, height=500');
}
function open_question(id){
		var url = "pop_questions.php?id_question=" + id;
		window.open(url,"question","menubar=no, status=no, scrollbars=yes, menubar=no, width=530, height=350");
}
function open_infos(page){
		window.open(page,"pratiques","menubar=no, status=no, scrollbars=yes, menubar=no, width=440, height=400");
}
function open_astuce(page){
		window.open(page,"pratiques","menubar=no, status=no, scrollbars=yes, menubar=no, width=470, height=270");
}

function DeCrypt(un, deux, trois, id)
{
	//var un = "cosinus";
	//var deux = "be";
	//var trois = "info";
	var at = "@";
	var mailto = "mailto:";
	var point =".";
	window.document.getElementById(id).href = mailto+trois+at+un+point+deux ;
} 