/*
 * ProFrom - Professzionális Felhasználói Felületek $ _lib.js,v 1.9 2005/01/20 11:55:56 gyuris Exp $
 * Copyright © 2004 nexum MarsNet Kft. <info@nexum.hu>

 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


/**
 * $ prototype_A.js,v 1.5 2005/01/20 11:13:37 gyuris Exp $
 * prototype A
 * @package  lib.prototypeA
 * @author   Gyuris Gellért
 */
/**
 * Node - csak IE, a hiányzó objektum pótlása
 */
if( !Node ){
	var Node = {
		ELEMENT_NODE                : 1,
		ATTRIBUTE_NODE              : 2,
		TEXT_NODE                   : 3,
		CDATA_SECTION_NODE          : 4,
		ENTITY_REFERENCE_NODE       : 5,
		ENTITY_NODE                 : 6,
		PROCESSING_INSTRUCTION_NODE : 7,
		COMMENT_NODE                : 8,
		DOCUMENT_NODE               : 9,
		DOCUMENT_TYPE_NODE          : 10,
		DOCUMENT_FRAGMENT_NODE      : 11,
		NOTATION_NODE               : 12
	};
};
/**
 * Function.prototype.getName - visszaadja egy funkció nevét, IE-ben nincs segéd.
 * @return String  A funkció neve.
 */
Function.prototype.getName = function () {
	var aTemp;
	if ( typeof this.name == 'string' ) {
		return this.name;
	}
	else {
		aTemp = /function\s([\w]+)\(/g.exec( this.toString() );
		return this.name = ( aTemp != null && typeof aTemp[1] != 'undefined' ) ? aTemp[1] : '';
	};
};
/**
 * String.prototype.trim - letörli a string végéről a fölösleges üres karatereket.
 * @return String  A String új értéke.
 */
String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, '');
};
/**
 * String.prototype.escapeHTML - egy Stringet bekódol forráskód-megjelenítésre
 * @return String  A String új, forráskód-megjeleníthető értéke.
 */
String.prototype.escapeHTML = function() {
	var s = this.toString();
	s = s.replace(/\&/g, '&amp;');
	s = s.replace(/\</g, '&lt;');
	s = s.replace(/\>/g, '&gt;');
	return s;
};
/**
 * String.prototype.unescapeHTML - egy Stringet bekódol megjelenítésre
 * @return String  A String új, HTML-ként értzelmezhető értéke.
 */
String.prototype.unescapeHTML = function() {
	var s = this.toString();
	s = s.replace(/\&lt;/g,  '<');
	s = s.replace(/\&gt;/g,  '>');
	s = s.replace(/\&amp;/g, '&');
	return s;
};
/**
 * String.prototype.toInt - parseInt úgy, hogy mindenképpen számot adjon vissza
 * @return Number  A leparsolt szám. Pl.: 'a112' -> 0, '23a1' -> 23,  '1.2a34bc' -> 1
 */
String.prototype.toInt = function( nBase ) {
	var nVal;
	if ( typeof( nBase ) == 'undefined' ) {
		nBase = 10;
	};
	nVal = parseInt( this.toString() , nBase );
	if ( isNaN( nVal ) ) {
		nVal = 0;
	};
	return nVal;
};
/**
 * String.prototype.toFloat - egy string számmá alakítása a tizedeshelyek elvetésével
 * @return Number  A leparsolt szám. Pl.: '01.2a34bc' -> 1234
 */
String.prototype.toFloat = function() {
	return parseFloat( ('0' + this.toString() ).replace(/[^0-9]/g,''), 10)
};
/**
 * String.prototype.toFloat - számok kinyerése egy szringből a tizedeshelyek elvetésével.
 * @return String  A leparsolt szöveg. Pl.: '01.2a34bc' -> '01234'
 */
String.prototype.toSequence = function() {
	return this.toString().replace(/[^0-9]/g,'');
};
/**
 * String.prototype.endsWith - egy String a megadott sztringre végződik-e? (Java)
 * @param sEnd String  A keresett sztring.
 * @return Boolean     true vagy false
 */
String.prototype.endsWith = function( sEnd ) {
	if ( typeof sEnd != 'string' ) {
		sEnd = sEnd.toString();
	};
	return ( this.toString().substring( this.toString().length - sEnd.length, this.toString().length ) == sEnd ) ? true : false;
};
/**
 * String.prototype.startsWith - egy String a megadott sztringgel kezdődik-e? (Java)
 * @param sStart String  A keresett sztring.
 * @param nStart Number  Opcionális. Megadható egy kezdőpont, ahonnan a vizsgálat kezdődik. Elhagyása a 0-t jelenti.
 * @return Boolean       true vagy false
 */
String.prototype.startsWith = function( sStart, nStart ) {
	if ( typeof sStart != 'string' ) {
		sStart = sStart.toString();
	};
	if ( !nStart ) {
		nStart = 0;
	};
	if ( typeof nStart != 'number' ) {
		nStart = nStart.toString().toInt();
	};
	return ( this.toString().substring( nStart, nStart + sStart.length ) == sStart ) ? true : false;
};
/**
 * String.prototype.toUpperCaseFirst - Egy string első betűjét nagybetűssé teszi (Java)
 * @return String  A nagybetűssé tett sztring.
 */
String.prototype.toUpperCaseFirst = function() {
	return this.toString().charAt(0).toUpperCase() + this.toString().substring( 1, this.toString().length );
};
/**
 * String.prototype.toUpperCaseWords - Egy string minden szavának első betűjét nagybetűssé teszi (Java)
 * @return String  A nagybetűssé tett sztring.
 * XXX - más karakterek
 */
String.prototype.toUpperCaseWords = function() {
	var i, aString = this.toString().split(' ');
	for ( i = 0; i < aString.length; i++ ) {
		aString[i] = aString[i].toUpperCaseFirst();
	};
	return aString.join(' ');
};
/**
 * updateArrayPrototype - hozzáadja az Array-hoz Array.prototype.item, Array.prototype.nextItem elemeket, ezen kívül 
 * IE5-ben a hiányzó elemeket is hozzáadja ( Array.prototype.push, Array.prototype.pop, Array.prototype.shift,
 * Array.prototype.unshift, Array.prototype.splice - dokumentációk a hivatalos leírásokban)
 */
function updateArrayPrototype() {
	/**
	 * Array.prototype.item - egy megadott elem
	 */
	Array.prototype.item = function( i ) {
		return this[i];
	};
	/**
	 * Array.prototype.nextItem - visszadja a követkető elemet, akár szám, akár sztring indexelésű. Az utolsó elem után 
	 * az elsőt adja vissza. Ha a határokon kívüli elemmel hívjuk, meg az elsőt adja vissza. 
	 */
	Array.prototype.nextItem = function( i ) {
		var n, k, j, bNext = false;
		// string indexelésű
		if ( isNaN( parseInt( i ) ) ) {
			for ( n in this ) { // a következő elem
				if ( bNext ) {
					if ( typeof Array.prototype[n] == 'undefined' ) { // az Array prototípus kiegésztések kizárása
						return this[n];
					};
				};
				if ( i == n ) {
					bNext = true;
				};
			};
			for ( j in this ) { // a legelső elemet adjuk vissza
				if ( typeof Array.prototype[j] == 'undefined' ) { // az Array prototípus kiegésztések kizárása
					return this[j];
				};
			};
		};
		// szám indexelésű
		i = parseInt( i );
		if ( i < 0 ) {
			i = -1;
		};
		if ( i >= this.length - 1 ) {
			i = 0;
		}
		else {
			i++;
		};
		return this[i];
	};
	if ( !Array.prototype.push || [1, 1, 1].push( 1 ) != 4 ) {
		Array.prototype.push = function () {
			var i;
			for( i = 0; i < arguments.length; i++ ) {
				this[this.length] = arguments[i];
			};
			return this.length;
		};
	};
	if ( !Array.prototype.pop ) {
		Array.prototype.pop = function() {
			var xOld;
			xOld = this[this.length - 1];
			delete this[this.length - 1];
			this.length--;
			return xOld;
		};
	};
	if ( !Array.prototype.shift ) {
		Array.prototype.shift = function() {
			var xOld, i;
			xOld = this[0];
			for( i = 0; i < this.length - 1; i++ ) {
				this[i] = this[i + 1];
			};
			delete this[this.length - 1];
			this.length--;
			return xOld;
		};
	};
	if ( !Array.prototype.unshift || [1, 1, 1 ].unshift( 1 ) != 4 ) {
		Array.prototype.unshift = function () {
			var i;
			for ( i = this.length - 1; i >= 0; i-- ) {
				this[i + arguments.length] = this[i];
			};
			for ( i = 0; i < arguments.length; i++ ) {
				this[i] = arguments[i];
			};
			return this.length;
		};
	};
	if( !Array.prototype.splice ) {
		Array.prototype.splice = function ( nStart, nDeleteCount ) {
		    var aReturn = [], i;
		    for ( i = 0; i < nDeleteCount; i++ ) {
				aReturn[i] = this[i + nStart];
			};
			for ( i = nStart; i < this.length - nDeleteCount; i++ ) {
				this[i] = this[i + nDeleteCount];
			};
			this.length -= nDeleteCount;
			if ( arguments.length > 2 ) {
				for( i = this.length - 1; i >= nStart; i-- ) {
					this[i + nDeleteCount] = this[i];
				};
				for( i = 0; i < nDeleteCount; i++ ) {
					this[i + nStart] = arguments[i + 2];
				};
			};
			return aReturn;
		};
	};
};
updateArrayPrototype();
/**
 * cleanupArrayPrototype: - a for..in Array esetén szükséges kitakarítást végzi el.
 */
