/***************************************
 * prototypeA v3.6 :
 **************************************/
/*
 * Node v1
 ***************************************
 * IE-ben nincs
 */
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 v1
 ****************************************
 * IE-ben nincs
 */
Function.prototype.getName = function () {
	if ( typeof Function.prototype.name == 'string' )
		return this.name;
	else {
		var sName, nPos;
		sName= this.toString().split(' ')[1];
		nPos = sName.indexOf( '(' );
		this.name = sName.substr( 0, nPos )
		return this.name;
	};
};
/*
 * String.prototype.trim
 ***************************************
 * lecsupaszítás
 */
String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "");
};
/*
 * String.prototype.escapeHTML, String.prototype.unescapeHTML v1
 *******************************************************************************
 * átalakítás HTML-re és vissza
 */
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 = function() {
	var s = this.toString();
	s = s.replace(/\&lt;/g,  '<');
	s = s.replace(/\&gt;/g,  '>');
	s = s.replace(/\&amp;/g, '&');
	return s;
};
/*
 * String.prototype.toInteger, String.prototype.toFloat  v1.1
 *******************************************************************************
 * toInteger: 'a112' -> 0, '23a1' -> 23,  '1.2a34bc' -> 1
 * toFloat: '1.2a34bc' -> 1234
 */
String.prototype.toInt = function( nBase ) {
	if ( typeof( nBase ) == 'undefined' )
		nBase = 10;
	var nVal = parseInt( this.toString() , nBase );
	if ( isNaN( nVal ) )
		nVal = 0;
	return nVal;
};
String.prototype.toFloat = function() {
	return parseFloat( ('0' + this.toString() ).replace(/[^0-9]/g,''), 10)
};
/*
 * String.prototype.endsWith, String.prototype.startsWith  v1
 *******************************************************************************
 * kezdődik-e ill. végződik-e (opc: bizonyos kezdőponttól) a megadott sztringgel
 */
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 = 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, String.prototype.toUpperCaseWords  v1
 *******************************************************************************
 * nagybetűssé alakítja az első betűt, ill. minden szó első betűjét
 */
String.prototype.toUpperCaseFirst = function() {
	return this.toString().charAt(0).toUpperCase() + this.toString().substring( 1, this.toString().length );
}
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(' ');
}
/*
 * Array.prototype.item, Array.prototype.nextItem v1.1
 * && Array.prototype.push, Array.prototype.pop, Array.prototype.shift,
 * Array.prototype.unshift, Array.prototype.splice v1.1
 *******************************************************************************
 * item: visszaadja az i indexelésű elemet
 * nextItem : Visszadja a követkető elemet, akár szám, akár sztring indexelésű.
 * 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. 
 * IE5.0 kiegészítése: splice unshift shift pop push
 * updateArrayPrototype, cleanupArrayPrototype: a for..in Array esetén szükséges
 * kitakarítást végzi el.
 */
function updateArrayPrototype() {
	Array.prototype.item = function( i ) {
		return this[i];
	};
	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();
function cleanupArrayPrototype() {
	var i;
	for ( i in Array.prototype ) 
		delete Array.prototype[i];
};


/**
 * @package  lib.browserCheck
 * @author   Gyuris Gellért
 * @since    4.43
 */
var is = {
	getUserAgents : function() { 
		// segédfunkciók XXX regexp
		this.geckoGetRv = function() {
			var nRv = 0, nStart, nEnd, sRv, aRv, nExp = 1, i, nTemp;
			nStart = this.agent.indexOf( 'rv:' );
			nEnd   = this.agent.indexOf( ')', nStart );
			sRv    = this.agent.substring( nStart + 'rv:'.length , nEnd  );
			aRv    = sRv.split('.');
			for ( i = 0; i < aRv.length; i++ ) {
				nTemp = parseInt( aRv[i] );
				nRv += nTemp / nExp;
				nExp *= 10;
			};
			return nRv;
		};
		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 ) );
		// 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;
		/*@cc_on @*/ /*@if (@_jscript) 
		this.ieJSBuild   = @_jscript_build;
		this.ieJSVersion = @_jscript_version; /*@end @*/
		// 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.fb          = ( this.gecko && ( this.vendor == 'mozilla firebird' || this.vendor == 'phoenix' || this.vendor == 'firefox' ) );
		this.fx          = ( 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.opera7 || this.saf );
		this.bss         = ( this.gecko || this.opera7 || this.saf )
		this.min         = ( this.bs5 || this.ie5 || this.opera || this.khtml );
		return this;
	}
};
is.getUserAgents();


