// JavaScript Document
$(document).ready(function(){


// bt indicar a um amigo
$("#bt_indique").click(function(){
	$("#indique").show('slow');								
	})

$("#cancelar_ind").click(function(){
	$("#indique").hide('slow');								
	})

// bt imprimir
$("#bt_print").click(function(){
							  window.print();
							  })

	$("#form_indicacao").submit(function(){

	if($("#nome_r").val().length == 0){
		alert("Preencha seu nome");
		$("#nome_r").focus();
		return false;
	} // x if nome_r
	
	if($("#email_r").val().length == 0){
		alert("Preencha seu email");
		$("#email_r").focus();
		return false;
	} // x if nome_r
	
	if($("#nome_a").val().length == 0){
		alert("Preencha o nome do seu amigo");
		$("#nome_a").focus();
		return false;
	} // x if nome_r
	
	if($("#email_a").val().length == 0){
		alert("Preencha o email do seu amigo");
		$("#email_a").focus();
		return false;
	} // x if nome_r
		
	
	$.post('../../enviar_artigo_amigo',{
		   							'lk'      : $("#lk").val(), // link do artigo
									'tit_artigo' : $("#tit_artigo").val(), // título do artigos para ir no email
		   							'nome_r'  : $("#nome_r").val(), // nome do remetente
									'email_r' : $("#email_r").val(), // email do remetente
									'nome_a'  : $("#nome_a").val(), // nome do amigo
									'email_a' : $("#email_a").val(), // email do amigo
									'msg'     : $("#msg").val() // msg do remetente
				   
								   } , function(){
										alert("Enviado com sucesso");								   
									   })
	return false;
	}) // x submit

})
