	var metodoHistory = "";

	function applyColor(obj) {
		obj.style.background = "#EFEFEF";
	}

	function restoreColor(obj) {
		obj.style.background = "#E0DFE3";
	}

	function onlyNumber() {
	    if ((event.keyCode < 48 || event.keyCode > 57) && event.keyCode != 46)
	        event.returnValue = false;
	}

	function windowAction(source, obj) 
	{
		var windowAction = new getObj('windowAction');
		var iAction = new getObj('iAction');
		var posX = findPosX(obj);
		var posY = findPosY(obj);

		if (metodoHistory == source) 
		{
			windowAction.style.display = "none";
			frm.orderField.style.display = "block";
			metodoHistory = "";
			iAction.obj.src = "";
		} 
		else 
		{
			iAction.obj.src = source;
			windowAction.style.top = 0;
			windowAction.style.left = 0;
			windowAction.style.top = posY + 20;
			windowAction.style.left = posX - 532;
			windowAction.style.display = "block";
			metodoHistory = source;
		}
	}

	function windowClose() {
		var windowAction = new getObj('windowAction');
		windowAction.style.display = "none";
		var iAction = new getObj('iAction');
		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');
			contenedor.style.height = (altura + 15);
			contenido.style.height = (altura + 25);
		}
	}

	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 validateCombos(field) {
	if (field.value=="0") {
		alert("Please, choose some item from list" ); 
		field.focus();
		return false;
	}
	else {return true;}
	}



	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];
		}
	}
	
	


