var isNav, isIE;
var coll = "";
var styleObj = "";
if( parseInt(navigator.appVersion) >= 4 ) {
    if( navigator.appName == "Netscape" ) {
        isNav = true;
    }
    else {
        isIE = true;
        coll = "all.";
        styleObj = ".style";
    }
}

// Convierte un nombre como string de un objeto o una referencia a un objeto
// en un objeto valido, dependiendo del browser
function getObject(obj) {
    var theObj;
    if( typeof obj == "string" ) {
        theObj = eval("document." + coll + obj + styleObj);
    }
    else {
        theObj = obj;
    }
    return theObj;
}

// Posiciona un objeto en una coordenada dada en pixeles
function shiftTo(obj, x, y) {
    var theObj = getObject(obj);
    if( isNav ) {
        theObj.moveTo( x,y );
    }
    else {
        theObj.pixelLeft = x;
        theObj.pixelTop = y;
    }
}

// Mueve un objeto en x e y pixeles
function shiftBy(obj, x, y) {
   var theObj = getObject(obj);
   if( isNav ) {
       theObj.moveBy(x,y);
   }
   else {
       theObj.pixelLeft += x;
       theObj.pixelTop += y;
   }
}

// Cambia el orden de almacenamiento en la pila de un objeto
function setIndex(obj, zOrder) {
   var theObj = getObject(obj);
   theObj.zIndex = zOrder;
}

// Cambia el color de fondo de un objeto
function setBGColor(obj, color) {
   var theObj = getObject(obj);
   if( isNav ) {
       theObj.bgColor = color;
   }
   else {
       theObj.backgroundColor = color;
   }
}

// Vuele visible un objeto
function show(obj) {
   var theObj = getObject(obj);
   if( isNav )
       theObj.visibility = "show";
   else
       theObj.visibility = "visible";
}

// esconde un objeto
function hide(obj) {
   var theObj = getObject(obj);
   if( isNav )
       theObj.visibility = "hide";
   else
       theObj.visibility = "hidden";
}

// Retorna la coordenada X del objeto
function getObjectLeft(obj) {
   var theObj = getObject(obj);
   if( isNav ) {
       return theObj.left;
   }
   else {
       return theObj.pixelLeft;
   }
}

// Retorna la coordenada Y del objeto
function getObjectTop(obj) {
   var theObj = getObject(obj);
   if( isNav ) {
       return theObj.top;
   }
   else {
       return theObj.pixelTop;
   }
}

// Cambia el tamano de un objeto a W pixeles de ancho y H pixeles de alto.
function resizeObjectTo(obj, w, h) {
   var theObj = getObject(obj);
   if( isNav ) {
       theObj.resizeTo(w,h);
   }
   else {
       theObj.width = w;
       theObj.height = h;
   }
}

// Aumenta el tamano de un objeto en W pixeles de ancho y H pixeles de alto.
function resizeObjectBy(obj, w, h) {
   var theObj = getObject(obj);
   if( isNav ) {
       theObj.resizeBy(w,h);
   }
   else {
       theObj.clientWidth += w;
       theObj.clientHeight += h;
   }
}

// Crea un area de Clip de W pixeles de ancho por H de alto
function ClipObject(obj, w, h) {
   var theObj = getObject(obj);
   if( isNav ) {
       theObj.resizeTo(w,h);
   }
   else {
       theObj.posWidth = w;
       theObj.posHeight = h;
   }
}


