/*Script: Moo.js	My Object Oriented javascript.Author:	Valerio Proietti, <http://mad4milk.net>License:	MIT-style license.Mootools Credits:	- Class is slightly based on Base.js <http://dean.edwards.name/weblog/2006/03/base/> (c) 2006 Dean Edwards, License <http://creativecommons.org/licenses/LGPL/2.1/>	- Some functions are based on those found in prototype.js <http://prototype.conio.net/> (c) 2005 Sam Stephenson sam [at] conio [dot] net, MIT-style license	- Documentation by Aaron Newton (aaron.newton [at] cnet [dot] com) and Valerio Proietti.*//*Class: Class	The base class object of the <http://mootools.net> framework.Arguments:	properties - the collection of properties that apply to the class. Creates a new class, its initialize method will fire upon class instantiation.Example:	(start code)	var Cat = new Class({		initialize: function(name){			this.name = name;		}	});	var myCat = new Cat('Micia');	alert myCat.name; //alerts 'Micia'	(end)*/var Class = function(properties){	var klass = function(){		if (this.initialize && arguments[0] != 'noinit') return this.initialize.apply(this, arguments);		else return this;	};	for (var property in this) klass[property] = this[property];	klass.prototype = properties;	return klass;};/*Property: empty	Returns an empty function*/Class.empty = function(){};Class.prototype = {	/*	Property: extend		Returns the copy of the Class extended with the passed in properties.	Arguments:		properties - the properties to add to the base class in this new Class.	Example:		(start code)		var Animal = new Class({			initialize: function(age){				this.age = age;			}		});		var Cat = Animal.extend({			initialize: function(name, age){				this.parent(age); //will call the previous initialize;				this.name = name;			}		});		var myCat = new Cat('Micia', 20);		alert myCat.name; //alerts 'Micia'		alert myCat.age; //alerts 20		(end)	*/	extend: function(properties){		var pr0t0typ3 = new this('noinit');		var parentize = function(previous, current){			if (!previous.apply || !current.apply) return false;			return function(){				this.parent = previous;				return current.apply(this, arguments);			};		};		for (var property in properties){			var previous = pr0t0typ3[property];			var current = properties[property];			if (previous && previous != current) current = parentize(previous, current) || current;			pr0t0typ3[property] = current;		}		return new Class(pr0t0typ3);	},	/*	Property: implement		Implements the passed in properties to the base Class prototypes, altering the base class, unlike <Class.extend>.	Arguments:		properties - the properties to add to the base class.	Example:		(start code)		var Animal = new Class({			initialize: function(age){				this.age = age;			}		});		Animal.implement({			setName: function(name){				this.name = name			}		});		var myAnimal = new Animal(20);		myAnimal.setName('Micia');		alert(myAnimal.name); //alerts 'Micia'		(end)	*/	implement: function(properties){		for (var property in properties) this.prototype[property] = properties[property];	}};/* Section: Object related Functions *//*Function: Object.extend	Copies all the properties from the second passed object to the first passed Object.	If you do myWhatever.extend = Object.extend the first parameter will become myWhatever, and your extend function will only need one parameter.Example:	(start code)	var firstOb = {		'name': 'John',		'lastName': 'Doe'	};	var secondOb = {		'age': '20',		'sex': 'male',		'lastName': 'Dorian'	};	Object.extend(firstOb, secondOb);	//firstOb will become: 	{		'name': 'John',		'lastName': 'Dorian',		'age': '20',		'sex': 'male'	};	(end)Returns:	The first object, extended.*/Object.extend = function(){	var args = arguments;	args = (args[1]) ? [args[0], args[1]] : [this, args[0]];	for (var property in args[1]) args[0][property] = args[1][property];	return args[0];};/*Function: Object.Native	Will add a .extend method to the objects passed as a parameter, equivalent to <Class.implement>Arguments:	a number of classes/native javascript objects*/Object.Native = function(){	for (var i = 0; i < arguments.length; i++) arguments[i].extend = Class.prototype.implement;};new Object.Native(Function, Array, String, Number, Class);/*Script: Utility.js	Contains Utility functionsAuthor:	Valerio Proietti, <http://mad4milk.net>License:	MIT-style license.*///htmlelementif (typeof HTMLElement == 'undefined'){	var HTMLElement = Class.empty;	HTMLElement.prototype = {};} else {	HTMLElement.prototype.htmlElement = true;}//window, documentwindow.extend = document.extend = Object.extend;var Window = window;/*Function: $type	Returns the type of object that matches the element passed in.Arguments:	obj - the object to inspect.Example:	>var myString = 'hello';	>$type(myString); //returns "string"Returns:	'element' - if obj is a DOM element node	'textnode' - if obj is a DOM text node	'whitespace' - if obj is a DOM whitespace node	'array' - if obj is an array	'object' - if obj is an object	'string' - if obj is a string	'number' - if obj is a number	'boolean' - if obj is a boolean	'function' - if obj is a function	false - (boolean) if the object is not defined or none of the above.*/function $type(obj){	if (obj === null || obj === undefined) return false;	var type = typeof obj;	if (type == 'object'){		if (obj.htmlElement) return 'element';		if (obj.push) return 'array';		if (obj.nodeName){			switch (obj.nodeType){				case 1: return 'element';				case 3: return obj.nodeValue.test(/\S/) ? 'textnode' : 'whitespace';			}		}	}	return type;};/*Function: $chk	Returns true if the passed in value/object exists or is 0, otherwise returns false.	Useful to accept zeroes.*/function $chk(obj){	return !!(obj || obj === 0);};/*Function: $pick	Returns the first object if defined, otherwise returns the second.*/function $pick(obj, picked){	return ($type(obj)) ? obj : picked;};/*Function: $random	Returns a random integer number between the two passed in values.Arguments:	min - integer, the minimum value (inclusive).	max - integer, the maximum value (inclusive).Returns:	a random integer between min and max.*/function $random(min, max){	return Math.floor(Math.random() * (max - min + 1) + min);};/*Function: $clear	clears a timeout or an Interval.Returns:	nullArguments:	timer - the setInterval or setTimeout to clear.Example:	>var myTimer = myFunction.delay(5000); //wait 5 seconds and execute my function.	>myTimer = $clear(myTimer); //nevermindSee also:	<Function.delay>, <Function.periodical>*/function $clear(timer){	clearTimeout(timer);	clearInterval(timer);	return null;};/*Class: window	Some properties are attached to the window object by the browser detection.Properties:	window.ie - will be set to true if the cur