$(document).ready(function() {

    $("li.topmenu > a").stop().mouseover(function(){
        var title = $(this).html();
        $('div#menutitles').hide();
        $("div#menutitles > p").text(title);
        $('div#menutitles').css("left", "-600px");
        $('div#menutitles').show();
        $("div#menutitles").animate({
            left: '0'
        }, 300);
    });

    $("ul.menu").stop().mouseout(function(){
        $('div#menutitles').hide();
    });

    if ($("#xmas")) {
        $("div#xmas").insertAfter($("div#main"));
        $("div#xmas").css({"width" : $("body").outerWidth()});
        $("div#xmas").animate({
            top: $(window).scrollTop() + $(window).height() - $("#xmas").outerHeight()
        }, 300);

        $(window).resize(function(){
            $("div#xmas").css({"width" : $("body").outerWidth()});
            $("div#xmas").css({"top" : $(window).scrollTop() + $(window).height() - $("#xmas").outerHeight()});
        });

        $(window).scroll(function(){
            $("div#xmas").css({"top" : $(window).scrollTop() + $(window).height() - $("#xmas").outerHeight()});
        });

        $("a.close").click(function(){
            $("div#xmas").hide();
            if (!event.preventDefault()){
                event.returnValue = false;
            }
        });

    }

});
