$(document).ready(function () {
	//$("#controls-wrapper, #nextthumb, #prevthumb").attr("style", "width: 0; height: 0");
	$("#controls-wrapper, #nextthumb, #prevthumb, #slidecaption").attr("style", "visibility: hidden; display: none;");
	//$("#controls-wrapper, #nextthumb, #prevthumb").attr("style", "width: 0; height: 0");
	//$("#controls-wrapper, #prevthumb, #nextthumb").attr("style", "bottom: -300px");
	$("#verFoto").click(function() {
		if ($("#content").hasClass("cerrado")) {			
			$("#controls-wrapper, #nextthumb, #prevthumb, #slidecaption").attr("style", "visibility: hidden; display: none;");
			$("#content").animate({ left: '50%' }, 2000, function() {
				$("#detalles").slideDown();
			});
			//$("#controls-wrapper, #prevthumb, #nextthumb").animate( { bottom: '-300px' }, 3000);			
			
			$("#content").removeClass("cerrado");
		} else {
			$("#detalles").slideUp(function() {
				$("#content").animate( { left: '-255px'}, 2000, function() {
					$("#controls-wrapper, #nextthumb, #prevthumb, #slidecaption").attr("style", "visibility: visible; display: block;");
				});	
			});
			//$("#controls-wrapper, #prevthumb, #nextthumb").animate( { bottom: '60px' }, 3000);			
			$("#content").addClass("cerrado");
		}
	});		
	$('#container nav ul li ul').hide();
	$('#container nav ul li').hover(
		function () {
			$(this).find("ul").slideDown();
			$(this).addClass("seleccionado");
		}, 
		function () {
			$(this).find("ul").slideUp();
			$(this).removeClass("seleccionado");
		}
	);
	
	$(".content_home h2").click(function() {
		$(".content_home p").slideToggle();
	});	
	Cufon('nav ul li a.menu', {
		color: '#fff',
		hover: {
			color: '#000'
		}
	});
	Cufon('nav ul li a.current', {
		color: '#000',
		hover: {
			color: '#000'
		}
	});
	Cufon('footer a', {
		color: '#d8c245',
		hover: {
			color: '#fff'
		}
	});
	Cufon('#slidecaption', {
		color: '#fff'
	});
	Cufon.replace('a.menu'); // Requires a selector engine for IE 6-7, see above
	Cufon.replace('nav ul li a.current'); // Requires a selector engine for IE 6-7, see above
	Cufon.replace('h2'); // Requires a selector engine for IE 6-7, see above
	Cufon.replace('a.current'); // Requires a selector engine for IE 6-7, see above
	Cufon.replace('footer'); // Requires a selector engine for IE 6-7, see above
	Cufon.replace('#slidecaption') // Requires a selector engine for IE 6-7, see above	
});

$(document).ready(function() {
			/*
			*   Examples - images
			*/

			$("a#example1").fancybox();

			$("a#example2").fancybox({
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});

			$("a#example3").fancybox({
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'	
			});

			$("a#example4").fancybox({
				'opacity'		: true,
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'none'
			});

			$("a#example5").fancybox();

			$("a#example6").fancybox({
				'titlePosition'		: 'outside',
				'overlayColor'		: '#000',
				'overlayOpacity'	: 0.9
			});

			$("a#example7").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#example8").fancybox({
				'titlePosition'	: 'over'
			});

			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			/*
			*   Examples - various
			*/

			$("#various1").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});

			$("#various2").fancybox();

			$("#various3").fancybox({
				'width'				: '75%',
				'height'			: '75%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});

			$("#various4").fancybox({
				'padding'			: 0,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
			
			/*
	*   Examples - manual call
	*/

	$("#manual1").click(function() {
		$.fancybox({
			//'orig'			: $(this),
			'padding'		: 0,
			'href'			: 'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
			'title'   		: 'Lorem ipsum dolor sit amet',
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic'
		});
    });
    
    $("#manual2").click(function() {
		$.fancybox([
			'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
			'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
			{
				'href'	: 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
				'title'	: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
			}
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'changeFade'        : 0
		});
	});

		});
