//Variaveis!
var timmer;
var timer_slide = 4000;
var timer_slide_fade = 600;
var ico_loading = '<div align="center"><img src="imagens/loader_ajax.gif" /></div>';
var timmer_spam_click = 0;
/**
 * @author Maycon Fortes
 */
/* Login Form */



function fnChkFrmLg() {
	if (document.frmLogin.usuario.value.length == 0 || document.frmLogin.usuario.value == "Username") {
		alert ('Por favor, entre com um username correto!.');
		frmLogin.strID.value = "";
		frmLogin.strID.focus();
		return false;
	}
	if (document.frmLogin.senha.value.length == 0 || document.frmLogin.senha.value == "Password") {
		alert ('Por favor, entre com uma senha correta.');
		frmLogin.strPW.value = "";
		frmLogin.strPW.focus();
		return false;
	}
	return true;
}


function login_erro(id) {
	f = document.log;
	if (id == 1) {
		alert('Seu Login / Senha está incorreto, tente novamente!');
		f.usuario.focus();
	}
	if (id == 2) {
		alert('Caracteres Invalidos digitados.');	
		f.usuario.focus();
	}
	if (id == 3) {
		alert('[BLOCKED] Tentativas excessivas de login. Seu IP está bloqueado por 10 minutos. Tente novamente mais tarde.');	
	}
	if (id == 4) {
		alert('[Error] Numero de caracteres menor que 4 ou maior que 23 digitados no login.');	
		f.usuario.focus();
	}
	if (id == 5) {
		alert('[Error] Numero de caracteres menor que 4 ou maior que 23 digitados na senha.');	
		f.usuario.focus();
	}
}


function POST_ajax(http, div_name, frm_name) { //função para posts

	var POST_xmlhttp = false;
	var frm = false
	var url = "";


	try { POST_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { POST_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) { try { POST_xmlhttp = new XMLHttpRequest(); }
	catch (e) { POST_xmlhttp = false; }}}
	if (!POST_xmlhttp) return null;

	frm = document.getElementById(frm_name);

	document.getElementById('load_div').style.visibility="visible";

	url = "frm_name=" + frm_name;

	for (i = 0; i < frm.elements.length; i++) {
		frm.elements[i].disabled = true;
		if (frm.elements[i].type == "checkbox") {
			if (frm.elements[i].checked)
				frm.elements[i].value = 1;
			else
				frm.elements[i].value = 0;
		}
		url = url + "&" + frm.elements[i].name + "=" + escape(frm.elements[i].value);
	}


	POST_xmlhttp.open("POST", http, true);

	POST_xmlhttp.onreadystatechange = function() {
		if (POST_xmlhttp.readyState == 4) {
			document.getElementById('load_div').style.visibility="hidden";

			for (i = 0; i < frm.elements.length; i++) {
				if (frm.elements[i].type == "checkbox")
					frm.elements[i].checked = false;
				if (frm.elements[i].type == "password")
					frm.elements[i].value = "";
				frm.elements[i].disabled = false;
			}

			if (POST_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") > -1) {
				var x = POST_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") + "<script type=\"text/javascript\">".length;
				var y = POST_xmlhttp.responseText.indexOf("</script>") - x;
				eval(POST_xmlhttp.responseText.substr(x, y));
			}

			if (POST_xmlhttp.responseText.indexOf('ALERT|') > -1) {
				var x = POST_xmlhttp.responseText.indexOf('ALERT|') + "ALERT|".length;
				var y = POST_xmlhttp.responseText.indexOf('|ENDALERT') - x;
				window.alert(POST_xmlhttp.responseText.substr(x , y));
			} else
				document.getElementById(div_name).innerHTML = POST_xmlhttp.responseText + ' ';
		}
	}

	POST_xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	POST_xmlhttp.setRequestHeader("Content-length", url.length);
	POST_xmlhttp.setRequestHeader("Connection", "close");
	POST_xmlhttp.send(url);  

	return false;
}

