// JavaScript Document
var nom;
var rnom;
var rnom2;
var clq;
var idCalque;
var CS;
var y = 0;
var x = 0;
var ref;
var formulaire;
var txt;
var position;
var envoi;

function styleCalque(idCalque)
		{
		  //if (document.all) {calqueStyle = document.all[idCalque].style; }
		  
		  if (document.layers) {calqueStyle = document.layers[idCalque]; }
		  if (document.getElementById) {calqueStyle = document.getElementById(idCalque).style; }
		  
		  return calqueStyle;
		}
function fermerFenetre()
{
	window.close();
	
}
		
function dossier(fichier,nm)
{
	
	if (fichier == "Commercial") { var fic = "candidature.php?f=1";} else {var fic = "candidature.php?f=0&n="+nm;}
	var fen = window.open(fic, '_blank', 'width=820,height=733,scrollbars=yes');
	fen.focus();
}

function confirmSup()
{
	if (confirm("Attention vous êtes sur le point de supprimer l'offre\nsélectionnée et tout ce qui y est attaché.\n\nContinuer ?\n\n"))
	{
		return true;
	}
	else
	{
		return false;
	}
	

}
		
function verifenvoi(envoi)
{
	
			if ((document.contact.mail.value == "Votre adresse mail") || (document.contact.message.value == "Votre message")) 
			{
				alert("Veuillez saisir les informations demandées s'il vous plaît");
				return false;
			}
	
}

function calcul()
{
	var hc = document.getElementById('loyerH').value;
	var prov = document.getElementById('provision').value;
	var h = parseInt(hc);
	var p = parseInt(prov);
	var calc = h + p;
	document.getElementById('loyerC').value = calc;
	document.getElementById('garant').value= hc;
}

function selectText(champ)
{
	var tag = document.getElementById(champ);
	tag.selectionStart = 0;
	tag.selectionEnd = tag.value.length;		
}


function transpo(formulaire)
{
	if (formulaire == "")
	{
		var tr = document.ajouter.photos.value;
		document.ajouter.rep.value = tr;
	}
	else
	{
		var tr = document.gestionPhotos.photosAjout.value;
		document.gestionPhotos.chemPhoto.value = tr;
	}
}		
function inscrireRef()
{
	var To = document.ZLMail.elements["ZLMail[]"].selectedIndex; 
	document.gestionPhotos.reference.value = document.ZLMail.elements["ZLMail[]"].options[To].value
}

