/****************************************************************************************************************/
// DIREITOS AUTORAIS
/****************************************************************************************************************/
if (!desproteger) {
	// ESTA FUNÇÃO BLOQUEIA O BOTÃO DIREITO DO MOUSE
	var ns = ((document.getElementById || document.layers) && (!document.all))? true:false;
	var ie = (document.all)? true:false;
	//var msg="O conteúdo deste site é protegido pela LEI DE DIREITOS AUTORAIS.\nNão é permitido qualquer reprodução do conteúdo sem a prévia\nautorização da PANROTAS Editora Ltda.";
	var msg="# # # # # # # # # # # # # # # A T E N Ç Ã O  # # # # # # # # # # # # # # #\n\n                  O CONTEÚDO DESTE SITE É PROTEGIDO PELA LEI DE DIREITOS AUTORAIS.\n\nO uso das informações requer o crédito à PANROTAS ou autorização da editora para fins especiais."
	if (ns) document.captureEvents(Event.MOUSEDOWN || Event.CLICK);
	document.onclick = sourcecodeprotect;
	document.onmousedown = sourcecodeprotect;

	// ESTA FUNÇÃO BLOQUEIA CTRL + C a CTRL + A
	if ((document.getElementById || document.layers) && (!document.all))
	{
		document.onkeypress = function (evt) {
		var r = '';
		var ctrl = 0;
	    
		if (document.getElementById && (!document.all)) {
			ctrl = evt.ctrlKey;
			}
		else
			if (document.layers) {
				ctrl = Event.CONTROL_MASK;
			} 
			r = String.fromCharCode(evt.which).toUpperCase();    
			if (ctrl){
    			if (r=='A'||r=='C'){
  				alert(msg);
  				return false;
  				}
  			}
		}
	}
}
else {
    var msg="";
}

// ***********************************************************
function sourcecodeprotect(e) {
  if (ns&&(e.which==3)) {
        alert(msg);
        return false;
  }
  else 
    if (ie&&(window.event.button==2)) 
        alert(msg);
  else 
    return true;
}

function direitoAutorais() {
    if (msg!='') {
        alert(msg);
        //Limpa os dados copiados
        //event.returnValue=false;
    }
}

/****************************************************************************************************************/
// FIM DAS FUNÇÕES DE DIREITOS AUTORAIS
/****************************************************************************************************************/

/****************************************************************************************************************/
// TIPO_DADOS - Analise os dados digitados
// PARAMETROS
//			obj_input - Campo a ser analiasado (OBJETO)
//			tipo - O tipo de análise
//			features - Se o retorno da função será em:
//						+ Caixa Alta [U]
//						+ Caixa Baixa [L]
//						+ Não exibe mensagens de alerta [N]
//						+ Desativa features []
/****************************************************************************************************************/

/* Determina os dados do campo */
function tipo_dados(obj_input,tipo,features) {
	
	/*Vamos verificar se o campo esta vazio */
	if (obj_input.value=="") { return true };
			
	/* Vamos atribuir o value a uma string */
	string = obj_input.value;
			
	myString = new String( obj_input.value)
			
	switch (tipo){
		case "AN":
			var valid="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
			break;
		case "AN*":
			var valid="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@-_.";
			break;
		case "N":
			var valid="1234567890";
			break;
		case "D":
			var valid="1234567890/";
			break;
		case "H":
			var valid="1234567890:";
			break;
		case "A":
			var valid="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
			break;
		case "A+":
			var valid="abcdefghijklmnopqrstuvwxyzáàãâéèêíóôõúùçABCDEFGHIJKLMNOPQRSTUVWXYZÁÀÃÂÉÈÊÍÓÔÕÚÙÇ ";
			break;
		case "A+N":
			var valid="abcdefghijklmnopqrstuvwxyzáàãâéèêíóôõúùçABCDEFGHIJKLMNOPQRSTUVWXYZÁÀÃÂÉÈÊÍÓÔÕÚÙÇ 1234567890";
			break;
		case "C": /*Moeda*/
			var valid="1234567890.";
			break;
		case "DI": /*Distância*/
			var valid="1234567890,";
			break;
		case "P": /*Porcentagem*/
			var valid="1234567890.";
			break;
		case "AN+":
			var valid="1234567890abcdefghijklmnopqrstuvwxyzáàãâéèêíóôõúùçABCDEFGHIJKLMNOPQRSTUVWXYZÁÀÃÂÉÈÊÍÓÔÕÚÙÇ!@#$%&*()-+={}[]?/:;<>,.\| "
			break;
		case "T":
			/*TELEFONE*/
			var valid="1234567890-()";
			break;
		case "CE":
			/*CEP*/
			var valid="1234567890-";
			break;
	}
	
    for (var i=0; i<myString.length; i++) {
        if (valid.indexOf(string.charAt(i)) < 0) {
			
			/*Vamos verificar se devemos exibir a mensagem*/
			if (features !='N') {
			
				/*Vamos escolher a mensagem para o usuário*/
				switch (tipo){
					case "AN":
						alert("Utilize apenas números e letras sem acentuação.");
						obj_input.focus();
						break;
					case "AN*":
						alert("Utilize apenas números, letras sem acentuação e os símbolos _  @  .  - ");
						obj_input.focus();
						break;
					case "N":
						alert("Utilize apenas números.");
						obj_input.focus();
						break;
					case "D":
						alert("A data informada não é valida. Utilize o formato dd/mm/aaaa.");
						obj_input.focus();
						break;
					case "H":
						alert("Utilize o formato hh:mm");
						obj_input.focus();
						break;
					case "A":
						alert("Utilize apenas letras sem acentuação.");
						obj_input.focus();
						break;
					case "A+":
						alert("Utilize apenas letras.");
						obj_input.focus();
						break;
					case "A+N":
						alert("Utilize apenas letras e números.");
						obj_input.focus();
						break;
					case "C":
						alert("Utilize apenas números e pontos para separar as casas decimais.");
						obj_input.focus();
						break;
					case "DI":
						alert("Utilize apenas números e vírgula para separar as casas decimais.");
						obj_input.focus();
						break;
					case "P":
						alert("Utilize apenas números e pontos para separar as casas decimais.");
						obj_input.focus();
						break;
					case "AN+":
						alert("Utilize apenas os caracteres convencionais de seu teclado, letras e números.");
						obj_input.focus();
						break;
					case "T":
						/*TELEFONE*/
						alert("Utilize apenas os números e os caracteres - ( ).\nEx.(11)2764-4800");
						obj_input.focus();
						break;
					case "CE":
						/*CEP*/
						alert("Utilize apenas os números e o traço.");
						obj_input.focus();
						break;
				}
			}
			
			/*Vamos notificar que a string não passou pelo teste*/
            return false;
        }
    }
			
	/* Vamos arredondar se for tipo C
	if (tipo=="C" && obj_input.value!="") {
		obj_input.value =	round_money(obj_input.value);
		}
	else if (tipo=="P"){
		obj_input.value =	centavos(obj_input.value);
	}*/
	
	/*Vamos tratar as excessões*/
	switch (tipo) {
		case "C":
			if (obj_input.value!="") {
				obj_input.value =	round_money(obj_input.value);
			}
			break;
			
		case "P":
			obj_input.value =	centavos(obj_input.value);
			
		case "D":
			/*Vamos verificar se e uma data válida*/
			split_mtx = obj_input.value.split("/");
			if (obj_input.value.length>10 || obj_input.value.length<8) {
				alert("A data informada não é valida. Utilize o formado dd/mm/aaaa.");
				obj_input.focus();
			}
			else {
				if (!isDate(split_mtx[0],split_mtx[1],split_mtx[2])) {
					alert("A data informada não é valida. Utilize o formado dd/mm/aaaa.");
					obj_input.focus();
				}
				break;
			}
	}
	
	/*Vamos converter o value em caixa alta */
	switch (features.toUpperCase()) {
		case "U":
			obj_input.value = trim(obj_input.value.toUpperCase());
			break;
		case "L":
			obj_input.value = trim(obj_input.value.toLowerCase());
			break;
		default:
			obj_input.value = trim(obj_input.value);
	};

	return true;
}

