var mapLoaded = false;
$(document).ready(function(){

	$(".addToFavourite").click(function(){
	
		var loc = document.location;
		var title = document.title;
	
		if ($.browser.msie) {
			window.external.AddFavorite(loc, title);
		} else if ($.browser.mozilla) {
			window.sidebar.addPanel(title, loc, "");
		} else if ($.browser.opera) {
		/*
			var a = document.createElement("a"); 
			a.setAttribute("href", loc); 
			a.setAttribute("title", title); 
			a.setAttribute("rel","sidebar"); 
			a.click(); 
		*/
		}
	});

	$("#info .links li").click(function(){
		$("#info .links li.active").removeClass("active");
		var show = $(this).attr("class");
		$(this).addClass("active");
		$("#data").children().css("display", "none");
		$("#data #" + show).css("display", "block");
		
		var i = $("#info .links li").index( this );
		if ( i == 1 && !mapLoaded ) {	// gdy kliknieto na zakladke z mapka
			try {
				load();
				mapLoaded = true;
			} catch (e) {
				alert("Error: map not load");
			}
		}
	});
	
	$("#info .links li").mouseover(function(){
		$(this).css({cursor: "pointer"});
	});

});
