if(typeof window.addEventListener != 'undefined') {
	//.. gecko, safari, konqueror and standard
	window.addEventListener('load', AddFunction, false);
}
else if(typeof document.addEventListener != 'undefined') {
	//.. opera 7
	document.addEventListener('load', AddFunction, false);
}
else if(typeof window.attachEvent != 'undefined') {
	//.. win/ie
	window.attachEvent('onload', AddFunction);
}

function openMap() {
var server=window.location.host;
var PosPoint=server.indexOf(".");
var nom=server.substring(0,PosPoint);
var dossier = nom.replace(/-/,"_");
var Fensteroptionen = "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0";
var popupWindow = window.open("/design/"+dossier+"/javascript/map.html", 'Map', Fensteroptionen + ',width=620,height=520');
var focus = popupWindow.focus();
}

function AddFunction() {
var bloc=document.getElementById("bloc");
	if(bloc) {
		nbImg=bloc.getElementsByTagName("img").length

		for(var i=0; i<nbImg; i++) {
			urlImg=bloc.getElementsByTagName("img")[i].src;
			PosLastSlash=urlImg.lastIndexOf("_");
			PosLastPoint=urlImg.lastIndexOf(".");
			if(PosLastSlash!=-1) {
				Ext=urlImg.substring(PosLastPoint);
				NewURL=urlImg.substring(0,PosLastSlash)+"_large"+Ext;
				bloc.getElementsByTagName("img")[i].onclick = function() {
					imagezoom(Number(this.width*3),Number(this.height*3),NewURL)
				}
				//bloc.getElementsByTagName("img")[i].setAttribute("style","cursor:pointer");
				bloc.getElementsByTagName("img")[i].className="cliquable";
			}
		}
	}
}



function ouvre(parent, enfant) {

txtParent=document.getElementById(parent).innerHTML;
etatEnfant=document.getElementById(enfant).style.display;

//document.getElementById(parent).innerHTML=(txtParent=="+") ? "-&nbsp;" : "+";
document.getElementById(enfant).style.display=(etatEnfant=="none") ? "" : "none";

}



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_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_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 imagezoom(w,h,url) {
w+=18;
h+=15;
   var Fensteroptionen = "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0";
   var popupWindow = window.open(url, 'Imagezoom', Fensteroptionen + ',width=' + w + ',height=' + h);
   var focus = popupWindow.focus();
}




function changeLocation2(Combo) {
	var URL=document.getElementById(Combo).value;
	if(URL!="") {
		if(document.location.href.indexOf(URL)<0) {
			window.location = '/' + URL;
		}
	}
	else {
		switch (Combo) {
			case 'type':
				URL="";
				break;
				case 'type2':
				URL="";
				break;
				case 'type3':
				URL="";
				break;
			case 'marque':
				URL=document.getElementById("type").value;
				break;
			case 'modele':
				URL=document.getElementById("marque").value;
				break;
		}
		window.location = '/' + URL;
	}
}

function changeLocation3(Combo){
	var URL = document.getElementById(Combo).value;
	
	var URL2 = document.getElementById("texto").value;
	window.location = "/content/advancedsearch?region2=" + URL + "&texte=" + URL2;
	
}
function changeLocation4(Combo){
	var URL = document.getElementById(Combo).value;
	
	var URL2 = document.getElementById("texto2").value;
	window.location = "/recrutement?region2=" + URL + "&texte2=" + URL2;
	
}

function changeLocation5(Combo){

	var URL = document.getElementById(Combo).value;

	var zone1;
    var zone2;	
	if(URL == "-1"){
	    zone2 = "";
	    zone1 = "none";
	}
	else
	{
		zone1 = "";
		zone2 = "none";
	}

	var URL2 = document.getElementById("texto3").value;
	window.location = "/recherche?region_n=" + URL + "&texte=" + URL2 + "&zone1=" + zone1 +"&zone2="+ zone2;
	
}

function changeLocation6(Combo){
	var URL = document.getElementById(Combo).value;	
	var URL2 = document.getElementById("texto3").value;
	var zone1 = document.getElementById("zone").style.display;	
	var zone2 = document.getElementById("zone2").style.display;
	window.location = "/recherche?contrat2=" + URL + "&texte=" + URL2 + "&zone1=" + zone1 +"&zone2="+ zone2; ;
}

function OpenGed(id) {
  }

function changeLocation(Combo) {
	return document.getElementById(Combo).value;
}

function getLocation(loca) {

loca=document.getElementById(Combo).value;

}




