function Ajax(url,o){o=o||new Object();o.data=o.data||'';o.m=(o.metoda||'POST').toUpperCase();this.v=(o.vratit||'TEXT').toUpperCase();this.req=false;if(window.XMLHttpRequest&&!(window.ActiveXObject)){try{this.req=new XMLHttpRequest()}catch(e){this.req=false}}else if(window.ActiveXObject){try{this.req=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{this.req=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){this.req=false}}}if(this.req){var that=this;this.req.onreadystatechange=function(){that.change.call(that)};this.req.open(o.m,o.m=='POST'?url:url+'?'+o.data,true);if(o.m=='POST'){this.req.setRequestHeader('Content-Type','application/x-www-form-urlencoded')}this.req.send(o.m=='POST'?o.data:null)}}Ajax.prototype.onProgress=function(){};Ajax.prototype.onComplete=function(){};Ajax.prototype.onError=function(e){alert("Nastala tato chyba:"+e)};Ajax.prototype.change=function(){switch(this.req.readyState){case 1:this.onProgress();break;case 4:if(this.req.status==200){this.onComplete(this.v=='TEXT'?this.req.responseText:this.req.responseXML)}else{this.onError(this.req.statusText)}break}}