function GET_ajax(http, div_name, frm_name) { //função para gets

	var GET_xmlhttp = false;
	var frm = false
	var url = "";

	
	try { GET_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { GET_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) { try { GET_xmlhttp = new XMLHttpRequest(); }
	catch (e) { GET_xmlhttp = false; }}}
	if (!GET_xmlhttp) return null;
	
	frm = document.getElementById(frm_name);

	document.getElementById('load_div').style.visibility="visible";

	url = http + "?frm_name=" + frm_name;

	for (i = 0; i < frm.elements.length; i++) {
		frm.elements[i].disabled = true;
		if (frm.elements[i].type == "checkbox") {
			if (frm.elements[i].checked)
				frm.elements[i].value = 1;
			else
				frm.elements[i].value = 0;
		}
		url = url + "&" + frm.elements[i].name + "=" + escape(frm.elements[i].value);
	}


	GET_xmlhttp.open("GET", url, true);
	
	GET_xmlhttp.onreadystatechange = function() {
		if (GET_xmlhttp.readyState == 4) {
			document.getElementById('load_div').style.visibility="hidden";

			for (i = 0; i < frm.elements.length; i++) {
				if (frm.elements[i].type == "checkbox")
					frm.elements[i].checked = false;
				if (frm.elements[i].type == "password")
					frm.elements[i].value = "";

				frm.elements[i].disabled = false;
			}
	
			if (GET_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") > -1) {
				var x = GET_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") + "<script type=\"text/javascript\">".length;
				var y = GET_xmlhttp.responseText.indexOf("</script>") - x;
				eval(GET_xmlhttp.responseText.substr(x, y));
			}
			
			if (GET_xmlhttp.responseText.indexOf('ALERT|') > -1) {
				var x = GET_xmlhttp.responseText.indexOf('ALERT|') + "ALERT|".length;
				var y = GET_xmlhttp.responseText.indexOf('|ENDALERT') - x;
				window.alert(GET_xmlhttp.responseText.substr(x , y));
			} else
				document.getElementById(div_name).innerHTML = GET_xmlhttp.responseText + ' ';
		}
	}

	GET_xmlhttp.send(null);  

	return false;
}

function force(item_name, frm_name, e) {
	var keynum;

	if (window.event)
		keynum = e.keyCode;
	else if (e.which)
		keynum = e.which;

	if (keynum == 13) {
		var frm = false;
		var i = 0;
		var j = 0;

		frm = document.getElementById(frm_name);

		for (i = 0; i < frm.elements.length; i++) {
			if (item_name == frm.elements[i].name) {
				if (frm.elements[i + 1].type == "submit") {
					for (j = 0; j < frm.elements.length; j++) {
						if (frm.elements[j].type == "checkbox")
							continue;
						if (frm.elements[j].value == '') {
							frm.elements[j].focus();
							return false;
						}
					}
				}
				while (frm.elements[i + 1]) {
					if (frm.elements[i + 1].type != "hidden") {
						frm.elements[i + 1].focus();
						return false;
					}
					i++;
				}
			}
		}
	}
	return true;
}


function validaForm() {

 d = document.senha;

 if (d.pass.value == ""){
   alert("O campo SUA SENHA SENHA ATUAL deve ser preenchido!");
   d.pass.focus();
   return false; }

 if (d.pass.value.length < 2){
   alert("O campo SUA SENHA SENHA ATUAL deve ter mais que 2 digitos!");
   d.pass.focus();
   return false; }


 if (d.mail.value == ""){
   alert("O campo SEU E-MAIL ATUAL deve ser preenchido!");
   d.mail.focus();
   return false; }


 if (d.npass.value == ""){
   alert("O campo NOVA SENHA deve ser preenchido!");
   d.npass.focus();
   return false; }

 if (d.npass.value.length < 6){
   alert("O campo NOVA SENHA deve ter mais que 6 digitos!");
   d.npass.focus();
   return false; }


 if (d.cnpass.value == ""){
   alert("O campo CONFIRMAR NOVA SENHA deve ser preenchido!");
   d.cnpass.focus();
   return false; }

 if (d.cnpass.value.length < 6){
   alert("O campo CONFIRMAR NOVA SENHA deve ter mais que 6 digitos!");
   d.cnpass.focus();
   return false; }

 if (d.npass.value != d.cnpass.value) {
   alert("O campo NOVA SENHA e CONFIRMAR NOVA SENHA não estão iguais!");
   d.npass.value = ""; d.cnpass.value = ""; d.npass.focus();
   return false; }

 if (d.nmail.value == ""){
   alert("O campo NOVO EMAIL deve ser preenchido!");
   d.nmail.focus();
   return false; }

 if (d.nmail.value.length < 5){
   alert("O campo NOVO EMAIL deve ter mais que 5 digitos!");
   d.nmail.focus();
   return false; }


 if (d.cnmail.value == ""){
   alert("O campo REPETE NOVO EMAIL deve ser preenchido!");
   d.cnmail.focus();
   return false; }

 if (d.nmail.value != d.cmail.value) {
   alert("O campo NOVO EMAIL e REPETE NOVO EMAIL não estão iguais!");
   d.nmail.value = ""; d.cnmail.value = ""; d.nmail.focus();
   return false; }

}


