function imgover (id, direction) {

	/* Használata: <a href="[url]" onmouseover="imgover('[id]','on')" onmouseout="imgover('[id]','off')"><img src="[url - off]" id="[id]" /> */

	var src = document.getElementById(id).src
	if (direction == "on") {
		var rawsrc = src.substr(0, src.length-8);
		document.getElementById(id).src = rawsrc + "_on.png";
	} else {
		var rawsrc = src.substr(0, src.length-7);
		document.getElementById(id).src = rawsrc + "_off.png";
	}
}

var legendWin;
function createWin(url,width,height) {
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	if(legendWin == null || legendWin.closed) {
		var props = "resizable,scrollbars=no,left=" + left + ",top=" + top + ",width=" + width + ",height=" + height;
		legendWin = window.open(url, "legend", props);
		legendWin.focus();
	} else {
		legendWin.close();
		var props = "resizable,scrollbars=no,left=" + left + ",top=" + top + ",width=" + width + ",height=" + height;
		legendWin = window.open(url, "legend", props);
		legendWin.focus();
	}
}