		
		
	 	var posx = 500;
	 	var posy = 500;
		var globalIndex = 50;
		var poprzednieInfo = 0;
		var aktywny = "";
		
		function dashinfo (showHide, widgetID) {
			getXY();
			globalIndex++;
			temp = document.getElementById('dashinfo');			
			if (showHide == 1) {
			 	temp.style.left = posx + "px";
				temp.style.top = posy + "px";	
				temp.style.zIndex = globalIndex;
				temp.style.visibility = "visible";
				// 
				document.getElementById('info'+widgetID).style.visibility = "visible";
			} else if (showHide == 0){
				temp.style.visibility = "hidden";
				document.getElementById('info'+poprzednieInfo).style.visibility = "hidden";
			} else {
				temp.style.zIndex = globalIndex;
				temp.style.visibility = "visible";
				
			}
			poprzednieInfo = widgetID;
		}		
		
		function getXY(e) {
			if (!e) var e = window.event;
			if (e.pageX || e.pageY) 	{
				posx = e.pageX;
				posy = e.pageY;
			}
			else if (e.clientX || e.clientY) 	{
				posx = e.clientX + document.body.scrollLeft
					+ document.documentElement.scrollLeft;
				posy = e.clientY + document.body.scrollTop
					+ document.documentElement.scrollTop;
			}
			posx -= 100;
			posy += 10;
		}
		
	

		function zobacz (i) {
		
			if (i == "strona-glowna") {
				parent.location.href='http://appleblog.pl/';
			} else if (i == "widgety") {
				parent.location.href='http://appleblog.pl/widgety/';
			} else if (i != aktywny) {
				globalIndex++;
				// wysun odpowiedni "top"
				document.getElementById("top-" + i).style.zIndex = globalIndex;
				// ustaw pozostale przyciski na neutral
				resetButtons();
				// zmien tlo przycisku na hover
				document.getElementById(i).style.backgroundPosition = "bottom";
				aktywny = i;
			} 
		}
		
		function openDashboard () {
			//
			agent = navigator.appVersion;
			if (agent.indexOf("Safari") > 0) {
				globalIndex++;
				document.getElementById("dashboard").style.zIndex = globalIndex;
				Effect.toggle('dashboard','appear'); 
			} else {
				window.location='http://appleblog.pl/widgety/';
			}
		
		}
	
		function resetButtons() {
			document.getElementById("strona-glowna").style.backgroundPosition = "top";	
			document.getElementById("kontakt").style.backgroundPosition = "top";			
			document.getElementById("gielda").style.backgroundPosition = "top";
			document.getElementById("widgety").style.backgroundPosition = "top";
			document.getElementById("twoj-tekst").style.backgroundPosition = "top";
			document.getElementById("kanaly-rss").style.backgroundPosition = "top";			
		}

	
