/* COMECO EXIBIR FLASHS */
function exibe_flash(swf,width,height) {
	var flash = "";
	flash += '<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'" id="charge">';
	flash += '<param name="movie" value="'+swf+'" />';
	flash += '<param name="wmode" value="transparent" />';
	flash += '<param name="quality" value="high" />';
	flash += '<embed src="'+swf+'" swliveconnect="true" name="charge" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
	flash += '</object>';
	document.write(flash);
}
/* FIM EXIBIR FLASHS */



/* COMECO FOCAR CAMPO */
function Focar(elementID) {
	document.getElementById(elementID).focus();
}
/* FIM FOCAR CAMPO */



/* COMECO CONFIRMAR */
function Confirmar(Questao) {
	var agree=confirm(Questao);
	
	if (agree)
		return true;
	else
		return false;
}
/* FIM CONFIRMAR */



/* COMECO FORMATAR CAMPOS */
function FormataCampo(Formulario, Filtro) {
	var I = Formulario.value.length;
	var Saida = Filtro.substring(0,1);
	var Texto = Filtro.substring(I)
	
	if (Texto.substring(0,1) != Saida) {
		Formulario.value += Texto.substring(0,1);
	}
}
/* FIM FORMATAR CAMPOS */



/* COMECO SOMENTE NUMEROS */
function SomenteNumeros(Evento) {
	var CaractereCodigo = (Evento.which) ? Evento.which : event.keyCode;
	return (CaractereCodigo>=48 && CaractereCodigo<=57 || CaractereCodigo==8);
}
/* FIM SOMENTE NUMEROS */



/* COMECO OCULTAR NOTIFICACOES */
function FecharAviso() {
	document.getElementById("Aviso").style.display="none"
}
/* FIM OCULTAR NOTIFICACOES */



/* COMECO COMBOBOX */
function ComboAuto(targ,selObj,restore) {
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	
	if (restore) selObj.selectedIndex=0;
}
/* FIM COMBOBOX */



/* COMECO ENVIANDO DADOS */
function pegaMedidas(rolagem){
	var larguraPag, alturaPag;
	if (self.innerHeight) {
		larguraPag = self.innerWidth;
		alturaPag = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		larguraPag = document.documentElement.clientWidth;
		alturaPag = document.documentElement.clientHeight;
	} else if (document.body) {
		larguraPag = document.body.clientWidth;
		alturaPag = document.body.clientHeight;
	}
	if(rolagem){
		var rolagemH, rolagemV;
		
		if (window.innerHeight && window.scrollMaxY) {
			rolagemH = document.body.scrollWidth;
			rolagemV = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ 
			rolagemH = document.body.scrollWidth;
			rolagemV = document.body.scrollHeight;
		} else {
			rolagemH = document.body.offsetWidth;
			rolagemV = document.body.offsetHeight;
		}	
		if(rolagemV > alturaPag) {
			alturaPag = rolagemV;
			if(/Internet Explorer/.test(navigator.appName)) alturaPag+=30;
		}
		if(rolagemH > larguraPag) larguraPag = rolagemH;
	}
	valores = new Array(larguraPag,alturaPag); 
	return valores;
}

function EnviandoInfo() {
	MedidasPagina = pegaMedidas(true);
	LarguraPagina = MedidasPagina[0];
	AlturaPagina = MedidasPagina[1];
	
	var ObjBody = document.getElementsByTagName("body").item(0);
	var ObjFundo = document.createElement("div");
	
	ObjFundo.setAttribute('id','FundoEnviaImagem');
	ObjFundo.style.position="absolute"; 
	ObjFundo.style.top="0px";
	ObjFundo.style.left="0px";
	ObjFundo.style.width=LarguraPagina+"px";
	ObjFundo.style.height=AlturaPagina+"px";
	ObjFundo.style.background="#EAEAEA";
	ObjFundo.style.zIndex=998;
	ObjFundo.style.MozOpacity=.7;
	ObjFundo.style.opacity=.7;
	ObjFundo.style.filter="Alpha(Opacity=70)";
	ObjBody.appendChild(ObjFundo);
	
	
	var ObjQuadro = document.createElement("div");
	
	ObjQuadro.setAttribute('id','QuadroEnviaImagem');
	ObjQuadro.style.position="absolute";
	ObjQuadro.style.border="solid 2px #CCCCCC";
	ObjQuadro.style.top=""+ AlturaPagina/2-165 +"";
	ObjQuadro.style.left=""+ LarguraPagina/2-165 +"";
	ObjQuadro.style.width="250px";
	ObjQuadro.style.height="250px";
	ObjQuadro.style.background="#FFFFFF";
	ObjQuadro.style.padding="5px";
	ObjQuadro.style.zIndex=999;
	ObjQuadro.innerHTML = "<span style='color:#006699; font-family: Verdana; font-size:12px; text-align:center; font-weight:bold;'><p>Aguarde...</p><p>&nbsp;</p><p>Os dados est\xe3o sendo enviados...</p><p>&nbsp;</p><p>&nbsp;</p><p><img src=Imagens/ImagemLoading.gif></p></span>";
	
	ObjBody.appendChild(ObjQuadro);
}
/* FIM ENVIANDO DADOS */
