// JavaScript Document

//*****************************************************************************************************************************//
	// - método que retorna o objeto BODY para os mais comuns navegadores
	function getBody(){
		if (document.compatMode && document.compatMode != "BackCompat"){
		   var oBody = document.documentElement;
		} else {
		   var oBody = document.body;
		}
		return oBody;
	}

//*****************************************************************************************************************************//
	// - método que redimenciona e estabelece um mínimo de tamanho para as janelas popUps
	function resize(local,dif,roda,mW,mH){
		// a variavel booleana roda serva para diferenciar os lugares que este script vai rodar ou nao.
		if (roda){
			if (getWidth() < screen.width){
				if (parseInt(navigator.appVersion) > 3) {
					if (navigator.appName == "Netscape") {
						window.outerWidth = minWidth(mW);
						window.outerHeight = minHeight(mH);
					} else {
//=========================================================================================================================//
//===AQUI TEM UM ERRO DE ACESSO NEGADO QUE APARECEC SÓ DE VEZ ENQUANDO=====================================================//
//=========================================================================================================================//
						window.resizeTo(minWidth(mW),minHeight(mH));
//=========================================================================================================================//
//===AQUI TEM UM ERRO DE ACESSO NEGADO QUE APARECEC SÓ DE VEZ ENQUANDO=====================================================//
//=========================================================================================================================//						
					}
				}
			}

			// aumenta o tamanho do iFrame para o tamanho da janela menos a diferença da parte de baixo.
			if (navigator.appName == "Microsoft Internet Explorer")
				local.style.height = getHeight() - (dif+31);
			else {
				local.style.height = getHeight() - dif;
			}
		}
	}

	function minWidth(mW){
		if (getWidth() > mW)
			return getWidth();
		else
			return mW;
	}

	function minHeight(mH){
		if (getHeight() > mH){
			return getHeight();
		} else {
			return mH;
		}
	}
	
//*****************************************************************************************************************************//
	function maximize(){
		window.resizeTo(getScreenWidth(),getScreenHeight());
	}

//*****************************************************************************************************************************//
	function getWidth(local){
		if (local == null) local = document;
		
		var wWidth = 0;
		if (navigator.userAgent.indexOf("MSIE") > 0) {
			wWidth = document.body.clientWidth;
			return wWidth;
		} else {
			wWidth = window.outerWidth;
			return wWidth;
		}
	}
	
//*****************************************************************************************************************************//
	function setNavWidth(width){
		if (navigator.userAgent.indexOf("MSIE") > 0) {
			document.body.clientWidth = width;
		} else
			window.outerWidth = width;
	}

//*****************************************************************************************************************************//
	function getHeight(local){
		if (local == null) local = document;

		var wHeight = 0;
		if (navigator.userAgent.indexOf("MSIE") > 0) {	
			wHeight = local.body.clientHeight;
			return wHeight;
		} else {
			wHeight = window.innerHeight;
			return wHeight;
		}
	}

//*****************************************************************************************************************************//
	function setNavHeight(height){
		if (navigator.userAgent.indexOf("MSIE") > 0) {	
			document.body.clientHeight = height;
		} else
			window.innerHeight = height;
	}


//*****************************************************************************************************************************//
	function getScreenWidth(){
		if (navigator.userAgent.indexOf("MSIE") > 0)		
			return screen.AvailWidth;
		else
			return screen.width;
	}

//*****************************************************************************************************************************//
	function getScreenHeight(){
		if (navigator.userAgent.indexOf("MSIE") > 0)		
			return screen.AvailHeight;
		else
			return screen.height;
	}

//*****************************************************************************************************************************//
	function getWindowSize() {
		if (navigator.userAgent.indexOf("MSIE") > 0) {
			var sSize = (document.body.clientWidth * document.body.clientHeight);
			return sSize;
		} else {                                                
			var sSize = (window.outerWidth * window.outerHeight);
			return sSize;
		}
		return;      
	}
	
//*****************************************************************************************************************************//
	function getPercent(){
		var w = Math.round((getWidth()/(screen.width)*100) * Math.pow(10, 0));
		var h = Math.round((getHeight()/(screen.height)*100) * Math.pow(10, 0));
	}