function getPage(page) {
    $.ajax({
        type: "POST",
        url: "searchcriteriaservice.asmx/GetMe",
        data: "{countryId: '" + page + "'}",
        //data: "{countryid: '" + document.getElementById('').value + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(response) {
            var lmDestinations = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
            jQuery('#destinations').empty();
            var html = '<select name="destination" id="destination" class="dropdown2" style="width:100px;"><option value="0" selected="selected">Alle områder</option>';
            for (var i = 0; i < lmDestinations.length; i++) {
                html += '<option value="' + lmDestinations[i].DestinationId + '">' + lmDestinations[i].DestinationName + '</option>';
            }
            html += '</select>';
            jQuery('#destinations').html(html);
        },
        failure: function(msg) {
            alert("error");
            $('#destinations').text(msg);
        }
    });
}
function toggleGreyOut(selId) {
    if (selId > 2) {
        //document.getElementById('departure').disabled = true;
        document.getElementById('departure').value = 0;
        document.getElementById('departure').style.display = 'none';
        document.getElementById('headdep').innerHTML = '';
    }
    else {
        //var s = document.getElementById('departure');
        document.getElementById('departure').style.display = 'block';
        document.getElementById('headdep').innerHTML = 'Afrejsested';
        //document.getElementById('departure').disabled = false;
    }
    if (selId == 6) {
        document.getElementById('country').value = 0;
        document.getElementById('country').style.display = 'none';
        document.getElementById('destination').value = 0;
        document.getElementById('destination').style.display = 'none';
        document.getElementById('headcountry').innerHTML = '';
        document.getElementById('headdest').innerHTML = '';
    }
    else {
        document.getElementById('headcountry').innerHTML = 'Land';
        document.getElementById('headdest').innerHTML = 'Rejsemål';
        document.getElementById('country').style.display = 'block';
        document.getElementById('destination').style.display = 'block';
    }
}