function cleanupArrayPrototype() {
	var i;
	for ( i in Array.prototype ) {
		delete Array.prototype[i];
	};
};

/**
 * $ browserCheck.js,v 1.10 2005/01/20 11:13:37 gyuris Exp $
 * @package  lib.browserCheck
 * @author   Gyuris Gellért
 */
var is = {
	/**
	 * @constructor
	 */
	getUserAgents : function() { 
		// segédfunkciók
		this.geckoGetRv = function() {
			var aTemp = /rv:(\d+\.)(\d+(\.\d+)?)/g.exec(this.agent);
			return aTemp[1] + aTemp[2].toSequence();
		};
		this.getVersion = function() {
			var sId;
			switch ( this.app ) {
				case 'gecko' :
					return this.geckoRv;
					break;
				case 'ie' :
					sId = 'msie ';
					break;
				case 'opera' :
					sId = ( this.agent.indexOf( 'opera/' ) > -1 ) ? 'opera/' : 'opera ';
					 break;
				case 'khtml' :
					sId = ( this.saf ) ? 'applewebkit/' : 'konqueror/';
					break;
				case 'ns4' :
					sId = 'mozilla/';
					break;
			};
			return parseFloat( '0' + this.agent.substr( this.agent.indexOf( sId ) + sId.length ), 10 );
		};
		// adatok átvétele
		this.ver         = navigator.appVersion.toLowerCase();
		this.agent       = navigator.userAgent.toLowerCase();
		this.platform    = navigator.platform.toLowerCase();
		this.product     = new String( navigator.product ).toLowerCase();
		this.productSub  = new String( navigator.productSub ).toLowerCase();
		this.vendor      = new String( navigator.vendor ).toLowerCase();
		this.vendorSub   = new String( navigator.vendorSub ).toLowerCase();
		this.opera       = typeof ( window.opera ) != 'undefined';
		this.dom         = document.getElementById ? true : false;
		this.compatMode  = new String( document.compatMode ).toLowerCase(); // 'css1compat', 'backcompat', 'quirksmode'
		
		// platformok
		this.win         = this.platform.indexOf("win") > -1;
		this.linux       = ( this.platform.indexOf("linux") > -1 || this.platform.indexOf("x11") > -1 );
		this.mac         = this.platform.indexOf("mac") > -1;
	
		// böngészők
		// khtml
		this.khtml       = ( this.agent.indexOf("khtml") > -1 || this.product.indexOf("khtml") > -1 )
		this.konq        = ( this.agent.indexOf("konqueror") > -1 || this.product.indexOf("konqueror") > -1 );
		this.konq31      = ( this.konq && this.ver.indexOf("konqueror/3.1") > - 1 );
		this.saf         = ( this.agent.indexOf("safari") > -1 || this.ver.indexOf("safari") > -1 );
		// opera
		this.opera       = ( this.opera || this.agent.indexOf("opera") > -1 ); // nem win platformon az opera obj nem jön létre
		this.opera5      = ( this.opera && this.agent.indexOf("opera 5") > -1 );
		this.opera6      = ( this.opera && ( this.agent.indexOf("opera 6") > -1 || this.agent.indexOf("opera/6") > -1 ) );
		this.opera7      = ( this.opera && ( this.agent.indexOf("opera 7") > -1 || this.agent.indexOf("opera/7") > -1 ) );
		this.opera8      = ( this.opera && ( this.agent.indexOf("opera 8") > -1 || this.agent.indexOf("opera/8") > -1 ) );
		// IE
		this.ie          = ( this.ver.indexOf('msie') != -1 && !this.opera ) ? true : false;
		this.ie4         = ( document.all && !this.dom && !this.opera ) ? true : false;
		this.ie5         = ( document.all && this.ver.indexOf("msie 5.0") > -1 && !this.opera ) ? true : false; 
		this.ie5mac      = ( this.ie5 && this.mac ) ? true : false; 
		this.ie55        = ( document.all && this.ver.indexOf("msie 5.5") > -1 && !this.opera ) ? true : false; 
		this.ie6         = ( document.all && this.ver.indexOf("msie 6" )  > -1 && !this.opera ) ? true : false;
		this.ieJSBuild   = ( this.ie ) ? ScriptEngineBuildVersion() : '';
		this.ieJSVersion = ( this.ie ) ? ScriptEngineMajorVersion() + '.' + ScriptEngineMinorVersion() : '';
		// mozilla
		this.ns4         = ( document.layers && !this.dom ) ? true : false;
		this.gecko       = ( this.product == "gecko" && !this.khtml ) ? true : false;
		this.geckoRv     = ( this.gecko ) ? this.geckoGetRv() : 0;
		this.gecko1      = ( this.gecko && Number( this.productSub ) > 20020530 ) ? true : false;
		this.moz1        = ( this.gecko && this.vendor == '' && !( this.geckoRv < 1 ) ) ? true : false;
		this.ns6         = ( this.gecko && this.vendor == 'netscape6' && parseFloat( this.vendorSub ) >= 6 && parseFloat( this.vendorSub ) < 7 ) ? true : false;
		this.ns7         = ( this.gecko && this.vendor == 'netscape' && parseFloat( this.vendorSub ) >= 7 ) ? true : false;
		this.ff          = ( this.gecko && ( this.vendor == 'mozilla firebird' || this.vendor == 'phoenix' || this.vendor == 'firefox' ) );
		this.cm          = ( this.gecko && ( this.vendor == 'chimera' || this.vendor == 'camino' ) );
		this.beo         = ( this.gecko && this.vendor == 'beonex' );
		this.kmel        = ( this.agent.indexOf('k-meleon') > -1 ) ? true : false ;
		// alkalmazás-verziószám
		this.app         = ( ( this.ie ) ?  'ie' : ( this.gecko ) ? 'gecko' : ( this.opera ) ?  'opera' : ( this.khtml ) ? 'khtml' : ( this.ns4 ) ? 'ns4' : 'undefined' );
		this.appVer      = this.getVersion();
	
		// csoportok
		this.bs4         = ( this.ie || this.ns4 || this.gecko || this.opera || this.khtml );
		this.bs5         = ( ( this.ie && this.appVer >= 5.5 ) || this.gecko || ( this.opera && this.appVer >= 7  ) || this.saf );
		this.bss         = ( this.gecko || ( this.opera && this.appVer >= 7  ) || this.saf )
		this.min         = ( this.bs5 || this.ie5 || this.opera || this.khtml );
		return this;
	}
};
is.getUserAgents();



