/**************************************

  JH CORE MODULE v2
  
  (c) 2005-2010 by Juergen Hoog
  
	jh('#element')
		.left()					// get absolute left
		.left(relative=false)	// get absolute/relative left
		.left(value)			// set left
		.top()					// get absolute top
		.top(relative=false)	// get absolute/relative top
		.top(value)				// set top
		.width()				// get outer width
		.width(inner=false)		// get inner/outer width
		.width(value)			// set width
		.height()				// get outer height
		.height(inner=false)	// get inner/outer height
		.height(value)			// set height
		.border()				// get border width: left/right/top/bottom
			.left
			.right
			.top
			.bottom
		.addEvent(evtype, listenerfunc, usecapture)
		.centralize(keep=false)	// position element in middle of browser window ("keep" keeps the window centered all the time)
		.maximize(kepp=false)
		.arrange(where, from='window', offset=0, keep=false)
		.windowlock()			// gibt den lockstatus zurück
		.windowlock(true/false) // setzt den lockstatus des elements, sodass es nur innerhalb des anzeigefensters positioniert werden kann
		.visible()
		.visible(true/false)	// setzt den sichtbarkeitsstatus des elements (achtung: visibility, nicht display mode!)
		.ajax(url, beginfunc, endfunc, errfunc, disable_global_funcs)
		
	jh() = jh(window)
		.left()
		.top()
		.height()
		.width()
		.exec(function)			// Führt eine oder mehrere Funktionen aus. Erwartet entweder eine Funktion, einen String mit einem Funktionsnamen oder ein Array mit Funktionen/Funktionsnamen als Parameter
		.addEvent(evtype, listenerfunc, usecapture)
		.doctype()
			.dtd
			.xhtml
			.version
			.importance
		.redir(url)
		.ajax_add_global_func(beginfunc, endfunc, errorfunc)
		.array
			.unique(array)		// Alle Elemente eines Arrays werden einzigartig
			
	jh('mouse')
		.left()
		.top()
		.height()	// 0
		.width()	// 0
		
	jh(document)
		HINWEIS: Ist eine DTD vorhanden, geben die jh(document).height/width Funktionen manchmal nicht korrekte Werte zurück.
		Grund ist, dass margin-bottom beim letzten element und <p>&nbsp;</p> am Seitenende nicht einbezogen werden.
		Um fehlberechnungen zu vermeiden, ist es entweder sinnvoll, auf diese ganz zu verzichten oder
		am Seitenende ein <span style="visibility:hidden;">&nbsp;</span> zu haben.
		.height()
		.width()

***************************************/

