function init_menu()
{

	$('ul:first', $("li#plus") ).hide();
	
	$('li:last a', $("li#plus") ).addClass('last');
	$('li:first a', $("li#plus") ).addClass('first');

	$("li#plus").hover(function(){
    
        $(this).addClass("hover");
        //$('ul:first',this).css('visibility', 'visible');
        $('ul:first',this).show();
    
    }, function(){
    
        $(this).removeClass("hover");
        //$('ul:first',this).css('visibility', 'hidden');
        $('ul:first',this).hide();
    
    });

}


function init(){

	//
	// Cortina dos anos anteriores
	//
	init_menu();
	
	//
	// Galerias
	//
	
	$("a[rel=fancybox]").fancybox();
	
	//
	// Inscricoes
	//
	
	$("#btnLogin").fancybox({
		type:				'inline',
		modal:				true,
		centerOnScroll:		true
	});
	
	//
	// Máscaras
	//
	$("input.tel").mask("(99) 9999-9999? r999");
	
}

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

// Scroll

$(document).ready(function(){
	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();

		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;

		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];

		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;

		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
});

