jQuery.noConflict();

// Put all your code in your document ready area

jQuery(document).ready(function ($) {

    // Do jQuery stuff using $ this where the functions need to go   

    //============ HOMEPAGE IMAGE ROTATOR THUMBNAIL HOVER BORDER EFFECT - Inset Border Effect Plugin - jquery.insetBorderEffect.js ======================

    $("ul.sub_header_nav li a img").insetBorder({
        speed: 400,           // 1000 = 1 second, default 250
        borderColor: "#0075b6",    // Default white (#ffffff)
        inset: 5,             // Border width, default 10px
        borderType: "solid",        // Border type, e.g. dashed
        outerClass: "ibe_outer",    // Class name of outer wrap
        innerClass: "ibe_inner"     // Class name of inner border
    });

    //============ HOMEPAGE IMAGE ROTATOR - Using Cycle Plugin - jquery.cycle.all.min.v2.88.js ======================

    $('div#sub_header_image_rotator').cycle({
        fx: 'fade',
        speed: 1000,
        timeout: 6000,
        pause: true,
        pagerEvent: 'mouseover',
        pager: 'ul.sub_header_nav',
        pagerAnchorBuilder: function (idx, slide) {
            // return selector string for existing anchor
            //alert('ul.sub_header_nav li:eq(' + idx + ') a');
            return 'ul.sub_header_nav li:eq(' + idx + ') a';
        },
        updateActivePagerLink: function (pager, currSlideIndex) {
            // Default behaviour
            $(pager).find('li').removeClass('activeSlide').filter('li:eq(' + currSlideIndex + ')').addClass('activeSlide');

            // Trigger mouseleave event on all pager elements to remove inset border
            $('.ibe_outer').trigger("mouseleave");

            // Trigger mouseenter event on the current pager element to add inset border
            $(pager).find('li:eq(' + currSlideIndex + ') a div.ibe_outer').trigger("mouseenter");

            // Set ocpacity of image of current pager
            $("ul.sub_header_nav li a img").css("opacity", "0.7");
            $("ul.sub_header_nav li.activeSlide img").css("opacity", "1.0");
        }
    });



    //============ HOMEPAGE IMAGE ROTATOR THUMBNAIL HOVER IMAGE OPACITY - jQuery Function ======================

    //-------- Normal State Opacity -------------

    $("ul.sub_header_nav li a img").css("opacity", "0.7");

    //-------- Active State Opacity -------------

    $("ul.sub_header_nav li.activeSlide img").css("opacity", "1.0");

    //-------- Hover State Opacity -------------

    $('ul.sub_header_nav li a:has(img)').hover(function () {
        $('img', this).stop().animate({ "opacity": 1 });
    }, function () {
        $('img', this).stop().animate({ "opacity": 0.7 });
    });

    //============ HOMEPAGE LOGO SCROLLER - Using Cycle Plugin - jquery.cycle.all.min.v2.88.js ======================

    $('div#logo_slideshow').cycle({
        fx: 'scrollRight',
        speed: 1000,
        timeout: 6000
    });

    //============ ADD CLASS TO LAST LIST ITEM IN SIDEBAR SUB NAV - jQuery Function ======================

    $("div#sidebar div.widget_nav_menu ul.menu li:last").addClass("last");


    //============ HOMEPAGE LOGO SCROLLER - Using Cycle Plugin - jquery.cycle.all.min.v2.88.js ======================

    $('div.testimonials_rotator').cycle({
        fx: 'fade',
        speed: 1000,
        timeout: 9000
    });

    //============ HOMEPAGE LOGO SCROLLER - Using Cycle Plugin - jquery.cycle.all.min.v2.88.js ======================

    $('div#galleria').galleria({
		autoplay: 6000
	});
		
	$('a img.attachment-post-thumbnail').insetBorder({
        speed: 400,           // 1000 = 1 second, default 250
        borderColor: "#0075b6",    // Default white (#ffffff)
        inset: 5,             // Border width, default 10px
        borderType: "solid",        // Border type, e.g. dashed
        outerClass: "ibe_outer",    // Class name of outer wrap
        innerClass: "ibe_inner"     // Class name of inner border
		
    });

});