/* Vamos arredondar o financeiro*/
function round_money(num) {
    return centavos(Math.round(num));
    /*return centavos(Math.round(num*Math.pow(10,X))/Math.pow(10,X));*/
}

/*Arredondar números*/
function round(number,X) {
// rounds number to X decimal places, defaults to 2
    X = (!X ? 0 : X);
    return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}

		
/* Vamos formatar o númro para .00 */
function centavos(valor) {
    valor -= 0;
    return (valor == Math.floor(valor)) ? valor + '.00' : (  (valor*10 == Math.floor(valor*10)) ? valor + '0' : valor);
}

function trim(strText) { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
} 

/********************************************************
/ Valida o e-mail digitado. 
/ Retorn VERDADEIRO ou FALSO
*********************************************************/
function isemail(string) {
   if (!string) return false;
   if (string=='') return false;
   var iChars = "*|,\":<>[]{}`\';()&$#%";
   var chk=0;
   
   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1) {
         return false;}
      
      if (string.charAt(i)=="@" || string.charAt(i)==".") {
		chk++;}
   }

   if (chk>=2) {
	return true;
	}
   else {
	return false;
	}
}      

/* Valida a data digitada*/
function y2k(number) { return (number < 1000) ? number + 1900 : number; }

function isDate (day,month,year) {
    var today = new Date();
    year = ((!year) ? y2k(today.getYear()):year);
    month = ((!month) ? today.getMonth():month-1);
    if (!day) return false
    var test = new Date(year,month,day);
    if ( (y2k(test.getYear()) == year) &&
         (month == test.getMonth()) &&
         (day == test.getDate()) )
        return true;
    else
        return false
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*  CALCULA A DIFERENÇA ENTRE 2 DATAS                                             */
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function daysElapsed(date1,date2) {
    var difference = Date.UTC(y2k(date1.getYear()),date1.getMonth(),date1.getDate(),0,0,0)- Date.UTC(y2k(date2.getYear()),date2.getMonth(),date2.getDate(),0,0,0);
    return difference/1000/60/60/24;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

function facilita_entrada_data(obj){
	if (obj.value.length==2 || obj.value.length==5) {
		if (window.event.keyCode==8 || window.event.keyCode==46  || window.event.keyCode==16  || window.event.keyCode==17  || window.event.keyCode==18) 
			{
			}
		else {
			if (window.event.keyCode!=193 && window.event.keyCode!=111) { //Cod Asc de "/"
				obj.value = obj.value + "/"
			}
			else {
				/*Vamos verificar se o dia ou o mês te 2 digitos*/
				mtx_split = obj.value.split("/");
				if (mtx_split[0].length<2) {
					mtx_split[0] = "0" + mtx_split[0];
				}
				if (mtx_split.length>1) {
					if (mtx_split[1].length<2) {
						mtx_split[1] = "0" + mtx_split[1];
					}
				}
			}
		}
	}
}

function facilita_entrada_hora(obj){
	if (obj.value.length==2) {
		if (window.event.keyCode==8 || window.event.keyCode==46  || window.event.keyCode==16  || window.event.keyCode==17  || window.event.keyCode==18) 
			{
			}
		else {
			if (window.event.keyCode!=191) { //Cod Asc de ":"
				obj.value = obj.value + ":"
			}
			else {
				obj.value = obj.value
			}
		}
	}
}


/*Verifica o total de caracteres digitados */
/* e alerta quando passa do limite definido*/
/* função testada no evento onKeyUP do obj */
function qtdcar(obj,limite){
	if ((obj.value.length+1)>limite+1)
	{
		alert("Você pode digitar no máximo 400 caracteres neste campo");
		obj.value=obj.value.substr(0,obj.value.length-1);
	}
}

function qtdcar_plus(obj,obj_conta,limite){
	if ((obj.value.length+1)>limite)
	{
		alert("Seu comentário deve ter no máximo " + (limite-1) + " caracteres");
		obj.value=obj.value.substr(0,limite-1);
	}
	obj_conta.value = obj.value.length;
}

/**************************************************************
IsNumeric: Returns a Boolean (true) if the Number is validated as a 
**************************************************************/
function IsNumeric(sText)
{
   var ValidChars = "0123456789,";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

/**************************************************************
IsTime: Returns a Boolean (true) if the Time is validated as a 
Time Format, false is not
Parameters:
strTime: String Time in following formats:
		hh:mm:ss tt - 3:48:01 PM
		hh:mm tt- 3:48 PM
		hh:mm- 15:48
Returns: Boolean
***************************************************************/
function IsTime(strTime) {
	var strTime1 = /^(\d{1,2})(\:)(\d{2})\2(\d{2})(\ )\w[AM|PM|am|pm]$/;
	var strTime2 = /^(\d{1,2})(\:)(\d{2})(\ )\w[A|P|a|p]\w[M|m]$/;
	var strTime3 = /^(\d{1,2})(\:)(\d{1,2})$/;
    	
	var strFormat1 = strTime.match(strTime1);
	var strFormat2 = strTime.match(strTime2);
	var strFormat3 = strTime.match(strTime3);
// Check to see if it matches one of the 3 Format Strings.


    	if (strFormat1 == null && strFormat2 == null && strFormat3 == null) {
    		return false;
    	}


        	else if (strFormat1 != null) {
        		// Validate for this format: 3:48:01 PM


            		if (strFormat1[1] > 12 || strFormat1[1] < 00) {
            			return false;
            		}


                		if (strFormat1[3] > 59 || strFormat1[3] < 00) {
                			return false;	
                		}


                    		if (strFormat1[4] > 59 || strFormat1[4] < 00) {
                    			return false;	
                    		}
                    	}


                        	else if (strFormat2 != null) {
                        		// Validate for this format: 3:48 PM


                            		if (strFormat2[1] > 12 || strFormat2[1] < 00) {
                            			return false;
                            		}


                                		if (strFormat2[3] > 59 || strFormat2[3] < 00) {
                                			return false;	
                                		}
                                	}


                                    	else if (strFormat3 != null) {
                                    		// Validate for this format: 15:48


                                        		if (strFormat3[1] > 23 || strFormat3[1] < 00) {
                                        			return false;
                                        		}


                                            		if (strFormat3[3] > 59 || strFormat3[3] < 00) {
                                            			return false;	
                                            		}
                                            	}
                                            	return true;
	}


/***************************************************************************************************************/
// Utiliza a função IsTime para exibir uma mensagem de erro ao usuário
function valida_hora(obj) {
	if (!IsTime(obj.value)) {
		alert("A hora digitada é inválida");
		obj.focus();
		return false;
	}
}

/****************************************************************************************************************/
//Adiciona dias em uma data
function addDays(myDate,days) {
    data_alt = new Date(myDate.getTime() + days*24*60*60*1000);
    return data_alt.getDate()+'/'+(data_alt.getMonth()+1)+'/'+data_alt.getFullYear();
}

/****************************************************************************************************************/
//Compara duas datas e se a primeira for maior que a segunda retorna FALSE
//myDate1 - dd/mm/aaaa, myTime1 - hh:mm
function compara_datas(myDate1,myTime1,myDate2,myTime2) {
	if (myDate1=="" || myDate2=="" || myTime1=="" || myTime2=="") {
		return false;
	}
	
	//Vamos separar os argumentos
	segDate1 = myDate1.split("/")
	segTime1 = myTime1.split(":")
	segDate2 = myDate2.split("/")
	segTime2 = myTime2.split(":")
	
	var DateComp1 = new Date(segDate1[2],segDate1[1]-1,segDate1[0],segTime1[0],segTime1[1],0);
	var DateComp2 = new Date(segDate2[2],segDate2[1]-1,segDate2[0],segTime2[0],segTime2[1],0);
	
	if (DateComp1<DateComp2) {
		return true;
	}
	else {
		return false;
	}
	
}

/****************************************************************************************************************/
//Exibe o cabeçalho de data ATUAL no formato (<semana>, <dia atual> de <mês atual> de <ano atual>)
//Esta função foi utilizada na home do site
//CABECALHO

function mostra_data(show_link,icon) {
	var hoje = new Date();
	var semana=new Array("Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado")
	var mes=new Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro")
	if (!show_link) {
		document.write(semana[hoje.getDay()]+', '+ hoje.getDate() + ' de ' + mes[hoje.getMonth()]+ ' de ' + hoje.getFullYear());
	}
	else {
		document.write(semana[hoje.getDay()]+', '+ hoje.getDate() + ' de ' + mes[hoje.getMonth()]+ ' de ' + hoje.getFullYear()+' <a href="javascript:show_calendar();"><img alt="Calendário" src=' + icon + '></A>');
	}
}

/****************************************************************************************************************/
//Exibe o cabeçalho de data no formato (<semana>, <dia atual> de <mês atual> de <ano atual>, <hora>h<minuto>)

function formata_data(ano,mes,dia,hora,min,seg) {
	if (ano=="" || mes=="" || dia=="" || hora=="" || min=="" || seg=="") {
		return;
	}
	var data_cab = new Date(ano,mes-1,dia,hora,min,seg);
	var minutes = data_cab.getMinutes();
	var hours = data_cab.getHours();
	var semana=new Array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado");
	var mes=new Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro");
	if (minutes<=9) {
		minutes="0"+data_cab.getMinutes();
	}
	if (hours<=9) {
		hours="0"+data_cab.getHours();
	}
	document.write(semana[data_cab.getDay()]+', '+ data_cab.getDate() + ' de ' + mes[data_cab.getMonth()]+ ' de ' + data_cab.getYear() + " - " + hours + 'h' + data_cab.getMinutes());
}

/****************************************************************************************************************/
//Formata o dia da semana para texto português
function formata_dia_semana(ano,mes,dia) {
	if (ano=="" || mes=="" || dia=="") {
		return;
	}
	var semana=new Array("Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado");
	var data_cab = new Date(ano,mes,dia,0,0,0);
	document.write(semana[data_cab.getDay()]);
}

/****************************************************************************************************************/
// Abre a janela de impresão do browser
function PrintPage() {
  if (window.print)	{
    window.print();
    window.close();
    }
  else
    alert("O script não conseguiu enviar o documento diretamente para impressão,\nPressione Ctrl+P ou selecione Imprimir no menu Arquivo para imprimir esta página.");
}

/****************************************************************************************************************/
// Abre a janela de impresão FUNÇÃO PARA O SITE
function abre_impressao(page) {
	/*Vamos verificar se a janela já foi criada*/
	if (!window.win_print) {
		win_print = window.open(page,'win_impressao','scrollbars=yes,status=no,toolbar=no,menubar=no,resizable=no,width=600,height=400,left='+((screen.width-600)/2)+',top='+((screen.height-400)/2))
		win_print.focus();
	}
	else {
		/*Vamos verifica se a janela ainda esta aberta*/
		if (!win_print.closed) {
			win_print.focus();
		}
		else {
			win_print = window.open(page,'win_impressao','scrollbars=yes,status=no,toolbar=yes,menubar=yes,resizable=no,width=600,height=400,left='+((screen.width-600)/2)+',top='+((screen.height-400)/2))
			win_print.focus();
		}
	}
			
}

/****************************************************************************************************************/
// VALIDA A PESQUISA GERAL DO SITE
function valida_busca_geral(obj) {
	var txt_pesq = new String(obj.txt_busca.value);
	
	if (trim(txt_pesq)!='') {
		
		if (tipo_dados(obj.txt_busca,'AN+','')) {
			
			if (txt_pesq.length<3) {
				alert('Digite pelo menos 3 caracteres no campos de pesquisa.')
				obj.txt_busca.focus();
			}
			else {
				obj.submit();
			}
		}
			
	}
	else {
		alert('Preencha o campo com o texto que deseja localizar.')
		obj.txt_busca.value='';
		obj.txt_busca.focus();
	}
}

/****************************************************************************************************************/
// ESTA FUNÇÃO PERMITE O USUÁRIO INFORMAR ERROS NAS PÁGINAS ATRAVÉS DE SEU GERENCIADOR DE E-MAIL
// A FUNÇÃO CRIA AUTOMATICAMENTE O LINK NA PAGINA ONDE FOR UTILIZADA
/****************************************************************************************************************/
function informa_erro() {
	document.write ("<a href='mailto:informa.erro@panrotas.com.br?subject=Informar%20erro:%20" + escape(location.href)+ "&body=Caro Usuário,%0D%0A%0D%0AAgradecemos sua colaboração.%0D%0A%0D%0APara melhor atendê-lo preencha os campos abaixo:%0D%0A--------------------------------------------------------------------%0D%0ANome:%0D%0ADDD/Telefone:%0D%0A--------------------------------------------------------------------%0D%0ADESCRIÇÃO DO PROBLEMA ENCONTRADO:%0D%0A%0D%0A%0D%0AObrigado,%0D%0A%0D%0AEquipe PANROTAS' title='Ajude-nos a melhorar o conteúdo do Portal.'><IMG src='/images/icon_info_erro.gif' style='border:none;vertical-align:middle;height:14px;width:16px;'>&nbsp;INFORMAR ERRO</a>&nbsp;&nbsp;")
	document.write ("<a href='mailto:sugestoes@panrotas.com.br?subject=Sugestao:" + escape(location.href)+ "&body=Caro Usuário,%0D%0A%0D%0AAgradecemos sua colaboração.%0D%0A%0D%0APara melhor atendê-lo preencha os campos abaixo:%0D%0A--------------------------------------------------------------------%0D%0ANome:%0D%0ADDD/Telefone:%0D%0A--------------------------------------------------------------------%0D%0ASUA SUGESTÃO:%0D%0A%0D%0A%0D%0AObrigado,%0D%0A%0D%0AEquipe PANROTAS' title='Ajude-nos a melhorar o conteúdo do Portal.'><IMG src='/images/icon_info_sugestao.gif' style='border:none;vertical-align:middle;height:14px;width:16px;'>&nbsp;SUGESTÕES</a>&nbsp;&nbsp;")
	document.write ("<a href='mailto:duvidas@panrotas.com.br?subject=Duvida:" + escape(location.href)+ "&body=Caro Usuário,%0D%0A%0D%0AAgradecemos sua colaboração.%0D%0A%0D%0APara melhor atendê-lo preencha os campos abaixo:%0D%0A--------------------------------------------------------------------%0D%0ANome:%0D%0ADDD/Telefone:%0D%0A--------------------------------------------------------------------%0D%0ASUA DÚVIDA:%0D%0A%0D%0A%0D%0AObrigado,%0D%0A%0D%0AEquipe PANROTAS' title='Ajude-nos a melhorar o conteúdo do Portal.'><IMG src='/images/icon_info_duvida.gif' style='border:none;vertical-align:middle;height:14px;width:16px;'>&nbsp;DÚVIDAS</a>")
}

function informa_erro_botao() {
	document.location.assign("mailto:informa.erro@panrotas.com.br?subject=Informar%20erro:%20" + escape(location.href)+ "&body=Agradecemos sua colaboração. Digite neste espaço a descrição do problema encontrado.");
}

/****************************************************************************************************************/
// ESTA FUNÇÃO PERMITE DAR SUBMIT EM UM FORM QUANDO PRESSIONAMOS A TECLA ENTER EM UM DETERMINADO CAMPO
/****************************************************************************************************************/
function checkEnter(event,obj_func)
{ 	
	NS4 = (document.layers) ? true : false;	
	
	var code = 0;
	
	if (NS4)
		code = event.which;
	else
		code = event.keyCode;
	if (code==13)
		eval(obj_func);
}

/****************************************************************************************************************/
// ESTA FUNÇÃO ABRE UMA JANELA COM A ÁRVORE HIERÁRQUICA DE LOCALIDADE INFORMADA POR ID OU CÓDIGO IATA
/****************************************************************************************************************/
function abre_local(cod_loc,texto,col,lin) {
	/*Vamos identificar o navegador do usuário*/
	var nav = new Is();
	var fator_c=0, fator_l=0;
	if (nav.opera) {
		//Fatores de correção
		fator_l=0; 
		fator_c=5;
	} 
	else if (nav.firefox) {
		//Fatores de correção
		fator_l=0; 
		fator_c=5;
	}
	
	/*Definicao Coluna e Linha*/
	col = col+fator_c
	lin = lin+fator_l
	
	/*Vamos verificar se a janela já foi criada*/
	if (!window.win_local) {
		win_local = window.open('/guia/canais/servicos/localidades/estrutura_geo_reduzida.asp?cod_loc='+cod_loc+'&texto='+texto,'win_localidade','scrollbars=auto,status=no,toolbar=no,menubar=no,resizable=no,width='+col+',height='+lin+',left='+((screen.width-col)/2)+',top='+((screen.height-lin)/2))
		win_local.focus();
	}
	else {
		win_local = window.open('/guia/canais/servicos/localidades/estrutura_geo_reduzida.asp?cod_loc='+cod_loc+'&texto='+texto,'win_localidade','scrollbars=auto,status=no,toolbar=no,menubar=no,resizable=no,width='+col+',height='+lin+',left='+((screen.width-col)/2)+',top='+((screen.height-lin)/2))
		win_local.focus();
	}
}


/****************************************************************************************************************/
// ABRE A JANELA DO ÁLBUM DE FOTOS
/****************************************************************************************************************/
function abre_album(cod_alb) {
	/*Vamos verificar se a janela já foi criada*/
	if (!window.win_album) {
		win_album = window.open('/guia/canais/redacao/noticias/album/modelo_album/padrao_not/default.asp?cod_alb='+cod_alb,'win_album_coment','scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no,width=534,height=479,left='+((screen.width-534)/2)+',top='+((screen.height-479)/2))
		win_album.focus();
	}
	else {
		/*Vamos verifica se a janela ainda esta aberta*/
		if (!win_album.closed) {
			win_album.focus();
		}
		else {
			win_album = window.open('/guia/canais/redacao/noticias/album/modelo_album/padrao_not/default.asp?cod_alb='+cod_alb,'win_album_coment','scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no,width=534,height=479,left='+((screen.width-534)/2)+',top='+((screen.height-479)/2))
			win_album.focus();
		}
	}
			
}

/****************************************************************************************************************/
// CONTROLA EXIBIÇÃO DE DIVs
/****************************************************************************************************************/
// EXIBE/ESCONDE UMA DIV
function show(id) { 
	if (document.getElementById) 
		{ // DOM3 = IE5, NS6
			//Vamos ver se o elemento já está sendo exibido
			if (document.getElementById(id).style.display!='block') {
				document.getElementById(id).style.display = 'block';
			}
			else {
				hide(id);
			}
		}	
	else
		{ 
		if (document.layers)
			{	
				document.id.display = 'block';
			} 
		else
			{
				document.all.id.style.display = 'block';
		}
	}

}

//APENAS EXIBE UMA DIV
function show_so(id) { 
	if (document.getElementById) 
		{ // DOM3 = IE5, NS6
			document.getElementById(id).style.display = 'block';
		}	
	else
		{ 
		if (document.layers)
			{	
				document.id.display = 'block';
			} 
		else
			{
				document.all.id.style.display = 'block';
		}
	}

}

// ESCONDE UMA DIV
function hide(id) { 
	if (document.getElementById) 
		{ // DOM3 = IE5, NS6
			document.getElementById(id).style.display = 'none';
		}	
	else
		{ 
		if (document.layers)
			{	
				document.id.display = 'none';
			} 
		else
			{
				document.all.id.style.display = 'none';
		}
	}
}

/****************************************************************************************************************/
// PERMITE EXIBIR OU ESCONDER UMA MATRIZ DE DIVs EM LOTE
//
// PARÂMETROS
// mtx_div - nome da matriz de divs. Uma matriz e considerada se no HTML for composto por um NOME seguido
// por um numero. Ex: elemento1,elemento2...elementoN
// acao - pode receber o valor hide (esconder) ou qualquer show (exibir)
// total_loop - total de elementos da matriz
/****************************************************************************************************************/
function loop_div(mtx_div,acao,total_loop){
	for(i=1;i<=total_loop;i++) {
		if (document.getElementById(mtx_div+i)) {
			if (acao=='hide') {
				hide(mtx_div+i);
			}
			else {
				show(mtx_div+i);
			}
		}
	}

}

/****************************************************************************************************************/
// CONTROLA EXIBIÇÃO DE CAMPOS EXTRAS EM INPUTs DO TIPO SELECT
/****************************************************************************************************************/
function campo_extra(div,gatilho,select_obj) {
	/*
		PARÂMETROS
		
		div - nome da DIV que contém o campo extra
		gatilho - valor que irá disparar a apresentação do campo extra
		select_obj - nome do objeto do tipo SELECT que será monitorado e irá acionar o campo extra
	*/
	if (select_obj.options[select_obj.selectedIndex].value==gatilho)
		{
			show(div);
		}
	else
		{
			hide(div);
		}
}

/****************************************************************************************************************/
// RETORNA O TEXTO SELECIONADO EM UMA PÁGINA/JANELA OU CAMPO
/****************************************************************************************************************/
function getSel()
{
	var txt = '';
	var foundIn = '';
	if (window.getSelection)
	{
		txt = window.getSelection();
		return txt;
	}
	else if (document.getSelection)
	{
		txt = document.getSelection();
		return txt;
	}
	else if (document.selection)
	{
		txt = document.selection.createRange().text;
		return txt;
	}
	else return;
}

/****************************************************************************************************************/
// IDENTIFICA PLATAFORMA QUE O USUÁRIO UTILIZA PARA ACESSO A INTERNET
// O NOME DO NAVEGADOR E A VERSÃO, O SISTEMA OPERACIONAL E VERSÃO DO JAVASCRIPT
// EXEMPLO: var is = new Is(); Instancia o objeto IS
//			if (is.firefox) {} Verifica se a propriedade firefox é TRUE
// OBS: Ler a função para identificar as demais propriedades
// http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
/****************************************************************************************************************/
function Is() 
{
	//<!--
	// Ultimate client-side JavaScript client sniff. Version 3.03

	// Everything you always wanted to know about your JavaScript client
	// but were afraid to ask. Creates "this." variables indicating:
	// (1) browser vendor:
	//     this.nav, this.ie, this.opera, this.hotjava, this.webtv, this.TVNavigator, this.AOLTV
	// (2) browser version number:
	//     this.major (integer indicating major version number: 2, 3, 4 ...)
	//     this.minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
	// (3) browser vendor AND major version number
	//     this.nav2, this.nav3, this.nav4, this.nav4up, this.nav6, this.nav6up, this.gecko, this.ie3,
	//     this.ie4, this.ie4up, this.ie5, this.ie5up, this.ie5_5, this.ie5_5up, this.ie6, this.ie6up, this.hotjava3, this.hotjava3up,
	//     this.opera2, this.opera3, this.opera4, this.opera5, this.opera5up
	// (4) JavaScript version number:
	//     this.js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
	// (5) OS platform and version:
	//     this.win, this.win16, this.win32, this.win31, this.win95, this.winnt, this.win98, this.winme, this.win2k
	//     this.os2
	//     this.mac, this.mac68k, this.macppc
	//     this.unix
	//     this.sun, this.sun4, this.sun5, this.suni86
	//     this.irix, this.irix5, this.irix6
	//     this.hpux, this.hpux9, this.hpux10
	//     this.aix, this.aix1, this.aix2, this.aix3, this.aix4
	//     this.linux, this.sco, this.unixware, this.mpras, this.reliant
	//     this.dec, this.sinix, this.freebsd, this.bsd
	//     this.vms
	//

	// convert all characters to lowercase to simplify testing
	var agt=navigator.userAgent.toLowerCase();
	
	//Implementação para exibir a string Agent
	this.agent = agt;
	
	// *** BROWSER VERSION ***
	// Note: On IE5, these return 4, so use this.ie5up to detect IE5.
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);

	// Note: Opera and WebTV spoof Navigator.  We do strict client detection.
	// If you want to allow spoofing, take out the tests for opera and webtv.
	this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
				&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
				&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	this.nav2 = (this.nav && (this.major == 2));
	this.nav3 = (this.nav && (this.major == 3));
	this.nav4 = (this.nav && (this.major == 4));
	this.nav4up = (this.nav && (this.major >= 4));
	this.navonly  = (this.nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) );
	this.nav6 = (this.nav && (this.major == 5));
	this.nav6up = (this.nav && (this.major >= 5));
	
	//Para NETSCAPE Maior que 6.0
	this.netscape = (agt.indexOf("netscape") != -1);
	this.netscape7 = (this.nav && this.netscape && (this.major>=5 && this.major<6) && (agt.indexOf("netscape/7") != -1) );
	this.netscape8 = (this.nav && this.netscape && (this.major>=5 && this.major<6) && (agt.indexOf("netscape/8") != -1) );
	
	this.gecko = (agt.indexOf('gecko') != -1);


	this.firefox= ((agt.indexOf("firefox") != -1) && (agt.indexOf("gecko") != -1));

	this.ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	this.ie3    = (this.ie && (this.major < 4));
	this.ie4    = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) );
	this.ie4up  = (this.ie && (this.major >= 4));
	this.ie5    = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
	this.ie5_5  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
	this.ie5up  = (this.ie && !this.ie3 && !this.ie4);
	this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);
	this.ie6    = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) );
	this.ie7	= (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5 && !this.ie6 && (agt.indexOf("msie 8.")<0));
	this.ie8	= ((agt.indexOf("msie 8.")!=-1));

	// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
	// or if this is the first browser window opened.  Thus the
	// variables this.aol, this.aol3, and this.aol4 aren't 100% reliable.
	this.aol   = (agt.indexOf("aol") != -1);
	this.aol3  = (this.aol && this.ie3);
	this.aol4  = (this.aol && this.ie4);
	this.aol5  = (agt.indexOf("aol 5") != -1);
	this.aol6  = (agt.indexOf("aol 6") != -1);

	this.opera = (agt.indexOf("opera") != -1);
	this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
	this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
	this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
	this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
	this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);

	this.webtv = (agt.indexOf("webtv") != -1); 

	this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
	this.AOLTV = this.TVNavigator;

	this.hotjava = (agt.indexOf("hotjava") != -1);
	this.hotjava3 = (this.hotjava && (this.major == 3));
	this.hotjava3up = (this.hotjava && (this.major >= 3));

	// *** JAVASCRIPT VERSION CHECK ***
	this.js;
	if (this.nav2 || this.ie3) this.js = 1.0;
	else if (this.nav3) this.js = 1.1;
	else if (this.opera5up) this.js = 1.3;
	else if (this.opera) this.js = 1.1;
	else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
	else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
	else if (this.hotjava3up) this.js = 1.4;
	else if (this.nav6 || this.gecko) this.js = 1.5;
	// NOTE: In the future, update this code when newer versions of JS
	// are released. For now, we try to provide some upward compatibility
	// so that future versions of Nav and IE will show they are at
	// *least* JS 1.x capable. Always check for JS version compatibility
	// with > or >=.
	else if (this.nav6up) this.js = 1.5;
	// NOTE: ie5up on mac is 1.4
	else if (this.ie5up) this.js = 1.3

	// HACK: no idea for other browsers; always check for JS version with > or >=
	else this.js = 0.0;

	// *** PLATFORM ***
	this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	// NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
	//        Win32, so you can't distinguish between Win95 and WinNT.
	this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

	// is this a 16 bit compiled version?
	this.win16 = ((agt.indexOf("win16")!=-1) || 
			(agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
			(agt.indexOf("windows 16-bit")!=-1) );  

	this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
					(agt.indexOf("windows 16-bit")!=-1));

	this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
	this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));

	// NOTE: Reliable detection of Win98 may not be possible. It appears that:
	//       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
	//       - On Mercury client, the 32-bit version will return "Win98", but
	//         the 16-bit version running on Win98 will still return "Win95".
	this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
	this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
	this.win32 = (this.win95 || this.winnt || this.win98 || 
					((this.major >= 4) && (navigator.platform == "Win32")) ||
					(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

	this.os2   = ((agt.indexOf("os/2")!=-1) || 
					(navigator.appVersion.indexOf("OS/2")!=-1) ||   
					(agt.indexOf("ibm-webexplorer")!=-1));

	this.mac    = (agt.indexOf("mac")!=-1);
	// hack ie5 js version for mac
	if (this.mac && this.ie5up) this.js = 1.4;
	this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) || 
							(agt.indexOf("68000")!=-1)));
	this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) || 
								(agt.indexOf("powerpc")!=-1)));

	this.sun   = (agt.indexOf("sunos")!=-1);
	this.sun4  = (agt.indexOf("sunos 4")!=-1);
	this.sun5  = (agt.indexOf("sunos 5")!=-1);
	this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
	this.irix  = (agt.indexOf("irix") !=-1);    // SGI
	this.irix5 = (agt.indexOf("irix 5") !=-1);
	this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
	this.hpux  = (agt.indexOf("hp-ux")!=-1);
	this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
	this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
	this.aix   = (agt.indexOf("aix") !=-1);      // IBM
	this.aix1  = (agt.indexOf("aix 1") !=-1);    
	this.aix2  = (agt.indexOf("aix 2") !=-1);    
	this.aix3  = (agt.indexOf("aix 3") !=-1);    
	this.aix4  = (agt.indexOf("aix 4") !=-1);    
	this.linux = (agt.indexOf("inux")!=-1);
	this.sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
	this.unixware = (agt.indexOf("unix_system_v")!=-1); 
	this.mpras    = (agt.indexOf("ncr")!=-1); 
	this.reliant  = (agt.indexOf("reliantunix")!=-1);
	this.dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
		(agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
		(agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
	this.sinix = (agt.indexOf("sinix")!=-1);
	this.freebsd = (agt.indexOf("freebsd")!=-1);
	this.bsd = (agt.indexOf("bsd")!=-1);
	this.unix  = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux || 
				this.sco ||this.unixware || this.mpras || this.reliant || 
				this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);

	this.vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
}

