// JavaScript Document
var meupaso=new Object;
var pontofinal=0;
function adjustIFrameSize (iframeWindow) {
  if (iframeWindow.document.height) {
    var iframeElement = document.getElementById
(iframeWindow.name);
    iframeElement.style.height = iframeWindow.document.height + 'px';
    iframeElement.style.width = iframeWindow.document.width + 'px';
  }
  else if (document.all) {
    var iframeElement = document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode &&
        iframeWindow.document.compatMode != 'BackCompat') 
    {
      iframeElement.style.height = 
iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
      iframeElement.style.width = 
iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
    }
    else {
      iframeElement.style.height = 
iframeWindow.document.body.scrollHeight + 5 + 'px';
      iframeElement.style.width = 
iframeWindow.document.body.scrollWidth + 5 + '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 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 == 'block'){
      eval("obj.style.display='none'");
    }else{
	   eval("obj.style.display='block'");
	 }
  }
}
function demora(chamaesta,depoisde){
	tim=setTimeout(chamaesta,parseInt(depoisde));
}

function desliza(chega){
	pontofinal = parseInt(chega);
 	meupaso=setInterval('versemexe()',70);
	return 0;
}

function versemexe(){
//	clearInterval(meupaso);
//	var miinfo = new Object;
//	miinfo = document.getElementById('info');
   var estoy= getCurrentYPos();
	var velo=parseInt((estoy-pontofinal)*0.2);
	if (Math.abs(velo)==0){
		clearInterval(meupaso);
	}else{
		var voypara = parseInt(estoy-velo);
		scrollTo(0,voypara);
	}
//	miinfo.innerHTML="estoy="+estoy+" e velo="+velo;
}

function getCurrentYPos() {
 if (document.body && document.body.scrollTop)
   return document.body.scrollTop;
 if (document.documentElement && document.documentElement.scrollTop)
   return document.documentElement.scrollTop;
 if (window.pageYOffset)
   return window.pageYOffset;
 return 0;
}