$(document).ready(function(){
    $('#menu').accordion({
        autoheight: false,
        active: '.selected',
        selectedClass: 'active',
        alwaysOpen: false
    });
    
    $('#menu2').accordion({
        autoheight: false,
        active: '.selected',
        selectedClass: 'active',
        alwaysOpen: false
    });
    
    $("#menu2 li > a").click(function(){ window.location.href = $(this).attr("href"); });
    
    $("#menu li > a").click(function(){ window.location.href = $(this).attr("href"); });
//    $('#anecdot').jScrollPane();
    $('#cite').jScrollPane();
    $('#datepicker').datepicker({ inline: true });



    var nkTimeout = 0;
    $("#newscont").easyCarusel({
        prevId:      'prevNews',
        nextId:      'nextNews',
        duration: 	 400,
        easing:      'easeOutSine',
        height:      '280px',
        width:       '100%',
        orientation: 'vertical'
    })
    .hoverIntent ( function() {
        clearTimeout(nkTimeout);
        var opp = this;
        var margin = -1 * $(opp).height();
        var left = $('#newscont_control').width();
        $('#newscont_control').css({"margin-top": margin + "px", "left":left + "px"}).fadeIn(300);
    },
    function() {
        nkTimeout = setTimeout("$('#newscont_control').fadeOut(300)", 4000);
    });

    $("#maincont").easyCarusel({
        prevId:      'prevMain',
        nextId:      'nextMain',
        duration: 	 600,
        easing:      'easeOutExpo',
        height:      '280px',
        width:       '400px',
        orientation: 'h'
    });

    $(".loadpdfa").click(function(){
       $("#pdfacontent").load($(this).attr("href"));
       return false; 
    });
    
     $("#searchField").focus(function(){
         if ($(this).val() == $(this).attr('title'))
            $(this).val('');
     });
     
     $("#searchField").blur(function(){
         if ($(this).val() == '')
            $(this).val($(this).attr('title'));
     });
     
});