/**
 * $ eventBinding.js,v 1.5 2005/01/03 13:22:09 gyuris Exp $
 * @package  lib.eventBinding
 * @author   Gyuris Gellért
 * @see      browserCheck, prototype A
 */
if ( is.ie ) {
	var IE_EVENTBINDING_MS_ID     = 0;
	var FORCE_IE_EVENTBINDING     = false; // ezt át lehet állítani!
	var IE_EVENTBINDING_ASSISTANT = 'function ieEventBindingAssistant( node ) {'
	                              + '     try { eval( node.uniqueID ); return true	}'
	                              + '     catch( ex ) { return false }'
	                              + '};'
	eval(IE_EVENTBINDING_ASSISTANT);
};
/**
 * eventBinding - egy esemény csatolása. Alapfüggvény. A this kulcsszú emulálása IE-ben megoldott, ennek kikapcsolása: 
 * FORCE_IE_EVENTBINDING = true; A getBindingSelf-el leget az eseménycsatolás hordozóját megkapni.
 * @param node DOMElement     Az elem, amihez csatolunk.
 * @param bFlag Boolean       Csatolunk vagy elveszünk.
 * @param sType String        Az esmeméyn típusa: pl.: 'click', 'mouseover' ('on' nélkül).
 * @param fListener Function  A függvény, melyet csatolunk.
 * @param bCapture Boolean    Használjunk-e elfogást :: false
 * @return Boolean            Sikeres volt-e a csatolás, vagy sem.
 */
function eventBinding( node, bFlag, sType, fListener, bCapture ) {
	var sBind;
	if ( node == null || typeof node == 'undefined' ) {
		return false;
	};
	if ( is.ie && is.win && typeof node.nodeType != 'undefined' && !FORCE_IE_EVENTBINDING ) {
		if ( !ieEventBindingAssistant( node ) ) {
			if ( node.id == '' && node.name == '' ) {
				IE_EVENTBINDING_MS_ID++;
				node.id = 'IE_EVENTBINDING_MS_ID' + IE_EVENTBINDING_MS_ID + 'hack';
				node.name = node.id;
			};
			eval( node.uniqueID + ' = document.all["' + node.id + '"]' );
		};
		sBind = 'var IEeventBind_' + node.uniqueID + ' = new Object();\n' + ( ( fListener.getName() != '' ) ?
		        'IEeventBind_' + node.uniqueID + '.' + fListener.getName()  +  ' = ' + fListener.getName() + ';\n' :
		        'IEeventBind_' + node.uniqueID + '.noname = ' + fListener.toString() + ';\n' ) +
		        'IEeventBind_' + node.uniqueID + '.self = ' + node.uniqueID + ';\n' +
		        'IEeventBind_' + node.uniqueID + '.getSelf = function() { return this.self };\n' +
		        'IEeventBind_' + node.uniqueID + '.' + ( fListener.getName() || 'noname' ) + '();'
	};
	sType = sType.toLowerCase();
	if ( bFlag ) {
		if ( is.ie && is.win ) {
			if ( !FORCE_IE_EVENTBINDING && typeof node.nodeType != 'undefined' ) { // window
				node.attachEvent( 'on' + sType, new Function( sBind ) );
			}
			else {// minden más node
				node.attachEvent( 'on' + sType, fListener );
			};
		};
		if ( is.ie5mac ) {
			eventBindingCompletion( [node], bFlag, sType, fListener, bCapture );
		};
		if ( is.bss ) {
			node.addEventListener( sType, fListener, bCapture );
		};
	}
	else {
		if ( is.ie && is.win ) {
			if ( !FORCE_IE_EVENTBINDING && typeof node.nodeType != 'undefined' ) { // window
				node.detachEvent( 'on' + sType, new Function( sBind ) );
			}
			else { // minden más node
				node.detachEvent( 'on' + sType, fListener );
			};
		};
		if ( is.ie5mac ) {
			eventBindingCompletion( [node], bFlag, sType, fListener, bCapture );
		};
		if ( is.bss ) {
			node.removeEventListener( sType, fListener, bCapture );
		};
	};
	return true;
};
/**
 * getBindingSelf - egy esemény csatolása után a csatolást hordozó elem lekérdezése.
 * @param el Object    Meghívás: getBindingSelf(this). A this IE-ben egy objeltum, más böngészőkben, pedig maga a elem.
 * @return DOMElement  A csatolást hordozó elem.
 */
function getBindingSelf( el ) {
	if ( is.ie5mac ) {
		return window.event.srcElement;
	}
	else if ( is.ie ) {
		if ( FORCE_IE_EVENTBINDING ) {
			return window.event.srcElement;
		};
		return el.getSelf();
	}
	else {
		return el;
	};
};
/**
 * loadEventBinding -  a betöltési (load) eseménykötés érdekességei miatt van rá szükség:
 * - opera7 : a document bocsátja el az eseményt, nem a window
 * - konqueror és safari: a window engedi el, de a document kapja meg...
 * - ie5Mac: inline funkció nem megy át, csak egy különálló.
 * @param oWin Window         Az ablak, amelynek dokumentuma betöltődésére kötünk eseményt.
 * @param fListener Function  A függvény, melyet csatolunk.
 * @return Boolean            Sikeres volt-e a csatolás, vagy sem.
 */
function loadEventBinding( oWin, fListener ) {
	if ( is.ie || is.gecko || is.saf ) {
		eventBinding( oWin, true, 'load', fListener, false );
	};
	if ( is.opera && is.appVer >= 7 ) {
		eventBinding( oWin.document, true, 'load', fListener, false );
	};
	if ( is.konq ) {
		eventBindingCompletion( [ oWin, oWin.document ], true, 'load', fListener, false );
	};
	return true;
};
/**
 * resizeEventBinding -  az ablak átméretezésehez való csatolás
 * - opera7 : a document bocsátja el az eseményt, nem a window
 * @param bFlag Boolean       Csatolunk vagy elveszünk.
 * @param fListener Function  A függvény, melyet csatolunk.
 * @return Boolean            Sikeres volt-e a csatolás, vagy sem.
 */
function resizeEventBinding( bFlag, fListener ) {
	if ( is.opera && is.appVer >= 7 ) {
		eventBinding( document, bFlag, 'resize', fListener, false );
	}
	else {
		eventBinding( window, bFlag, 'resize', fListener, false );
	};
	return true;
};
/**
 * globalEventBinding - teljes csatolás a beágyazott IFRAME-k eseményeinek átvételére.
 * @param node DOMElement           Az elem, amihez csatolunk.
 * @param bFlag Boolean             Csatolunk vagy elveszünk.
 * @param sType String              Az esmeméyn típusa: pl.: 'click', 'mouseover' ('on' nélkül).
 * @param fListener Function        A függvény, melyet csatolunk.
 * @param bCapture Boolean          Használjunk-e elfogást :: false
 * @param IEcaptureNode DOMElement  Csak IE: az elem, amely ellopja az összes eseményt.
 * @return Boolean                  Sikeres volt-e a csatolás, vagy sem.
 */
function globalEventBinding( node, bFlag, sType, fListener, bCapture, IEcaptureNode ) {
	var windows, i;
	if ( is.ie ) {
		eventBinding( document, bFlag, sType, fListener, bCapture );
		if ( bFlag ) {
			IEcaptureNode.setCapture();
		}
		else {
			IEcaptureNode.releaseCapture();
		};
	};
	if ( is.bss ) {
		eventBinding( document, bFlag, sType, fListener, bCapture );
		windows = node.getElementsByTagName('IFRAME');
		for ( i = 0; i < windows.length; i++ ) {
			eventBinding( windows[i].contentDocument, bFlag, sType, fListener, bCapture );
			globalEventBinding( windows[i].contentDocument , bFlag, sType, fListener, bCapture );
		};
	};
};
/**
 * eventBindingCompletion - kívülről nem hívható. ie5Mac nem támogatja a többszörösen csatolt eseményeket, ez a 
 * kigészítés végzi el. Konq. és Saf. is hasznája a loadBinding-ben.
 */