function validaRegistro() {

 e = document.registro;
 
 if (e.login.value.length < 4){
   alert("O campo USUARIO deve conter entre 4 a 23 caracteres!");
   e.login.focus();
   return false; }
   
 if (e.login.value.length > 24){
   alert("O campo USUARIO deve conter entre 4 a 23 caracteres!");
   e.login.focus();
   return false; }

 if (e.senha.value == ""){
   alert("O campo SUA SENHA SENHA ATUAL deve ser preenchido!");
   e.senha.focus();
   return false; }
   
 if (e.senha.value == e.login.value){
   alert("O campo SUA SENHA nao pode ser igual a seu login");
   e.senha.focus();
   return false; }
   
 if (e.senha.value != e.csenha.value){
   alert("As senhas digitadas nao sao iguais. Verifique se confirmou a senha correta.");
   e.senha.focus();
   return false; }
   
 if (e.senha.value.length < 6){
   alert("O campo SENHA deve conter entre 6 a 23 caracteres!");
   e.senha.focus();
   return false; }
   
 if (e.senha.value.length > 23){
   alert("O campo SENHA deve conter entre 6 a 23 caracteres!");
   e.senha.focus();
   return false; }

 if (e.email.value == ""){
   alert("O campo E-MAIL deve ser preenchido!");
   e.email.focus();
   return false; }

 if (e.csenha.value == ""){
   alert("O campo CONFIRMAR SENHA deve ser preenchido!");
   e.csenha.focus();
   return false; }

 if (e.csenha.value.length < 6){
   alert("O campoCONFIRMAR SENHA deve ter mais que 6 digitos!");
   e.csenha.focus();
   return false; }
   
 if (e.csenha.value.length > 23){
   alert("O campo CONFIRMAR SENHA deve conter entre 6 a 23 caracteres!");
   e.csenha.focus();
   return false; }

}

function verificar_login(){
	var login = $('#registro_login').val();
	$('#c-login').fadeIn('slow');

	$('#mensagem-login').load('verificar_login.php?login='+login,function () { 
		$('#mensagem-login').fadeIn('slow'); 
		$('#c-login').fadeOut('fast');
	});
}


function logwoe(id){
	if(id == "asgard"){
		$('#logwoe').load('logwoe.php?servidor=asgard');
		
		$('#asgard').addClass('ranking-botao-active');
		$('#outro').removeClass('ranking-botao-active');
	}
	else if(id == "outro"){
		$('#logwoe').load('logwoe.php?servidor=outro');	
		
		$('#asgard').removeClass('ranking-botao-active');
		$('#outro').addClass('ranking-botao-active');
	}
	else {
		$('#logwoe').load('logwoe.php?servidor=asgard');
		
		$('#asgard').addClass('ranking-botao-active');
		$('#outro').removeClass('ranking-botao-active');
	}

}

function ranking_pvp(id){
	if(id == "asgard"){
		$('#rankingpvp').load('ranking-pvp-s.php?servidor=asgard');
		
		$('#asgard').addClass('ranking-botao-active');
		$('#outro').removeClass('ranking-botao-active');
	}
	else if(id == "outro"){
		$('#rankingpvp').load('ranking-pvp-s?servidor=outro');	
		
		$('#asgard').removeClass('ranking-botao-active');
		$('#outro').addClass('ranking-botao-active');
	}
	else {
		$('#rankingpvp').load('ranking-pvp-s?servidor=asgard');
		
		$('#asgard').addClass('ranking-botao-active');
		$('#outro').removeClass('ranking-botao-active');
	}

}

function ranking_gvg(id){
	if(id == "asgard"){
		$('#rankinggvg').load('ranking-gvg-s.php?servidor=asgard');
		
		$('#asgard').addClass('ranking-botao-active');
		$('#outro').removeClass('ranking-botao-active');
	}
	else if(id == "outro"){
		$('#rankinggvg').load('ranking-gvg-s?servidor=outro');	
		
		$('#asgard').removeClass('ranking-botao-active');
		$('#outro').addClass('ranking-botao-active');
	}
	else {
		$('#rankinggvg').load('ranking-gvg-s?servidor=asgard');
		
		$('#asgard').addClass('ranking-botao-active');
		$('#outro').removeClass('ranking-botao-active');
	}

}

