var JSEARCH = {
  requiredAttrParams: ["btn_type" , "btn_lbl" , "kw_lbl" , "cat_lbl" , "loc_lbl" , "div_lbl" ],

  create: function( SO , id , parentid ) {
    DROP.setElementDisplay(parentid, "none");
    var loadfn = function() {
      if (DROP.hasRequiredAttrParams(SO)) {
        JSEARCH.init( SO, id , parentid );
      }
      DROP.setElementDisplay(parentid, "block");
    };
    DROP.addLoadEvent(loadfn);
  },

  init: function( SO , id , parentid ){

    if( !document.getElementById || !document.getElementsByTagName ) return;
    var objTarget = document.getElementById( id );
    var objParent = document.getElementById( parentid );
    if (typeof objTarget.innerHTML == "undefined" || typeof objParent.innerHTML == "undefined") return;

    var strOutPut = '';
    objTarget.innerHTML = '';

    strOutPut += '<form action="" method="post">\n';

    strOutPut += '<span class="wrapper"><label for="' + id + '_keywords">' + SO.kw_lbl + '</label><input type="text" id="' + id + '_keywords" class="txt" maxlength="30" /></span>';

    strOutPut += '<span class="wrapper"><label for="' + id + '_category" class="hide">' + SO.cat_lbl + '</label><select id="' + id + '_category">';
    strOutPut += '<option value="">' + SO.cat_lbl + '</option>';
    strOptions = '';
    for( x=0 ; x<JSEARCH.CatItems.length ; x++ ){
      strOptions += JSEARCH.addOption( JSEARCH.CatItems[x].split('|')[1] , JSEARCH.CatItems[x].split('|')[0] , '' );
    } 
    strOutPut += strOptions;
    strOutPut += '</select></span>';

    strOutPut += '<span class="wrapper"><label for="' + id + '_location" class="hide">' + SO.loc_lbl + '</label><select id="' + id + '_location">';
    strOutPut += '<option value="">' + SO.loc_lbl + '</option>';
    strOptions = '';
    for( x=0 ; x<JSEARCH.LocItems.length ; x++ ){
      strOptions += JSEARCH.addOption( JSEARCH.LocItems[x].split('|')[1] , JSEARCH.LocItems[x].split('|')[0] , '' );
    } 
    strOutPut += strOptions;
    strOutPut += '</select></span>';

    strOutPut += '<span class="wrapper"><label for="' + id + '_division" class="hide">' + SO.loc_lbl + '</label><select id="' + id + '_division">';
    strOutPut += '<option value="">' + SO.div_lbl + '</option>';
    strOptions = '';
    for( x=0 ; x<JSEARCH.DivisionItems.length ; x++ ){
      strOptions += JSEARCH.addOption( JSEARCH.DivisionItems[x].split('|')[1] , JSEARCH.DivisionItems[x].split('|')[0] , '' );
    } 
    strOutPut += strOptions;
    strOutPut += '</select></span>';

    strOutPut += '<a href="#" title="' + SO.btn_lbl + '" class="btn btn' + SO.btn_type + '" id="' + id + '_btn" target="_blank"><span>' + SO.btn_lbl + '</span></a>\n';
    strOutPut += '</form>\n';

    objTarget.innerHTML = strOutPut;

    objButton = document.getElementById( id + '_btn' );
    if( objButton ){
      addEvent( objButton , 'click' , JSEARCH.processClick , false );
    }

    addclass( objTarget , 'selector' );
    objParent.style.overflow = 'visible';
    objParent.style.overflow = '';
  },

  addOption: function( strval , strtext , id ){
    strIdAttrib = id != '' ? ' id="' + id + '"' : '';
    strTemp = '<option value="' + strval + '"' + strIdAttrib + '>' + strtext + '</option>\n';
    return strTemp;
  },

  processClick: function(e){
    var curNode = window.event ? window.event.srcElement: e ? e.target : null;
    if( curNode == null ) return;

    divBase = ascendDOM( curNode , 'div' );
    if( divBase.nodeName.toLowerCase() != 'div' || !divBase.id ) return;

    strSelected = 'http://kcnch.jobseu.recruitadvantage.com/job/job_search_result.cfm?cLang=French';

    objKw = document.getElementById( divBase.id + '_keywords' );
    objCat = document.getElementById( divBase.id + '_category' );
    objLoc = document.getElementById( divBase.id + '_location' );
    objDivision = document.getElementById( divBase.id + '_division' );

    strKw = objKw ? escape( objKw.value ) : '';
    strCat = objCat ? objCat.options[objCat.selectedIndex].value : '';
    strLoc = objLoc ? objLoc.options[objLoc.selectedIndex].value : '';
    strDivision = objDivision ? objDivision.options[objDivision.selectedIndex].value : '';

    if( strKw == '' && strCat == '' && strLoc == '' && strDivision == '' ){
      curNode.href = 'http://kcnch.jobseu.recruitadvantage.com/job/job_search.cfm?cLang=French';

    }
    else {
                        { if (strCat == '' ){ (strCat = '0' );}
              if (strLoc == '') { (strLoc = '0');}
              if  (strDivision == '') {(strDivision = '0' );}}          
                 curNode.href = strSelected + '&frm_loc_id=' + strLoc + '&frm_ind_id=' + strCat + '&frm_job_type_id=' + strDivision + '&frm_keyword=' + strKw;

         }

    return true;
  },



  CatItems: ["Toutes|0", "Bâtiment - artisanat|3951", "Biotech - Chimie - Pharma|3950", "Bureau|3949", "Centre d'appels|3943", "Finance - Assurances|3944", "Horlogerie|7698", "Hôtellerie - Gastronomie|3946", "Industrie - Technique|3948", "International|3952", "IT - Informatique|3947", "Medical|3945", "Offres d'emplois internes|5966"],

  LocItems: ["Tous|0", "Aargau|1429", "Appenzell Außerrhoden|1430", "Appenzell Innerrhoden|1431", "Basel|1507", "Bern|1434", "Deutsche Schweiz|1457", "Fribourg|1435", "Genève|1436", "Glarus|1437", "Graubünden|1438", "Jura|1439", "Luzern|1440", "Neuchâtel|1441", "Nidwalden|1442", "Obwalden|1443", "Others|2131", "Schaffhausen|1444", "Schwyz|1445", "Solothurn|1446", "St. Gallen|1447", "Suisse romande|1455", "Thurgau|1448", "Ticino|1449", "Uri|1450", "Valais|1451", "Vaud|1452", "Zug|1453", "Zürich|1454", " International|-1"],

  DivisionItems: ["Tous|0", "Fixe|2", "Temporaire|15", "Temporaire ou fixe|3", "Temps partiel|4"]

};


<!--
//Server:WWb02
-->
