$(document).ready(function() {
    $('.jqHover').mouseover(function(){
        $(this).css({'opacity': '0.9'});
    }).mouseout(function(){
        $(this).css({'opacity': '1'});
    }).mousedown(function(){
        $('span.body', this).addClass('click');
    }).mouseup(function(){
        $('span.body', this).removeClass('click');
    });
    if (typeof(document.getElementById('articleGallery')) != "undefined") $("#articleGallery a").fancybox();
    $("#sidebarLogosContainer a").fancybox();
    
    $('#registerForm').find('#role').change(function() {
        if ($(this).val() == 'beneficiary') {
            $('.beneficiaryOnly').show();
            $('.clientOnly').hide();
        } else {
            $('.beneficiaryOnly').hide();
            $('.clientOnly').show();
        }
    }).each(function() {
        if ($(this).val() == 'beneficiary') {
            $('.beneficiaryOnly').show();
            $('.clientOnly').hide();
        } else {
            $('.beneficiaryOnly').hide();
            $('.clientOnly').show();
        }
    });
});

function center(maxsize, size) { return (maxsize/2)-(size/2); }

function openPlayerWin() {
    window.open("","VideoWin","toolbar=0,fullscreen=0,height=700px,width=1002px,resizable=0,directories=0,personalbar=0,dialog=1,scrollbars=0,location=0,statusbar=0,status=0,titlebar=0,menubar=0,left="+center(screen.width,1002)+",top="+center(screen.height, 700)).focus(); 
}

