/* auteur: Nadim Saikali */
/* Date de création: 29/01/2004 */
function swap_it(img_name,to_what,time)
{
	towhat=to_what;
	swap=eval('document.images.'+img_name);
//	var towhat="img/shim.gif";//'img/'+to_what+'.gif';
	swap.src=towhat;
}

function focuson(oThis) {
	if (oThis.value=="Entrez une référence") {
		oThis.value="";
	}
}
function blurout(oThis) {
	if (oThis.value=="") {
		oThis.value="Entrez une référence";
	}
}
//-
function tybsearch() {

	var atLeastOne;
	var theFrom = document.searchform;
	var countFields = parseInt(theFrom.countfields.value);
	for (i=0;i<countFields;i++) {
		if (theFrom.elements[i].checked==true)
			atLeastOne = 1;
	}
	
	if	(atLeastOne != 1) {
		alert("Veuillez sélectionner un type de bâtiment !");
		return;
	} else {
		theFrom.action = "recherche_result.php";
		theFrom.submit();
	}
	return;
}
//-
var delayed;
function delay() {
	delayed = setTimeout('document.getElementById("gamtext").innerText="Sélectionnez la gamme de produits"', 400);
}
function stopdelay() {
	 clearTimeout(delayed);
}

//-
function popen(urlstr,nom,larg,haut,top,gch,scrl,rsz)
{
	new_win=window.open(urlstr,nom,'toolbar=no,location=no,directories=no,status=no,scrollbars='+scrl+',resizable='+rsz+',menubar=no,width='+larg+',height='+haut+',top='+top+',left='+gch+'');
	new_win.focus();
	return;
}

function popcenter(urlstr,name,larg,haut,scrl,rsz,doublepop)
{
	var top=(screen.height-haut)/2;
   var gch=(screen.width-larg)/2;
	if (document.all) { if (navigator.appMinorVersion.indexOf('SP2')>0) haut = haut+23; }

	new_win = window.open(urlstr, name, 'toolbar=no, location=no, directories=no, status=no, scrollbars='+scrl+', resizable='+rsz+', menubar=no, width='+larg+', height='+haut+', top='+top+', left='+gch+'');
	new_win.focus();
	return;
}

//|--
function handleCountryDiv(h){
	if (h==1) document.getElementById("countrydiv").style.display="";
	else document.getElementById("countrydiv").style.display="none"
}