/*
// File: custom_DOM_and_Event_model.js
// Description: Adds/Enhances to the Default Functionality of WebPage/Document/Browser DOM and Event Model.
// Author: Ronnie Depp 
		
		My eMailbox: 	mr.salman.ahmad@gmail.com 
		Twitter: 		@RonnyDepp
		Personal Blog: 	http://ronnydepp.blogspot.com 
		Personal Site: 	http://ronniedepp.co.cc 
		Tech Blog: 		http://techbytes-from-ronnie.blogspot.com 
		Voice: 			+92 313 407 0856 (my cell phone number)
		Snail Mail: 	43, block K, Model Town Co-operative Society, Lahore, 54700, Punjab, Pakistan.
		
// Dated: Monday, June 28, 2010.
// PLEASE RETAIN THE ABOVE MENTIONED ATTRIBUTIONS | If you want to use this file for your own implementations, please retain the commented attribution and ask me before the use of this code via my emailbox: mr.salman.ahmad@gmail.com
*/

/*
---------------------------------------------
© Copyright www.theboxerring.com 2010.

Christa Cook
The Boxer Ring - www.TheBoxerRing.com
P.O. Box 128
Edwardsville, IL 62025
Phone:  (+1) 618-960-6316
Email:  theboxerring@earthlink.net
---------------------------------------------
*/


// Define/Add/Enhance the _DOM of Document Object Model of the Browser/Document
var _Dom = {
	get: function(el) {
	  if (typeof el === 'string') {
		return document.getElementById(el);
	  } else {
		return el;
	  }
	},
	add: function(el, dest) {
	  var el = this.get(el);
	  var dest = this.get(dest);
	  dest.appendChild(el);
	},
	remove: function(el) {
	  var el = this.get(el);
	  el.parentNode.removeChild(el);
	}
};
// Define/Add/Enhance the _Event to DOM 's Event Model
var _Event = {
	add: function() {
	  if (window.addEventListener) {
		return function(el, type, fn) {
		  _Dom.get(el).addEventListener(type, fn, false);
		};
	  } else if (window.attachEvent) {
		return function(el, type, fn) {
		  var f = function() {
			fn.call(_Dom.get(el), window.event);
		  };
		  _Dom.get(el).attachEvent('on' + type, f);
		};
	  }
	}()
};
//Bind Events
/*
_Event.add(window, 'load', function() {
	var i = 0;
	_Event.add('add-element', 'click', function() {
		  var el = document.createElement('p');
		  el.innerHTML = 'Remove This Element (' + ++i + ')';
		  Dom.add(el, 'content');
		  _Event.add(el, 'click', function(e) {
				Dom.remove(this);
		  });
	});
});
*/

