function AlterarEstilo(estilo)
{

	 
	var i, a, main;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) 
	{
		 
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("id") == "Estilo") 
		{
			 
			a.setAttribute("href",estilo);
		}
    }
  
}
function Down(){
	window.scroll(0,220000)
}

function alerta(mensagem)
{
	alert(mensagem);
}

var win = null;
function windowOpen(mypage,myname,w,h,features) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += 'alwaysRaised=yes,';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

function escrever(conteudo)
{
	document.write(conteudo);
}
function mascaraData(formato, keypress, objeto) 
{ 
campo = eval (objeto); 
if (formato=='DATA') 
{ 
caracteres = '01234567890'; 
separacoes = 1; 
separacao1 = '/'; 
conjuntos = 3; 
conjunto1 = 2; 
conjunto2 = 5; 
if ((caracteres.search(String.fromCharCode (keypress))!=-1) && campo.value.length < 
(conjunto1 + conjunto2 + 1)) 
{ 
if (campo.value.length == conjunto1) 
campo.value = campo.value + separacao1; 
if (campo.value.length == conjunto2) 
campo.value = campo.value + separacao1; 

} 
else 
campo.value = campo.value; 
} 

if (formato=='MESANO') 
{ 
caracteres = '01234567890'; 
separacoes = 1; 
separacao1 = '/'; 
conjuntos = 2; 
conjunto1 = 2; 
conjunto2 = 4; 
if ((caracteres.search(String.fromCharCode (keypress))!=-1) && campo.value.length < 
(conjunto1 + conjunto2 + 1)) 
{ 
if (campo.value.length == conjunto1) 
campo.value = campo.value + separacao1; 
} 
else 
event.returnValue = false; 
} 
}


function AbrirBox(overlay,content,side,fechar){ 
document.getElementById(overlay).style.visibility="visible"; 
document.getElementById(content).style.visibility="visible"; 
document.getElementById(side).style.visibility="hidden"; 

} 
function FecharBox(overlay,content,side,fechar){ 
document.getElementById(overlay).style.visibility="hidden"; 
document.getElementById(content).style.visibility="hidden"; 
document.getElementById(side).style.visibility="visible"; 

}  

// MARCACAO DE SELECAO DE VOO

function seleciona_viagem(e,n) {
       var tr = e.parentNode.parentNode;
        
        if (n==1)
        {
	        tr.className = 'selecionadaIda';
	   }
	   if (n==2)
	   {
	    tr.className = 'selecionadaVolta';
	   }

       var table = tr.parentNode.parentNode;
       var linhas = table.getElementsByTagName('TR');
       for (var i = 0; i < linhas.length; i++) {
               if (linhas[i] != tr) {
                       linhas[i].className = '';
               }
       }

    
}

function HotelRefazer(pnlAtivo)
{
     if (document.getElementById(pnlAtivo)!=null)
     {
        if (document.getElementById(pnlAtivo).className=="pnlAtivo")
        {
        document.getElementById(pnlAtivo).className="pnlInativo"; 
        }
        else
        {
        document.getElementById(pnlAtivo).className="pnlAtivo"; 
        }
    }
     
}