function updateListaSzkol(szkolaSelected) {

var cel = document.getElementById("cel");
selectedValue = cel.options[cel.selectedIndex].value;


advAJAX.setDefaultParameters({
    onInitialization : function(obj) { document.getElementById("listaSzkol").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onLoading : function(obj) { document.getElementById("listaSzkol").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onSuccess : function(obj) { document.getElementById("listaSzkol").innerHTML = obj.responseText; },
    onError : function(obj) { document.getElementById("listaSzkol").innerHTML = '<div align="center" style="margin: 0px;">Błąd! Kliknij kategorię jeszcze raz...</div>'; }
});

advAJAX.get({ url: "/updateListaSzkol.php", cel: selectedValue, szkolaSelected: szkolaSelected });

}



function updateCities(szkola, id_kursu) {

for (i=0;i<document.forms[0].kategoria.length;i++) {
	if (document.forms[0].kategoria[i].checked) {
		kat = document.forms[0].kategoria[i].value;
	}
}

advAJAX.setDefaultParameters({
    onInitialization : function(obj) { document.getElementById("szkoly").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onLoading : function(obj) { document.getElementById("szkoly").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onSuccess : function(obj) { document.getElementById("szkoly").innerHTML = obj.responseText; },
    onError : function(obj) { document.getElementById("szkoly").innerHTML = '<div align="center" style="margin: 0px;">Błąd! Kliknij szkołę jescze raz...</div>'; }
});

advAJAX.get({ url: "/wyszukiwarka/updateMiasta.php", szkola: szkola, id_kursu: id_kursu, kat: kat });

}

function updateCategoriesSel()
{
	var kategoria = document.getElementById("kategoria");
	kat = kategoria.options[kategoria.selectedIndex].value;
	//alert (kat);
	updateCategories(kat, '')
	
}

function updateCategories(kat, spec) {

advAJAX.setDefaultParameters({
    onInitialization : function(obj) { document.getElementById("spece").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onLoading : function(obj) { document.getElementById("spece").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onSuccess : function(obj) { document.getElementById("spece").innerHTML = obj.responseText; },
    onError : function(obj) { document.getElementById("spece").innerHTML = '<div align="center" style="margin: 0px;">Błąd! Kliknij kategorię jeszcze raz...</div>'; }
});

advAJAX.get({ url: "/wyszukiwarka/updateSpecjalizacje.php", kat: kat, spec: spec });

}

function updateKategorie() {

//var w = document.szukaj.au_miasta.selectedIndex;


	
	
var w = document.getElementById("au_miasta");
selectedValue = w.options[w.selectedIndex].value;


advAJAX.setDefaultParameters({
    onInitialization : function(obj) { document.getElementById("kategorie").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onLoading : function(obj) { document.getElementById("kategorie").innerHTML = '<div align="center" style="margin: 0px;"><img src="/img/loading001.gif" alt="Preparing..." title="Preparing..."></div>'; },
    onSuccess : function(obj) { document.getElementById("kategorie").innerHTML = obj.responseText; },
    onError : function(obj) { document.getElementById("kategorie").innerHTML = '<div align="center" style="margin: 0px;">Błąd! Kliknij kategorię jeszcze raz...</div>'; }
});

advAJAX.get({ url: "/wyszukiwarka/updateKategorie.php", lokalizacje: selectedValue });

}


function showKurs(title, id)
{
var win = new Window(Application.getNewId(), {className: "dialog", title: ""+title+"", width:640, height:400, resizable: true, url: "/kursyPrev/"+id+"", showEffectOptions: {duration:1}})
win.showCenter();

}

function showKat(title, id)
{
var win = new Window(Application.getNewId(), {className: "dialog", title: ""+title+"", width:640, height:400, resizable: true, url: "/kategoriePrev/"+id+"", showEffectOptions: {duration:1}})
win.showCenter();

}

function showSpec(title, id)
{
var win = new Window(Application.getNewId(), {className: "dialog", title: ""+title+"", width:640, height:400, resizable: true, url: "/specjalizacjePrev/"+id+"", showEffectOptions: {duration:1}})
win.showCenter();

}

function showMiasto(title, id)
{
var win = new Window(Application.getNewId(), {className: "dialog", title: ""+title+"", width:640, height:400, resizable: true, url: "/miastaPrev/"+id+"", showEffectOptions: {duration:1}})
win.showCenter();

}

function showSzkola(title, id)
{
var win = new Window(Application.getNewId(), {className: "dialog", title: ""+title+"", top:70, left:100, width:640, height:400, resizable: true, url: "/szkolyPrev/"+id+"", showEffectOptions: {duration:1}})
win.show();
}

function koloruj(nazwa){
document.getElementById(nazwa).className="szkola1";

}

function kolorujout(nazwa){
document.getElementById(nazwa).className="szkola";

}
