function clearForm() {
    document.getElementById("jobSearchControl_keywordText").value = "";
    document.getElementById("jobSearchControl_jobCat").options[0].selected = true;
    document.getElementById("jobSearchControl_jobFunc").options[0].selected = true;
    document.getElementById("jobSearchControl_keywordType_3").checked = "checked";
    document.getElementById("jobSearchControl_saveAlertEmail").value = "";
}

function clearFormList() {
    document.getElementById("AdvancedJobSearchControl2_keywordText").value = "";
    document.getElementById("AdvancedJobSearchControl2_jobCatList").options[0].selected = true;
    document.getElementById("AdvancedJobSearchControl2_jobFuncList").options[0].selected = true;
    document.getElementById("AdvancedJobSearchControl2_positionCompanyRadio").checked = "checked";
    document.getElementById("AdvancedJobSearchControl2_careerLevelList").options[0].selected = true;
    document.getElementById("AdvancedJobSearchControl2_qualificationList").options[0].selected = true;
    document.getElementById("AdvancedJobSearchControl2_yearOfExpFromList").options[0].selected = true;
    document.getElementById("AdvancedJobSearchControl2_yearOfExpToList").options[0].selected = true;
    document.getElementById("AdvancedJobSearchControl2_yearOfExpCheck").checked = "checked";
    document.getElementById("AdvancedJobSearchControl2_qualificationCheck").checked = "checked";
    document.getElementById("AdvancedJobSearchControl2_jobPostedWithinList").options[2].selected = true;
    document.getElementById("AdvancedJobSearchControl2_saveAlertEmail").value = "";
    
}



function checkSearcWord(objId) {
    if (document.getElementById(objId).value.trim().length <= 0) {
        alert("Please at least input 1 item for job search!");
        return false;
    }
    return true;
}

