$(document).ready(function() {

	$("#tabs").tabs("rotate", 1000, true);

});


function ResizeContainer()
{  
    var difference = 0;
    
    $('div[id^="mod"]').each(function()
    {
        var currentDifference = parseInt($(this).height() - $(this).css('min-height').replace('px', ''));
        
        if(currentDifference > difference)
        {
            difference = currentDifference;
        }
    });
    
    $('#container').height($('#container').height() + difference);
}

function ResizeForm(formID, numberOfValidators)
{
    if($('.form' + formID + ' .formValidator').css('display') == 'none') //only run once
    {
        var offset = 15; 
    
        $('#container').height($('#container').height() + (offset * numberOfValidators));
    }
}

function ResizeModule(name)
{
    if (typeof(Page_Validators) != 'undefined') 
    {
        if(!Page_IsValid)
        {
            if(!$('.' + name).parent().attr('style'))
            {
                var offset = 10; 
                var numberOfValidators = $('span[id*="RequiredFieldValidator"]').length;
            
                $('.' + name).parent().height($('.' + name).parent().height() + (offset * numberOfValidators));
                ResizeContainer();
            }
        }
    }
}

$(window).load(function() {
    ResizeContainer();
});

$(document).ready(function() {
    var nav = window.location.pathname;
    $('ul[id^="ni"] li[^="link"] a[href$="' + nav + '"] ').addClass('activeLink');
});


