fcmsJs.wait('fcmsLib_Utils','extlib_persistjs').onLoad(function(){fcmsJs.console._loggerModeStore=new fcmsLib_Utils_ClientStore('fcmsJsConsole');fcmsJs.console._loggerModeStore.get('debug',function(ok,value){if(ok&&value==='enabled'){fcmsJs.console.enable();}else{fcmsJs.console.disable();}});});(function(){fcmsJs.Class('fcmsLib_Core_Window').inherits(fcmsLib_Core_Class).construct(function(domObject){this.windowCallback=new fcmsLib_Core_Observer();this._windowCallbackEnabeled=false;this._windows=[];this.$=domObject;}).method('enableWindowCallback',function(){this._windowCallbackEnabeled=true;}).method('isWindowCallbackEnabeled',function(){return this._windowCallbackEnabeled;}).method('open',function(name,url,options){var oname=name,w=null;name=this.cleanWindowName(name);if(typeof options==='undefined'){options={};} if(typeof options==='object'){options=$H({resizable:1,scrollbars:1}).merge(options).toObject();} if(typeof options==='object'){var o=[];$H(options).each(function(pair){o.push(pair.key+'='+pair.value);});options=o.join(',');} if(typeof this._windows[name]==='undefined'||typeof this._windows[name].$==='undefined'||this._windows[name].$===null||this._windows[name].$.closed) {w=window.open(url,name,options);if(typeof w==='object'){this._windows[name]=new fcmsLib_Core_Window(w);}else{return false;}}else{try{this._windows[name].setLocation(url);}catch(e){w=window.open(url,name,options);if(typeof w==='object'){this._windows[name]=new fcmsLib_Core_Window(w);}else{return false;}}} if(!this._windows[name].focus()){return false;} return this._windows[name];}).method('openSelect',function(name,type,multi){var realType,popupType,html,liste;if(typeof multi!=='undefined'&&multi){fcmsJs.console.error('Noch nicht Implementiert.');popupType='SSINGLE';}else{popupType='SSINGLE';} realType=type;html='select.html';liste='art_Liste';this.open(name,'/_/admin/'+html+'?_CMPARM='+realType+'-'+popupType+'-'+liste+'----','width=300 ,height=1024 ,resizable=1 ,scrollbars=1');}).method('openEditor',function(model){var editorUrls={'fcmsAdmin_Picture_Model':['imgeditor_showEditor_','/_/admin/func.html?_CMFUNC=imgeditor_showEditor&_CMMODE=EDIT&_CMELEM=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Article_Model':['art_Editor_','/_/admin/func.html?_CMFUNC=art_Editor&_CMMODE=EDIT&_CMELEM=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Article_Tree_Model':['EDFLD','/_/admin/func.html?_CMFUNC=tr_EditFolder&_CMMODE=EDIT&_CMTREE=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Tree_Model':['EDFLD','/_/admin/func.html?_CMFUNC=tr_EditFolder&_CMMODE=EDIT&_CMTREE=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Picture_Tree_Model':['EDFLD','/_/admin/func.html?_CMFUNC=tr_EditFolder&_CMMODE=EDIT&_CMTREE=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Streamset_Model':['sts_Editor_','/_/admin/func.html?_CMFUNC=sts_Editor&_CMMODE=EDIT&_CMELEM=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Ted_Model':['TedEditor_showEditor_','/_/admin/func.html?_CMFUNC=TedEditor_showEditor&_CMMODE=EDIT&_CMELEM=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Linkbox_Model':['lbx_Editor_','/_/admin/func.html?_CMFUNC=lbx_Editor&_CMMODE=EDIT&_CMELEM=','width=1024,height=768,resizable=1,scrollbars=1'],'fcmsAdmin_Imagemap_Model':['map_Editor_','/_/admin/func.html?_CMFUNC=map_Editor&_CMMODE=EDIT&_CMELEM=','width=640,height=480,resizable=1,scrollbars=1'],'fcmsAdmin_Xmedia_Model':['xma_Editor_','/_/admin/func.html?_CMFUNC=xma_Editor&_CMMODE=EDIT&_CMELEM=','width=760,height=600,resizable=1,scrollbars=1'],'fcmsAdmin_Media_Model':['med_Editor_','/_/admin/func.html?_CMFUNC=med_Editor&_CMMODE=EDIT&_CMELEM=','width=800,height=600,resizable=1,scrollbars=1'],'fcmsAdmin_GameClub_Model':['tiv_Editor_','/_/admin/func.html?_CMFUNC=tiv_Editor&_CMMODE=EDIT&_CMELEM=','width=800,height=600,resizable=1,scrollbars=1']};if(typeof model.className==='string'&&typeof editorUrls[model.className]==='object'){this.open(editorUrls[model.className][0]+model.data.id,editorUrls[model.className][1]+model.data.id,editorUrls[model.className][2]);}else{var ret=false;$H(editorUrls).each(function(p){if(typeof window[p.key]==='function'&&model instanceof window[p.key]) {this.open(p.value[0]+model.data.id,p.value[1]+model.data.id,p.value[2]);ret=true;}}.bind(this));if(!ret){fcmsJs.console.error('Kein Editor für die Klasse '+model.className+' gefunden.');} return ret;} return true;}).method('focus',function(){if(typeof this.$==='object'&&this.$!==null){this.$.focus();return true;} return false;}).method('setLocation',function(loc){this.$.document.location.href=loc;}).method('fitToHeight',function(minWidth,minHeight){if(this.$.document.documentElement.clientWidthminHeight){this.$.resizeTo(minWidth,this.$.screen.availHeight-50);}else{this.$.resizeTo(minWidth,this.$.screen.availHeight);}} if(this.$.document.documentElement.clientHeightminHeight){this.$.resizeTo(minWidth,this.$.screen.availHeight-50);}} return;}).method('cleanWindowName',function(name){if(Object.isString(name)){return name.replace(/[^a-zA-Z_]/g,'_');} return'';});if(typeof fcmsJs.window==='undefined'){fcmsJs.window=new fcmsLib_Core_Window(window);}})();function fcmsLib_Core_Webservice(url){var that=this;this.parameters.fWSin=Object.toJSON($(this.formId).serialize(true));} (function(){fcmsJs.Class('fcmsLib_Core_Array').inherits(fcmsLib_Core_Class).construct(function(formName){}).staticMethod('merge',function(one,two){if(typeof one!=='object'){one={};} if(typeof two!=='object'){two={};} return Object.extend(one,two);});fcmsLib_Core_Array.addMultiDimKey=function(target,key,value){var keys=key.split('.'),tmp=null;tmp=target;for(var i=0,ii=keys.length;i24){date.setHours(f2);date.setMinutes(f1);}else{date.setHours(f1);date.setMinutes(f2);} return date;} function make2digits(num){if(num<=9){return'0'+num;} return num;} function makeDate(found){var year=null,month=null,day=null,f1=0,f2=0,f3=0,d;if(typeof found==='object'&&found!==null) {f1=(typeof found[1]==='number')?found[1]:parseInt(found[1],10);f2=(typeof found[2]==='number')?found[2]:parseInt(found[2],10);f3=(typeof found[3]==='number')?found[3]:parseInt(found[3],10);f1=isNaN(f1)?0:f1;f2=isNaN(f2)?0:f2;f3=isNaN(f3)?0:f3;} if(f1>1000){year=f1;month=f2;day=f3;}else if(f3>1000){year=f3;month=f2;day=f1;}else{day=f1;month=f2;} if(day<=0){day=1;} if(month<=0){month=1;} if(year===null){year=minYear;} if(yearmaxYear){year=maxYear;} d=new Date(year,month-1,day,12,0,0);return d;} that.expandDate=function(value){var found,date;found=value.match(/(\d{1,4})?[^\d]*(\d{1,2})[^\d]*(\d{1,4})?/);if(found){date=makeDate(found);}else{date=new Date();} if(date.getTime()<(new Date()).getTime()){date=new Date();} return make2digits(date.getDate())+'.'+make2digits(date.getMonth()+1)+'.'+date.getFullYear();};that.expandTime=function(value){var found,date=new Date();found=value.match(/(\d{1,2})[^\d]*(\d{0,2})/);if(found){date=makeTime(found);}else{return'';} return make2digits(date.getHours())+':'+make2digits(date.getMinutes());};function _init(){try{$$('.autodate').each(function(e){e.observe('blur',autodate);});$$('.autotime').each(function(e){e.observe('blur',autotime);});}catch(err){logger.error(err);}} that.init=function(){Event.observe(window,'load',_init);};} (function(){var autodate=new fcmsLib_Core_Autodate();autodate.init();})();(function(){fcmsJs.Class('fcmsLib_Core_CallChain').inherits(fcmsLib_Core_Class).construct(function(){this._chain=[];this._pointer=0;this.state='stopped';this.onEnd=new fcmsLib_Core_Observer();this.onStart=new fcmsLib_Core_Observer();}).method('add',function(func){this._chain.push(func);}).method('start',function(){this._pointer=-1;this._state='started';this.callNext();this.onStart.notify();}).method('callNext',function(){var func=this.next();if(typeof func==='function'){func.apply(this,[this]);if(this.state==='running'){fcmsJs.console.error('Callchain wurde nicht richtig beendet.');this.stop();}}else{return this.stop();}}).method('next',function(){this._pointer+=1;return this.current();}).method('current',function(){if(typeof this._chain[this._pointer]!==undefined){return this._chain[this._pointer];} return false;}).method('stop',function(){fcmsJs.console.debug('STOP!');this.state='stopped';this.onEnd.notify();});})();(function(){fcmsJs.Class('fcmsLib_Core_DataMethods').inherits(fcmsLib_Core_Class).construct(function(formName){this._handlers={};this._callOnRegNodes={};}).method('register',function(name,opts){var o;if(typeof opts==='function'){o={method:'single',func:opts};}else{o=fcmsLib_Core_Array.merge({method:'multi'},opts);} var priorties={'viewcount':20,'advert':30};if(typeof priorties[name]==='undefined'){o.priority=0;}else{o.priority=priorties[name];} if(typeof this._handlers[o.priority]==='undefined'){this._handlers[o.priority]={};} this._handlers[o.priority][name]=o;this._callRegistered(name,o.func);}).method('attachHandlers',function(domNode){var stuffToDo={};if(!domNode){return;} $(domNode).select('*[data-fCMS-method]').each(function(domElement){var meth=$(domElement).getAttribute('data-fCMS-method'),methods;if(meth.indexOf(',')!==-1){methods=meth.split(',');}else{methods=[meth];} methods.each(function(m){if(typeof stuffToDo[m]==='undefined'){stuffToDo[m]=[];} stuffToDo[m].push(domElement);}.bind(this));}.bind(this));$H(this._handlers).sortBy(function(p){return p.key;}).each(function(p){fcmsJs.console.debug(p);$H(p.value).each(function(q){if(typeof stuffToDo[q.key]!=='undefined'){if(q.value.method==='single'){$A(stuffToDo[q.key]).each(q.value.func);}else{q.value.func(stuffToDo[q.key]);} delete stuffToDo[q.key];}}.bind(this));}.bind(this));this._callOnRegNodes=stuffToDo;}).method('_getHandler',function(name){var ret=$H(this._handlers).find(function(p){if(typeof p.value[name]==='object'){return true;} return false;});return(typeof ret[name]!=='undefined')?ret[name]:null;}).method('_executeMethod',function(name,node){if(this._getHandler(name)){this._getHandler(name).func(node);}else{this._callOnRegister(name,node);}}).method('_callRegistered',function(name,func){if(typeof this._callOnRegNodes[name]==='object'){func(this._callOnRegNodes[name]);delete this._callOnRegNodes[name];}}).staticMethod('_getSingleton',function(method,func){if(typeof this._singleton!=='object'){this._singleton=new this();} return this._singleton;}).staticMethod('register',function(method,func){this._getSingleton().register(method,func);}).staticMethod('attachHandlers',function(domNode){return this._getSingleton().attachHandlers(domNode);});Event.observe(window,'load',function(){fcmsLib_Core_DataMethods.attachHandlers(document.body);});})();function fcmsLib_Core_Date(input){var that=this,found,date=null;if(input instanceof Date){date=input;}else if(input.match(/(\d\d).(\d\d).(\d\d\d\d).\d\d.\d\d/)){found=input.match(/(\d\d).(\d\d).(\d\d\d\d).(\d\d).(\d\d)/);date=new Date(found[3],found[2]-1,found[1],found[4],found[5]);}else if(input.match(/(\d\d).(\d\d).(\d\d\d\d)/)){found=input.match(/(\d\d).(\d\d).(\d\d\d\d)/);date=new Date(found[3],found[2]-1,found[1]);}else if(input.match(/(\d\d\d\d)-(\d\d)-(\d\d) \d\d:\d\d:\d\d/)){found=input.match(/(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/);date=new Date(found[1],found[2]-1,found[3],found[4],found[5],found[6]);}else if(input.match(/(\d\d\d\d)-(\d\d)-(\d\d) \d\d:\d\d/)){found=input.match(/(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d)/);date=new Date(found[1],found[2]-1,found[3],found[4],found[5],0);}else if(input.match(/(\d\d\d\d)-(\d\d)-(\d\d)/)){found=input.match(/(\d\d\d\d)-(\d\d)-(\d\d)/);date=new Date(found[1],found[2]-1,found[3]);}else if(input===""){date=new Date();}else{} that.format=function(str){if(!date){return input;} return this.dateFormat(date,str);};that.getTimeStamp=function(){if(!date){throw"Ungültiges Datumsformat";} return date.getTime();};that.nextDay=function(){return new fcmsLib_Core_Date(new Date(that.getTimeStamp()+1000*60*60*24));};that.compare=function(date2){if(that.getTimeStamp()>date2.getTimeStamp()){return-1;}else if(that.getTimeStamp()===date2.getTimeStamp()){return 0;}else{return 1;}};that.getDayOfWeek=function(){return date.getDay();};that.dataFormat=function(){return this.format('yyyy-mm-dd HH:MM:ss');};that.displayFormat=function(){return this.format('dd.mm.yyyy HH:MM');};that.dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[\-+]\d{4})?)\b/g,timezoneClip=/[^\-+\dA-Z]/g,pad=function(val,len){val=String(val);len=len||2;while(val.length99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};return mask.replace(token,function($0){return $0 in flags?flags[$0]:$0.slice(1,$0.length-1);});};}();that.dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};that.dateFormat.i18n={dayNames:["Son","Mon","Di","Mi","Do","Fr","Sa","Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],monthNames:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez","Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]};} fcmsLib_Core_Date.format=function(format,input){var a=new fcmsLib_Core_Date(input);return a.format(format);};(function(){fcmsJs.Class('fcmsLib_Core_Event').inherits(fcmsLib_Core_Class).construct(function(){}).staticMethod('fire',function(domElement,e){try{if(document.createEventObject){return domElement.fireEvent('on'+e,document.createEventObject());}else{var evt=document.createEvent("HTMLEvents");evt.initEvent(e,true,true);return!domElement.dispatchEvent(evt);}}catch(err){fcmsJs.console.error(err);}});})();(function(){function addMultiDimKey(target,key,value){var keys=key.split('.'),tmp=null;tmp=target;for(var i=0,ii=keys.length;i0){errorbox.display('Bitte korrigieren Sie folgende Fehler und versuchen es erneut:',response.responseJSON.issues);}else if(response.responseJSON.messages.length>0){errorbox.display('Bitte korrigieren Sie folgende Fehler und versuchen es erneut:',response.responseJSON.messages);}}catch(e){errorbox.display(e.message,[e.description]);}}.bind(this));}).method('listen',function(type,func){this._listeners.subscribe(function(message){if(typeof message.data==='undefined'){fcmsJs.console.error('message.data is undefined.');return false;} if(typeof message.type==='undefined'){fcmsJs.console.error('message.type is undefined.');return false;} if(message.type===type){func(message.data);}});}).method('startPolling',function(method,data){if(this._poller!==null){return false;} if(typeof method!=='undefined'&&method){this._pollMethod=method;} if(typeof data!=='undefined'&&data){this._pollData=data;} if(this._pollMethod&&this._pollData){if(this.interval>0){this._poller=fcmsJs.window.$.setInterval(this.doPoll.curry(this._pollMethod,this._pollData).bind(this),this.interval);} this.doPoll(this._pollMethod,this._pollData);}}).method('stopPolling',function(){fcmsJs.window.$.clearInterval(this._poller);this._poller=null;}).method('doPoll',function(method,data,forcePoll){var now=new Date();fcmsJs.console.info('Poll!');if(forcePoll===true||this.lastPoll.getTime()+(15*1000)0){$A(serverResponse.data.messages).each(function(m){try{this._handleMessage(m);}catch(e){fcmsJs.console.error(e);}}.bind(this));}} this.waiting=false;this.onServerResponse.notify(serverResponse);}).method('_handleMessage',function(m){this._listeners.notify(m);}).method('sendLocalMessage',function(m){this._handleMessage(m);}).method('sendLocalMessages',function(m){if(Object.isArray(m)){m.each(function(msg){this._handleMessage(msg);}.bind(this));}});window._serverChannels={};fcmsLib_Core_ServerChannel.getChannel=function(module,options){if(typeof window._serverChannels[module]!=='object'){window._serverChannels[module]=new fcmsLib_Core_ServerChannel(module,options);} return window._serverChannels[module];};})();(function(){fcmsJs.Class('fcmsLib_Core_Shortcut').inherits(fcmsLib_Core_Class).construct(function(){this.events={};this.init();this.special_keys={'esc':27,'escape':27,'tab':9,'space':32,'return':13,'enter':13,'backspace':8,'scrolllock':145,'scroll_lock':145,'scroll':145,'capslock':20,'caps_lock':20,'caps':20,'numlock':144,'num_lock':144,'num':144,'pause':19,'break':19,'insert':45,'home':36,'delete':46,'end':35,'pageup':33,'page_up':33,'pu':33,'pagedown':34,'page_down':34,'pd':34,'left':37,'up':38,'right':39,'down':40,'f1':112,'f2':113,'f3':114,'f4':115,'f5':116,'f6':117,'f7':118,'f8':119,'f9':120,'f10':121,'f11':122,'f12':123};this.keyCodeMap={8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pausebreak",20:"capslock",27:"escape",32:" ",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",43:"+",44:"printscreen",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"};}).method('init',function(){this.observe(document);}).method('observe',function(dom){fcmsJs.console.debug(dom);fcmsJs.console.debug($(dom));Event.observe(dom,'keydown',this._keypress.bind(this));}).method('add',function(name,func,opts){var evt,keys=name.toLowerCase().split('+');if(typeof opts!=='object'){opts={};} evt=Object.extend({func:func,preventDefault:true},opts);if(typeof this.events[name]==='undefined'){this.events[name]={keys:keys,events:[evt]};}else{this.events[name].events.push(evt);}}).method('_keypress',function(e){var code,stop=false;if(e.keyCode){code=e.keyCode;}else if(e.charCode){code=e.charCode;}else if(e.which){code=e.which;}else{fcmsJs.console.error('Konnte keinen keyCode/charCode finden.');return;} $H(this.events).sortBy(function(s){return 100-s.key.length;}).each(function(p){if(stop===true){return;} var keys=p.value.keys;for(var i=0,ii=keys.length;ithis._maxParallelRequest){fcmsJs.console.debug('Enqued!');this._queue.push(func);}else{this._runningCount+=1;func();}}).method('_runQueue',function(){var a=this._queue.shift();if(typeof a==='function'){this._makeCall(a);}}).method('_makeParams',function(data){return{fWSin:Object.toJSON(data),fWScontext:fcmsJs.window.$.location.href};});})();if(typeof fcmsJs==="object"){fcmsJs.loaded("fcmsLib_Core");}