/***************************************
 * createFullOffset v1.41
 *******************************************************************************
 * Visszadja az elem abszoludt elelyezekedését a body-hoz viszonyítva: offsetX
 * és offsetY (kompatibilitás miatt regisztrálja is a elembe) - vagy null-t
 */
function createFullOffset( el ) {
	var aFullOffset = [];
	function getFullOffset( el ) {
		var aOffset = [];
		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 ) {
			var aTempOffset = [];
			aTempOffset = getFullOffset( el.offsetParent );
			aOffset[0] += aTempOffset[0];
			aOffset[1] += aTempOffset[1];
		}
		return aOffset;
	}
	if ( el.nodeType != Node.ELEMENT_NODE ) return null;
	aFullOffset = getFullOffset( el );
	el.offsetX = aFullOffset[0]; // opera7 miatt nem setAttribute, mert nem tudja kiolvasni, es hogy number tipusú legyen!
	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 v1.3
 *******************************************************************************
 * valódi style lrtlkek lekérdezése, sStyleProperty pl. 'border-left-color'
 */
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.opera7 ) {
		// 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 ] ); // display-t nem tudja visszadni!
		return elNode.currentStyle.getAttribute( sStyleProperty );
	}
}


/****************************************
 * eventBinding v3.6beta
 *******************************************************************************
 * Egy esemény csatolása. Alapfüggvény. A this kulcsszú emulásának lekérdezésére
 * való a getBindingSelf
 */
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);
};
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 );
		};
	}
}
function getBindingSelf( el ) {
	if ( is.ie ) {
		if ( FORCE_IE_EVENTBINDING ) {
			return window.event.srcElement;
		};
		return el.getSelf()
	}
	else {
		return el;
	}
}
/* eventBindingCompletion v1
 *******************************************************************************
 * ie5Mac nem támogatja a többszörösen csatolt eseményeket, ez akigészítés végzi
 * el, Konq és Saf is hasznája a loadBindingben
 */
function eventBindingCompletion( aNode, bFlag, sType, fListener, bCapture ) {
	function eventObject( sType, fListener) {
		this.type = sType;
		this.listener = fListener;
		return this;
	}
	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.getName() + '()' );
					}
				}
			}
			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] = new eventObject( sType, findFunctionString( fFirst ) ); // typeof: string
			eval( 'aNode['+i+'].on' + sType + ' = ' + 'aNode['+i+'].dispatchEvents' );
			aNode[i].aAttachedEvents[aNode[i].aAttachedEvents.length] = new eventObject( sType, 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;
			}
		}
	}
}
/* loadEventBinding v1
 *******************************************************************************
 * 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...
 */
function loadEventBinding( oWin, fListener ) {
	if ( is.ie || is.gecko )
		eventBinding( oWin, true, 'load', fListener, false );
	if ( is.opera7 )
		eventBinding( oWin.document, true, 'load', fListener, false );
	if ( is.konq || is.saf )
		eventBindingCompletion( [ oWin, oWin.document ], true, 'load', fListener, false );
}
/* resizeEventBinding v1
 *******************************************************************************
 * 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...
 */
function resizeEventBinding( bFlag, fListener ) {
	if ( is.opera7 )
		eventBinding( document, bFlag, 'resize', fListener, false )
	else
		eventBinding( window, bFlag, 'resize', fListener, false );
}
/* globalEventBinding v1
 *******************************************************************************
 * Teljes csatolás a beágyazott IFRAME-k eseményeinek átvételére.
 */
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 )
		var 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 )
		}
	}
}


/***************************************
 * Class v1.2
 **************************************/
