/* ******************************* */
/*   Changement de couleur de fond sur la navigation de gauche     */
/* ******************************* */
var oldCol;
function chColorNav(td, mode) {
	if (mode == 0) {
		oldCol = td.className;
		td.className = 'tdNavOver';
	} else {
		td.className = 'oldCol';
	}
}

/* ******************************* */
/*   Preload images    */
/* ******************************* */
function preloadImg() {var doc=document; if(doc.images){ if(!doc.Drstp) doc.Drstp=new Array();var i,j=doc.Drstp.length,a=preloadImg.arguments;for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){doc.Drstp[j]=new Image; doc.Drstp[j++].src=a[i];}}}


/* ******************************* */
/*   Changement de l'image detail     */
/* ******************************* */
ie4 = (document.all)? true:false
ns6 = (document.getElementById && !document.all)? true:false

function chIllustrDetail(img){
	msg = "<img src='"+img+"'>";
	
	if (ns6){
		var lyr = document.getElementById('illustrDetail').innerHTML = msg;
	} else if (ie4){
		document.all.illustrDetail.innerHTML = msg;
	}
}

/* ******************************* */
/*   PopUp     */
/* ******************************* */

function DoPopup(strURL,strType) {
var strOptions="";
	if (strType=="video") {
	strOptions="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=360,height=270";
	}
	if (strType=="carte") {
	strOptions="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=580,height=520";
	}
window.open(strURL, 'hsr', strOptions);
}


/* ******************************* */
/*   Changement Appartement sur la home     */
/* ******************************* */

    
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
ns6 = (document.getElementById && !document.all)? true:false

function switchFlat(id, inputIllustrBig, inputDesc, inputRef, inputIllustrSmall1, inputIllustrSmall2, inputLink){ // id du TD, chemin de la grande illustration, texte descriptif, reference de l'appartement, petite illustration 1, petite illustration 2, lien vers le detail de l'appartement.
		
		/*objBackground = document.getElementById(id);
	if(objBackground.className.indexOf('numberOff')>-1)
		objBackground.className = 'numberOn';
	else
		objBackground.className = 'numberOff';*/
		
		
		document.getElementById('link1').className = 'numberOff';
		document.getElementById('link2').className = 'numberOff';
		document.getElementById('link3').className = 'numberOff';
		document.getElementById('link4').className = 'numberOff';
		document.getElementById('link5').className = 'numberOff';
		
		
		objBackground = document.getElementById(id);	
		objBackground.className = 'numberOn';
		
		
		
		
		
		msgIllustrBig = "<img src='"+inputIllustrBig+"' width='196' height='199' alt='' />";
		msgTexte = inputDesc;
		msgRef = inputRef;
		msgImg1 = "<img src='"+inputIllustrSmall1+"' width='60' height='60' alt='' />";
		msgImg2 = "<img src='"+inputIllustrSmall2+"' width='60' height='60' alt='' />";
		msgLink = "<a href='"+inputLink+"' class='lkHightLight'><strong>>> En savoir +</strong></a>";

	if (ns6){
		document.getElementById('illustrBig').innerHTML = msgIllustrBig;
		document.getElementById('divText').innerHTML = msgTexte;
		document.getElementById('divRef').innerHTML = msgRef;
		document.getElementById('illustrSmall1').innerHTML = msgImg1;
		document.getElementById('illustrSmall2').innerHTML = msgImg2;
		document.getElementById('divLink').innerHTML = msgLink;
	}
	else if (ie4){
	
		document.all.illustrBig.innerHTML = msgIllustrBig;
		document.all.divText.innerHTML = msgTexte;
		document.all.divRef.innerHTML = msgRef;
		document.all.illustrSmall1.innerHTML = msgImg1;
		document.all.illustrSmall2.innerHTML = msgImg2;
		document.all.divLink.innerHTML = msgLink;
	}

}