/* ************************************************************************** **
**      new HTMLObject(Object)                                                **
**      Description: Creates an HTMLObject object                             **
**      Arguments: oEl(required) - Object - eg. myHTMLElement                 **
** ************************************************************************** */
HTMLObject = function(oEl) {
	//if(!window.attachEvent) {return oEl;}
	for(property in HTMLObject) { oEl[property] = HTMLObject[property]; }
	return oEl;
}

/* ************************************************************************** **
**      Object.extend(HTMLObject,WhizBang.prototype)                          **
**      Description: Extends an HTMLObject with WhizBang properties           **
**      Arguments: none                                                       **
** ************************************************************************** */
WhizBang = function() { };

/* ************************************************************************** **
**      Object.extend(Object,Object)                                          **
**      Description: Extends objects with properties from other objects       **
**      Arguments: oDestination(required) - Object - eg. myHTMLObject         **
**                 oSource(required) - Object - eg. WhizBang.prototype        **
** ************************************************************************** */
Object.extend = function(oDestination,oSource) {
	for(property in oSource) { oDestination[property] = oSource[property]; }
	return oDestination;
}

/* ************************************************************************** **
**      bind(Object)                                                          **
**      Description: binds a function to a function or object                 **
**                   support for legacy bindWithArguments                     **
**      Arguments: oObj(required) - Object - eg. myObject                     **
** ************************************************************************** */
Function.prototype.bind = Function.prototype.bindWithArguments = function(oObj) {
	var __method = this;
	var args = [];
	for (var i=0,len=arguments.length-1; i<len; i++) { args[i] = arguments[i+1]; }
	return function() { __method.apply(oObj,args); };
};
