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

function MM_reloadPage(init) {  //Netscape 4 Resize Fix
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//Changement de style d'un objet

function newstyle(idf,prop,value)
{
	if (!DHTML) return; 
	var x = MM_findObj(idf);
	
	if (!document.layers)
	{
		x = x.style;
	}
     
     eval('x.' + prop + '="' + value + '"' );
}

//Fonction de défilement des textes d'intro

editoText = new Array();
editoText[1] = "titre_edito";
editoText[2] = "text_edito";
num_edit = 1;
nb_edit = 4;

function defileText()
{
	if(MM_findObj('titre_edito1'))
	{
	
		if(num_edit > nb_edit) num_edit = 1;
		num_edit_prec = (num_edit == 1) ? nb_edit : (num_edit - 1);
		
		for(i = 1 ; i < 3 ; i++)
		{
			var obj1 = MM_findObj(editoText[i] + num_edit_prec);
			var obj2 = MM_findObj(editoText[i] + num_edit);
			
			if (!document.layers)
			{
				obj1 = obj1.style;
				obj2 = obj2.style;
			}
			
			eval( "obj1.visibility = 'hidden'" );
			eval( "obj2.visibility = 'visible'" );
		}
		
		num_edit++;
		
		cpt = setTimeout("defileText()",7000);
	}
}

function verif_rech_motcle(masque, val)
{
	if (	(val == "") || (val == masque) || (val.length == 1 ) )
	 { 
		 alert('Veuillez taper un mot dans le champ de recherche SVP...'); 
		 return false; 
	 } 
}
function verif_rech_metier(val)
{
	if (val == "")
	 { 
		 alert('Veuillez choisir un métier dans la liste SVP...'); 
		 return false; 
	 } 
}
function change_action()
{
	document.form_trade.action = document.form_trade.metier.value;
}
//Fonction qui vide le contenu du champ
function vide_champ(field,rech) 
{ 
	val = field.value;
	
	if (val == rech) 
	{
		field.value = "";
	} 
}

function popinfo(v)
{
	var positiontop=document.body.clientHeight/2;
	var positionleft=document.body.clientWidth-600;
	winopened = window.open(url_popup+'commun/popup/popinfo.php?v=' + v ,'popinfo','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=600,height=200,top='+ positiontop +',left='+ positionleft);
	winopened.focus();
}

function popprint(v)
{
	var hauteur = document.body.clientHeight;
	var longueur= document.body.clientWidth-100;
	winopened = window.open(url_popup+'commun/popup/popprint.php?v=' + v ,'popprint','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=' + longueur + ',height=' + hauteur + ',top=50,left=50');
	winopened.focus();
}
function popcnil()
{
	var positiontop=document.body.clientHeight/2;
	var positionleft=document.body.clientWidth-600;
	winopened = window.open(url_popup+'commun/popup/popcnil.php','popcnil','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=600,height=200,top='+ positiontop +',left='+ positionleft);
	winopened.focus();
}

function jvsPOPUPwebcallback_ok()
{
	window.open(url_popup+"commun/popup/popwebcallback.php", "popuplinkeo", "width=400,height=370,top=5,left=5,toolbar=no,location=no, directories=no,status=no,scrollbars=no,resizable=1");
}
var url_popup="";
