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'){				var 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;			}						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){			stelle = stelle || 0;						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('setOpacity', function(val){		this.each(function(el){			if(el.filters)				el.style.filters = 'alpha(opacity='+val+')';			else				el.style.opacity = val/100;		})		return this;	}).method('toggleVis', function(type){		this.each(function(el){			type = type || 'display';			type=='visibility'?				self.DOOMLIB.getStyle(el, type)=='hidden'?$(el).show(type):$(el).hide(type):				self.DOOMLIB.getStyle(el, type)=='none'?$(el).show(type):$(el).hide(type);		})		return this;	}).method('show', function(type){		this.each(function(el){			type=='visibility'?$(el).setStyle('visibility', 'visible'):$(el).setStyle('display', 'block');			   		})		return this;	}).method('hide', function(type){		this.each(function(el){			type=='visibility'?$(el).setStyle('visibility', 'hidden'):$(el).setStyle('display', 'none');		   		})		return this;	}).method('append', function(elem){		this.each(function(el){			if(typeof elem!="undefined"){				el.appendChild(this.checkElem(elem));			}else{				alert('PTDOOMLIB says: not defined');			}		})		return this;	}).method('appendFirst', function(elem){		this.each(function(el){			el.insertBefore(this.checkElem(elem), el.firstChild);		})		return this;	}).method('before', function(elem){		this.each(function(el){			el.parentNode.insertBefore(this.checkElem(elem), this.checkElem(el));		})		return this;	}).method('after', function(elem){		this.each(function(el){			el.parentNode.insertBefore(this.checkElem(elem), this.checkElem(el).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];	}).method('getTarget', function(e){		e=e||window.event;		return e.target||e.srcElement;	}).method('setPageX', function(elem){		this.each(function(el){			var x = elem.offsetParent ? elem.offsetLeft+DOOMLIB.getPageX(elem.offsetParent):elem.offsetLeft;			$(el).setStyle('left', x+'px');		})		return this;	}).method('setPageY', function(elem){		this.each(function(el){			var y = elem.offsetParent ? elem.offsetTop+DOOMLIB.getPageY(elem.offsetParent):elem.offsetTop;			$(el).setStyle('top', y+'px');		})		return this;	}).method('setFullWidth', function(elem){		this.each(function(el){			$(el).setStyle('width', self.DOOMLIB.getFullWidth(elem));		})		return this;	}).method('setFullHeight', function(elem){		this.each(function(el){			$(el).setStyle('height', self.DOOMLIB.getFullHeight(elem));		})		return this;	})	//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);		}})();self.DOOMLIB={	getAgent:function(){				if (navigator.userAgent.search(/MSIE/) > -1) {			agent.browser = 'IE';			var appD = navigator.appVersion.split(";");			agent.version = appD[1].replace(/\s\D+/gi, "");		}else if (navigator.userAgent.search(/Firefox/) > -1) {			agent.browser = 'FF';			agent.version = navigator.appVersion;		}		else if (navigator.userAgent.search(/Safari/) > -1) {			agent.browser = 'S';			agent.version = navigator.appVersion;		}					return agent;	},	getPageX:function(elem){		return elem.offsetParent ? elem.offsetLeft+DOOMLIB.getPageX(elem.offsetParent):elem.offsetLeft;	},	getParentX:function(elem){		return elem.offsetLeft;	},	getPageY:function(elem){		return elem.offsetParent ? elem.offsetTop+DOOMLIB.getPageY(elem.offsetParent):elem.offsetTop;	},	getParentY:function(elem){		return elem.offsetTop;	},	getRelativeHeight:function(elem){		var old = resetCSS(elem, {			height:'',			display:'',			visibility:'hidden'		});		if(DOOMLIB.getStyle(elem, 'display')!='none'){			var h = elem.offsetHeight+'px' || DOOMLIB.getStyle(elem, 'height');			restoreCSS(elem, old);			return h;		}				var h = elem.clientHeight+'px' || DOOMLIB.getStyle(elem, 'height');		restoreCSS(elem, old);		return h;	},	getHeight:function(elem){		var h = elem.offsetHeight+'px' || elem.clientHeight+'px' || DOOMLIB.getStyle(elem, 'height');		return h;	},	getWidth:function(elem){		var h = elem.offsetWidth+'px' || elem.clientWidth+'px' || DOOMLIB.getStyle(elem, 'width');		return h;	},	getFullHeight:function(elem){		var old = resetCSS(elem, {			height:'',			display:'',			visibility:'hidden',			position:'absolute'		});		if(DOOMLIB.getStyle(elem, 'display')!='none'){			var h = elem.offsetHeight+'px' || DOOMLIB.getStyle(elem, 'height');			restoreCSS(elem, old);			return h;		}				var h = elem.clientHeight+'px' || DOOMLIB.getStyle(elem, 'height');		restoreCSS(elem, old);		return h;	},	getRelativeWidth:function(elem){		if(DOOMLIB.getStyle(elem, 'display')!='none')			return elem.offsetWidth+'px' || DOOMLIB.getStyle(elem, 'width');		var old = resetCSS(elem, {			display:'',			visibility:'hidden'		});		var h = elem.clientWidth+'px' || DOOMLIB.getStyle(elem, 'width');		restoreCSS(elem, old);		return h;	},	getFullWidth:function(elem){		if(DOOMLIB.getStyle(elem, 'display')!='none')			return elem.offsetWidth+'px' || DOOMLIB.getStyle(elem, 'width');		var old = resetCSS(elem, {			width:'',			display:'',			visibility:'hidden',			position:'absolute'		});		var h = elem.clientWidth+'px' || DOOMLIB.getStyle(elem, 'width');		restoreCSS(elem, old);		return h;	},	fixE:function(e){		e = e || window.event;		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;		return e;	},	getTarget:function(e){		e = DOOMLIB.fixE(e);		return e.target||e.srcElement;	},	getName:function(e){		return self.DOOMLIB.getTarget(e).nodeName.toLowerCase();	},	stopBubble:function(e){		e = DOOMLIB.fixE(e);		if(e&&e.stopPropagation)			e.stopPropagation();		else			window.event.cancelBubble = true	},	stopDefault:function(e){		e = DOOMLIB.fixE(e);		(e.stopPropagation) ? e.stopPropagation() : e.cancelBubble = true;		(e.preventDefault) ? e.preventDefault() : e.returnValue = false;				return e;	},	getStyle:function(elem, prop){		return elem.style[prop];	},	getComStyle:function(elem, prop){		if(window.getComputedStyle)  			s= window.getComputedStyle(elem, null ).getPropertyValue(prop); 		else if(elem.currentStyle)   			s=elem.currentStyle.backgroundColor; 		else if(document.ids)   			s=elem.bgColor; 		else if(document.all)    		s=elem.style.backgroundColor;		return s;	}}agent = {'browser':'other'}DOOMLIB.getAgent();function resetCSS(elem, prop){	var old = {};	for(var i in prop){		old[i] = elem.style[i];		elem.style[i]=prop[i];	}	return old;}function saveCSS(elem, prop){	var old = {};	for(var i in prop){		old[i] = elem.style[i];	}	return old;}function saveCCSS(elem, prop){	var old = {};	for(var i in prop){		old[i] = DOOMLIB.getComStyle(elem, i);	}	return old;}function restoreCSS(elem, prop){	for(var i in prop){		elem.style[i]=prop[i];	}}function resizeOnScreen(root){		typeof root=="object"? root=root: root = document.getElementById('root');		refObjHeight = 769;		refObjWidth = 1024;		var getScreenHeight = function(){			document.documentElement.clientWidth ? wWidth = document.documentElement.clientWidth : wWidth = window.innerWidth;			document.documentElement.clientHeight ? wHeight = document.documentElement.clientHeight : wHeight = window.innerHeight;		}		var anpassen = function(){			getScreenHeight();			wWidth = Math.max(refObjWidth, wWidth);			wHeight = Math.max(refObjHeight, wHeight);			var screen_w_h = wWidth/wHeight;			var pic_w = 1024;			var pic_h = 676;			var pic_w_h = pic_w/pic_h;			var scale_w_h;			if(pic_w_h>=1){				if (pic_w_h == screen_w_h) {					scale_w_h = Stage.width/pic_w;				} else if (pic_w_h<screen_w_h) {					scale_w_h = wWidth/pic_w;				} else if (pic_w_h>screen_w_h) {					scale_w_h = wHeight/pic_h;				}			}else{				if (pic_w_h == screen_w_h) {					scale_w_h = wWidth/pic_w;				} else if (pic_w_h>screen_w_h) {					scale_w_h = wWidth/pic_w;				} else if (pic_w_h<screen_w_h) {					scale_w_h = wHeight/pic_h;				}			}			if(root.hasChildNodes()){				root.style.overflow = "hidden";				root.firstChild.width = "auto";				root.firstChild.style.width = Math.round(scale_w_h*pic_w)+"px";				root.firstChild.style.height = Math.round(scale_w_h*pic_h)+"px";				root.style.width = wWidth+"px";				root.style.height = wHeight+"px";			}		}		return{			refreshIt:function(e){				anpassen(e);			}			}	}
