function AjaxPlainSender(){this.errorTimeout=10000;this.showTimeout=3000;this.successCallback=null;this.errorCallback=null;this.errorText="Chyba ve spojení na server.";this.timoutText="Čas pro spojení se serverem vypršel.";this.type="GET";this.data=null;this.dataType=null;this.contentType="application/x-www-form-urlencoded; charset=utf-8";this.async=true;this.jsonp=null;this.jsonpCallback=null}AjaxPlainSender.prototype.send=function(c,b){if($.active){return false}var a=this;if(!$.wavky.spinner){$.wavky.createSpinner()}$.wavky.spinner.css({position:"absolute",left:c?c.pageX:null,top:c?c.pageY:null}).show();$.ajax({type:this.type,data:this.data,dataType:this.dataType,contentType:this.contentType,async:this.async,url:b,success:function(e,f,d){a.onSuccess(e,f,d)},error:function(d,f,e){a.onError(d,f,e)},timeout:this.errorTimeout,beforeSend:function(d){d.setRequestHeader("Content-type",a.contentType)},jsonp:this.jsonp,jsonpCallback:this.jsonpCallback});return false};AjaxPlainSender.prototype.onError=function(a,c,b){this.showText("ajax_ko",this.timoutText);if(typeof this.errorCallback=="function"){this.errorCallback(a,c,b)}};AjaxPlainSender.prototype.onSuccess=function(b,c,a){if(typeof this.successCallback=="function"){this.successCallback(b,c,a)}};AjaxPlainSender.prototype.showText=function(b,a){var c=$("<div>",{html:a,"class":b});$("body").append(c);c.dialog();window.setTimeout(function(){c.remove()},this.showTimeout)};