function checkSearcWord1() {
    isok = false;
    if (document.getElementById("advancedJobSearchControl_keywordTxt").value.trim().length > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl_jobCatList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl_jobFuncList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl_careerLevelList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl_qualificationList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl_yearOfExpFromList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl_yearOfExpToList").selectedIndex > 0)
        isok = true;
    else if (checkBoxList("advancedJobSearchControl_jobTypeCheckBoxList"))
        isok = true;
    if (!isok)
        alert("Please at least input 1 item for job search!");
    return isok;
}

function checkSearcWord2() {
    isok = false;
    if (document.getElementById("AdvancedJobSearchControl2_keywordText").value.trim().length > 0)
        isok = true;
    else if (document.getElementById("AdvancedJobSearchControl2_jobCatList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("AdvancedJobSearchControl2_jobFuncList").selectedIndex > 0)
        isok = true;
    if (!isok)
        alert("Please at least input 1 item for job search!");
    return isok;
}

function checkSearcWord5() {
    isok = false;
    if (document.getElementById("advancedJobSearchControl2_keywordTxt").value.trim().length > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl2_jobCatList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl2_jobFuncList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl2_careerLevelList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl2_qualificationList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl2_yearOfExpFromList").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("advancedJobSearchControl2_yearOfExpToList").selectedIndex > 0)
        isok = true;
    else if (checkBoxList("advancedJobSearchControl2_jobTypeCheckBoxList"))
        isok = true;
    if (!isok)
        alert("Please at least input 1 item for job search!");
    return isok;
}

function checkSearcWord3() {
    isok = false;
    if (document.getElementById("jobSearchControl_keywordText").value.trim().length > 0)
        isok = true;
    else if (document.getElementById("jobSearchControl_jobCat").selectedIndex > 0)
        isok = true;
    else if (document.getElementById("jobSearchControl_jobFunc").selectedIndex > 0)
        isok = true;
    if (!isok)
        alert("Please at least input 1 item for job search!");
    return isok;
}

function checkSearcWord4() {
    isok = false;
    if (document.getElementById("keyword").value.trim().length > 0)
        isok = true;
    else if (document.getElementById("jobCat").selectedIndex > 0)
        isok = true;
    if (!isok)
        alert("Please at least input 1 item for job search!");
    return isok;
}


function checkBoxList(id) {
    var obj = document.getElementById(id).getElementsByTagName("input");
    for (var i = 0; i < obj.length; i++) {
        if (obj[i].checked)
            return true;
    }
    return false;
}

String.prototype.trim = function() {
    return this.replace(/(^\s*)(\s*$)/g, '');
}



function onCatSelectionChanged (srcId, targetId, defaultValue) { 
    selectionChange(srcId, targetId, rc_catFuncMap, defaultValue);
}



//--------cat map ----------
var rc_jobCat = new Object();
rc_jobCat['0'] = '-- Please Select Job Category --';
rc_jobCat['11000'] = 'Accounting / Auditing';
rc_jobCat['12000'] = 'Administration / Secretary';
rc_jobCat['47000'] = 'Airline / Travel / Tourism';
rc_jobCat['13000'] = 'Banking / Finance / Securities';
rc_jobCat['14000'] = 'Building / Architectural';
rc_jobCat['23000'] = 'Catering';
rc_jobCat['17000'] = 'Customer Service';
rc_jobCat['18000'] = 'Design';
rc_jobCat['19000'] = 'Education';
rc_jobCat['20000'] = 'Engineering';
rc_jobCat['53450'] = 'Fresh Graduate / Management Trainee';
rc_jobCat['22000'] = 'Health / Beauty';
rc_jobCat['30000'] = 'Hospital / Medical / Pharmaceutical';
rc_jobCat['53460'] = 'Hospitality / Hotel';
rc_jobCat['24000'] = 'Human Resources';
rc_jobCat['25000'] = 'Insurance';
rc_jobCat['26000'] = 'IT';
rc_jobCat['15000'] = 'Journalism';
rc_jobCat['27000'] = 'Legal';
rc_jobCat['28000'] = 'Logistics / Transportation / Shipping';
rc_jobCat['21000'] = 'Management';
rc_jobCat['29000'] = 'Manufacturing';
rc_jobCat['41000'] = 'Marketing / Advertising';
rc_jobCat['31000'] = 'Merchandising / Purchasing';
rc_jobCat['48000'] = 'Others';
rc_jobCat['53480'] = 'Part Time / Temporary Job / Contract';
rc_jobCat['32000'] = 'Property / Estate Management';
rc_jobCat['33000'] = 'Publishing / Printing';
rc_jobCat['34000'] = 'Quality Assurance / Control & Testing';
rc_jobCat['43000'] = 'Retail';
rc_jobCat['44000'] = 'Sales';
rc_jobCat['53600'] = 'Social Services';
rc_jobCat['53700'] = 'Government';




//-- cat & fun map --
var rc_catFuncMap = new Object();
var rc_catFuncNVP = new Object();
rc_catFuncNVP['0'] = '-- Please Select Job Function --';
rc_catFuncNVP['56000'] = 'Accounting / Financial Management';
rc_catFuncNVP['6560'] = 'Credit Control';
rc_catFuncNVP['56001'] = 'External Audit';
rc_catFuncNVP['3542'] = 'General Accounting';
rc_catFuncNVP['3543'] = 'Internal Audit';
rc_catFuncNVP['56060'] = 'Others';
rc_catFuncNVP['3544'] = 'Taxation';
rc_catFuncMap['11000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56002'] = 'Administration / Personal Assistant / Executive / Secretary';
rc_catFuncNVP['3546'] = 'Clerical Support';
rc_catFuncNVP['56003'] = 'Office Management';
rc_catFuncNVP['56024'] = 'Others';
rc_catFuncMap['12000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56061'] = 'Customer Service';
rc_catFuncNVP['3638'] = 'Flight / Ground Service';
rc_catFuncNVP['56062'] = 'Others';
rc_catFuncNVP['56034'] = 'Ticketing / Reservation';
rc_catFuncNVP['56035'] = 'Tour Guide';
rc_catFuncNVP['56036'] = 'Travel Agency / Consultant';
rc_catFuncMap['47000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3550'] = 'Analysis';
rc_catFuncNVP['3552'] = 'Compliance / Regulatory';
rc_catFuncNVP['3557'] = 'Corporate Finance';
rc_catFuncNVP['3558'] = 'Credit Analysis / Approval';
rc_catFuncNVP['3559'] = 'Dealing & Trading';
rc_catFuncNVP['3545'] = 'Equities / Capital Market / Treasury';
rc_catFuncNVP['56063'] = 'Financial Services';
rc_catFuncNVP['3548'] = 'Fund Management';
rc_catFuncNVP['56004'] = 'Investment';
rc_catFuncNVP['56064'] = 'Legal';
rc_catFuncNVP['56065'] = 'Loan';
rc_catFuncNVP['56066'] = 'Mortgage';
rc_catFuncNVP['56067'] = 'Others';
rc_catFuncNVP['3560'] = 'Private Banking';
rc_catFuncNVP['3554'] = 'Retail Banking';
rc_catFuncMap['13000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3561'] = 'Architectural';
rc_catFuncNVP['3562'] = 'Building / Construction';
rc_catFuncNVP['56068'] = 'Others';
rc_catFuncNVP['3565'] = 'Surveying';
rc_catFuncMap['14000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3591'] = 'Catering';
rc_catFuncNVP['56009'] = 'Food ';
rc_catFuncNVP['56070'] = 'Others';
rc_catFuncMap['23000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3626'] = 'Customer Service';
rc_catFuncMap['17000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3576'] = 'Draftsman';
rc_catFuncNVP['3573'] = 'Fashion';
rc_catFuncNVP['3574'] = 'Graphic';
rc_catFuncNVP['3563'] = 'Interior';
rc_catFuncNVP['56071'] = 'Multi-Media';
rc_catFuncNVP['56072'] = 'Others';
rc_catFuncNVP['3575'] = 'Product';
rc_catFuncMap['18000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56007'] = 'Lecturer / Professor';
rc_catFuncNVP['3609'] = 'Librarian';
rc_catFuncNVP['56005'] = 'Others';
rc_catFuncNVP['56006'] = 'Teacher';
rc_catFuncNVP['3577'] = 'Tutor / Teaching  Assistant';
rc_catFuncMap['19000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3580'] = 'Building Service';
rc_catFuncNVP['3578'] = 'Chemical / Environmental Protection / Laboratory';
rc_catFuncNVP['3579'] = 'Civil / Structural';
rc_catFuncNVP['3581'] = 'Electrical / Electronic';
rc_catFuncNVP['3583'] = 'Industry / Manufacturing';
rc_catFuncNVP['3585'] = 'Mechanical';
rc_catFuncNVP['56073'] = 'Others';
rc_catFuncNVP['56008'] = 'Project Management';
rc_catFuncNVP['56093'] = 'Research & Development';
rc_catFuncNVP['3587'] = 'Telecommunication / Wireless / Radio';
rc_catFuncMap['20000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56014'] = 'Fresh Graduate / Management Trainee';
rc_catFuncMap['53450'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3590'] = 'Health / Beauty Care';
rc_catFuncNVP['56074'] = 'Others';
rc_catFuncMap['22000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56075'] = 'General Support';
rc_catFuncNVP['56016'] = 'Medical Services';
rc_catFuncNVP['56017'] = 'Nursing';
rc_catFuncNVP['3615'] = 'Others';
rc_catFuncNVP['56018'] = 'Professional / Specialist';
rc_catFuncMap['30000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56012'] = 'Customer Service / Guest Relations';
rc_catFuncNVP['56010'] = 'Front Desk / Office';
rc_catFuncNVP['3592'] = 'Others';
rc_catFuncNVP['56011'] = 'Reservation';
rc_catFuncMap['53460'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3594'] = 'HR / Personnel / Administration';
rc_catFuncNVP['3595'] = 'Training & Development';
rc_catFuncMap['24000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3597'] = 'Insurance';
rc_catFuncNVP['56076'] = 'Others';
rc_catFuncMap['25000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56013'] = 'Management';
rc_catFuncNVP['3604'] = 'Network / Technical Support';
rc_catFuncNVP['56077'] = 'Others';
rc_catFuncNVP['3603'] = 'Programming';
rc_catFuncNVP['3605'] = 'System Support';
rc_catFuncMap['26000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3571'] = 'Creative Writing';
rc_catFuncNVP['3566'] = 'Editorial';
rc_catFuncNVP['3570'] = 'Media Production / Photography';
rc_catFuncNVP['3568'] = 'News Report /  Anchor';
rc_catFuncNVP['56078'] = 'Others';
rc_catFuncNVP['3569'] = 'Translation';
rc_catFuncMap['15000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3572'] = 'Company Secretary';
rc_catFuncNVP['3608'] = 'Legal Service';
rc_catFuncNVP['56079'] = 'Others';
rc_catFuncMap['27000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56080'] = 'Chain & Supply';
rc_catFuncNVP['3610'] = 'Logistics';
rc_catFuncNVP['56033'] = 'Management';
rc_catFuncNVP['56081'] = 'Others';
rc_catFuncNVP['3635'] = 'Shipping';
rc_catFuncNVP['3636'] = 'Transportation';
rc_catFuncNVP['3612'] = 'Warehouse / Inventory';
rc_catFuncMap['28000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3589'] = 'Management';
rc_catFuncMap['21000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3613'] = 'General / Production Workers';
rc_catFuncNVP['56015'] = 'Manufacturing Management';
rc_catFuncNVP['56082'] = 'Others';
rc_catFuncNVP['56083'] = 'Product Development / Management';
rc_catFuncNVP['3614'] = 'Production Planning / QC';
rc_catFuncMap['29000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3625'] = 'Advertising / Market Communication';
rc_catFuncNVP['56084'] = 'Brand Marketing';
rc_catFuncNVP['3629'] = 'Corporate Communication / PR';
rc_catFuncNVP['56085'] = 'Customer Relationship Management';
rc_catFuncNVP['3628'] = 'General Marketing';
rc_catFuncNVP['3627'] = 'Market Research';
rc_catFuncNVP['56086'] = 'Others';
rc_catFuncNVP['56087'] = 'Product Marketing';
rc_catFuncMap['41000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['36081'] = 'Electrical / Electronic';
rc_catFuncNVP['36001'] = 'Fabric / Textile';
rc_catFuncNVP['36281'] = 'Fashion / Garment Accessories';
rc_catFuncNVP['36261'] = 'Footwear';
rc_catFuncNVP['36021'] = 'Garment / All';
rc_catFuncNVP['56088'] = 'Garment / Knit';
rc_catFuncNVP['56089'] = 'Garment / Sweater';
rc_catFuncNVP['56090'] = 'Garment / Woven';
rc_catFuncNVP['36141'] = 'Gift / Premium';
rc_catFuncNVP['36221'] = 'Handbag';
rc_catFuncNVP['36341'] = 'Household / Kitchen Wares';
rc_catFuncNVP['36241'] = 'Jewellery / Watch';
rc_catFuncNVP['56019'] = 'Merchandising Management';
rc_catFuncNVP['56020'] = 'Others';
rc_catFuncNVP['56091'] = 'Printing';
rc_catFuncNVP['56021'] = 'Procurement / Purchasing / Sourcing';
rc_catFuncNVP['36161'] = 'Stationary';
rc_catFuncNVP['36201'] = 'Sundries / Seasonal Items';
rc_catFuncNVP['36121'] = 'Toys';
rc_catFuncMap['31000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['6561'] = 'Others';
rc_catFuncMap['48000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56023'] = 'Part Time / Temporary Job / Contract ';
rc_catFuncMap['53480'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3619'] = 'Others';
rc_catFuncNVP['56026'] = 'Property / Estate Management';
rc_catFuncNVP['3620'] = 'Property Consultant / Agency';
rc_catFuncNVP['56025'] = 'Security';
rc_catFuncMap['32000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3622'] = 'Circulation';
rc_catFuncNVP['56092'] = 'Others';
rc_catFuncNVP['3623'] = 'Production';
rc_catFuncMap['33000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['8617'] = 'Electrical / Electronic';
rc_catFuncNVP['8618'] = 'Fashion / Garment Accessories';
rc_catFuncNVP['8619'] = 'Garment & Textile';
rc_catFuncNVP['8621'] = 'Others';
rc_catFuncNVP['3624'] = 'QA';
rc_catFuncNVP['8620'] = 'Toys & Sundries';
rc_catFuncMap['34000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56094'] = 'Others';
rc_catFuncNVP['56027'] = 'Retail Management';
rc_catFuncNVP['3632'] = 'Retail Sales';
rc_catFuncMap['43000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['3631'] = 'Business Development';
rc_catFuncNVP['56028'] = 'General Sales';
rc_catFuncNVP['56095'] = 'Others';
rc_catFuncNVP['56031'] = 'Sales Administration';
rc_catFuncNVP['56029'] = 'Sales Engineer / Technical Sales';
rc_catFuncNVP['56030'] = 'Sales Management';
rc_catFuncNVP['56032'] = 'Telemarketing / Call Centre';
rc_catFuncMap['44000'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56096'] = 'Social Services';
rc_catFuncNVP['56097'] = 'Others';
rc_catFuncMap['53600'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncNVP['56098'] = 'Government';
rc_catFuncMap['53700'] = rc_catFuncNVP;
rc_catFuncNVP = new Object();
rc_catFuncNVP['0']  = '-- Please Select Job Function --';
rc_catFuncMap['0'] = rc_catFuncNVP;







