		function findPosX(obj)
		{
			var curleft = 0;
			if (obj.offsetParent)
			{
				while (obj.offsetParent)
				{
					curleft += obj.offsetLeft
					obj = obj.offsetParent;
				}
			}
			else if (obj.x)
				curleft += obj.x;
			return curleft;
		}

		function findPosY(obj)
		{
			var curtop = 0;
			if (obj.offsetParent)
			{
				while (obj.offsetParent)
				{
					curtop += obj.offsetTop
					obj = obj.offsetParent;
				}
			}
			else if (obj.y)
				curtop += obj.y;
			return curtop;
		}
		function BuildMenu()
		{
		//----------------------------------------
		// Skoda Top Menu Items
		// JScript source code for SkodaTopMenu
		// S K O D A   A U T O   a . s .
		//----------------------------------------

		//detect menu span and position
		var PositionSpan=document.getElementById('MenuPositionSpan')
		var left_pos=findPosX(PositionSpan);
		var top_pos=findPosY(PositionSpan);

		//detect browser type
		//bwExplorer = (navigator.appName == 'Microsoft Internet Explorer') ? "True" : "False";
		bwNetscape = (navigator.appName == 'Netscape') ? "True" : "False";
		agent = navigator.userAgent;
		if (((agent.toLowerCase().indexOf('opera 7')>-1) || (agent.toLowerCase().indexOf('opera/7')>-1))) {bwOpera = "True";} else {bwOpera = "False";}

		//defining styles for different browsers
		var TOP_STYLE_ON = "TopOn";
		var TOP_STYLE_OVER = "TopOver";
		var SUB_STYLE_ON = "SubOn";
		var SUB_STYLE_OVER = "SubOver";
		var SUB_STYLE_ON_BOTTOM = "SubOnBottom";
		var SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
		opera_pos = 1;
		level_off = 20;
		if (bwNetscape == "True") 
			{ 
				opera_pos = 1;
				level_off = 20;
				TOP_STYLE_ON = "TopOn";
				TOP_STYLE_OVER = "NetscapeTopOver";
				SUB_STYLE_ON = "SubOn";
				SUB_STYLE_OVER = "NetscapeSubOver";
				SUB_STYLE_ON_BOTTOM = "SubOnBottom";
				SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
			}
		if (bwOpera == "True") 
			{ 
				opera_pos = 4;
				level_off = 22;
				TOP_STYLE_ON = "OperaTopOn";
				TOP_STYLE_OVER = "OperaTopOver";
				SUB_STYLE_ON = "SubOn";
				SUB_STYLE_OVER = "SubOver";
				SUB_STYLE_ON_BOTTOM = "SubOnBottom";
				SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
			}

		//Definition of menu items
		//Item attributes : itemName, itemPosition[left,top], itemSize[height,width], itemOff[left,top], 
		//					itemLevelOff[left,top], itemUrl, itemStyle[styleOn, styleOff], itemDescription

		var skodaTopMenuItems = 
		[
			// default value for first level - position, size, item off, style nad url
			{"itemPosition": [left_pos + opera_pos, top_pos + opera_pos], "itemSize": [12,90], "itemOff": [90,0], "itemStyle": [TOP_STYLE_ON, TOP_STYLE_OVER], "itemUrl": "none"},
			
			//first level
			{"itemName": ":: index ::", "itemUrl": "index.php", "itemSize": [16, 77], "itemOff": [77,0],"itemSubMenu":                 
			[	//second level
				// default value for second level - size, item off, level off, style and url
				{"itemSize": [14, 150], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "index.php"}
  				
            ]},
			//first level
			{"itemName": ":: about ::", "itemSize": [16, 83], "itemOff": [83,0],"itemSubMenu":                 
			[	//second level
				// default value for second level - size, item off, level off, style and url
				{"itemSize": [14, 98], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
  				
           		{"itemName": "&nbsp;&nbsp;&#171; me", "itemUrl": "about.php", "itemDescription": "a few words about me - copyright jjmironb :):):)", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
           		
 
           		{"itemName": "&nbsp;&nbsp;&#171; CV", "itemUrl": "about.php?jj=2", "itemDescription": "CV should be or not... ", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},

              	{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
            ]},


{"itemName": ":: works ::", "itemSize": [16, 86], "itemOff": [86,0],"itemSubMenu":                 
			[	//second level
				// default value for second level - size, item off, level off, style and url
				{"itemSize": [14, 101], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
  				
           		{"itemName": "&nbsp;&nbsp;&#171; www", "itemUrl": "works.php?jj=0", "itemDescription": "web projects and other stuff", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
           		
           		{"itemName": "&nbsp;&nbsp;&#171; art", "itemUrl": "works.php", "itemDescription": "free time old times", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
           		
           		
              	{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
            ]},


			//first level
			{"itemName": ":: reference ::", "itemUrl": "reference.php", "itemSize": [16, 106], "itemOff": [106,0],"itemSubMenu":                 
			[	//second level
				// default value for second level - size, item off, level off, style and url
				{"itemSize": [14, 140], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"}
  				
            ]},



//first level
			{"itemName": ":: contact ::", "itemUrl": "contact.php", "itemSize": [16, 85], "itemOff": [85,0],"itemSubMenu":                 
			[	//second level
				// default value for second level - size, item off, level off, style and url
				{"itemSize": [14, 77], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"}
  				
            ]}
		];
		
		SkodaMenu(skodaTopMenuItems);
		menuBuilded=true;
		}
		
		var menuBuilded=false
		
		function onResizeRebuildMenu()
		{
			if (!menuBuilded)
				return;
			try
			{
				if (document.getElementById('MainMenuSpan') != null)
					{document.body.removeChild(document.getElementById('MainMenuSpan'));}
			}catch(e){}
			BuildMenu();
		}
