function Core(){};Core.prototype={EVENTS:new Array(), CHANGELEVEL:0, LAST_INVOKED:0, BASE64S:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', fireTrigger:function(_event){_event=doyo.core.getEvent(_event);var handler=_event.type;if(handler==null)return;var evts=doyo.core.EVENTS;if(evts[handler]){for(var key in evts[handler]){eval(evts[handler][key]+'(_event);');};};}, addTrigger:function(_handler,_callback){var evts=doyo.core.EVENTS;if(!evts[_handler])evts[_handler]=new Array();var addCallback=true;for(var key in evts[_handler]){if(evts[_handler][key]==_callback){addCallback=false;break;};};if(addCallback)evts[_handler][evts[_handler].length]=_callback;}, renameFile:function(_oldname){var newname=prompt('Datei umbenennen:', _oldname);if(newname){document.rename.oldname.value=_oldname;document.rename.newname.value=newname;document.rename.submit();};return false;}, base64_encode:function(_str){var b64s=doyo.core.BASE64S;_str=escape(_str);var bits, dual, i=0, encOut='';while(_str.length >=i+3){bits=(_str.charCodeAt(i++)& 0xff)<<16 |(_str.charCodeAt(i++)& 0xff)<<8 | _str.charCodeAt(i++)& 0xff;encOut+=b64s.charAt((bits & 0x00fc0000)>>18)+b64s.charAt((bits & 0x0003f000)>>12)+b64s.charAt((bits & 0x00000fc0)>> 6)+b64s.charAt((bits & 0x0000003f));};if(_str.length-i > 0 && _str.length-i < 3){dual=Boolean(_str.length-i-1);bits=((_str.charCodeAt(i++)& 0xff)<<16)|(dual ?(_str.charCodeAt(i)& 0xff)<<8:0);encOut+=b64s.charAt((bits & 0x00fc0000)>>18)+b64s.charAt((bits & 0x0003f000)>>12)+(dual ? b64s.charAt((bits & 0x00000fc0)>>6):'=')+'=';};return encOut;}, base64_decode:function(_str){var b64s=doyo.core.BASE64S;var bits;var decOut='';var undecOut;var i=0;for(;i<_str.length;i+=4){bits=(b64s.indexOf(_str.charAt(i))& 0xff)<<18 |(b64s.indexOf(_str.charAt(i+1))& 0xff)<<12 |(b64s.indexOf(_str.charAt(i+2))& 0xff)<< 6 | b64s.indexOf(_str.charAt(i+3))& 0xff;decOut+=String.fromCharCode((bits & 0xff0000)>>16,(bits & 0xff00)>>8, bits & 0xff);};if(_str.charCodeAt(i-2)==61)undecOut=decOut.substring(0, decOut.length-2);else if(_str.charCodeAt(i-1)==61)undecOut=decOut.substring(0, decOut.length-1);else undecOut=decOut;return unescape(undecOut).replace(/\\/g,'');}, changed:function(_level){if(isNaN(_level))_level=1;if(_level==0){doyo.core.CHANGELEVEL=_level;}else if(_level > doyo.core.CHANGELEVEL){doyo.core.CHANGELEVEL=_level;};return true;}, saveYourSelf:function(){if(doyo.core.CHANGELEVEL > 0){if(confirm('ACHTUNG!\nKlicken Sie auf [ Ok ] um &Auml;nderungen zu speichern.\n[ Abbrechen ] verwirft um die &Auml;nderungen'))doyo.core.save();};return true;}, selectMenuChoosed:function(_src,_dst,_filename,_level,_isBgImage){if(!_src || !_dst)return false;var hiddenObj=eval('document.form.'+_dst.substr(3));var tmp=_src.split('-');var viewObj=stdio.getObject('dlg:'+_dst);_src=stdio.getObject(tmp[tmp.length-1]);_dst=stdio.getObject(_dst);if(_src && _dst){if(_src.style && _dst.style){if(_src.style.backgroundImage){_dst.style.backgroundImage=_src.style.backgroundImage;_dst.style.filter='';}else if(_src.style.filter){_dst.style.filter=_src.style.filter;_dst.style.backgroundImage='';};if(_isBgImage){if(doyo.csstools)doyo.csstools.changeBodyBackground(_filename);};if(hiddenObj){hiddenObj.value=_filename;doyo.core.changed(_level);};};if(!viewObj)viewObj=_dst;viewObj.scrollIntoView(false);};return false;}, errorHandler:function(_msg,_file,_line){var srv=new Array();srv=document.URL.split('://');srv=srv[1].split('/');srv=srv[0];if(srv=='localhost'){window.ScriptError='Server:'+srv+" Fehler:\n"+_msg+"\n"+_file+"\n"+_line;return doyo.core.croakError();};return true;}, croakError:function(){return confirm(window.ScriptError);}, getEvent:function(_e){if(window.event)return window.event;return _e;}, getCoords:function(_obj,_withSize){var wh=null;var x=0,y=0;var w=0,h=0;if(_obj){w=_obj.clientWidth;h=_obj.clientHeight;if(_withSize){if(w==0 || h==0)wh=doyo.core.getSouthEastCorner(_obj);};x+=_obj.scrollLeft;y+=_obj.scrollTop;};while(_obj !=null){x+=_obj.offsetLeft;y+=_obj.offsetTop;_obj=_obj.offsetParent;};if(wh !=null){w=wh.x-x;h=wh.y-y;};var xw=x+w;var yh=y+h;return{x:x,y:y,w:w,h:h,xw:xw,yh:yh};}, getSouthEastCorner:function(_obj){var x=0;var y=0;var id='xmax.ymax';if(_obj.id){id=id+'.'+_obj.id;};var corner=stdio.getObject(id);if(corner){var dim=doyo.core.getCoords(corner);x=dim.x;y=dim.y;};return{x:x,y:y};}, setActive:function(_style){if(_style.backgroundImage)_style.backgroundImage=_style.backgroundImage.replace(/\/normal\//,'/active/');}, setNormal:function(_style){if(_style.backgroundImage)_style.backgroundImage=_style.backgroundImage.replace(/\/active\//,'/normal/');}, changeIcon:function(_self,_doOpen){var tagtype=_self.tagName.toUpperCase();switch(_self.tagName.toUpperCase()){case 'IMG':if(_doOpen){_self.src=_self.src.replace(/\/closed-/,'/open-');}else{_self.src=_self.src.replace(/\/open-/,'/closed-');};break;default:if(_doOpen){_self.style.backgroundImage=_self.style.backgroundImage.replace(/\/closed-/,'/open-');}else{_self.style.backgroundImage=_self.style.backgroundImage.replace(/\/open-/,'/closed-');};break;};}, getUniqId:function(_self,_sep){if(_sep==null)_sep='.';if(_self==null)return _self;if(!_self.id)return null;var split=_self.id.split(_sep);if(split.length > 1)return split[split.length-1];return _self.id;}, changeBgColor:function(_self,_color){if(_color==null){_self.bgColor='';}else if(_self.bgColor !=_color){_self.bgColor=_color;};}, setCSSVisibility:function(_obj,_visibility){if(_obj==undefined)return false;if(_visibility=='hidden'){if(stdio.IS['ie4'] || stdio.IS['ns6']){_obj.style.visibility='hidden';_obj.style.display='none';}else if(stdio.IS['ns4']){_obj.visibility='hide';};}else{if(stdio.IS['ie4'] || stdio.IS['ns6']){_obj.style.visibility=_visibility;_obj.style.display='inline';}else if(stdio.IS['ns4']){_obj.visibility=_visibility;};};return true;}, clickHref:function(_id,_event){var obj=stdio.getObject(_id);if(obj){if(obj.href){if(!_event){var dim=doyo.core.getCoords(obj);if(dim)window.scrollTo(0,dim.y);};var strHref=unescape(obj.href);var strTarget=obj.target;_event=doyo.core.getEvent(_event);if(_event && _event.ctrlKey){strTarget='_blank';}if(strTarget){window.open(strHref, strTarget);}else{window.location.href=strHref;};};};return false;}, jigsaw:function(_instance){var doIt=(doyo.core.getFrame(top,_instance.concat('_siteLogo'))==null);if(!doIt)doIt=(doyo.core.getFrame(top,_instance.concat('_siteHeader'))==null);if(!doIt)doIt=(doyo.core.getFrame(top,_instance.concat('_siteBar'))==null);if(doIt){var elems=window.location.pathname.split('/');var file=elems.pop();elems.pop();var redirURI=window.location.protocol;redirURI=redirURI.concat('/');redirURI=redirURI.concat('/');redirURI=redirURI.concat(window.location.hostname);redirURI=redirURI.concat(elems.join('/'));redirURI=redirURI.concat('/?');redirURI=redirURI.concat('src='+escape(file));var search=window.location.search.substring(1);if(search.length > 0)redirURI=redirURI.concat('&'+search);top.window.location.href=redirURI;};return false;}, getFrame:function(_window,_name){var result=null;if(_window){var nameOfFrame;for(var i=0;i<_window.frames.length;i++){try{nameOfFrame=_window.frames[i].name;}catch(e){continue;};if(nameOfFrame==_name){result=_window.frames[i];break;};};};return result;}, collectFrames:function(_result,_self,_skip){var nameOfFrame;for(var i=0;i<_self.frames.length;i++){try{nameOfFrame=_self.frames[i].name;}catch(e){continue;};if(_skip &&(_skip==nameOfFrame)){;}else{_result[_result.length]=_self.frames[i];};this.collectFrames(_result,_self.frames[i],_skip);};}, confirmIt:function(_hidden,_msg){var isOk=confirm(_msg);if(isOk){doyo.core.changed();_hidden.value=1;doyo.core.save();};return false;}, confirmUndo:function(_form){if(doyo.core.CHANGELEVEL > 0){var isOk=confirm('Letzte &Auml;nderungen r&uuml;ckg&auml;ngig machen ?');if(isOk){_form.reset();doyo.core.changed(0);};};return void(0);}, transform:function(_direction){doyo.core.changed();document.form.transform.value=_direction;doyo.core.save(null,null,true);return void(0);}, save:function(_self,_event,_nosplash){var isHiddenPost=false;if(doyo.core.CHANGELEVEL > 0){if(doyo.core.CHANGELEVEL==1){if(typeof POSTFRAME !='undefined'){document.form.target=POSTFRAME;isHiddenPost=true;};}else{document.form.target='';};if(_nosplash==null)doyo.dlg.showSplash(_self,_event,isHiddenPost);doyo.core.changed(0);doyo.core.encodeModSecurityPostContent(document.form);document.form.onsubmit=null;document.form.submit();doyo.core.decodeModSecurityPostContent(document.form);};return false;}, encodeModSecurityPostContent:function(_form){if(!(_form || _form.elements))return false;var elements=_form.elements;var item;for(var i=0;i < elements.length;i++){item=elements[i];if(!item.value)continue;if(item.type=='file')continue;if(isNaN(item.value))item.value='doyo_'+doyo.core.base64_encode(item.value);};return true;}, decodeModSecurityPostContent:function(_form){if(!(_form || _form.elements))return false;var elements=_form.elements;var item;for(var i=0;i < elements.length;i++){item=elements[i];if(!item.value)continue;if(item.type=='file')continue;if(item.value.match(/^doyo_/))item.value=doyo.core.base64_decode(item.value.replace(/^doyo_/, ''));};return true;}, forceSave:function(_self,_event,_nosplash){doyo.core.changed();doyo.core.save();}, drop:function(){if(doyo.core.lastInvoked()< 2000){return false;}doyo.core.changed(0);var questionTxt='';var hiddenTag=document.form._recycleThis;switch(arguments[0]){case 'picture':questionTxt='Bild wird endg&uuml;ltig gel&ouml;scht';break;case 'folder':questionTxt='Der gesamte Ordner wird nun\ninklusive Inhalt endültig gelöscht';break;case 'allPics':hiddenTag=document.form._recyclePics;questionTxt='Es werden aller Bilder in diesem Ordner entfernt';break;default:return false;break;};var confirmed=doyo.core.confirmIt(hiddenTag, questionTxt);doyo.core.lastInvoked();return confirmed;}, lastInvoked:function(){var d=new Date();var now=d.getTime();var diff=now-this.LAST_INVOKED;this.LAST_INVOKED=now;return diff;}, getKeyCode:function(_event){_event=_event || window.event;return _event.keyCode;}, hitReturnKey:function(_event){return(this.getKeyCode()==13);}, reverse:function(){return "Hallo";}, getBaseDir:function(){var tmp=window.location.href.split('/');tmp.pop();return tmp.join('/')+'/';}};if(!doyo)var doyo={};doyo.core=new Core();window.onerror=doyo.core.errorHandler;document.onmousemove=doyo.core.fireTrigger;document.onmouseout=doyo.core.fireTrigger;document.onmouseup=doyo.core.fireTrigger;document.onkeypress=doyo.core.fireTrigger;
