Dhv.modul={};(function(f,d){function e(h,j){var i=h.split("-");var k=j.split("-");var g="";if(i[0]!=k[0]){g=i[2]+"."+i[1]+"."+i[0]+" - "+k[2]+"."+k[1]+"."+k[0]}else{if(i[1]!=k[1]){g=i[2]+"."+i[1]+". - "+k[2]+"."+k[1]+"."+k[0]}else{if(i[2]!=k[2]){g=i[2]+". - "+k[2]+"."+k[1]+"."+k[0]}else{g=k[2]+"."+k[1]+"."+k[0]}}}return g}f.Handler=function(){this.rowtemplate="";this.nodatatemplate="";this.rowspacer="";this.tableId="";this.sourceUrl="";this.itemUrl=""};f.Handler.prototype.clearRows=function(){d("#"+this.tableId).find("tr:gt(0)").remove()};f.Handler.prototype.addRows=function(j){var h="";if(j instanceof Array&&j.length>0){for(var g=0;g<j.length;g++){h+=this.getRowHtml(j[g]);h+=this.rowspacer}}else{h=this.nodatatemplate}d("#"+this.tableId).last().append(h)};f.Handler.prototype.getRowHtml=function(g){return""};f.Handler.prototype.refreshDisplay=function(){var h=this;var g={url:this.sourceUrl,dataType:"json",success:function(i){h.clearRows();h.addRows(i)}};d.ajax(g)};f.Handler.prototype.initRefresh=function(g){var h=this;h.refreshDisplay();window.setInterval(function(){h.refreshDisplay()},g)};var c;c.prototype=new f.Handler();c.prototype.constructor=c;function c(){}f.MpHandler=c;f.MpHandler.prototype.getRowHtml=function(i){var h=this.rowtemplate.replace(/###MRK_ANBIETER###/g,Dhv.fn.htmlspecialchars(i.Anbieter,null,null,false));h=h.replace(/###MRK_DATUM###/g,Dhv.fn.mysqlDateToString(i.Datum));h=h.replace(/###MRK_ANGEBOT###/g,Dhv.fn.htmlspecialchars(i.Angebot));var g=this.itemUrl.replace(/{id}/g,i.Id);h=h.replace(/###MRK_URL_ANGEBOT###/g,g);return h};var b;b.prototype=new f.Handler();b.prototype.constructor=b;function b(){}f.TutHandler=b;f.TutHandler.prototype.getRowHtml=function(j){var i=this.rowtemplate.replace(/###MRK_TITEL###/g,Dhv.fn.htmlspecialchars(j.Titel,null,null,false));var g=e(j.Von,j.Bis);i=i.replace(/###MRK_TERMIN###/g,g);var h=this.itemUrl.replace(/{id}/g,j.Id);i=i.replace(/###MRK_URL_ANGEBOT###/g,h);return i};var a;a.prototype=new f.Handler();a.prototype.constructor=a;function a(){}f.EventHandler=a;f.EventHandler.prototype.getRowHtml=function(j){var i=this.rowtemplate.replace(/###MRK_EVENT###/g,Dhv.fn.htmlspecialchars(j.Name,null,null,false));var g=e(j.Von,j.Bis);i=i.replace(/###MRK_TERMIN###/g,g);var h=this.itemUrl.replace(/{id}/g,j.Id);i=i.replace(/###MRK_URL_EVENT###/g,h);return i}})(Dhv.modul,jQuery);
