/*------------------------------------------------------------------------
# JA Helio for Joomla 1.5 - Version 1.2 - Licence Owner JA108226
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites:  http://www.joomlart.com -  http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/

/*

Script: Core.js

	Mootools - My Object Oriented javascript.



License:

	MIT-style license.



MooTools Copyright:

	copyright (c) 2007 Valerio Proietti, <http://mad4milk.net>



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 inspired by 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.

*/



var MooTools = {

	'version': 1.1

};



/*

Function: $defined

	Returns true if the passed in value/object is defined, that means is not null or undefined.



Arguments:

	obj - object to inspect

*/



function $defined(obj){

	return (obj != undefined);

};



/*

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

	'arguments' - if obj is an arguments object

	'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

	'regexp' - if obj is a regular expression

	'class' - if obj is a Class. (created with new Class, or the extend of another class).

	'arguments' - if obj is the arguments object.

	'collection' - if obj is a native htmlelements collection, such as childNodes, getElementsByTagName .. etc.

	false - (boolean) if the object is not defined or none of the above.

*/



function $type(obj){

	if (!$defined(obj)) return false;

	if (obj.htmlElement) return 'element';

	var type = typeof obj;

	if (type == 'object' && obj.nodeName){

		switch(obj.nodeType){

			case 1: return 'element';

			case 3: return /\S/.test(obj.nodeValue) ? 'textnode' : 'whitespace';

		}

	}

	if (type == 'object' || type == 'function'){

		switch(obj.constructor){

			case Array: return 'array';

			case RegExp: return 'regexp';

			case Class: return 'class';

		}

		if (typeof obj.length == 'number'){

			if (obj.item) return 'collection';

			if (obj.callee) return 'arguments';

		}

	}

	return type;

};



/*

Function: $merge

	merges a number of objects recursively without referencing them or their sub-objects.



Arguments:

	any number of objects.



Example:

	>var mergedObj = $merge(obj1, obj2, obj3);

	>//obj1, obj2, and obj3 are unaltered

*/



function $merge(){

	var mix = {};

	for (var i = 0; i < arguments.length; i++){

		for (var property in arguments[i]){

			var ap = arguments[i][property];

			var mp = mix[property];

			if (mp && $type(ap) == 'object' && $type(mp) == 'object') mix[property] = $merge(mp, ap);

			else mix[property] = ap;

		}

	}

	return mix;

};



/*

Function: $extend

	Copies all the properties from the second passed object to the first passed Object.

	If you do myWhatever.extend = $extend the first parameter will become myWhatever, and your extend function w