//*		FONCTIONS UTILITAIRES	*//

function PopupVideo (url) { 
	nomfenetre = "popvideos"; 
	var w = window.open (url,nomfenetre,"width=930,height=535,toolbar=no,location=no,status=no,scrollbars=no,menubar=no,resizable=no") ;
	w.document.close();
	w.focus();
}

function Popuplangue (url) { 
	nomfenetre = "langue"; 
	var w = window.open (url,nomfenetre,"width=550,height=75,toolbar=no,location=no,status=no,scrollbars=no,menubar=no,resizable=no") ;
	w.document.close();
	w.focus();
}

function Popuplangueetvideo (url) { 
	nomfenetre = "langue"; 
	var w = window.open (url,nomfenetre,"width=550,height=550,toolbar=no,location=no,status=no,scrollbars=no,menubar=no,resizable=no") ;
	w.document.close();
	w.focus();
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function PopupGalerie (url) { 
	nomfenetre = "popgalerie"; 
	var w = window.open (url,nomfenetre,"width=700,height=550,toolbar=no,location=no,status=no,scrollbars=no,menubar=no,resizable=no") ;
	w.document.close();
	w.focus();
}

function message_status() {
	window.status=("Nimportequi.com - Les vidéos");
}

// Compatible IE5+ / NN6+ / Mozilla
function twPopupImage(img, titre) { 
  
  oFenetre = window.open('','Image','width=200,height=200,toolbar=no,scrollbars=yes,resizable=yes');
  oFenetre.document.write("<html><head><title>"+titre+"</title></head>"); 
  oFenetre.document.write("<script type=\"text/javascript\">function twAjustePopUp() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+30,document.images[0].height+40); window.focus();} else { setTimeout('twAjustePopUp()',1000) } }</"+"script>");
  oFenetre.document.write("<body onload='twAjustePopUp()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>"); 
  oFenetre.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><tr><td valign='middle' align='center'>"); 
  oFenetre.document.write("<img src='"+img+"' border='0' alt='"+titre+"' title='"+titre+"'>");
  oFenetre.document.write("</td></tr></table></body></html>"); 
  oFenetre.document.close(); 
}

//*	FONCTIONS DE MISE EN PAGE	*//

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 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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

function verif_form()
{
 if(document.formulaire.message.value == "")  {
   alert("Veuillez entrer votre nom svp");
   document.formulaire.nom.focus();
   alert("Error");
   return false;
  }
   else
   	 if(document.formulaire.exp_mail.value == "") {
   		alert("Veuillez entrer votre prenom svp");
   		document.formulaire.prenom.focus();
   		alert("Error");
   		return false;
  	}
   	else
   		if(document.formulaire.exp_nom.value == "") {
   			alert("Veuillez entrer votre adresse electronique svp");
   			document.formulaire.email.focus();
   			alert("Error");
   			return false;
  		}
  		else
  			return true
}


//alterner contenu de div passées en paramatres
function alternerDiv(divVisible, divInvisible){

if(document.getElementById(divVisible).style.display == "none")
document.getElementById(divVisible).style.display = 'block';
else 
document.getElementById(divVisible).style.display = 'none';


if(document.getElementById(divInvisible).style.display == "block")
document.getElementById(divInvisible).style.display = 'none';
else 
document.getElementById(divInvisible).style.display = 'block';
	/*divVisible.style.display = 'block';
	divInvisible.style.display = 'none';
*/
	
setTimeout("alternerDiv('"+divVisible+"', '"+divInvisible+"')",7000);
}


function alterner_pellicule(id_pellicule_a_afficher){
	for (i=0; i<=2; i++)
	{
		if (id_pellicule_a_afficher != 'wrap_'+i){
			document.getElementById('wrap_'+i).style.display = 'none';
			document.getElementById('bouton_pelloch_'+i).className = 'pelloch';
		}
		else{		
			document.getElementById('bouton_pelloch_'+i).className = 'current_pelloch';
			document.getElementById(id_pellicule_a_afficher).style.display = 'block';
		}
	}
	
}


function orderby(ordonne){
	document.tri.ordre.value =ordonne;
	document.tri.submit(); 
}



function clearSearch(){
	document.formvideosearch_top.videorecherche.value="";
	document.formvideosearch_bottom.videorecherche.value="";
	
}



function afficher_populaires(div_affiche, total_div){
	for (i=1;i<=total_div;i++){
		document.getElementById('populaire_'+i).style.display = 'none';
	}
	document.getElementById('populaire_'+div_affiche).style.display = 'block';
}