﻿/**/function introParagragh() {
    var introHeight = $("p.intro").height();

    $("#twoCol").css({
    //"margin-top": introHeight + 60
});
}

function featuredEvent() {
    var eventHeight = $(".eventsInfo").height();

    $(".eventContainer .featured").css({
        "height": eventHeight - 10
    });
}

function showNavContent(n) {

    $("#heroNavContent" + n).show().siblings(".heroNavContent").hide();

}

//when the DOM is ready
$(document).ready(function() {
    //Jquery PNG fix					   
    $(document).pngFix();

    introParagragh();
    featuredEvent();

    $(".logoSlider").jCarouselLite({
        btnNext: ".logoSlider_next",
        btnPrev: ".logoSlider_prev",
        visible: 4,
        scroll: 1,
        vertical: false
    });




    setInterval("jQuery('.logoSlider_next img').click()", 5000);

if ($("#heroCarousel").length){

    $("#heroCarousel").jCarouselLite({
        btnNext: "#heroNext",
        btnPrev: "#heroPrev",
        visible: 4,
        scroll: 1,
        circular: true,
        vertical: false,
        beforeStart: function(a, b) {

            var imgUrl = $(a[2]).children("img")[0].src;
            if (imgUrl.indexOf("-dim.png") == (-1)) $(a[2]).children("img")[0].src = imgUrl.replace(".png", "-dim.png");

        },
        afterEnd: function(a) {

            var imgUrl = $(a[2]).children("img")[0].src;
            $(a[2]).children("img")[0].src = imgUrl.replace("-dim.png", ".png");

            //retrieve pane id from img src...
            imgUrl = imgUrl.replace("-dim.png", "");
            imgUrl = imgUrl.replace(".png", "");
            showNavContent(imgUrl.charAt(imgUrl.length - 1));

        }

    });

    var ogLis = $("#heroCarousel li");
    var imgUrl = $(ogLis[6]).children("img")[0].src;
    $(ogLis[6]).children("img")[0].src = imgUrl.replace("-dim.png", ".png");

    //feature Third slide
    showNavContent(3);
}

});

