!function(context){var __uid=1,registry={},collected={},overOut=/over|out/,namespace=/[^\.]*(?=\..*)\.|.*/,stripName=/\..*/,addEvent='addEventListener',attachEvent='attachEvent',removeEvent='removeEventListener',detachEvent='detachEvent',doc=context.document||{},root=doc.documentElement||{},W3C_MODEL=root[addEvent],eventSupport=W3C_MODEL?addEvent:attachEvent,isDescendant=function(parent,child){var node=child.parentNode;while(node!==null){if(node==parent){return true;} node=node.parentNode;}},retrieveUid=function(obj,uid){return(obj.__uid=uid&&(uid+'::'+__uid++)||obj.__uid||__uid++);},retrieveEvents=function(element){var uid=retrieveUid(element);return(registry[uid]=registry[uid]||{});},listener=W3C_MODEL?function(element,type,fn,add){element[add?addEvent:removeEvent](type,fn,false);}:function(element,type,fn,add,custom){custom&&add&&(element['_on'+custom]=element['_on'+custom]||0);element[add?attachEvent:detachEvent]('on'+type,fn);},nativeHandler=function(element,fn,args){return function(event){event=fixEvent(event||((this.ownerDocument||this.document||this).parentWindow||context).event);return fn.apply(element,[event].concat(args));};},customHandler=function(element,fn,type,condition,args){return function(e){if(condition?condition.apply(this,arguments):W3C_MODEL?true:e&&e.propertyName=='_on'+type||!e){fn.apply(element,Array.prototype.slice.call(arguments,e?0:1).concat(args));}};},addListener=function(element,orgType,fn,args){var type=orgType.replace(stripName,''),events=retrieveEvents(element),handlers=events[type]||(events[type]={}),originalFn=fn,uid=retrieveUid(fn,orgType.replace(namespace,''));if(handlers[uid]){return element;} var custom=customEvents[type];if(custom){fn=custom.condition?customHandler(element,fn,type,custom.condition):fn;type=custom.base||type;} var isNative=nativeEvents[type];fn=isNative?nativeHandler(element,fn,args):customHandler(element,fn,type,false,args);isNative=W3C_MODEL||isNative;if(type=='unload'){var org=fn;fn=function(){removeListener(element,type,fn)&&org();};} element[eventSupport]&&listener(element,isNative?type:'propertychange',fn,true,!isNative&&type);handlers[uid]=fn;fn.__uid=uid;fn.__originalFn=originalFn;return type=='unload'?element:(collected[retrieveUid(element)]=element);},removeListener=function(element,orgType,handler){var uid,names,uids,i,events=retrieveEvents(element),type=orgType.replace(stripName,'');if(!events||!events[type]){return element;} names=orgType.replace(namespace,'');uids=names?names.split('.'):[handler.__uid];function destroyHandler(uid){handler=events[type][uid];if(!handler){return;} delete events[type][uid];if(element[eventSupport]){type=customEvents[type]?customEvents[type].base:type;var isNative=W3C_MODEL||nativeEvents[type];listener(element,isNative?type:'propertychange',handler,false,!isNative&&type);}} destroyHandler(names);for(i=uids.length;i--;destroyHandler(uids[i])){} return element;},del=function(selector,fn,$){return function(e){var array=typeof selector=='string'?$(selector,this):selector;for(var target=e.target;target&&target!=this;target=target.parentNode){for(var i=array.length;i--;){if(array[i]==target){return fn.apply(target,arguments);}}}};},add=function(element,events,fn,delfn,$){if(typeof events=='object'&&!fn){for(var type in events){events.hasOwnProperty(type)&&add(element,type,events[type]);}}else{var isDel=typeof fn=='string',types=(isDel?fn:events).split(' ');fn=isDel?del(events,delfn,$):fn;for(var i=types.length;i--;){addListener(element,types[i],fn,Array.prototype.slice.call(arguments,isDel?4:3));}} return element;},remove=function(element,orgEvents,fn){var k,m,type,events,i,isString=typeof(orgEvents)=='string',names=isString&&orgEvents.replace(namespace,''),names=names&&names.split('.'),rm=removeListener,attached=retrieveEvents(element);if(isString&&/\s/.test(orgEvents)){orgEvents=orgEvents.split(' ');i=orgEvents.length-1;while(remove(element,orgEvents[i])&&i--){} return element;} events=isString?orgEvents.replace(stripName,''):orgEvents;if(!attached||names||(isString&&!attached[events])){for(k in attached){if(attached.hasOwnProperty(k)){for(i in attached[k]){for(m=names.length;m--;){attached[k].hasOwnProperty(i)&&new RegExp('^'+names[m]+'::\\d*(\\..*)?$').test(i)&&rm(element,[k,i].join('.'));}}}} return element;} if(typeof fn=='function'){rm(element,events,fn);}else if(names){rm(element,orgEvents);}else{rm=events?rm:remove;type=isString&&events;events=events?(fn||attached[events]||events):attached;for(k in events){if(events.hasOwnProperty(k)){rm(element,type||k,events[k]);delete events[k];}}} return element;},fire=function(element,type,args){var evt,k,i,m,types=type.split(' ');for(i=types.length;i--;){type=types[i].replace(stripName,'');var isNative=nativeEvents[type],isNamespace=types[i].replace(namespace,''),handlers=retrieveEvents(element)[type];if(isNamespace){isNamespace=isNamespace.split('.');for(k=isNamespace.length;k--;){for(m in handlers){handlers.hasOwnProperty(m)&&new RegExp('^'+isNamespace[k]+'::\\d*(\\..*)?$').test(m)&&handlers[m].apply(element,[false].concat(args));}}}else if(!args&&element[eventSupport]){fireListener(isNative,type,element);}else{for(k in handlers){handlers.hasOwnProperty(k)&&handlers[k].apply(element,[false].concat(args));}}} return element;},fireListener=W3C_MODEL?function(isNative,type,element){evt=document.createEvent(isNative?"HTMLEvents":"UIEvents");evt[isNative?'initEvent':'initUIEvent'](type,true,true,context,1);element.dispatchEvent(evt);}:function(isNative,type,element){isNative?element.fireEvent('on'+type,document.createEventObject()):element['_on'+type]++;},clone=function(element,from,type){var events=retrieveEvents(from),obj,k;var uid=retrieveUid(element);obj=type?events[type]:events;for(k in obj){obj.hasOwnProperty(k)&&(type?add:clone)(element,type||from,type?obj[k].__originalFn:k);} return element;},fixEvent=function(e){var result={};if(!e){return result;} var type=e.type,target=e.target||e.srcElement;result.preventDefault=fixEvent.preventDefault(e);result.stopPropagation=fixEvent.stopPropagation(e);result.target=target&&target.nodeType==3?target.parentNode:target;if(~type.indexOf('key')){result.keyCode=e.which||e.keyCode;}else if((/click|mouse|menu/i).test(type)){result.rightClick=e.which==3||e.button==2;result.pos={x:0,y:0};if(e.pageX||e.pageY){result.clientX=e.pageX;result.clientY=e.pageY;}else if(e.clientX||e.clientY){result.clientX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;result.clientY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;} overOut.test(type)&&(result.relatedTarget=e.relatedTarget||e[(type=='mouseover'?'from':'to')+'Element']);} for(var k in e){if(!(k in result)){result[k]=e[k];}} return result;};fixEvent.preventDefault=function(e){return function(){if(e.preventDefault){e.preventDefault();} else{e.returnValue=false;}};};fixEvent.stopPropagation=function(e){return function(){if(e.stopPropagation){e.stopPropagation();}else{e.cancelBubble=true;}};};var nativeEvents={click:1,dblclick:1,mouseup:1,mousedown:1,contextmenu:1,mousewheel:1,DOMMouseScroll:1,mouseover:1,mouseout:1,mousemove:1,selectstart:1,selectend:1,keydown:1,keypress:1,keyup:1,orientationchange:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,focus:1,blur:1,change:1,reset:1,select:1,submit:1,load:1,unload:1,beforeunload:1,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};function check(event){var related=event.relatedTarget;if(!related){return related===null;} return(related!=this&&related.prefix!='xul'&&!/document/.test(this.toString())&&!isDescendant(this,related));} var customEvents={mouseenter:{base:'mouseover',condition:check},mouseleave:{base:'mouseout',condition:check},mousewheel:{base:/Firefox/.test(navigator.userAgent)?'DOMMouseScroll':'mousewheel'}};var bean={add:add,remove:remove,clone:clone,fire:fire};var clean=function(el){var uid=remove(el).__uid;if(uid){delete collected[uid];delete registry[uid];}};if(context[attachEvent]){add(context,'unload',function(){for(var k in collected){collected.hasOwnProperty(k)&&clean(collected[k]);} context.CollectGarbage&&CollectGarbage();});} var oldBean=context.bean;bean.noConflict=function(){context.bean=oldBean;return this;};(typeof module!=='undefined'&&module.exports)?(module.exports=bean):(context['bean']=bean);}(this);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=fcmsLib_Core_Object.extend({resizable:1,scrollbars:1},options);} if(typeof options==='object'){var o=[];fcmsLib_Core_Object.each(options,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){var realType,popupType,html,liste,options;if(typeof type==='object'){type=type.getModuleName();} realType=type;popupType='SSINGLE';html='select.html';liste='NONE';options='width=1024, height=768, resizable=1, scrollbars=1';if(type==='Article_Tree'){liste='NONE';popupType='CALLBACK';realType='ARTIKEL';html='tree.html';options='width=300, height=1024, resizable=1, scrollbars=1';}else if(type==='Article'||type.substr(0,7)==='Article'){liste='art_Liste';realType='ARTIKEL';}else if(type==='Picture_Tree'){liste='NONE';popupType='CALLBACK';realType='IMAGES';html='tree.html';options='width=300, height=1024, resizable=1, scrollbars=1';}else if(type==='Picture'){realType='IMAGES';liste='imglist_showList';}else if(type==='Streamset'){realType='STREAMS';liste='sts_Liste';}else if(type==='Template'){liste='tpllist_showList';realType='TEMPLATE';}else if(type==='Style'){liste='csslist_showList';realType='STYLES';}else if(type==='Script'){liste='scrlist_showList';realType='SCRIPTS';}else if(type==='Layout'){liste='lay_Liste';realType='LAYOUT';}else if(type==='Navigation'){liste='nav_Liste';realType='NAVIGATION';}else if(type==='Newsletter_Topic'){liste='NewsletterTopicList_showList';realType='THEMEN';}else if(type==='Epaper'){liste='ep_Liste';realType='EPAPER';popupType='SMULTI';}else if(type==='Media'){liste='med_Liste';realType='MEDIA';popupType='SSINGLE';}else if(type==='Payment_Item'){liste='PaymentItemList_showSelectList';realType='PRODUKTE';}else if(type==='Region'){liste='RegionList_showList';realType='REGION';}else{fcmsJs.console.error('Für den Typ: '+type+'gibt es keine Konfiguration. Es wird der Default verwendet');} this.open(name,'/_/admin/'+html+'?_CMPARM='+realType+'-'+popupType+'-'+liste+'----',options);}).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_Template_Model':['tpleditor_showEditor_','/_/admin/func.html?_CMFUNC=tpleditor_showEditor&_CMELEM=','width=1000,height=700,resizable=1,scrollbars=1'],'fcmsAdmin_Layout_Model':['lay_Editor_','/_/admin/func.html?_CMFUNC=lay_Editor&_CMELEM=','width=800,height=900,resizable=1,scrollbars=1'],'fcmsAdmin_Navigation_Model':['nav_Editor_','/_/admin/func.html?_CMFUNC=nav_Editor&_CMELEM=','width=800,height=900,resizable=1,scrollbars=1'],'fcmsAdmin_Style_Model':['csseditor_showEditor_','/_/admin/func.html?_CMFUNC=csseditor_showEditor&_CMELEM=','width=1000,height=900,resizable=1,scrollbars=1'],'fcmsAdmin_Script_Model':['screditor_showEditor_','/_/admin/func.html?_CMFUNC=screditor_showEditor&_CMELEM=','width=1000,height=900,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'],'fcmsAdmin_Newsletter_Send_Model':['NLTED','func.html?_CMFUNC=nlt_Editor&_CMELEM=','width=550,height=590,resizable=1,scrollbars=1'],'fcmsAdmin_Payment_Item_Model':['PaymentTimeTicketEditor_showEditor','func.html?_CMFUNC=PaymentTimeTicketEditor_showEditor&_CMELEM=','width=680,height=480,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;fcmsLib_Core_Object.each(editorUrls,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){try{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);}}}catch(e){fcmsJs.console.error(e);} 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 fcmsLib_Core_Autodate(){var that=this,minYear=(new Date()).getFullYear(),maxYear=(new Date()).getFullYear()+100,logger=new fcmsLib_Core_Console();function autodate(evt){$(this).setValue(that.expandDate($(this).getValue()));} function autotime(evt){$(this).setValue(that.expandTime($(this).getValue()));} function makeTime(found){var date=new Date(),f1=(typeof found[1]==='number')?found[1]:parseInt(found[1],10),f2=(typeof found[2]==='number')?found[2]:parseInt(found[2],10);if(isNaN(f1)){f1=0;} if(isNaN(f2)){f2=0;} if(f1>24){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));fcmsLib_Core_Object.each(fcmsLib_Core_Object.sortBy(this._handlers,function(p){return p.key;}),function(p){fcmsLib_Core_Object.each(p.value,function(q){if(typeof stuffToDo[q.key]!=='undefined'){if(q.value.method==='single'){fcmsLib_Core_Array.each(stuffToDo[q.key],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=fcmsLib_Core_Object.find(this._handlers,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===null||input===undefined){date=new Date();}else if(input===""){date=new Date();}else if(input instanceof Date){date=input;}else if(typeof input.match!=='function'){date=new Date();fcmsJs.console.error('Input für das Date hat ein komisches format.');}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]);} that.format=function(str){if(!date){return input;} return this.dateFormat(date,str);};that.daysAgo=function(num){return new fcmsLib_Core_Date(new Date(that.getTimeStamp()-num*1000*60*60*24));};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){bean.fire(domElement,e);});})();(function(){fcmsJs.Class('fcmsLib_Core_Exception').construct(function construct(error){this._setMessage(error);this._setName(this.className);if(typeof error==="object"){this._evaluateError(error);}}).method("getMessage",function getMessage(){if(typeof this.message==="undefined"){this.message="";} return this.message;}).method("getName",function getName(){return this.name;}).method('getTrace',function getTrace(){if(typeof this.trace==="undefined"){this.trace="";} return this.trace;}).method('_evaluateError',function(error){this._setTrace(error.trace||error.stack);}).method('_setTrace',function(trace){this.trace=trace;}).method("_setName",function _setName(name){if(typeof name==="undefined"){fcmsJs.console.error("Kein Name für die Exception angegeben.");return;} this.name=name;}).method("_setMessage",function _setMessage(message){this.message=message;});})();(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){this.waiting=true;this.onCommit.notify();this._webservice.call(method,{messages:this.getMessages()},this._handleServerResponse.bind(this));this._msgOut=[];}}).method('getMessages',function(){return this._msgOut;}).method('send',function(name,data,ressource,callback){var d=data;if(typeof data==='function'){d=data();} var request={'type':name,'data':d,'ressource':{}};var func=name.split('::');if(fcmsLib_Core_Array.size(func)===2&&typeof callback==='function'){if(this._mode==='direct'){var ws=new fcmsLib_Core_Webservice(func[0]);this._webservice.call(func[1],data,callback,func[0],ressource.objectid);this.commit('process');return false;}} if(typeof callback==='function'){request.ressource.requestid=Math.floor(Math.random()*(9999999-100000+1))+1000000;this.rememberCallback(request.ressource.requestid,callback);} if(typeof ressource==='object'){if(typeof ressource.objectid!=='undefined'){request.ressource.objectid=ressource.objectid;}} this._msgOut.push(request);}).method('rememberCallback',function(id,callback){if(typeof this._callbacks[id]!=='undefined'){fcmsJs.console.error('Callback für Request id '+id+' wird überschrieben.');} this._callbacks[id]=callback;}).method('_handleCallback',function(message){if(message.type.substr(0,10)==='response::'){var id=message.type.substr(10);if(typeof this._callbacks[id]==='function'){this._callbacks[id](message.data);delete this._callbacks[id];}else{fcmsJs.console.error('Kein Registrierter Callback für '+message.type);}}}).method('_handleServerResponse',function(serverResponse){this.lastPoll=new Date();if(typeof serverResponse.data!=='object'){return;} if(typeof serverResponse.data.messages==='object'){if(fcmsLib_Core_Array.size(serverResponse.data.messages)>0){fcmsLib_Core_Array.each(serverResponse.data.messages,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)){fcmsLib_Core_Array.each(m,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;} fcmsLib_Core_Object.each(fcmsLib_Core_Object.sortBy(this.events,function(val,key){return 100-key.length;}),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");}