// JavaScript Document
div_sel = 1;
function Rolar() {
if (div_sel == 1) {
div_sel = 2;
$("#um").animate({left: "-2000"}, "fast")
		.fadeOut("fast");
				
		$("#dois")
		.animate({left: "0"})
		.fadeIn("fast");
		}
		else {
		div_sel = 1;
		$("#dois").animate({left: "-2000"}, "fast")
		.fadeOut("fast");
				
		$("#um")
		.animate({left: "0"})
		.fadeIn("fast");
		}
		document.getElementById(didoff).innerHTML = '';
}
function Carregar(url, valor1, valor2, valor3) {
	document.getElementById('carregando').style.display = '';
	if (div_sel == 2) { did = 'um'; didoff = 'dois'; } else { did = 'dois'; didoff= 'um'; }
	ajaxGet('GET', url+'?didoff='+didoff+'&valor1='+valor1+'&valor2='+valor2+'&valor3='+valor3, did); nfoto=1;
}
function AFacilitar(palavra, did) {
	if (palavra.length > 2) {
		document.getElementById(did).style.display = '';
		document.getElementById(did).innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle">';
		ajaxGet2('GET', 'ajax_artistas.asp?palavra='+palavra, did);
		}
		else { document.getElementById(did).style.display = 'none'; }
}
function AFacilitar2(palavra, did) {
	if (palavra.length > 2) {
		document.getElementById(did).style.display = '';
		document.getElementById(did).innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle">';
		ajaxGet2('GET', 'ajax_artistas2.asp?palavra='+palavra, did);
		}
		else { document.getElementById(did).style.display = 'none'; }
}
function AFacilitar3(palavra, did) {
	if (palavra.length > 2) {
		document.getElementById(did).style.display = '';
		document.getElementById(did).innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle">';
		ajaxGet2('GET', 'ajax_artistas4.asp?palavra='+palavra, did);
		}
		else { document.getElementById(did).style.display = 'none'; }
}
nfoto = 1;
function MaisFoto(qtd_foto, didoff) {
	if (nfoto < qtd_foto) {
	document.getElementById(didoff).innerHTML = '';
	nfoto++;
	EscFoto(qtd_foto);
	document.getElementById('art_foto'+nfoto).style.display = '';
	document.getElementById('art_texto'+nfoto).style.display = '';
	}
	else { 
	document.getElementById(didoff).innerHTML = '';
	nfoto = 1;
	EscFoto(qtd_foto);
	document.getElementById('art_foto'+nfoto).style.display = '';
	document.getElementById('art_texto'+nfoto).style.display = '';
	}
}
function MenosFoto(qtd_foto, didoff) {
	if (nfoto > 1) {
	document.getElementById(didoff).innerHTML = '';
	nfoto--;
	EscFoto(qtd_foto);
	document.getElementById('art_foto'+nfoto).style.display = '';
	document.getElementById('art_texto'+nfoto).style.display = '';
	document.getElementById('seta2').style.display = '';
	}
	else { 
	document.getElementById(didoff).innerHTML = '';
	nfoto = qtd_foto;
	EscFoto(qtd_foto);
	document.getElementById('art_foto'+nfoto).style.display = '';
	document.getElementById('art_texto'+nfoto).style.display = '';
	}
}
function EscFoto(qtd_foto) {
	for (x=1; x <= qtd_foto; x++) { document.getElementById('art_foto'+x).style.display = 'none'; document.getElementById('art_texto'+x).style.display = 'none'; }
}
function Curriculo(id, nome) {
	document.getElementById('art_nome').innerHTML = nome;
	document.getElementById('curriculo_txt').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
	ajaxGet2('GET', 'ajax_curriculo.asp?id='+id, 'curriculo_txt');
	document.getElementById('curriculo_txt').scrollTop = 0;
}
function OndeEnc(id, nome) {
	document.getElementById('art_nome2').innerHTML = nome;
	document.getElementById('art_onde').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
	ajaxGet2('GET', 'ajax_onde.asp?id='+id, 'art_onde');
	document.getElementById('art_onde').scrollTop = 0;
}
function BlogArt(id, id_artista) {
	document.getElementById('blog02').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
	ajaxGet2('GET', 'ajax_blogart.asp?id='+id+'&id_artista='+id_artista, 'blog02');
	document.getElementById('blog02').scrollTop = 0;
}
function Bloger(id, didoff) {
	document.getElementById(didoff).innerHTML = '';
	document.getElementById('blog_central').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
	ajaxGet2('GET', 'ajax_blog.asp?id='+id, 'blog_central');
	document.getElementById('blog_central').scrollTop = 0;
}
function Blog(id, id_artista) {
	document.getElementById('blog01').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
	ajaxGet2('GET', 'ajax_blog.asp?id='+id+'&id_artista='+id_artista, 'blog01');
	document.getElementById('blog01').scrollTop = 0;
}
function Video(id, titulo, id_artista, didoff) {
document.getElementById(didoff).innerHTML = '';
document.getElementById('video_central').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
document.getElementById('art_titulo_video').innerHTML = titulo;
ajaxGet2('GET', 'ajax_video.asp?id='+id+'&id_artista='+id_artista, 'video_central');
}
function Apagar(did) {
	document.getElementById(did).innerHTML = '';
}
function Postar() {
	local = document.getElementById('comentarios').local.value;
	id_local = document.getElementById('comentarios').id_local.value;
	nome = document.getElementById('comentarios').txt_nome.value;
	email = document.getElementById('comentarios').txt_email.value;
	comentario = document.getElementById('comentarios').txt_comentario.value;
	comentario = comentario.replace(/\n/g, '<br>');
	ajaxGet2('GET', 'ajax_postar.asp?nome='+nome+'&email='+email+'&comentario='+comentario+'&id_local='+id_local+'&local='+local, '');
	alert('Comentário adicionado com sucesso, porém, só estará\n visível após liberação do moderador.');
	document.getElementById('comentarios').txt_nome.value = '';
	document.getElementById('comentarios').txt_email.value = '';
	document.getElementById('comentarios').txt_comentario.value = '';
	return (false);
}
function Fechar_Tela(id) {
document.getElementById('tela_preta').style.display = 'none';
document.getElementById(id).style.display = 'none';
}
function Solicitacao(id, didoff) {
	document.getElementById(didoff).innerHTML = '';
	document.getElementById('tela_preta').style.display = '';
	document.getElementById('spekbox').style.display = '';
	document.getElementById('spekbox').innerHTML = '<img src="images/loading.gif" align="absmiddle" border="0"> Carregando...';
	ajaxGet2('GET', 'ajax_solicitar.asp?id='+id, 'spekbox');
}

