﻿function ieHoverFix(menuId, adminMode) {
}



$(document).ready(function() {

    //$('ul#HouseMenuNav').addClass('sf-menu');

    try {
        $('ul#HouseMenuNav').supersubs({
            minWidth: 12,   // min width of sub-menus in em units 
            maxWidth: 27,   // max width of sub-menus in em units 
            extraWidth: 1.5   // extra width can ensure lines don't sometimes turn over due to slight rounding differences and font-family 
        }).superfish({
            delay: 800,                             // delay on mouseout 
            animation: { opacity: 'show', height: 'show' },  // fade-in and slide-down animation 
            speed: 'fast',                          // animation speed (slow/normal/fast)
            autoArrows: true,                            // enable generation of arrow mark-up 
            dropShadows: true                             // enable drop shadows
        });
    }
    catch (exx) {
    }

    //middle menu - select item
    $('#MiddleMenu ul li').each(function() {

        if (location.href.toLowerCase().indexOf($(this).children('a:first-child').attr('rel').toLowerCase()) > -1) {
            $(this).addClass('current');
        }
    })

    //fix content alignment if there is no text in ContentPane but in LeftPane and RightPane
    if ($('td.leftPane').find('.SimpleWrapper').length > 0 && $('td.rightPane').find('.SimpleWrapper').length > 0 && $('td.ContentPane').find('.SimpleWrapper').length == 0) {
        $('td.leftPane').css('width', '50%');
        $('td.rightPane').css('width', '50%');
    }

    //fill page header


    $('#PageHeader').text(document.title);
    if ($('#PageHeader').length > 0) {
        if (document.title.length > 0) {
            var HeaderText = document.title;
            var HeaderArray = HeaderText.split("-");
            if (HeaderArray.length > 1) {
                $('#PageHeader').html(HeaderArray[0] + ' - ' + '<span>' + HeaderArray[1] + '</span>');
            }
        }
    }

    //fix height of 2 bordered boxes
    if ($('td.leftPane').find('.SimpleWrapper').length > 0 && $('td.rightPane').find('.SimpleWrapper').length > 0 && $('td.ContentPane').find('.SimpleWrapper').length == 0) {
        var LeftBox = $('td.leftPane').find('.SimpleWrapper');
        var RightBox = $('td.rightPane').find('.SimpleWrapper');

        var MaxHeight = (LeftBox.css('height') >= RightBox.css('height')) ? LeftBox.css('height') : RightBox.css('height');

        LeftBox.css('height', MaxHeight); RightBox.css('height', MaxHeight);
    }


});




