/// <reference path="../jquery/jquery-1.3.2-vsdoc2.js" />

//master pages onload event handler.
$(document).ready(function () {

    //watch for resize events.
    //$(window).watch('height', function() { MasterPageModule.handleWindowResize('watch-not-msie'); });
    //$(window).watch('width', function() { MasterPageModule.handleWindowResize('watch-not-msie'); });
    $(window).resize(function () { MasterPageModule.handleWindowResize('watch-msie'); });

    //initalize the superfish menu.
    $('ul.sf-menu').superfish({
        delay: 200,                                         // milleseconds for delay on mouseout 
        animation: { opacity: 'show', height: 'show' },     // fade-in and slide-down animation 
        speed: 'normal',                                    // faster animation speed 
        autoArrows: true,                                   // disable generation of arrow mark-up 
        dropShadows: true                                   // disable drop shadows
    });

    //use the corner plugin to round out the box.
    $('div.SelectorRoundedCorner').corner();

    $('.sf-solus-sub').css('color', '#ffffff');

    //reposition the footer.
    MasterPageModule.handleWindowResize();

});


//namespacing for javascript forms.
var MasterPageModule = function () {

    // Public methods ---------------------------------------------------------------------------->
    return {

        handleWindowResize: function (trigger) {

            //check to see if we need to correct the header.
            var hasVScroll = $(document).height() > $(window).height();
            //alert(hasVScroll);

            //reposition the footer.
            if (hasVScroll == false) {
                //$('#ContentWrap').height($(window).height() - 300);
                $('#ContentWrap').height($(window).height() - 350);
            }
        }
    };
} ();
