// 
var posx, posy;
//
var isNav, isIE, is4, isDOM;
var coll = "";
var styleObj = "";
is4 = (parseInt(navigator.appVersion)==4);

isNav = (document.layers) ? 1 : 0;
isIE = (document.all) ? 1 : 0;
isDOM = (document.getElementById) ? 1 : 0;

if (isIE) {
	coll = "all.";
	styleObj = ".style";
}
if (isDOM) {
	coll = "getElementById('";
	styleObj = "').style";	
}
//
// Convierte la cadena en un objeto válido
//
function getObject(obj) {
	var theObj;
	if (typeof obj == "string") {
		theObj = eval("document." + coll + obj + styleObj);
	} else {
		theObj = obj;
	}
	return theObj;
}
//
// Posiciona un objeto a una coordenada específica
//
function shiftTo(obj, x, y) {
	var theObj = getObject(obj);
	if (isNav) {
		theObj.moveTo(x, y);
	} else if (isDOM) {
		theObj.pixelLeft = x; 
		theObj.pixelTop = y; 
	} else {
		theObj.pixelLeft = x;
		theObj.pixelTop = y;
	}
}
//
// Mueve un objeto a una coordenada específica
//
function moveTo(obj, deltaX, deltaY) {
	var theObj = getObject(obj);
	if (isNav) {
		theObj.moveBy(deltaX, deltaY);
	} else if (isDOM) {
		theObj.pixelLeft += deltaX;
		theObj.pixelTop += deltaY;
	} else {
		theObj.pixelLeft += deltaX;
		theObj.pixelTop += deltaY;
	}
}
//
// Fija el z-order para un objeto dado
//
function setZIndex(obj, zOrder) {
	var theObj = getObject(obj);
	theObj.zIndex = zOrder;
}
//
// Fija el fondo para un objeto dado
//
function setBGColor(obj, color) {
	var theObj = getObject(obj);
	if (isNav) {
		theObj.bgColor = color;
	} else {
		theObj.backgroundColor = color;
	}
}
//
// Hace visible un objeto
//
function show(obj) {
	var theObj = getObject(obj);
	if (isIE || isDOM) {
		theObj.visibility = "visible";
	} else {
		theObj.visibility = "show";
	}
}
//
// Oculta un objeto
//
function hide(obj) {
	var theObj = getObject(obj);
	theObj.visibility = "hidden";
}
//
// Obtiene la coordenada x de un objeto
//
function getObjLeft(obj) {
	var theObj = getObject(obj);
	if (isNav) {
		return theObj.left;
	} else {
		return theObj.pixelLeft;
	}
}
//
// Obtiene la coordenada y de un objeto
//
function getObjTop(obj) {
	var theObj = getObject(obj);
	if (isNav) {
		return theObj.top;
	} else {
		return theObj.pixelTop;
	}
}
//
// NN tiene problemas con el cambio de tamaño
//
function handleResize() {
	location.reload();
	return false;
}
//
function noimplementado() {
	alert("¡Todavía no implementado!");
	return false;
}

/*
	Despliega una ventana con el documento de la licitación
*/
function despliegaDoc(elDoc) {
	newWin 	= window.open(elDoc, "Documento", "allwaysRaised=yes,dependent=yes,scrollbars,location=yes,menubar=yes,toolbar=yes,height=400,width=600,screenX=0,screenY=0"); 
	newWin.focus();
	return false;
}

/*
*/

function JSClock() {
   var time = new Date();
   var hour = time.getHours();
   var minute = time.getMinutes();
   var second = time.getSeconds();
   var temp = "" + ((hour > 12) ? hour - 12 : hour);
   temp += ((minute < 10) ? ":0" : ":") + minute;
   temp += ((second < 10) ? ":0" : ":") + second;
   temp += (hour >= 12) ? " P.M." : " A.M.";
   document.clockform.digits.value = temp;
   id = setTimeout("JSClock()",1000);
}


