function ComboSelect(identifiant, nom, func, initule){
this.id = identifiant;
this.name = nom;
this.funcname = func;
this.title = initule;
this.options = new Array();
this.addOption(this.title,"not_open");
}
ComboSelect.prototype = {
write: function() {
document.write("<select id=\""+this.id+"\" name=\""+this.name+"\" onchange=\""+this.funcname+"(this)\">");
for(var i=0;i<this.options.length;i++){
this.options[i].write();
}
document.write("</select>");
},
addOption: function(option,valeur){
var option = new ComboOption(option,valeur);
this.options.push(option);
}
}
function ComboOption(option, valeur){
this.label = option;
this.value = valeur;
}
ComboOption.prototype = {
write: function() {
document.write("<option value=\""+this.value+"\">"+this.label+"</option>");
}
}
function liOnClick(aElt){
var liNode = aElt.parentNode;
var liID = liNode.getAttribute("ID");
var k = 0;
var classAttr = liNode.className;
if( classAttr=="on"){
liNode.className = classAttr.replace("on", "");
}else if(classAttr.indexOf(" on")>-1 ){
liNode.className = classAttr.replace(" on", "");
}else{
liNode.className = classAttr+" on";
}
while(liNode.childNodes[k] != null){
var currentNode = liNode.childNodes[k];
if( currentNode.nodeName == 'A' ){
if( currentNode.className.indexOf("depli") > -1){
currentNode.className = currentNode.className.replace("depli","repli");
var imgElt = currentNode.getElementsByTagName('IMG');
imgElt[0].src = imgElt[0].src.replace('ferme','ouvert');
if( imgElt[0].style.filter != null ){
imgElt[0].style.filter = imgElt[0].style.filter.replace('ferme','ouvert');
}
imgElt[0].alt="replier";
}else if(currentNode.className.indexOf("repli") > -1 ){
currentNode.className = currentNode.className.replace("repli","depli");
var imgElt = currentNode.getElementsByTagName('IMG');
imgElt[0].src = imgElt[0].src.replace('ouvert','ferme');
if( imgElt[0].style.filter != null ){
imgElt[0].style.filter = imgElt[0].style.filter.replace('ouvert','ferme');
}
imgElt[0].alt="deplier";
}
}
if( currentNode.nodeName == 'UL' ){
if( currentNode.className=="invisible" ){
currentNode.className='';
}else{
currentNode.className='invisible';
}
break;
}
k++;
}
}
function initMenuNavigation(){
var navDIV = document.getElementById("navigation");
if( navDIV != null){
var aCpt = 1;
var aElements = navDIV.getElementsByTagName('A');
for( var i = 0;i<aElements.length; i++){
var aElt = aElements[i];
if( aElt.className == 'depli' || aElt.className == 'repli'){
liOnClick(aElements[i]);
}
}
}
}
function majEmplois(domaines){
if( domaines != null ){
var options = domaines.options;
var emplois = document.forms['recherche_concours'].emploi;
videSelectEmploi();
for( var i=0; i<options.length; i++ ){
if( options[i].selected ){
var domaineEmplois = jsDomaine[options[i].value];
for( var j in domaineEmplois ){
var optionEmploi = document.createElement('option');
optionEmploi.value=j;
optionEmploi.label=domaineEmplois[j];
optionEmploi.text=domaineEmplois[j];
try{
emplois.add(optionEmploi,null);
}catch(ex){
emplois.add(optionEmploi); // IE
}
}
}
}
}
}
function videSelectEmploi(){
document.forms['recherche_concours'].emploi.innerHTML = "";
}
function openHelp(el){
if( el != null ){
var url = el.href;
var leftPos = getPageOffsetLeft(el);
var topPos = getPageOffsetTop(el);
var params = "width=350,height=450,left="+leftPos+",top="+topPos+",resizable=yes,scrollbars=auto,status=no";
window.open(url, "aide", params);
}
}