/****************************************************************************************************************/
// PERMITE IR PARA UMA DETERMINADA PÁGINA OU VOLTAR VIA HISTÓRICO DE PÁGINAS
// OBS: Ler a função para identificar as demais propriedades
/****************************************************************************************************************/
function ir_para(destino,new_window) {
	/*
		PARÂMETROS
		destino - caminho para a página destino ou número da página no histórico do navegador.
		new_window - true/false para abrir uma nova janela com a página destino.
					 Só em conjunto com o parâmetro <url>
	*/
	if (isNaN(Number(destino))) {
		if (!new_window) {
			document.location.href=destino;
			}
		else {
			window.open(destino);
		}
	}
	else { 
			history.go(destino);
	}
}

/****************************************************************************************************************/
// PERMITE IR PARA UMA DETERMINADA PÁGINA OU VOLTAR VIA HISTÓRICO DE PÁGINAS
/****************************************************************************************************************/
function ir_para_migracao(destino,new_window) {
    /*
        PARÂMETROS
        destino - caminho para a página destino ou número da página no histórico do navegador.
        new_window - true/false para abrir uma nova janela com a página destino.
			         Só em conjunto com o parâmetro <url>
    */
    if (isNaN(Number(destino))) {
        if (!new_window) {
	        document.location.href="http://www.panrotas.com.br/default_migracao.asp?irpara="+destino;
	        }
        else {
	        window.open(destino);
        }
    }
    else { 
	        history.go(destino);
    }
}

