	var ajax = null;
    ajax = new ajax_control("/loading.asp","http://"+document.location.hostname+"/");
    function init(){
        ajax.init_timer();
    }
    onload = init;


	function EscondeMenu(qualDiv) {
		//alert('x');
		document.getElementById(qualDiv).innerHTML=''
		//setTimeout("EscondeMenu("+qualDiv+")",2000);
	}
	
	function MudaPosDiv(qualDiv, col) {
		var pos = (col-1)*85;
		obj = document.getElementById(qualDiv);
		obj.style.left = (220 + pos)+'px';
	}


	function TrocaCores(Cor1, Cor2, Cor3, Cor4) {

	   if (Cor1 == '') { Cor1 = '#000000' }
	   if (Cor2 == '') { Cor2 = '#44916C' }
	   if (Cor3 == '') { Cor3 = '#D94F00' }
	   if (Cor4 == '') { Cor4 = '#969594' }

	   var cj1 = new Array();
	   cj1[0] = document.getElementById('img1');
	   cj1[1] = document.getElementById('img62');
	   cj1[2] = document.getElementById('img63');
	   cj1[3] = document.getElementById('img64');
	   cj1[4] = document.getElementById('img65');
	   
		var cj2 = new Array();
		cj2[0] = document.getElementById('img55');
		cj2[1] = document.getElementById('img2');
		cj2[2] = document.getElementById('img51');
		cj2[3] = document.getElementById('img52');
		cj2[4] = document.getElementById('img53'); 
		cj2[5] = document.getElementById('img54');

		var cj3 = new Array();
		cj3[0] = document.getElementById('img7');

		var cj4 = new Array();
		cj4[0] = document.getElementById('img4');

		for (var i=0; i < cj1.length; i ++) {
			if (cj1[i]) {
				cj1[i].bgColor = Cor1;
			}
		}

		for (var i=0; i < cj2.length; i ++) {
			if (cj2[i]) {
				cj2[i].bgColor = Cor2;
			}
		}

		for (var i=0; i < cj3.length; i ++) {
			if (cj3[i]) {
				cj3[i].bgColor = Cor3;
			}
		}
			
		for (var i=0; i < cj4.length; i ++) {
			if (cj4[i]) {
				cj4[i].bgColor = Cor4;
			}
		}
	
	}

	function CarregaAjax(strDiv,strForm,strUrl,Msg){ 
		if (Msg != null) {
			alert(Msg);
		}
		
		var params = ajax_get_form_values(strForm, null);
		//loadRel(params,strDiv,strUrl);
		var divLocal = strDiv;
		var xmlRequest = ajax.create_http_request();
		var lock = new Object();
		lock.status = 0;
		//coloca a animação do "aguardando"
		ajax.init_loading(document.getElementById("divLoading"),lock);
		var listener = new Object();
		listener.onResponse = function(){
			if(xmlRequest.readyState == 4){
				lock.status=1; 
				var node = document.getElementById(divLocal);
				node.innerHTML = xmlRequest.responseText;
				document.getElementById('divLoading').innerHTML = '';
			}
		};
			ajax.post_xml(xmlRequest,strUrl,params,listener);
	}
	

	function loadRel(params,strDiv,strUrl) {
		divLocal = strDiv;
		var xmlRequest = ajax.create_http_request();
		var lock = new Object();
		lock.status = 0;
		//coloca a animação do "aguardando"
		ajax.init_loading(document.getElementById("divLoading"),lock);
		var listener = new Object();
		listener.onResponse = function(){
			if(xmlRequest.readyState == 4){
				lock.status=1; 
				var node = document.getElementById(divLocal);
				node.innerHTML = xmlRequest.responseText;
				document.getElementById('divLoading').innerHTML = '';
			}
		};
		
		var p = params;
		if(p != null){
			p = "'" + p + "'";
		}
		
		ajax.add_mark("loadRel("+p+","+strDiv+","+strUrl+")");
		
	//		if(params == null){
	//			ajax.get_xml(xmlRequest,'/do/faq/cadastro/questao?paginaAtual=0&acao=' + acao,listener);
	//			}
	//		else{
	//			ajax.post_xml(xmlRequest,'/do/faq/cadastro/questao',params,listener);
	//			}
	
			ajax.post_xml(xmlRequest,strUrl,params,listener);
		//document.form5.strApolice.value = '';
		//document.form5.strItem.value = '';
	}

	function CarregaPagina1000() {
		var divLocal = 'divConteudoMenu'
		var url = "/admin/usuarios/default.asp"
		var xmlRequest = ajax.create_http_request();
		var node = document.getElementById(divLocal);
		if (node) {
			node.style.visibility = 'visible';
		}
		var lock = new Object();
		lock.status = 0;
		//ajax.init_loading(document.getElementById("divLoading"),lock);
		var listener = new Object();
		listener.onResponse = function(){
			if(xmlRequest.readyState == 4){
				lock.status=1; 
				node.innerHTML = xmlRequest.responseText;
				document.getElementById('divLoading').innerHTML = '';
			}
		};
		//ajax.add_mark("CarregaPagina("+divLocal+","+url+")");
		//ajax.add_mark("CarregaPagina('"+divLocal+"','"+url+"')");
		ajax.get_xml(xmlRequest,url,listener);
	}


	function CarregaPagina(divLocal,url) {
		div1 = document.getElementById(divLocal);
		if (div1) {
			div1.style.display = '';
		}

		var xmlRequest = ajax.create_http_request();
		var node = document.getElementById(divLocal);
		if (node) {
			node.style.visibility = 'visible';
		}
		var lock = new Object();
		lock.status = 0;
		//ajax.init_loading(document.getElementById("divLoading"),lock);
		var listener = new Object();
		listener.onResponse = function(){
			if(xmlRequest.readyState == 4){
				lock.status=1; 
				node.innerHTML = xmlRequest.responseText;
				document.getElementById('divLoading').innerHTML = '';
			}
		};
		//ajax.add_mark("CarregaPagina("+divLocal+","+url+")");
		//ajax.add_mark("CarregaPagina('"+divLocal+"','"+url+"')");
		ajax.get_xml(xmlRequest,url,listener);
	}

	function EscondeLayer(divLocal) {
		var divDet = document.getElementById(divLocal);
		divDet.innerHTML = '';
		divDet.style.display = 'none';
		//divDet.style.visibility = 'hidden';
	}
	function PosicaoEsquerda (el) {
		var ol=el.offsetLeft;
		while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
		return ol;
	}
	function PosicaoSuperior (el) {
		var ot=el.offsetTop;
		while((el=el.offsetParent) != null) { ot += el.offsetTop; }
		return ot;
		}


	function submitFormPost(pagina,divLocal,formulario){ 
		var params = ajax_get_form_values(formulario, null);
		var xmlRequest = ajax.create_http_request();
		var lock = new Object();
		lock.status = 0;
		ajax.init_loading(document.getElementById("divLoading"),lock);
		var listener = new Object();
		listener.onResponse = function(){
			if(xmlRequest.readyState == 4){
				lock.status=1; 
				var node = document.getElementById(divLocal);
				node.innerHTML = xmlRequest.responseText;
				document.getElementById('divLoading').innerHTML = '';
			}
		};
		ajax.post_xml(xmlRequest,pagina,params,listener);
	}

	function submitForm(qualDiv,url,sForm) {
		divLocal = qualDiv;
		var xmlRequest = ajax.create_http_request();
		var lock = new Object();
		lock.status = 0;
		//coloca a animação do "aguardando"
		ajax.init_loading(document.getElementById("divLoading"),lock);
		var listener = new Object();
		listener.onResponse = function(){
			if(xmlRequest.readyState == 4){
				lock.status=1; 
				var node = document.getElementById(divLocal);
				node.innerHTML = xmlRequest.responseText;
				document.getElementById('divLoading').innerHTML = '';
			}
		};

		var NomeForm = eval('document.'+sForm);
		var params = ajax_get_form_values(NomeForm, null);
		ajax.post_xml(xmlRequest,url,params,listener);
	}
	function EnviaContato() {
		var Nome = document.formContato.Nome;
		var Email = document.formContato.Email;
		var Comentario = document.formContato.Comentario;
		var Erro = 0;
		var txtErro = 'Os seguintes campos devem ser preenchidos: \r'
		if (Nome.value == '') {
			txtErro = txtErro + 'Nome\r'
			Erro = 1;
		}
		if (Email.value == '') {
			txtErro = txtErro + 'E-mail\r'
			Erro = 1;
		}
		if (Comentario.value == '') {
			txtErro = txtErro + 'Comentário\r'
			Erro = 1;
		}
		if (Erro == 1) {
			alert(txtErro);
			return false;
		}
		
		submitForm('divTexto','/contato_ok.asp','formContato')
	}

	function LiveChat(myForm) {
		var name = document.formLiveChat.name;
		var email = document.formLiveChat.email;
		var Erro = 0;
		var txtErro = 'Os seguintes campos devem ser preenchidos: \r'
		if (name.value == '') {
			txtErro = txtErro + 'Nome\r'
			Erro = 1;
		}
		if (email.value == '') {
			txtErro = txtErro + 'E-mail\r'
			Erro = 1;
		}
		if (Erro == 1) {
			alert(txtErro);
			return false;
		}
		   w = screen.availWidth;
		   h = screen.availHeight;
		
		var leftPos = (w-640)/2, topPos = (h-480)/2;
		//var w = window.open("livechat/","ALSRoom","toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=640,height=480,top=" + topPos + ",left=" + leftPos);
		myForm.target = 'ALSRoom';
		myForm.action = "livechat/UserPreChat.asp"
		var w = window.open("","ALSRoom","toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=640,height=480,top=" + topPos + ",left=" + leftPos);

		return true;

		//submitForm('divTexto','/livechat_ok.asp','formLiveChat')
	}



