function wyslij_form1(fname){
	req = mint.Request();
	req.OnSuccess = function() { formDo(this.responseText,fname);}
	req.SendForm(fname);
}
function wyslij_form(fname) {
	www=$("#"+fname).attr("action");
	data=$("#"+fname).serialize();
	$.post(www,data,function(data,fname) {formDo(data,"L"+fname);},"html");	
}
function formDo(text,l) {
	text = trim(text); // obcinamy smieci
	//alert(text)
	cmds = text.split(";");
	for (k in cmds) {
		text = cmds[k];		
		
		if (text.length>0) {
			if (text=="1" || text==1 || text=="ok") { 
				layers[l].closeLayer();
			} else if (text=="refresh") { 
				window.location.reload();
			} else if (text.substr(0,4)=="goto") { 
				did = text.substr(5,text.length-6); 
				window.location.href=did;
			} else if(text.substr(0,10)=="refreshDiv") {//odswierzamy diva
				did = text.substr(11,text.length-12); //nazwa diva do odswierzenia
				refreshDiv(did);
			} else { //pokazujemy komunikat
				
				
				alert(text);
			}
		}
	}
}
function setParent(p){$("#parent").val(p);}