function eventBindingCompletion( aNode, bFlag, sType, fListener, bCapture ) {
	function findType( aAttachedEvents, sType) {
		var i;
		for ( i = 0; i < aAttachedEvents.length; i++ ) {
			if ( aAttachedEvents[i] == null ) {
				continue;
			};
			if ( aAttachedEvents[i].type == sType ) {
				return true;
			};
		};
		return false;
	};
	function findFunctionString( firstFunc ) {
		var str, num1, num2;
		num1 = firstFunc.toString().indexOf('{');
		num2 = firstFunc.toString().lastIndexOf(')');
		str = firstFunc.toString().substring( num1 + 1, num2 + 1 )
		return str.trim();
	}
	var i, k, fFirst;
	if ( bFlag ) {
		for ( i = 0 ; i < aNode.length; i++ ) {
			if ( typeof aNode[i].aAttachedEvents == 'undefined' ) {
				aNode[i].aAttachedEvents = [];
			};
			aNode[i].dispatchEvents = function() {
				var j, type = window.event.type;
				for ( j = 0; j < this.aAttachedEvents.length; j++ ) {
					if ( this.aAttachedEvents[j] == null ) {
						continue;
					};
					if ( type == this.aAttachedEvents[j].type ) {
						if ( typeof this.aAttachedEvents[j].listener == 'string' ) {
							eval( this.aAttachedEvents[j].listener );
						}
						else if ( typeof this.aAttachedEvents[j].listener == 'function' ) {
							eval( this.aAttachedEvents[j].listener.toString().substring( this.aAttachedEvents[j].listener.toString().indexOf( '{' ) + 1, this.aAttachedEvents[j].listener.toString().length - 1 ) );
						};
					};
				};
			};
			fFirst = eval( 'aNode['+i+'].on' + sType );
			if ( fFirst != null && !findType( aNode[i].aAttachedEvents, sType ) ) { // ha már inline volt egy függvény hozzárendelve, azt átemeljük
				aNode[i].aAttachedEvents[aNode[i].aAttachedEvents.length] = { type : sType, listener : findFunctionString( fFirst ) }; // typeof: string
			};
			eval( 'aNode['+i+'].on' + sType + ' = ' + 'aNode['+i+'].dispatchEvents' );
			aNode[i].aAttachedEvents[aNode[i].aAttachedEvents.length] = { type : sType, listener : fListener }; // typeof : function
		};
	}
	else { 
		for ( i = 0; i < aNode.length; i++ ) {
			for ( k = 0; k < aNode[i].aAttachedEvents.length; k++ ) { 
				if ( aNode[i].aAttachedEvents[k] == null ) {
					continue;
				};
				if ( aNode[i].aAttachedEvents[k].type == sType && aNode[i].aAttachedEvents[k].listener == fListener ) { // typeof aNode.aAttachedEvents[i].listener = string || function 
					aNode[i].aAttachedEvents[k] = null;
				};
			};
		};
	};
};


/**
 * $ className.js,v 1.4 2004/08/19 11:59:21 gyuris Exp $
 * @package  lib.className
 * @author   Gyuris Gellért
 */
/**
 * removeClass - eltávolítja egy elem CSS oszályai közül a megadottat
 * @param el DOMElement      A elem, amelyen módosítunk.
 * @param sClassName String  A CSS osztály neve.
 * @return String            A keletkezett osztálynév.
 */
function removeClass( el, sClassName ) {
	var i, aClass, aNewClass = [];
	if ( hasClass( el, sClassName ) ) {
		aClass = el.className.split(' ');
		for ( i = aClass.length; i > 0; ) {
			if ( aClass[--i] != sClassName ) {
				aNewClass.unshift( aClass[i] );
			};
		};
		el.className = aNewClass.join(' ');
	};
	return el.className;
};
/**
 * addClass - hozzáadja egy elem CSS oszályai közé legutolsó helyre a megadottat,
 * ha már szerepel, akkor kiemeli a legutolsó helyre.
 *
 * @param el DOMElement      A elem, amelyen módosítunk.
 * @param sClassName String  A CSS osztály neve.
 * @return String            A keletkezett osztálynév.
 */
function addClass( el, sClassName ) {
	if ( el.className == '' ) {
		el.className = sClassName;
	}
	else if ( !hasClass( el, sClassName ) ) { // nincs szerepe a sorrendiségnek
		el.className += ' ' + sClassName;
	};
	return el.className;
};
/**
 * hasClass - megnézi, hogy egy elem CSS oszályai között szerepel-e a megadott?
 * @param el DOMElement      A elem, amelyen a vizsgálatot végezzük.
 * @param sClassName String  A CSS osztály neve.
 * @return Boolean           Szerepel-e vagy sem benne?
 */
function hasClass( el, sClassName ) {
	var i, aClass;
	aClass = el.className.split(' ');
	for ( i = aClass.length; i > 0; ) {
		if ( aClass[--i] == sClassName ) {
			return true;
		};
	};
	return false;
};


/**
 * $ child.js,v 1.4 2004/08/19 11:59:21 gyuris Exp $
 * @package  lib.child
 * @author   Gyuris Gellért
 * @see      prototypeA
 */
/**
 * getChildIndex - visszaadja a gyermek sorszámát
 * @param elChild DOMNode  A csomópont, amelynek a sorszámára vagyunk kíváncsiak.
 * @return Number          Hanyadik csomópont.
 * @return null            Nincs szülője.
 */
function getChildIndex( elChild ) {
	var i;
	if ( elChild.parentNode == null ) {
		return null;
	};
	for ( i = 0; i < elChild.parentNode.childNodes.length; i++ ) {
		if ( elChild.parentNode.childNodes.item(i) == elChild ) {
			return i;
			break;
		};
	};
	return null;
}
/**
 * getContextNodes - visszaadja a kért csomópont-típusú leszármazottjait. A 
 * getAllChildElement v2.0, getAllChildNode v2.0 ennek két önálló régebbi 
 * speciális megvalósítása, melyet kompatibilitás miatt megőriztem.
 *
 * @param elRoot DOMNode  A csomópont, amelynek a leszármazottait kérjük 
 * @param aType Array     A leszármazott csomópont-típusok, Lásd a Node
 * @return Array          A megadott csomópont-típusoknak megfelelő leszármazottak.
 */
function getContextNodes( elRoot, aType ) {
	var aNodes = [];
	function searchNodes( el ) {
		var i, j;
		if ( !el.hasChildNodes() ) {
			return;
		};
		for ( i = 0; i < el.childNodes.length; i++ ) {
			for ( j = 0; j < aType.length; j++ ) {
				if ( el.childNodes.item(i).nodeType == aType[j] ) {
					aNodes[aNodes.length] = el.childNodes.item(i);
					break;
				};
			};
			if ( el.childNodes[i].nodeType == Node.ELEMENT_NODE ) {
				searchNodes( el.childNodes.item(i) );
			};
		};
	};
	searchNodes( elRoot );
	return aNodes;
}
/**
 * getAllChildElement - Lásd: getContextNodes;
 * @param elRoot DOMNode  A csomópont, amelynek a leszármazottait kérjük 
 */
function getAllChildElement( elRoot ) {
	elRoot.allEl = getContextNodes( elRoot, [ Node.ELEMENT_NODE ] );
};
/**
 * getAllChildNode - Lásd: getContextNodes;
 * @param elRoot DOMNode  A csomópont, amelynek a leszármazottait kérjük 
 */
function getAllChildNode( elRoot ) {
	elRoot.allNodes = getContextNodes( elRoot, [ Node.ELEMENT_NODE, Node.TEXT_NODE, Node.CDATA_SECTION_NODE, Node.COMMENT_NODE ] );
};
/**
 * getFirstElement - visszaadja egy csomópont első ELEMENT_NODE-ját
 * @param el DOMElement  A csomópont, amelynek első elemét kérjük.
 * @return DOMELement    Az első elem.
 * @return null          Ha nincs első elem.
 */
