/**********************
START DOCUMENT READY
**********************/
$(document).ready(function () {
    /*Menu*/
    $("#nav-menu li").hover(
		function () {
		    $(this).find("ul").show();
		    $(this).addClass("hover");
		},
		function () {
		    $(this).find("ul").hide();
		    $(this).removeClass("hover");
		}
	);

    /*Intrabar Resorts*/
    $(".iright, .resorts").hover(
		function () {
		    $(".resorts").show();
		    $(".iright").addClass("active");
		},
		function () {
		    $(".resorts").hide();
		    $(".iright").removeClass("active");
		}
	);

    /*Plan Your Trip*/
    $('#plan-trip .buttons .submit').click(function () {
        var arrivaldate = $("#arrivaldate").val();
        var departuredate = $("#departuredate").val();
        var adultcount = $("#adults").val();
        var childcount = $("#children").val();
        var url = "http://www.inntopia.travel/aspnet/09/search.aspx?productsupercategoryid=1&productcategoryid=1&salesid=656921&arrivaldate=" + arrivaldate + "&departuredate=" + departuredate + "&adultcount=" + adultcount + "&childcount=" + childcount + ""
        window.open(url, "_self", "", "");
    });

    /*Tabs*/
    $("#tabs").tabs();

    /*List Item Description*/
    $('.view').click(function () {
        $(this).parent().parent().parent().children(".desc").toggle();
        return false;
    });

    /*DEFAULT VALUE*/
    var default_values = new Array();
    $("input.default-value").focus(function () {
        if (!default_values[this.id]) {
            default_values[this.id] = this.value;
        }
        if (this.value == default_values[this.id]) {
            this.value = '';
        }
        $(this).blur(function () {
            if (this.value == '') {
                this.value = default_values[this.id];
            }
        });
    });
});
/**********************
END DOCUMENT READY
**********************/
//Custom function created by Intrawest
function showHide(elementid) {
    if (document.getElementById(elementid).style.display == 'none') {
        document.getElementById(elementid).style.display = '';
    } else {
        document.getElementById(elementid).style.display = 'none';
    }
} 
