	window.onload = function() {
		if(!($.browser.msie && $.browser.version == '7.0')) {
			$("#overlay").show();		
		}
		
		$("#detail_holder").fadeIn();  
		
		$("#detail_holder").click(function() {
		$("#detail_holder").fadeOut(500, function() { initMain();  });
		
		
	});

		
	}

	function initMain() {
			$("#poukazka_icon").fadeIn();
			$("#poukazka_icon").mouseover(overPoukazkaIcon);
			$("#poukazka_icon").mouseout(overPoukazkaIcon);
			$('#overlay').hide();
	}

	function overPoukazkaIcon() {
		$(this).toggleClass('over');
	}
	

		var ie = document.all;		

		var flashvars;
		var params = {
			menu: "false",
			wmode: "transparent"
		};
		
		if (ie) {
			var attributes = {
				id: "galleryplayer",
				name: "galleryplayer"
			};		
			swfobject.embedSWF("media/gallery.swf", "galleryplayer", "964", "476", "9.0.0", "media/expressInstall.swf", flashvars, params, attributes);
		}
	
		var attributes = {
			id: "slideshowplayer",
			name: "slideshowplayer"
		};
		swfobject.embedSWF("media/slideshow.swf", "slideshowplayer", "964", "476", "9.0.0", "media/expressInstall.swf", flashvars, params, attributes);
    
		function showHome() {
			hidePoukazkaDiv();
			hideGalleryDiv();
			hideAllMenus();
			hideKontaktDiv();
			showSlideshowDiv();
		}
		function showKontakt() {
			hidePoukazkaDiv();
			hideGalleryDiv();
			hideSlideshowDiv();
			hideAllMenus();
			showKontaktDiv();
		}
		function showPoukazka() {
			hideGalleryDiv();
			hideSlideshowDiv();
			hideAllMenus();
			hideKontaktDiv();
			showPoukazkaDiv();
		}
    	function showMenu(menu) {
			hideAllMenus();
			document.getElementById('menu-'+menu).style.display='block';
		}
		function hideAllMenus() {
			document.getElementById('menu-design').style.display='none';
			document.getElementById('menu-naseprace').style.display='none';
		}
    	function showGallery(gal) {
			hideAllMenus();
			hideSlideshowDiv();
			hideKontaktDiv();
			hidePoukazkaDiv();
			
			var mv = "media/gallery.swf?xml=data/images/gallery/"+gal+".xml";
var c = '<embed id="galleryplayer" height="476" align="middle" width="964" type="application/x-shockwave-flash" salign="" allowscriptaccess="sameDomain" allowfullscreen="false" menu="true" name="galleryplayer" bgcolor="#ffffff" devicefont="false" wmode="transparent" scale="showall" loop="true" play="true" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="' + mv + '"/>';
			if (!ie) {
				var newdiv = document.createElement("div");
				newdiv.innerHTML = c;
				var container = document.getElementById("gallery");
				if (container.hasChildNodes()) {
					while ( container.childNodes.length >= 1 ) {
						container.removeChild(container.firstChild);
				    } 
				}
				container.appendChild(newdiv);
			} else {			
				document.getElementById('galleryplayer').src=mv;
				document.getElementById('galleryplayer').movie=mv;
			}
			showGalleryDiv();
		}
		function hidePoukazkaDiv() {
			document.getElementById('poukazka').style.display='none';
		}
		function showPoukazkaDiv() {
			document.getElementById('poukazka').style.display='block';
		}
		function hideGalleryDiv() {
			document.getElementById('gallery').style.display='none';
		}
		function showGalleryDiv() {
			document.getElementById('gallery').style.display='block';
		}
		function hideSlideshowDiv() {
			document.getElementById('slideshow').style.display='none';
		}
		function showSlideshowDiv() {
			document.getElementById('slideshow').style.display='block';
		}
		function hideKontaktDiv() {
			document.getElementById('kontakt').style.display='none';
		}
		function showKontaktDiv() {
			document.getElementById('kontakt').style.display='block';
		}
   
