$(document).ready(function () {



    //---------------------equal height for colomn elements----------------- 
    //$(function () { $('.equalize').equalHeights(); });




    //---------------------truncate----------------- 

    //title h3
    $('h3').jTruncate({
        length: 60,
        minTrail: 0,
        moreText: "",
        lessText: "",
        ellipsisText: " ...",
        moreAni: "fast",
        lessAni: 2000
    });


    //summary
    $('.entryContent p').jTruncate({
        length: 190,
        minTrail: 0,
        moreText: "",
        lessText: "",
        ellipsisText: " ...",
        moreAni: "fast",
        lessAni: 2000
    });



    //---------------------main search dropdown----------------- 
    $(function () {



        //the element
        var $ui = $('#ctl00_ui_element');


        //on focus and on click display the dropdown, 
        //and change the arrow image
        $ui.find('.searchInput').bind('focus click', function () {
            $ui.find('.sb_down')
					   .addClass('sb_up')
					   .removeClass('sb_down')
					   .andSelf()
					   .find('.sb_dropdown')
					   .show()
					    .css('z-index', 9999);
            $(".sb_dropdown").css('z-index', '9999');
        });


        //on mouse leave hide the dropdown, 
        //and change the arrow image
        $ui.bind('mouseleave', function () {
            $ui.find('.sb_up')
					   .addClass('sb_down')
					   .removeClass('sb_up')
					   .andSelf()
					   .find('.sb_dropdown')
					   .css('z-index', 1)
					   .hide();
        });


        // selecting all checkboxes
        $ui.find('.sb_dropdown').find('label[for="ctl00_SearchAll"]').prev().bind('click', function () {
            $(this).parent().siblings().find(':checkbox').attr('checked', this.checked).attr('disabled', this.checked);
        });

        $('.sb_dropdown2').find('label[for="ctl00_ContentBody_SearchAll"]').prev().bind('click', function () {


            $(this).parent().siblings().find(':checkbox').attr('checked', this.checked).attr('disabled', this.checked);
        });
    });




    //---------------------main menu----------------- 

    //$('#multi-ddm').dropDownMenu({ timer: 1000, parentMO: 'parent-hover', childMO: 'child-hover1' });

    //---------------------content search dropdown----------------- 
    $(function () {

        //the element
        var $uiContent = $('#ui_elementContent');


        //on focus and on click display the dropdown, 
        //and change the arrow image
        $uiContent.find('.searchInputContent').bind('focus click', function () {
            $uiContent.find('.sb_downContent')
					   .addClass('sb_upContent')
					   .removeClass('sb_downContent')
					   .andSelf()
					   .find('.sb_dropdownContent')
					   .show()
					    .css('z-index', 999);
        });


        //on mouse leave hide the dropdown, 
        //and change the arrow image
        $uiContent.bind('mouseleave', function () {
            $uiContent.find('.sb_upContent')
					   .addClass('sb_downContent')
					   .removeClass('sb_upContent')
					   .andSelf()
					   .find('.sb_dropdownContent')
					   .css('z-index', 1)
					   .hide();
        });


        // selecting all checkboxes
        $uiContent.find('.sb_dropdownContent').find('label[for="allContent"]').prev().bind('click', function () {
            $(this).parent().siblings().find(':checkbox').attr('checked', this.checked).attr('disabled', this.checked);
        });
    });

    //---------------------slider-----------------
//    $('#slider1').anythingSlider({
//        width: 940,          // Override the default CSS width
//        height: 360,          // Override the default CSS width
//        autoPlay: true,
//        buildNavigation: true,
//        easing: 'easeInOutExpo',
//        navigationFormatter: function (index, panel) {

//            return $(panel).find(".sliderThumb").html();
//        }
//    });

    //---------------------general image hover----------------- 
    $(".fade").hover(
function () {
    $(this).stop().animate({ "opacity": ".5" }, "fast");
},
function () {
    $(this).stop().animate({ "opacity": "1" }, "slow");
});

    $("aside.sectorsBtns ul li a").hover(
function () {
    $(this).stop().animate({ "opacity": ".5" }, "fast");
},
function () {
    $(this).stop().animate({ "opacity": "1" }, "slow");
});



    // hides the slickbox as soon as the DOM is ready
    $('.slickbox').hide();

    //---------------------section toggle-----------------
    // toggles the slickbox on clicking the noted link  
    $('.toggleLinks').click(function () {
        $('.slickbox').slideToggle(400);
        return false;
    });



    //---------------------accordion-----------------
    $('#indexMenu').hoverAccordion({
        keepHeight: false,
        activateItem: 1,
        speed: 'fast'
    });


    //---------------------jshowoff - related rotator-----------------
    $('.featureRotate').jshowoff({
        links: false,
        speed: 5000,
        controls: false,
        autoPlay: true,
        effect: 'slideLeft',
        cssClass: 'basicFeatures',
        hoverPause: true
    });


    //---------------------labelify-----------------
    $('input:text').labelify();


    /*---------------------PDF Tracking-------------
    $('a[href$=".pdf"]').click(function () {
        window._gaq.push(['_trackEvent', 'PDF Downloads', 'Download', $(this).attr('href')]);
    });*/

});


							
							
							