function getFirstElement( el ) {
	var i;
	if ( !el.hasChildNodes() ) {
		return null; // ha nem ELEMENT_NODE a szülő
	};
	for ( i = 0 ; i < el.childNodes.length; i++ ) {
		if ( el.childNodes.item(i).nodeType == Node.ELEMENT_NODE ) {
			return el.childNodes.item(i);
			break;
		};
	};
	return null;
};
/**
 * getLastElement - visszadja egy csomópont utolsó ELEMENT_NODE-ját
 *
 * @param el DOMElement  A csomópont, amelynek utolsó elemét kérjük.
 * @return DOMELement    Az utoló elem.
 * @return null          Ha nincs utolsó elem.
 */
function getLastElement( el ) {
	var i;
	if ( !el.hasChildNodes() ) {
		return null; // ha nem ELEMENT_NODE a szülő
	};
	for ( i = el.childNodes.length - 1 ; i >= 0; i-- ) {
		if ( el.childNodes.item(i).nodeType == Node.ELEMENT_NODE ) {
			return el.childNodes.item(i);
			break;
		};
	};
	return null;
};
/**
 * getNextElement - visszaadja egy egy elem testvérei közül a következő elemet
 *
 * @param elChild DOMElement  A gyermek-csomópont, amely szülőjének következő elemét kérjük.
 * @return DOMELement         A következő elem.
 * @return null               Ha nincs következő elem.
 */
function getNextElement( elChild ) {
	function getNext( el ) {
		if ( el.nextSibling == null ) {
			return null;
		};
		if ( el.nextSibling.nodeType == Node.ELEMENT_NODE ) {
			return el.nextSibling;
		};
		return getNext( el.nextSibling );
	};
	return getNext( elChild );
};
/**
 * getPreviousElement - visszaadja egy egy elem testvérei közül az előző elemet
 *
 * @param elChild DOMElement  A gyermek-csomópont, amely szülőjének előző elemét kérjük.
 * @return DOMELement         Az előző elem.
 * @return null               Ha nincs előző elem.
 */
function getPreviousElement( elChild ) {
	function getPrevious( el ) {
		if ( el.previousSibling == null ) {
			return null;
		};
		if ( el.previousSibling.nodeType == Node.ELEMENT_NODE ) {
			return el.previousSibling;
		};
		return getPrevious( el.previousSibling );
	};
	return getPrevious( elChild );
};
/**
 * removeEmptyTextNode - eltávolítja egy elem üres TEXT_NODE-jait
 *
 * @param elRoot DOMElement  A csomópont, amely üres TEXT_NODE-jait kitöröljük
 * @return Array             A csomópontok, melyek ki lettek törölve.
 */
function removeEmptyTextNode( elRoot ) {
	var re, aNodes, aRemovedNodes = [];
	re = /^[\s\n\t]*$/;
	aNodes = getContextNodes( elRoot, [ Node.TEXT_NODE ] );
	for ( i = 0; i < aNodes.length; i++ ) {
		if ( aNodes[i].nodeType != Node.TEXT_NODE ) {
			continue;
		};
		if ( re.test( aNodes[i].nodeValue ) ) {
			aRemovedNodes[aRemovedNodes.length] = aNodes[i].parentNode.removeChild( aNodes[i] );
		};
	};
	return aRemovedNodes;
};
/**
 * getTextContent - bármilyen csomópont szöveges tartalmát visszaadja (ha lehetséges neki)
 * @param nodeRoot DOMNode  A csomópont, amelynek szöveges tartalmára vagyunk kiváncsiak
 * @return String           A tartalom
 */
function getTextContent( nodeRoot ) {
	switch ( nodeRoot.nodeType ) {
		case  2 : // Node.ATTRIBUTE_NODE
		case  5 : // Node.ENTITY_REFERENCE_NODE
		case  6 : // Node.ENTITY_NODE
		case  7 : // Node.PROCESSING_INSTRUCTION_NODE
		case  9 : // Node.DOCUMENT_NODE
		case 10 : // Node.DOCUMENT_TYPE_NODE
		case 11 : // Node.DOCUMENT_FRAGMENT_NODE
		case 12 : // Node.NOTATION_NODE
			return '';
			break;
		case  1 : // Node.ELEMENT_NODE
		case  3 : // Node.TEXT_NODE
		case  4 : // Node.CDATA_SECTION_NODE
		case  8 : // Node.COMMENT_NODE
			if ( is.gecko ) {
				return nodeRoot.textContent;
			}
			else {
				return ( nodeRoot.innerText ) ? nodeRoot.innerText : nodeRoot.nodeValue;
			};
	};
};



/**
 * $ makeUnselectable.js,v 1.2 2004/08/19 11:59:21 gyuris Exp $
 * makeUnselectable - egy elemenek tiltja a kijelölését és fókuszba kerülését. Opera7 megoldatlan.
 * @package                    lib.makeUnselectable
 * @author                     Gyuris Gellért
 * @see                        browserCheck, prototype A
 * @param el DOMElement        Az elem, amelyen a műveletet végezzük.
 * @return el DOMElement       Az elem, a megváltozott paraméterekkel.
 */
function makeUnselectable( el ) {
	if ( el.nodeType != Node.ELEMENT_NODE ) {
		return false;
	};
	if ( is.ie ) {
		el.setAttribute('unselectable', 'on' );
		el.setAttribute('hidefocus', true );
	}
	else if ( is.gecko ) {
		el.style.MozUserSelect = 'none';
		el.style.MozUserFocus = 'none';
	};
	return el;
};


/**
 * $ displayChanger.js,v 1.2 2004/08/19 11:59:21 gyuris Exp $
 * displayChanger - megfordítja egy elem display-ét, vagy a megadottra állítja. 
 * IE5Mac el.currentStyle.display nem tudja visszaadni a tényleges display állapotot,
 * így IE5 alatt 'késik' a getComputedStylePropertyValue függvény miatt.
 * @package               lib.displayChanger
 * @author                Gyuris Gellért
 * @see                   browserCheck, getComputedStylePropertyValue, prototypeA
 * @param el DOMElement   Az elem, melyneknek megjelenítését változtatjuk.
 * @param bValue Boolean  Opcionális; true: mutatva lesz, false: elrejtve lesz, 
 *                        elhagyásakor megfordul.
 * @return String         A beállított display
 */
function displayChanger( el, bValue ) {
	var aTags, aStandardDisplays, aMSIEDisplays, aCurrentDisplays, i, bFound = false;
	if ( el.nodeType != Node.ELEMENT_NODE || !is.bs5 ) {
		return null;
	};
	aTags             = ['iframe', 'body',  'p',     'div',   'span',  'table', 'tbody',           'tfoot',              'thead',              'tr',        'td',         'th',         'ul',    'ol',    'li',        'input',  'button', 'textarea' ];
	aStandardDisplays = ['inline', 'block', 'block', 'block', 'inline','table', 'table-row-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-cell', 'table-cell', 'block', 'block', 'list-item', 'inline', 'inline', 'inline' ];
	aMSIEDisplays     = ['inline', 'block', 'block', 'block', 'inline','block', 'block',           'block',              'block',              'block',     'block',      'block',      'block', 'block', 'inline',    'inline', 'inline', 'inline' ];
	aCurrentDisplays  = ( is.ie ) ? aMSIEDisplays : aStandardDisplays;
	for ( i = 0; i < aTags.length; i++ ) { // kikeressük a megfelelő párosításokat
		if ( el.tagName.toLowerCase() == aTags[i] ) {
			bFound = true;
			break;
		};
	};
	if ( !bFound ) {
		return false;
	};
	if ( typeof( bValue ) != 'undefined' ) { // ha megvan adva, hogy mire kell cserélni
		if ( bValue == false ) {
			el.style.display = 'none'
		}
		else {
			el.style.display = aCurrentDisplays[i];
		};
		return el.style.display;
	}
	else { // meg kell fordítani
		if ( el.style.display == '' ) {
			el.style.display = getComputedStylePropertyValue( el, 'display', '' );
		};
		if ( el.style.display == 'none' || el.style.display == '' ) { // < opera7.2
			el.style.display = aCurrentDisplays[i];
		}
		else {
			el.style.display = 'none';
		};
		return el.style.display;
	};
};


