/*/copyright by businessrocker.de/*/Function.prototype.method=function(name, fn){	this.prototype[name]=fn;	return this; };(function(){	function _$(elems){		this.elements=[];		for(var i=0, len=elems.length;i<len;i++){			var element=elems[i];						if(typeof element==='string'){				element2 = document.getElementById(element);					if(typeof element2!="undefined")					if(element2==null)						document.createElementNs?element =document.createElementNS("http://www.w3.org/1999/xhtml","html:"+element):element = document.createElement(element);				else					element = element2;									//alert(element);			}						this.elements.push(element);		}	}	_$.method('each',function(fn){		for(var i=0,len=this.elements.length;i<len; i++){			fn.call(this, this.elements[i]);		}	}).method('setClass', function(name, stelle){		this.each(function(el){			if(typeof stelle=="undefined")				el.className=name;	   			else{				var classArr = el.className.split(" ");				classArr[stelle]=name;				el.className=classArr.join(" ");			}		})		return this;	}).method('setAttribute', function(name, value){		this.each(function(el){			el.setAttribute(name, value);	   		})		return this;	}).method('setStyle', function(prop, val){		this.each(function(el){			el.style[prop]=val;	   		})		return this;	}).method('getStyle', function(prop){		this.each(function(el){			return el.style[prop];	   		})		//return this;	}).method('show', function(){		var thisObj = this;		this.each(function(el){			thisObj.setStyle('display', 'block');			   		})		return this;	}).method('append', function(elem){		this.each(function(el){			if(typeof elem!="undefined"){				el.appendChild(this.checkElem(elem));			}		})		return this;	}).method('appendFirst', function(elem){		this.each(function(el){			el.parentNode.insertBefore(this.checkElem(elem), el.parentNode.firstChild);		})		return this;	}).method('before', function(elem, befelem){		this.each(function(el){			el.parentNode.insertBefore(this.checkElem(elem), this.checkElem(befelem));		})		return this;	}).method('after', function(elem, befelem){		this.each(function(el){			el.parentNode.insertBefore(this.checkElem(elem), this.checkElem(befelem).nextSibling);		})		return this;	}).method('remove', function(elem){		this.each(function(el){			el.removeChild(elem);			//alert(el);		})		return this;	}).method('empty', function(){		this.each(function(el){			while(el.firstChild) 				$(el).remove(el.firstChild);		})		return this;	}).method('checkElem',function(elem){		return elem && elem.constructor==String?document.createTextNode(elem):elem;	}).method('get', function(number){		number=number||0;		return this.elements[number];	})	//EVENTS	.method('addEvent', function(type, fn){		this.each(function(el){			if(el.addEventListener)				el.addEventListener(type, fn, false)			else if(el.attachEvent)				el.attachEvent('on'+type, fn);			else				el['on'+type] = fn;		})		return this;					 	}).method('removeEvent', function(type, fn){		this.each(function(el){			if(el.removeEventListener){				el.removeEventListener(type, fn, false)			}else if(el.detachEvent)				el.detachEvent('on'+type, fn);			else				delete el['on'+type];		})		return this;					 	})	window.$ = function(){		return new _$(arguments);		}})();