function link_jump(http, div_name) {
	var LINK_xmlhttp = false;
	try { LINK_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { LINK_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) { try { LINK_xmlhttp = new XMLHttpRequest(); }
	catch (e) { LINK_xmlhttp = false; }}}
	
	document.getElementById(div_name).innerHTML = "<img src='imagens/loading.gif'>";
	
	if (!LINK_xmlhttp) return null;
	LINK_xmlhttp.open("GET", http, true);
	LINK_xmlhttp.onreadystatechange = function() {
		if (LINK_xmlhttp.readyState == 4) {
			if (LINK_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") > -1) {
				var x = LINK_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") + "<script type=\"text/javascript\">".length;
				var y = LINK_xmlhttp.responseText.indexOf("</script>") - x;
				eval(LINK_xmlhttp.responseText.substr(x, y));
			}
			if (LINK_xmlhttp.responseText.indexOf('ALERT|') > -1) {
				var x = LINK_xmlhttp.responseText.indexOf('ALERT|') + "ALERT|".length;
				var y = LINK_xmlhttp.responseText.indexOf('|ENDALERT') - x;
				window.alert(LINK_xmlhttp.responseText.substr(x , y));
			} else
				document.getElementById(div_name).innerHTML = LINK_xmlhttp.responseText + ' ';
		}
	}
	LINK_xmlhttp.send(null);
	return false;
}

function post_jump(http, div_name, frm_name) { //função para gets

	var POST_xmlhttp = false;
	var frm = false
	var url = "";
    //var namevalue=document.getElementById(div_name).innerHTML;
    //var agevalue=document.getElementById(frm_name).barcode.value;
    var poststr = "";

	try { POST_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { POST_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) { try { POST_xmlhttp = new XMLHttpRequest(); }
	catch (e) { POST_xmlhttp = false; }}}
	if (!POST_xmlhttp) return null;

	frm = document.getElementById(frm_name);
	url = http + "?frm_name=" + frm_name;

	for (i = 0; i < frm.elements.length; i++) {
		frm.elements[i].disabled = true;
		if (frm.elements[i].type == "checkbox") {
			if (frm.elements[i].checked)
				frm.elements[i].value = 1;
			else
				frm.elements[i].value = 0;
		}
		url = url + "&" + frm.elements[i].name + "=" + escape(frm.elements[i].value);
		poststr = poststr + "&" + frm.elements[i].name + "=" + escape(frm.elements[i].value);
	}
    POST_xmlhttp.open("POST", url, true);
	POST_xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	POST_xmlhttp.setRequestHeader("Content-length", poststr.length);
    //POST_xmlhttp.setRequestHeader("Connection", "close");
	POST_xmlhttp.onreadystatechange = function() {
		if (POST_xmlhttp.readyState == 4) {
			for (i = 0; i < frm.elements.length; i++) {
				if (frm.elements[i].type == "checkbox")
					frm.elements[i].checked = false;
				if (frm.elements[i].type == "password")
					frm.elements[i].value = "";

				frm.elements[i].disabled = false;
			}

			if (POST_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") > -1) {
				var x = POST_xmlhttp.responseText.indexOf("<script type=\"text/javascript\">") + "<script type=\"text/javascript\">".length;
				var y = POST_xmlhttp.responseText.indexOf("</script>") - x;
				eval(POST_xmlhttp.responseText.substr(x, y));
			}

			if (POST_xmlhttp.responseText.indexOf('ALERT|') > -1) {
				var x = POST_xmlhttp.responseText.indexOf('ALERT|') + "ALERT|".length;
				var y = POST_xmlhttp.responseText.indexOf('|ENDALERT') - x;
				window.alert(POST_xmlhttp.responseText.substr(x , y));
			} else
				document.getElementById(div_name).innerHTML = POST_xmlhttp.responseText
		}
	}

	POST_xmlhttp.send(poststr);
	return false;
}


/* Item Sets Form */
function confirmSetPurchase(id)
{
	var char 	= document.getElementById('charname');
	var set 	= document.getElementById('purchase_set'+id).itemset.value;
	var setname = document.getElementById('purchase_set'+id).setname.value;
	var setcost = document.getElementById('purchase_set'+id).setcost.value;
	var charset = document.getElementById('purchase_set'+id).charset;
	
	Item = char.selectedIndex;
    Result = char.options[Item].value;
	charset.value = Result;
	
	if(Result == ""){
		alert('Por favor selecione um Char');
		return false;
	}else if(set == ""){
		alert('Por favor selecione um set para comprar');
		return false;
	}else if(charset.value == ""){
		alert('Por favor selecione um Char');
		return false;
	}else{
		
		var agree = confirm('Voce tem certeza que deseja comprar o set '+setname+' para o char '+charset.value+' por '+setcost+' coins?');
		if(agree){
			document.getElementById('purchase_set'+id).submit();
			return true;
		}else{
			return false;
		}
	}
}