/**
 * $ getViewport.js,v 1.5 2005/01/03 13:22:09 gyuris Exp $
 * @package  lib.getViewport
 * @author   Gyuris Gellért
 * @see      browserCheck
 */
/**
 * getViewport - visszaaja a tartalomban rendelkezésre álló terület a görgetősávok NÉLKÜL.
 * XXX - át kell alakítani MINDEN böngészőre egyenként és külön a css1compat és az backcompat||quirksmode
 * @return Object  Az adatokat tartalmazó értékek számmal.
 */
function getViewport() {
	var nWidth, nHeight, nScollTop, nScollHeight;
	if ( is.compatMode == 'css1compat' ) {
		if ( is.ie6 || is.geckoRv >= 1.5 || ( is.opera && is.appVer >= 7 ) ) {
			nWidth = document.documentElement.clientWidth;
			nHeight = document.documentElement.clientHeight;
			nScollTop = document.documentElement.scrollTop;
			nScollHeight = document.documentElement.scrollHeight;
		};
		if ( is.opera && is.appVer >= 7 ) {
			nHeight = window.innerHeight //document.documentElement.clientHeight;
		};
		if ( is.gecko ) {
			nWidth = ( document.body.scrollWidth >= document.body.clientWidth ) ? document.body.clientWidth : window.innerWidth;
			nHeight = ( document.body.scrollHeight >= document.body.clientHeight ) ? document.body.clientHeight : window.innerHeight;
			if ( is.geckoRv >= 1.7 ) {
				nWidth = ( document.documentElement.scrollWidth >= document.documentElement.clientWidth ) ? document.documentElement.clientWidth : window.innerWidth;
				nHeight = ( document.documentElement.scrollHeight >= document.documentElement.clientHeight ) ? document.documentElement.clientHeight : window.innerHeight;
			}
			nScollTop = window.scrollY;
			nScollHeight = document.documentElement.scrollHeight;
		};
	}
	else {
		if ( is.ie ) {
			nWidth = document.body.clientWidth;
			nHeight = document.body.clientHeight;
			nScollTop = document.body.scrollTop;
			nScollHeight = document.body.scrollHeight;
		}
		else if ( is.khtml ) {
			nWidth = window.innerWidth;
			nHeight = window.innerHeight;
		}
		else if ( is.bss ) {
			nWidth = ( document.body.scrollWidth >= document.body.clientWidth ) ? document.body.clientWidth : window.innerWidth;
			nHeight = ( document.body.scrollHeight >= document.body.clientHeight ) ? document.body.clientHeight : window.innerHeight;
			nScollTop = window.scrollY;
			nScollHeight = document.documentElement.scrollHeight;
		};
		if ( ( is.opera && is.appVer >= 7 ) || is.khtml ) {
			nScollTop = document.documentElement.scrollTop;
			nScollHeight = document.documentElement.scrollHeight;
		};
	};
	// kompatibilitás miatt
	window.strictInnerWidth   = nWidth;
	window.strictInnerHeight  = nHeight;
	window.strictScrollTop    = nScollTop;
	window.strictScrollHeight = nScollHeight;
	return { width        : nWidth,
	         height       : nHeight,
	         scrollTop    : nScollTop,
	         scrollHeight : nScollHeight };
};
/**
 * getWindowDimension - kompatibilitás miatt megőrizve: a getViewport másolata
 */
function getWindowDimension() {
	return getViewport();
};


/**
 * $ xml.js,v 1.7 2004/08/19 11:59:21 gyuris Exp $
 * XML kezelés IE és Geckó alatt.
 * @package  lib.xml
 * @author   Gyuris Gellért
 * @see      browserCheck
 */
/**
 * getMSXMLProgId - csak IE alatt: megkeresi, hogy melyik activeX an telepítve az XmlHttp és az XmlDocument számára.
 * @return String  A progId emberi neve. Ha nincs teleítve, akkor null.
 */
function getMSXMLProgId() {
	var oXML, i, sFunction;
	if ( this.progId != null ) {
		return this.progId;
	};
	sFunction = 'function testProgId( obj ) {' +
				'	try {' +
				'		oXML = new ActiveXObject( obj.aProdId[i] );' +
				'		return obj.aProdId[i];' +
				'	}' +
				'	catch ( ex ) {};' +
				'};'
	eval( sFunction );
	for ( i = 0; i < this.aProdId.length; i++ ) {
		return testProgId( this );
	};
	return null;
};
/**
 * isCorrectMSXMLMinimalProgId - csak IE alatt: a megadott progId-nek megfelel-e a telepített activeX?
 * @return Boolean  Ha megfelel vagy nem felelt meg: true ill. false.
 */
function isCorrectMSXMLMinimalProgId( sMinimalProgId ) {
	var i, nInstalled = this.aProdId.length - 1 , nMinimal = -1;
	for ( i = 0; i < this.aProdId.length; i++ ) {
		if ( this.progId == this.aProdId[i] ) {
			nInstalled = i;
		};
		if ( sMinimalProgId.toLowerCase() == this.aProdId[i].toLowerCase() ) {
			nMinimal = i;
		};
	};
	return ( nMinimal < nInstalled ) ? false : true;
};
/**
 * XmlHttp - XML kommunikáció létrehozása.
 */
var XmlHttp = {
	aProdId : [ 'Msxml2.XMLHTTP.4.0',
				'Msxml2.XMLHTTP.3.0',
				'Msxml2.XMLHTTP',
				'MSXML.XmlHttp',
				'MSXML3.XmlHttp',
				'Microsoft.XmlHttp' ],
	progId : null,
	getProgId : getMSXMLProgId,
	isCorrectMinimalProgId : isCorrectMSXMLMinimalProgId,
	/**
	 * XmlHttp.create - egy XMLHttpRequest létrehozása
	 * @param fError Function               Ha nem jó a böngésző, akkor mi történjen.
	 * @param sMSXMLMinimalProgId String    Opcionális. Csak IE: a minimális activeX.
	 * @param fMSXMLMinimalError Function   Opcionális. Csak IE: ha nem felel meg a minmális activeX, mi történjen.
	 * @return Object                       XMLHttpRequest objektum.
	 * @since                               2.0
	 */
	create : function( fError, sMSXMLMinimalProgId, fMSXMLMinimalError ) {
		if ( window.ActiveXObject ) {
			this.progId = this.getProgId();
			if ( sMSXMLMinimalProgId ) {
				if ( this.isCorrectMinimalProgId( sMSXMLMinimalProgId ) ) {
					return ( this.progId != null ) ? new ActiveXObject( this.progId ) : null
				}
				else {
					fMSXMLMinimalError();
				};
			}
			else {
				return ( this.progId != null ) ? new ActiveXObject( this.progId ) : null;
			};
		}
		else if ( window.XMLHttpRequest ) {
			return new XMLHttpRequest();
		}
		else if ( fError ) {
			fError();
		};
		return null;
	},
	/**
	 * XmlHttp.loadBinding - Betöltődés eseménycsatolás
	 * @param xmlHttp Object  Aminek abetöltődéséhez csatolunk.
	 * @paran fLoad Fuction   A függvény, ami a betöltődéskor lefut.
	 */
	loadBinding : function( xmlHttp, fLoad ) {
		if ( is.gecko ) {
			xmlHttp.onload = function() {
				if ( !XmlHttp.existError( xmlHttp ) ) {
					fLoad( xmlHttp.responseXML );
				};
			};
		}
		else if ( is.ie ) {
			xmlHttp.onreadystatechange = function() {
				if ( xmlHttp.readyState == 4 && !XmlHttp.existError( xmlHttp ) ) {
					fLoad( xmlHttp.responseXML );
				};
			};
		};
	},
	/**
	 * XmlHttp.existError - van-e hiba betöltődéskor?
	 * @param xmlHttp Object  A betöltődött XMLHttpRequest objektum.
	 * @retutn Boolan         Nincs hiba ill. van hiba.
	 */
	existError : function ( xmlHttp ) {
		if ( xmlHttp.responseXML == null 
			|| xmlHttp.responseXML.documentElement == null
			|| xmlHttp.responseXML.xml.indexOf('parsererror') > -1 ) {
			throw new Error( "XMLKommunikációs hiba!\n\n" + xmlHttp.getAllResponseHeaders() 
					+ "\nstatus: " + xmlHttp.status 
					+ "\nstatusText: " + xmlHttp.statusText
					+ "\n\nresponseText:\n" + xmlHttp.responseText )
			return true;
		};
	}
};
/**
 * XmlDocument - XML dokumentum létrehozása.
 */
