$(document).ready(function() {

	$('#slides').slides({
		preload: true,
		preloadImage: '/website/img/loading.gif',
		play: 5000,
		pause: 500,
		hoverPause: false,
		effect: 'fade',
		crossfade: true,
		autoHeightSpeed: 150
	});


	
		$(".frame").fancybox({
			'width'				: '75%',
			'height'			: '75%',
        	'autoScale'     	: false,
        	'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'type'				: 'iframe'
		});
		
		$(".tellfriend").fancybox({
			'width'				: 300,
			'height'			: 300,
        	'autoScale'     	: false,
        	'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'type'				: 'iframe'
		});
		
		$(".bio").fancybox({
			'width'				: '75%',
			'height'			: '45%',
        	'autoScale'     	: false,
        	'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'type'				: 'iframe'
		});
		
		$(".inline").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade'
		});
		
		$("#documento").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade'
		});
		
		//Buscador
		$('.busca input').css('color','#999');
		
		$('.busca input[type="text"]').focus(function(){
			
			if ($(this).val() == $(this).attr('title')){
				$(this).val('').css('color','#333');
			}else{
				$(this).css('color','#333');
				$(this).select();
			}
			
		}).blur( function() {
			if ($(this).val() == ''){
				$(this).val($(this).attr('title')).css('color','#999');
			}
		});
		
		
		//Tabs
		$(".tab_content").hide(); 
		$("ul.tabs li:first").addClass("active").show(); 
		$(".tab_content:first").show();

		$("ul.tabs li").click(function() {

			$("ul.tabs li").removeClass("active");
			$(this).addClass("active");
			$(".tab_content").hide();

			var activeTab = $(this).find("a").attr("href");
			$(activeTab).fadeIn(); 
			return false;
		});
});

$(function() {
	$(".newsticker-jcarousellite").jCarouselLite({
		horizontal: true,
		hoverPause:true,
		visible: 3,
		auto:2500,
		speed:2000
	});
});

