// JavaScript Document

try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}
				
				
function carrega(url, elemento){

    var conteudo = document.getElementById(elemento);

	   xmlhttp.open("GET",url,true);		
	
    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {
		
		if (xmlhttp.readyState == 1) {
	  		    
	  	}	

        if (xmlhttp.readyState==4){	

            //Lę o texto
            var texto=xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
			
			if (xmlhttp.status == 200) {
	  			var conteudo=document.getElementById(elemento)
            	conteudo.innerHTML=texto  
	  		}	
        }
    }
    xmlhttp.send(null)
}

function abrir(pagina,largura,altura) {


w = screen.width;
h = screen.height;


meio_w = w/2;
meio_h = h/2;


altura2 = altura/2;
largura2 = largura/2;
meio1 = meio_h-altura2;
meio2 = meio_w-largura2;


window.open(pagina,'','height=' + altura + ', width=' + largura + ', scrollbars=no, status=yes, top='+meio1+', left='+meio2+''); 
}

function abrirscroll(pagina,largura,altura) {


w = screen.width;
h = screen.height;


meio_w = w/2;
meio_h = h/2;


altura2 = altura/2;
largura2 = largura/2;
meio1 = meio_h-altura2;
meio2 = meio_w-largura2;


window.open(pagina,'','height=' + altura + ', width=' + largura + ', scrollbars=yes, top='+meio1+', left='+meio2+''); 
}

function logar(){
	
	document.form1.submit();
	document.form1.reset();
	
	}