/****************************************************************************************************************/
// PERMITE NAVEGAR PELAS ÂNCORAS DA PÁGINA
/****************************************************************************************************************/
function ir_ancora(name) {
	var url = document.location.href;
	var pos_sharp = url.indexOf('#');

	if (pos_sharp!=-1) {
		document.location.href = url.slice(0,pos_sharp) + '#' + name;
	}
	else {
		document.location.href = url + '#' + name;
	}
}

/****************************************************************************************************************/
// CRIA A ÁREA DE LOGIN PARA O TOPO DO SITE
/****************************************************************************************************************/
function root_login(back_url) {
	document.write("<iframe src='https://seguro.panrotas.com.br/ini_frm_login.asp?back_url=" + back_url +"' frameborder='0' scrolling='no' class='iframe_login' id='iframeSeg'></iframe>");
}

/****************************************************************************************************************/
// CRIA A MENSAGEM DE SAUDAÇÃO PARA O USUÁRIO
// PARÂMETROS
//			texto: texto a ser exibido ao usuário
/****************************************************************************************************************/
function saudacao_user(texto) {
	var d = new Date() 
	var h = d.getHours() 
	var saudacao
	if (h <= 12) {saudacao = "Bom dia";}
	else {
		if (h > 12 && h<=18) {saudacao = "Boa tarde";} 
		else {saudacao = "Boa noite";}
	}
	//Vamos verificar se devemos utilizar o texto padrão
	if (texto=='') {texto="Visitante";}
	
	document.write('<input type="text" readonly="readonly" name="saudacao_user" id="saudacao_user" class="sauda_user" value="' + saudacao + ', ' + texto + '" />');
}

