//<SCRIPT LANGUAGE=javascript>

function go(){

	if(trim(document.getElementById('libelle').value)=='' && 
	document.getElementById('familleListe').value=='' && 
	document.getElementById('sousFamilleListe').value=='' && 
	document.getElementById('paysListe').value=='' && 
	document.getElementById('langueListe').value=='' && 
	trim(document.getElementById('codif').value)=='' && 
	document.getElementById('nouveaute').checked==false && 
	document.getElementById('siteWeb').checked==false && 
	document.getElementById('titreExport').checked==false
	){
		alert("Veuillez saisir au moins un critère.");
		return true;
	}
	else if(trim(document.getElementById('codif').value).length==5 &&
		trim(document.getElementById('codif').value).substring(0,1)!=0){
		alert("Veuillez saisir une codif commençant par 0.");
		return true;
	}
	else
		document.frmecran001.submit();
}
function goSondage(){
		document.frmecran001.submit();

}


function trim(string) 
{ 
return string.replace(/(^\s*)|(\s*$)/g,''); 
} 
function setFocus()
{
    document.getElementById('libelle').focus();
}

function ouvre_popup(page) {
       window.open(page,"nom_popup","menubar=no, status=no, scrollbars=no, menubar=no, width=650, height=650");
}
function ChangeFamille(strFamille){
	while (document.getElementById("sousFamilleListe").options.length>0)
		document.getElementById("sousFamilleListe").remove(0);
	var noption=document.createElement('option');
	noption.value="";
	noption.text="sélectionnez un sous thème";
	try {
	  document.getElementById("sousFamilleListe").add(noption);
	}
	catch (ex) {
		document.getElementById("sousFamilleListe").add(noption,null);
	}
	for (var i=0 ; i<Famille.length ; i++){
		if (strFamille.substring(0,2)==Famille[i][0]){
			var noption=document.createElement('option');
			noption.text=Famille[i][2];
			noption.value=Famille[i][1];
			try {
			  document.getElementById("sousFamilleListe").add(noption);
			}
			catch (ex) {
				document.getElementById("sousFamilleListe").add(noption,null);
			}
		}
	}
}

function toogleRechercheAvancee(oLink) {
	var f  = document.forms['frmecran001'];
	var el = f.elements;
	var drawer = document.getElementById('RechercheAvancee');
	var oGrp2 = document.getElementById('grp2');
	if( drawer && oGrp2 ) {
		drawer.style.display = (drawer.style.display=='none'?'block':'none');
		oGrp2.style.visibility = (drawer.style.display=='none'?'hidden':'');
		oLink.innerHTML = (drawer.style.display=='none'?'Recherche avancée':'Recherche simplifiée');
		if( 'none'==drawer.style.display ) {
			f.typeRecherche.value="0";
			f.codif.value = "";
			f.langueListe.selectedIndex = 0;
			f.paysListe.selectedIndex = 0;		
			f.tri.selectedIndex = 0;			
			f.nouveaute.checked = false;
			f.siteWeb.checked = false;
			f.titreExport.checked = false;			
		}
		else f.typeRecherche.value="1";
	}
}


//</SCRIPT>