

// NS a OPERA nepozna undefined, takze si ho vytvorim
	var undefined;
	
// -SPRACOVANIE-UDALOSTI---BEGIN---------------------------------------------------------------------------------------------------------	

	// funkcia ktora nic nerobi, iba vracia FALSE
	function return_false() { return false }
	
	// ak sa funkcia zapise do udalosti .oncontextmenu, zablokuje vyskocenie contextmenu
	function nocontextmenu(e)
	{
		stopBubbling(e);
		if (!e && window.event) e = window.event;
		e.returnValue  = false; 
		return false;
	} 

// -BROWSER-BEGIN---------------------------------------------------------------------------------------------------------

	var browser = new Object();
	browser.isIE;  // Internet Explorer
	browser.isNS;  // Netscape Navigator alebo Mozilla
	browser.isOP;  // Opera

	// zistuje a naplni 3 premenne, isIE, isNS, isOP  podla aktualneho BROWSERU
	// vola sa iba raz pri spusteni stranky
	browser.detectUserAgent = function()
	{
		var agent = navigator.userAgent.toLowerCase();
		this.isNS = (!document.all && !window.opera && document.getElementById)?true:false;  // Netscape aj Mozilla
		this.isIE = (document.all && !window.opera)?true:false;
		this.isOP = (agent.indexOf("opera")>0 && window.opera)?true:false;
		
		// Supernavigator by mal fungovat na nasledujucich verziach prehliadacov
		// IE       6,    5.5,   5,     4???
		// Opera    7,    6??,   5??,   4??
		// Mozilla  1.4,  ???
		// NS       7,    6??,   5??
		  
		// treba zistit este verziu
		if (this.isIE)
		{
			if (document.fireEvent && document.createComment) this.version = 6;
			else if (document.fireEvent && !document.createComment) this.version = 5.5;
			else this.version = 5;
		}
		if (this.isNS) // a co verzie Mozilly ???????????????
		{
			if (window.getSelection && !document.compatMode) this.version = 6; 
			if (window.getSelection && window.atob) 		 this.version = 7;  
		}
		if (this.isOP)
		{
			if (!document.createElement) this.version = 5;
			if (document.releaseEvents)  this.version = 6;
			if (document.compatMode)  	 this.version = 7;
		}
		
		// skusi odhadnut rychlost pocitaca
		var time = 0;
		for(var k=1; k<=5; k++)
		{
			stopWatch.start();
			for (var i=0; i<100000; i++) { i++; i--; }
			time += stopWatch.stop();
		}
		time = 72000 / (time / (k-1)); // na MHz (zhruba)
		if (this.isNS) time /= 1.2;
		if (this.isOP) time *= 3.5;
		this.speed = time;
		// IE 25 // NS 25 // OP 80
	}

// -BROWSER-END---------------------------------------------------------------------------------------------------------

// -STOPKY-BEGIN--------------------------------------------------------------------------------------------------------

	// stopky na meranie casu
	var stopWatch = { startTime: 0, stopTime: 0, time: 0 }

	// spusti stopky
	stopWatch.start = function()
	{
		var datum = new Date();
		stopWatch.startTime = datum.getTime();
	}
	// zastavi stopky a vrati aktualny cas
	stopWatch.stop = function()
	{
		var datum = new Date();
		stopWatch.stopTime = datum.getTime();
		stopWatch.time = stopWatch.stopTime - stopWatch.startTime;
		stopWatch.startTime = stopWatch.stopTime = 0;
		return stopWatch.time;
	}
	// vracia posledny namerany cas
	stopWatch.time = function()
	{
		return stopWatch.time;
	}
	
