/*
--------------------------------------------
//--> Função: Criar SFW
--------------------------------------------*/
function insswf(versao, largura, altura, nome, parametros, modo, cor){
	
	var fl_ver 	= versao
	var fl_w 	= largura
	var fl_h 	= altura
	var fl_n 	= nome
	var fl_m 	= modo
	var fl_c 	= cor
	
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="'+fl_ver+',0,0,0" width="'+fl_w+'" height="'+fl_h+'">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value="/education/contents/swf/'+fl_n+'.swf?'+parametros+'" />\n');
	document.write('<param name="wmode" value="'+fl_m+'" />\n');
	document.write('<param name="bgcolor" value="'+fl_c+'" />\n');
	document.write('<param name="menu" value="false" />\n');
	document.write('<param name="FlashVars" value="'+parametros+'" />\n');
	document.write('<embed src="/education/contents/swf/'+fl_n+'.swf?'+parametros+'" wmode="'+fl_m+'" bgcolor="'+cor+'" width="'+fl_w+'" height="'+fl_h+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');
}
/*
--------------------------------------------
//--> Função: Alterar tamanho do texto 
--------------------------------------------*/ 
var tgs = new Array( 'div','td','tr', 'a', 'span');

var szs = new Array( '9','10','11','13','15','17','20' );
var startSz = 2;

function mudaTamTexto(trgt,inc) {
	
 	document.getElementById("corpo").style.width= 'auto';

    if (!document.getElementById) return
    var d = document,cEl = null,sz = startSz,i,j,cTags;
    
    sz += inc;
    if ( sz < 0 ) sz = 0;
    if ( sz > 6 ) sz = 6;
    startSz = sz;
        
    if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

    cEl.style.fontSize = szs[ sz ];

    for ( i = 0 ; i < tgs.length ; i++ ) {
        cTags = cEl.getElementsByTagName( tgs[ i ] );
        for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
    }
}
/*
--------------------------------------------
//--> Função: Formata campo texto
--------------------------------------------*/ 
function Formata(objCampo, strMascara)
	{
		var intDigito = event.keyCode;

		// Expressão regular para validação de caractere dígitado.
		// São aceitos apenas números entre "0-9", são feitos dois testes pois existem "dois teclados numéricos" e seus caracteres ASCII são diferentes.
		var objER = /^(4[8-9]|5[0-7]|9[6-9]|10[0-5])$/;

		if(objER.test(intDigito))
			{
				var intTamanho   = objCampo.value.length;
				var strCaractere = strMascara.charAt(0);
				var strMascara   = strMascara.substring(intTamanho)

				if (strMascara.charAt(0) != strCaractere)
					objCampo.value += strMascara.charAt(0);
			}
}
/* --------------------------------------------
	Função: Abrir Janela
---------------------------------------------*/
function PopUp(url,w,h,b,m){ 
 	var leftposicao = (screen.width) ? (screen.width-w)/2 : 0;
	var topposicao = (screen.height) ? (screen.height-h)/2 : 0;
	window.open(url,'Popups','width='+w+',height='+h+',top='+topposicao+',left='+leftposicao+',scrollbars='+b+',menubar='+m+',resizable=no');
}
/* --------------------------------------------
	Função: Promoção POP-UP
---------------------------------------------*/
function showLoad(){
		
	getPageSize();
	
	
	var oDiv 	= document.createElement('div');
	var w 	= arrayPageSize[0];
	var h	= arrayPageSize[1]-100;
	
	oDiv.id 			= 'load' 
	oDiv.style.width	= w
	oDiv.style.height	= h
 
	stext	= '<div id="boxLoad" >'
	+'<p class="alRight""><a href="#" onclick="document.getElementById(\'load\').style.display = \'none\'; showSelectBoxes();"><img src="/contents/bto/bto39.gif" /></a></p>'
	+'<p><a href="/pesquisa/?o=4"><img src="/image/banner/pop1.jpg" /></a></p>'
	+'</div> '
	
	hideSelectBoxes();
	
	document.body.appendChild(oDiv);
	document.getElementById('load').innerHTML = (stext);
	
}

function hideSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}
function showSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}


function getPageSize(){ 
    
    var xScroll, yScroll; 
    
    if (window.innerHeight && window.scrollMaxY) {    
        xScroll = document.body.scrollWidth; 
        yScroll = window.innerHeight + window.scrollMaxY; 
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac 
        xScroll = document.body.scrollWidth; 
        yScroll = document.body.scrollHeight; 
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 
        xScroll = document.body.offsetWidth; 
        yScroll = document.body.offsetHeight; 
    } 
    
    var windowWidth, windowHeight; 
    if (self.innerHeight) {    // all except Explorer 
        windowWidth = self.innerWidth; 
        windowHeight = self.innerHeight; 
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode 
        windowWidth = document.documentElement.clientWidth; 
        windowHeight = document.documentElement.clientHeight; 
    } else if (document.body) { // other Explorers 
        windowWidth = document.body.clientWidth; 
        windowHeight = document.body.clientHeight; 
    }    
    
    // for small pages with total height less then height of the viewport 
    if(yScroll < windowHeight){ 
        pageHeight = windowHeight; 
    } else { 
        pageHeight = yScroll; 
    } 

    // for small pages with total width less then width of the viewport 
    if(xScroll < windowWidth){    
        pageWidth = windowWidth; 
    } else { 
        pageWidth = xScroll; 
    } 
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
}