var XmlDocument = {
	aProdId : [ 'Msxml2.DOMDocument.4.0',
				'Msxml2.DOMDocument.3.0',
				'Msxml2.DomDocument',
				'MSXML3.DomDocument',
				'MSXML.DomDocument',
				'Microsoft.DomDocument',
				'Microsoft.XMLDOM' ],
	progId : null,
	getProgId : getMSXMLProgId,
	isCorrectMinimalProgId : isCorrectMSXMLMinimalProgId,
	/**
	 * XmlDocument.create - egy XML dokumentum létrehozása
	 * @param fError Function               Ha nem jó a böngésző, akkor mi történjen.
	 * @param sMSXMLMinimalProgId String    Opcionális. Csak IE: a minimális activeX.
	 * @param fMSXMLMinimalError Function   Opcionális. Csak IE: ha nem felel meg a minmális activeX, mi történjen.
	 * @return Object                       XML dokumentum.
	 * @since                               2.0
	 */
	create : function( fError, sMSXMLMinimalProgId, fMSXMLMinimalError ) {
		if ( window.ActiveXObject ) {
			this.progId = this.getProgId();
			if ( sMSXMLMinimalProgId ) {
				if ( this.isCorrectMinimalProgId( sMSXMLMinimalProgId ) ) {
					return ( this.progId != null ) ? new ActiveXObject( this.progId ) : null
				}
				else {
					fMSXMLMinimalError();
				};
			}
			else {
				return ( this.progId != null ) ? new ActiveXObject( this.progId ) : null;
			};
		}
		else if ( document.implementation && document.implementation.createDocument ) {
			return document.implementation.createDocument('', '', null)
		}
		else if ( fError ) {
			fError();
		}
		return null;
	}
};
/**
 * selectXMLNodesByXPath - XPath-szal való lekérdezés XML dokumentumban: elem lista kérése.
 * @param xmlDoc Object       Az XML dokumentum, amelyben a keresést végezzük.
 * @param nodeContext Object  A kifejezés gyökér eleme a dokumentumban.
 * @param sExpression String  Az XPath kifejezés.
 */
function selectXMLNodesByXPath( xmlDoc, nodeContext, sExpression ) {
	var oXPathResult, el, aReturn = [];
	if ( is.ie ) {
		xmlDoc.setProperty('SelectionLanguage', 'XPath');
		return nodeContext.selectNodes( sExpression );
	}
	else if ( is.gecko ) {
		oXPathResult = xmlDoc.evaluate( sExpression, nodeContext, null, XPathResult.ANY_TYPE, null );
		while ( el = oXPathResult.iterateNext() ) {
			aReturn[aReturn.length] = el;
		};
		return aReturn;
	};
};
/**
 * selectXMLSingleNodeByXPath - XPath-szal való lekérdezés XML dokumentumban: egy elem kérése. Leváltotta a 
 * getXMLElement, etChildElementByAttribute, getSpecifiedElement függvényeket.
 * @param xmlDoc Object       Az XML dokumentum, amelyben a keresést végezzük.
 * @param nodeContext Object  A kifejezés gyökér eleme a dokumentumban.
 * @param sExpression String  Az XPath kifejezés.
 */
function selectXMLSingleNodeByXPath( xmlDoc, nodeContext, sExpression ) {
	if ( is.ie ) {
		xmlDoc.setProperty('SelectionLanguage', 'XPath');
		return nodeContext.selectSingleNode( sExpression );
	}
	else if ( is.gecko ) {
		return xmlDoc.evaluate( sExpression, nodeContext, null, XPathResult.ANY_TYPE, null ).iterateNext();
	};
};
/**
 * XSLTProcessor - IE kiegészítés XSL átalakításra. Dokumentációja a mozilla.org-on.
 */
if ( !XSLTProcessor ) {
	function XSLTProcessor() {
		this.xmlDoc = null;
		this.importStylesheet = function( oXSLDoc ) {
			this.xslDoc = oXSLDoc;
		};
		this.transformToFragment = function( oXMLDoc, oDOMDocument ) {
			oDOMDocument.async = false;
  			oDOMDocument.validateOnParse = true;
			oXMLDoc.transformNodeToObject( this.xslDoc, oDOMDocument );
			return oDOMDocument;
		};
		this.transformToDocument = function( oXMLDoc ) {};
		this.setParameter = function( sNamespaceURI, sLocalName, sValue ) {};
		this.getParameter = function( sNamespaceURI, sLocalName ) {};
		this.removeParameter = function( sNamespaceURI, sLocalName ) {};
		this.clearParameters = function() {};
		this.reset = function() {};
		return this;
	};
};
/**
 * XMLSerializer - IE kiegészítés XML stringé alakítására. Dokumentációja a mozilla.org-on.
 */
if ( !XMLSerializer ) {
	function XMLSerializer() {
		this.serializeToString = function( DOMElement ) {
			return DOMElement.xml; 
		};
		this.serializeToStream = function() {};
		return this;
	};
};
/** 
 * Document.prototype.loadXML, Document.prototype.xml, Element.prototype.xml -  Geckó kiegészítések.
 */
if ( window.DOMParser && window.XMLSerializer && typeof XMLDocument != 'undefined' &&
	 Node && Node.prototype && Node.prototype.__defineGetter__ ) {
	XMLDocument.prototype.loadXML = function ( sXML ) {
		var doc2, i;
		doc2 = ( new DOMParser() ).parseFromString( sXML, 'text/xml' );
		while ( this.hasChildNodes() ) {
			this.removeChild( this.lastChild );
		};
		for ( i = 0; i < doc2.childNodes.length; i++ ) {
			this.appendChild( this.importNode( doc2.childNodes[i], true ) );
		};
	};
	XMLDocument.prototype.__defineGetter__( 'xml', function () {
		return ( new XMLSerializer() ).serializeToString( this );
	} );
	Element.prototype.__defineGetter__( 'xml', function () {
		return ( new XMLSerializer() ).serializeToString( this );
	} );
};


/**
 * $ attribute.js,v 1.4 2004/08/19 11:59:21 gyuris Exp $
 * @package  lib.attribute
 * @author   Gyuris Gellért
 * @see      browserCheck
 */
/**
 * isSpecified - Egy elem attribútuma deklarálva van-e?
 * Szabványos attr. esetén attributes['valami'].specified; nem szabvanyos 
 * attributum esetén: attributes.getNamedItem('valami') visszatérési értéke 
 * null, de csak 6-os Explorer; hasAttribute minden máshol
 *
 * @param nodeEl DOMElement  Az elem DOM objektumként.
 * @param sAttribute String  Az attribútum neve stringként.
 * @return Boolean           Dekralárva van, vagy sem?
 * @since                    1.4
 */
