/* Author:

*/

$(document).ready(function() {
	
	$("#destaques li a").click(function()
	{
		if($(this).parent().hasClass('hover')==false)
		{
			$("#destaques li").removeClass('hover');
		
			$(this).parent().addClass('hover');

			var imgSrc = $(this).find("img").attr("src"); 
			$("#destaques-img").attr("src",imgSrc);
			$("#destaques-img").parent().attr("href",$(this).attr("href"));

			return false;	
		}
		
		
	});
	
	
	 $("a[rel=fancybox]").fancybox({
            'overlayColor':'#000000',
            'overlayOpacity':0.75
        });
		
		$("a[rel=fancybox2]").fancybox({
            'overlayColor':'#000000',
            'overlayOpacity':0.75
        });
		
		
		
		$("a[rel=fancybox3]").fancybox({
            'overlayColor':'#000000',
            'overlayOpacity':0.75
        });
		
		
		$(".fancyvideo").fancybox({
                                    'type': 'iframe',
                                    'overlayColor':'#000000',
                                    'overlayOpacity':0.75
                                    
	});
	
	
	$(".navfotosvideos a").click(function(){
		
			if($(this).attr('rel')=='fotos')
			{
				$("#mfotos a").addClass("selected");
				$("#mvideos a").removeClass("selected");
				$(".lvideos").hide();
				$(".lfotos").show();
				$(".maisfotosvideos a").attr("href","http://www.flickr.com/photos/cmtv/sets/72157628942173225/show/");
			}
			if($(this).attr('rel')=='videos')
			{
				$("#mvideos a").addClass("selected");
				$("#mfotos a").removeClass("selected");
				$(".lfotos").hide();
				$(".lvideos").show();
				$(".maisfotosvideos a").attr("href","http://www.youtube.com/TorresVedrasCM");
			}
		
		return false;
	});
	
});