/****************************************************************************************************************/
// EXIBE SELOS DE CERTIFICAÇÃOSEGURO DO PORTAL
/****************************************************************************************************************/
function exibeVerisign() {
    document.write ("<img src='/images/siteSeguro.gif' style='border:none;' alt='Site Validado Certisign.' />")
    document.write ("<a href='javascript:vrsn_splash();'><img src='/images/veriSign.gif' style='border:none;' alt='Click to Verify - This site has chosen a VeriSign SSL Certificate to improve Web site security' /></a>")
}

function vrsn_splash() {
    tbar = "location=yes,status=yes,resizable=yes,scrollbars=yes,width=560,height=500";
    u1 = "https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=SEGURO.PANROTAS.COM.BR&lang=pt";
    sw = window.open(u1,'VRSN_Splash',tbar);
    sw.focus();
}

/****************************************************************************************************************/
// VERIFICA SE O CHECKBOX OU GRUPO DE CHECKBOX POSSUI ELEMENTOS SELECIONADOS
// PARÂMETROS
//			obj_form: objeto form onde se encontra o(s) checkbox(es)
//			obj_name: nome do objeto checkbox
/****************************************************************************************************************/
function isChecked(obj_form,obj_name) {
    for (i=0,n=obj_form.elements.length;i<n;i++)
        if (obj_form.elements[i].name.indexOf(obj_name)!=-1) {
			if (obj_form.elements[i].checked) {
				return true;
			}
		}
            
}

