// JavaScript Document
function GetXMLHttp() {  
if(navigator.appName == "Microsoft Internet Explorer") {  
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  
}  
else {  
xmlHttp = new XMLHttpRequest();  
}  
return xmlHttp;  
}  
   
var xmlRequest = GetXMLHttp(); 

function loading(url,div) {
	var ajax=null
	if(window.ActiveXObject)
		ajax=new ActiveXObject('Microsoft.XMLHTTP')
	else if(window.XMLHttpRequest)
		ajax=new XMLHttpRequest()
	if(ajax!=null){
		var cache=new Date().getTime()
		ajax.open('GET',url+"&cache="+cache,true)
		ajax.onreadystatechange=function status() {
			if(ajax.readyState == 4){
				if(ajax.status == 200){
					document.getElementById(div).innerHTML=ajax.responseText
					var texto=unescape(ajax.responseText.replace(/\+/g," "))
					ExtractScript(texto)
				}
			} 
		else
			document.getElementById(div).innerHTML='<center><img src="images/carregando.gif" alt="" style="margin-top: 3px;" /></center>'}
		ajax.send(null)
	}
}
function SomenteNumero(e){
	if (window.event) //IE
	{
		tecla = e.keyCode;
	}
	
	else if (e.which) //FF
	{
		tecla = e.which;
	}
	
	if ( (tecla >= 48 && tecla <= 57)||(tecla == 8 ) ) {
		return true;
	}
	else {
		return false;
	}
}
function janela(url, width, height, janela) { 
	if (document.all) {
		window.showModalDialog(url, janela, 'width='+width+', height='+height+', top=50, left=50, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
	} else {
		window.open (url, janela, 'width='+width+', height='+height+', top=50, left=50, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
	}
}