function confirmRewardPurchase(id)
{
	var itemname = document.getElementById('name');
	var itemid = document.getElementById('entry');
	var itemcost = document.getElementById('cost');
	var send = document.getElementById('itementry');

	if(char.value == ""){
		alert("Por favor selecione um Char para receber o GOLD");
		return false;
	}else{
		var agree = confirm("Voce tem certeza que deseja comprar o Item "+itemname.innerHTML+" para o char "+char.value+" por "+itemcost.innerHTML+"?");
		if(agree){
			send.value = itemid.value;
			if(send.value != ""){
				document.getElementById('buyReward'+id).submit();
			}else{
				alert("Please purchase an item from the list displayed");
				return false;
			}
		}else{
			return false;
		}
	}
}

function votePopup_Show() {
		document.getElementById('vPopup').style.display = "block";
}

function votePopup_Hide() {
	document.getElementById('vPopup').style.display = "none";
	document.getElementById('vPopup').innerHTML = "";
};


function ConfirmarCompra()
{
	var charname = document.getElementById('charname');

	if(charname.value == ""){
		alert("Por favor selecione um Char.");
		return false;
	}else{
		document.getElementById('ConfirmarCompra').submit();
		return true;
	}
}

function EnviarFormSet(id)
{
	document.getElementById('set'+id).submit();
		return true;
}


/* Check Username Availability (Register) */
function ChkUser(user)
{
	var xmlhttp;
	if(window.XMLHttpRequest){ 
		xmlhttp = new XMLHttpRequest(); 
	}else if (window.ActiveXObject){ 
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
		}catch (e) { 
			try{ 
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
			}catch(e){} 
		} 
	} 
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4){
	  		if(xmlhttp.responseText == "Indisponivel"){
				document.images.available.src="http://www.wowproject.com.br/novo/imagens/indisponivel.png";
	  		}else if(xmlhttp.responseText == "Disponivel"){
		  		document.images.available.src="http://www.wowproject.com.br/novo/imagens/disponivel.png";
	  		}
  		}
	}
	xmlhttp.open("GET","http://www.wowproject.com.br/novo/checar_usuario.php?check="+user,true);
	xmlhttp.send(null);
}


function fnChkRegFrm() {
	if (document.regForm.username.value.length == 0) {
		alert ('Por favor digite um nome de usuario válido.');
		regForm.username.value = "";
		regForm.username.focus();
		return false;
	}else if (document.regForm.username.value.length <= 3) {
		alert ('O Username deve conter mais que 4 caracteres.');
		regForm.username.focus();
		return false;
	}
	else if (document.regForm.password.value == document.regForm.username.value) {
		alert ('Por favor nao utilize o Username como Senha.');
		regForm.password.value = "";
		regForm.password.focus();
		return false;
	}
	else if (document.regForm.password.value.length == 0) {
		alert ('Por favor digite uma Senha.');
		regForm.password.value = "";
		regForm.password.focus();
		return false;
	}
	else if (document.regForm.password.value.length <= 3) {
		alert ('A senha deve conter mais que 4 caracteres.');
		regForm.password.focus();
		return false;
	}
	else if (document.regForm.passwordc.value.length == 0) {
		alert ('Por favor confirme sua Senha.');
		regForm.passwordc.value = "";
		regForm.passwordc.focus();
		return false;
	}
	else if (document.regForm.password.value != document.regForm.passwordc.value) {
		alert ('As Senhas digitas não conferem.');
		regForm.password.value = "";
		regForm.passwordc.value = "";
		regForm.password.focus();
		return false;
	}
	else if (document.regForm.email.value.length == 0) {
		alert ('Por favor digite um e-mail valido.');
		regForm.email.value = "";
		regForm.email.focus();
		return false;
	}
	else if (document.regForm.emailc.value.length == 0) {
		alert ('Por favor confirme seu e-mail.');
		regForm.emailc.value = "";
		regForm.emailc.focus();
		return false;
	}
	else if (document.regForm.email.value != document.regForm.emailc.value) {
		alert ('Os e-mails digitados não conferem.');
		regForm.emailc.value = "";
		regForm.emailc.focus();
		return false;
	}
	else {
		document.getElementById('regForm').submit();
		return true;
	}
}

