$(document).ready(function(){
	//alert('Carga el js');

	// Replace the input value with the label content
	texto_input= $('#header label');
	texto_input.hide();
	$("#header input[type='text']").attr('value',texto_input.text());
	$("#header .button").attr('value','');
	$("#login a.button").click(function() { $('#login').submit() });
	$("#nueva a").click(function() { $('#nueva').submit() });
	$("#speedcook a").click(function() { $('#speedcook').submit() });
	$("#filter a").click(function() { $('#filter').submit() });
	$("#recomendacion_form a").click(function() { $('#recomendacion_form').submit() });
	$("#comment_form p.submit a").click(function() { $('#comment_form').submit() });

	texto_input= $('#login label:first');
	texto_input.hide();
	$("#login input[type='text']:first").attr('value',texto_input.text());
	$("#login #usuario").click(function () {
		$(this).val('');
	});

	texto_input= $('#login label:last');
	texto_input.hide();
	$("#login input[type='text']:last").attr('value',texto_input.text());
	$("#login #password").click(function () {
		$(this).val('');
	});

	texto_input= $('#login label:last');
	texto_input.hide();
	$("#login input[type='password']:last").attr('value',texto_input.text());
	$("#login #password").click(function () {
		$(this).val('');
	});



	texto_input= $('#buscar label');
	texto_input.hide();
	$("#buscar input[type='text']").attr('value',texto_input.text());
	$("#buscar #busqueda").click(function () {
		$(this).val('');
	});


	//Cufon
/*
	Cufon.replace('h2');
	Cufon.replace('#speedcook label',{ textShadow: '#000 1px 1px'});
	Cufon.replace('#breadcrumb h2',{ textShadow: '#000 1px 1px'});
	Cufon.replace('#top_users .register h2', { textShadow: '#b5a278 1px 1px'});
	Cufon.replace('#prefooter h2', { textShadow: '#000 1px 1px'});
	Cufon.replace('#header dd>a',{ textShadow: '#000 2px 2px'} );
*/

	$("#nav a").hover(
		function () {$(this).stop().animate({marginLeft : "15px", color: "#ffffff"}, 250);}, 
		function () {$(this).stop().animate({marginLeft : "0", color: "#000000"}, 250).removeClass('navHover');}
	);
	
	$('.big a').click(function(){
			$('.vote a').unbind('mouseenter').unbind('mouseleave').fadeTo("slow", 0.7);
			$(this).unbind('click');
			//$('.vote').fadeOut(250);
			if ($(this).attr('class')=='up hvote') {$('.like').fadeIn(250);}
			else {$('.nolike').fadeIn(250);}
			$('.thanks').fadeIn(250).fadeOut(1500);
		//}
		return false;
	});



	$('.rup').hover(
		function(){$(this).addClass('hvote').animate({height : "77px"}, 250);},
		//function(){$(this).animate({height : "77px"}, 250);},
		function(){$(this).animate({height : "32px"}, 250).removeClass('hvote');}
	);
	
	$('.rdown').hover(
		function(){$(this).addClass('hvote').animate({height : "77px"}, 250);},
		//function(){$(this).animate({height : "77px"}, 250);},
		function(){$(this).animate({height : "32px"}, 250).removeClass('hvote');}
	);
	
	$("a[rel^='openphoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		allowresize: false, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){}
	});
	

	$("a[rel^='remember']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){}
	});


});