// 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 AFacilitar1(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_artistas1.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, id_loc, 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+'&id_loc='+id_loc, 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 = '';
	}
	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 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 Fechar_Tela(id) {
document.getElementById('tela_preta').style.display = 'none';
document.getElementById(id).style.display = 'none';
}
function SWK_Loc(id) {
		document.getElementById('swk_conteudo').innerHTML = '<img src="images/loading.gif" align="absmiddle" border="0"> Carregando...';
		ajaxGet2('GET', 'loc_conteudo.asp?id='+id, 'swk_conteudo');
		nfoto = 1;
}
function SWK_Artesao(id, nome) {
			document.getElementById('swk_nome').innerHTML = nome;
		document.getElementById('swk_lista').innerHTML = '<img src="images/loading.gif" align="absmiddle" border="0"> Carregando...';
		ajaxGet2('GET', 'loc_artesaos.asp?id='+id, 'swk_lista');
		nfoto = 1;
		SWK_Videos(id);
		document.getElementById('swk_release').innerHTML = '<a href="release.asp?id='+id+'">Release</a>';
}
function SWK_Videos(id) {
		document.getElementById('swk_videos').innerHTML = '<img src="images/loading.gif" align="absmiddle" border="0"> Carregando...';
		ajaxGet2('GET', 'loc_videos.asp?id='+id, 'swk_videos');
		nfoto = 1;
}
function MaisFoto2(qtd_foto, didoff, did) {
	if (nfoto < qtd_foto) {
	document.getElementById(didoff).innerHTML = '';
	nfoto++;
	EscFoto2(qtd_foto, did);
	document.getElementById(did+nfoto).style.display = '';
	document.getElementById(did+nfoto).style.display = '';
	}
	else { 
	document.getElementById(didoff).innerHTML = '';
	nfoto = 1;
	EscFoto2(qtd_foto, did);
	document.getElementById(did+nfoto).style.display = '';
	document.getElementById(did+nfoto).style.display = '';
	}
}
function MenosFoto2(qtd_foto, didoff, did) {
	if (nfoto > 1) {
	document.getElementById(didoff).innerHTML = '';
	nfoto--;
	EscFoto2(qtd_foto, did);
	document.getElementById(did+nfoto).style.display = '';
	document.getElementById(did+nfoto).style.display = '';
	}
	else { 
	document.getElementById(didoff).innerHTML = '';
	nfoto = qtd_foto;
	EscFoto2(qtd_foto, did);
	document.getElementById(did+nfoto).style.display = '';
	document.getElementById(did+nfoto).style.display = '';
	}
}
function EscFoto2(qtd_foto, did) {
	for (x=1; x <= qtd_foto; x++) { document.getElementById(did+x).style.display = 'none'; document.getElementById(did+x).style.display = 'none'; }
}
function Video2(id, titulo, id_artista) {
document.getElementById('video_central').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
ajaxGet2('GET', 'ajax_video2.asp?id='+id+'&id_artista='+id_artista, 'video_central');
}

function RetFoto(id, didoff) {
document.getElementById('div_fotos').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
ajaxGet2('GET', 'ajax_ret_foto.asp?id='+id+'&didoff='+didoff, 'div_fotos');
}

function RetTexto(id, didoff) {
document.getElementById('edende_home').innerHTML = '<img src="images/loading.gif" border="0" align="absmiddle"> Carregando...';
ajaxGet2('GET', 'ajax_ret_texto.asp?id='+id, 'edende_home');
}


function SelArtista(id, didoff) {
document.getElementById(didoff).innerHTML = '';
RetFoto(id, didoff);
RetTexto(id, didoff);
document.getElementById('div_onde').innerHTML = "<a href=javascript:Carregar('onde_encontrar_artesao.asp','home.asp','"+id+"','');>... Onde Encontrar</a>";
document.getElementById('div_formulario').innerHTML = "<a href=javascript:Solicitacao('"+id+"','"+didoff+"') style='color:#872827;'>Formul&aacute;rio de contato</a>";
}