function openModal(pUrl, pWidth, pHeight) {
	if (window.showModalDialog) {
		return window.showModalDialog(pUrl, window,
		  "dialogWidth:" + pWidth + "px;dialogHeight:" + pHeight + "px");
	} else {
		try {
			netscape.security.PrivilegeManager.enablePrivilege(
			  "UniversalBrowserWrite");
			window.open(pUrl, "wndModal", "width=" + pWidth
			  + ",height=" + pHeight + ",resizable=no,modal=yes");
			return true;
		}
		catch (e) {
			alert("Script não confiável, não é possível abrir janela modal.");
			return false;
		}
	}
}







function FlashObject(divId,width,height,url){
    this.flashClassId = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
    this.flashWidth = width;
    this.flashHeight = height;
    this.flashUrl = url;
    this.flashId = "obj";
    this.flashDivId = divId;
    this.flashCodeBase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0";
            
    this.parameters = new Array();
}
        
function FlashParameter(name, value){
    this.parameterName = name;
    this.parameterValue = value;
}
        
FlashParameter.prototype.getName = function(){
    return this.parameterName;
}
        
FlashParameter.prototype.getValue = function(){
    return this.parameterValue;
}
        
FlashObject.prototype.setClassId = function(classId){
    this.flashClassId = classId;
}

