$(document).ready(function(){

    // newsletter validate ---
    $("#newslettersignupthankyoulabel").hide();
        $("#newslettersignupform").validate({
            onfocusout: false,
            errorLabelContainer: "#errorholder",
            invalidHandler: function(form) {
                $("#signuplabel").hide();
            },
            submitHandler: function(form) {
                $(form).ajaxSubmit(function(){
                    $("#newslettersignupform").hide();
                    $("#newslettersignupthankyoulabel").show();
                });
            }
        });
    // / newsletter validate ---

    // lightbox handler ---
    $('.lightbox').lightbox();
    // / lightbox handler ---

    // main carousel handler ---
    jQuery('#maincarousel').jcarousel({
        start: 1,
        scroll: 1,
        auto: 5,
        wrap: 'circular',
        visible: 1,
        animation: 'slow'
    });
    // / main carousel handler ---

    // events carousel handler ---
    if(eventscarousel == 1)
    {
        jQuery('#eventscarousel').jcarousel({
            vertical: true,
            start: 1,
            scroll: 1,
            wrap: 'circular',
            visible: 1,
            animation: 'slow'
        });
    }
    // / events carousel handler

    // press carousel handler ---
    if(presscarousel == 1)
    {
        jQuery('#presscarousel').jcarousel({
            start: 1,
            scroll: 1,
            wrap: 'circular',
            visible: 1,
            animation: 'slow'
        });
    }
    // / events carousel handler

    // photos handler
    if(photos == 1)
    {
        $('#loadphotos').load('index.php/loader/photoloader/'+firstphotocatid);

        $(".photocat").live('click',function() {
            var showcatphotos = $(this).attr("rel");
            $('#loadphotos').load('index.php/loader/photoloader/'+showcatphotos);
        });

        $(function() {
            $('.scrollpane01').jScrollPane();
        });
    }
    // / photos handler

    // videos handler
    if(ytplaylist == 1)
    {
        $('#loadvideos').load('index.php/loader/videoloader/'+firstvideocatid);

        $(".videocat").live('click', function() {
            var showcatvideos = $(this).attr("rel");
            $('#loadvideos').load('index.php/loader/videoloader/'+showcatvideos);
        });
            
        $(function() {
            $('.scrollpane01').jScrollPane();
        });
    }
    // / videos handler

});
