    function AjaxGetOkresy(idKraj,eIDokres,eIDobec){
        if((e = document.getElementById(eIDobec)) != undefined){
            e.innerHTML = '<option value="">-- zvoľte niečo --</option>';
        }
		AjaxRequest.get(
			{
				'url':WEBROOT + '/files/getOkresy.php?ajax=1&id_kraj='+idKraj
				,'onSuccess':function(req) { AjaxDisplayResult(eIDokres,req.responseText); }
				,'onLoading':function(req) { }
				,'onLoaded':function(req) { }
				,'onError':function(req) { }
			}
		);
	}
    
    function AjaxGetObce(idOkres,eIDobec){
        AjaxRequest.get(
			{
				'url':WEBROOT + '/files/getObce.php?ajax=1&id_okres='+idOkres
				,'onSuccess':function(req) { AjaxDisplayResult(eIDobec,req.responseText); }
				,'onLoading':function(req) { }
				,'onLoaded':function(req) { }
				,'onError':function(req) { }
			}
		);
	}
    
    function AjaxDisplayResult(id,result){
        var e = document.getElementById(id);
        if(e != undefined){
            e.innerHTML = result;
        }
	}
    
    function CreateBookmarkLink(title,url) {
    	if (window.sidebar) {
            window.sidebar.addPanel(title,url,"");
    	} else { 
            if(window.external) {
                window.external.AddFavorite(url,title);
    	    } else { 
                if(window.opera && window.print) {
                    return true;
                }
            }
        }
    }

    NewWindow1 = null;
    function ShowWin(href, w, h){
    	if(NewWindow1){ NewWindow1.close(); }
    	if(NewWindow1==null || NewWindow1.closed){
    		var top = screen.height/2 - h/2;
    		var left = screen.width/2 - w/2;
    		var settings =
    	 		"left=" + left + "px,"
    			+"top=" + top + "px,"
    			+"width=" + w + "px,"
    			+"height=" + h + "px,"
    			+"toolbar=yes,"
    			+"location=no,"
    			+"directories=no,"
    			+"status=yes,"
    			+"menubar=yes,"
    			+"scrollbars=yes,"
    			+"resizable=yes";
    		NewWindow1 = window.open(href,'okno',settings);
    	}
    	NewWindow1.focus();
    }
    
    function addLoadEvent(func){	
        var oldonload = window.onload;
        if (typeof window.onload != 'function'){
            window.onload = func;
        } else {
            window.onload = function(){
                oldonload();
                func();
            }
        }
    }

