
$(document).ready(function(){
	
	$("#nextBtn a").hover(
	function() {
		$(this).stop().animate({"opacity": "0"}, 500);
	},
	function() {
		$(this).stop().animate({"opacity": "1"}, 500);
	});
	
	$("#prevBtn a").hover(
	function() {
		$(this).stop().animate({"opacity": "0"}, 500);
	},
	function() {
		$(this).stop().animate({"opacity": "1"}, 500);
	});

	$("#content input, #content textarea").each( function() {
			if ($(this).val() == "")
			{
				$(this).addClass("inputTitleColor");
				$(this).val($(this)[0].title);
			}
	});
	
	
	$(".newsBox, #share, #about").hover(
	function() {
		$(this).animate({ backgroundColor: "#ffffeb"}, 500);
	},
	function() {
		$(this).animate({ backgroundColor: "#FFFFFF"}, 500);
	});
	
	$("#news").hover(
	function() {
		$('.news_link',this).stop().animate({ color: "#ffc41c"}, 500);
	},
	function() {
		$('.news_link',this).stop().animate({ color: "#7b2727"}, 500);
	});
	
	$("ul#imageList li").hover(
	function() {
		$(this).animate({ backgroundColor: "#ffc41c"}, 500);
	},
	function() {
		$(this).animate({ backgroundColor: "#FFFFFF"}, 500);
	});
	
	$(".page_espetaculo_rel_list_link").css({color: "#7b2727"});
	
	$("#sidebar ul li a").hover(
	function() {
		$(this).stop().animate({ color: "#ffc41c"}, 300);
	},
	function() {
		$(this).stop().animate({ color: "#7b2727"}, 300);
	});
	
	$("#sidebar ul li a.subNavCurrent").hover(
	function() {
		$(this).stop().animate({ color: "#7b2727"}, 300);
	},
	function() {
		$(this).stop().animate({ color: "#7b2727"}, 300);
	});

	$("#content input[type=text], #content textarea").focus(
		function() {
			highlightInputField($(this));
			if ($(this).val() == $(this).attr('title'))
				$(this).removeClass("inputTitleColor").val("");
		}
	);
	$("#content input[type=text], #content textarea").blur(
		function() {
			unhighlightInputField($(this));
			if ($(this).val() == "")
				$(this).addClass("inputTitleColor").val($(this).attr('title'));
		}
	);
	
	$("a.button, button, .hiddenContent, .visibleContent").hover(
	function() {
		$(this).stop().animate({ backgroundColor: "#ffc41c"}, 500);
	},
	function() {
		$(this).stop().animate({ backgroundColor: "#7b2727"}, 500);
	});
	
	$(".page_espetaculos_fotos_link span").hide().fadeTo(0,0);
	$(".page_espetaculos_fotos_link").hover(
	function() {
		texto = $('span',this).text()
		if (texto!="") {
			$('span',this).stop().show().fadeTo(1000,1);
		}
	},
	function() {
		texto = $('span',this).text()
		if (texto!="") {
			$('span',this).stop().fadeTo(1000,0,function() { $(this).hide() });
		}
	});
	
	$("#dropmenu a").hover(
	function() {
		$(this).stop().animate({ color: "#ffc41c"}, 300);
	},
	function() {
		$(this).stop().animate({ color: "#ffffff"}, 300);
	});
	
	
	$("#dropmenu li li a").hover(
	function() {
		$(this).stop().animate({ backgroundColor: "#ffc41c"}, 600);
	},
	function() {
		$(this).stop().animate({ backgroundColor: "#ecb413"}, 600);
	});


	$(".hiddenContent a, .visibleContent a").hover(
	function() {
		$(this).stop().animate({ color: "#FFFFFF"}, 300);
	},
	function() {
		$(this).stop().animate({ color: "#FFFFFF"}, 300);
	});
});

function highlightInputField(field)
{
	field.stop().animate({ backgroundColor: "#ffc41c", color: "#FFFFFF"}, 300);
}

function unhighlightInputField(field)
{
	field.stop().animate({ backgroundColor: "#f9f9f9", color: "#737373"}, 300);
}