function ajax_get_simples(uerrel,div){
	$.ajax({
		url: uerrel,
		dataType: 'html',
		beforeSend: function(){
			$(div).html(ico_loading);
		},
		complete: function(){
			$(ico_loading).remove();
		},
		success: function(data){
			$(div).hide();
			$(div).fadeIn(900).html(data);
		}
	});
}

function mudar_ranking(id) {
var box = $('#'+id);
var botao = $('#b-'+id);
if(box.is(':hidden'))
{
	box.fadeIn('fast');
	botao.html('OCULTAR');
}
else
{
	box.fadeOut('fast');
	botao.html('MOSTRAR');
}
}

function pvp_change(id){
	if(id == 1){
		$('#v-botao').removeClass('b-normal');
		$('#v-botao').removeClass('b-ativo');
		$('#i-botao').removeClass('b-normal');
		$('#i-botao').removeClass('b-ativo');
		$('#k-botao').removeClass('b-normal');
		$('#k-botao').removeClass('b-ativo');
		$('#l-botao').removeClass('b-normal');
		$('#l-botao').removeClass('b-ativo');
		
		$('#v-botao').addClass('b-ativo');
		$('#i-botao').addClass('b-normal');
		$('#k-botao').addClass('b-normal');
		$('#l-botao').addClass('b-normal');
		$('#box_2').fadeOut('fast', function(){	$('#box_1').fadeIn('slow');});
		$('#box_3').fadeOut('fast', function(){	$('#box_1').fadeIn('slow');});
		$('#box_4').fadeOut('fast', function(){	$('#box_1').fadeIn('slow');});
	}
	
	else if(id == 2) {
		$('#v-botao').removeClass('b-normal');
		$('#v-botao').removeClass('b-ativo');
		$('#i-botao').removeClass('b-normal');
		$('#i-botao').removeClass('b-ativo');
		$('#k-botao').removeClass('b-normal');
		$('#k-botao').removeClass('b-ativo');
		$('#l-botao').removeClass('b-normal');
		$('#l-botao').removeClass('b-ativo');
		
		$('#i-botao').addClass('b-ativo');
		$('#v-botao').addClass('b-normal');
		$('#k-botao').addClass('b-normal');
		$('#l-botao').addClass('b-normal');
		$('#box_1').fadeOut('fast', function(){	$('#box_2').fadeIn('slow');});
		$('#box_3').fadeOut('fast', function(){	$('#box_2').fadeIn('slow');});
		$('#box_4').fadeOut('fast', function(){	$('#box_2').fadeIn('slow');});
	}
	
	else if(id == 3) {
		$('#v-botao').removeClass('b-normal');
		$('#v-botao').removeClass('b-ativo');
		$('#i-botao').removeClass('b-normal');
		$('#i-botao').removeClass('b-ativo');
		$('#k-botao').removeClass('b-normal');
		$('#k-botao').removeClass('b-ativo');
		$('#l-botao').removeClass('b-normal');
		$('#l-botao').removeClass('b-ativo');
		
		$('#k-botao').addClass('b-ativo');
		$('#i-botao').addClass('b-normal');
		$('#v-botao').addClass('b-normal');
		$('#l-botao').addClass('b-normal');
		$('#box_2').fadeOut('fast', function(){	$('#box_3').fadeIn('slow');});
		$('#box_1').fadeOut('fast', function(){	$('#box_3').fadeIn('slow');});
		$('#box_4').fadeOut('fast', function(){	$('#box_3').fadeIn('slow');});


	}

	else {
		$('#v-botao').removeClass('b-normal');
		$('#v-botao').removeClass('b-ativo');
		$('#i-botao').removeClass('b-normal');
		$('#i-botao').removeClass('b-ativo');
		$('#k-botao').removeClass('b-normal');
		$('#k-botao').removeClass('b-ativo');
		$('#l-botao').removeClass('b-normal');
		$('#l-botao').removeClass('b-ativo');
		
		$('#l-botao').addClass('b-ativo');
		$('#i-botao').addClass('b-normal');
		$('#v-botao').addClass('b-normal');
		$('#k-botao').addClass('b-normal');
		$('#box_2').fadeOut('fast', function(){	$('#box_4').fadeIn('slow');});
		$('#box_1').fadeOut('fast', function(){	$('#box_4').fadeIn('slow');});
		$('#box_3').fadeOut('fast', function(){	$('#box_4').fadeIn('slow');});


	}
}