jh_core_global = new Array();
function jh(selector) {
	if (!jh_core_global[selector]) jh_core_global[selector] = new jh_core(selector);
	return jh_core_global[selector];
}
function jh_core(selector) {
	
// ----- window -----
	if ((typeof(selector) == 'undefined') || (selector == window) || (selector == 'window')) {
		
		this.ajax_global = {
			beginfunc: new Array(),
			endfunc: new Array(),
			errorfunc: new Array()
		}

		this.left = function() {
			if (window.pageXOffset) {
				return window.pageXOffset;
			} else if (document.documentElement && document.documentElement.scrollLeft) {
				return document.documentElement.scrollLeft;
			} else if (document.body && document.body.scrollLeft) {
				return document.body.scrollLeft;
			} else {
				return 0;
			}
		}
		
		this.top = function(settop) {
			if (window.pageYOffset) {
				return window.pageYOffset;
			} else if (document.documentElement && document.documentElement.scrollTop) {
				return document.documentElement.scrollTop;
			} else if (document.body && document.body.scrollTop) {
				return document.body.scrollTop;
			} else {
				return 0;
			}
		}
		
		this.width = function() {
			if (!jh().doctype().dtd && document.body && document.body.clientWidth) {
				return document.body.clientWidth;
			} else if (jh().doctype().dtd && document.documentElement && document.documentElement.clientWidth) {
				return document.documentElement.clientWidth;
			} else if (window.innerWidth) {
				return window.innerWidth;
			} else if (document.documentElement && document.documentElement.clientWidth) {
				return document.documentElement.clientWidth;
			} else if (document.body && document.body.clientWidth) {
				return document.body.clientWidth;
			} else {
				return 0;
			}
		}
		
		this.height = function() {
			if (!jh().doctype().dtd && document.body && document.body.clientHeight) {
				return document.body.clientHeight;
			} else if (jh().doctype().dtd && document.documentElement && document.documentElement.clientHeight) {
				return document.documentElement.clientHeight;
			} else if (window.innerHeight) {
				return window.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) {
				return document.documentElement.clientHeight;
			} else if (document.body && document.body.clientHeight) {
				return document.body.clientHeight;
			} else {
				return 0;
			}
		}

		this.exec = function(func) {
			if (func) {
				switch (typeof(func)) {
					case 'string':
					case 'number':
						func = eval(func);
						if (typeof(func) == 'function') func();
						break;
					case 'object':
						for (var i=0; i < func.length; i++) {
							jh().exec(func[i]);
						}
						break;
					case 'function':
						func();
						break;
				}
			}
		}

		this.addEvent = function(evtype, listenerfunc, useCapture) {
			evtype = evtype.replace(/^on/, '');
			if (window.addEventListener) {
				window.addEventListener(evtype, listenerfunc, useCapture);
			} else if (window.attachEvent) {
				window.attachEvent('on' + evtype, listenerfunc);
			} else {
				window['on' + evtype] = listenerfunc;
			}
		}
		
		/*
		this.removeEvent = function(evtype, listenerfunc, useCapture) {
			evtype = evtype.replace(/^on/, '');
			if (window.addEventListener) {
				window.addEventListener(evtype, listenerfunc, useCapture);
			} else if (window.attachEvent) {
				window.attachEvent('on' + evtype, listenerfunc);
			} else {
				window['on' + evtype] = listenerfunc;
			}
		}
		*/
		
		this.redir = function(url) {
			if (top) {
				top.location.href = url;
			} else {
				window.location.href = url;
			}
		}
		
		this.ajax_add_global_func = function(beginfunc, endfunc, errorfunc) {
			if (beginfunc) this.ajax_global.beginfunc.push(beginfunc);
			if (endfunc) this.ajax_global.endfunc.push(endfunc);
			if (errorfunc) this.ajax_global.errorfunc.push(errorfunc);
		}
		
		// function inspired by
		// http://roseindia.net/java/javascript-array/javascript-array-unique.shtml
		this.array_unique = function(arr) {
			var ret = new Array();
			label:for (var i=0; i<arr.length; i++ ) {  
				for (var j=0; j<ret.length; j++ ) {
					if (ret[j]==arr[i]) continue label;
				}
				ret.push(arr[i]);
			}
			return ret;
		}
		
		// function inspired by
		// http://bytes.com/topic/javascript/answers/520145-doctype-detector
		this.doctype = function() {
			var re = /\s+(X?HTML)\s+([\d\.]+)\s*([^\/]+)*\//gi;
			var mydtd = false;
			
			if (typeof(document.namespaces) != 'undefined') {
				if (document.all[0].nodeType == 8) {
					mydtd = true;
					re.exec(document.all[0].nodeValue);
				}
			} else {
				if (document.doctype != null) {
					mydtd = true;
					re.exec(document.doctype.publicId);
				}
			}
					
			return {
				dtd: mydtd,
				xhtml: ((mydtd) ? RegExp.$1 : ''),
				version: ((mydtd) ? RegExp.$2 : ''),
				itype: ((mydtd) ? RegExp.$3 : '')
			}
		}
	}



// ----- document -----
	if ((selector) && ((selector == document) || (selector == 'document'))) {

		this.width = function() {
			tempwidth = 0;
			if (document.width) 
				tempwidth = document.width;
			if (document.body.scrollWidth && (document.body.scrollWidth > tempwidth)) 
				tempwidth = document.body.scrollWidth;
			if (document.body.offsetWidth && (document.body.offsetWidth > tempwidth)) 
				tempwidth = document.body.offsetWidth;
			if (document.body && document.body.clientWidth && (document.body.clientWidth > tempwidth)) 
				tempwidth = document.body.clientWidth;
			if (document.documentElement && document.documentElement.clientWidth && (document.documentElement.clientWidth > tempwidth))
				tempwidth = document.documentElement.clientWidth;
				
			if ((tempwidth <= 0) && (document.innerWidth))
				tempwidth = document.innerWidth;

			/*
			alert(
				'doc.width:' + ((document.width) ? document.width : 'undef ') + "\n" +
				'body.client:' + ((document.body.clientWidth) ? document.body.clientWidth : 'undef ') + "\n" +
				'el.width:' + ((document.documentElement.clientWidth) ? document.documentElement.clientWidth : 'undef ') + "\n" +
				'innerwidth:' + ((document.innerWidth) ? document.innerWidth : 'undef ') + "\n" +
				'document.body.width:' + ((document.body.width) ? document.body.width : 'undef ') + "\n" + 
				'document.body.style.width:' + ((document.body.style.width) ? document.body.style.width : 'undef ') + "\n" + 
				'screen.availwidth:'  + ((screen.availWidth) ? screen.availWidth : 'undef ') + "\n" + 
				'screen.width:'  + ((screen.width) ? screen.width : 'undef ') + "\n" + 
				'scrollwidth:' + ((document.body.scrollWidth) ? document.body.scrollWidth : 'undef ') + "\n" + 
				''
			);
			*/
			return tempwidth;
		}
		
		this.height = function() {
			tempheight = 0;
			if (document.height) 
				tempheight = document.height;
			if (document.body.scrollHeight && (document.body.scrollHeight > tempheight)) 
				tempheight = document.body.scrollHeight;
			if (document.body.offsetHeight && (document.body.offsetHeight > tempheight)) 
				tempheight = document.body.offsetHeight;
			if (document.body && document.body.clientHeight && (document.body.clientHeight > tempheight)) 
				tempheight = document.body.clientHeight;
			if (document.documentElement && document.documentElement.clientHeight && (document.documentElement.clientHeight > tempheight))
				tempheight = document.documentElement.clientHeight;
				
			if ((tempheight <= 0) && (document.innerHeight))
				tempheight = document.innerHeight;
			
			/*
			alert(
				  'doc.height:' + ((document.height) ? document.height : 'undef ') + "\n" +
				  'body.client:' + ((document.body.clientHeight) ? document.body.clientHeight : 'undef ') + "\n" +
				  'el.height:' + ((document.documentElement.clientHeight) ? document.documentElement.clientHeight : 'undef ') + "\n" +
				  'innerheight:' + ((document.innerHeight) ? document.innerHeight : 'undef ') + "\n" +
				  'document.body.height:' + ((document.body.height) ? document.body.height : 'undef ') + "\n" + 
				  'document.body.offsetHeight:' + ((document.body.offsetHeight) ? document.body.offsetHeight : 'undef ') + "\n" + 
				  'document.body.scrollHeight:' + ((document.body.scrollHeight) ? document.body.scrollHeight : 'undef ') + "\n" + 
					''
				  );
			*/
			return tempheight;
		}	
	}
	
// ----- Screen -----
	if ((selector) && ((selector == screen) || (selector == 'screen'))) {
		this.left = function() {
			return (screen.left) ? screen.left : 0;
		}
		
		this.top = function(settop) {
			return (screen.top) ? screen.top : 0;
		}
		
		this.width = function() {
			return (screen.width) ? screen.width : 0;
		}
		
		this.height = function() {
			return (screen.height) ? screen.height : 0;
		}
		
		this.availWidth = function() {
			return (screen.availWidth) ? screen.availWidth : 0;
		}
		
		this.availHeight = function() {
			return (screen.availHeight) ? screen.availHeight : 0;
		}
	}

// ----- #Element -----
	if ((selector) && (selector.match(/^#.+$/))) {
		element = selector.substring(1);
		if (document.getElementById(element)) {
			this.el = document.getElementById(element);
		} else {
			return false;
		}

		this.position_windowlock = false;
		this.http_request = null;
		
		this.top = function(settop) {
			switch (typeof(settop)) {
				case 'number':
				case 'string':
					settop = parseInt(settop);
					if (this.position_windowlock) {
						if (settop > (jh().top() + jh().height())) settop = jh().top() + jh().height();
						if (settop < jh().top()) settop = jh().top();
					}
					this.el.style.top = settop + 'px';
					break;
				default:
					if (settop) {
						// relative
						return this.el.offsetTop;
					} else {
						// absolute:
						// solange elem ein Objekt ist und die Eigenschaft offsetTop enthaelt
						// wird diese Schleife fuer das Element und all seine Offset-Eltern ausgefuehrt
						elem = this.el; y=0; x=0;
						while ((typeof(elem) == 'object') && (elem.tagName) && (typeof(elem.tagName) != 'undefined')) {
							y+=elem.offsetTop;	// Offset des jeweiligen Elements addieren
							x+=elem.offsetLeft;	// Offset des jeweiligen Elements addieren
						
							// wenn beim Body-tag angekommen elem fuer Abbruch auf 0 setzen
							switch (elem.tagName.toLowerCase()) {
								case 'body':
								case 'html':
									elem = 0;
							}
						
							// wenn elem ein Objekt ist und offsetParent enthaelt Offset-Elternelement ermitteln
							if ((typeof(elem) == 'object') && (typeof(elem.offsetParent) == 'object')) {
								elem=elem.offsetParent;
							}
						}
						return y;
					}
			}
		}
		
		this.left = function(setleft) {
			switch (typeof(setleft)) {
				case 'number':
				case 'string':
					setleft = parseInt(setleft);
					if (this.position_windowlock) {
						if (setleft > (jh().left() + jh().width() - this.width())) setleft = jh().left() + jh().width() - this.width();
						if (setleft < jh().left()) setleft = jh().left();
					}
					this.el.style.left = parseInt(setleft) + 'px';
					break;
				default:
					if (setleft) {
						// relative
						return this.el.offsetLeft;
					} else {
						// absolute:
						// solange elem ein Objekt ist und die Eigenschaft offsetTop enthaelt
						// wird diese Schleife fuer das Element und all seine Offset-Eltern ausgefuehrt
						elem = this.el; y=0; x=0;
						while ((typeof(elem) == 'object') && (elem.tagName) && (typeof(elem.tagName) != 'undefined')) {
							y+=elem.offsetTop;	// Offset des jeweiligen Elements addieren
							x+=elem.offsetLeft;	// Offset des jeweiligen Elements addieren
						
							// wenn beim Body-tag angekommen elem fuer Abbruch auf 0 setzen
							switch (elem.tagName.toLowerCase()) {
								case 'body':
								case 'html':
									elem = 0;
							}
						
							// wenn elem ein Objekt ist und offsetParent enthaelt Offset-Elternelement ermitteln
							if ((typeof(elem) == 'object') && (typeof(elem.offsetParent) == 'object')) {
								elem=elem.offsetParent;
							}
						}
						return x;
					}
			}
		}
		
		this.windowlock = function(setwindowlock) {
			switch (typeof(setwindowlock)) {
				case 'boolean':
					this.position_windowlock = (setwindowlock == true);
					break;
				default:
					return this.position_windowlock;
			}
		}
		
		this.width = function(setwidth) {
			switch (typeof(setwidth)) {
				case 'number':
				case 'string':
					setwidth = parseInt(setwidth);
					this.el.style.width = ((setwidth < 0) ? '0' : setwidth) + 'px';
					break;
				default:
					if (!setwidth) {
						return this.el.offsetWidth;
					} else {
						return this.el.offsetWidth - this.border().left - this.border().right;
					}
			}
		}
		
		this.height = function(setheight) {
			switch (typeof(setheight)) {
				case 'number':
				case 'string':
					setheight = parseInt(setheight);
					this.el.style.height = ((setheight < 0) ? '0' : setheight) + 'px';
					break;
				default:
					if (!setheight) {
						return this.el.offsetHeight;
					} else {
						return this.el.offsetHeight - this.border().top - this.border().bottom;
					}
			}
		}
		
		// funktioniert aus irgendeinem grunde nicht
		/*this.position = function(x, y, w, h) {
			if ((typeof(x) == 'number') || (typeof(x) == 'string')) this.top(x);
			if ((typeof(y) == 'number') || (typeof(y) == 'string')) this.left(y);
			if ((typeof(w) == 'number') || (typeof(w) == 'string')) this.width(w);
			if ((typeof(h) == 'number') || (typeof(h) == 'string')) this.left(h);
		}*/
		
		this.border = function() {
			if (document.defaultView) {
				// Firefox + Safari + Opera
				bl = parseInt(document.defaultView.getComputedStyle(this.el, null).getPropertyValue('border-left-width'));
				bt = parseInt(document.defaultView.getComputedStyle(this.el, null).getPropertyValue('border-top-width'));
				br = parseInt(document.defaultView.getComputedStyle(this.el, null).getPropertyValue('border-right-width'));
				bb = parseInt(document.defaultView.getComputedStyle(this.el, null).getPropertyValue('border-bottom-width'));
			} else if (this.el.currentStyle) {
				// IE (+ Opera)
				bl = parseInt(this.el.currentStyle['borderLeftWidth']);
				bt = parseInt(this.el.currentStyle['borderTopWidth']);
				br = parseInt(this.el.currentStyle['borderRightWidth']);
				bb = parseInt(this.el.currentStyle['borderBottomWidth']);
				if (isNaN(bl)) bl = 0;
				if (isNaN(bt)) bt = 0;
				if (isNaN(br)) br = 0;
				if (isNaN(bb)) bb = 0;
			} else {
				bl = bt = br = bb = 0;
			}
			
			return {
				left: bl,
				right: br,
				top: bt,
				bottom: bb
			}
		}
		
		this.addEvent = function(evtype, listenerfunc, useCapture) {
			evtype = evtype.replace(/^on/, '');
			if (this.el.addEventListener) {
				this.el.addEventListener(evtype, listenerfunc, useCapture);
			} else if (this.el.attachEvent) {
				this.el.attachEvent('on' + evtype, listenerfunc);
			} else {
				this.el['on' + evtype] = listenerfunc;
			}
		}
	
		this.centralize = function(register_handler) {
			tempwidth = this.width();
			tempheight = this.height();
			//this.el.style.position = 'absolute';
			this.top(parseInt((jh().height() - tempheight) / 2) + jh().top());
			this.left(parseInt((jh().width() - tempwidth) / 2) + jh().left());
			//this.width(tempwidth);	// w+h können sich durch positionsänderung verändern, daher wieder auf die alten w+h zurücksetzen setzen
			//this.height(tempheight);
			
			if (register_handler == true) {
				function jh_centralizefunc (eventobject) {jh(selector).centralize();}
				jh().addEvent('resize', jh_centralizefunc);
				jh().addEvent('scroll', jh_centralizefunc);
			}
		}
		
		this.maximize = function(register_handler, maximize_global) {
			this.left((maximize_global && (maximize_global == true)) ? 0 : jh().left());
			this.top((maximize_global && (maximize_global == true)) ? 0 : jh().top());
			this.height(jh((maximize_global && (maximize_global == true)) ? 'document' : 'window').height() - this.border().top - this.border().bottom);
			this.width(jh((maximize_global && (maximize_global == true)) ? 'document' : 'window').width() - this.border().left - this.border().right);
			
			if (register_handler == true) {
				function jh_maximizefunc (eventobject) {jh(selector).maximize(false, maximize_global);}
				jh().addEvent('resize', jh_maximizefunc);
				jh().addEvent('scroll', jh_maximizefunc);
			}
		}
		
		this.ajax = function(url, beginfunc, endfunc, errfunc, disable_global_funcs, return_value) {
			if (window.XMLHttpRequest) { // Mozilla, Safari,...
				this.http_request = new XMLHttpRequest();
			} else if (window.ActiveXObject) { // IE
				try {
					this.http_request = new ActiveXObject('Microsoft.XMLHTTP');
				} catch (e) {
					try {
						this.http_request = new ActiveXObject('Msxml2.XMLHTTP');
					} catch (e) {}
				}
			}
		
			if (!this.http_request) {
				if (errfunc) {
					jh().exec(errfunc);
				} else {
					alert('AJAX ERROR 001 - Could not load AJAX Object.');
				}
				return false;
			}
			
			// global beginfunc ausfuehren
			if (!disable_global_funcs) jh().exec(jh().ajax_global.beginfunc);
			
			// beginfunc ausfuehren
			if (beginfunc) jh().exec(beginfunc);

			// readyStates: 
			//	0 uninitialized
			//	1 loading (send aufgerufen)
			//	2 loaded (header+status verfuegbar)
			// 	3 interactive (downloading)
			//	4 completed
			this.http_request.onreadystatechange = function jh_ajaxfunc() {
				switch (jh(selector).http_request.readyState) {
					case 4:
						switch (jh(selector).http_request.status) {
							case 200:
							case 304:
								if (return_value) {
									eval('return_value') = jh(selector).http_request.responseText;
								} else {
									jh(selector).innerHTML(jh(selector).http_request.responseText);
								}
								
								// JS nachladen
								/*scripts = jh(selector).http_request.responseText.match(/\<script.*\>((.|\n|\r)*)\<\/script\>/gi);
								for (s in scripts) {
									alert(scripts[s].replace(/\<script.*\>((.|\n|\r)*)\<\/script\>/gi, '$1'));
									eval(scripts[s].replace(/\<script.*\>((.|\n|\r)*)\<\/script\>/gi, '$1'));
								}*/
								
								if (!disable_global_funcs) jh().exec(jh().ajax_global.endfunc);
								if (endfunc) jh().exec(endfunc);
								break;
							default:
								if (errfunc || (jh().ajax_global.errorfunc && !disable_global_funcs)) {
									if (!disable_global_funcs) jh().exec(jh().ajax_global.errorfunc);
									jh().exec(errfunc);
								} else {
									alert('AJAX ERROR 003 - ' + jh(selector).http_request.statusText + ' (Status ' + jh(selector).http_request.status + ')');
								}
								break;
						}
				}
			}

			try {
				this.http_request.open('GET', url + '&frm[ajax]=1', true);
				this.http_request.send(null);
			} catch(e) {
				this.http_request.abort();
				if (errfunc || (jh().ajax_global.errorfunc && !disable_global_funcs)) {
					if (!disable_global_funcs) jh().exec(jh().ajax_global.errorfunc);
					jh().exec(errfunc);
				} else {
					alert('AJAX ERROR 002 - Could not load specified url.');
				}
			}
		}
		
		this.ajaxabort = function() {
			if (this.http_request) this.http_request.abort();
		}
		
		this.mouseover = function(data) {
		}
		

		this.className = function(cn) {
			switch (typeof(cn)) {
				case 'undefined':
					return ((this.el.className) ? this.el.className : '');
				default:
					if (this.el) this.el.className = cn;
			}
		}

		this.innerHTML = function(html) {
			switch (typeof(html)) {
				case 'undefined':
					return ((this.el.innerHTML) ? this.el.innerHTML : '');
				default:
					if (this.el) this.el.innerHTML = html;
			}
		}
		
		this.visible = function(setvisible) {
			switch (typeof(setvisible)) {
				case 'undefined':
					return (this.el.style.visibility == 'visible');
				default:
					if (this.el) this.el.style.visibility = (setvisible) ? 'visible' : 'hidden';
			}
		}

		this.arrange = function(where, from, offset, register_handler) {
			if (!from) from = 'window';
			if (!offset) offset = 0;
			offset = parseInt(offset);
			
			l = (where.search(/left|L/) != -1);
			r = (where.search(/right|R/) != -1);
			t = (where.search(/top|T/) != -1);
			b = (where.search(/bottom|B/) != -1);
			o = (where.search(/outer|O/) != -1);	
			i = (where.search(/ident|I/) != -1);
			if (o) this.windowlock(true);
			//if ((from == 'window') || (from == 'document')) o = false;
			
			if (from == 'mouse') {
				
				function jh_mousefunc(eventobject) {
					if (!eventobject) eventobject = window.event;
					mx = (eventobject.pageX) ? eventobject.pageX : eventobject.clientX;
					my = (eventobject.pageY) ? eventobject.pageY : eventobject.clientY;
					if (l) jh(selector).left(mx - jh(selector).width(true) - offset);
					if (r) jh(selector).left(mx + offset);
					if (t) jh(selector).top(my - jh(selector).height(true) - offset);
					if (b) jh(selector).top(my + offset);
				}
				jh().addEvent('mousemove', jh_mousefunc);
				
			} else {
				if (i) {
					this.left(jh(from).left(true) - offset);
					this.top(jh(from).top(true) - offset);
					this.width(jh(from).width(true) - this.border().left - this.border().right + offset);
					this.height(jh(from).height(true) - this.border().top - this.border().bottom + offset);
				} else {
					if (l) {
						this.left(jh(from).left() + offset);
					}
					if (r) {
						if (o) {
							this.left(jh(from).left() + jh(from).width(true) + offset);
						} else {
							this.left(jh(from).left() + jh(from).width(true) - this.width(true) - offset);
						}
					}
					if (t) {
						this.top(jh(from).top() + offset);
					}
					if (b) {
						if (o) {
							this.top(jh(from).top() + jh(from).height(true) + offset);
						} else {
							this.top(jh(from).top() + jh(from).height(true) - this.height(true) - offset);
						}
					}
				}
	
				if (register_handler == true) {
					function jh_arrangefunc (eventobject) {jh(selector).arrange(where, from, offset, false);}
					jh().addEvent('resize', jh_arrangefunc);
					jh().addEvent('scroll', jh_arrangefunc);
				}
			}
		}
	}

}

