var sciverse = sciverse || {};

sciverse.init = function() {
    $('#register').validate({
        rules: {
            firstName: {
                required: true
            },
            lastName: {
                required: true
            },
            'function' : {
                required: true
            },
            email: {
                email: true,
                required: true
            },
            organization: {
                required: true
            }
        },
        highlight: function(elm, errorClass, validClass) {
            $(elm).parents('p:first').addClass(errorClass).removeClass(validClass);
        },
        unhighlight: function(elm, errorClass, validClass) {
            $(elm).parents('p:first').addClass(validClass).removeClass(errorClass);
        }
    });

    $("a.inline-fancybox").fancybox({
        width: 550,
        height:300,
        autoDimensions: false
    });
	$('a.image-fancybox').css({'display':'block','position':'relative','text-decoration':'none'});
    $('a.image-fancybox').fancybox();
	$('a.image-fancybox').hover(function() {
		$(this).append('<span style="font-size:10px;text-align:center;background-color:#fff;border: 1px solid #106635;padding:3px;position:absolute;color:#777;bottom:-20px;right:40px;">Click to Enlarge</span>');
										 },
										 function() {
		$(this).children('span').remove();
										 });

    $('.overview-box h3 a').each(function() {
        var link = $(this).attr('href');
        $(this).parents('.overview-box:first').click(function() {
            window.location = link;
        }).css('cursor', 'pointer').hover(function() {
            $(this).find('.content').css('color', '#111');
        }, function() {
            $(this).find('.content').css('color', '#106635');
        });
    });

}

$(document).ready(function() {
    sciverse.init();
});

