var mensagem = '<html><body topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0><table width=100% height=100% cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr><Td><font face="arial, verdana" size="2" color="#ff0000"><center>Este Site utiliza tecnologia<br>que a versão do seu navegador <b>não suporta.</b><br><br> Por Favor, tente novamente <br>após fazer a atualização do mesmo!</center></font></td></tr></table>';

var isNav4, isIE, isNS6;
var compl    = ""
var finalObj = ""
var theObj2;
var temporario;

if(parseInt(navigator.appVersion) >=4){
           if(navigator.appName == "Netscape" && (!document.getElementById)){
                isNav4   = true
           }else if(document.all){
                isIE     = true
                compl    = "all."
                finalObj = ".style"
           }else if(document.getElementById && navigator.appName == "Netscape"){
		        isNS6    = true
				compl    = "";
				finalObj = "";
		   }
}else{

win = window.open('','ERRO','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=100');
win.document.write(mensagem);
win.document.close();
parent.window.location.replace("about:blank")
}


//Encontrar e definir o objeto.
function getObject(obj){
   var theObj
   if(typeof obj == "string"){
		if(isNav4){
                       numLayers = document.layers.length;
                       for(i=0; i<numLayers; i++){
                          if(document.layers[i].name == obj){
                             theObj = eval("document."+ compl + obj + finalObj)
                             return theObj;
                          }
                          numLayersInterno = document.layers[i].document.layers.length;
                             for(k=0; k<numLayersInterno; k++){
                               if(document.layers[i].document.layers[k].name == obj){
                                  theObj = eval("document.layers[i].document."+ compl+ obj + finalObj)
                                  return theObj;
                               }
                               numLayersInterno2 = document.layers[i].document.layers[k].document.layers.length;
                                  for(j=0; j<numLayersInterno2; j++){
                                      if(document.layers[i].document.layers[k].document.layers[j].name == obj){
                                         theObj = eval("document.layers[i].document.layers[k].document."+ compl+ obj + finalObj)
                                         return theObj;
                                      }
                                      
                                  }
                             }
                       }
                }
                if(isIE){
                       theObj = eval("document."+ compl + obj + finalObj)
                       theObj2 = eval("document."+ compl + obj)					   

                       return theObj;
                       return theObj2;					   
                }
				if(isNS6){
                       theObj = eval(document.getElementById(obj));
                       return theObj;
				}
   }else{
             theObj = obj
             return theObj;
   }

}


//Tornar visivel algum objeto.
function show(obj){
   var theObj = getObject(obj)
   if(isNS6)
      theObj.style.visibility = 'visible'
   else
      theObj.visibility = 'visible'
}

//Tornar invisivel algum objeto.
function hide(obj){
   var theObj = getObject(obj)
   if(isNS6)
      theObj.style.visibility = 'hidden';
   else
      theObj.visibility = 'hidden';
}


//Posicionar um objeto a uma coordenada determinada em pixels.
function shiftTo(obj, x, y) {
	var theObj = getObject(obj)
	if (isNav4) {
		theObj.moveTo(x,y)
	}else if(isIE){
		theObj.pixelLeft = x
		theObj.pixelTop = y
	}else if(isNS6){
		theObj.style.left = x
		theObj.style.top = y
	}
}

//Mover um objeto apartir de uma coordenada em pixels.
function shiftBy(obj, deltaX, deltaY) {
	var theObj = getObject(obj)
	if (isNav4) {
		theObj.moveBy(deltaX, deltaY)
	} else {
		theObj.pixelLeft += deltaX
		theObj.pixelTop += deltaY
	}
}

//Determinar a posicao do objeto em relacao aos outros objetos.
function setZIndex(obj, zOrder) {
	var theObj = getObject(obj)
	theObj.zIndex = zOrder
}


//Determinar a cor de fundo de um objeto.
function setBGColor(obj, color) {
	var theObj = getObject(obj)
	if (isNav4) {
		theObj.bgColor = color
	} else {
		theObj.backgroundColor = color
	}
}


