// Baptista & Soares
// www.baptistasoares.pt

$(function(){
	$('.menu ul li a')
		.css( {backgroundPosition: "0 7px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:300})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 7px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0 7px"})
			}})
		})
});

$(function() {
	$("div#controller").jFlow({
		slides: ".slides",
		width: "940px",
		height: "366px",
	    duration: 1000,
		auto: true
	});
});

$(function() {
    $('img[data-hover]').hover(function() {
        $(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
    }).each(function() {
        $('<img />').attr('src', $(this).attr('data-hover'));
    });;
});

$(document).ready(function() {


	$("a.foto").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'titleShow'		:	false,
		'enableEscapeButton'	:	true
	});
	
	$('#um').qtip({
		content: {
		   text: $('div#umtxt')
		},
		position: {
		   my: 'top left',
		   at: 'bottom center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#dois').qtip({
		content: {
		   text: $('div#doistxt')
		},
		position: {
		   my: 'top center',
		   at: 'bottom center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#tres').qtip({
		content: {
		   text: $('div#trestxt')
		},
		position: {
		   my: 'bottom center',
		   at: 'top center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#quatro').qtip({
		content: {
		   text: $('div#quatrotxt')
		},
		position: {
		   my: 'top center',
		   at: 'bottom center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#cinco').qtip({
		content: {
		   text: $('div#cincotxt')
		},
		position: {
		   my: 'bottom center',
		   at: 'top center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#seis').qtip({
		content: {
		   text: $('div#seistxt')
		},
		position: {
		   my: 'top center',
		   at: 'bottom center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#sete').qtip({
		content: {
		   text: $('div#setetxt')
		},
		position: {
		   my: 'bottom center',
		   at: 'top center'
		},
		show: {
		   event: 'click mouseenter', 
		   ready: true,
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#oito').qtip({
		content: {
		   text: $('div#oitotxt')
		},
		position: {
		   my: 'top center',
		   at: 'bottom center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#nove').qtip({
		content: {
		   text: $('div#novetxt')
		},
		position: {
		   my: 'bottom right',
		   at: 'top center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	$('#dez').qtip({
		content: {
		   text: $('div#deztxt')
		},
		position: {
		   my: 'top right',
		   at: 'bottom center'
		},
		show: {
		   event: 'click mouseenter', 
		   solo: true,
		   effect: function(offset) {
			$(this).fadeIn(400);
		   }
		},
		hide: false,
		style: {
		   classes: 'ui-tooltip-shadow ui-tooltip-light'
		}
	 });
	
});