// -STOPKY-END-----------------------------------------------------------------------------------------------------------	

	function checkEmail(email)
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
			return true;
		else
			return false;
	}

	// funkcia vracia velkost objektu (html prvku) na stranke
	// vracia objekt s vlastnostami left a top
	function offsetSize_objektu(objekt)
	{
		if (!objekt) return null;
		return new Position( objekt.offsetWidth, objekt.offsetHeight );
	}

	// vypise vlastnosti objektu v novom okne
	function print_obj(objekt)
	{
		var vlastnosti = new Array();
		for (var vlastnost in objekt)
		{
			vlastnosti[vlastnost] = objekt[vlastnost];
		}	
		//vlastnosti.sort();
		var text = '';
		for (var vlastnost in vlastnosti) text += vlastnost+"<font color=red>="+vlastnosti[vlastnost]+"</font><br>\n";
		win = window.open();
		win.document.write(text);
		win.document.close();
	}

	// vracia poziciu nascrollovania aktualneho okna
	function getScrollPosition()
	{
		// poradie je tu dolezite... takto to musi byt
		if (typeof(window.pageYOffset)=="number")
   			return new Position( window.pageXOffset, window.pageYOffset ); 
		if (document.documentElement && typeof(document.documentElement.scrollTop)=="number") 
   			return new Position( document.documentElement.scrollLeft, document.documentElement.scrollTop ); 
		if (document.body && typeof(document.body.scrollTop)=="number") 
   			return new Position( document.body.scrollLeft, document.body.scrollTop ); 
   		return Position(0,0);
	}

	// vracia velkost okna (vnutornu velkost)	
	function getWindowSize()
	{
		//Non-IE
		if( typeof( window.innerWidth ) == 'number' ) 
			return new Size( window.innerWidth, window.innerHeight);
		
		//IE 6+ in 'standards compliant mode'
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
			return new Size( document.documentElement.clientWidth, document.documentElement.clientHeight);
			
		//IE 4 compatible
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
			return new Size( document.body.clientWidth, document.body.clientHeight);
		
		else 
			return new Size(0,0);
	}
	
	// vracia velkost documentu
	function getDocumentSize()
	{
		return new Size( document.body.offsetWidth, document.body.offsetHeight );
	}
	
	// ak bolo prave tlacitko mysi (true | false)
	function rightMouse(e)
	{
		if (!e) var e = event;
		return (browser.isNS && e.which > 1) || (browser.isIE && e.button > 1);
	}

	// vracia poziciu mysi v dokumente
	getMousePosition = function(e)
	{
		return (browser.isNS) ? 
				new Position( e.pageX, e.pageY ) : 
				new Position( event.clientX, event.clientY).plus(getScrollPosition());
	} 
	
	// vracia poziciu mysi v okne
	getMousePositionInWindow = function(e)
	{
		return (browser.isNS) ? 
				new Position( e.pageX, e.pageY ).minus( getScrollPosition() ) : 
				new Position( event.clientX, event.clientY);
	} 


	// vytvori html element
	vytvorHTMLElement = function( tag, id, parent)
	{
		var element;
		if (parent && !(element = getById(id)))
		{
			element = document.createElement( tag );
			element.id = id;
			parent.appendChild( element );
		}
		return element;
	}
		
	// vracia HTML Element podla ID (taka funkcia uz je, ale tato skracuje jej zapis)
	function getById(ElementID)
	{
		return document.getElementById(ElementID);	
	}
	
	
	
	
	// -UHOL---BEGIN-------------------------------------------------------------------------------------------------------
	
	function Angle( alfa )
	{
		this.alfa  = alfa;								// uhol
		this.cos   = Math.cos( alfa * Angle.deg2rad );	// predpocitany sinus
		this.sin   = Math.sin( alfa * Angle.deg2rad );	// predpocitany cosinus
		Angle.last = this;
	}
	// prepocet stupnov na radiany
	Angle.deg2rad = Math.PI/180;
	// posledny vytvoreny uhol (usetri na pocitani ak vytvaram znovu ten isty)
	Angle.last = null;
	// vytvori novy uhol (optimalizovane, ak je to ten co naposledy, nevytvara novy ale vracia posledny)
	Angle.create = function( alfa ) { return (Angle.last && alfa == Angle.last.alfa) ? Angle.last : new Angle( alfa ); }
	
	// vracia uhol medzi dvoma vektormi
	Angle.getFromVectors = function( vector1, vector2 )
	{
		var v1  = vector1.getCopy().unitize();
		var v2  = vector2.getCopy().unitize();
		var cos = Position.scalarMultiply( v1, v2 );
		var uhol = Math.acos(cos)/Angle.deg2rad;
		// toto je len taka haluz, treba neskor presne vypocitat fazu
		if ( v1.x*v1.y >= 0 && v2.x*v2.y >= 0 && uhol > 90) uhol = 360-uhol;
		if ( v1.x*v1.y <= 0 && v2.x*v2.y <= 0 && uhol < 90) uhol = 360-uhol;
		//window.defaultStatus = uhol +"" + (v1.x*v1.y) + " " + (v2.x*v2.y);
		return Angle.create(uhol);	
	}
// -UHOL---END---------------------------------------------------------------------------------------------------------
	