/****************************************************************************************************************/
// Para utilizar essas funções com AD Manager o script da seção deve ser do tipo
// JAVASCRIPT fail over IFRAME
/****************************************************************************************************************/
function runFlash_transp(filename,link,width,height) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" id="aqflashTransp" width="'+width+'" height="'+height+'"><param name="wmode" value="transparent" /><param name="movie" value="'+filename+'?clickTag='+link+'" /><param name="menu" value="false" /><param name="quality" value="high" /><embed src="'+filename+'?clickTag='+link+'" menu="false" quality="high" swliveconnect="false" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed></object>');
}

function runFlash(filename,link,width,height) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" id="aqflashBg" width="'+width+'" height="'+height+'"><param name="movie" value="'+filename+'?clickTag='+link+'" /><param name="menu" value="false" /><param name="quality" value="high" /><embed src="'+filename+'?clickTag='+link+'" menu="false" quality="high" swliveconnect="false" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
}

function runFlashExpand(filename,link) {
	document.frames['ad_frame'].document.open();
	document.frames['ad_frame'].document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" id="aqflashExp" width="468" height="300"><param name="wmode" value="transparent" /><param name="movie" value="'+filename+'?clickTag='+link+'" /><param name="menu" value="false" /><param name="quality" value="high" /><embed src="'+filename+'?clickTag='+link+'" menu="false" quality="high" swliveconnect="false" width="468" height="300" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed></object>');
	document.frames['ad_frame'].document.close();
}

