$(document).ready(function(){

	initCufon();

	if(typeof jQuery.fn.mailrep == 'function') {

		$('#footer span').mailrep({

			email:false

			,titulo:false

		});

	}

	if(typeof jQuery.fn.fancybox == 'function') {

		$(".preview").fancybox({

			opacity	: true

			,overlayShow: false

			,transitionIn:'elastic'

			,transitionOut: 'none'

		});

	}

	if(typeof jQuery.fn.scrollable == 'function') {

		$(".scrollable").scrollable({

			speed:500
			//,circular:true

		});

	}

	var nav = $("#menu_header");

	nav.find("li").each(function() {

		if ($(this).find("ul").length > 0) {

			$(this).mouseenter(function() {

				$(this).find("span").addClass("activeB");

				$(this).find("ul").stop(true, true).slideDown("fast");

			});

			$(this).mouseleave(function() {

				$(this).find("span").removeClass("activeB");

				$(this).find("ul").stop(true, true).slideUp("fast");

			});

		}

	});

	$("span",nav).hover(function(){

		var titleCufon = $(this);

		Cufon.replace(titleCufon, {color:'#FFFFFF',hover: false});

	},function(){

		var titleCufon = $(this);

		Cufon.replace(titleCufon, {color:'#9C9E9F',hover: false});

	});

	$("a.submit").click(function(){

		$(this).parent().submit();

	});

});



function initCufon() {

	Cufon.replace(".font1", {fontFamily:'MetaPlusBold', hover:true});

}