function isSpecified( nodeEl, sAttribute ) {
	if ( is.ie || is.opera7 ) {
		/*getItemIndex( nodeEl, sAttribute ) != null ) { // normál 'core' attribútum
			return nodeEl.attributes[sAttribute].specified
		}*/
		if ( typeof nodeEl.attributes[sAttribute] != 'undefined' ) {
			return nodeEl.attributes[sAttribute].specified;
		};
		if ( is.ie5 || is.ie55 ) {
			return ( nodeEl.getAttribute( sAttribute ) ) ? true : false;
		}
		else if ( is.ie6 || is.opera7 ) {
			return ( nodeEl.attributes.getNamedItem( sAttribute ) ) ? true : false;
		};
	}
	else if ( is.bss ) { // opera7.5
		return nodeEl.hasAttribute( sAttribute );
	};
};
/**
 * getAttributeIndex - IE: visszaadja az attribútum sorszámát az attributes tömben
 * @param nodeEl DOMElement  Az elem DOM objektumként.
 * @param sAttribute String  Az attribútum neve stringként.
 * @return Number            Hanyadik attribútum.
 * @since                    1.0
 */
function getAttributeIndex( nodeEl, sAttribute ) {
	var i;
	sAttribute = sAttribute.toLowerCase();
	for ( i = 0; i < nodeEl.attributes.length; i++ ) {
		if ( nodeEl.attributes.item(i).nodeName.toLowerCase() == sAttribute ) {
			return i;
		};
	};
	return null;
};
/**
 * createId - vagy visszaadja az elem már meglévő Id-jét, vagy készít egy véletlen Id-t
 * @param el DOMELement  Az elem, amelynek id-t akarunk készíteni.
 * @return String        A string, mely idnek felel meg. IE esetén a beépített uniqueID használtatik.
 * @since                0.1
 */
function createId( el ) {
	if ( isSpecified( el, 'id' ) ) {
		return el.id;
	};
	if ( is.ie ) {
		return el.uniqueID;
	}
	else {
		function getRandom() {
			var strNum = Math.random().toString().toFloat();
			if ( strNum == 0 || strNum == 1 ) { 
				return getRandom();
			};
			return strNum;
		};
		return 'rID-' + getRandom();
	};
};


/**
 * $ createFullOffset.js,v 1.4 2004/09/20 11:21:58 gyuris Exp $
 * createFullOffset - visszadja az elem abszolút elhelyezekedését a body-hoz 
 * viszonyítva: kompatibilitás miatt regisztrálja is a elembe
 * @package              lib.createFullOffset
 * @author               Gyuris Gellért
 * @see                  browserCheck, getComputedStylePropertyValue, prototypeA
 * @param el DOMElement  Az elem, melynek pozícióira kiváncsiak vagyunk.
 * @return Object        offsetX, offsetY: x és y pozíciók számokkal
 */
function createFullOffset( el, elRoot ) {
	var aFullOffset = [];
	function getFullOffset( el ) {
		var aOffset = [], aTempOffset = [];
		aOffset[0] = el.offsetLeft;
		aOffset[1] = el.offsetTop;
		if ( is.ie5 && el.tagName.toLowerCase() == 'body' ) {
			aOffset[0] += getComputedStylePropertyValue( el, 'margin-left', '' ).toInt();
			aOffset[0] += getComputedStylePropertyValue( el, 'padding-left', '' ).toInt();
			aOffset[1] += getComputedStylePropertyValue( el, 'margin-top', '' ).toInt();
			aOffset[1] += getComputedStylePropertyValue( el, 'padding-top', '' ).toInt();
		};
		if ( el.offsetParent != null && el.offsetParent != elRoot ) {
			aTempOffset = getFullOffset( el.offsetParent );
			aOffset[0] += aTempOffset[0];
			aOffset[1] += aTempOffset[1];
		};
		return aOffset;
	};
	if ( !elRoot ) {
		elRoot = document.documentElement || document.body;
	};
	if ( el.nodeType != Node.ELEMENT_NODE ) {
		return { offsetX : null, offsetY : null };
	};
	aFullOffset = getFullOffset( el );
	el.offsetX = aFullOffset[0];
	el.offsetY = aFullOffset[1];
	if ( is.ie5 ) { // ie5win + ie5mac
		el.offsetX = el.offsetX - getComputedStylePropertyValue( el, 'padding-left', '' ).toInt();
		el.offsetY = el.offsetY - getComputedStylePropertyValue( el, 'padding-top',  '' ).toInt();
	};
	return { offsetX : el.offsetX, offsetY : el.offsetY };
};


/**
 * $ getComputedStylePropertyValue.js,v 1.4 2005/01/03 13:22:09 gyuris Exp $
 * getComputedStylePropertyValue - visszadja az elem tényleges stílusának elemeit. FONTOS! Nem minden böngésző támogatja.
 * Gond nélkül megy Geckókban és IE-ben. Opera csak a 7.20-tól támogatja, az alatti csak visszadja a normális style 
 * értékeket. Nem megy KHTML (Safari) alatt. 
 * @package                       lib.getComputedStylePropertyValue
 * @author                        Gyuris Gellért
 * @see                           browserCheck
 * @param elNode DOMElement       Az elem, melynek stílus-értékére vagyunk kíváncsiak.
 * @param sStyleProperty String   Az stílus deklaráció neve: pl. 'border-left-color'
 * @param sPseudoProperty String  A pszeudo deklráció neve: pl. 'fist-letter' - Ez csak Geckókban működik!, elhagyható
 * @return String                 A deklarácó értéke.
 */
function getComputedStylePropertyValue( elNode, sStyleProperty, sPseudoProperty ) {
	var aResult, i, sResult;
	if ( is.khtml ) {
		// null document.getOverrideStyle( elNode, sPseudoProperty )
		// nem igazi: visszatérési érték null, ha nincs
		return elNode.style.getPropertyValue( sStyleProperty );
	}
	else if ( is.opera && is.appVer >= 7 ) {
		// opera7.20!
		if ( window.getComputedStyle ) {
			return window.getComputedStyle( elNode, sPseudoProperty ).getPropertyValue( sStyleProperty );
		};
		// nem igazi: visszatérési érték null, ha nincs; azért van kikeresve, hogy létezik-e, mert egyébként egy 
		// 'Warning' hibaüzenetet ad vissza, amit nem lehet lekezelni:
		for ( i = 0; i < elNode.style.length; i++ ) {
			if ( elNode.style.item( i ) == sStyleProperty ) {
				return elNode.style.getPropertyValue( sStyleProperty );
			};
		};
		return null;
	}
	else if ( is.gecko ) {
		return document.defaultView.getComputedStyle( elNode, sPseudoProperty ).getPropertyValue( sStyleProperty );
	}
	else if ( is.ie ) {
		aResult = sStyleProperty.split('-')
		for ( i = 1; i < aResult.length; i++ ) {
			aResult[i] = aResult[i].toUpperCaseFirst();
		};
		sStyleProperty = aResult.join('');
		if ( is.mac ) { // a dokumentáció ellenére nincs getAttribute() függvény ie5Mac alatt
			return elNode.currentStyle[ sStyleProperty ]; // XXX display-t nem tudja visszadni!
		};
		return elNode.currentStyle.getAttribute( sStyleProperty );
	};
};


/**
 * $ makeAbsolute.js,v 1.2 2004/08/19 11:59:21 gyuris Exp $
 * makeAbsolute - egy elemet györkerét megváltoztatja úgy, hogy pocíziciója megmaradjon.
 * @package                    lib.makeAbsolute
 * @author                     Gyuris Gellért
 * @see                        createFullOffset, getComputedStylePropertyValue
 * @param el DOMElement        Az elem, amelyet áthelyezünk.
 * @param elParent DOMElement  Az elem, amely az új gyökér lesz.
 * @return el DOMElement       Az elem, amlynek már új a parentNode-ja
 */
function makeAbsolute( el, elParent ) {
	var oFullOffset;
	oFullOffset = createFullOffset( el );
	//elNew = elOld.cloneNode( true );
	if ( getComputedStylePropertyValue( el, 'display', '' ) != 'none' ) {
		el.style.width = el.offsetWidth + 'px';
		el.style.height = el.offsetHeight + 'px';
	};
	el.style.position = 'absolute';
	el.style.left = oFullOffset.offsetX + 'px' ;
	el.style.top = oFullOffset.offsetY + 'px' ;
	//elOld.parentNode.removeChild( elOld );
	elParent.appendChild( el );
	return el;
};