// JavaScript Document
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];}
}

/////////////////////////HIGHLIGHT/////////////////

function open_highlight(index,tot)
{
	close_all_highlight(tot);
	document.getElementById("HG_"+index).className="ShowHighlight";
	document.getElementById("HG_Img_"+index).className="ShowHighlight";
	
	///return false;

}

function close_all_highlight(tot)
{
	
	for(i=0;i<tot;i++){
		document.getElementById("HG_"+i).className="hideHighlight";
		document.getElementById("HG_Img_"+i).className="hideHighlight";	
	}
	//return false;		

}

/////////////////////////ARTISTE/////////////////

function open_galerieartiste(index,tot,altezza)
{
	//alert(altezza);
	close_all_galerieartiste(tot);
	//document.getElementById("photogalerie").offsetHeight=altezza;
	document.getElementById("AR_Img_"+index).className="ShowHighlight";
	
	///return false;

}

function close_all_galerieartiste(tot)
{
	//document.getElementById("photogalerie").offsetHeight=0;
	for(i=0;i<tot;i++){
		//document.getElementById("AR_0").className="hideHighlight";	
		document.getElementById("AR_Img_"+i).className="hideHighlight";	
	}
	//return false;		

}
////////////////////SWF///////////////

function writeswfartiste(){

var hauteur=document.getElementById('lyr1revue').offsetHeight;
var npage=Math.ceil(hauteur/368);
//alert(npage);

tab_pager+="<table height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"noir12\">";
tab_pager+="<tr>";
		
		for(i=0;i<(npage);i++){	
			tab_pager+="  <td width=\"21\" height=\"20\" align=\"center\" class=\"trait_v_gauche\"><a href=\"javascript:move_layer("+(-368*i)+")\" class=\"chiffres\" onClick='change_style("+i+")' id='page"+i+"'>"+(i+1)+"</a></td>";
		}
		
tab_pager+="</tr>";
tab_pager+="</table>";
//alert(tab_pager);
//alert("position="+document.getElementById('lyr1').offsetTop);
document.getElementById('pager').innerHTML=tab_pager;
}


/////////////////////////////////////////
//////POPUP
function open_pupup(url,titre,largeur,hauteur){
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(url,titre,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+",menubar=no,scrollbars=yes,statusbar=no");
	
}
//////POPUP
function open_pupup_noscroll(url,titre,largeur,hauteur){
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(url,titre,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+",menubar=no,scrollbars=no,statusbar=no");
	
}
///POP UP IMAGE
function popimage(url,W,H){
open_pupup_noscroll("pop_image.php?path="+url,"image",W,H);

}

/////VIDEO
//javascript:show_video('http://mondomix-planet.com/productions/accords-croises/Publish/artiste/1/movie.flv')
function show_video(path){
	
					///POP UP
					open_pupup_noscroll("../video_player/player.php?video="+path,'video_player',320,240);
				
	

}
/////VIDEO
//javascript:show_audio('http://mondomix-planet.com/productions/accords-croises/Publish/track/1/901958a.mp3')
function show_audio(path){

					///POP UP
					open_pupup_noscroll("../player_audio/player.php?Path="+path,'audio_player',280,150);
				
	

}

/////diaporama
function pop_diapo(id){
	
					///POP UP
					open_pupup_noscroll("diapo/diaporama.php?diaporama_id="+id,'diaporama',450,360);
				
	

}

/////diaporama
function show_agenda(id){
	
					///POP UP
					open_pupup("pop_agenda.php?agenda_id="+id,'agenda',450,360);
				
	

}

/////diaporama
function opennews(id,type){
	
					///POP UP
					open_pupup("news.php?id="+id+"&type="+type,'news',630,400);
				
	

}
/////diaporama
function newsletter(){
	
			mesErr="";	
			email=document.getElementById("email").value;
	
			poset=email.indexOf("@");
			pospunto=email.indexOf(".");

					if(poset==-1||pospunto==-1||!email)mesErr="Email no correcto";
							
							//mesErr="E-Mail not correct";
				
					
					
					if(mesErr!=""){
					window.alert(mesErr);
					}else{
					///POP UP
					open_pupup_noscroll("../pop_newsletter.php?lng=ES&email="+email,'newsletter',450,250);
					}
	
	
					
				
	

}
////RECHERCHE
function search(){
	var kwords;
	kwords=document.getElementById("kwords").value;	
	document.location="search.php?kwords="+kwords;	
}

function check_mail(){
	var email,poset,pospunto,mesErr;
	
	mesErr="";	
	email=document.finscription.email.value;
	
	poset=email.indexOf("@");
	pospunto=email.indexOf(".");

					if(poset==-1||pospunto==-1||!email)mesErr="E-Mail not correct";
							
							//mesErr="E-Mail not correct";
				
					
					
					if(mesErr!=""){
					window.alert(mesErr);
					}else{
					///POP UP
					document.finscription.submit();
					}
	

}


function open_intervenant(id,lng){
	
	
					///POP UP
					open_pupup("../pop_biointerv.php?intervenant_id="+id+"&lng="+lng,'intervenant',450,360);
	
}