function runFlashExpandNoTrans(filename,link) {
	document.frames['ad_frame'].document.open();
	document.frames['ad_frame'].document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" id="aqflashExp" width="468" height="300"><param name="movie" value="'+filename+'?clickTag='+link+'" /><param name="menu" value="false" /><param name="quality" value="high" /><embed src="'+filename+'?clickTag='+link+'" menu="false" quality="high" swliveconnect="false" width="468" height="300" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
	document.frames['ad_frame'].document.close();
}


function flash6(nome, id, com, alt, query){
		/*
		query: Troca a aba selecionada.
				- home
				- guia
				- editorial
				- noticias
		*/
		document.write(
			'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0"  width="'+com+'" height="'+alt+'" id="'+id+'" > <param name="movie" value="'+nome+'" />'+
			'<param name="FlashVars" value="'+query+'" />'+
			'<param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+nome+'" wmode="transparent" FlashVars="'+query+'"  quality="high" width="'+com+'" height="'+alt+'" name="'+id+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
			'</object>'
		);
	}

function openflash(filename,width,height,id){
		document.write(
			'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0"  width="'+width+'" height="'+height+'" id="'+id+'" > <param name="movie" value="'+filename+'" />'+
			'<param name="allowFullScreen" value="true" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+filename+'" wmode="transparent" allowFullScreen="true" quality="high" width="'+width+'" height="'+height+'" name="'+id+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
			'</object>'
		);
	}

/****************************************************************************************************************/

