﻿/// <reference path="../../Scripts/jquery-1.2.6-vsdoc.js" />

$(document).ready(function() {
    SetupStaticMenu();

    ConfigureWings();
    //If the User resizes the window, adjust the wing height
    $(window).bind("resize", ConfigureWings);
});

function SetupStaticMenu() {
    $('#tblMenuStatic td').hover(
    //hover over
    function() { $(this).removeClass(); $(this).addClass(this.id + '_hover'); },
    //hover out
    function() { $(this).removeClass(); $(this).addClass(this.id); }
    );

    //Set links
    $('#tblMenuStatic td').click(function() {
        window.open($(this).attr('url'), '_self', '', '');
    });

    //static menu subitem event
    $('#tblMenuStatic .I3').hover(
    //hover over
        function() { /*$(this).height(200);*/$('.subItems').slideDown("300"); },
    //hover out
        function() { /*$(this).height(50);*/$('.subItems').slideUp("300"); }
    );
}

function ConfigureWings() {
    //NOTE: sides should by default be positioned all the way at the top of each side.
    //Template will have some minimum height set.
    //#1)Detect the page height
    var height = $('#divBoundary2').height(); //height of browser window

    //#2 Set left and right side height to form height
    $('.Wing').height(height);
    //#3 Shift left and right sides into position
    $('.Wing').css("margin-top", "-" + height + "px");
    //#4 Show the Wings
    $('.Wing').show();
}



