function openWindow(URL) {
    //adres = "http://panda/miasto.torun.pl/okno.php?id="+URL;
	adres = "http://miasto.torun.pl/okno.php?id="+URL;

    newWindow = window.open(adres, "noweOkno", "toolbar=no, menubar=no, location=no, directories=0, status=0, scrollbars=yes, width=460, height=350, top=10, left=350");
	newWindow.focus();
}

function openWin(adres){
	newWindow = window.open(adres, "noweOkno", "toolbar=no, menubar=no, location=no, directories=0, status=0, scrollbars=yes, width=460, height=350, top=10, left=350");
	newWindow.focus();
}

function openWindowDB(URL) {
    //adres = "http://panda/miasto.torun.pl/okno.php?id="+URL;
	adres = "http://miasto.torun.pl/okno.php?id="+URL;
    newWindow = window.open(adres, "noweOkno", "toolbar=no, menubar=no, location=no, directories=0, status=0, scrollbars=yes, width=460, height=350, top=10, left=350");
	newWindow.focus();
	return false;
}

function NewWindow(URL,w,h,s)
{
	umorother = window.open(URL,'OtherUnMapWindow','toolbar=no,menubar=no,location=no,personalbar=no,scrollbars='+s+',directories=no,status=no,resizable=yes,width='+w+',height='+h);
	umorother.focus();
	return false;
}

function wybierz_ul(co) {
    
		val = co.options[co.selectedIndex].value;

	var i = parseInt(val);
	var tabela = val.split(",");
	
    var id = tabela[0];
	var x = tabela[1];
	var y = tabela[2];
	var s = tabela[3];
	
    var cel = window.document.mapa;


	if (!cel) {
		alert("Pobierz plugin");   // Ochrona przed uzywaniem mapy bez pluginu
	}
	
    else {

        if (val!="") {
               cel.SetVariable ("xprop", 1);
               cel.SetVariable ("id", id );
               cel.SetVariable ("x_pos", x );
               cel.SetVariable ("y_pos", y );
               cel.SetVariable ("zoom", s );
        }
	}
	return false;
}


function AddLayer(lay)
	{
	   
	   //var cel = parent.window.document.all['mapa'];
	   var cel = parent.window.document.mapa;
	   if (!cel) {
		   alert("Pobierz plugin");  //detekcja pluginu
	   }
	   
	   else {
	   cel.SetVariable ("warstwa", lay);
	   }
	   return false;
	}

function SearchPoint(TSelect, TValues, wparent)
{
	
	if(TValues != "")
	{
		var TAB = TValues.split(",");

		AddLayer(TSelect);

		if(wparent == true)
		{
			var cel = parent.window.document.mapa;
		}
		else var cel = window.document.mapa;
		if (!cel) {
			alert("Pobierz plugin");  //detekcja pluginu
		}

		if(TAB[3] > 0)
		{
			cel.SetVariable ("xprop", 1);
			cel.SetVariable ("id", TAB[0] );
			cel.SetVariable ("x_pos", TAB[1] );
			cel.SetVariable ("y_pos", TAB[2] );
			cel.SetVariable ("zoom", TAB[3] );
		}
		
		if(TAB[3]==-1){
			
			openWindowDB(TAB[0]);
		}
	}
	return false;
}

self.name="ThisDocumentAllTarget";