function changeType(el)
{
	if (el.type.toLowerCase () == "text" )
	{
		var pw = document.createElement ("input");
		pw.setAttribute ("type", "password" );
		//pw.setAttribute ("onblur", "alert(this.value); if (this.value == '') { changeType(this); }");
		pw.onblur=function () {
			if (this.value == '') {
				changeType(this);
			}
		}
		pw.value = el.value;
		pw.id = el.id;
		pw.name = el.name;
		pw.className = el.className;
		pw.style.height ="14";
		pw.style.width  ="124";
		el.parentNode.replaceChild (pw, el);
		window.setTimeout("LeFocus('"+pw.id+"');",1000);
	}
	else if (el.type.toLowerCase () == "password")
	{
		var pw = document.createElement ("input" );
		pw.setAttribute ("type", "text" );
		pw.onfocus=function () {
			if (this.value == 'Mot de passe') {
				this.value=''; changeType(this);
			}
		}
		pw.value = 'Mot de passe';
		pw.id = el.id;
		pw.name = el.name;
		pw.className = el.className;
		pw.style.height ="14";
		pw.style.width  ="124";
		el.parentNode.replaceChild (pw, el);
	}
	return true;
}

function LeFocus(id)
{
	document.getElementById(id).focus();
}

function videSelect(leSelect) {
	while (leSelect.options.length>0) {
		leSelect.options[0] = null;
	}
}

function typeChanged(id_type, recherche, id_annonce) {
	if(id_annonce == undefined) {
		xajax_load_moteurs(id_type, recherche);
		xajax_load_marques(id_type, recherche);
		xajax_load_genres(id_type, recherche);
		xajax_load_motorisationEnergie(id_type, recherche);
		xajax_load_options(id_type, recherche);
	} else {
		xajax_load_moteurs(id_type, recherche, id_annonce);
		xajax_load_marques(id_type, recherche, id_annonce);
		xajax_load_genres(id_type, recherche, id_annonce);
		xajax_load_motorisationEnergie(id_type, recherche, id_annonce);
		xajax_load_options(id_type, recherche, id_annonce);
	}
}

function preloadRecherche(id_marque, id_modele) {
	xajax_load_modeles(id_marque,true,null,id_modele);
}

function selectOptionActual(select) {

	var length = select.options.length;
	select.options[length - 1 ].selected = "selected";
}

function addOption(select,name,value) {
	var length = select.options.length;
	select.options[length] = new Option(name, value);
}