function Solicitar(id) {
	did = document.getElementById('frm_solicitar');
	vnome = did.txt_nome.value;
	vemail = did.txt_email.value;
	vtelefone = did.txt_telefone.value;
	vcomentario = did.txt_comentario.value;
	vcomentario = vcomentario.replace(/\n/g, '<br>');
	if (vemail == '') { alert('Informe seu e-mail por favor.'); did.txt_email.focus(); return (false); }
	document.getElementById('spekbox').innerHTML = '<img src="images/loading.gif" align="absmiddle" border="0"> Aguarde... sua solicitação está sendo enviada...';
ajaxGet2('GET', 'ajax_solicitar_enviar.asp?id='+id+'&nome='+vnome+'&email='+vemail+'&telefone='+vtelefone+'&comentario='+vcomentario, 'spekbox');
}
function Tecn(id) {
	document.getElementById(didoff).innerHTML = '';
	document.getElementById('tela_preta').style.display = '';
	document.getElementById('spekbox').style.display = '';
	document.getElementById('spekbox').style.width = '500px';
document.getElementById('spekbox').innerHTML = '<img src="images/loading.gif" align="absmiddle" border="0"> Carregando...';
ajaxGet2('GET', 'ajax_tec.asp?id='+id, 'spekbox');
}
function EnviarContato() {
	//Pega o objeto formulário
	did = document.getElementById('frm_contato');
	
	//Critica os campos obrigatórios
	if ( did.email.value == '' ) { alert('Informe seu e-mail.'); did.email.focus(); return (false); }

	//Coleta os dados
	v_nome = did.nome.value;
	v_email = did.email.value;
	v_homepage = did.home_page.value;
	v_telefone = did.telefone.value;
	v_skype = did.skype.value;
	v_mensagem = did.mensagem.value;
	v_mensagem = v_mensagem.replace(/\n/g, '<br>');
	did.ok.value = 'Aguarde...';
	did.ok.disabled = true;
	
	//Envia via Ajax
	ajaxGet2('GET', 'ajax_contato.asp?nome='+v_nome+'&email='+v_email+'&homepage='+v_homepage+'&telefone='+v_telefone+'&skype='+v_skype+'&mensagem='+v_mensagem, '');
	setTimeout('LimparContato();', 5000);
	return (false);
}
function LimparContato() {
	//Pega o objeto formulário
	did = document.getElementById('frm_contato');
	did.nome.value = '';
	did.email.value = '';
	did.telefone.value = '';
	did.home_page.value = '';
	did.skype.value = '';
	did.mensagem.value = '';
	did.ok.value = 'Enviar';
	did.ok.disabled = false;
	alert('Mensagem enviada com sucesso!\nObrigado pela participação!');
	did.nome.focus();
}