/**
 * @author rodrigo
 */
function hideLabel(a){$(a).parent().find('span.text').hide();}
function showLabel(a){$(a).parent().find('span.text').show();}

$(document).ready(function(){
	$('.geral').corner("15px");
	$('.box').corner("15px");
	$('.box2').corner("15px");
	$('.conteudo h2').corner("10px");
	$('.menuCursos h3').corner("10px");
	$('.resultado').corner("10px");
	$('.cursoItem').corner("10px");
	$('.menuCursos ul').corner("10px bottom");
	$('.conteudo .form_').corner("10px");
	$('.votar').corner("10px");
	//$('.dialogBox').append('<br /><a href="#" class="close">fechar janela</a>');
	$('.close').click(function(){$(this).parent().hide('slow');});

	$('.item2:last').css("border", "none");
	$('.menuCursos li:last').css("border", "none");
	$('.cursos tr:last').find('td').css("border", "none");
	
	$('.menuCursos li').hover(
	function(){$(this).animate({"backgroundColor": "#c3c3c3"},200);},
	function(){$(this).animate({"backgroundColor": "#f2f2f2"},200);}
	);
	
	$('.item').hover(
	function(){$(this).animate({"backgroundColor": "#f3f3f3"},200);},
	function(){$(this).animate({"backgroundColor": "#fff"},200);}
	);
	
	$('.norm').hover(
	function(){$(this).animate({"backgroundColor": "#f1fcff"},200);},
	function(){$(this).animate({"backgroundColor": "#fff"},200);}
	);
	
	$('.alt').hover(
	function(){$(this).animate({"backgroundColor": "#f1fcff"},200);},
	function(){$(this).animate({"backgroundColor": "#e6e6e6"},200);}
	);
	
	$('.box .esqueci').click(function(){$('.esqSenha:hidden').show("slow");});

	$('input.text').each(function(){var val = $(this).attr('value');if(val){hideLabel(this);}});
	
	$('span.text').click(function(){$(this).parent().find('input.text').focus();});
		
	$('.text').focus(function(){hideLabel(this);$(this).parent().parent().addClass("focus");});
	$('.text').blur(function(){
		$(this).parent().parent().removeClass("focus");
		$('input.text').each(function(){var val = $(this).attr('value');if(!val){showLabel(this);}});
	});
});
