$(document).ready(function () {
//jCarousel Plugin
    //debugger;
    $('#carousel').jcarousel({
        vertical: true,
        scroll: 1,
        auto: 2,        
        wrap: 'last',
        visible: 3,
        buttonNextHTML: null,
        buttonPrevHTML: null,
        initCallback: mycarousel_initCallback
    });
    //Front page Carousel - Initial Setup
    $('div#slideshow-carousel a img').css({'opacity': '0.5'});
    $('div#slideshow-carousel a img:first').css({'opacity': '1.0'});
    //Combine jCarousel with Image Display
    $('div#slideshow-carousel li a').hover(
        function () {
            if (!$(this).has('span').length) {
            $('div#slideshow-carousel li a img').stop(true, true).css({'opacity': '0.5'});
            $(this).stop(true, true).children('img').css({'opacity': '1.0'});
        } },
        function () {
            $('div#slideshow-carousel li a img').stop(true, true).css({'opacity': '0.5'});
            $('div#slideshow-carousel li a').each(function () {
                if ($(this).has('span').length) $(this).children('img').css({'opacity': '1.0'});
            });
        }
    ).click(function () {
        $('span.arrow').remove(); $('div#slideshow-main li').removeClass('active'); $('div#slideshow-main li.' + $(this).attr('rel')).addClass('active'); return false;
    });
   
   //lightBox
   $('a.lightbox').lightBox();

});


function mycarousel_initCallback(carousel) {
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
    carousel.stopAuto();
    }, function() {
    carousel.startAuto();
    });
}



$(function(){
    $('#contact').contactable({
        subject: 'A Feeback Message'
    });
    


    $("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
    $("#topnav li").each(function() { //For each list item...
    var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
    $(this).find("span").show().html(linkText); //Add the text in the <span> tag
    });
    $("#topnav li").hover(function() { //On hover...        
        $(this).find("span").stop().animate({
        marginTop: "-40" //Find the <span> tag and move it up 40 pixels
        }, 250);
        } , function() { //On hover out...
        $(this).find("span").stop().animate({
        marginTop: "0" //Move the <span> back to its original state (0px)
        }, 250);
        });

});



function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}




var openstat = { counter: 2046266, next: openstat };
(function(d, t, p) {
var j = d.createElement(t); j.async = true; j.type = "text/javascript";
j.src = ("https:" == p ? "https:" : "http:") + "//openstat.net/cnt.js";
var s = d.getElementsByTagName(t)[0]; s.parentNode.insertBefore(j, s);
})(document, "script", document.location.protocol);




