﻿$(document).ready(function() {
        var headerContainer = $("#pnlBody div.logonHeaderContainer");
        var formContainer = $("#pnlBody div.logonFormContainer");
        var loggingIn = $("#pnlBody div.loggingIn");
        
        var wWidth = $(window).width();
        var wHeight = $(window).height();
        var wOffset = ((wWidth / 2) + 250);
                
        headerContainer.height($("#pnlBody div.logonHeader").height() + 40);
        
        var topSliderHeight = headerContainer.height();
        var bottomSliderHeight = formContainer.height();
        var sliderHeight = topSliderHeight + bottomSliderHeight + 10;
        
        var hTopOffset = (wHeight / 2) - (sliderHeight / 2);
        
        headerContainer.css("top", hTopOffset + "px");
        formContainer.css("top", (hTopOffset + topSliderHeight + 10) + "px");
        
        headerContainer.animate({
            width: wOffset
        }, 2000);
        
        formContainer.animate({
            width: wOffset
        }, 2000);
        
        loggingIn.css("top", ((wHeight / 2) - 22.5) + "px").css("left", ((wWidth / 2) - 150) + "px");
     
        
        $("#pnlBody input.LogonButton").click(function() {
            if (Page_IsValid) {
                headerContainer.animate({
                    width: "0px"
                }, 2000);
                
                formContainer.animate({
                    width: "0px"
                }, 2000);
                
                loggingIn.fadeIn("slow");
            }
        });
});
