var DOMElement =
{
	extendFunctionList: new Array(),
	
	extend: function(name,fn)
	{
		if(!document.all)
		{
			HTMLElement.prototype[name] = fn;			
		}
		else
		{
			this.extendFunctionList.push({name:name, fn:fn});
			
			var _createElement = document.createElement;
			document.createElement = function(tag)
			{
				var _elem = _createElement(tag);
				DOMElement.proto(_elem);
				return _elem;
			}
			var _getElementById = document.getElementById;
			document.getElementById = function(id)
			{
				var _elem = _getElementById(id);
				DOMElement.proto(_elem);
				return _elem;
			}
			var _getElementsByTagName = document.getElementsByTagName;
			document.getElementsByTagName = function(tag)
			{
				var _arr = _getElementsByTagName(tag);
				for(var i=0 ; i<_arr.length ; i++)
				{
					DOMElement.proto(_arr.item(i));
				}
				return _arr
			}
		}
	},
	
	proto: function(elm)
	{
		if(!isElement(elm)) return false;
		
		for(var i=0 ; i<this.extendFunctionList.length ; i++)
		{
			elm[this.extendFunctionList[i]['name']] = this.extendFunctionList[i]['fn'];
		}
	}
};
