// DYMKI do obiektów

// Skrypt wymaga umieszczenia znacznika

// <div id="dymek" style="position: absolute; visibility: hidden;"></div>

// na początku dokumentu

var IE = document.all?true:false

if (!IE) {
   document.captureEvents(Event.MOUSEMOVE);
   document.onmousemove=mousePos;
   var netX, netY;
}

function posX() {
	if (IE) {
	   tempX=document.body.scrollLeft + event.clientX;
	}
	if (tempX<0) {
	   tempX=0;
	}
	return tempX;
}

function posY(e) {
	if (IE) {
	    tempY = event.clientY + document.body.scrollTop;
	}
	if (tempY<0) {
	   tempY=0;
	}
	return tempY;
}

function mousePos(e) {
	netX=e.pageX;
	netY=e.pageY;
}

function dymekPokaz(pX, pY, src) {
	if (IE) {
	   document.all.dymek.style.visibility='visible';
	   document.all.dymek.innerHTML=src;
	   document.all.dymek.style.left=posX()+pX+"px";
	   document.all.dymek.style.top=posY()+pY+"px";
	}
	else {
		 document.getElementById("dymek").style.visibility='visible';
		 document.getElementById("dymek").style.left=netX+pX+"px";
		 document.getElementById("dymek").style.top=netY+pY+"px";
		 document.getElementById("dymek").innerHTML=src;
	}
}

function dymekPrzesun(pX, pY) {
	if (IE) {
	   document.all.dymek.style.left=posX()+pX+"px";
	   document.all.dymek.style.top=posY()+pY+"px";
	}
	else {
		 document.getElementById("dymek").style.left=netX+pX+"px";
		 document.getElementById("dymek").style.top=netY+pY+"px";
	}
}

function dymekZamknij() {
	if (IE) {
	   document.all.dymek.innerHTML='';
	   document.all.dymek.style.visibility='hidden';
	}
	else {
		 document.getElementById("dymek").style.visibility='hidden';
		 document.getElementById("dymek").innerHTML='';
	}
}

function dymekKom(tresc) {
	text='<table cellspacing=2 cellpadding=3 width=250 cellpadding=2>';
	/*text+='<tr><td style="font-size: 11px; background-color: white; border: solid; border-width: 1px; border-color: black;">Opis:</td></tr>';
	*/
	text+='<tr><td style="font-size: 11px; background-color: #F7F5ED; border: solid; border-width: 1px; border-color: black; ">'+tresc+'</td></tr></table>';
	dymekPokaz(0, 15, text);
}

function dymekLinkPrzesun() {
	dymekPrzesun(0, 15);
}

function dymekSrodekPrzesun() {
	dymekPrzesun(-120, 15);
}

function kom(napID) {
eval("pagekomentarz = window.open('komentarze/?tid=" + napID + "', 'komentarz', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=700,height=540,left = 20,top = 20');");
}


var exit=true;
function zoomimg(nazwa, obrazek, wx, wy)
{
	wxw = wx + 20;
	wyh = wy + 20;
	var winl = screen.width/2 - wx/2;
	var wint = screen.height/2 - wy/2;
	var okienko = window.open("","","height="+wyh+",width="+wxw+",toolbar=no,menubar=no,scrollbars=0, left=" +winl+ ", ,top=" + wint);
	okienko.document.write("<html><head><title>" + nazwa + "</title></head><body style=\"margin:0; padding:0; background:#FFFFFF; color:white\">");
	okienko.document.write("<center><a href=\"javascript:self.close()\" style=\"text-decoration:none; font-size:25; font-family: verdana,helvetica; color:#004080;\"><img src=\"" + obrazek + "\" border=0 aheight=" + wy + " vspace=5 hspace=5 title=\"Kliknij aby zamknąć okienko\"><br></center>");
	okienko.document.write("<div style=\"position:absolute; width:100px; height:54px; z-index:1; left:20; top: 10px; text-decoration:none; font-size:25; font-family: verdana,helvetica; color:#004080;\"\"></a></div>");
	okienko.document.write("</body></html>");
}

function WinOpen()
{
var w = (screen.width - 10)
var h = (screen.height - 60)
var winl = (screen.width - 330)
var wint = (screen.height - 70)
myWin=open('','winin','toolbar=no,menubar=no,scrollbars=no,resizable=no,width=385,height=490,left=' +winl+ ',' + wint);
  myWin.location = '<?=$config[base_url]?>/mapka.html';
  var shut=true;
}
