if (typeof AZUL == "undefined") {
    /**
     * The AZUL global namespace object.  If AZUL is already defined, the
     * existing AZUL object will not be overwritten so that defined
     * namespaces are preserved.
     * @class AZUL
     * @static
     */
    var AZUL = {};
};
document.getElementByID = function( id )
{
	var element = null; 
	var style = null;
	if ( document.getElementById )
	{
		element = document.getElementById( id );
		style = document.getElementById( id ).style;
	}
	else if (document.all)
 	{
		element = document.all[id];
		style = document.all[id].style;
	}
	else if (document.layers)
	{
		element = document.layers[id];
		style = document.layers[id].style;
	}
	return element;	
};

AZUL.Dom = function()
{
	this.element = "";
	AZUL.Dom.prototype.getAttribute = function( element, attribute )
	{
		if ( element.getAttribute ) 
		{
			return element.getAttribute(attribute);
		}
		else 
		{
			return eval("element."+attribute);
		}
	}
	AZUL.Dom.prototype.getElement = function(id)
	{
		return document.getElementByID( id );
	};
	
	AZUL.Dom.prototype.findPos = function(obj) 
	{
		var curleft = curtop = 0;
		if (obj.offsetParent) 
		{
			do 
			{
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		}
		return [curleft,curtop];
	}
	/** 
	 * Funcion encaragada de retornar la posicion X del elemento obj
	 *
	 * @param: obj - Objeto del cual queremos conocer su posicion X
	 */
	AZUL.Dom.prototype.posX = function(obj)
	{
		var result_x = 0;
		if (obj.offsetParent) 
		{
			while (obj.offsetParent) 
			{
		  		result_x += obj.offsetLeft
		  		obj = obj.offsetParent;
			}
		}
		else if (obj.x)
		{
			result_x += obj.x;
		}
		return result_x;
	};
	/** 
	 * Funcion encaragada de retornar la posicion Y del elemento obj
	 *
	 * @param: obj - Objeto del cual queremos conocer su posicion Y
	 */
	AZUL.Dom.prototype.posY = function(obj)
	{
		var result_y = 0;
		if (obj.offsetParent) 
		{
		    while (obj.offsetParent) 
		    {
		        result_y += obj.offsetTop
		        obj = obj.offsetParent;
		    }
		}
		else if (obj.y)
		{
		    result_y += obj.y;
		}
		return result_y;
	};
};
AZUL.dom = new AZUL.Dom();