
function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function deselect(e)
{return false;}
function select()
{return true;}
document.onselectstart=new Function("return false");
if (window.sidebar)
{
document.onmousedown=deselect;
document.onclick=select;
}


function refresh()
	{
	document.location.reload();
                return false;
	}
document.oncontextmenu = refresh;


function NoError()
	{
	return true;
	}
window.onerror=NoError;


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 objet() {
this.length = objet.arguments.length
for (var i = 0; i < this.length; i++) this[i+1] = objet.arguments[i]
}
var nom = new objet ("google1.gif", "position.gif");
var numero = 1;
function changer() {
document.image.src = "images/"+nom[numero];
numero += 1;
if (numero == nom.length + 1) numero = 1;
setTimeout("changer()", 1500);
}

function popup(page) {
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'popup','width=319,height=430,toolbar=true,scrollbars=1');	
}

function popup1(page) {
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'popup','width=760,height=580,toolbar=true,scrollbars=1');	
}

function popup2(page) {
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'popup','width=520,height=380,toolbar=true,scrollbars=1');	
}

function popup3(page) {
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'popup','width=600,height=500,toolbar=true,scrollbars=1');	
}

function popup6(page) {
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'popup','width=760,height=350,toolbar=true,scrollbars=0');	
}


function popup7(page) {
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'popup','width=630,height=580,toolbar=true,scrollbars=1');	
}

function popup11(page) {
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur
	window.open(page,'popup','width=700,height=500,toolbar=true,scrollbars=1');	
}

function spop( fichier, nom, largeur, hauteur, options )
{
var id = Math.round( Math.random() * 100 );
var gauche = ( screen.width - largeur ) / 2;
var haut = ( screen.height - hauteur ) / 2;
if ( options )
{
options = 'width=' + largeur + 'px, height=' + hauteur + 'px,  top=' + haut + ', left=' + gauche + ', ' + options;
	}
else
{
options = 'width=' + largeur + 'px, height=' + hauteur + 'px,  top=' + haut + ', left=' + gauche;
	}
document.open( fichier, nom + id, options );
	}
	
function showdetails(person)
{
x = details.x;
y = details.y;
h = details.h;
w = details.w;
ct = details.ct;
cb = details.cb;
cl = details.cl;
cr = details.cr;
css = details.css;
if(who!=''){who.clipIt(0,0,0,0,20);who.nodragdrop();}
person.moveIt(x,y);person.showIt(); 
person.clipIt(ct,500,270,cl,20); // 510*270 étant les dimensions des fiches contacts
person.dragdrop();
who = person;
}

var who='';
function init_em()
{
details = new lib_obj('detailsDIV');
instantm = new lib_obj('instantmDIV');
coord = new lib_obj('coordDIV');
mmails = new lib_obj('mmailsDIV');
// Cacher les fiches des contacts
instantm.h=0;instantm.w=0;
coord.h=0;coord.w=0;
mmails.h=0;mmails.w=0;
instantm.hideIt();
details.showIt();
details.nodragdrop();
// Positionner les contacts sur la zone
x = details.x;
y = details.y;
instantm.moveIt(x,y);instantm.clipIt(0,0,0,0,740);
coord.moveIt(x,y);coord.clipIt(0,0,0,0,740);
mmails.moveIt(x,y);mmails.clipIt(0,0,0,0,740);
// details.centerIt();
//bloc.dragdrop();
}

function hide_wait()
{
// Cacher le div du téléchargement en cours
var nava = (document.layers);
var dom = (document.getElementById);
var iex = (document.all);
if (nava) { waitDIVobj = document.waitDIV }
else if (dom) { waitDIVobj = document.getElementById("waitDIV").style }
else if (iex) { waitDIVobj = waitDIV.style }
waitDIVobj.visibility = "hidden";
//et affichet le div pricipal de la page
if (nava) { mainDIVobj = document.mainDIV }
else if (dom) { mainDIVobj = document.getElementById("mainDIV").style }
else if (iex) { mainDIVobj = mainDIV.style }
mainDIVobj.visibility = "visible";
}

function emailCheck(txt) {
  if (txt.indexOf("@")<3)return false;
  return true;
 }
 //###################################################################
 // Pour envoyer les données au module de contacts dans une chromless
 //###################################################################
 function Send_This()
 { 
    window.name="origine";
	nom = document.forms['contacts']['nom'].value;
	email = document.forms['contacts']['email'].value;
	tel = document.forms['contacts']['tel'].value;
	sujet = document.forms['contacts']['sujet'].value;
	message = document.forms['contacts']['message'].value;
    theURL="contacts/rcontact19d1.html?nom="+nom+"&email="+email+"&tel="+tel+"&sujet="+sujet+"&message="+message;
	//theURL = "index.php";
	//document.model_form.form_sresultcontent.value = theURL;
	// Paramètres de la Chromeless Window
	wname ="MODEL_TESTER";
	W=510;
	H=270;
	windowCERRARa 		= "scripts/chromeless/img/close_a.gif";
	windowCERRARd 		= "scripts/chromeless/img/close_d.gif";
	windowCERRARo 		= "scripts/chromeless/img/close_o.gif";
	windowNONEgrf 		= "scripts/chromeless/img/none.gif";
	windowCLOCK		    = "scripts/chromeless/img/clock.gif";
	windowREALtit		= " Test du modèle de résultats ..."
	windowTIT 	    	= "<font face=verdana size=1 color='#ff3300'><b>&nbsp;  Veuillez patienter quelques instant...</b></font>";
	windowBORDERCOLOR   	= "#000000";
	windowBORDERCOLORsel	= "#000000";
	windowTITBGCOLOR    	= "#FFEFA1";
	windowTITBGCOLORsel 	= "#FFCC00";
	z=openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel);
   //if (z.opener == null) {z.opener = self;}
} 
// Vérifier que tous les champs ont été bien remplis
function validateform()
{
var mess =new String();
if (document.forms['contacts']['nom'].value =="")mess= "Vous devez saisir votre nom";
if (!emailCheck(document.forms['contacts']['email'].value))mess+= "\n Votre adresse email semble erronée. veuillez reverifier";
if (document.forms['contacts']['sujet'].value=="")mess+= "\n Vous devez saisir un sujet pour votre message";
if (document.forms['contacts']['message'].value=="")mess+= "\n Vous devez saisir votre message";
if(mess!="") alert(mess);
else {Send_This();}
}
// Et pour pouvoir sélectionner dans le div
function ResetEvents()
{
 document.onmousemove="";
 document.onmousedown="";
 document.onmouseup="";
}

function gotourl(url)
{
location=url;
}
