// jQuery Animated Dropdowns
// Created by Kevin Becker
// http://www.kevinbecker.name/
// http://www.mindsculpt.net/

$(document).ready(function () {

    var startingHeight = 76; // Specifies the height of your navigation when collapsed
    var speed = 300; // Specifies the speed of the animation

    var heights = new Array();

    var i = 1;
    while ($("#nav"+i).length) {
        heights.push($("#nav"+i).height() + 8);
        $("#nav"+i).height(startingHeight);
        $("#nav"+i).mouseover(function () {
            $(this).stop().animate({height:heights[this.id.substr(3)-1]},{queue:false, duration:speed});
            $(this).children('.menu_head').children('a').css("background", "#6f923c");
        });
        $("#nav"+i).mouseout(function () {
            $(this).stop().animate({height:startingHeight+'px'},{queue:false, duration:speed,
                complete: function() {
                    $(this).children('.menu_head').children('a').css("background", "#636466");
                    $(this).children('.active').children('a').css("background", "#6f923c");
                }
            });
        });
        i++;
    }

    $("#nav ul").css("visibility", "visible");

    var path = window.location.toString();

    for(var i=0; $("#nav2 a").length > i; i++) {
        var navItem = $("#nav2 a")[i].toString();
        if(i < 2) {
            $('#one h2').addClass('selected1');
        }
        if (i > 0 && (navItem == path)) {
            $('#one').liteAccordion({containerWidth : 686, containerHeight : 335, slideSpeed : 600, firstSlide : i, headerWidth : 32 });
        }
    }

});