/* removeClass v1, addClass v1, hasClass v1
 *******************************************************************************
 * Többszörös class-oksat kezelnek a függvények. A hasClass true vagy false 
 * értékkel tér vissza.Minden függvény két paramétert vár: el:DOMElement, 
 * className:CSS osztály
 */
function removeClass( el, className ) {
	if ( !( el && el.className ) )
		return;
	var i, aClass, aNewClass = [];
	aClass = el.className.split(' ');
	for ( i = aClass.length; i > 0; ) {
		if ( aClass[--i] != className )
			aNewClass[aNewClass.length] = aClass[i];
	}
	el.className = aNewClass.join(' ');
};
function addClass( el, className ) {
	if ( !el ) // előfordulhat, hogy még nincs osztályba sorolva
		return;
	removeClass( el, className ); // kivesszük az első helyről, ha ott van
	if ( el.className == '' )
		el.className = className;
	else
		el.className += ' ' + className;
};
function hasClass( el, className ) {
	if ( !( el && el.className ) )
		return;
	var i, aClass;
	aClass = el.className.split(' ');
	for ( i = aClass.length; i > 0; ) {
		if ( aClass[--i] == className )
			return true;
	}
	return false;
};


/***************************************
 * child v1
 **************************************/
/* getChildIndex v1.1
 *******************************************************************************
 * visszaadja a gyermek sorszámát a szülő objektumban, null-t ha nem gyermek
 */
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 v1.0
 *******************************************************************************
 * visszaadja a kért csomópont-típusú leszármazottját
 * 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
 */
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;
}
function getAllChildElement( elRoot ) {
	elRoot.allEl = getContextNodes( elRoot, [ Node.ELEMENT_NODE ] );
}
function getAllChildNode( elRoot ) {
	elRoot.allNodes = getContextNodes( elRoot, [ Node.ELEMENT_NODE, Node.TEXT_NODE, Node.CDATA_SECTION_NODE, Node.COMMENT_NODE ] );
}
/* getFirstElement v1.1, getLastElement v1.2
 *******************************************************************************
 * getFirstElement: visszaadja egy csomópont első ELEMENT_NODE-ját, vagy null-t 
 * getLastElement: visszadja egy csomópont utolsó ELEMENT_NODE-ját, vagy null-t
 */
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;
}
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 v1.0, getPreviousElement v1.0
 *******************************************************************************
 * getNextElement: visszadja egy csomópont következő ELEMENT_NODE testvérét, 
 * getPreviousElement: visszadja egy csomópont megelőző ELEMENT_NODE testvérét, 
 * null-t ad vissza ha nincs
 */
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 )
}
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 v1.2
 ***************************************
 * üres TEXT_NODE-ok eltávolítása
 */
function removeEmptyTextNode( elRoot ) {
	var re, aNodes;
	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 ) ) {
			aNodes[i].parentNode.removeChild( aNodes[i] );
		}
	}
}

/***************************************
 * makeUnselectable v1.2
 *******************************************************************************
 * Egy elemetnek tiltja a kijelölését és fókuszba kerülését. Opera7 megoldatlan.
 */
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';
	}
}


/***************************************
 * displayChanger v1.4 
 *******************************************************************************
 * Megfordítja egy elem display-ét, vagy a megadottra állítja (true/false). IE5Mac
 * el.currentStyle.display nem tudja visszaadni a tényleges display állapotot,
 * így IE5 alatt 'késik' a getComputedStylePropertyValue függvény miatt.
 */
function displayChanger( el, bValue ) {
	var aTags, aStandardDisplays, aMSIEDisplays, aCurrentDisplays, i, bFound = false;
	if ( el.nodeType != Node.ELEMENT_NODE ) return null;
	aTags             = ['iframe', 'body',  'p',     'div',   'span',  'table', 'tbody',           'tfoot',              'thead',              'tr',        'td',         'th',         'ul',    'ol',    'li',        'select' ];
	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' ];
	aMSIEDisplays     = ['inline', 'block', 'block', 'block', 'inline','block', 'block',           'block',              'block',              'block',     'block',      'block',      'block', 'block', 'inline',    'inline' ];
	if ( is.bss )     aCurrentDisplays = aStandardDisplays;
	else if ( is.ie ) aCurrentDisplays = aMSIEDisplays;
	else return false;
	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];
			
	}
	else { // ha 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';
	}
}