// -POZICIA-A-VELKOST---BEGIN------------------------------------------------------------------------------------------
	
	// CONSTRUCTOR pozicie [suradnice]
	function Position( x, y )
	{
		this.x     = x;
		this.y	   = y;
		this.limit = null; // :Area
	}
	
	// CONSTRUCTOR velkosti [rozmery]
	function Size( width, height )
	{
		this.width  = width;
		this.height = height;
		this.limit = null; // :Area
	}

	// vytvori poziciu (vrati ::Position) mozne vstupy: a) dve suradnice (cisla), b) jedno cislo, pouzije ho dvojmo, alebo c) priamo objekt ::Position
	Position.make = function( x, y ) { if (typeof(x)=="object" && x.constructor == Position) return x; if (typeof(x)=="object" && x.constructor == Size) return new Position( x.width, x.height ); if (typeof(y)!="number") return new Position( x, x ); return new Position( x, y ); }
	Size.make     = function( x, y ) { if (typeof(x)=="object" && x.constructor == Size) return x; if (typeof(x)=="object" && x.constructor == Position) return new Position( x.x, x.y ); if (typeof(y)!="number") return new Size( x, x ); return new Size( x, y ); }
	
	// tieto metody som vytvoril, aby som mohol zjednotit ostatne metody Position a Size (x==width, y==height)
	Position.prototype.getX = function() { return this.x; }
	Position.prototype.getY = function() { return this.y; }
	Size.prototype.getX = function() { return this.width; }
	Size.prototype.getY = function() { return this.height; }
	Position.prototype.setX = function(x) { this.x = x; this.check(); }
	Position.prototype.setY = function(y) { this.y = y; this.check(); }
	Size.prototype.setX = function(width) { this.width = width; this.check(); }
	Size.prototype.setY = function(height) { this.height = height; this.check(); }
	
	// [COMPARE] porovnavacia funkcia
	Position.prototype.isSameWith = 
		Size.prototype.isSameWith = function( posOrSize ) { return this.getX()==posOrSize.getX() && this.getY()==posOrSize.getY(); }
	// [COPY] vytvori kopiu pozicie
	Position.prototype.getCopy = 
		Size.prototype.getCopy = function() { return new this.constructor( this.getX(), this.getY() ); }
	// [VALUEOF] vypise poziciu
	Position.prototype.valueOf = function() { return "Position ["+this.getX()+", "+this.getY()+"] " }
	Size.prototype.valueOf = function() { return "Size ["+this.getX()+", "+this.getY()+"] " }
	// [SET] nastavi novu poziciu (mozes zadat objekt :Position alebo :Size, alebo x, y ako :Number)
	Position.prototype.set =
		Size.prototype.set = function( x, y )
		{
			if (typeof(x)=="object" && x.getX && x.getY)
				{ this.setX( x.getX() ); this.setY( x.getY() ); }
			else
				{ this.setX(x); this.setY(y); }
			this.check(); 
		}
	// [LIMIT] nastavi hranicne hodnoty (limitove hodnoty mozu byt aj null)
	Position.prototype.setLimit =
		Size.prototype.setLimit = function( area ) { this.limit = area; this.check(); }
	// [CHECK LIMIT] otestuje a opravi hodnoty pozicie podla limitu
	Position.prototype.check =
		Size.prototype.check = function()
	{
		if (this.limit)
		{
			if (this.limit.cornerUL)
			{
				if (typeof(this.limit.cornerUL.x)=="number" && this.limit.cornerUL.x>this.getX()) this.setX(this.limit.cornerUL.x);
				if (typeof(this.limit.cornerUL.y)=="number" && this.limit.cornerUL.y>this.getY()) this.setY(this.limit.cornerUL.y);
			}
			if (this.limit.cornerBR)
			{
				if (typeof(this.limit.cornerBR.x)=="number" && this.limit.cornerBR.x<this.getX()) this.setX(this.limit.cornerBR.x);
				if (typeof(this.limit.cornerBR.y)=="number" && this.limit.cornerBR.y<this.getY()) this.setY(this.limit.cornerBR.y);
			}
		}
	}
	// [CHECK LIMIT] otestuje a opravi hodnoty pozicie podla limitu
	Position.prototype.isInArea =
		Size.prototype.isInArea = function(area)
	{
		return this.getX()>=area.cornerUL.getX() && this.getY()>=area.cornerUL.getY() && this.getX()<=area.cornerBR.getX() && this.getY()<=area.cornerBR.getY();
	}
	
	// POZOR POZOR !!!!  Nasledujuce funkcie nic nevracaju, menia svoju instance
	// [ROTATE] zrotuje poziciu
	Position.prototype.rotate =
		Size.prototype.rotate = function( alfa ) { var angle = Angle.create( alfa ); this.set( angle.cos*this.getX() + angle.sin*this.getY(),  -angle.sin*this.getX() + angle.cos*this.getY() ); this.check(); return this; }
	// [+] pripocitanie k pozicii (Y je nepovinne, ak sa zada iba JEDNO CISLO, pripocita sa k obom suradniciam)
	Position.prototype.plus =
		Size.prototype.plus = function( x, y )     { var pos = this.constructor.make( x, y ); this.setX(this.getX()+pos.getX()); this.setY(this.getY()+pos.getY()); this.check(); return this; }
	// [-] odpocitanie k pozicii (Y je nepovinne, ak sa zada iba JEDNO CISLO, odpocita sa k obom suradniciam)
	Position.prototype.minus =
		Size.prototype.minus = function( x, y )    { var pos = this.constructor.make( x, y ); this.setX(this.getX()-pos.getX()); this.setY(this.getY()-pos.getY()); this.check(); return this; }
	// [*] vynasobenie pozicii (Y je nepovinne, ak sa zada iba JEDNO CISLO, vynasobi obe suradnice)
	Position.prototype.multiply =
		Size.prototype.multiply = function( x, y ) { var pos = this.constructor.make( x, y ); this.setX(this.getX()*pos.getX()); this.setY(this.getY()*pos.getY()); this.check(); return this; }
	// [/] vydelenie pozicii (Y je nepovinne, ak sa zada iba JEDNO CISLO, vedeli obe suradnice)
	Position.prototype.divide =
		Size.prototype.divide = function( x, y )   { var pos = this.constructor.make( x, y ); this.setX(this.getX()/pos.getX()); this.setY(this.getY()/pos.getY()); this.check(); return this; }

	
	// vracia HTML style="...." pozicie/velkosti
	Position.prototype.printToStyleHTML =
		Size.prototype.printToStyleHTML = function()
	{
		if (this.constructor == Position) return 'left: '+parseInt(this.x)+'px; top: ' +parseInt(this.y)+'px;';
		if (this.constructor == Size)     return 'width: '+parseInt(this.width)+'px; height: ' +parseInt(this.height)+'px;';
	}
	
	// vracia dlzku vektora
	Position.prototype.getLength =
		Size.prototype.getLength = function()
	{
		return Math.sqrt(Math.pow(this.getX(),2) + Math.pow(this.getY(),2));
	}
	
	// urobi s vektoru jednotkovy (jeho dlzka bude 1)
	Position.prototype.unitize =
		Size.prototype.unitize = function()
	{
		return this.divide( this.getLength() );
	}
	
	
	// vracia pomer dlzok this.vektora ku vektora zadaneho parametrom
	Position.prototype.sizeKoefTo =
		Size.prototype.sizeKoefTo = function( anotherPosition )
	{
		return this.getLength() / anotherPosition.getLength();
	}
	
	// vracia vektor od aktualnej pozicie do pozicie zadanej parametrom
	Position.prototype.getVectorTo =
		Size.prototype.getVectorTo = function( targetPosition )
	{
		var thisPosition = targetPosition.getCopy();
		thisPosition.minus( this );
		return thisPosition;
	}
	
	// vracia vektor od aktualnej pozicie do pozicie zadanej parametrom
	Position.prototype.getVectorTo =
		Size.prototype.getVectorTo = function( targetPosition )
	{
		var thisPosition = targetPosition.getCopy();
		thisPosition.minus( this );
		return thisPosition;
	}
	
	// vracia minimum dvoch pozicii
	Position.getMin = 
		Size.getMin = function( pos1, pos2 ) //::Position
	{
		return new this( (pos1.getX() < pos2.getX()) ? pos1.getX() : pos2.getX(),
						 (pos1.getY() < pos2.getY()) ? pos1.getY() : pos2.getY());
	}
	
	// vracia maximum dvoch pozicii
	Position.getMax = 
		Size.getMax = function( pos1, pos2 ) //::Position
	{
		return new this( (pos1.getX() > pos2.getX()) ? pos1.getX() : pos2.getX(),
						 (pos1.getY() > pos2.getY()) ? pos1.getY() : pos2.getY());
	}
	
	// vracia vzdialenost (rozdiel)
	Position.getDistance = 
		Size.getDistance = function( pos1, pos2 ) //::Position
	{
		return Math.sqrt(Math.pow(pos1.x-pos2.x,2) + Math.pow(pos1.y-pos2.y,2));
	}
	
	// vracia skalarny sucin
	Position.scalarMultiply = 
		Size.scalarMultiply = function( vec1, vec2 ) //::Number (cos uhla ktory zvieraju)
	{
		return vec1.getX()*vec2.getX() + vec1.getY()*vec2.getY();
	}
	
	// zaoktuhli poziciu / velkost
	Position.prototype.round = 
		Size.prototype.round = function()
	{
		this.setX( Math.round( this.getX() ) );
		this.setY( Math.round( this.getY() ) );
		return this;
	}

	// zaokruhli na cele cislo (!!!!ak je mala odchylka!!!!) 
	Position.prototype.roundMinimum = 
		Size.prototype.roundMinimum = function()
	{
		if ( Math.abs(this.getX()-Math.round(this.getX()))<0.01 ) this.setX(Math.round(this.getX()));
		if ( Math.abs(this.getY()-Math.round(this.getY()))<0.01 ) this.setY(Math.round(this.getY()));
		return this;
	}

	// odsekne desatinnu cast poziciu / velkost
	Position.prototype.floor = 
		Size.prototype.floor = function()
	{
		this.setX( Math.floor( this.getX() ) );
		this.setY( Math.floor( this.getY() ) );
		return this;
	}

	// odsekne desatinnu cast poziciu / velkost
	Position.prototype.ceil = 
		Size.prototype.ceil = function()
	{
		this.setX( Math.ceil( this.getX() ) );
		this.setY( Math.ceil( this.getY() ) );
		return this;
	}
	
	// nastavi poziciu HTML Elementu (tuto funkciu ale musi prebrat HTML Element, nefunguje ako metoda objektu Position)
	Position.setPositionHTML = 
		Size.setPositionHTML = function( position )
	{
		if (isNaN(position.getX())) position.setX(0);
		if (isNaN(position.getY())) position.setY(0);
		if (position.getX()!==null) this.style.left = Math.round(position.getX()) + "px";	
		if (position.getY()!==null) this.style.top  = Math.round(position.getY()) + "px";
	}

	// nastavi poziciu HTML Elementu (tuto funkciu ale musi prebrat HTML Element, nefunguje ako metoda objektu Position)
	Position.setSizeHTML = 
		Size.setSizeHTML = function( size )
	{
		if (isNaN(size.getX())) size.setX(0);
		if (isNaN(size.getY())) size.setY(0);
		if (size.getX()!==null) this.style.width  = Math.round(size.getX()) + "px";	
		if (size.getY()!==null) this.style.height = Math.round(size.getY()) + "px";
	}	

