// The below function showDestinationDiv seems obsolete may be removed after confirming with SEO / Affiliates.
function showDestinationDiv(show) {
        alert("Please report a defect if this alert is shown REF:7691428");
        document.getElementById("destinationsearch").style.display  = show ? "block" : "none";
        document.getElementById("hotelsearch").style.display        = show ? "none"  : "none";
        document.getElementById("detailedsearch").style.display     = show ? "none"  : "block";
        document.getElementById('linkswitchback').style.display     = show ? "block" : "none";
        document.getElementById('linknewsearch').style.display      = show ? "none"  : "block";
    }
/*
    function switchoption() {
        if (document.getElementById('detailedsearch').style.display == '') {
            document.getElementById('destinationsearch').style.display = '';
            document.getElementById('detailedsearch').style.display = 'none';
            document.getElementById('caption').innerHTML = 'Switch to classic search';
            document.getElementById("searchOption").value = "New";
            if (document.getElementById("hotelname").value.length > 0) {
                document.getElementById("hotelname").focus();
                document.getElementById("SearchBy").value = "Name";  
                }
            else {
                document.getElementById("destination").focus();
                document.getElementById("SearchBy").value = "LocationKey";  
            }
            
           
        } else {
            document.getElementById('detailedsearch').style.display = '';
            document.getElementById('destinationsearch').style.display = 'none';
            document.getElementById('caption').innerHTML = 'Use our new search now!';
            document.getElementById("searchOption").value = "Old";
            document.getElementById("SearchBy").value = "criteria"     
        }
        
    }

*/
    function switchoption() {
        if ($("#default_search").val() == "crit") {
            $("#default_search").val("dest");
            $("input[name='hdnLocationID']").val("");
                $("#destinationsearch").show();
                $("#detailedsearch").hide();
                $("#caption").html('Use our classic search');
                var selopt = $(".radio_button:checked").val();
                if (selopt == "dest") {
                    $("#SearchBy").val("LocationKey");
                    $("#hotelname").hide();
                    $("#destination").show();
                    $("#destination").val(HINT_DRE);
                    $("#destination").css("color", "#C0C0C0");
                }
                else if (selopt == "hname") {
                    $("#SearchBy").val("Name");
                    $("#hotelname").show();
                    $("#destination").hide();
                    $("#hotelname").val("");
                }
        }
        else if ($("#default_search").val() == "dest") {
                $("#default_search").val("crit");
                $("#SearchBy").val("criteria");
                $("#destinationsearch").hide();
                $("#detailedsearch").show();
                $("#caption").html('Use our new search now!');
                $("input[name='hdnLocationID']").val("");
        }
    }

    function getSerachResultsBy(sortValue) {
        window.location.replace(replaceQueryString(replaceQueryString(window.location + "", "rpage", document.getElementById("rpage").value), "OrderBy", sortValue));
    }

