	
	var draggable_admin = false;
	var mouse_adminX, mouse_adminY, drawn_adminX, drawn_adminY;
	var box_admin;
	var zind = 100;
	document.onmousemove = watchMouse_admin;
	
function watchMouse_admin(e, elm) {
if(document.getElementById(elm)) {
	box_admin = document.getElementById(elm) ;
}

try {
watchMouse(e);
}
catch(err) {

}

  // za³aczenie pozycji ekranu przegl¹darki, aby policzyæ pozycjê okienka
  var sx = window.scrollX || document.documentElement.scrollLeft|| 0;
  var sy = window.scrollY || document.documentElement.scrollTop|| 0;

  if(!e) e = window.event; // pieprzone IE
  mouse_adminX = e.clientX + sx;
  mouse_adminY = e.clientY + sy;

 if(draggable_admin == true) { // przenoszenie okna
  box_admin.style.left= (mouse_adminX - drawn_adminX) + 'px';
  box_admin.style.top = (mouse_adminY - drawn_adminY) + 'px';
 }

}
function zeruj_zindex() {
	if(elm = document.getElementById('plakat')) {
		elm.style.zIndex = 100;
	}
	if(elm = document.getElementById('drag_admin')) {
		elm.style.zIndex = 100;
	}
	if(elm = document.getElementById('drag_comment')) {
		elm.style.zIndex = 100;
	}
	if(elm = document.getElementById('glosa')) {
		elm.style.zIndex = 100;
	}
	if(elm = document.getElementById('comment')) {
		elm.style.zIndex = 100;
	}
	if(elm = document.getElementById('drag')) {
		elm.style.zIndex = 100;
	}
	if(elm = document.getElementById('look')) {
		elm.style.zIndex = 100;
	}
}

function nagore(elm) {
zeruj_zindex();
elm.style.zIndex = 200; 
}
var zdaj;

function nagore_t() {
zeruj_zindex();
elm = document.getElementById('plakat');
elm.style.zIndex = 200;
clearTimeout(zdaj);
}

function nagore_d(elm) {
zdaj = setTimeout(nagore_t, 100) 
}

function drag_admin_start(e, iden) { //oblicznie pozycji oknazz
	if(document.getElementById(iden)) {
	zeruj_zindex();
	box_admin = document.getElementById(iden) ;
	box_admin.style.zIndex = 200;	
	ukryj_flashe(true);
	_opacity_id(iden,70);
	}

 draggable_admin = true;
// wylaczanie wszuystkich funkcji na czas przenoszenia okna
 if(e.cancelable) { e.preventDefault(); }
 if(window.event) { box_admin.onselectstart = new Function('return false'); }

   // za³aczenie pozycji ekranu przegl¹darki, aby policzyæ pozycjê okienka
  var sx = window.scrollX || document.documentElement.scrollLeft|| 0;
  var sy = window.scrollY || document.documentElement.scrollTop|| 0;

  if(!e) e = window.event; // pieprzone IE
  mouse_adminX = e.clientX + sx;
  mouse_adminY = e.clientY + sy;
 
 drawn_adminX = mouse_adminX - parseInt(box_admin.style.left);
 drawn_adminY = mouse_adminY - parseInt(box_admin.style.top);
 // przenioszenie okna
 box_admin.onmouseup = function() { draggable_admin = false; ukryj_flashe(false);_opacity_id(iden, 100)}
}

 // Resizes the map's width and height by the given increment
 function dodomu() {
  box_admin.style.top = '0px'
  box_admin.style.left = '0px'
 } 	  

function schowaj_iden(iden) {
document.getElementById(iden).style.display = 'none';
}	