// -POZICIA-A-VELKOST---END---------------------------------------------------------------------------------------------

// -OBLSAT-(AREA)---BEGIN-----------------------------------------------------------------------------------------------

	// CONSTRUCTOR area (oblasti  pos1[x1,y1]  a  pos2[x2,y2] )
	function Area( position1, position2 ) // nepovinne parametre (nastavi null)
	{
		if (!position1 || !position2)
		{
			this.cornerUL = position1; // [UL] UpperLeft
			this.cornerBR = position2; // [BR] BottomRight
		}
		else
		{
			this.cornerUL = Position.getMin( position1, position2 ); // [UL] UpperLeft
			this.cornerBR = Position.getMax( position1, position2 ); // [BR] BottomRight
		}
	}
	
	// vytvori oblsat z jej stredu a velkosti
	Area.make = function( position, size )	
	{
		var halfsize = size.getCopy().divide(2);
		return new Area( position.getCopy().minus(halfsize), position.getCopy().plus(halfsize) );
	}
	
	// navratova hodnota pri vypise
	Area.prototype.valueOf = function() { return "AREA("+this.cornerUL+"; "+this.cornerBR+") "; }
	
	// vracia poziciu stredu oblasti ::Position
	Area.prototype.getCopy = function()
	{
		return new Area( this.cornerUL.getCopy(), this.cornerBR.getCopy() );		
	}
	
	// vracia poziciu stredu oblasti ::Position
	Area.prototype.getCenter = function()
	{
		return this.cornerUL.getCopy().plus(this.cornerBR).divide(2);
	}
	
	// vracia velkost WIDTH oblasti ::Number
	Area.prototype.getWidth  = function() { return Math.abs(this.cornerBR.getX() - this.cornerUL.getX());	}
	// vracia velkost HEIGHT oblasti ::Number
	Area.prototype.getHeight = function() { return Math.abs(this.cornerBR.getY() - this.cornerUL.getY());	}
	// vracia velkost oblasti ::Size
	Area.prototype.getSize = function() { return new Size( this.getWidth(), this.getHeight() ); }
	
	// zvacsi/zmensi oblast (0.5 - zmensi na polovicu alebo 1.1 - zvacsi)
	Area.prototype.resize = function( koef )
	{
		var stred     = this.getCenter();
		var halfSize  = this.getSize().multiply( koef/2 );
		this.cornerUL = stred.getCopy().minus( halfSize );
		this.cornerBR = stred.getCopy().plus(  halfSize );
		return this;
	}
	
	// zisti ci oblast je v zadanej oblasti
	Area.prototype.isInArea = function( area )
	{
		if (!this.cornerUL || !this.cornerBR || !area.cornerUL || !area.cornerBR) return false;
		return this.cornerUL.x >= area.cornerUL.x
			&& this.cornerBR.x <= area.cornerBR.x
			&& this.cornerUL.y >= area.cornerUL.y
			&& this.cornerBR.y <= area.cornerBR.y;
	}
	
	// zisti ci oblast je v zadanej oblasti aspon ciastocne (ci sa pretinaju, alebo ci je [this] viditelna v [area])
	Area.prototype.isPartlyInArea = function( area )
	{
		if (!this.cornerUL || !this.cornerBR || !area.cornerUL || !area.cornerBR) return false;
		return this.cornerBR.x >= area.cornerUL.x
			&& this.cornerUL.x <= area.cornerBR.x
			&& this.cornerBR.y >= area.cornerUL.y
			&& this.cornerUL.y <= area.cornerBR.y;
	}

	// zluci dve oblasti do jedne ktora obsiahne obe	
	Area.compound = function( area1, area2 )
	{
		if (!area1.cornerUL || !area1.cornerBR) return area2.getCopy();
		if (!area2.cornerUL || !area2.cornerBR) return area1.getCopy();
		return new Area( Position.getMin( area1.cornerUL, area2.cornerUL ),
						 Position.getMax( area1.cornerBR, area2.cornerBR ));
	}
	
	// prepocitava poziciu do zakladnej suradnej sustavy (z konkretnej mapy - podla objektu) [VRACIA KOPIU]
	Area.prototype.toBase = function( map )
	{
		return new Area( this.cornerUL.toBase( map ), this.cornerBR.toBase( map ) );
	}
	
	// prepocitava poziciu zakladnej suradnej sustavy do suradnej sustavy konkretnej mapy (podla objektu mapy)
	Area.prototype.toThisMap = function( map )
	{
		return new Area( this.cornerUL.toThisMap( map ), this.cornerBR.toThisMap( map ) );
	}
	
