
	var metodoHistory = "";
	var motodoApplyColor = 1;

	function applyColor(theRow) {
		theRow.style.background = "#FFFEF8";
	}

	function restoreColor(theRow) {
		theRow.style.background = "#ffffff";
	}

	function windowAction(source, obj, title) {
		var windowAction = new getObj('windowAction');
		var windowTitle = new getObj('windowTitle');
		var iAction = new getObj('iAction');
		var posX = findPosX(obj);
		var posY = findPosY(obj);
		
		if (metodoHistory == source) {
			windowAction.style.display = "none";
			metodoHistory = "";
			iAction.obj.src = "";

		} else {
			iAction.obj.src = source;
			iAction.style.height = 90;
			windowAction.style.top = posY + 5; 
			windowAction.style.left = posX - 490;
			windowAction.style.display = "block";
			windowTitle.obj.innerHTML = title;
			metodoHistory = source;
		}
	}

	function windowClose() {
		var windowAction = new getObj('windowAction');
		var iAction = new getObj('iAction');
		windowAction.style.display = "none";
		iAction.obj.src = "";
		metodoHistory = "";
	}

	function setHeight(obj) {
		var bloque = new getObj(obj);
		var altura = bloque.obj.clientHeight;

		if (altura > 0) {
			var contenedor = new getParentObj('windowAction');
			var contenido = new getParentObj('iAction');
			tmp = altura + 15; contenedor.style.height = tmp.toString() + "px";
			tmp = altura + 25; contenido.style.height = tmp.toString() + "px";
		}
	}


	function findPosX(obj) {
		var curleft = 0;
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}
	function findPosY(obj) {
		var curtop = 0;
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}





	function getObj(name) {
		if (document.getElementById) {
			this.obj = document.getElementById(name);
			this.style = document.getElementById(name).style;

		} else if (document.all) {
			this.obj = document.all[name];
			this.style = document.all[name].style;

		} else if (document.layers) {
			this.obj = document.layers[name];
			this.style = document.layers[name];
		}
	}
	function getParentObj(name) {
		if (window.parent.document.getElementById) {
			this.obj = window.parent.document.getElementById(name);
			this.style = window.parent.document.getElementById(name).style;

		} else if (window.parent.document.all) {
			this.obj = window.parent.document.all[name];
			this.style = window.parent.document.all[name].style;

		} else if (window.parent.document.layers) {
			this.obj = window.parent.document.layers[name];
			this.style = window.parent.document.layers[name];
		}
	}

	function onlyNumber() {
		if (event.keyCode < 48 || event.keyCode > 57)
			event.returnValue = false;
	}

	function validoCUIT(valor) {
		coeficiente = new Array(10); 
		coeficiente[0] = 5; coeficiente[1] = 4; coeficiente[2] = 3; coeficiente[3] = 2; coeficiente[4] = 7; 
		coeficiente[5] = 6; coeficiente[6] = 5; coeficiente[7] = 4; coeficiente[8] = 3; coeficiente[9] = 2;
		var sumador = 0; var cuit = new String(valor);
		for (var i = 0; i <= 9; i++) sumador += cuit.substr(i,1) * coeficiente[i];
		if ((sumador % 11) == 0) var digito = 0; else var digito = 11 - (sumador % 11);
		return (digito == cuit.substr(10,1));
	}

