/* MSIE 5.5 does not support a wildcard (*) as argument for getElementsByTagName. Use document.all, or if a context node is given, iterate through the childNodes the old-fashioned way */

if(document.all && document.getElementsByTagName('*').length ==0){
	document.getElementsByClassName = function(className, parentElement) {
		var children = new Array();
		parentElement? getElements(children, $(parentElement)) : children = document.all;
		var elements = [], child, pattern = new RegExp("(^|\\s)" + className + "(\\s|$)");
		for (var i = 0, length = children.length; i < length; i++) {
			child = children[i];
			var elementClassName = child.className;
			if (elementClassName.length == 0) continue;
			if (elementClassName == className || elementClassName.match(pattern))
				elements.push(Element.extend(child));
		}
		return elements;
	};

	getElements = function(arr, obj){
		if(obj != undefined){
			for (var i=0;i<obj.childNodes.length;i++){
				if (obj.childNodes[i].nodeType==1){ // Elements only
					arr[arr.length] = obj.childNodes[i];
					getElements(arr, obj.childNodes[i])
				}
			}
		}
	};

}

/* 	MSIE 5.5 does not support the getElementsBySelector.
	Therefore we provide an alternative function getElementsByClassSelector
	as an extension to the prototype Elements.Methods. */
Element.Methods.getElementsByClassSelector = function(element, className) {
	if((navigator.userAgent.indexOf('MSIE')!=-1)&&(navigator.appVersion.indexOf('5.5')!=-1)){
		// Because the function uses a full class selector ('.classname'), 
		// we remove the dot (.) from the classname to be able to use getElementsByClassName.
		return document.getElementsByClassName(className.substr(1), element);
	}else{
		// All other browsers use the getElementsBySelector functionality,
		// because Firefox 3.0 uses a diferent implementation of getElementsByClassName.
		var args = $A(arguments), element = $(args.shift());
		return Selector.findChildElements(element, args);
	}
};