$(document).ready(function(){	
	//meuCadastro
	valor1 = $(".meuCadastro .input1 input").val();
	valor2 = $(".meuCadastro .input2 input").val();
	$(".meuCadastro .input1 input").focus(function(){
		if($(this).val() == valor1){
			$(this).val("");
		}
	});
	$(".meuCadastro .input2 input").focus(function(){
		if($(this).val() == valor2){
			$(this).val("");
		}
	});
	$(".meuCadastro .input1 input").blur(function(){
		if($(this).val() == ""){
			$(this).val("Seu usuário");
		}
	});	
	$(".meuCadastro .input2 input").blur(function(){
		if($(this).val() == ""){
			$(this).val("Sua senha");
		}
	});
	
	$(".input1 input, .input2 input, .input3 input").focus(function(){
		$(this).parent().css("background-position","0 -29px");	
	});
	$(".input1 input, .input2 input, .input3 input").blur(function(){
		$(this).parent().css("background-position","0 0");	
	});
	
	//input4
	$(".input4").click(function(){
		if($(".input4 ul").css("display") == "none"){
			$(".input4 ul").slideToggle();
		}
	});
	
	$(".input4 ul li").click(function(){
		$(".input4 div").html($(this).html());
		$(".selectInvisivel").val($(this).html());
		$(".input4 ul").slideToggle();
	});
	
	//dir
	$(".dir figure a").attr("status","off");
	$(".dir figure a").hover(function(){
		$(this).attr("status","on");
		$(".dir figure a[status=off]").stop().animate({
			opacity:0.5	
		});			
	}, function(){
		$(this).attr("status","off");
		$(".dir figure a").stop().animate({
			opacity:1	
		});			
	});
	
	//boxVideo
	$(".recebeImg a > img").css("opacity","0.5");
	$(".boxVideo a").hover(function(){
		$(this).find("span").stop().animate({
			top:-60	
		},600);	
		$(this).find("img:first").stop().animate({
			opacity:1	
		},600);	
	}, function(){
		$(this).find("span").stop().animate({
			top:43	
		},900);
		$(this).find("img:first").stop().animate({
			opacity:0.5	
		},900);
	});
	
	//abreVideo
	$("a[rel=video]").click(function() {
		$.fancybox({
			"width":475,
			"height":315,
			"href":this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			"type":"swf",
			"swf":{
				"wmode":"transparent",
				"allowfullscreen":"true"
			},
			"titleFormat": function(){
				return false;	
			}
		});
		return false;
	});	
	
	//abreCartao
	$("#cartao").fancybox({
		'width'				: 495,
		'height'			: 335,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
});



//Adicionar mais um item na lista
function addLista(table){
	id_lista=($(table+" tr").length+1);
	$(table).append('<tr>\n\t<td>Nome do produto:&nbsp;</td>\n<td><input name="produto['+id_lista+']" type="text" id="produto['+id_lista+']" value="" /></td>\n<td>&nbsp;&nbsp;&nbsp;Qtd:&nbsp;</td>\n<td><input name="qtd['+id_lista+']" type="text" class="qtd" id="qtd['+id_lista+']" value="" /></td>\n</tr>');
}