// Retorna a posicao do objeto em relacao a margem esquerda (cord. x).
function getObjectLeft(obj)  {
	var theObj = getObject(obj)
	if (isNav4) {
		return theObj.left
	} else {
		return theObj.pixelLeft
	}
}

// Retorna a posicao do objeto em relacao a margem do topo (cord. y).
function getObjectTop(obj)  {
	var theObj = getObject(obj)
	if (isNav4) {
		return theObj.top
	}else if(isIE){
		return theObj.pixelTop
	}else if(isNS6){
		return theObj.style.top;
	}	
}



// Retorna a altura de um objeto
function getObjectHeight(obj)  {
	var theObj = getObject(obj)
	if(isNav4){
		return theObj.clip.bottom
	}else if(isIE){
		return theObj2.clientHeight
	}else if(isNS6){
		return theObj.offsetHeight;
	}
}


function getObjectWidth(obj)  {
	var theObj = getObject(obj)
	if (isNav4) {
		return theObj.clip.width
	} else {
		return theObj2.clientWidth
	}	
}

function setObjectWidth(obj,param)  {
	var theObj = getObject(obj)
	if (isNav4) {
		theObj.clip.width = param
	} else {
		theObj2.clientWidth = param
	}	
}


function writeObject(obj, param){
   var theObj = getObject(obj)
   if(isNav4){
	   theObj.document.write(param);
	   document.close();
	}else if(isIE){
	   theObj2.innerHTML = param;
    }else if(isNS6){
	   theObj.innerHTML = param;
	}
}


   function scroll(direcao, obj, deltaX, deltaY){
      theObj = getObject(obj)
      ObjAlt = getObjectHeight(obj);
      limiteYtop = ObjAlt - AlturaLayer;

      if(direcao == 'topo'){
         moveCima(obj, deltaX, deltaY)
      }
      if(direcao == 'rodape'){
         moveBaixo(obj, deltaX, deltaY)
      }
   }
   function moveBaixo(obj, deltaX, deltaY){
      deltaX2 = deltaX;
      deltaY2 = deltaY;
      if(isNav4){
         if(theObj.top>-limiteYtop){
            theObj.top -= deltaY
            TimerID = setTimeout("moveBaixo('+obj+',deltaX2,deltaY2)",1)
         }
      }else if(isIE){
         if(theObj.pixelTop>-limiteYtop){
            theObj.pixelTop -= deltaY
            TimerID = setTimeout("moveBaixo('+obj+',deltaX2,deltaY2)",1)
         }
      }else if(isNS6){
         tempa = theObj.style.top;
         tempa = parseFloat(tempa.slice(0,tempa.length-2));
         if(tempa>-limiteYtop){
            theObj.style.top = tempa - deltaY;
            TimerID = setTimeout("moveBaixo('"+obj+"',deltaX2,deltaY2)",1)
         }
      }
   }
   function moveCima(obj, deltaX, deltaY){
      deltaX2 = deltaX;
      deltaY2 = deltaY;
      if(isNav4){
         if(theObj.top<0){
            theObj.top += deltaY
            TimerID = setTimeout("moveCima('+obj+',deltaX2,deltaY2)",1)
         }
      }else if(isIE){
         if(theObj.pixelTop<0){
            theObj.pixelTop += deltaY
            TimerID = setTimeout("moveCima('+obj+',deltaX2,deltaY2)",1)
         }
      }else if(isNS6){
         tempa = theObj.style.top;
         tempa = parseFloat(tempa.slice(0,tempa.length-2));
         if(tempa<0){
            theObj.style.top = tempa + deltaY;
            TimerID = setTimeout("moveCima('"+obj+"',deltaX2,deltaY2)",1)
         }
      }
   }
   function mata(){ if(TimerID) clearTimeout(TimerID); }