FlashObject.prototype.setId = function(id){
    this.flashId = id;
}
        
FlashObject.prototype.setCodeBase = function(codeBase){
    this.flashCodeBase = codeBase;
}
        
FlashObject.prototype.addParameter = function(parameter){
    this.parameters.push(parameter);
}
        
FlashObject.prototype.createObject = function(){

    var objectString;
    var embedString;
            
    objectString = "<object classid='"+this.flashClassId+"' codebase='"+this.flashCodeBase+"' width='"+this.flashWidth+"' height='"+this.flashHeight+"' id='"+this.flashId+"'>";
    embedString = "<embed width='"+ this.flashWidth+"' height='"+this.flashHeight+"' src='"+this.flashUrl+"' ";

    for(i = 0; i < this.parameters.length; i++){
        var parameter = this.parameters[i];
        objectString += "<param name='"+parameter.getName()+"' value='"+parameter.getValue()+"' />";
        embedString += parameter.getName() + "='" + parameter.getValue() + "' ";
    }
            
    objectString += "<param name='movie' value='"+this.flashUrl+"' />";
            
    objectString += embedString + ">";
    objectString += "</object>";
        
    var div = document.getElementById(this.flashDivId);
    div.innerHTML = objectString;
}    


function CarregaFlash(divLocal,width,height,url) {
	var param;
	var obj = new FlashObject(divLocal,width,height,url);
	
	param = new FlashParameter("quality","high");
	obj.addParameter(param);
	
	param = new FlashParameter("bgcolor","#FFFFFF");
	obj.addParameter(param);

	//param = new FlashParameter("allowScriptAccess","sameDomain");
	//obj.addParameter(param);
	
	//param = new FlashParameter("menu","false");
	//obj.addParameter(param);

	obj.createObject();

}
