/**********************************************
: : Projeto, Implementação e Sistematização : :
    VetorialNet Web Design
    webdesign@vetorialnet.com.br
***********************************************/

var mensagem = "Browser Desatualizado!";

var isNav4, isIE, isNS6;
var compl    = ""
var finalObj = ""
var theObj2;
var temporario;

if(parseInt(navigator.appVersion) >=4){
           if(navigator.appName == "Netscape"){
                isNav4   = true
           }else if(document.all){
                isIE     = true
                compl    = "all."
                finalObj = ".style"
           }
}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;
                }

   }else{
             theObj = obj
             return theObj;
   }

}


//Tornar visivel algum objeto.
function show(obj){
   var theObj = getObject(obj)
   theObj.visibility = 'visible'
}

//Tornar invisivel algum objeto.
function hide(obj){
   var theObj = getObject(obj)
   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 {
                theObj.pixelLeft = x
                theObj.pixelTop = 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 {
                return theObj.pixelTop
        }
}



// Retorna a altura de um objeto
function getObjectHeight(obj)  {
        var theObj = getObject(obj)
        if (isNav4) {
                return theObj.clip.bottom
        } else {
                return theObj2.clientHeight
        }
}


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();
        }
        if(isIE){
           theObj2.innerHTML = param;
    }
}


function UpdateObject(obj, fonte, tamanho, cor){
   var theObj = getObject(obj)

        if(isIE){
           theObj.fontSize   = tamanho + "px";
       theObj.fontFamily = fonte;
       theObj.color      = cor;
           theObj.fontWeight = "bold";
    }
}


function changeTo(theObj, x, y) {
//        var theObj = getObject(obj)
        if (isNav4) {
                theObj.moveTo(x,y)
        } else {
                theObj.pixelLeft = x
                theObj.pixelTop = y
        }
}




function abre(pagina,nomeJanela,largura,altura) {
   window.open(pagina,nomeJanela,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + largura + ',height=' + altura)
}

function abre2(pagina,nomeJanela,largura,altura) {
   window.open(pagina,nomeJanela,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + largura + ',height=' + altura)
}