$(document).ready(function() {
    // do stuff when DOM is ready
    $("#slides").cycle("fade");
    $("*[title]").qtip({
        style: {
            classes: 'ui-tooltip-youtube small'
        },
        position: {
            viewport: $(window)
        }
    });

    $("#navigation").superfish();
    if ($.browser.msie && $.browser.version.substr(0,1) < 8) {
        $("#ie6Warning").fadeIn("slow");
    }
    // Fade in the logo
    if (window.location.pathname.indexOf("Home.jsp") != -1 ) {
        $("#Header\\:logo").slideDown(1000);
    } else {
        $("#Header\\:logo").show();
    }
    $("#Header\\:twitter-follow").show(1000);

    //If I am not in reservations page then continue. Reservations page has
    //heaps of red buttons which does not need to checked.
    if ($("#form1\\:outputText_Headline").html() == "Reservations") {
        return;
    }
    // do check for delete buttons and add extra msgbox
    $(".buttonRedAdmin").each( function( intIndex, button ){
        var onclick = $(button).attr("onclick");
        $(button).attr("onclick", "");
        if (onclick) {
            $(button).click(function () {
                if (!confirm('Are you sure you wish to delete this item?')) {
                    return false;
                }
                onclick();
            });
        }
    });
});
