
$(document).ready(function(){

    // PNG fix
    $('#wrapper').pngFix();
    
    // Fix sidebar right height 
    if($(".page").height()>$('.box_right').height())
        $('.box_right').css('height',$(".page").height());
    else
        $('.page').css('height',$(".box_right").height());

    /* Box & Content opacity */
    $('.box, #content, .box_right, .page').css('opacity','0.9');
    
    /* Menu buttons */
    $('#menu a').hover(
        function () {
            $(this).animate({ top : "-10"}, "fast");
        }, 
        function () {
            if($(this).attr('class')!='active')
                $(this).animate({ top : "0"}, "fast");
        }        
    );
    
    /* News ticker */
    $('.news').innerfade({
        animationtype: 'fade',
        speed: 1000,
        timeout: 8000,
        type: 'sequence',
        containerheight: '1em'
    });
    
    $('.inputDate').DatePicker({
            format:'d/m/Y',
            date: $('#inputDate').val(),
            current: $('#inputDate').val(),
            starts: 1,
            position: 'right',
            onBeforeShow: function(){
                $('#inputDate').DatePickerSetDate($('#inputDate').val(), true);
            },
            onChange: function(formated, dates){
                $('#inputDate').val(formated);
                if ($('#closeOnSelect input').attr('checked')) {
                    $('#inputDate').DatePickerHide();
                }
            }
        });
        
    $("a.zoom").fancybox();

    $("a.zoom1").fancybox({
        'overlayOpacity'    :    0.7,
        'overlayColor'        :    '#FFF'
    });

    $("a.zoom2").fancybox({
        'zoomSpeedIn'        :    500,
        'zoomSpeedOut'        :    500
    }); 
});
