$(document).ready(function(){

	$("div.header .menu li").mouseenter(function(){
		$(this).children("ul").fadeIn("fast");
	}).mouseleave(function(){
		$(this).children("ul").fadeOut("fast");
	});
        $("div.gallery_list a[rel^='prettyPhoto']").prettyPhoto({overlay_gallery:false});
        $("div.map_cell a[rel^='prettyPhoto']").prettyPhoto();

        $("div.nomination_cell .control_slide").live('click', function(){
            $(this).parents("div.nomination_cell:first").addClass("open");
           // $(this).parents("div.nomination_cell:first").find(".anons").slideUp();
            $(this).parents("div.nomination_cell:first").find(".body").slideDown();
        });
        $("div.nomination_cell.open .control_slide").live('click', function(){
            $(this).parents("div.nomination_cell:first").removeClass("open");
            $(this).parents("div.nomination_cell:first").find(".body").slideUp();
           // $(this).parents("div.nomination_cell:first").find(".anons").slideDown();
        });

        $("div.partner_cell .thumb img").mouseenter(function(){
		$(this).parents("div.thumb:first").find(".tooltip").show();
	}).mouseleave(function(){
		$(this).parents("div.thumb:first").find(".tooltip").hide();
	});

        $("div.box_header .sort a.date").live('click',function(){
            $("#center").addClass("list-date").removeClass("list-rating");

            return false;
        });

        $("div.box_header .sort a.rating").live('click',function(){
            $("#center").addClass("list-rating").removeClass("list-date");

            return false;
        });

        $("#sendlink_form_email").mask("*@*.a");

        equalHeight('.column');

        $('#mycarousel_1').jcarousel({
        vertical: false,
        scroll: 1
        });
	$('#mycarousel_2').jcarousel({
        vertical: false,
        scroll: 1
        });


        $("#footer .menu ul li span.dm_inactive").click(function(){
            
            $(this).next("ul").slideToggle();

        });

});

function equalHeight(group) {
    var tallest = 0;
    $(group).each(function() {
        var thisHeight = $(this).height();
        if(thisHeight >= tallest) {
        tallest = thisHeight;
        }
    });
    $(group).css("min-height",tallest+"px");
}

