function ta_hideLayer(theLayer) {
    if(document.getElementById) {
        //functionality for standard browsers
        if (!document.getElementById(theLayer)) {
        } else {
            document.getElementById(theLayer).style.visibility = "hidden";
        }
    }
    else if (document.all) {
        //functionality for older IE browsers
        document.all[theLayer].style.visibility = "hidden";
    }
    else if (document.layers) {
        //functionality for NN4
        if (document.layers[theLayer]) {
            document.layers[theLayer].visibility = 'hide';
        }
   }
}

function ta_showLayer(theLayer) {
    if (document.getElementById) {
        //functionality for standard browsers
        document.getElementById(theLayer).style.visibility = "visible";
    }
    else if (document.all) {
        //functionality for older IE browsers
        document.all[theLayer].style.visibility = "visible";
    }
    else if (document.layers) {
        //functionality for NN4
        if (document.layers[theLayer]) {
            document.layers[theLayer].visibility = 'show';
        }
    }
}

function ta_handleChildrenMenu() {

    if(document.searchForm.ts_with_children.checked == true) {
        ta_showLayer("children_menus");
    } else {
        ta_hideLayer("children_menus");
    }
}

function handleAccommodationMenu() {

    if (ta_accEn) {
        if (typeof ta_accDisableDestAtt != 'undefined') {
            for (i = 0; i < ta_accDisableDestAtt.length; i++) {
                if(eval('document.searchForm.tade_'+ta_accDisableDestAtt[i]+'.checked') == true) {
                    ta_hideLayer("stars");
                    ta_hideLayer("search_param2");
                    ta_hideLayer("accommodation");
                    return;
                }
            }
        }
        ta_showLayer("accommodation");

        if(ta_getValue(document.searchForm.ts_accommodation) != "kaikki" && ta_getValue(document.searchForm.ts_accommodation) != "htl" && ta_getValue(document.searchForm.ts_accommodation) != "hhtl" && ta_getValue(document.searchForm.ts_accommodation) != "H" && ta_getValue(document.searchForm.ts_accommodation) != "A") {
            ta_hideLayer("stars");
            ta_hideLayer("search_param2");
        } else {
            ta_showLayer("stars");
            ta_showLayer("search_param2");
        }
    }
}

function ta_handleSettlingMenu() {

    var new_shared = _ta_isShareable(document.searchForm.ts_adults, document.searchForm.ts_ch_2);

    if (new_shared || document.searchForm.ts_room_count.selectedIndex == 0) {
        ta_hideLayer("settling");
    } else {
        ta_showLayer("settling");
    }
}

function handleDestinationMenu() {

    if (ta_destAttEn) {
        if(ta_getValue(document.searchForm.ts_dest) != "kaikki") {
            ta_hideLayer("search_param0");
        } else {
            ta_showLayer("search_param0");
        }
    }
}