// -OBLSAT-(AREA)---END-----------------------------------------------------------------------------------------------	
	
	
	
	// prerata CSS styly pre IE5
	function renderCSSforIE5()
	{
		if (browser.isIE && browser.version<=5.5)
		{
				var pocet = document.all.length;
			
				for (var i=0; i<pocet; i++)
					renderElementforIE5( document.all[i] );
		}
	}

	function renderElementforIE5( obj )
	{
		var style    = obj.style;
		var curStyle = obj.currentStyle;
		if (curStyle && browser.isIE && browser.version<=5.5)
		{
			function getNewSize()  // argumenty actualSize + plus co ma pripocitat
			{
				var actualSize = arguments[0];
				if (actualSize.indexOf("px")>0)
				{
					actualSize = parseInt(actualSize);
					for (var i=1; i<arguments.length; i++)
						if (curStyle[arguments[i]].indexOf("px")>0 && parseInt(curStyle[arguments[i]]))
							actualSize += parseInt(curStyle[arguments[i]]);
				}
				return actualSize;
			}
					
		
			if (curStyle.width.indexOf("%")<0 && parseInt(curStyle.width))
				style.width = getNewSize(curStyle.width, "paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth") + "px";

			if (curStyle.height.indexOf("%")<0 && parseInt(curStyle.height))
				style.height = getNewSize(curStyle.height, "paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth") + "px";

			/*if (obj.nodeName=="A" && curStyle.display=="inline")
			{
				if (parseInt(obj.offsetWidth))  style.width  = getNewSize(obj.offsetWidth, "paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth") + "px";

				if (parseInt(obj.offsetHeight))	style.height = getNewSize(obj.offsetHeight, "paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth") + "px";
			}*/
		}	
	}