	// INICIA A CLASSE XMLHttpRequest CORRETA DEPENDENDO DO TIPO DE BROWSER
    try{
        xmlhttp = new XMLHttpRequest();
    }catch(ee){
        try{
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
            try{
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(E){
                xmlhttp = false;
            }
        }
    }




	// Função pra montar o Flash e não travar na segurança do IE
	function swf(file,x,y,wmode, variaveis){
		var file, x, y, wmode, variaveis;
		if(variaveis == undefined || variaveis.length < 1) variaveis = '';
		document.write(' <object id="rev" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+x+'" height="'+y+'">');
		document.write('  <param name="movie" value="'+file+'.swf'+variaveis+'" />');
		document.write('  <param name="quality" value="best" />');
		document.write('  <param name="wmode" value="'+wmode+'" />');
		document.write('  <param name="salign" value="c" />');
		document.write('  <embed src="'+file+'.swf'+variaveis+'" wmode="'+wmode+'" quality="best" salign="c" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+x+'" height="'+y+'"></embed>');
		document.write(' </object>');
	}

	function callAdjustBox(div){
		if(document.all){
			adjustBoxHeight(div,1);
		} else {
			setTimeout(adjustBoxHeight, 5000,div,1);
			setTimeout(adjustBoxHeight,10000,div,1);
			setTimeout(adjustBoxHeight,15000,div,1);
		}
	}
			



	// Função para ajustar a altura do box da direita conforme conteudo
	function adjustBoxHeight(divAjuste,contador){
		
		if(!document.getElementById(divAjuste)) return false;

		// fator de ajuste (????)
		ajuste = 20;
		
		//Posição top Esquerda: 
		hEsq = document.getElementById("content").offsetTop;
		//Altura Esquerda
		aEsq = document.getElementById("content").offsetHeight;
		//Base Esquerda
		bEsq = aEsq + hEsq;


		//Posicao top Fotos
		hFotos = document.getElementById(divAjuste).offsetTop;
		//Altura Fotos
		aFotos = document.getElementById(divAjuste).offsetHeight;
		//Base Esquerda
		bFotos = aFotos + hFotos;
//		alert(bEsq - bFotos + ' ' + bEsq + ' ' + bFotos);
		if(bEsq < bFotos){
			// altura para chegar na base da colFotos
			var diff = (bFotos - hEsq) - ajuste;
			document.getElementById("content").style.height = diff+'px';
			if(contador < 50)
				adjustBoxHeight(divAjuste,contador+1);

		} else if(bEsq > bFotos) {
			// altura para fotos chegar na base do content
			var diff = (bEsq - hFotos) - ajuste;
			document.getElementById(divAjuste).style.height = diff+'px';
			if(contador < 50)
				adjustBoxHeight(divAjuste,contador+1);

		}
	}


	function refresh(){
		window.location.href = window.location.href;
	}




	function adjustContent(){

		// fator de ajuste (????)
		ajuste = 15;
		
		monitorX = document.body.offsetWidth;
		diff = monitorX - 218;
		document.getElementById("esquerda").style.width = diff+'px';		
		diff2 = diff - 32;
		document.getElementById("content").style.width = diff2+'px';


		/*

		//Posição top Esquerda: 
		hEsq = document.getElementById("content").offsetTop;
		//Altura Esquerda
		aEsq = document.getElementById("content").offsetHeight;
		//Base Esquerda
		bEsq = aEsq + hEsq;


		//Posicao top Fotos
		hFotos = document.getElementById(divAjuste).offsetTop;
		//Altura Fotos
		aFotos = document.getElementById(divAjuste).offsetHeight;
		//Base Esquerda
		bFotos = aFotos + hFotos;
		


		if(bEsq < bFotos){
			// altura para chegar na base da colFotos
			var diff = (bFotos - hEsq) - ajuste;
			document.getElementById("content").style.height = diff+'px';
			adjustBoxHeight(divAjuste);
		} else if(bEsq > bFotos) {
			// altura para fotos chegar na base do content
			var diff = (bEsq - hFotos) - ajuste;
			document.getElementById(divAjuste).style.height = diff+'px';
//			document.getElementById("ulFotos").style.height = diff+'px';
			adjustBoxHeight(divAjuste);
		}
//		alert(document.getElementById('ulFotos').offsetTop);
//		alert(document.getElementById('ulFotos').offsetHeight);*/
	}






// Carrega regulamentacao pela OMINI
function combourlchange(form)
	{
	var myindex=form[0].selectedIndex
	if (form[0].options[myindex].value != "0")
		{
		window.open(form[0].options[myindex].value, 'CustomsInfo', '')
		//document.location.replace(form[0].options[myindex].value)
		}
	}
// -->


/* FUNCAO DE FILTRO DE OPÇÕES DO COMBO*/ 
function combourlchange(obj){
	if(xmlhttp){
		id = obj.options[obj.selectedIndex].value;
		var url="ajax.regulamentacao.php?url="+id+"&"+Math.random()
		xmlhttp.open("GET", url,true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4){
				resposta=xmlhttp.responseText
//				resposta=unescape(resposta.replace(/\+/g," ")).split("|")
				document.getElementById('RegFromOmni').innerHTML = resposta;
			}
		}
		//Enquanto ocorre a conexao e busca, mostra o texto nos campos...
		document.getElementById('RegFromOmni').innerHTML = "<em>Por favor aguarde... <br/>Obtendo informa&ccedil;&otilde;es diretamente da OMNI<br/><br/><br/>Wait a moment please...<br/> Retrieving information from OMNI</br></em>"
		xmlhttp.send(null)
		window.focus();
	}else{
		//Caso o navegador nao suporte XMLHttpRequest
		alert("Seu navegador não suporta algumas funcionalidades deste site.")
	}
}