/***************************************
 * debug v1.2
 ***************************************
 * list v1.2
 */
function list( oObj ) {
	if ( is.ns4 || is.opera5 || is.opera6 )
		listWidthBrowsers4( oObj )
	else
		listWidthBrowsers5( oObj );
}
function listWidthBrowsers4( oObj ) {
	var i, str = '';
	for ( i in oObj ) 
		str += i + ' = ' + oObj[i] + '\n';
	alert( str );
}
function listWidthBrowsers5( oObj ) {
	var i, sHTML, oChild, elListWindow, sFunction;
	// segédfunkció string típusok esetén a HTML kód kiszűrésére
	function stripTags( str ) {
		var aChar, aHTML, i, re;
		aChar = ["<"   , ">",    "\n",     "\t"     ];
		aHTML = ["&lt;", "&gt;", "&nbsp;", "&nbsp;" ];
		for ( i = 0; i < aChar.length; i++ ) {
			re = new RegExp( aChar[i] , "g" );
			str = str.replace( re, aHTML[i] );
		}
		return( str );
	}
	// segédfunkció a hibaüzenetek meghatározásához
	function errorMessage( e ) {
		var sError = ( new String( navigator.product ).toLowerCase() == 'gecko' ) ? e : e.number + '; ' + e.description;
		return sError;
	}
	// segédfunkció az elemek legyártásához
	function addItem( strHTML, oStyle, oParent ) {
		var k, elItem;
		elItem = document.createElement('DIV');
		for ( k in oStyle )
			elItem.style[k] = oStyle[k];
		elItem.innerHTML = strHTML;
		if ( oParent )
			oParent.appendChild( elItem )
		else
			return elItem;
	}
	if ( !window.innerWidth ) { 
		window.innerWidth = ( document.body ) ? document.body.offsetWidth : 800;
		window.innerHeight = ( document.body ) ? document.body.offsetHeight : 600;
	}
	if ( document.body && document.body.appendChild ) {
		elListWindow = addItem( '', style = { 
			position : 'absolute', 
			top : '10px', 
			right : '10px', 
			width : Math.floor( window.innerWidth * 2/5 ) + 'px',
			height : window.innerHeight - 30 + 'px',
			zIndex : '1000',
			overflow : 'auto',
			backgroundColor : 'silver',
			fontFamily : 'Verdana, sans-serif',
			fontSize : '11px',
			padding : '5px',
			paddingBottom : '20px',
			border : '1px solid black' } )
	}
	sFunction = "function doList() {\n" +
				"    if ( oObj == null ) {\n" +
				"        addItem( '&#8501; null', style = { color : 'darkblue', fontWeight : 'bold', fontFamily : 'Lucida sans Unicode, sans-serif', fontSize : '14px' }, elListWindow ) }\n" + 
				"     else {\n" + 
				"        try { addItem( '&#8501; ' + eval( oObj ), style = { color : 'darkblue', fontWeight : 'bold', fontFamily : 'Lucida sans Unicode, sans-serif', fontSize : '14px' }, elListWindow ) }\n" +
				"        catch( e ) { addItem( 'ERROR: [' + i + ' : ' + errorMessage( e ) + ']', style = { color : 'red', fontFamily : 'Lucida sans Unicode, sans-serif' }, elListWindow ) }\n" + 
				"        for ( i in oObj ) {\n" + 
				"            try {\n" + 
				"                oChild = oObj[i];\n" + 
				"                if      ( typeof( oChild ) == 'object'   )  {\n" +
				"                    if      ( oChild instanceof Array    )  addItem( i + ' [] ',                                       style = { color : 'deeppink' }, elListWindow )\n" + 
				"                    else if ( oChild instanceof Date     )  addItem( i + ' &raquo; ' + oChild,                         style = { color : 'black' }, elListWindow )\n" + 
				"                    else if ( oChild instanceof RegExp   )  addItem( i + ' &#8250; ' + oChild,                         style = { color : 'midnightblue' }, elListWindow )\n" + 
				"                    else if ( oChild instanceof Object   )  addItem( '&rarr; ' + i + ' ',                              style = { color : 'darkblue' }, elListWindow )\n" + 
				"                    else if ( oChild == null             )  addItem( i + ' &bull; ',                                   style = { color : 'darkblue' }, elListWindow )\n" + 
				"                    else                                    addItem( '&rarr; ' + i + ' ',                              style = { color : 'darkblue' }, elListWindow )\n" + 
				"                }\n" +  
				"                else if ( typeof( oChild ) == 'number'   )  addItem( i + ' = '       + oChild,                         style = { color : 'darkmagenta' }, elListWindow )\n" + 
				"                else if ( typeof( oChild ) == 'string'   )  addItem( i + ' : &quot;' + stripTags( oChild ) + '&quot;', style = { color : 'darkred' }, elListWindow )\n" + 
				"                else if ( typeof( oChild ) == 'function' )  addItem( ' &fnof; ' + i,                                   style = { color : 'green' }, elListWindow )\n" + 
				"                else if ( typeof( oChild ) == 'boolean'  )  addItem( i + ' &rsaquo;&rsaquo; ' + oChild,                style = { color : 'mediumvioletred' }, elListWindow )\n" + 
				"                else                                        addItem( i + ' &ne; '    + oChild,                         style = { color : 'red' }, elListWindow )\n" + 
				"            }\n" + 
				"            catch( e ) { addItem( i + ' &#8212; ERROR: ' + errorMessage( e ), style = { color : 'red' }, elListWindow ) }\n" + 
				"        }\n" + 
				"    }\n" +
				"}"
	eval( sFunction );
	doList();
	document.body.appendChild( elListWindow ); 
}
/*
 * Workload v1.1
 ***************************************/
