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"><font color="black">' + SO.kw_lbl + '</font></label><input type="text" id="' + id + '_keywords" class="txt" Width="447px" 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" class="hide" >';
    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" class="hide">';
    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://bti.livejobs.recruitadvantage.com/job/job_search_result.cfm';

    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://bti.livejobs.recruitadvantage.com/job/job_search.cfm';

    }
    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: ["Any|0" , "Accounting - Auditing|5547" , "Administration and Support Services|5548" , "Advertising and Media|5549" , "Architectural - Interiors|5550" , "Banking - Consumer - Retail|5551" , "Banking - Corporate - Institutional|5552" , "Banking - Finance|5553" , "Banking - Fund & Asset Management & Securities|5554" , "Banking - Investment|5555" , "Banking - Support Services|5559" , "Banking - Support Services - Others|5588" , "Banking - Treasury|5556" , "Banking - Wealth Management|5557" , "Biotechnology and Pharmaceutical|5558" , "Construction - Real Estate|5560" , "Consulting - Professional Services|5561" , "Contact Center - Customer Services|5562" , "Education and Training|5563" , "Engineering - Manufacturing|5564" , "Environmental Health and Safety|5565" , "Finance|5566" , "Food and Beverages|5567" , "General Management - C-Levels|5568" , "Government|5569" , "Healthcare|5570" , "Hospitality - Tourism|5571" , "Human Resources|5572" , "Insurance|5573" , "IT|5574" , "Legal - Corporate Affairs|5575" , "Marketing and Corporate Communication|5576" , "Oil & Gas - Chemical|5577" , "Others|5578" , "Procurement - Vendor Management|5579" , "Quality Assurance|5580" , "Recruitment Consultant|5581" , "Research and Development|5582" , "Retail - Consumer Products|5583" , "Safety and Security|5589" , "Sales and Business Development|5584" , "Semiconductor|5585" , "Supply Chain - Logistics - Warehousing|5586" , "Telecommunication|5587"],

  LocItems: ["Any|0" , "India|2112" , "Indonesia|2115" , "Malaysia|2114" , "Singapore|2111" , "Thailand|2113"],

  DivisionItems: ["Any|0" , "Casual|5" , "Contract|3" , "Ongoing|13" , "Part-Time|4" , "Permanent|2" , "Seasonal|12" , "Temporary|15"]

};


<!--
//Server:WWb02
-->