function infoBulle(txt,position)
{
	
	if (position.pageX || position.pageY)
	{
		var x = position.pageX;
		var y = position.pageY;
	}
	else if (position.clientX || position.clientY){
	  var x = position.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
	  var y = position.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
	
	//var x = position.pageX+25;
	//var y =position.pageY;
	if (document.getElementById)
	{
		document.getElementById("bulle").innerHTML = txt;
	}
  	else if (document.all)
	{
		document.all["bulle"].innerHTML = txt;
	}
	CS = styleCalque("bulle");
	CS.left = x+10;
	
	CS.visibility = "visible";
	CS.top = y+10;
}

function qInfoBulle()
{
	CS = styleCalque("bulle");
	CS.visibility = "hidden";
}		

function fermerErr(etat)
{
	if (etat ==1) 
	{
		var CS = styleCalque("erreurPhotos");
		CS.visibility = "visible";
		CS = styleCalque("textErreur");
		CS.visibility = "visible";
	}
	else
	{
		var CS = styleCalque("erreurPhotos");
		CS.visibility = "hidden";
		CS = styleCalque("textErreur");
		CS.visibility = "hidden";
	}
}
/*function afficheZL(etat)
{
var sel = document.getElementById("ZLType");
	for (var i=0; i<sel.options.length; i++) 
	{
		var opt = sel.options[i];
		sel.removeChild(opt);
		i--;
	}
	if (etat == "Location")
	{			
				nouvel_element = new Option('Vide','Vide');
				annonce.typeLoc.options[eval("document.annonce.typeLoc").length] = nouvel_element;
				nouvel_element = new Option('Meublé','Meublé');
				annonce.typeLoc.options[eval("document.annonce.typeLoc").length] = nouvel_element;
				if (document.getElementById)
					{
						document.getElementById("LbType").innerHTML = "Type de Location :";
					}
				  else if (document.all)
					{
						document.all["LbType"].innerHTML = "Type de Location :";
					}
	}
	else
	{
				nouvel_element = new Option('Libre','Libre');
				annonce.typeLoc.options[eval("document.annonce.typeLoc").length] = nouvel_element;
				nouvel_element = new Option('Occupé','Occupé');
				annonce.typeLoc.options[eval("document.annonce.typeLoc").length] = nouvel_element;
				if (document.getElementById)
					{
						document.getElementById("LbType").innerHTML = "Type de Vente :";
					}
				  else if (document.all)
					{
						document.all["LbType"].innerHTML = "Type de Vente :";
					}
	}
	
	
}*/
function Finance2(etat)
{	
	
	var sel = document.getElementById("ZLType");
	for (var i=0; i<sel.options.length; i++) 
	{
		var opt = sel.options[i];
		sel.removeChild(opt);
		i--;
	}
	
	if (etat == "Location")
	{			
				
				/*nouvel_element = new Option('Vide','Vide');
				ajouter.typeLoc.options[eval("document.ajouter.typeLoc").length] = nouvel_element;
				nouvel_element = new Option('Meublé','Meublé');
				ajouter.typeLoc.options[eval("document.ajouter.typeLoc").length] = nouvel_element;
				nouvel_element = new Option('Commercial','Commercial');
				ajouter.typeLoc.options[eval("document.ajouter.typeLoc").length] = nouvel_element;
				*/
				
				nouvel_element = new Option('Vide','Vide');
				
				sel.options[eval(sel).length] = nouvel_element;
				nouvel_element = new Option('Meublé','Meublé');
				sel.options[eval(sel).length] = nouvel_element;
				nouvel_element = new Option('Commercial','Commercial');
				sel.options[eval(sel).length] = nouvel_element;
				//Finance2("Location");
				if (document.getElementById)
					{
						document.getElementById("loyerHC").innerHTML = "Loyer HC :";
						document.getElementById("prov").innerHTML = "Charges :";
						document.getElementById("loyerCC").innerHTML = "Loyer CC :";
						document.getElementById("garantie").innerHTML = "Garantie :";
						document.getElementById("taxe").innerHTML = "Taxe :";
						
					}
				  else if (document.all)
					{
						document.all["loyerHC"].innerHTML = "loyer HC :";
						document.all["prov"].innerHTML = "Charges :";
						document.all["loyerCC"].innerHTML = "Loyer CC :";
						document.all["garantie"].innerHTML = "Garantie :";
						document.all["taxe"].innerHTML = "Taxe :";
					}
	}
	else
	{
				nouvel_element = new Option('Libre','Libre');
				ajouter.typeLoc.options[eval("document.ajouter.typeLoc").length] = nouvel_element;
				nouvel_element = new Option('Occupé','Occupé');
				ajouter.typeLoc.options[eval("document.ajouter.typeLoc").length] = nouvel_element;
				nouvel_element = new Option('Commercial','Commercial');
				ajouter.typeLoc.options[eval("document.ajouter.typeLoc").length] = nouvel_element;
				
				if (document.getElementById)
				{
					document.getElementById("loyerHC").innerHTML = "Taxe fonc. :";
					document.getElementById("prov").innerHTML = "Charges M. :";
					document.getElementById("loyerCC").innerHTML = "Prix :";
					document.getElementById("garantie").innerHTML = "Honoraire :";
					document.getElementById("taxe").innerHTML = "Taxe hab. :"; 
				}
			  else if (document.all)
				{
					document.all["loyerHC"].innerHTML = "Taxe fonc. :";
					document.all["prov"].innerHTML = "Charges M. :";
					document.all["loyerCC"].innerHTML = "Prix :";
					document.all["garantie"].innerHTML = "Honoraire :";
					document.all["taxe"].innerHTML = "Taxe hab. :"; 
				}			
	}
	var CS = styleCalque("Finance");
	CS.display = "block";
	CS = styleCalque("c1");
	CS.height = "810";
	
}

function Finance3(etat)
{	
	
	var sel = document.getElementById("ZLType");
	for (var i=0; i<sel.options.length; i++) 
	{
		var opt = sel.options[i];
		sel.removeChild(opt);
		i--;
	}
	
	if (etat == "Location")
	{			
				
				
				nouvel_element = new Option('Vide','Vide');
				Visual.TypeLocation.options[eval("document.Visual.TypeLocation").length] = nouvel_element;
				nouvel_element = new Option('Meublé','Meublé');
				Visual.TypeLocation.options[eval("document.Visual.TypeLocation").length] = nouvel_element;
				nouvel_element = new Option('Commercial','Commercial');
				Visual.TypeLocation.options[eval("document.Visual.TypeLocation").length] = nouvel_element;
				if (document.getElementById)
					{
						document.getElementById("loyerHC").innerHTML = "Loyer HC :";
						document.getElementById("prov").innerHTML = "Charges :";
						document.getElementById("loyerCC").innerHTML = "Loyer CC :";
						document.getElementById("garantie").innerHTML = "Garantie :";
						document.getElementById("taxe").innerHTML = "Taxe :";
						
					}
				  else if (document.all)
					{
						document.all["loyerHC"].innerHTML = "loyer HC :";
						document.all["prov"].innerHTML = "Charges :";
						document.all["loyerCC"].innerHTML = "Loyer CC :";
						document.all["garantie"].innerHTML = "Garantie :";
						document.all["taxe"].innerHTML = "Taxe :";
					}
	}
	else
	{
				nouvel_element = new Option('Libre','Libre');
				Visual.TypeLocation.options[eval("document.Visual.TypeLocation").length] = nouvel_element;
				nouvel_element = new Option('Occupé','Occupé');
				Visual.TypeLocation.options[eval("document.Visual.TypeLocation").length] = nouvel_element;
				nouvel_element = new Option('Commercial','Commercial');
				Visual.TypeLocation.options[eval("document.Visual.TypeLocation").length] = nouvel_element;
				if (document.getElementById)
				{
					document.getElementById("loyerHC").innerHTML = "Taxe fonc. :";
					document.getElementById("prov").innerHTML = "Charges M. :";
					document.getElementById("loyerCC").innerHTML = "Prix :";
					document.getElementById("garantie").innerHTML = "Honoraire :";
					document.getElementById("taxe").innerHTML = "Taxe hab. :"; 

				}
			  else if (document.all)
				{
					document.all["loyerHC"].innerHTML = "Taxe fonc. :";
					document.all["prov"].innerHTML = "Charges M. :";
					document.all["loyerCC"].innerHTML = "Prix :";
					document.all["garantie"].innerHTML = "Honoraire :";
					document.all["taxe"].innerHTML = "Taxe hab. :"; 
				}			
	}
	var CS = styleCalque("Finance");
	CS.display = "block";
	/*CS = styleCalque("c1");
	CS.height = "740";*/
	
}

function Finance4(etat)
{	
	
	var sel = document.getElementById("ZLType");
	for (var i=0; i<sel.options.length; i++) 
	{
		var opt = sel.options[i];
		sel.removeChild(opt);
		i--;
	}
	
	if (etat == "Location")
	{			
				nouvel_element = new Option('Vide','Vide');
				
				sel.options[eval(sel).length] = nouvel_element;
				nouvel_element = new Option('Meublé','Meublé');
				sel.options[eval(sel).length] = nouvel_element;
				nouvel_element = new Option('Commercial','Commercial');
				sel.options[eval(sel).length] = nouvel_element;
				//Finance4("Location");
				
				if (document.getElementById)
					{
						document.getElementById("loyerHC").innerHTML = "Loyer HC :";
						document.getElementById("prov").innerHTML = "Charges :";
						document.getElementById("loyerCC").innerHTML = "Loyer CC :";
						document.getElementById("garantie").innerHTML = "Garantie :";
						document.getElementById("taxe").innerHTML = "Taxe :";
						// Retire la partie admin
					document.getElementById("garantie").style.display = "block";
					document.getElementById("garant").style.display = "block";	
					}
				  else if (document.all)
					{
						document.all["loyerHC"].innerHTML = "loyer HC :";
						document.all["prov"].innerHTML = "Charges :";
						document.all["loyerCC"].innerHTML = "Loyer CC :";
						document.all["garantie"].innerHTML = "Garantie :";
						document.all["taxe"].innerHTML = "Taxe :";
						
						document.all["garantie"].style.display = "block";
						document.all["garant"].style.display = "block";
					}
	}
	else
	{
				nouvel_element = new Option('Libre','Libre');
				sel.options[eval(sel).length] = nouvel_element;
				nouvel_element = new Option('Occupé','Occupé');
				sel.options[eval(sel).length] = nouvel_element;
				nouvel_element = new Option('Commercial','Commercial');
				sel.options[eval(sel).length] = nouvel_element;
				
				if (document.getElementById)
				{
					document.getElementById("loyerHC").innerHTML = "Taxe fonc. :";
					document.getElementById("prov").innerHTML = "Charges M. :";
					document.getElementById("loyerCC").innerHTML = "Prix :";
					
					document.getElementById("taxe").innerHTML = "Taxe hab. :"; 
					// Retire la partie admin
					document.getElementById("garantie").style.display = "none";
					document.getElementById("garant").style.display = "none";
				}
			  else if (document.all)
				{
					document.all["loyerHC"].innerHTML = "Taxe fonc. :";
					document.all["prov"].innerHTML = "Charges M. :";
					document.all["loyerCC"].innerHTML = "Prix :";
					document.all["taxe"].innerHTML = "Taxe hab. :";
					
					document.all["garantie"].style.display = "none";
					document.all["garant"].style.display = "none"; 
				}			
	}
	var CS = styleCalque("Finance");
	CS.display = "block";
	CS = styleCalque("c1");
	CS.height = "1005";
	
}





function Finance(etat)
{	
	
//toThis = "<form name='FormFinance'><table><th colspan='5'>Finance</th>";
toThis = "<table><th colspan='5'>Finance</th>";
	switch (etat)
	{
			case "Location" :
				var toThis = toThis + "<tr><td width='85'><label>Loyer HC : </label> </td><td><input type='text' name='loyerHC' size='8' value='0'></td><td width='15'>&nbsp;</td><td width='75'><label>provision : </label></td><td><input type='text' name='provision' size='8' value='0'></td>";
					toThis = toThis + "</tr><tr><td><label>Loyer CC : </label> </td><td><input type='text' name='loyer' size='8' value='0'></td><td width='15'>&nbsp;</td>";	
					toThis = toThis + "<td><label>Garantie : </label></td><td><input type='text' name='garantie' size='8' value='0'></td></tr>";
					toThis = toThis + "<tr><td><label>Taxe : </label></td><td><input type='text' name='taxeH' size='8' value='0'> </td><td width='15'>&nbsp;</td>";
					toThis = toThis + "<td><label>Type : </label></td><td><select name='typeLoc'><option value='Vide'>Vide</option><option value='Meublé'>Meublé</option></select></td></tr>";
					toThis = toThis + "<tr><td colspan='5'><input type='hidden' name='genre' value='Location'><input type='button' value='Valider Finance' onclick='valFinance()' style='margin-left:220;'></td></tr></table>";
					if (document.getElementById)
					{
						var range = document.createRange();
					   range.setStartAfter(document.finance.lastChild);
					   var docFrag = range.createContextualFragment(toThis);
					   document.body.appendChild(docFrag);
					   this.layer = document.getElementById('Finance');
						
						
						//document.getElementById("Finance").insertAdjacentHTML('beforeEnd',toThis); alert("test");
					}
				  else if (document.all)
					{
						alert("test2"); document.all["Finance"].insertAdjacentHTML('beforeEnd',toThis); 
					}
				break;
		case "Vente" :
			var toThis = toThis + "<tr>";
				toThis = toThis + "<td><label>Prix : </label> </td><td><input type='text' name='loyer' size='8' value='0'></td><td width='15'>&nbsp;</td><td><label>Honoraire : </label></td><td><input type='text' name='honoraire' size='8' value='0'> </td>";
				toThis = toThis + "</tr><tr><td><label>Type : </label></td><td><select name='typeLoc'><option value='Libre'>Libre</option><option value='Occupé'>Occupé</option></select></td>";
				toThis = toThis + "<td width='15'>&nbsp;</td><td><label>Charges M. : </label></td><td><input type='text' name='provision' size='8' value='0'></td>";
				toThis = toThis + "</tr><tr><td><label>Taxe hab.: </label></td><td><input type='text' name='taxeH' size='8' value='0'></td><td width='15'>&nbsp;</td>";
				toThis = toThis + "<td><label>Taxe fonc.: </label></td><td><input type='text' name='taxeF' size='8' value='0'></td>";
				toThis = toThis + "</tr>";
				toThis = toThis + "<tr><td colspan='5'><input type='hidden' name='genre' value='Vente'><input type='button' value='Valider Finance' onclick='valFinance()' style='margin-left:210;'></td></tr></table></form>";
				if (document.getElementById)
				{
				document.getElementById("Finance").innerHTML = toThis;
				}
			  else if (document.all)
				{
				document.all["Finance"].innerHTML = toThis;
				}			
			break;
	}
	var CS = styleCalque("Finance");
	CS.visibility = "visible";
}


function mailpage()
{
	var ref = document.cache.ref.value;
	var adresse = "http://www.arobazimmo.com/visual.php?detail=" + ref;
	mail_str = "mailto:&subject= Lien concernant votre recherche de bien";
	mail_str += "&body=Nous vous proposons ce lien concernant votre recherche de bien :\r\n " + escape(adresse);
	location.href = mail_str;

}

function verif()
{
	if (document.annonce.nom.value =="")  
	{
		alert("Vous n'avez pas rempli le champ 'Nom'. S'il vous plaît veuillez le remplir.");
		document.annonce.nom.focus();
		return false; 
	}
	if (document.annonce.telephone.value =="")  {
	alert("Vous n'avez pas rempli le champ 'telephone'. S'il vous plaît veuillez le remplir.");
	document.annonce.telephone.focus();
	return false; }
	if (document.annonce.mail.value =="")  {
	alert("Vous n'avez pas rempli le champ 'mail'. S'il vous plaît veuillez le remplir.");
	document.annonce.mail.focus();
	return false; }
	
	var To = document.annonce.elements["r1"]; 
	if ((!To[0].checked) && (!To[1].checked)) {
	alert("Vous avez oublié de spécifier si votre bien est proposé en location ou en vente.");
	return false; }
	
	var To = document.annonce.elements["typeLoc"].selectedIndex; 
	if (document.annonce.elements["typeLoc"].options[To].value =="") {
	alert("Vous avez oublié de spécifier le type de location");
	return false; }
	
}


function affichephotos(photos,pos)
{
	/*if (pos == "EE")
	{
		
		//var y = "220";
		//var x = "0";
	}
	else
	{
		var x="";
		var y="";
		var t="";
		var sH="";
		var x = pos.pageX+95;
		var y =pos.pageY;
		var t = y + 300;
		var sH = screen.height;
		var Z = sH-t; 
		if (y > 600)
		{
			if (Z <300) 
			{
				y = y - 300; 
			}
		}
	}*/
	var form = "<center style='margin-left:5;margin-top:5;'><img src='photos/" + photos + "' width='300' height='302'></center>";
	if (document.getElementById)
		{
			document.getElementById("photos").innerHTML = form;
		}
	  else if (document.all)
		{
			document.all["photos"].innerHTML = form;
		}
	
	CS = styleCalque("photos");
	CS.display = "block";
	//CS.left = 800;
	//CS.top = 300;
	
}

function quitterphotos(nom)
{
	CS = styleCalque("photos");
	CS.display = "none";
}

// Affichage des calques utiles à la gestion du site
function fichier()
{
	CS = styleCalque("c1");
	CS.visibility = "visible";
}



// Fonctions pour le formulaire de contact
function efface(nom)
{
	
	if (nom == "mail") 
	{
		if (document.contact.mail.value == "Votre adresse mail") {document.contact.mail.value = "";}
	}
	else
	{
		if (document.contact.message.value == "Votre message") {document.contact.message.value = "";}
	}
}

function remet(rnom)
{
	if (rnom = "message")
	{
		if (document.contact.message.value == "") {document.contact.message.value = "Votre message";}
	}
	
}

function remet2(rnom2)
{
	if (rnom = "mail")
	{
		if (document.contact.mail.value == "") {document.contact.mail.value = "Votre adresse mail";}
	}
}
// Fonctions pour éviter les cadres autour des animations flash
function run()
{

	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="654" height="209">\n');
	document.write('<param name="movie" value="Img/bandeau.swf">\n');
	document.write('<param name="quality" value="high">\n');
	document.write('<embed src="Img/bandeau.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="654" height="209"></embed></object>\n');

}

function rechercheL()
{
	  	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="400">');
		document.write('<param name="movie" value="Img/rechercheLoc.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<embed src="Img/rechercheLoc.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="400"></embed></object>');

}

function rechercheL2()
{
	  	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="400">');
		document.write('<param name="movie" value="Img/rechercheLoc2.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<embed src="Img/rechercheLoc2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="400"></embed></object>');

}

function rechercheV()
{
	  	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="400">');
		document.write('<param name="movie" value="Img/recherchev.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<embed src="Img/recherchev.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="400"></embed></object>');

}

function rechercheCom()
{
	  	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="400">');
		document.write('<param name="movie" value="Img/rechercheCom.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<embed src="Img/rechercheCom.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="400"></embed></object>');
}



// Fonctions pour l'animation des publicités
imgPath = new Array;
SiClickGoTo = new Array;
version = navigator.appVersion.substring(0,1);
if (version >= 3)
	{
		i0 = new Image;
		i0.src = 'Img/pub/immeuble.jpg';
		SiClickGoTo[0] = "mailto:toto@moi.fr";
		imgPath[0] = i0.src;
		i1 = new Image;
		i1.src = 'Img/pub/immeuble2.jpg';
		SiClickGoTo[1] = "http://www.nwerag.fr";
		imgPath[1] = i1.src;
		i2 = new Image;
		i2.src = 'Img/pub/immeuble3.jpg';
		SiClickGoTo[2] = "http://www.google.fr";
		imgPath[2] = i2.src;
	}
a = 0;
function StartAnim()
	{
	if (version >= 3)
		{
		document.write('<A HREF="#" onClick="ImgDest();return(false)"><IMG SRC="Img/pub/test.jpg" BORDER=0 ALT=Menu NAME=defil></A>');
		defilimg()
		}
	else
		{
		document.write('<A HREF="mailto:toto@moi.fr"><IMG SRC="Img/pub/test.jpg" BORDER=0></A>')
		}
	}
function ImgDest()
	{
	document.location.href = SiClickGoTo[a-1];
	}
function defilimg()
	{
	if (a == 3)
		{
		a = 0;
		}
	if (version >= 3)
		{
		document.defil.src = imgPath[a];
		tempo3 = setTimeout("defilimg()",2000);
		a++;
		}
	}

function haut(idCalq)
{	
	if (idCalq == "res") {var CS = styleCalque("res");} else {var CS = styleCalque("C3");}
	y=y-10;
	CS.top = y;
	if (idCalq == "res") {moveupvar=setTimeout("haut('res')",50);} else {moveupvar=setTimeout("haut()",50);}

}

function bas(idCalq)
{
	if (idCalq == "res") {var CS = styleCalque("res");} else {var CS = styleCalque("C3");}
	y=y+10;
	if ((CS.top >= 0+'px')||(CS.top =='')) {return false;};
	CS.top = y;
	if (idCalq == "res") {movedownvar=setTimeout("bas('res')",50);} else {movedownvar=setTimeout("bas()",50);}

}
function droite()
{
	x=x-15;
	var CS = styleCalque("C3");
	CS.left = x;
	movedroitevar=setTimeout("droite()",50);
}

function gauche()
{
	x=x+15;
	var CS = styleCalque("C3");
	if (CS.left >= 0+'px') {return false;};
	CS.left = x;
	movegauchevar=setTimeout("gauche()",50);
}

function alertsup()
{
	if (!confirm("Etes-vous sûr de vouloir supprimer cette référence ?")) {return false;}
}

function selectionItemLD(idSelect,valItem)
{
	
	// Parcourt la liste déroulante afin d'en sélectionner les items
	var sel = document.getElementById(idSelect);
	var totalop = sel.options.length;
	
	for (i=0;i<totalop;i++)
	{
		val = sel.options[i].value;
	if (val == valItem) {sel.options[i].selected = true;}
	}
}
function selectItemLD(idSelect,valItem)
{
	
	// Parcourt la liste déroulante afin d'en sélectionner les items
	var sel = document.getElementById(idSelect);
	var totalop = sel.options.length;
	
	for (i=0;i<totalop;i++)
	{
		val = sel.options[i].value;
		
	if (val == valItem) {sel.options[i].selected = true;}
	}
}
