/* http://closure-compiler.appspot.com/home */
$(document).ready(function(){$("ul.menu li img").click(function(){$(this).parent().children("ul.sub-menu").slideDown("fast").show();$(this).parent().hover(function(){},function(){$(this).parent().find("ul.sub-menu").animate({opacity:"hide",height:"hide"},"slow")})});$("div.click-to-unfold").mousedown(function(){var a=$(this).attr("id"),a=a.substring(9);$("#hidden-content-"+a).fadeSliderToggle(800);return!1});$("input.button_show_attachment").mousedown(function(){$("div").find("#attachment-div").fadeSliderToggle(500)}); $("input.button_show_meta_info").mousedown(function(){$("div").find(".document-meta-info").fadeSliderToggle(500)});$("#display-done-changes").fadeOut(4E3);$.ajaxSetup({error:function(a,c){0==a.status?alert("Keine Internetverbindung!!\n Bitte \u00fcberpr\u00fcfe Deine Netzwerkeinstellungen."):404==a.status?alert("Die angeforderte Seite wurde nicht gefunden. Bitte sage Sebastian bescheid."):500==a.status?alert("Interner Server Fehler. Bitte sage Sebastian bescheid."):"parsererror"==c?alert("parsererror Fehler.\n Bitte sage Sebastian bescheid."): "timeout"==c?alert("Request Time out."):alert("Unbekannter Fehler.\n Bitte sage Sebastian bescheid"+a.responseText)}});$(function(){$("a[rel]").overlay({mask:{color:"#f3f9ee",speed:1E4,opacity:0.6},effect:"apple",onBeforeLoad:function(){this.getOverlay().find(".contentWrap").load(this.getTrigger().attr("href"))},onClose:function(){update_mainpage_after_popupclose()}})});$("#q").keyup(function(){$(".search_item").each(function(){var a=RegExp($("#q").val(),"i");$(this).children(".search_text")[0].innerHTML.match(a)? $(this).show():$(this).hide()})});$(".set_cursor").focus()});$(function(){$("#dob").val("");$("#search_client_name").autocomplete({source:"hidden/client_live_search.ajax.php",minLength:2,focus:function(a,c){$("#client_id").val(c.item.client_id);$("#dob").text("Geboren: "+c.item.dob)},select:function(a,c){$("#client_id").val(c.item.client_id);$("#dob").val("");$("#search_client_name").val(c.item.value);$("#autocomplete_search").val(1);$("#search_form").submit()}})}); jQuery.fn.fadeSliderToggle=function(a){a=jQuery.extend({speed:600,easing:"swing"},a);caller=this;"none"==$(caller).css("display")?$(caller).animate({opacity:1,height:"toggle"},a.speed,a.easing):$(caller).animate({opacity:0,height:"toggle"},a.speed,a.easing)};function changeText(a,c){document.getElementById(a).value=c} function toggle_button_text(a,c,e,k){if("none"==document.getElementById(c).style.display)document.getElementById(a).value=k;else if("block"==document.getElementById(c).style.display)document.getElementById(a).value=e}function checkDelete(a,c){submitBool=confirm(unescape("Wollen Sie "+a+" wirklich l%F6schen? Diese Aktion kann nicht r\u00fcckg\u00e4ngig gemacht werden."));if(!1==submitBool)return!1;location.href=c;return!0} function checkContentBeing(a,c){if(""==a.being_name.value)return alert(c+" darf nicht leer sein"),a.being_name.focus(),!1}function checkContentLink(a){return""==a.link.value||""==a.heading.value?(alert("Keines der beiden Felder darf leer sein"),a.link.focus(),!1):!0} $.fn.loadText=function(a,c){return this.each(function(){var e=$(this);e.fadeOut("slow",function(){e.empty().html(random_array(a));e.fadeIn("slow")});timeOut=setTimeout(function(){e.loadText(a,c)},c);$("#text-reload").click(function(){e.is(":animated")||(clearTimeout(timeOut),e.loadText(a,c))})})};function random_array(a){var c=Math.floor(Math.random()*a.length+a.length);return a[c-a.length]}function update_mainpage_after_popupclose(){} function enable_save_button(){fire_save_function=!0;$("#save_button").val("Speichern")}function disable_save_button(){$("#save_button").val("Gespeichert");fire_save_function=!1}function tinymce_focus(){$(".defaultSkin table.mceLayout").css({"border-color":"#A967D5"});$(".defaultSkin table.mceLayout tr.mceFirst td").css({"border-top-color":"#A967D5"});$(".defaultSkin table.mceLayout tr.mceLast td").css({"border-bottom-color":"#A967D5"})} function tinymce_blur(){$(".defaultSkin table.mceLayout").css({"border-color":"#e0e0e0"});$(".defaultSkin table.mceLayout tr.mceFirst td").css({"border-top-color":"#e0e0e0"});$(".defaultSkin table.mceLayout tr.mceLast td").css({"border-bottom-color":"#e0e0e0"})}var qTipTag="a,label,input,tr,td,img,button,select,textarea,div",qTipX=0,qTipY=15;tooltip={name:"qTip",offsetX:qTipX,offsetY:qTipY,tip:null}; tooltip.init=function(){if(!a)var a="qTip";var c=document.getElementById(a);c||(c=document.createElementNS?document.createElementNS("http://www.w3.org/1999/xhtml","div"):document.createElement("div"),c.setAttribute("id",a),document.getElementsByTagName("body").item(0).appendChild(c));if(document.getElementById){if(this.tip=document.getElementById(this.name))document.onmousemove=function(a){tooltip.move(a)};for(var e,k=qTipTag.split(","),i=0;i<k.length;i++)if(e=document.getElementsByTagName(k[i]))for(var j= 0;j<e.length;j++)if(a=e[j],c=a.getAttribute("title"))a.setAttribute("tiptitle",c),a.removeAttribute("title"),a.removeAttribute("alt"),a.onmouseover=function(){tooltip.show(this.getAttribute("tiptitle"))},a.onmouseout=function(){tooltip.hide()}}}; tooltip.move=function(a){var c=0,e=0;document.all?(c=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,e=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,c+=window.event.clientX,e+=window.event.clientY):(c=a.pageX,e=a.pageY);this.tip.style.left=c+this.offsetX+"px";this.tip.style.top=e+this.offsetY+"px"}; tooltip.show=function(a){if(this.tip)this.tip.innerHTML=a,this.tip.style.display="block"};tooltip.hide=function(){if(this.tip)this.tip.innerHTML="",this.tip.style.display="none"};window.onload=function(){tooltip.init()}; (function(a){function c(i,j){var g=this,c=i.add(g),n=a(window),f,l,m,d=a.tools.expose&&(j.mask||j.expose),b=Math.random().toString().slice(10);d&&("string"==typeof d&&(d={color:d}),d.closeOnClick=d.closeOnEsc=!1);var h=j.target||i.attr("rel");l=h?a(h):i;if(!l.length)throw"Could not find Overlay: "+h;i&&-1==i.index(l)&&i.click(function(a){g.load(a);return a.preventDefault()});a.extend(g,{load:function(h){if(g.isOpened())return g;var f=k[j.effect];if(!f)throw'Overlay: cannot find effect : "'+j.effect+ '"';j.oneInstance&&a.each(e,function(){this.close(h)});h=h||a.Event();h.type="onBeforeLoad";c.trigger(h);if(h.isDefaultPrevented())return g;m=!0;d&&a(l).expose(d);var i=j.top,p=j.left,q=l.outerWidth({margin:!0}),r=l.outerHeight({margin:!0});"string"==typeof i&&(i="center"==i?Math.max((n.height()-r)/2,0):parseInt(i,10)/100*n.height());"center"==p&&(p=Math.max((n.width()-q)/2,0));f[0].call(g,{top:i,left:p},function(){m&&(h.type="onLoad",c.trigger(h))});d&&j.closeOnClick&&a.mask.getMask().one("click", g.close);j.closeOnClick&&a(document).bind("click."+b,function(d){a(d.target).parents(l).length||g.close(d)});j.closeOnEsc&&a(document).bind("keydown."+b,function(a){27==a.keyCode&&g.close(a)});return g},close:function(h){if(!g.isOpened())return g;h=h||a.Event();h.type="onBeforeClose";c.trigger(h);if(!h.isDefaultPrevented())return m=!1,k[j.effect][1].call(g,function(){h.type="onClose";c.trigger(h)}),a(document).unbind("click."+b).unbind("keydown."+b),d&&a.mask.close(),g},getOverlay:function(){return l}, getTrigger:function(){return i},getClosers:function(){return f},isOpened:function(){return m},getConf:function(){return j}});a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(d,h){a.isFunction(j[h])&&a(g).bind(h,j[h]);g[h]=function(d){d&&a(g).bind(h,d);return g}});f=l.find(j.close||".close");!f.length&&!j.close&&(f=a('<a class="close"></a>'),l.prepend(f));f.click(function(a){g.close(a)});j.load&&g.load()}a.tools=a.tools||{version:"v1.2.5"};a.tools.overlay={addEffect:function(a, c,g){k[a]=[c,g]},conf:{close:null,closeOnClick:!0,closeOnEsc:!0,closeSpeed:"fast",effect:"default",fixed:!a.browser.msie||6<a.browser.version,left:"center",load:!1,mask:null,oneInstance:!0,speed:"normal",target:null,top:"10%"}};var e=[],k={};a.tools.overlay.addEffect("default",function(i,c){var g=this.getConf(),e=a(window);g.fixed||(i.top+=e.scrollTop(),i.left+=e.scrollLeft());i.position=g.fixed?"fixed":"absolute";this.getOverlay().css(i).fadeIn(g.speed,c)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed, a)});a.fn.overlay=function(i){var j=this.data("overlay");if(j)return j;a.isFunction(i)&&(i={onBeforeLoad:i});i=a.extend(!0,{},a.tools.overlay.conf,i);this.each(function(){j=new c(a(this),i);e.push(j);a(this).data("overlay",j)});return i.api?j:this}})(jQuery); (function(a){function c(a){var c=a.offset();return{top:c.top+a.height()/2,left:c.left+a.width()/2}}var e=a.tools.overlay,k=a(window);a.extend(e.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});e.addEffect("apple",function(i,j){var g=this.getOverlay(),e=this.getConf(),n=this.getTrigger(),f=this,l=g.outerWidth({margin:!0}),m=g.data("img"),d=e.fixed?"fixed":"absolute";if(!m){var b=g.css("backgroundImage");if(!b)throw"background-image CSS property not set for overlay";b=b.slice(b.indexOf("(")+ 1,b.indexOf(")")).replace(/\"/g,"");g.css("backgroundImage","none");m=a('<img src="'+b+'"/>');m.css({border:0,display:"none"}).width(l);a("body").append(m);g.data("img",m)}var b=e.start.top||Math.round(k.height()/2),h=e.start.left||Math.round(k.width()/2);if(n)n=c(n),b=n.top,h=n.left;e.fixed?(b-=k.scrollTop(),h-=k.scrollLeft()):(i.top+=k.scrollTop(),i.left+=k.scrollLeft());m.css({position:"absolute",top:b,left:h,width:0,zIndex:e.zIndex}).show();i.position=d;g.css(i);m.animate({top:g.css("top"),left:g.css("left"), width:l},e.speed,function(){g.css("zIndex",e.zIndex+1).fadeIn(e.fadeInSpeed,function(){f.isOpened()&&!a(this).index(g)?j.call():g.hide()})}).css("position",d)},function(i){var e=this.getOverlay().hide(),g=this.getConf(),o=this.getTrigger(),e=e.data("img"),n={top:g.start.top,left:g.start.left,width:0};o&&a.extend(n,c(o));g.fixed&&e.css({position:"absolute"}).animate({top:"+="+k.scrollTop(),left:"+="+k.scrollLeft()},0);e.animate(n,g.closeSpeed,i)})})(jQuery); (function(a){function c(){if(a.browser.msie){var f=a(document).height(),c=a(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,20>f-c?c:f]}return[a(document).width(),a(document).height()]}function e(f){if(f)return f.call(a.mask)}a.tools=a.tools||{version:"v1.2.5"};var k;k=a.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}}; var i,j,g,o,n;a.mask={load:function(f,l){if(g)return this;"string"==typeof f&&(f={color:f});f=f||o;o=f=a.extend(a.extend({},k.conf),f);i=a("#"+f.maskId);i.length||(i=a("<div/>").attr("id",f.maskId),a("body").append(i));var m=c();i.css({position:"absolute",top:0,left:0,width:m[0],height:m[1],display:"none",opacity:f.startOpacity,zIndex:f.zIndex});f.color&&i.css("backgroundColor",f.color);if(!1===e(f.onBeforeLoad))return this;f.closeOnEsc&&a(document).bind("keydown.mask",function(d){27==d.keyCode&& a.mask.close(d)});f.closeOnClick&&i.bind("click.mask",function(d){a.mask.close(d)});a(window).bind("resize.mask",function(){a.mask.fit()});l&&l.length&&(n=l.eq(0).css("zIndex"),a.each(l,function(){var d=a(this);/relative|absolute|fixed/i.test(d.css("position"))||d.css("position","relative")}),j=l.css({zIndex:Math.max(f.zIndex+1,"auto"==n?0:n)}));i.css({display:"block"}).fadeTo(f.loadSpeed,f.opacity,function(){a.mask.fit();e(f.onLoad);g="full"});g=!0;return this},close:function(){if(g){if(!1===e(o.onBeforeClose))return this; i.fadeOut(o.closeSpeed,function(){e(o.onClose);j&&j.css({zIndex:n});g=!1});a(document).unbind("keydown.mask");i.unbind("click.mask");a(window).unbind("resize.mask")}return this},fit:function(){if(g){var a=c();i.css({width:a[0],height:a[1]})}},getMask:function(){return i},isLoaded:function(a){return a?"full"==g:g},getConf:function(){return o},getExposed:function(){return j}};a.fn.mask=function(c){a.mask.load(c);return this};a.fn.expose=function(c){a.mask.load(c,this);return this}})(jQuery); (function(a){function c(d,b,h){var c=d.offset().top,g=d.offset().left,f=h.position.split(/,?\s+/),i=f[0],f=f[1];c-=b.outerHeight()-h.offset[0];g+=d.outerWidth()+h.offset[1];/iPad/i.test(navigator.userAgent)&&(c-=a(window).scrollTop());h=b.outerHeight()+d.outerHeight();"center"==i&&(c+=h/2);"bottom"==i&&(c+=h);d=d.outerWidth();"center"==f&&(g-=(d+b.outerWidth())/2);"left"==f&&(g-=d);return{top:c,left:g}}function e(a){function b(){return this.getAttribute("type")==a}b.key="[type="+a+"]";return b}function k(d, b,h){function i(d,b,c){if(h.grouped||!d.length){var e;!1===c||a.isArray(c)?(e=f.messages[b.key||b]||f.messages["*"],e=e[h.lang]||f.messages["*"].en,(b=e.match(/\$\d/g))&&a.isArray(c)&&a.each(b,function(a){e=e.replace(this,c[a])})):e=c[h.lang]||c;d.push(e)}}var e=this,j=b.add(e),d=d.not(":button, :image, :reset, :submit");a.extend(e,{getConf:function(){return h},getForm:function(){return b},getInputs:function(){return d},reflow:function(){d.each(function(){var d=a(this),b=d.data("msg.el");b&&(d=c(d, b,h),b.css({top:d.top,left:d.left}))});return e},invalidate:function(b,c){if(!c){var g=[];a.each(b,function(a,b){var c=d.filter("[name='"+a+"']");c.length&&(c.trigger("OI",[b]),g.push({input:c,messages:[b]}))});b=g;c=a.Event()}c.type="onFail";j.trigger(c,[b]);c.isDefaultPrevented()||m[h.effect][0].call(e,b,c);return e},reset:function(b){b=b||d;b.removeClass(h.errorClass).each(function(){var d=a(this).data("msg.el");d&&(d.remove(),a(this).data("msg.el",null))}).unbind(h.errorInputEvent||"");return e}, destroy:function(){b.unbind(h.formEvent+".V").unbind("reset.V");d.unbind(h.inputEvent+".V").unbind("change.V");return e.reset()},checkValidity:function(b,c){b=b||d;b=b.not(":disabled");if(!b.length)return!0;c=c||a.Event();c.type="onBeforeValidate";j.trigger(c,[b]);if(c.isDefaultPrevented())return c.result;var f=[];b.not(":radio:not(:checked)").each(function(){var b=[],d=a(this).data("messages",b),k=g&&d.is(":date")?"onHide.v":h.errorInputEvent+".v";d.unbind(k);a.each(l,function(){var a=this[0];if(d.filter(a).length){var g= this[1].call(e,d,d.val());if(!0!==g){c.type="onBeforeFail";j.trigger(c,[d,a]);if(c.isDefaultPrevented())return!1;var f=d.attr(h.messageAttr);if(f)return b=[f],!1;i(b,a,g)}}});b.length&&(f.push({input:d,messages:b}),d.trigger("OI",[b]),h.errorInputEvent&&d.bind(k,function(a){e.checkValidity(d,a)}));if(h.singleError&&f.length)return!1});var k=m[h.effect];if(!k)throw'Validator: cannot find effect "'+h.effect+'"';if(f.length)return e.invalidate(f,c),!1;k[1].call(e,b,c);c.type="onSuccess";j.trigger(c, [b]);b.unbind(h.errorInputEvent+".v");return!0}});a.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","),function(b,d){a.isFunction(h[d])&&a(e).bind(d,h[d]);e[d]=function(b){b&&a(e).bind(d,b);return e}});h.formEvent&&b.bind(h.formEvent+".V",function(a){if(!e.checkValidity(null,a))return a.preventDefault()});b.bind("reset.V",function(){e.reset()});d[0]&&d[0].validity&&d.each(function(){this.oninvalid=function(){return!1}});b[0]&&(b[0].checkValidity=e.checkValidity);h.inputEvent&&d.bind(h.inputEvent+ ".V",function(d){e.checkValidity(a(this),d)});d.filter(":checkbox, select").filter("[required]").bind("change.V",function(d){var b=a(this);(this.checked||b.is("select")&&a(this).val())&&m[h.effect][1].call(e,b,d)});var k=d.filter(":radio").change(function(a){e.checkValidity(k,a)});a(window).resize(function(){e.reflow()})}a.tools=a.tools||{version:"v1.2.5"};var i=/\[type=([a-z]+)\]/,j=/^-?[0-9]*(\.[0-9]+)?$/,g=a.tools.dateinput,o=/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,n=/^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i, f;f=a.tools.validator={conf:{grouped:!1,effect:"default",errorClass:"invalid",inputEvent:null,errorInputEvent:"keyup",formEvent:"submit",lang:"en",message:"<div/>",messageAttr:"data-message",messageClass:"error",offset:[0,0],position:"center right",singleError:!1,speed:"normal"},messages:{"*":{en:"Please correct this value"}},localize:function(d,b){a.each(b,function(a,b){f.messages[a]=f.messages[a]||{};f.messages[a][d]=b})},localizeFn:function(d,b){f.messages[d]=f.messages[d]||{};a.extend(f.messages[d], b)},fn:function(d,b,c){a.isFunction(b)?c=b:("string"==typeof b&&(b={en:b}),this.messages[d.key||d]=b);b=i.exec(d);b&&(d=e(b[1]));l.push([d,c])},addEffect:function(a,b,c){m[a]=[b,c]}};var l=[],m={"default":[function(d){var b=this.getConf();a.each(d,function(d,e){var g=e.input;g.addClass(b.errorClass);var f=g.data("msg.el");f||(f=a(b.message).addClass(b.messageClass).appendTo(document.body),g.data("msg.el",f));f.css({visibility:"hidden"}).find("p").remove();a.each(e.messages,function(b,d){a("<p/>").html(d).appendTo(f)}); f.outerWidth()==f.parent().width()&&f.add(f.find("p")).css({display:"inline"});g=c(g,f,b);f.css({visibility:"visible",position:"absolute",top:g.top,left:g.left}).fadeIn(b.speed)})},function(d){var b=this.getConf();d.removeClass(b.errorClass).each(function(){var b=a(this).data("msg.el");b&&b.css({visibility:"hidden"})})}]};a.each("email,url,number".split(","),function(d,b){a.expr[":"][b]=function(a){return a.getAttribute("type")===b}});a.fn.oninvalid=function(a){return this[a?"bind":"trigger"]("OI", a)};f.fn(":email","Please enter a valid email address",function(a,b){return!b||o.test(b)});f.fn(":url","Please enter a valid URL",function(a,b){return!b||n.test(b)});f.fn(":number","Please enter a numeric value.",function(a,b){return j.test(b)});f.fn("[max]","Please enter a value smaller than $1",function(a,b){if(""===b||g&&a.is(":date"))return!0;var c=a.attr("max");return parseFloat(b)<=parseFloat(c)?!0:[c]});f.fn("[min]","Please enter a value larger than $1",function(a,b){if(""===b||g&&a.is(":date"))return!0; var c=a.attr("min");return parseFloat(b)>=parseFloat(c)?!0:[c]});f.fn("[required]","Please complete this mandatory field.",function(a,b){return a.is(":checkbox")?a.is(":checked"):b});f.fn("[pattern]",function(a){return RegExp("^"+a.attr("pattern")+"$").test(a.val())});a.fn.validator=function(c){var b=this.data("validator");b&&(b.destroy(),this.removeData("validator"));c=a.extend(!0,{},f.conf,c);if(this.is("form"))return this.each(function(){var e=a(this);b=new k(e.find(":input"),e,c);e.data("validator", b)});b=new k(this,this.eq(0).closest("form"),c);return this.data("validator",b)}})(jQuery); jQuery(function(a){a.datepicker.regional.de={closeText:"schlie\u00dfen",prevText:"&#x3c;zur\u00fcck",nextText:"Vor&#x3e;",currentText:"heute",monthNames:"Januar,Februar,M\u00e4rz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember".split(","),monthNamesShort:"Jan,Feb,M\u00e4r,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez".split(","),dayNames:"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag".split(","),dayNamesShort:"So,Mo,Di,Mi,Do,Fr,Sa".split(","),dayNamesMin:"So,Mo,Di,Mi,Do,Fr,Sa".split(","), weekHeader:"Wo",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};a.datepicker.setDefaults(a.datepicker.regional.de)});
