$(document).ready(function() {
        $('.project').mouseenter(function(e) {
            $(this).children('a').children('span').fadeIn(200);
        }).mouseleave(function(e) {
            $(this).children('a').children('span').fadeOut(200);
        });
		
		$("a[rel='popup']").colorbox({transition:"fade"});

		$(".janela").colorbox({iframe:true, innerWidth:680, innerHeight:550});

		$(".popup").colorbox({width:"50%", inline:true, href:"#inline_example1"});
		
		$('.notificacao .close').click(function () {
			$(this).parent().fadeOut(1000, function() {
				//$(this).find('p').fixClearType();
			});		
			return false;
		});
});
	
	
	//plugin
jQuery.fn.topLink = function(settings) {
	settings = jQuery.extend({
		min: 1,
		fadeSpeed: 200
	}, settings);
	return this.each(function() {
		//listen for scroll
		var el = $(this);
		el.hide(); //in case the user forgot
		$(window).scroll(function() {
			if($(window).scrollTop() >= settings.min)
			{
				el.fadeIn(settings.fadeSpeed);
			}
			else
			{
				el.fadeOut(settings.fadeSpeed);
			}
		});
	});
};

//usage w/ smoothscroll
$(document).ready(function() {
	//set the link
	$('#top-link').topLink({
		min: 400,
		fadeSpeed: 500
	});
	//smoothscroll
	$('#top-link').click(function(e) {
		e.preventDefault();
		$.scrollTo(0,300);
	});
});




