function mudar_pagina(pg) {

	window.location.href = "?pg="+ pg;

}

function flash(width,height,wmode,movie,color,classe) {

    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" class="'+classe+'">');

    document.write('<param name="wmode" value="'+wmode+'"/>');

    document.write('<param name="quality" value="high"/>');

    document.write('<param name="movie" value="'+movie+'"/>');

    document.write('<param name="bgcolor" value="'+color+'"/>');

    document.write('<embed src="'+movie+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="'+wmode+'" width="'+width+'" height="'+height+'"></embed>');

    document.write('</object>');

}

/* BANNERS */

function expandSelo(altura)

{

	document.getElementById("selo").style.height = altura+"px";

}



function contractSelo()

{

	document.getElementById("selo").style.height = "60px";

}

/* BANNER FINAL */



//FUNÇÃO FORMATO PADRÃO PRÉ-DEFINIDO EM FORMS

function mascara(src, mask) 

{

  var i = src.value.length;

  var saida = mask.substring(0,1);

  var texto = mask.substring(i)

if (texto.substring(0,1) != saida) 

  {

	src.value += texto.substring(0,1);

  }

}



// FUNÇÃO ADICIONAR AOS FAVORITOS

function favoritos(){

var url="http://www.jericoacoaraturismo.com.br";

var titulo="Jericoacoara Turismo - Guia de Turismo e Lazer de Jericoacoara";

if (document.all) window.external.AddFavorite(url, titulo);

}



// JANELA IDICAR AMIGO

function indica(url) {

  window.open(url,'indica','width=448, height=218, top=12, left=15, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')

}



//Função Centraliza POPUP

function  centerpopup(url,nome,altura,largura){ 



   var minimo = screen.width/4;  



   var maximo = screen.height - 100;



  var w = ( ( ( (largura>minimo)? largura:minimo )<maximo )?largura:maximo); 



  var h = ( ( ( ( altura>minimo )? altura:minimo )<maximo )?altura:maximo); 



  var l = (screen.width/2) - w/2; 



  var t = (screen.height/2) - h/2;



  var argumentos = 'copyhistory=yes,width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=yes,screenX='+l+',screenY='+t; 



  var novajan = window.open(url,nome, argumentos); 



}



// FUNÇÃO GUIA RÁPIDO

function opendrop()

{

window.open('guiacidade/janela.php?id='+document.getElementById('drop').value)

}



// FUNÇÃO GUIA RÁPIDO2

function opendrop2()

{

window.open('guiacidade/janela.php?id='+document.getElementById('drop2').value)

}



//FUNCÕES DAS NOTÍCIAS

function TextoTamanho (elem, acao)

  {

      // tamanho inicial da fonte (em px)

      var tamInic = 12;

      

      // Tamanho mínimo da fonte (em px)

      var tamMin = 10;

      

      // Tamanho máximo da fonte (em px)

      var tamMax = 22;



      // Pega o tamanho da fonte. Se não foi setada ainda (primeira vez

      // que a função é executada) terá como tamanho padrão 'tamInic'.

      if (document.getElementById(elem).style.fontSize == "") 

        var tamFonte = tamInic;

      else

        var tamFonte = parseInt(document.getElementById(elem).style.fontSize);

      switch (acao)

      {

        // Aumenta o tamanho, enquanto foi menor que 'tamMax'

        case '+':

          if (tamFonte < tamMax)

            document.getElementById(elem).style.fontSize = (tamFonte + 2) + "px";

        break;

        

        // Diminui o tamanbo, enquanto for maior que 'tamMin'

        case '-':

          if (tamFonte > tamMin)

            document.getElementById(elem).style.fontSize = (tamFonte - 2) + "px";

        break;

      }

  }

  function Mostra_div(id)

{

	if (!document.getElementById(id).style.display)

	{

		document.getElementById(id).style.display = 'none';

	}

	else

	{

		document.getElementById(id).style.display = '';

	}

}



function enviardados(){ 



if(document.dados.nome_amigo.value=="" || document.dados.nome_amigo.value.length < 8) 

{ 

alert( "Preencha seu nome!" ); 

document.dados.nome_amigo.focus(); 

return false; 

} 





if( document.dados.email_amigo.value=="" || document.dados.email_amigo.value.indexOf('@')==-1 || document.dados.email_amigo.value.indexOf('.')==-1 ) 

{ 

alert( "Preencha campo E-MAIL corretamente!" ); 

document.dados.email_amigo.focus(); 

return false; 

} 



if(document.dados.nome_invite.value=="" || document.dados.nome_invite.value.length < 8) 

{ 

alert( "Preencha seu nome!" ); 

document.dados.nome_invite.focus(); 

return false; 

} 



if( document.dados.email_invite.value=="" || document.dados.email_invite.value.indexOf('@')==-1 || document.dados.email_amigo.value.indexOf('.')==-1 ) 

{ 

alert( "Preencha campo E-MAIL de seu amigo corretamente!" ); 

document.dados.email_invite.focus(); 

return false; 

} 

return true; 

}



//Valida Formulário Classificados

function validar(theForm) {

if (theForm.nome.value == "")

{

  alert("Digite seu nome!");

  theForm.nome.focus();

  return (false);

}

if (theForm.email.value == "")

{

  alert("Digite seu e-mail!");

  theForm.email.focus();

  return (false);

}

if (theForm.telefone.value == "")

{

  alert("Digite seu telefone!");

  theForm.telefone.focus();

  return (false);

}

if (theForm.produto.value == "")

{

  alert("Digite seu produto!");

  theForm.produto.focus();

  return (false);

}

if (theForm.preco.value == "")

{

  alert("Digite o preço!");

  theForm.preco.focus();

  return (false);

}

if (theForm.descricao.value == "")

{

  alert("Digite uma descrição!");

  theForm.descricao.focus();

  return (false);

}

return (true);

}





// Validar formulário contato

function validate(theForm) {

if (theForm.nome.value == "")

{

   alert("Digite seu Nome!");

   theForm.nome.focus();

   return (false);

}


if (theForm.assunto.value == "")

{

   alert("Escolha o assunto!");

   theForm.assunto.focus();

   return (false);

}

if (theForm.email.value == "")

{

   alert("Digite seu E-mail!");

   theForm.email.focus();

   return (false);

}

if (theForm.cidade.value == "")

{

   alert("Digite a Cidade onde você Mora!");

   theForm.cidade.focus();

   return (false);

}

if (theForm.estado.value == "")

{

   alert("Selecione o estado onde você Mora!");

   theForm.estado.focus();

   return (false);

}

if (theForm.telefone.value == "")

{

   alert("Digite seu Telefone!");

   theForm.telefone.focus();

   return (false);

}

return (true);

}



//TO NO SITE

function validate2(theForm) {

if (theForm.nome.value == "")

{

   alert("Digite seu Nome!");

   theForm.nome.focus();

   return (false);

}

if (theForm.email.value == "")

{

   alert("Digite seu E-mail!");

   theForm.email.focus();

   return (false);

}

if (theForm.cidade.value == "")

{

   alert("Digite a Cidade onde você Mora!");

   theForm.cidade.focus();

   return (false);

}

if (theForm.estado.value == "")

{

   alert("Selecione o estado onde você Mora!");

   theForm.estado.focus();

   return (false);

}

if (theForm.imagem.value == "")

{

   alert("Selecione sua foto");

   theForm.imagem.focus();

   return (false);

}

return (true);

}
