// JavaScript Document
var largoBrowser,altoBrowser,largoScreen,altoScreen,largoUtil,altoUtil;

function desaparece(quem){
	quadro = document.getElementById(quem);
   quadro.style.display = 'none';
}

function mostra(objId) { 
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if ((obj.style.display == 'none') || (obj.style.display == 'undefined')){
      eval("obj.style.display='block'");
    }else{
	   eval("obj.style.display='none'");
	 }
  }
}

function demora(chamaesta,depoisde){
	tim=setTimeout(chamaesta,parseInt(depoisde));
}

function adjustIFrameSize (iframeWindow) {
	if (iframeWindow.document.width) {
    var iframeElement = document.getElementById(iframeWindow.name);
 	 var titulojanela=document.getElementById('titulobox');
 	 var corpojanela=document.getElementById('framebox');
//	 novolargo = iframeWindow.document.width;
	 novolargo = iframeWindow.document.width + 8;
	 novoalto = iframeWindow.document.height + 8;
    iframeElement.style.width = novolargo + 'px';
    iframeElement.style.height = novoalto + 'px';
	 titulojanela.style.width = novolargo + 'px';
	 corpojanela.style.width = novolargo + 'px';
	 corpojanela.style.height = novoalto + 'px';
  }else{
	  if (document.all) {
		 var iframeElement = document.all[iframeWindow.name];
		 var titulojanela = document.all['titulobox'];
		 var corpojanela = document.all['framebox'];
		 if (iframeWindow.document.compatMode &&
			  iframeWindow.document.compatMode != 'BackCompat') 
		 {
			novoalto = iframeWindow.document.documentElement.scrollHeight;
			novolargo = iframeWindow.document.documentElement.scrollWidth;
			 iframeElement.style.width = novolargo + 'px';
			 iframeElement.style.height = novoalto + 'px';
			 titulojanela.style.width = novolargo + 'px';
			 corpojanela.style.width = novolargo + 'px';
			 corpojanela.style.height = novoalto + 'px';
		 }
		 else {
			novoalto = iframeWindow.document.body.scrollHeight;
			novolargo = iframeWindow.document.body.scrollWidth ;
			 iframeElement.style.width = novolargo + 'px';
			 iframeElement.style.height = novoalto + 'px';
			 titulojanela.style.width = novolargo + 'px';
			 corpojanela.style.width = novolargo + 'px';
			 corpojanela.style.height = novoalto + 'px';
		 }
	  }else{
	// assim funciona com o Opera
			var iframeElement = document.getElementById(iframeWindow.name);
			var titulojanela=document.getElementById('titulobox');
			var corpojanela=document.getElementById('framebox');
			novoalto = iframeWindow.document.body.scrollHeight;
			novolargo = iframeWindow.document.body.scrollWidth;
			 iframeElement.style.width = novolargo + 'px';
			 iframeElement.style.height = novoalto + 'px';
			 titulojanela.style.width = novolargo + 'px';
			 corpojanela.style.width = novolargo + 'px';
			 corpojanela.style.height = novoalto + 'px';
		}
  }
}

function ajustaplayer (iframeWindow,alto,largo) {
  if (iframeWindow.document.height) {
    var iframeElement = document.getElementById(iframeWindow.name);
    iframeElement.style.height = alto + 'px';
    iframeElement.style.width = largo + 'px';
  }
  else if (document.all) {
    var iframeElement = document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode &&
        iframeWindow.document.compatMode != 'BackCompat') 
    {
      iframeElement.style.height = alto + 5 + 'px';
      iframeElement.style.width = largo + 5 + 'px';
    }
    else {
      iframeElement.style.height = alto + 5 + 'px';
      iframeElement.style.width = largo + 5 + 'px';
    }
  }
}

function screens(){
	if (self.innerHeight) // all except Explorer
	{
		largoBrowser = self.innerWidth;
		altoBrowser = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		largoBrowser = document.documentElement.clientWidth;
		altoBrowser = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		largoBrowser = document.body.clientWidth;
		altoBrowser = document.body.clientHeight;
	}
	largoUtil = screen.availWidth;
	altoUtil = screen.availHeight;
	largoScreen = screen.width;
	altoScreen = screen.height;
}



