(String,["onlyDigits","isDecimal","isNumberBetween","toNumberBetween"]);String.implement({onlyDigits:function(){return this.match(/^[0-9]+$/)!=null;},isDecimal:function(){return this.match(/^(\-|\+)?([0-9]+(\.[0-9]+)|[0-9]*)$/)!=null;
},isNumberBetween:function(b,a){if(this.onlyDigits()){var c=this.toInteger();return c>=b&&c<=a;}return false;},toInteger:function(){return new Number(this.match(/[0-9]+/));
},toNumberBetween:function(b,a,c){return this.isNumberBetween(b,a)?this.toInteger():c;}});Number.implement({climb:function(a){var b=this.toInt()%(a*2);
return b*(b<a)+(2*a-b)*(b>=a);}});Array.implement({rig:function(c,d){for(var b=0,a=[];b<this.length;b++){a.push(c.call(d,this[b],b,this));}return a;},mergeext:function(d,c,e){if(this.length>1){var a=c.call(e,this[0],this[1],this),b=0;
for(b=2,l=this.length;b<l;b++){a=c.call(e,a,this[b],this);}return a;}return this.length>0?this[0]:d;}});Element.implement({disableSelection:function(){if(window.ie){this.onselectstart=function(){return false;
};this.addStyle("cursor","default");}else{if(window.gecko){this.setStyle("-moz-user-select","none");this.setStyle("cursor","default");}else{this.onmousedown=function(){return false;
};this.setStyle("cursor","default");}}return this;}});Element.implement({tidy:function(){this.set("value",this.get("value").tidy());},getTextInRange:function(b,a){return this.get("value").substring(b,a);
},getSelectedText:function(){if(Browser.Engine.trident){return document.selection.createRange().text;}return this.get("value").substring(this.getSelectionStart(),this.getSelectionEnd());
},getIERanges:function(){this.focus();var a=document.selection.createRange();var c=this.createTextRange();var b=c.duplicate();c.moveToBookmark(a.getBookmark());
b.setEndPoint("EndToStart",c);return{start:b.text.length,end:b.text.length+a.text.length,length:a.text.length,text:a.text};},getSelectionStart:function(){if(Browser.Engine.trident){return this.getIERanges().start;
}return this.selectionStart;},getSelectionEnd:function(){if(Browser.Engine.trident){return this.getIERanges().end;}return this.selectionEnd;},getSelectedRange:function(){return{start:this.getSelectionStart(),end:this.getSelectionEnd()};
},setCaretPosition:function(a){if(a=="end"){a=this.get("value").length;}this.selectRange(a,a);return this;},getCaretPosition:function(){return this.getSelectedRange().start;
},selectRange:function(c,a){this.focus();if(Browser.Engine.trident){var b=this.createTextRange();b.collapse(true);b.moveStart("character",c);b.moveEnd("character",a-c);
b.select();return this;}this.setSelectionRange(c,a);return this;},insertAtCursor:function(c,a){var d=this.getSelectionStart();var b=this.getSelectionEnd();
this.set("value",this.get("value").substring(0,d)+c+this.get("value").substring(b,this.get("value").length));if($pick(a,true)){this.selectRange(d,d+c.length);
}else{this.setCaretPosition(d+c.length);}return this;},insertAroundCursor:function(c,a){c=$extend({before:"",defaultMiddle:"SOMETHING HERE",after:""},c);
value=this.getSelectedText()||c.defaultMiddle;var f=this.getSelectionStart();var b=this.getSelectionEnd();if(f==b){var e=this.get("value");this.set("value",e.substring(0,f)+c.before+value+c.after+e.substring(b,e.length));
this.selectRange(f+c.before.length,b+c.before.length+value.length);e=null;}else{e=this.get("value").substring(f,b);this.set("value",this.get("value").substring(0,f)+c.before+e+c.after+this.get("value").substring(b,this.get("value").length));
var d=f+c.before.length;if($pick(a,true)){this.selectRange(d,d+e.length);}else{this.setCaretPosition(d+e.length);}}return this;}});Browser.isIE6=function(){return Browser.Engine.name=="trident"&&Browser.Engine.version==4;
};function min(b,a){return b<a?b:a;}function max(b,a){return b>a?b:a;}function sendPostData(a,c){var b=new Element("form",{enctype:"multipart/form-data",action:a,method:"post"}).inject($$("html")[0]);
$H(c).each(function(e,d){new Element("input",{styles:{display:"none"},type:"text",name:d}).inject(b).setProperty("value",e);});b.submit();}var DragLayer=new Class({Implements:[Options],options:{cancelAvailable:false},initialize:function(b,a){this.setOptions(a||{});
this.myDivParent=null;this.myDivContainer=null;this.idArr={};this.id=b;},init:function(){if(!this.myDivContainer){var a=new Hash.Cookie(this.id,{path:"/"});
this.myDivParent=new Element("div",{styles:{position:"absolute",left:max(0,a.get("x")||0)+"px",top:max(0,a.get("y")||0)+"px",width:"150px","z-index":"5000",border:"1px black solid",background:"silver","text-align":"left",padding:"1px"}}).inject(document.body);
var c=new Element("div",{id:this.id+"Handle",styles:{position:"relative",border:"1px white solid",cursor:"move",height:"20px"}}).inject(this.myDivParent);
if(this.options.cancelAvailable){var b=new Element("div",{"class":"PopupCancelButton"}).inject(c).addEvent("click",function(){this.myDivParent.setStyle("display","none");
this.myDivContainer.empty();}.bind(this));}this.myDivContainer=new Element("div",{id:this.id,"class":"clearfix",styles:{clear:"both",padding:"1px"}}).inject(this.myDivParent);
this.myDivParent.makeDraggable({handle:this.id+"Handle",onStart:function(d){d.setOpacity(0.5);},onComplete:function(d){d.setOpacity(1);var e=d.getPosition();
if(e.x<0||e.y<0){if(e.x<0){e.x=0;}if(e.y<0){e.y=0;}d.position(e);}a.set("x",e.x);a.set("y",e.y);}});}this.myDivParent.setStyle("display","block");},clear:function(){this.init();
this.myDivContainer.empty();},add:function(a){this.init();a.inject(this.myDivContainer);},show:function(){this.init();},hide:function(){this.myDivParent.setStyle("display","none");
},set:function(b,a){this.init();if(!this.idArr[b]){this.idArr[b]=(new Element("div")).inject(this.myDivContainer);}this.idArr[b].set("text",b+": "+a);}});
var Tracer=new Class({Extends:DragLayer,initialize:function(){this.parent("tracerPos",{cancelAvailable:true});},add:function(a){this.init();(new Element("div")).inject(this.myDivContainer).set("text",a);
},set:function(b,a){this.init();if(!this.idArr[b]){this.idArr[b]=(new Element("div")).inject(this.myDivContainer);}this.idArr[b].set("text",b+": "+a);}});
tracer=new Tracer();sprintfWrapper={init:function(){if(typeof arguments=="undefined"){return null;}if(arguments.length<1){return null;}if(typeof arguments[0]!="string"){return null;
}if(typeof RegExp=="undefined"){return null;}var j=arguments[0];var c=new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g);var g=new Array();
var m=new Array();var a=0;var h=0;var n=0;var d=0;var k="";var f=null;while(f=c.exec(j)){if(f[9]){a+=1;}h=d;n=c.lastIndex-f[0].length;m[m.length]=j.substring(h,n);
d=c.lastIndex;g[g.length]={match:f[0],left:f[3]?true:false,sign:f[4]||"",pad:f[5]||" ",min:f[6]||0,precision:f[8],code:f[9]||"%",negative:parseInt(arguments[a])<0?true:false,argument:String(arguments[a])};
}m[m.length]=j.substring(d);if(g.length==0){return j;}if((arguments.length-1)<a){return null;}var b=null;var f=null;var e=null;for(e=0;e<g.length;e++){if(g[e].code=="%"){substitution="%";
}else{if(g[e].code=="b"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(2));substitution=sprintfWrapper.convert(g[e],true);}else{if(g[e].code=="c"){g[e].argument=String(String.fromCharCode(parseInt(Math.abs(parseInt(g[e].argument)))));
substitution=sprintfWrapper.convert(g[e],true);}else{if(g[e].code=="d"){g[e].argument=String(Math.abs(parseInt(g[e].argument)));substitution=sprintfWrapper.convert(g[e]);
}else{if(g[e].code=="f"){g[e].argument=String(Math.abs(parseFloat(g[e].argument)).toFixed(g[e].precision?g[e].precision:6));substitution=sprintfWrapper.convert(g[e]);
}else{if(g[e].code=="o"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(8));substitution=sprintfWrapper.convert(g[e]);}else{if(g[e].code=="s"){g[e].argument=g[e].argument.substring(0,g[e].precision?g[e].precision:g[e].argument.length);
substitution=sprintfWrapper.convert(g[e],true);}else{if(g[e].code=="x"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(16));substitution=sprintfWrapper.convert(g[e]);
}else{if(g[e].code=="X"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(16));substitution=sprintfWrapper.convert(g[e]).toUpperCase();}else{substitution=g[e].match;
}}}}}}}}}k+=m[e];k+=substitution;}k+=m[e];return k;},convert:function(b,d){if(d){b.sign="";}else{b.sign=b.negative?"-":b.sign;}var a=b.min-b.argument.length+1-b.sign.length;
var c=new Array(a<0?0:a).join(b.pad);if(!b.left){if(b.pad=="0"||d){return b.sign+c+b.argument;}else{return c+b.sign+b.argument;}}else{if(b.pad=="0"||d){return b.sign+b.argument+c.replace(/0/g," ");
}else{return b.sign+b.argument+c;}}}};sprintf=sprintfWrapper.init;function getRadioButtonValue(c){var a=$$("*[name="+c+"]");for(var b in a){if(a[b].checked){return a[b].value;
}}return null;}(Hash,["toScriptParams"]);Hash.implement({toScriptParams:function(){var a="";this.each(function(c,b){if(a){a+="&";}a+=b+"="+c;});return a;
}});function logger(b,d){d=d||false;var c=new Request({url:ROOT_URL+"part/SystemTools.php"});var a=new Date();c.post({message:a.toGMTString()+": "+b,sendPerMail:d});
}var FlippTabs=new Class({initialize:function(c,e){var b=[];var d=new Fx.Transition(Fx.Transitions.linear,1);$(c).getChildren().each(function(h,f){var g=h.getParent().getStyle("height").toInt();
h.setStyles({top:f*e});h.store("idx",f);b.push(new Fx.Morph(h,{duration:400,transition:d.easeInOut}));h.addEvent("mouseenter",function(i){b.each(function(o,j){o.cancel();
var m=o.element.getStyle("top").toInt();var p=g-m;var n=(j<=this.retrieve("idx"))?e*j:g-e*(b.length-j);var k=g-n;o.start({top:[m,n]});},this);});});var a=$(c).getLast();
$(c).addEvent("mouseleave",a.fireEvent.bind(a,"mouseenter"));}});var LocationFinder=new Class({Implements:[Events],initialize:function(b){this.params=b;
this.focusedElement=null;this.offset=0;this.count=-1;this.scrollUp=false;this.myAjax=new Request({url:this.params.scriptURL});$(this.params.searchField).setProperty("autocomplete","off");
this.progress=null;$(this.params.resultField).setStyle("display","none");var a=new Element("div",{"class":"locationListEditor"}).inject($(this.params.resultField));
new Element("div",{html:((this.offset/15).toInt()+1)+"/"+(((this.count-1)/15).toInt()+1)+" "}).inject(a);new Element("a").inject(a).addEvent("click",function(c){c.key="pageup";
$(this.params.searchField).fireEvent("keydown",c);}.bind(this)).disableSelection();new Element("a").inject(a).addEvent("click",function(c){c.key="pagedown";
$(this.params.searchField).fireEvent("keydown",c);}.bind(this)).disableSelection();this.content=new Element("div",{}).inject($(this.params.resultField));
this.addEvent("empty",function(){$(this.content).empty();$(this.params.resultField).setStyle("display","none");});},updateLocationList:function(){this.focusedElement=null;
if($(this.params.searchField).value.length>0){if(this.progress){this.progress.setStyle("display","inline");}this.myAjax.cancel();this.myAjax.post({location:$(this.params.searchField).value,searchCountry:$(this.params.searchCountry).value,type:this.params.type,offset:this.offset,getCount:true});
}else{$(this.params.resultField).setStyle("display","none");}},init:function(){this.myAjax.addEvent("success",function(b){this.content.empty();if(b){var a=JSON.decode(b);
if(a.count>=0){this.count=a.count;$(this.params.resultField).getFirst().getFirst().set("html",((this.offset/15).toInt()+1)+"/"+(((this.count-1)/15).toInt()+1));
}a.content=this.content;this.fireEvent("onDataLoaded",a);}if(this.progress){this.progress.setStyle("display","none");}}.bind(this));this.addEvent("onDataFilled",function(){if(this.scrollUp){this.focusedElement=this.content.getLast();
}else{this.focusedElement=this.content.getFirst();}if(this.focusedElement){this.focusedElement.removeClass("locationListButton").addClass("locationListButtonSelected");
}$(this.params.resultField).setStyle("display",this.count>0?"block":"none");$(this.params.resultField).getFirst().setStyle("display",this.count>15?"block":"none");
$(this.params.resultField).getFirst().getLast().getPrevious().removeClass("up").removeClass("upGray").addClass(this.offset>0?"up":"upGray");$(this.params.resultField).getFirst().getLast().removeClass("down").removeClass("downGray").addClass((this.offset+15<this.count)?"down":"downGray");
this.scrollUp=false;});if(this.params.searchCountry){$(this.params.searchCountry).addEvent("change",function(a){this.offset=0;this.count=-1;this.updateLocationList();
}.bind(this));}$(this.params.searchField).addEvent("keyup",function(a){if(a.key=="enter"&&this.focusedElement){this.focusedElement.fireEvent("click");$(this.params.searchField).blur();
}else{if(a.key!="up"&&a.key!="down"&&this.lastStr!=$(this.params.searchField).getProperty("value")){this.lastStr=$(this.params.searchField).getProperty("value");
this.offset=0;this.count=-1;this.updateLocationList();}}}.bind(this));$(this.params.searchField).addEvent("keydown",function(a){switch(a.key){case"down":if(!this.myAjax.running&&this.focusedElement&&(this.offset+15<this.count||this.focusedElement.getNext())){if(this.focusedElement.getNext()){this.focusedElement.removeClass("locationListButtonSelected").addClass("locationListButton");
this.focusedElement=this.focusedElement.getNext();this.focusedElement.removeClass("locationListButton").addClass("locationListButtonSelected");}else{this.offset+=15;
this.updateLocationList();}}break;case"up":if(!this.myAjax.running&&this.focusedElement&&(this.offset>0||this.focusedElement.getPrevious())){if(this.focusedElement.getPrevious()){this.focusedElement.removeClass("locationListButtonSelected").addClass("locationListButton");
this.focusedElement=this.focusedElement.getPrevious();this.focusedElement.removeClass("locationListButton").addClass("locationListButtonSelected");}else{this.offset=max(0,this.offset-15);
this.scrollUp=true;this.updateLocationList();}}break;case"pagedown":if(!this.myAjax.running&&this.offset+15<this.count){this.offset+=15;this.updateLocationList();
}break;case"pageup":if(!this.myAjax.running&&this.offset>0){this.offset-=15;this.updateLocationList();}break;case"enter":a.stop();break;}}.bind(this));
$(this.params.searchField).addEvent("blur",function(a){if(this.focusedElement){}}.bind(this));$(this.params.searchField).addEvent("focus",function(a){if(this.content.getChildren().length==0){this.updateLocationList();
}else{}}.bind(this));if(this.params.progress){this.progress=new Element("img",{src:ROOT_URL+"design/icons/progress/progress.gif",styles:{"margin-left":"2px",display:"none"}}).injectAfter($(this.params.searchField));
}}});var TipManager=new Class({Implements:[Events,Options],options:{onShow:function(a){a.fade("in");},onHide:function(a){a.fade("out");}},settings:$H({offsets:{x:16,y:16},maxTitleChars:50,showDelay:100,hideDelay:100,focusTip:false,fixed:false,className:"tool",openOnClick:false,docking:"B"}),initialize:function(a){this.setOptions();
this.sets=a.rig(function(b){return $extend({},this.settings).extend(b);}.bind(this));this.sets.each(function(c,b){c.id=b;});document.body.store("tipMap",$H());
document.addEvent("mousedown",function(e){var g=[];this.fillFlatList(g,document.body);for(var c=0;c<g.length;c++){var d=g[c];var f=d.getCoordinates();var b=d.getScroll();
f.left+=b.x;f.top+=b.y;if(e.page.x>=f.left&&e.page.x<=f.left+f.width&&e.page.y>=f.top&&e.page.y<=f.top+f.height){this.closeChildren(d);break;}}}.bind(this));
window.addEvent("onAfterContentReplace",this.prepareContent.bind(this));},prepareContent:function(b){var a=this;this.sets.each(function(d){var c=b.getElements(d.selector);
c.each(function(e){e.store("owner",a.getTargetParent(e));e.store("group",d);a.build(d,e);});c.addEvent("mousedown",function(e){if(!d.focusTip){e.stop();
}if(d.openOnClick){this.store("tip:active",true);a.start(this,e,d);}});if(!d.openOnClick){c.addEvent(d.focusTip?"focus":"mouseenter",function(e){e.stop();
this.store("tip:active",true);a.start(this,e,d);});c.addEvent(d.focusTip?"blur":"mouseleave",function(e){a.end(this.retrieve("toolTip"),e);this.eliminate("tip:active");
});}if(!d.fixed&&!d.focusTip){c.addEvent("mousemove",function(e){if(this.retrieve("toolTip")){a.setToMousePos(e,this,true);}});}});},createTip:function(g,d,e){var a=d.retrieve("owner");
var f=a.retrieve("tipMap");var h=f[g.id];if(h){h.retrieve("pointer").eliminate("toolTip");d.store("toolTip",h);h.store("pointer",d);}else{var b=new Element("div",{"class":g.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden",opacity:0}}).inject(document.body);
d.store("toolTip",b);b.store("tipMap",$H());b.store("pointer",d);f[g.id]=b;if(g.fixed&&!g.focusTip&&!g.openOnClick){var c=this;b.addEvent("mouseenter",function(j){var i=this.retrieve("pointer");
i.store("tip:active",true);$clear(this.retrieve("timer"));this.store("timer",c.show.delay(i.retrieve("group").showDelay,c,this));}).addEvent("mouseleave",function(i){c.end(this,i);
this.retrieve("pointer").eliminate("tip:active");});}else{if(g.focusTip){b.addEvent("mousedown",function(i){i.stop();});}}}},destroyTipChildren:function(b,a){b.retrieve("tipMap").each(function(c){if(c.retrieve("fx")){c.retrieve("fx").cancel();
c.eliminate("fx");}this.destroyTipChildren(c,a);c.retrieve("pointer").eliminate("toolTip");c.eliminate("pointer");c.destroy();}.bind(this));b.store("tipMap",$H());
},build:function(g,a){if(a.title){if(a.title.test("^DOM:","i")){a.title=$(a.title.split(":")[1].trim()).innerHTML;}if(a.title.test("^AJAX:","i")){a.title=g.loadingText+"::"+a.title;
}var i=a.title.split("::");if(i.length>1){var e=i[0].trim();var h=i[1].trim();var d="^\\$([A-Z]){(.+)}(.*)";if(e.test(d,"i")){var f=e.replace(new RegExp(d),"$1");
var b=e.replace(new RegExp(d),"$2");e=e.replace(new RegExp(d),"$3");switch(f){case"D":a.store("docking",b);break;case"C":a.store("myExtClass",b);break;
}}a.store("myTitle",e);var c=h.test("^AJAX:","i")?"myUrl":"myText";a.store(c,h);}else{a.store("myText",a.title);}a.removeAttribute("title");if(a.retrieve("myTitle")&&a.retrieve("myTitle").length>g.maxTitleChars){a.store("myTitle",a.retrieve("myTitle").substr(0,g.maxTitleChars-1)+"&hellip;");
}}},start:function(d,e,f){this.createTip(f,d,e);if(d.retrieve("myUrl")){var c=this;if(!f.ajax){f.ajax=new Request({onComplete:function(g,h){this.el.store("myText",g);
if(this.el.retrieve("tip:active")){c.start(this.el,this.custEv,f);}if(this.nextCall){var i=this.nextCall;this.nextCall=null;if(i.e.retrieve("tip:active")){c.start(i.e,i.ev,i.gr);
}}},onCancel:function(){this.el.store("myUrl","AJAX:"+this.options.url);},onFailure:function(){this.el.store("myUrl","AJAX:"+this.options.url);}});}if(!f.ajax.running){f.ajax.el=d;
f.ajax.custEv=e;f.ajax.send({url:d.retrieve("myUrl").replace(/AJAX:/i,"")});d.eliminate("myUrl");}else{f.ajax.nextCall={e:d,ev:e,gr:f};}}if(d.retrieve("myText")){var a=d.retrieve("toolTip");
this.destroyTipChildren(a,this.sets);a.empty();if(d.retrieve("myTitle")){new Element("div",{"class":f.className+"-title"}).inject(a).set("html",d.retrieve("myTitle"));
}if(d.retrieve("myText")){var b=new Element("div",{"class":f.className+"-text"}).inject(a).set("html",d.retrieve("myText"));if(d.retrieve("myExtClass")){b.addClass(d.retrieve("myExtClass"));
}}window.fireEvent("onAfterContentReplace",a);if(f.fixed||f.focusTip){this.setPos(d.getPosition(),d);}else{this.setToMousePos(e,d,false);}if(!a.retrieve("tip:active")){$clear(a.retrieve("timer"));
a.store("timer",this.show.delay(f.showDelay,this,a));}}},end:function(a,b){if(a&&a.retrieve("pointer").retrieve("tip:active")){$clear(a.retrieve("timer"));
a.store("timer",this.hide.delay(a.retrieve("pointer").retrieve("group").hideDelay,this,a));}},setToMousePos:function(b,a,c){this.setPos(b.page,a,c);},setPos:function(h,e,g){var a=e.retrieve("toolTip");
var r=e.retrieve("group");var k={x:window.getWidth(),y:window.getHeight()};var p={x:window.getScrollLeft(),y:window.getScrollTop()};var q={x:a.offsetWidth,y:a.offsetHeight};
var o={x:e.offsetWidth,y:e.offsetHeight};var b={x:"left",y:"top"};var d={};for(var m in b){var n=h[m]+r.offsets[m];if(e.retrieve("docking")=="L"){if(m=="x"){n-=q[m];
}}else{if(e.retrieve("docking")=="R"){if(m=="x"){n+=o[m];}}else{if(e.retrieve("docking")=="T"){if(m=="y"){n-=q[m];}}else{if(r.docking=="T"&&m=="y"){n-=q[m];
}else{if(r.docking=="B"&&m=="y"){n+=o[m];}}}}}if(r.fixed){var j=e.retrieve("docking")=="L"||e.retrieve("docking")=="R";var i={x:(!j)*e.offsetWidth,y:j*e.offsetHeight};
var c=false;if(n-p[m]<0){n=h[m]+o[m];c=true;}if((n+q[m]-p[m])>k[m]){if(c){n=p[m];}else{n=h[m]-r.offsets[m]-q[m]+i[m];if(n-p[m]<0){n=p[m];}}}}d[b[m]]=n;
}var f=a.retrieve("fx");if(!f){f=a.retrieve("fx",new Fx.Morph(a,{onComplete:function(){if(this.nextFxPos){this.start(this.nextFxPos);this.nextFxPos=null;
}}}).set(d));}if(f.check()){f.start(d);}else{f.nextFxPos=d;}},show:function(a){$clear(a.retrieve("timer"));this.fireEvent("onShow",[a]);},hide:function(a){$clear(a.retrieve("timer"));
this.fireEvent("onHide",[a]);},fillFlatList:function(b,a){a.retrieve("tipMap").each(function(c){this.fillFlatList(b,c);}.bind(this));if(a==document.body||a.getStyle("visibility")=="visible"){b.push(a);
}},getTargetParent:function(a){do{a=a.getParent();}while(a&&!$defined(a.retrieve("tipMap")));return a;},closeChildren:function(a){a.retrieve("tipMap").each(function(b){b.retrieve("pointer").eliminate("tip:active");
this.closeChildren(b);this.hide(b);}.bind(this));}});var SimpleContentLoader=new Class({Implements:[Events,Options],options:{mode:"click"},initialize:function(b,a){this.setOptions(a);
window.addEvent("onAfterContentReplace",function(c){c.getElements(b).each(function(d){var e=d.title.split("::");if(e.length>=2){d.store("myContainer",e[0].trim());
if(e[1].test("^AJAX:","i")){d.store("myUrl",e[1].replace(/AJAX:/i,""));}else{d.store("myContent",e[1]);}if(this.options.mode=="hover"){d.addEvent("mouseenter",function(){this.show(d);
}.bind(this));}else{d.addEvent("click",function(){this.show(d);}.bind(this));}}d.removeAttribute("title");}.bind(this));}.bind(this));},show:function(a){if(a.retrieve("myUrl")){new Request({onComplete:function(b,c){a.eliminate("myUrl");
a.store("myContent",b);this.show(a);}.bind(this),onFailure:function(){a.store("myContent","Ein Fehler ist aufgetreten.");}.bind(this),url:a.retrieve("myUrl")}).post();
}else{$(a.retrieve("myContainer")).set("html",a.retrieve("myContent"));}}});var DropDownExt=new Class({Implements:[Events],initialize:function(a,b){this.build(a,b);
},build:function(b,h){var a=new Element("div",{styles:{height:0,border:"1px silver solid",display:"none"}}).injectAfter(b);var j=new Element("div",{styles:{border:"1px white solid",width:"20px",height:"99%","float":"right","background-color":"silver",overflow:"hidden",position:"relative"}}).inject(a);
var f=new Element("div",{styles:{overflow:"hidden",height:"100%",display:"block"}}).inject(a);var k=new Element("div",{styles:{position:"absolute",top:"40px","background-color":"gray",border:"1px white solid",left:"1px",width:"16px",height:"10px"}}).inject(j);
var e=new Element("div",{styles:{"background-image":"url("+ROOT_URL+"design/icons/22x22/move_task_up.png)",width:"22px",height:"22px"}}).inject(j);var g=new Element("div",{styles:{position:"absolute",bottom:"0","background-image":"url("+ROOT_URL+"design/icons/22x22/move_task_down.png)",width:"22px",height:"22px"}}).inject(j);
var i=null;var d=null;f.addEvent("scroll",function(){var m=k.getHeight()+2;var n=e.getHeight()+(this.getHeight()-m-e.getHeight()-g.getHeight())*this.getScrollTop()/(this.getScrollHeight()-this.getHeight());
k.setStyle("top",n);});e.addEvent("mousedown",function(){i=(function(){f.scrollTop=f.scrollTop-5;}).periodical(30);});g.addEvent("mousedown",function(){i=(function(){f.scrollTop=f.scrollTop+5;
}).periodical(30);});e.addEvent("mouseup",function(){$clear(i);});g.addEvent("mouseup",function(){$clear(i);});h.each(function(n){var m=new Element("a",{"class":n.className,href:n.link}).inject(f).set("html",n.label);
if(n.rel){m.setProperty("rel",n.rel);}});var c=new Fx.Transition(Fx.Transitions.linear,1);a.retrieve("effectOut",new Fx.Morph(b.getNext(),{duration:400,transition:c.easeInOut})).addEvent("onComplete",function(){$clear(d);
f.fireEvent("scroll");}.bind(f));a.retrieve("effectIn",new Fx.Morph(b.getNext(),{duration:400,transition:c.easeInOut})).addEvent("onComplete",function(){this.setStyle("display","none");
}.bind(a));b.addEvent("click",function(){this.setStyle("display","block");this.retrieve("effectIn").cancel();this.retrieve("effectOut").start({height:100});
d=(function(){f.fireEvent("scroll");}).periodical(30);}.bind(a));b.addEvent("mouseover",function(){$clear(this.retrieve("exitTimer"));}.bind(a));b.addEvent("mouseleave",function(){this.retrieve("effectOut").cancel();
this.store("exitTimer",this.retrieve("effectIn").start.delay(1000,this.retrieve("effectIn"),{height:0}));}.bind(a));a.addEvent("mouseover",function(){$clear(this.retrieve("exitTimer"));
this.retrieve("effectIn").cancel();this.retrieve("effectOut").start({height:100});});a.addEvent("mouseleave",function(){this.retrieve("effectOut").cancel();
this.store("exitTimer",this.retrieve("effectIn").start.delay(1000,this.retrieve("effectIn"),{height:0}));});}});var CustomFullDialog=new Class({Implements:[Events,Options],options:{showUrl:{},sendUrl:{},showParams:{},sendParams:{},allowClose:true,className:""},initialize:function(a){this.setOptions(a);
this.build();this.sendParamsOnShow={};this.keyUpEvent=null;},build:function(){this.area=new Element("div",{"class":this.options.className?this.options.className+"-mask":"",styles:{position:"absolute",left:"0",top:"0",width:window.getScrollWidth(),height:window.getScrollHeight(),"background-color":"silver",opacity:"0.5",display:"none"}}).inject(document.body);
this.content=new Element("div",{"class":this.options.className,styles:{position:(Browser.isIE6()?"absolute":"fixed"),height:"auto","background-color":"white","margin-left":"-200px",left:"50%",border:"2px black solid",display:"none"}}).inject(document.body);
this.bound={scrollMyWindow:this.scrollMyWindow.bind(this),close:this.close.bind(this),send:this.send.bind(this)};if(this.options.allowClose){this.area.addEvent("click",this.bound.close);
}},show:function(b,d){this.sendParamsOnShow=d||{};this.content.empty();window.addEvent("resize",this.bound.scrollMyWindow);if(Browser.isIE6()){window.addEvent("scroll",this.bound.scrollMyWindow);
}this.area.setStyle("display","block");this.content.setStyle("display","block");document.fireEvent("closeAllToolTips");var c=$H().extend(this.options.showParams).extend(b).extend(this.options.showParamsCalback?this.options.showParamsCalback.call(this):{});
if(this.options.showUrl.length>0){new Request({url:this.options.showUrl,onSuccess:function(f,h,g,e){this.content.set("html",f);if($("captchaImg")){$("captchaImg").src=URL("part/Captcha","num",(new Date).getTime());
}if($("dialogCancelButton")){$("dialogCancelButton").addEvent("click",this.bound.close);}var i=this.content.getElement(".dialogCancelButton");if(i){i.addEvent("click",this.bound.close);
}window.fireEvent("resize");this.fireEvent("onContentLoad");}.bind(this)}).post(c);}else{if(this.options.htmlContent){this.content.set("html",this.options.htmlContent);
window.fireEvent("resize");this.fireEvent("onContentLoad",c);}else{if(this.options.domContent){var a=this.options.domContent.clone(true,true);a.inject(this.content);
window.fireEvent("resize");this.fireEvent("onContentLoad",$H(c).extend({domContent:a}));}}}this.keyUpEvent=function(f){if(f.code==27){this.close();f.stop();
}}.bind(this);if(this.options.allowClose){document.addEvent("keyup",this.keyUpEvent);}},close:function(){window.removeEvent("resize",this.bound.scrollMyWindow);
if(Browser.isIE6()){window.removeEvent("scroll",this.bound.scrollMyWindow);}this.area.setStyle("display","none");this.content.setStyle("display","none");
if(this.options.allowClose){document.removeEvent("keyup",this.keyUpEvent);}},scrollMyWindow:function(){var a=(Browser.isIE6()*window.getScrollTop())+(window.getHeight()-this.content.getHeight())/2;
this.content.setStyles({top:a+"px","margin-left":"-"+(this.content.getWidth()/2)+"px"});this.area.setStyles({width:0,height:0});this.area.setStyles({width:window.getScrollWidth(),height:window.getScrollHeight()});
},send:function(a){new Request({url:this.options.sendUrl,onSuccess:function(c){if(c){var b=JSON.decode(c);this.onSend(b);}}.bind(this),onFailure:function(b){alert("Ein Fehler ist aufgetreten. Versuchen Sie bitte es zu einem spÃ¤teren Zeitpunkt");
}}).post($H().extend(this.options.sendParams).extend(this.sendParamsOnShow).extend(a).extend(this.options.sendParamsCalback?this.options.sendParamsCalback.call(this):{}));
},onSend:function(a){if(a.result=="ok"){this.fireEvent("send",a);this.close();}else{$("customDialogResultField").set("text",a.message);}window.fireEvent("resize");
}});var MailDialog=new Class({Extends:CustomFullDialog,Implements:[Events,Options],options:{},show:function(a){this.parent($extend(a.showParams||{},a.params),$extend(a.sendParams||{},a.params));
this.addEvent("onContentLoad",function(){if($("senderName")){$("senderName").focus();}else{if($("mailSubject")){$("mailSubject").focus();}else{if($("mailContent")){$("mailContent").focus();
}}}$("mailDialogForm").addEvent("onSendMail",this.bound.send);});},close:function(){this.parent();$("mailDialogForm").removeEvent("onSendMail",this.bound.send);
},send:function(){var a={mailContent:$("mailContent").value,captcha:$("captcha").value};if($("senderMail")){$extend(a,{senderMail:$("senderMail").value,senderName:$("senderName").value});
}if($("mailSubject")){a.subject=$("mailSubject").value;}if(this.options.getSendParams){$extend(a,this.options.getSendParams());}this.parent(a);},onSend:function(b){$("errorMessageLine").set("html","");
if(b.result=="ok"){this.fireEvent("onSend");this.close();}else{if(b.result=="error"){var a=new Element("ul",{styles:{margin:"3px","text-align":"left"}}).inject($("errorMessageLine"));
for(var c=0;c<b.errorReasons.length;c++){var d;switch(b.errorReasons[c]){case"noSenderMail":d="Geben Sie bitte Ihre EMail-Adresse ein";break;case"noSenderName":d="Geben Sie bitte Ihren Namen ein";
break;case"noSubject":d="Betreff erforderlich";break;case"noContent":d="EMail-Text erforderlich";break;case"noGratulation":d="Gratulationstext erforderlich";
break;case"wrongCaptcha":d="Geben Sie bitte den richtigen Verifikationscode ein";break;case"noValidRecipient":d="Der Empfänger ist nicht gültig";break;
case"noReason":d="Wählen Sie bitte den Reklamationsgrund.";break;default:d="Unbekannter Fehler["+b.errorReasons[c]+"]";}new Element("li").inject(a).set("html",d);
}}else{alert("Fehler");}}window.fireEvent("scroll");if(this.options.captchaUrl){$("captchaImg").src=URL(this.options.captchaUrl,"num",(new Date).getTime());
}}});var MediaGaleryDialog=new Class({Implements:[Events],initialize:function(){this.myAjax=null;this.zoom=Cookie.read("GaleryMediaFileZoom");this.zoom=this.zoom?this.zoom=="true":window.getSize().y>=800;
Cookie.write("GaleryMediaFileZoom",this.zoom,{path:"/"});this.desc=Cookie.read("GaleryMediaFileDesc");if(this.desc==null){this.desc="true";}this.desc=this.desc?this.desc=="true":this.desc;
Cookie.write("GaleryMediaFileDesc",this.desc,{path:"/"});this.mediaFilePK=0;this.prevMediaFilePK=0;this.nextMediaFilePK=0;this.index=0;this.count=0;this.build();
},build:function(){this.bound={updateOnResponse:this.updateOnResponse.bind(this),close:this.close.bind(this),keydown:this.keydown.bind(this),documentMouseUp:function(c){this.content.getFirst().fireEvent("mouseup",c);
}.bind(this)};this.area=new Element("div",{styles:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0","z-index":"1000","background-color":"black",display:"none"}}).inject(document.body);
this.content=new Element("div",{styles:{position:"absolute","background-color":"white",border:"2px white solid","z-index":"1001",overflow:"hidden",width:"0px",height:"0px",display:"none"}}).disableSelection().inject(document.body);
this.caption=new Element("div",{styles:{position:"absolute",width:"0px",height:"36px","padding-top":"5px",border:"2px white solid","background-color":"silver","z-index":"1001",display:"none"}}).disableSelection().inject(document.body);
this.buttonBox=new Element("div",{styles:{position:"absolute",left:"4px",top:"4px",margin:"1px","z-index":"1001"}}).inject(this.caption);this.downloadButton=new Element("a",{title:"Klicken Sie auf dieses Icon, um diese Datei in optimaler Qualität herunter zu laden.",styles:{"float":"left",background:"url("+ROOT_URL+"design/icons/32x32/filesave.png)",width:"32px",height:"32px",cursor:"pointer",display:"none"}}).inject(this.buttonBox);
this.resizeButton=new Element("img",{title:"Klicken Sie auf dieses Icon, um das Bild zu vergrößern oder zu verkleinern.",styles:{"float":"left",cursor:"pointer"}}).inject(this.buttonBox).addEvent("click",function(){this.zoom=!this.zoom;
Cookie.write("GaleryMediaFileZoom",this.zoom,{path:"/"});if(this.isImage){this._show(this.mediaFilePK);}else{this.updateOnResponse();}}.bind(this));this.descButton=new Element("img",{title:"Klicken Sie auf dieses Icon, um die Beschreibung zu aktivieren oder zu deaktivieren.",styles:{"float":"left",cursor:"pointer"}}).inject(this.buttonBox).addEvent("click",function(){this.desc=!this.desc;
Cookie.write("GaleryMediaFileDesc",this.desc,{path:"/"});this.updateOnResponse();}.bind(this));this.imgLeft=new Element("img",{src:ROOT_URL+"design/icons/32x32/1leftarrow.png",styles:{cursor:"pointer"}}).inject(this.caption);
this.information=new Element("span",{styles:{"font-weight":"bold",border:"1px white solid","background-color":"black",color:"white",opacity:"0.5",position:"relative",top:"-12px",margin:"0 5px 0 5px"}}).inject(this.caption).set("text","0/0");
this.imgRight=new Element("img",{src:ROOT_URL+"design/icons/32x32/1rightarrow.png",styles:{cursor:"pointer"}}).inject(this.caption);var b=new Element("div",{"class":"PopupCancelButton"}).inject(this.caption).addEvent("click",this.bound.close);
this.buttonArea=new Element("div",{styles:{position:"absolute",width:"0px",height:"50px",border:"2px white solid","background-color":"silver",overflow:"auto","z-index":"1001",display:"none"}}).inject(document.body);
this.progress=new Element("img",{src:ROOT_URL+"design/icons/progress/loading_animation_liferay.gif",styles:{position:"absolute",right:"25px",top:"5px"}}).inject(this.caption);
this.textDummy=new Element("div",{styles:{position:"absolute",left:"0px",top:"0px",border:"2px black solid",opacity:"0"}}).inject(document.body);this.imgLeft.addEvent("click",function(){if(this.prevMediaFilePK>0){this._show(this.prevMediaFilePK);
}}.bind(this));this.imgRight.addEvent("click",function(){if(this.nextMediaFilePK>0){this._show(this.nextMediaFilePK);}}.bind(this));var a=new Fx.Transition(Fx.Transitions.linear,1);
this.area.addEvent("click",function(){this.close();}.bind(this));this.updateOnResponse();},updateOnResponse:function(){this.area.setStyles({width:0,height:0});
this.area.setStyles({width:window.getScrollWidth(),height:window.getScrollHeight()});if(this.content.getChildren().length>0){this.progress.setStyle("display","none");
this.imgLeft.setStyle("opacity",this.index>0?1:0.3);this.imgRight.setStyle("opacity",this.index<this.count-1?1:0.3);var i=window.getSize();var g=min(this.width,i.x-20);
var c=max(g,350);this.textDummy.setStyle("width",g);this.textDummy.set("html",this.description);var h=this.desc?(this.textDummy.getSize().y<=100?this.textDummy.getSize().y:100):0;
var e=this.caption.getStyle("border-top-width").toInt()+this.caption.getStyle("border-bottom-width").toInt();var a=this.content.getStyle("border-top-width").toInt()+this.content.getStyle("border-bottom-width").toInt();
var f=this.buttonArea.getStyle("border-top-width").toInt()+this.buttonArea.getStyle("border-bottom-width").toInt();this.caption.setStyles({left:i.x/2-c/2+window.getScrollLeft(),top:window.getScrollTop()+1,width:c});
this.caption.setStyle("display","block");var d=min(this.height,i.y-this.caption.getSize().y-h-a-1-1-1-(h>0)*(1+f));this.content.setStyles({left:i.x/2-g/2+window.getScrollLeft(),top:this.caption.getTop()+1+this.caption.getSize().y,width:g,height:d,overflow:(this.width>g||this.height>d)?"auto":"hidden"});
this.content.setStyle("display","block");this.buttonArea.setStyles({left:i.x/2-g/2+window.getScrollLeft(),top:this.caption.getTop()+1+this.caption.getSize().y+1+this.content.getSize().y,width:g,height:h});
this.information.set("text",(this.index+1)+"/"+this.count);this.buttonArea.set("html",this.description);this.buttonArea.setStyle("display",this.desc?"block":"none");
if(this.isImage){var b=this.content.getFirst();b.removeEvents();window.removeEvent("mouseup",this.bound.documentMouseUp);if(this.width>g||this.height>d){b.setStyle("cursor","move");
b.addEvent("mousedown",function(j){j.stop();this.store("downPos",j.page);this.store("scrollPos",this.getParent().getScroll());this.store("down",true);}).addEvent("mouseup",function(j){j.stop();
this.eliminate("down");}).addEvent("mousemove",function(j){if(this.retrieve("down")){j.stop();this.getParent().scrollTo(this.retrieve("scrollPos").x+this.retrieve("downPos").x-j.page.x,this.retrieve("scrollPos").y+this.retrieve("downPos").y-j.page.y);
}});window.addEvent("mouseup",this.bound.documentMouseUp);}else{b.setStyle("cursor","default");}}this.downloadButton.setStyle("display",this.downloadAllowed?"block":"none");
this.downloadButton.setProperty("href",ROOT_URL+"part/MediaFileManager-action-download-mediaFilePK-"+this.mediaFilePK+"/");this.resizeButton.setProperty("src",ROOT_URL+"design/icons/32x32/"+(this.zoom?"window_nofullscreen.png":"window_fullscreen.png"));
this.descButton.setProperty("src",ROOT_URL+"design/icons/32x32/"+(this.desc?"empty.png":"document.png"));}},show:function(a){window.addEvent("resize",this.bound.updateOnResponse);
this.index=0;if(this.content.getChildren().length>0){this.content.empty();}this._show(a);},_show:function(a){if(this.myAjax){this.myAjax.cancel();}else{this.myAjax=new Request({url:ROOT_URL+"part/OutputImage.php"});
}this.myAjax.addEvent("success",function(d){if(d){var b=JSON.decode(d);this.mediaFilePK=b.mediaFilePK;this.prevMediaFilePK=b.prevMediaFilePK;this.nextMediaFilePK=b.nextMediaFilePK;
this.index=b.index.toInt();this.count=b.count;this.isImage=b.isImage;this.description=b.description;this.downloadAllowed=b.downloadAllowed;if(b.isFlash){this.width=b.width?b.width:400;
this.height=b.height?b.height:400;this.height+=30;if(this.content.getChildren().length>0){this.content.empty();}new Swiff(ROOT_URL+"java_scripts/video-player.swf?t="+new Date().getTime(),{width:this.width,height:this.height,autoPlay:true,container:this.content,params:{wMode:"window"},vars:{url:b.flashURL,autoPlay:true,autoRepeat:true,volume:30}});
this.updateOnResponse();}else{var c=new Asset.image(b.fileName,{onload:function(){if(this.content.getChildren().length>0){this.content.empty();}if(b.isDoc){c.setStyle("border",0);
c.inject(new Element("a",{href:b.dataUrl,target:"_blank"}).inject(this.content));}else{c.inject(this.content);}this.width=b.width;this.height=b.height;
this.updateOnResponse();}.bind(this)});}}}.bind(this));this.progress.setStyle("display","block");this.progress.src=ROOT_URL+"design/icons/progress/loading_animation_liferay.gif";
this.myAjax.post({action:"getMediaFileByIndex",mediaFilePK:a,zoom:this.zoom});this.area.setStyle("opacity",0.7);this.area.setStyle("display","block");document.addEvent("keydown",this.bound.keydown);
},close:function(){document.removeEvent("keydown",this.bound.keydown);window.removeEvent("resize",this.bound.updateOnResponse);this.area.setStyle("display","none");
this.caption.setStyle("display","none");this.content.setStyle("display","none");this.buttonArea.setStyle("display","none");},keydown:function(a){switch(a.code){case 27:this.close();
a.stop();break;case 37:this.imgLeft.fireEvent("click");a.stop();break;case 39:this.imgRight.fireEvent("click");a.stop();break;}}});