var Workload = {
	timeInit : new Date(),
	timeA : null,
	timeB : null,
	times : [],
	start : function() {
		this.timeA = new Date();	
	},
	addPoint : function( sComment) {
		this.times[this.times.length] = { time : new Date(), comment : sComment };
	},
	end : function() {
		var timeDifference, elListWindow, i;
		function addItem( strHTML, oStyle, oParent ) {
			var k, elItem;
			elItem = document.createElement('DIV');
			for ( k in oStyle )
				elItem.style[k] = oStyle[k];
			elItem.innerHTML = strHTML;
			if ( oParent )
				oParent.appendChild( elItem )
			else
				return elItem;
		}
		function getPrecisionDate( oDate ) {
			var s = '';
			s += oDate.getUTCHours()   + ':';
   			s += oDate.getUTCMinutes() + ':';
   			s += oDate.getUTCSeconds() + ' ';
   			s += oDate.getUTCMilliseconds();
			return s;
		}
		this.timeB = new Date();
		timeDifference = this.timeB - this.timeA;
		if ( !document.body || !document.body.appendChild )
			return alert( timeDifference );
		elListWindow = addItem( '', style = { 
			position : 'absolute', 
			top : '10px', 
			right : '10px', 
			zIndex : '1001',
			backgroundColor : 'silver',
			fontFamily : 'Verdana, sans-serif',
			fontSize : '11px',
			textAlign : 'left',
			padding : '5px',
			border : '1px solid black' } );
		addItem( getPrecisionDate( this.timeInit ) + ' init',  style = { color: 'black' }, elListWindow );
		addItem( getPrecisionDate( this.timeA )    + ' start', style = { color: 'blue' }, elListWindow );
		for ( i = 0; i < this.times.length; i++ ) {
			addItem( getPrecisionDate( this.times[i].time ) + ' ' + this.times[i].comment, style = { color: 'red' }, elListWindow );
		}
		addItem( getPrecisionDate( this.timeB )    + ' end',  style = { color: 'blue' }, elListWindow );	
		addItem( '&rarr; ' + timeDifference,  style = { color: 'red' }, elListWindow  );
		document.body.appendChild( elListWindow );
	}
};