function $( id ){ return document.getElementById(id); }
function gid( id ){ return document.getElementById(id); }

//Submit post via AJAX

function submitAjax( url, params, method )
{
  http_request = false;
  if (window.XMLHttpRequest) { // Mozilla, Safari,...
	 http_request = new XMLHttpRequest();
	 if (http_request.overrideMimeType) {

		http_request.overrideMimeType('text/html');
	 }
  } else if (window.ActiveXObject) { // IE
	 try {
		http_request = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
		try {
		   http_request = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {}
	 }
  }
  if (!http_request) {
	 alert('Cannot create XMLHTTP instance');
	 return false;
  }


  http_request.onreadystatechange = method;
  http_request.open('POST', url, true);
  http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http_request.setRequestHeader("Content-length", params.length);
  http_request.setRequestHeader("Connection", "close");
  http_request.send( params );


}
	
	function chamaVotosNaReta()
	{
		// Instancia a classe ajax
			var ajx = new AJAX();
		// Define a url
			ajx.url = 'index.php?module=IndexController&action=VotosNaReta';
		// Define o modo T = (Text), X = (XML)
			ajx.modo = 'T';
		// Processa o resultado e retorna na variavel r
			ajx.processaresultado = function(r)
			{
				// Separa em Partes a Resposta
					partes=r.split("|");
						//Adiciona Cada Percentual Correspondente ao Voto
						document.getElementById('resultado_nareta_1').innerHTML=partes[0];
						document.getElementById('resultado_nareta_2').innerHTML=partes[1];
						document.getElementById('resultado_nareta_3').innerHTML=partes[2];
			}
		// Conecta ao Ajax
		ajx.conectar();
	}
	
	function AdicionarVotoNaReta()
	{	
		
	
		//Recupera a opção desejada de voto
			for(i=0; i <  document.nareta.voto.length; i++)
			{
				if(document.nareta.voto[i].checked)
				{
					var opcao = document.nareta.voto[i].value;
				}
			}
			
						
		//Adiciona a variavel opção ao SEND
			var params = "opcao=" + encodeURI(opcao);
		//Destino
			var url = "index.php?module=IndexController&action=AdicionarVotoNaReta";

		//Envia os Dados e Pega a Resposta
			submitAjax( url, params, function( resposta ) {
	
			  if (http_request.readyState == 4) {
				 if (http_request.status == 200) {
	
					var resp = http_request.responseText;
				alert(resp);
				setTimeout('chamaVotosNaReta()', 100);
				 } else {
	
				 }
			  }
		} );
	}
	
	// Alterar Cadastro

	function ShowAlterarCadastro( id )
	{
		//var alterar = document.getElementById("alterar_cadastro");
		var alterar = gid("alterar_cadastro");
			alterar.style.display='';
		
	}

	function CloseAlterarCadastro( id )
	{
		var option;
			option = gid("alterar_cadastro");
			option.style.display='none';
			
	}
	
	// Boxes de Participação Promoções
	
	function ShowBoxPromocao( id )
	{
		document.getElementById("box_participa_promocao_"+id).style.display='';
	}
	
	function CloseBoxPromocao( id )
	{
		var option;
			option = gid("box_participa_promocao_"+id);
			option.style.display='none';
			//$("box_participa_promocao_"+id).style.display='none';
	}

	// Hora dos Perdidos [Pedido]
	
	function HoradosPerdidos()
	{
		var nome = document.hora_dos_perdidos.nome.value;
		var email = document.hora_dos_perdidos.email.value;
		var tel = document.hora_dos_perdidos.telefone.value;
		var dd = document.hora_dos_perdidos.ddd.value;
		var telefone = "("+dd+") "+tel;
		var estado = document.hora_dos_perdidos.estado.value;
		var banda = document.hora_dos_perdidos.banda.value;
		var musica = document.hora_dos_perdidos.musica.value;
		var identifica;
		 
		 // Verificação Campos Hora dos Perdidos
		
		if( (nome == null) || (nome == "")) { alert("[Cidade Web Rock]\nPreencha seu Nome!"); identifica = 1; return false; }
		if( (email == null) || (email == "") ) { alert("[Cidade Web Rock]\nPreencha seu E-mail!"); identifica = 1; return false; }
		if( (tel == null) || (tel == "") ) { alert("[Cidade Web Rock]\nPreencha seu Telefone!"); identifica = 1; return false; }
		if( (dd == null) || (dd == "") ) { alert("[Cidade Web Rock]\nPreencha seu DDD"); identifica = 1; return false; }
		if( (estado == null) || (estado == "") )	{ alert("[Cidade Web Rock]\nPreencha seu Estado\nExemplo: RJ"); identifica = 1; return false; }
		if( (banda == null) || (banda == "") ) { alert("[Cidade Web Rock]\nPreencha o Campo Banda!"); identifica = 1; return false; }
		if( (musica == null) || (musica == "") ) { alert("[Cidade Web Rock]\nPreencha o Campo Música!"); identifica = 1; return false; }
		
		if(identifica != 1) 
		
		{
				//
					var params = "nome=" + encodeURI(nome) + "&email=" + encodeURI(email) + "&telefone=" + encodeURI(telefone) + "&estado=" + encodeURI(estado) + "&banda=" + encodeURI(banda) + "&musica=" + encodeURI(musica) ;
				//Destino
					var url = "index.php?module=IndexController&action=HoraDosPerdidos";
	
				//Envia os Dados e Pega a Resposta
					submitAjax( url, params, function( resposta ) {
	
					  if (http_request.readyState == 4) {
						 if (http_request.status == 200) {
	
							var resp = http_request.responseText;
						alert(resp);
						document.hora_dos_perdidos.reset();
						 } else {
	
						 }
					  }
				} );
			
			
		}
		
	}
	
	// Promoção
	
	function ParticipaPromocao(id)
	{
		var resposta = gid("promocao_"+id).resposta.value;
		var email = gid("promocao_"+id).email.value;
		var pass = gid("promocao_"+id).senha.value;
		
		
		if( (email == null) || (email == "")) { alert("Informe seu E-mail!"); return false;	}
		if( (pass == null) || (pass == "")) { alert("Informe sua Senha!"); return false;	}
			
			
			//
			var params = "resposta=" + encodeURI(resposta) + "&email=" + encodeURI(email) + "&senha=" + encodeURI(pass) +  "&promo=" + encodeURI(id);
			
			//Destino
					var url = "index.php?module=PromocaoController&action=CadastrarParticipante";

				//Envia os Dados e Pega a Resposta
					submitAjax( url, params, function( resposta ) {

					  if (http_request.readyState == 4) {
						 if (http_request.status == 200) {

							var resp = http_request.responseText;
							
							if ( resp.indexOf("OK") >= 0 )
							{
								alert("[Cidade Web Rock] : Parabéns! Você está participando desta Promoção!\nAguarde o Resultado!");
								gid("promocao_"+id).reset();
								CloseBoxPromocao(id);
							}
							
							if ( resp.indexOf("PARTICIPANDO") >= 0 )
							{
								alert("[Cidade Web Rock] : Você já está participando desta Promoção!");
								gid("promocao_"+id).reset();
							}
							
							if ( resp.indexOf("FALHOU") >= 0 )
							{
								alert("[Cidade Web Rock] : Por favor, verifique seu e-mail e sua senha!");
								gid("promocao_"+id).reset();
							}
							
							

						 } else {

						 }
					  }
				} );
		
	}
	
	// Ganhadores Página Promoções
	
	function ViewGanhadores(){
	var combo = gid("ganhadores");
		window.location="index.php?module=PromocaoController&action=ResultadoPromocao&promo=" + combo.value;
	}
	
	// Outras Bandas

	function VerBanda(){
	var combo = gid("bandas");
		window.location="index.php?module=BandasController&action=VerBanda&Banda=" + combo.value;
	}
	
	// Cidade Apresenta

	function VerCidadeApresenta(){
	var combo = gid("outras_bandas");
		window.location="index.php?module=CidadeApresentaController&Atual=" + combo.value;
	}
	
	// Matérias do Blog
	function MateriasBlog(){
	var combo = gid("materias_id");
	var blogid = gid("blog_id");
		window.location="index.php?module=BlogController&action=Blog&Blog="+ blogid.value +"&Materia=" + combo.value;
	}
	
	// Bandas
	function BandasBordaShow(id){
	var combo = gid("banda_"+id);
		combo.style.border='1px solid #006699';
	}
	
	function BandasBordaHide(id){
	var combo = gid("banda_"+id);
		combo.style.border='1px solid #000000';
	}
	
	//Ondemand
	function displayOndemand( tipo,codigo )
	{
		var abrir_janela = "http://www.cidadewebrock.com.br/player_video_new.php?video="+tipo+"&codigo="+codigo;
		window.open(abrir_janela,'OndemandPlayer','status=no,resizable=no,scrollbars=no,menubar=no,width=530, height=425,left=120,top=120') ;
	}
	
	
	//Verfica Sessao das 10
	function validaFormSessaoDasDez(){
		
		d = document.form_sessao10;
		//Validar Nome
		if (d.nome.value == "")
		{
			alert("[Cidade Web Rock]:\nO campo " + d.nome.name + " deve ser preenchido!"); 
			d.nome.focus();
			return false;
		}
		
		//Validar E-mail
		if (d.email.value == ""){
			alert("[Cidade Web Rock]:\O campo " + d.email.name + " deve ser preenchido!");
			d.email.focus();
			return false;
		}
		
		//Validar telefone(verificacao se contem apenas numeros)
		if ((isNaN(d.ddd.value)) || (d.ddd.value == "")){
			alert("[Cidade Web Rock]:\nO campo " + d.ddd.name + " deve conter apenas numeros!\nSEM ESPAÇOS!!!!");
			d.ddd.focus();
			return false;
		}
		
		if ((isNaN(d.telefone.value)) || (d.telefone.value == "")){
			alert("[Cidade Web Rock]:\nO campo " + d.telefone.name + " deve conter apenas numeros\nSEM ESPAÇOS!!!!");
			d.telefone.focus();
			return false;
		}
		
		if (d.bairro.value == ""){
			alert("[Cidade Web Rock]:\nO campo " + d.bairro.name + " deve ser preenchido!");
			d.bairro.focus();
			return false;
		}
		
		if (d.mensagem.value == ""){
			alert("[Cidade Web Rock]:\nO campo " + d.mensagem.name + " deve ser preenchido!");
			d.mensagem.focus();
			return false;
		}
	
		return true;
	}
	
	function SiteOn() {
		gid('dark_site').style.display='';
			var box_pendrive = gid("box_pendrive");
			box_pendrive.style.display='';
			box_pendrive.style.position='fixed';
			box_pendrive.style.top='10%';
			
			
			//gid("bonecoPendrive").Play();
			
		gid('destaque').style.display='';
		gid('subflash').style.display='';
		
	}
	function SiteOff() {
		gid('dark_site').style.display='none';
				
				var box_pendrive;
				box_pendrive = gid("box_pendrive");
				box_pendrive.style.display='none';
				gid("bonecoPendrive").StopPlay();
		gid('destaque').style.display='';
		gid('subflash').style.display='';
		
	}
	
	function showBoxPerguntaPendrive1024()
	{
		
		var box_pendrive_pergunta = gid("box_pergunta_pendrive");
			if(box_pendrive_pergunta != null){
			box_pendrive_pergunta.style.display='none';
}
		
		var box_pendrive_pergunta_menor = gid("box_pergunta_pendrive_menor");
			if(box_pendrive_pergunta_menor != null){
			box_pendrive_pergunta_menor.style.display='';
		}
			/*var box_pendrive = gid("box_pendrive");
			box_pendrive.style.top='805px';*/
			var box_pendrive = gid("box_pendrive");
			if(box_pendrive != null){
				box_pendrive.style.position='fixed';
				box_pendrive.style.top='10%';
			}

	}
	
	//Box Pendrive Maior 1024
	function showBoxPerguntaPendrive()
	{
		
		var box_pendrive_pergunta = gid("box_pergunta_pendrive");
			if(box_pendrive_pergunta != null){
			box_pendrive_pergunta.style.display='';
			}
		var box_pendrive_pergunta_menor = gid("box_pergunta_pendrive_menor");
			if(box_pendrive_pergunta_menor != null){
			box_pendrive_pergunta_menor.style.display='none';
			}
		var box_pendrive = gid("box_pendrive");
			if(box_pendrive != null){
			box_pendrive.style.position='fixed';
			box_pendrive.style.top='10%';
			}
	}
	function showBoxPendrive()
	{
		SiteOn();
		window.scroll(0,0);
		/*var box_pendrive = gid("box_pendrive");
			box_pendrive.style.display='';
		gid("bonecoPendrive").Play();*/
			
		var box_pendrive_pergunta = gid("box_pergunta_pendrive");
			box_pendrive_pergunta.style.display='none';
		
		
	}
	
	

	function closeBoxPendrive()
	{
		SiteOff();
				/*var box_pendrive;
				box_pendrive = gid("box_pendrive");
				box_pendrive.style.display='none';*/
		//tamanho da tela
		var scr = screen.width
		if(scr > 1024) {
		var box_pendrive_pergunta = gid("box_pergunta_pendrive");
			box_pendrive_pergunta.style.display='';
		}
//		gid("bonecoPendrive").StopPlay();
		
	}
	
	// show Box Indicar
	function showBoxIndicarPromocao( id )
	{
		var box_indicar = gid("box_indicar_promocao");
			box_indicar.style.display='';
			document.FrmPromocaoIndica.idPromoInd.value = id;
	}
	// Close Box Indicar	
	function closeBoxIndicarPromocao( id )
	{
		var box_indicar = gid("box_indicar_promocao");
			box_indicar.style.display='none';
	}
	
	//Valida E Enviar Mensagem de Indicacao
	function ValidaFormIndicarPromocao( id ){
			d = document.FrmPromocaoIndica;
		var nome = document.FrmPromocaoIndica.nome.value;
		var email = document.FrmPromocaoIndica.email.value;
		var para = document.FrmPromocaoIndica.pnome.value;
		var pemail = document.FrmPromocaoIndica.pemail.value;
		var promoc = document.FrmPromocaoIndica.idPromoInd.value;
		
		if (nome == ""){ alert("[Cidade Web Rock]:\nO campo NOME deve ser preenchido!"); d.nome.focus(); return false; }
		if (email == ""){ alert("[Cidade Web Rock]:\nO campo E-MAIL deve ser preenchido!"); d.email.focus(); return false; }
		if (para == ""){ alert("[Cidade Web Rock]:\nO campo (PARA)NOME deve ser preenchido!"); d.pnome.focus(); return false; }
		if (pemail == ""){ alert("[Cidade Web Rock]:\nO campo (PARA)E-MAIL deve ser preenchido!"); d.pemail.focus(); return false; }
		
		
			
				//
					var params = "nome=" + encodeURI(nome) + "&email=" + encodeURI(email) + "&para=" + encodeURI(para) + "&pemail=" + encodeURI(pemail) +  "&promoc=" + encodeURI(promoc);
				//Destino
					var url = "index.php?module=PromocaoController&action=IndicarPromocao";

				//Envia os Dados e Pega a Resposta
					submitAjax( url, params, function( resposta ) {

					  if (http_request.readyState == 4) {
						 if (http_request.status == 200) {

							var resp = http_request.responseText;
						alert(resp);
						document.FrmPromocaoIndica.reset();
						closeBoxIndicarPromocao();
						 } else {
						alert("Erro");
						 }
					  }
				} );


		
	}
	
	//Ondemand Audio
	function metal() { 
		window.open('http://www.cidadewebrock.com.br/player_audio_ondemand.php?audio=metal_01_06_08_parte1.wma&id=229&grupo=72','metal','status=no,resizable=no,scrollbars=no,menubar=no,width=430, height=120,left=120,top=120') ;
	}
	function zerobala() { 
		window.open('http://www.cidadewebrock.com.br/player_audio_ondemand.php?audio=zero_02_06_08_parte1.wma&id=232&grupo=70','zero','status=no,resizable=no,scrollbars=no,menubar=no,width=430, height=120,left=120,top=120') ;
	}
	function beatles() { 
		window.open('http://www.cidadewebrock.com.br/player_audio_ondemand.php?audio=Album_Rock_Beatles_01.wma&id=31&grupo=2','beatles','status=no,resizable=no,scrollbars=no,menubar=no,width=430, height=120,left=120,top=120') ;
	}
	function live() { 
		window.open('http://www.cidadewebrock.com.br/player_audio_ondemand.php?audio=lc_04_06_08_parte1.wma&id=235&grupo=74','live','status=no,resizable=no,scrollbars=no,menubar=no,width=430, height=120,left=120,top=120') ;
	}
	
	// Abre o Player da Cidade Web Rock
	function janela(p_pag, p_width, p_heigth) {
	//alert("Estamos enfrentando problemas técnicos alheios.\nDesculpe pelo transtorno gerado,em breve estaremos retornando com nosso serviço.\nObrigado.");
	
		var desktop = window.open(p_pag,'cidade','scrollbars=no,location=no,directories=no,status=no,resizable=no,copyhistory=no,menubar=no,width='+p_width+',height='+p_heigth);
	}
	
	function get_player_value() {
	
		var banda32 = document.getElementById('fre32');
		var banda64 = document.getElementById('fre64');
		var banda128 = document.getElementById('fre128');
	
		var banda = "";
	
		if (banda32.checked == true) banda = "32";
		if (banda64.checked == true) banda = "64";
		if (banda128.checked == true) banda = "128";
	
		janela("http://www.cidadewebrock.com.br/v3/player.php?banda="+banda,"531","382")	
	
	
	
	}
	
	//Valida Form Pedido Musical
	//Verfica Sessao das 10
	function validaFormMusical(id){
		
		d = document.frmMailForm;
		//Validar Nome
		if (d.nome.value == "")
		{
			alert("[Cidade Web Rock]:\nO campo " + d.nome.name + " deve ser preenchido!"); 
			d.nome.focus();
			return false;
		}

		//Validar E-mail
		if (d.email.value == ""){
			alert("[Cidade Web Rock]:\O campo " + d.email.name + " deve ser preenchido!");
			d.email.focus();
			return false;
		}

		//Validar telefone(verificacao se contem apenas numeros)
		if ((isNaN(d.dddtelefone.value)) || (d.dddtelefone.value == "")){
			alert("[Cidade Web Rock]:\nO campo (DDD) deve conter apenas numeros!");
			d.dddtelefone.focus();
			return false;
		}

		if ((isNaN(d.telefone.value)) || (d.telefone.value == "")){
			alert("[Cidade Web Rock]:\nO campo " + d.telefone.name + " deve conter apenas numeros!");
			d.telefone.focus();
			return false;
		}
		
		//Validar telefone(verificacao se contem apenas numeros)
		if ((isNaN(d.dddcelular.value)) || (d.dddcelular.value == "")){
			alert("[Cidade Web Rock]:\nO campo (DDD) deve conter apenas numeros!");
			d.dddcelular.focus();
			return false;
		}

		if ((isNaN(d.telefone_cel.value)) || (d.telefone_cel.value == "")){
			alert("[Cidade Web Rock]:\nO campo TELEFONE CELULAR deve conter apenas numeros!");
			d.telefone_cel.focus();
			return false;
		}
		
		if (d.estado.value == ""){
			alert("[Cidade Web Rock]:\nO campo " + d.estado.name + " deve ser preenchido!");
			d.estado.focus();
			return false;
		}

		if (d.banda.value == ""){
			alert("[Cidade Web Rock]:\nO campo " + d.banda.name + " deve ser preenchido!");
			d.banda.focus();
			return false;
		}
		
		if (d.musica.value == ""){
			alert("[Cidade Web Rock]:\nO campo " + d.musica.name + " deve ser preenchido!");
			d.musica.focus();
			return false;
		}
		
		if(id == 1){
			if (d.mensagem.value == "")
			{
					alert("[Cidade Web Rock]:\nO campo " + d.mensagem.name + " deve ser preenchido!");
					d.mensagem.focus();
					return false;
			}
		}
		return true;
		
	}
	
	// Bate Papo
	function batepapo_cidade() {
	  var user    = document.chat.user.value;
	  var screen  = 'main';
	  var room    = 190;
	  var chatter = 'user';
	
	  user = escape(user);
	  var URL ='http://inchat.insite.com.br/cgi-bin/inchat/inchat.pl?login=1&user='+user+'&screen='+screen+'&room='+room+'&chatter='+chatter;
	
	
	  window.open(URL,'OpenInchat','resizable=yes,width=790,height=525,top=0,left=0');
	
	  return false;
	}
	
	// Form Sessao das 10
	function showFormSessao(id)
	{
		
		gid("FormSessao").style.display="";
		if(id == 10){ document.form_sessao10.origem_post.value = "zero"; gid("nome_programa_sessao").innerHTML = '<ul><li>ZERO BALA</li></ul>';}
		if(id == 11){ document.form_sessao10.origem_post.value = "vinta"; gid("nome_programa_sessao").innerHTML = '<ul><li>CLASSIC ROCK</li></ul>';}
		if(id == 12){ document.form_sessao10.origem_post.value = "mosh"; gid("nome_programa_sessao").innerHTML = '<ul><li>ROCK BRASIL</li></ul>';}
		if(id == 13){ document.form_sessao10.origem_post.value = "party"; gid("nome_programa_sessao").innerHTML = '<ul><li>ROCK PARTY</li></ul>';}
		if(id == 14){ document.form_sessao10.origem_post.value = "porrada"; gid("nome_programa_sessao").innerHTML = '<ul><li>WEB METAL</li></ul>';}
		if(id == 15){ document.form_sessao10.origem_post.value = "frente"; gid("nome_programa_sessao").innerHTML = '<ul><li>FRENTE</li></ul>'; }
		window.scroll(700,700)
	}
	function closeFormSessao()
	{
		gid("FormSessao").style.display="none";
	}
	function SubSessao10()
	{
	
		var confirmacao = escape(document.form_sessao10.origem_post.value);
		var nome = document.form_sessao10.nome.value;
		var email = document.form_sessao10.email.value;
		var ddd = document.form_sessao10.ddd.value;
		var telefone = document.form_sessao10.telefone.value;
		var bairro = document.form_sessao10.bairro.value;
		var mensagem = document.form_sessao10.mensagem.value;
		
		var identifica ;
		
		 // Verificação Campos 

		if((confirmacao == null) || (confirmacao == "")) { alert("[Cidade Web Rock]:\nEscolha um dos Programas Acima!"); identifica = 1; return false; }
		if((nome == null) || (nome == "")) { alert("[Cidade Web Rock]:\nO campo NOME deve ser preechido!"); identifica = 1; return false; }
		if((email == null) || (email == "")) { alert("[Cidade Web Rock]:\nO campo E-MAIL deve ser preenchido!"); identifica = 1; return false; }
		if((ddd == null) || (ddd == "")) { alert("[Cidade Web Rock]:\nO campo DDD deve ser preenhido!"); identifica = 1; return false; }
		if((telefone == null) || (telefone == "")) { alert("[Cidade Web Rock]:\nO campo TELEFONE deve ser preenhido!"); identifica = 1; return false; }
		if((bairro == null) || (bairro == ""))	{ alert("[Cidade Web Rock]:\nO campo BAIRRO deve ser preenchido!"); identifica = 1; return false; }
		if((mensagem == null) || (mensagem == "")) { alert("[Cidade Web Rock]:\nO campo MENSAGEM deve ser preenchido!"); identifica = 1; return false; }
	
		if(identifica != 1) 

		{
				//
					var params = "nome=" + encodeURI(nome) + "&email=" + encodeURI(email) + "&telefone=" + encodeURI(telefone) + "&ddd=" + encodeURI(ddd) + "&bairro=" + encodeURI(bairro) + "&mensagem=" + encodeURI(mensagem) + "&confirmacao=" + encodeURI(confirmacao);
				//Destino
					var url = "index.php?module=Sessao10Controller&action=EnviarPedidoAjax";

				//Envia os Dados e Pega a Resposta
					submitAjax( url, params, function( resposta ) {

					  if (http_request.readyState == 4) {
						 if (http_request.status == 200) {

							var resp = http_request.responseText;
						alert(resp);
						document.form_sessao10.reset();
						closeFormSessao();
						 } else {

						 }
					  }
				} );


		}

	}
	// PESQUISA GERAL GOOGLE
	function getBuscaAjax(busca) {

		var url = "teste_busca1.php?q="+busca;
		var ajx = new AJAX();
	
		ajx.url = url;
		ajx.modo = 'T';
		document.getElementById("busca_interna").innerHTML = "<div class='loading_ajax' aling=center><img src='images/main/BlackLoading.gif' class='loadin_ajax_img'/></div>";
			ajx.processaresultado = function(r){
				document.getElementById("busca_interna").innerHTML = r;
			}
		ajx.conectar();
	}
	
	function getBuscaGeral(busca) {

		var url = "teste_busca1.php?q="+busca;
		var ajx = new AJAX();

		ajx.url = url;
		ajx.modo = 'T';
		document.getElementById("busca_interna").innerHTML = "<div class='loading_ajax' aling=center><img src='images/main/BlackLoading.gif' class='loadin_ajax_img'/></div>";
			ajx.processaresultado = function(r){
				document.getElementById("busca_interna").innerHTML = r;
			}
		ajx.conectar();
	}
	
	//PAGINAÇÃO PESQUISA GERAL
	function getNextPageBusca(palavra,id)
	{

		var url = "teste_busca1.php?q="+palavra+"&p="+id;
		var ajx = new AJAX();
		gid("titulo_busca").innerHTML = "GERAL";
		ajx.url = url;
		ajx.modo = 'T';
			gid("busca_interna").innerHTML = "<div class='loading_ajax' aling=center><img src='images/main/BlackLoading.gif' class='loadin_ajax_img'/></div>";
			ajx.processaresultado = function(r){
				document.getElementById("busca_interna").innerHTML = r;
			}
		ajx.conectar();
	}

	/*function getOnclickBusca()
	{
		var palavra = gid("keyword").value;
		getBuscaAjax(palavra);
	}*/

	//PESQUISA BANDAS
	function getBandasBusca(palavra,id)
	{
			if(id) { 
				var url = "get_bandas_busca.php?banda="+palavra+"&pagina="+id; 
			}else{ 
				var url = "get_bandas_busca.php?banda="+palavra;  
			}
				gid("titulo_busca").innerHTML = "BANDAS";
				gid("busca_interna").innerHTML = "<div class='loading_ajax' aling=center><img src='images/main/BlackLoading.gif' class='loadin_ajax_img'/></div>";
	
				var ajx = new AJAX();
				ajx.url = url;
				ajx.modo = 'T';
				ajx.processaresultado = function(r){
						document.getElementById("busca_interna").innerHTML = r;
				}
					ajx.conectar();
	}
	
	//PESQUISA LETRAS
	function getLetrasBusca(palavra,id)
	{
		
			if(id) { 
				var url = "get_letras_busca.php?banda="+palavra+"&pagina="+id; 
			}else{ 
				var url = "get_letras_busca.php?banda="+palavra;  
			}
				gid("titulo_busca").innerHTML = "LETRAS";
				gid("busca_interna").innerHTML = "<div class='loading_ajax' aling=center><img src='images/main/BlackLoading.gif' class='loadin_ajax_img'/></div>";
				var ajx = new AJAX();
				ajx.url = url;
				ajx.modo = 'T';
				ajx.processaresultado = function(r){
						document.getElementById("busca_interna").innerHTML = r;
						//fadeIn('galeria_selecionada',0.5);
					}
					ajx.conectar();
	}
	
	//PESQUISA NOTAS
	function getNotasBusca(palavra,id)
	{
			if(id) { 
				var url = "get_notas_busca.php?pesquisa="+palavra+"&pagina="+id; 
			}else{ 
				var url = "get_notas_busca.php?pesquisa="+palavra;  
			}
				gid("titulo_busca").innerHTML = "NOTAS MUSICAIS";
				gid("busca_interna").innerHTML = "<div class='loading_ajax' aling=center><img src='images/main/BlackLoading.gif' class='loadin_ajax_img'/></div>";
				var ajx = new AJAX();
				ajx.url = url;
				ajx.modo = 'T';
				ajx.processaresultado = function(r){
						document.getElementById("busca_interna").innerHTML = r;
						//fadeIn('galeria_selecionada',0.5);
					}
					ajx.conectar();
	}
	
	//PESQUISA NOTAS
	function getEntrevistaBusca(palavra,id)
	{
			if(id) { 
				var url = "get_entrevista_busca.php?pesquisa="+palavra+"&pagina="+id; 
			}else{ 
				var url = "get_entrevista_busca.php?pesquisa="+palavra;  
			}
				gid("titulo_busca").innerHTML = "ENTREVISTA";
				gid("busca_interna").innerHTML = "<div class='loading_ajax' aling=center><img src='images/main/BlackLoading.gif' class='loadin_ajax_img'/></div>";
				var ajx = new AJAX();
				ajx.url = url;
				ajx.modo = 'T';
				ajx.processaresultado = function(r){
						document.getElementById("busca_interna").innerHTML = r;
						//fadeIn('galeria_selecionada',0.5);
					}
					ajx.conectar();
	}

	//BUTÃO DE GET PESQUISA
	function get_pesquisa() {
		
		var pesquisaBandas = document.getElementById('pesquisaBandas');
		var pesquisaNotas = document.getElementById('pesquisaNotas');
		var pesquisaLetras = document.getElementById('pesquisaLetras');
		var pesquisaEntrevista = document.getElementById('pesquisaEntrevista');
		var palavra = gid("palavra_pesquisa").value;
		
		var retorno = "";
		
		if (pesquisaBandas.checked == true) { getBandasBusca(palavra,0); }
		if (pesquisaNotas.checked == true) { getNotasBusca(palavra,0); }
		if (pesquisaLetras.checked == true) { getLetrasBusca(palavra,0); };
		if (pesquisaEntrevista.checked == true) { getEntrevistaBusca(palavra,0); };
		gid("busca_home").style.display="none";
		/*
		var pesquisaGeral = document.getElementById('pesquisaGeral');
		if (pesquisaGeral.checked == true) { getBuscaGeral(palavra); };
		*/
		
	}
	
	