function getposOffset(g,h){var e=(h=="left")?g.offsetLeft:g.offsetTop;var f=g.offsetParent;while(f!=null){e=(h=="left")?e+f.offsetLeft:e+f.offsetTop;f=f.offsetParent}return e}function offsetTop(c){var d=0;while(c!=null){d+=c.offsetTop;c=c.offsetParent}return d}function offsetLeft(c){var d=0;while(c!=null){d+=c.offsetLeft;c=c.offsetParent}return d}function drawMultiRadiantCircle(d,g,h,e,c){$(d).prop("width",g*2);$(d).prop("height",h*2);var b=$(d).get(0);var a=b.getContext("2d");c=c?c+(100-c)/10:0;e=e-5;var f=(c)/100*360*(Math.PI/180);a.beginPath();a.strokeStyle="#c3da4e";a.arc(g,h,e,1.5*Math.PI,1.5*Math.PI+f);a.lineWidth=10;a.stroke();a.beginPath();a.strokeStyle="#e9564e";a.arc(g,h,e,f-Math.PI/2,2*Math.PI-Math.PI/2);a.stroke()}var destinations=new Array(1);var http_requests=new Array(1);var http_funcs=new Array(1);http_requests[0]=false;destinations[0]="";function makePOSTRequest(d,f,e){mainPOSTRequest(d,f,e,null)}function mainPOSTRequest(l,j,e,h){var k=0;while((http_requests[k]!=null)){k++}http_requests[k]=false;destinations[k]=e;http_funcs[k]=h;if(window.XMLHttpRequest){http_requests[k]=new XMLHttpRequest();if(http_requests[k].overrideMimeType){http_requests[k].overrideMimeType("text/html")}}else{if(window.ActiveXObject){try{http_requests[k]=new ActiveXObject("Msxml2.XMLHTTP")}catch(i){try{http_requests[k]=new ActiveXObject("Microsoft.XMLHTTP")}catch(i){}}}}if(!http_requests[k]){alert("Cannot create XMLHTTP instance "+k);return false}http_requests[k].open("POST",l,true);http_requests[k].setRequestHeader("Content-type","application/x-www-form-urlencoded");http_requests[k].send(j);http_requests[k].onreadystatechange=alertContents}function alertContents(){var b=0;for(b=0;b .layer");if(!d.length){return false}var a=d.width();var b=d.height();var c=d.offset();var d=$("
");d.prop("id","ufly");d.addClass("ufly");d.css({width:a,height:b,top:c.top,left:c.left});$("body").append(d);var c=$("header .menu").offset();$("#ufly").animate({left:c.left+150,top:c.top+10,width:10,height:10},500,function(){$(this).remove()});return false},refresh:function(a){if(typeof(a)=="undefined"){a=""}if(!a){a=document.location.href}document.location.href=a;return false},set:function(a){users.callbackFunction=a;return false},callback:function(){if(users.callbackFunction){users.callbackFunction();users.callbackFunction=false}users.usermenu();users.fly();users.close();return false},error:function(a,b){if(!a){a=""}if(typeof(b)=="object"){$.each(b,function(d,c){$('#layer form [name="'+d+'"]').addClass("error");if(c){a+=c+"
"}})}if(a){$("#layer .alert").html(a);$("#layer .alert").show()}else{$("#layer .alert").hide();$("#layer .error").removeClass("error")}return false},login:{show:function(){layer.create();layer.copy($("#login-layer"));layer.center();layer.show();return false},enter:function(){layer.wait();users.error(false);var a=$("#layer form").serialize();$.post("/ajax.php?layer-login",a,null,"json").done(function(b){if(b.status=="DONE"){users.callback()}else{if(b.status=="ERROR"){users.error(false,b.errors)}else{if(b.status=="FAIL"){users.error(b.msg)}else{alert("System error!")}}}layer.wait(false)}).fail(function(){layer.wait(false);alert("System error!")});return false},social:{facebook:function(){var a=window.open("/login-facebook?run","facebookLoginWin","width=900,height=500,top=20,left="+(Math.round($(document).width()/2)-450));a.focus();return false},yahoo:function(){var a=window.open("/login-yahoo?run","yahooLoginWin","width=900,height=500,top=20,left="+(Math.round($(document).width()/2)-450));a.focus();return false},twitter:function(){var a=window.open("/login-twitter?run","twitterLoginWin","width=900,height=500,top=20,left="+(Math.round($(document).width()/2)-450));a.focus();return false},google:function(){var a=window.open("/login-google?run","googleLoginWin","width=900,height=500,top=20,left="+(Math.round($(document).width()/2)-450));a.focus();return false},linkedin:function(){var a=window.open("/login-linkedin?run","linkedinLoginWin","width=900,height=500,top=20,left="+(Math.round($(document).width()/2)-450));a.focus();return false}}},reg:{show:function(){layer.create();layer.copy($("#reg-layer"));layer.center();layer.show();grecaptcha.render($("#layer .recaptcha").get(0),{sitekey:"6Ld6CwoTAAAAAJhpbivfhiMnwOfRAwayglj_HN0U"});return false},step:function(){layer.wait();users.error(false);var a=$("#layer form").serialize();$.post("/ajax.php?layer-reg&step",a,null,"json").done(function(b){if(b.status=="DONE"){$("#layer .reg-layer .step").toggle()}else{if(b.status=="ERROR"){users.error(false,b.errors)}else{if(b.status=="FAIL"){users.error(b.msg)}else{alert("System error!")}}}layer.wait(false)}).fail(function(){layer.wait(false);alert("System error!")});return false},enter:function(){layer.wait();users.error(false);var a=$("#layer form").serialize();$.post("/ajax.php?layer-reg",a,null,"json").done(function(b){if(b.status=="DONE"){users.callback()}else{if(b.status=="ERROR"){users.error(false,b.errors)}else{if(b.status=="FAIL"){users.error(b.msg)}else{alert("System error!")}}}layer.wait(false)}).fail(function(){layer.wait(false);alert("System error!")});return false},skip:function(){$('#layer [name="skip"]').val("1");users.reg.enter();return false}},reset:{show:function(){layer.create();layer.copy($("#reset-layer"));layer.center();layer.show();return false},enter:function(){layer.wait();users.error(false);var a=$("#layer form").serialize();$.post("/ajax.php?layer-reset",a,null,"json").done(function(b){if(b.status=="DONE"){users.close()}else{if(b.status=="ERROR"){users.error(false,b.errors)}else{if(b.status=="FAIL"){users.error(b.msg)}else{alert("System error!")}}}layer.wait(false)}).fail(function(){layer.wait(false);alert("System error!")});return false}},socialback:{show:function(){layer.create();layer.copy($("#socialback-layer"));layer.center();layer.show();users.socialback.fill();return false},fill:function(){layer.wait();$.get("/ajax.php?layer-socialback&fill",null,null,"json").done(function(a){if(a){$('#layer form [name="email"]').val(a.email);$('#layer form [name="displayname"]').val(a.displayname)}layer.wait(false)}).fail(function(){layer.wait(false);alert("System error!")});return false},enter:function(){layer.wait();users.error(false);var a=$("#layer form").serialize();$.post("/ajax.php?layer-socialback",a,null,"json").done(function(b){if(b.status=="DONE"){users.callback()}else{if(b.status=="ERROR"){users.error(false,b.errors)}else{if(b.status=="FAIL"){users.error(b.msg)}else{alert("System error!")}}}layer.wait(false)}).fail(function(){layer.wait(false);alert("System error!")});return false}},close:function(){users.set(false);layer.hide(true);return false}};var layer={get:function(a){$.ajax({url:a,async:false}).done(function(b){layer.copy(b)})},copy:function(a){if(typeof(a)=="object"){a=$(a).html()}$("#layer").html(a);return false},load:function(a){if(typeof(a)=="undefined"){a=true}if(a==null){a=true}if(a){$("#layer").html("");var b=$("
");b.addClass("loading-layer");b.addClass("layer");$("#layer").append(b)}else{$("#layer .loading-layer").remove()}return false},wait:function(a){if(typeof(a)=="undefined"){a=true}if(a==null){a=true}if(a){var b=$("
");b.addClass("waiting-layer");$("#layer > div").append(b)}else{$("#layer .waiting-layer").remove()}return false},close:function(){layer.create(false);return false},overlay:function(a){if(typeof(a)=="undefined"){a=true}if(a==null){a=true}if(a){if(!$("#layer-overlay").length){var b=$("
");b.prop("id","layer-overlay");b.on("click.overlay",function(){layer.hide(true)});$("body").append(b);$(".blur").addClass("overlay-blur")}}else{$(".overlay-blur").removeClass("overlay-blur");$("#layer-overlay").remove()}return false},create:function(){if($("#layer").length){return false}var a=$("
");a.prop("id","layer");a.attr("style","display:none");$("body").append(a);return false},destroy:function(){$("#layer").remove();return false},show:function(){layer.overlay();setTimeout("layer.center()",10);$("#layer").fadeIn(400,function(){layer.center()});return false},hide:function(a,b){$("#layer").fadeOut(400,function(){layer.overlay(false);if(typeof(a)!="undefined"&&a){layer.destroy()}if(typeof(b)!="undefined"){b()}});return false},clear:function(){$("#layer").html();return false},center:function(){var d=$("#layer .layer");if(!d.length){return false}var c=d.height();var a=$(window).height();if(c>a){b=parseInt($(window).scrollTop());b=b+(c/2)+10}else{var b=a/2;if(b<1){b=10}b=b+parseInt($(window).scrollTop())}d.css("top",b+"px");if(d.offset().top<0){d.offset({top:10})}return false}};(function(a){if(typeof define==="function"&&define.amd){define(["jquery","jquery.ui.widget"],a)}else{if(typeof exports==="object"){a(require("jquery"),require("./vendor/jquery.ui.widget"))}else{a(window.jQuery)}}}(function(b){b.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||b('').prop("disabled"));b.support.xhrFileUpload=!!(window.ProgressEvent&&window.FileReader);b.support.xhrFormDataFileUpload=!!window.FormData;b.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);function a(c){var d=c==="dragover";return function(g){g.dataTransfer=g.originalEvent&&g.originalEvent.dataTransfer;var f=g.dataTransfer;if(f&&b.inArray("Files",f.types)!==-1&&this._trigger(c,b.Event(c,{delegatedEvent:g}))!==false){g.preventDefault();if(d){f.dropEffect="copy"}}}}b.widget("blueimp.fileupload",{options:{dropZone:b(document),pasteZone:undefined,fileInput:undefined,replaceFileInput:true,paramName:undefined,singleFileUploads:true,limitMultiFileUploads:undefined,limitMultiFileUploadSize:undefined,limitMultiFileUploadSizeOverhead:512,sequentialUploads:false,limitConcurrentUploads:undefined,forceIframeTransport:false,redirect:undefined,redirectParamName:undefined,postMessage:undefined,multipart:true,maxChunkSize:undefined,uploadedBytes:undefined,recalculateProgress:true,progressInterval:100,bitrateInterval:500,autoUpload:true,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(d,c){d=this.messages[d]||d.toString();if(c){b.each(c,function(e,f){d=d.replace("{"+e+"}",f)})}return d},formData:function(c){return c.serializeArray()},add:function(d,c){if(d.isDefaultPrevented()){return false}if(c.autoUpload||(c.autoUpload!==false&&b(this).fileupload("option","autoUpload"))){c.process().done(function(){c.submit()})}},processData:false,contentType:false,cache:false,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:b.support.blobSlice&&function(){var c=this.slice||this.webkitSlice||this.mozSlice;return c.apply(this,arguments)},_BitrateTimer:function(){this.timestamp=((Date.now)?Date.now():(new Date()).getTime());this.loaded=0;this.bitrate=0;this.getBitrate=function(e,d,c){var f=e-this.timestamp;if(!this.bitrate||!c||f>c){this.bitrate=(d-this.loaded)*(1000/f)*8;this.loaded=d;this.timestamp=e}return this.bitrate}},_isXHRUpload:function(c){return !c.forceIframeTransport&&((!c.multipart&&b.support.xhrFileUpload)||b.support.xhrFormDataFileUpload)},_getFormData:function(c){var d;if(b.type(c.formData)==="function"){return c.formData(c.form)}if(b.isArray(c.formData)){return c.formData}if(b.type(c.formData)==="object"){d=[];b.each(c.formData,function(e,f){d.push({name:e,value:f})});return d}return[]},_getTotal:function(d){var c=0;b.each(d,function(e,f){c+=f.size||1});return c},_initProgressObject:function(d){var c={loaded:0,total:0,bitrate:0};if(d._progress){b.extend(d._progress,c)}else{d._progress=c}},_initResponseObject:function(c){var d;if(c._response){for(d in c._response){if(c._response.hasOwnProperty(d)){delete c._response[d]}}}else{c._response={}}},_onProgress:function(g,f){if(g.lengthComputable){var d=((Date.now)?Date.now():(new Date()).getTime()),c;if(f._time&&f.progressInterval&&(d-f._time").prop("href",c.url).prop("host");c.dataType="iframe "+(c.dataType||"");c.formData=this._getFormData(c);if(c.redirect&&d&&d!==location.host){c.formData.push({name:c.redirectParamName||"redirect",value:c.redirect})}},_initDataSettings:function(c){if(this._isXHRUpload(c)){if(!this._chunkedUpload(c,true)){if(!c.data){this._initXHRData(c)}this._initProgressListener(c)}if(c.postMessage){c.dataType="postmessage "+(c.dataType||"")}}else{this._initIframeSettings(c)}},_getParamName:function(c){var d=b(c.fileInput),e=c.paramName;if(!e){e=[];d.each(function(){var f=b(this),g=f.prop("name")||"files[]",h=(f.prop("files")||[1]).length;while(h){e.push(g);h-=1}});if(!e.length){e=[d.prop("name")||"files[]"]}}else{if(!b.isArray(e)){e=[e]}}return e},_initFormSettings:function(c){if(!c.form||!c.form.length){c.form=b(c.fileInput.prop("form"));if(!c.form.length){c.form=b(this.options.fileInput.prop("form"))}}c.paramName=this._getParamName(c);if(!c.url){c.url=c.form.prop("action")||location.href}c.type=(c.type||(b.type(c.form.prop("method"))==="string"&&c.form.prop("method"))||"").toUpperCase();if(c.type!=="POST"&&c.type!=="PUT"&&c.type!=="PATCH"){c.type="POST"}if(!c.formAcceptCharset){c.formAcceptCharset=c.form.attr("accept-charset")}},_getAJAXSettings:function(d){var c=b.extend({},this.options,d);this._initFormSettings(c);this._initDataSettings(c);return c},_getDeferredState:function(c){if(c.state){return c.state()}if(c.isResolved()){return"resolved"}if(c.isRejected()){return"rejected"}return"pending"},_enhancePromise:function(c){c.success=c.done;c.error=c.fail;c.complete=c.always;return c},_getXHRPromise:function(f,e,d){var c=b.Deferred(),g=c.promise();e=e||this.options.context||g;if(f===true){c.resolveWith(e,d)}else{if(f===false){c.rejectWith(e,d)}}g.abort=c.promise;return this._enhancePromise(g)},_addConvenienceMethods:function(g,f){var d=this,c=function(e){return b.Deferred().resolveWith(d,e).promise()};f.process=function(h,e){if(h||e){f._processQueue=this._processQueue=(this._processQueue||c([this])).pipe(function(){if(f.errorThrown){return b.Deferred().rejectWith(d,[f]).promise()}return c(arguments)}).pipe(h,e)}return this._processQueue||c([this])};f.submit=function(){if(this.state()!=="pending"){f.jqXHR=this.jqXHR=(d._trigger("submit",b.Event("submit",{delegatedEvent:g}),this)!==false)&&d._onSend(g,this)}return this.jqXHR||d._getXHRPromise()};f.abort=function(){if(this.jqXHR){return this.jqXHR.abort()}this.errorThrown="abort";d._trigger("fail",null,this);return d._getXHRPromise(false)};f.state=function(){if(this.jqXHR){return d._getDeferredState(this.jqXHR)}if(this._processQueue){return d._getDeferredState(this._processQueue)}};f.processing=function(){return !this.jqXHR&&this._processQueue&&d._getDeferredState(this._processQueue)==="pending"};f.progress=function(){return this._progress};f.response=function(){return this._response}},_getUploadedBytes:function(e){var c=e.getResponseHeader("Range"),f=c&&c.split("-"),d=f&&f.length>1&&parseInt(f[1],10);return d&&d+1},_chunkedUpload:function(n,h){n.uploadedBytes=n.uploadedBytes||0;var g=this,e=n.files[0],f=e.size,c=n.uploadedBytes,d=n.maxChunkSize||f,j=this._blobSlice,k=b.Deferred(),m=k.promise(),i,l;if(!(this._isXHRUpload(n)&&j&&(c||d=f){e.error=n.i18n("uploadedBytes");return this._getXHRPromise(false,n.context,[null,"error",e.error])}l=function(){var q=b.extend({},n),p=q._progress.loaded;q.blob=j.call(e,c,c+d,e.type);q.chunkSize=q.blob.size;q.contentRange="bytes "+c+"-"+(c+q.chunkSize-1)+"/"+f;g._initXHRData(q);g._initProgressListener(q);i=((g._trigger("chunksend",null,q)!==false&&b.ajax(q))||g._getXHRPromise(false,q.context)).done(function(o,s,r){c=g._getUploadedBytes(r)||(c+q.chunkSize);if(p+q.chunkSize-q._progress.loaded){g._onProgress(b.Event("progress",{lengthComputable:true,loaded:c-q.uploadedBytes,total:c-q.uploadedBytes}),q)}n.uploadedBytes=q.uploadedBytes=c;q.result=o;q.textStatus=s;q.jqXHR=r;g._trigger("chunkdone",null,q);g._trigger("chunkalways",null,q);if(ch._sending){var e=h._slots.shift();while(e){if(h._getDeferredState(e)==="pending"){e.resolve();break}e=h._slots.shift()}}if(h._active===0){h._trigger("stop")}});return k};this._beforeSend(i,l);if(this.options.sequentialUploads||(this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending)){if(this.options.limitConcurrentUploads>1){j=b.Deferred();this._slots.push(j);d=j.pipe(f)}else{this._sequence=this._sequence.pipe(f,f);d=this._sequence}d.abort=function(){c=[undefined,"abort","abort"];if(!k){if(j){j.rejectWith(l.context,c)}return f()}return k.abort()};return this._enhancePromise(d)}return f()},_onAdd:function(q,m){var p=this,v=true,u=b.extend({},this.options,m),f=m.files,s=f.length,g=u.limitMultiFileUploads,k=u.limitMultiFileUploadSize,t=u.limitMultiFileUploadSizeOverhead,o=0,n=this._getParamName(u),d,c,r,l,h=0;if(!s){return false}if(k&&f[0].size===undefined){k=undefined}if(!(u.singleFileUploads||g||k)||!this._isXHRUpload(u)){r=[f];d=[n]}else{if(!(u.singleFileUploads||k)&&g){r=[];d=[];for(l=0;lk)||(g&&l+1-h>=g)){r.push(f.slice(h,l+1));c=n.slice(h,l+1);if(!c.length){c=n}d.push(c);h=l+1;o=0}}}else{d=n}}}m.originalFiles=f;b.each(r||f,function(e,i){var j=b.extend({},m);j.files=r?i:[i];j.paramName=d[e];p._initResponseObject(j);p._initProgressObject(j);p._addConvenienceMethods(q,j);v=p._trigger("add",b.Event("add",{delegatedEvent:q}),j);return v});return v},_replaceFileInput:function(e){var c=e.fileInput,d=c.clone(true);e.fileInputClone=d;b("
").append(d)[0].reset();c.after(d).detach();b.cleanData(c.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(f,g){if(g===c[0]){return d[0]}return g});if(c[0]===this.element[0]){this.element=d}},_handleFileTreeEntry:function(h,j){var e=this,i=b.Deferred(),d=function(l){if(l&&!l.entry){l.entry=h}i.resolve([l])},f=function(l){e._handleFileTreeEntries(l,j+h.name+"/").done(function(m){i.resolve(m)}).fail(d)},g=function(){k.readEntries(function(l){if(!l.length){f(c)}else{c=c.concat(l);g()}},d)},k,c=[];j=j||"";if(h.isFile){if(h._file){h._file.relativePath=j;i.resolve(h._file)}else{h.file(function(l){l.relativePath=j;i.resolve(l)},d)}}else{if(h.isDirectory){k=h.createReader();g()}else{i.resolve([])}}return i.promise()},_handleFileTreeEntries:function(c,e){var d=this;return b.when.apply(b,b.map(c,function(f){return d._handleFileTreeEntry(f,e)})).pipe(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(d){d=d||{};var c=d.items;if(c&&c.length&&(c[0].webkitGetAsEntry||c[0].getAsEntry)){return this._handleFileTreeEntries(b.map(c,function(f){var e;if(f.webkitGetAsEntry){e=f.webkitGetAsEntry();if(e){e._file=f.getAsFile()}return e}return f.getAsEntry()}))}return b.Deferred().resolve(b.makeArray(d.files)).promise()},_getSingleFileInputFiles:function(e){e=b(e);var c=e.prop("webkitEntries")||e.prop("entries"),d,f;if(c&&c.length){return this._handleFileTreeEntries(c)}d=b.makeArray(e.prop("files"));if(!d.length){f=e.prop("value");if(!f){return b.Deferred().resolve([]).promise()}d=[{name:f.replace(/^.*\\/,"")}]}else{if(d[0].name===undefined&&d[0].fileName){b.each(d,function(g,h){h.name=h.fileName;h.size=h.fileSize})}}return b.Deferred().resolve(d).promise()},_getFileInputFiles:function(c){if(!(c instanceof b)||c.length===1){return this._getSingleFileInputFiles(c)}return b.when.apply(b,b.map(c,this._getSingleFileInputFiles)).pipe(function(){return Array.prototype.concat.apply([],arguments)})},_onChange:function(f){var c=this,d={fileInput:b(f.target),form:b(f.target.form)};this._getFileInputFiles(d.fileInput).always(function(e){d.files=e;if(c.options.replaceFileInput){c._replaceFileInput(d)}if(c._trigger("change",b.Event("change",{delegatedEvent:f}),d)!==false){c._onAdd(f,d)}})},_onPaste:function(f){var c=f.originalEvent&&f.originalEvent.clipboardData&&f.originalEvent.clipboardData.items,d={files:[]};if(c&&c.length){b.each(c,function(e,h){var g=h.getAsFile&&h.getAsFile();if(g){d.files.push(g)}});if(this._trigger("paste",b.Event("paste",{delegatedEvent:f}),d)!==false){this._onAdd(f,d)}}},_onDrop:function(g){g.dataTransfer=g.originalEvent&&g.originalEvent.dataTransfer;var c=this,f=g.dataTransfer,d={};if(f&&f.files&&f.files.length){g.preventDefault();this._getDroppedFiles(f).always(function(e){d.files=e;if(c._trigger("drop",b.Event("drop",{delegatedEvent:g}),d)!==false){c._onAdd(g,d)}})}},_onDragOver:a("dragover"),_onDragEnter:a("dragenter"),_onDragLeave:a("dragleave"),_initEventHandlers:function(){if(this._isXHRUpload(this.options)){this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave});this._on(this.options.pasteZone,{paste:this._onPaste})}if(b.support.fileInput){this._on(this.options.fileInput,{change:this._onChange})}},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop");this._off(this.options.pasteZone,"paste");this._off(this.options.fileInput,"change")},_setOption:function(c,d){var e=b.inArray(c,this._specialOptions)!==-1;if(e){this._destroyEventHandlers()}this._super(c,d);if(e){this._initSpecialOptions();this._initEventHandlers()}},_initSpecialOptions:function(){var c=this.options;if(c.fileInput===undefined){c.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]')}else{if(!(c.fileInput instanceof b)){c.fileInput=b(c.fileInput)}}if(!(c.dropZone instanceof b)){c.dropZone=b(c.dropZone)}if(!(c.pasteZone instanceof b)){c.pasteZone=b(c.pasteZone)}},_getRegExp:function(e){var d=e.split("/"),c=d.pop();d.shift();return new RegExp(d.join("/"),c)},_isRegExpOption:function(c,d){return c!=="url"&&b.type(d)==="string"&&/^\/.*\/[igm]{0,3}$/.test(d)},_initDataAttributes:function(){var d=this,c=this.options,e=this.element.data();b.each(this.element[0].attributes,function(g,f){var h=f.name.toLowerCase(),i;if(/^data-/.test(h)){h=h.slice(5).replace(/-[a-z]/g,function(j){return j.charAt(1).toUpperCase()});i=e[h];if(d._isRegExpOption(h,i)){i=d._getRegExp(i)}c[h]=i}})},_create:function(){this._initDataAttributes();this._initSpecialOptions();this._slots=[];this._sequence=this._getXHRPromise(true);this._sending=this._active=0;this._initProgressObject(this);this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(d){var c=this;if(!d||this.options.disabled){return}if(d.fileInput&&!d.files){this._getFileInputFiles(d.fileInput).always(function(e){d.files=e;c._onAdd(null,d)})}else{d.files=b.makeArray(d.files);this._onAdd(null,d)}},send:function(g){if(g&&!this.options.disabled){if(g.fileInput&&!g.files){var e=this,c=b.Deferred(),h=c.promise(),d,f;h.abort=function(){f=true;if(d){return d.abort()}c.reject(null,"abort","abort");return h};this._getFileInputFiles(g.fileInput).always(function(i){if(f){return}if(!i.length){c.reject();return}g.files=i;d=e._onSend(null,g);d.then(function(j,l,k){c.resolve(j,l,k)},function(j,l,k){c.reject(j,l,k)})});return this._enhancePromise(h)}g.files=b.makeArray(g.files);if(g.files.length){return this._onSend(null,g)}}return this._getXHRPromise(false,g&&g.context)}})}));(function(a,c,b){var d=function(i){var h={text:"",start:0,end:0};if(!i.value){return h}try{if(c.getSelection){h.start=i.selectionStart;h.end=i.selectionEnd;h.text=i.value.slice(h.start,h.end)}else{if(b.selection){i.focus();var g=b.selection.createRange(),f=b.body.createTextRange();h.text=g.text;try{f.moveToElementText(i);f.setEndPoint("StartToStart",g)}catch(j){f=i.createTextRange();f.setEndPoint("StartToStart",g)}h.start=i.value.length-f.text.length;h.end=h.start+g.text.length}}}catch(j){}return h};a.fn.extend({selOnly:function(){if(!this[0]){return""}var e=d(this[0]);if(e.start==e.end){return""}return e.text},sel:function(f){if(!arguments.length){if(!this[0]){return}var e=d(this[0]);if(e.start==e.end){return this[0].value}return e.text}return this.each(function(h){var g=d(this);if(g.start==g.end){this.value=f}else{this.value=this.value.substr(0,g.start)+f+this.value.substr(g.end)}})}})})(jQuery,window,window.document);!function(C,x,k,j){function q(f,l){var n,d,c=[],h=0;f&&f.isDefaultPrevented()||(f.preventDefault(),l=f&&f.data?f.data.options:l||{},n=l.$target||k(f.currentTarget),d=n.attr("data-fancybox")||"",d?(c=l.selector?k(l.selector):f.data?f.data.items:[],c=c.length?c.filter('[data-fancybox="'+d+'"]'):k('[data-fancybox="'+d+'"]'),h=c.index(n),h<0&&(h=0)):c=[n],k.fancybox.open(c,l,h))}if(C.console=C.console||{info:function(a){}},k){if(k.fn.fancybox){return void console.info("fancyBox already initialized")}var A={loop:!1,gutter:50,keyboard:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'',preload:!0,css:{},attr:{scrolling:"auto"}},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'',spinnerTpl:'
',errorTpl:'

{{ERROR}}

',btnTpl:{download:'',zoom:'',close:'',smallBtn:'',arrowLeft:'',arrowRight:''},parentEl:"body",autoFocus:!1,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:4000},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:k.noop,beforeLoad:k.noop,afterLoad:k.noop,beforeShow:k.noop,afterShow:k.noop,beforeClose:k.noop,afterClose:k.noop,onActivate:k.noop,onDeactivate:k.noop,clickContent:function(a,c){return"image"===a.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{idleTime:!1,clickContent:function(a,c){return"image"===a.type&&"toggleControls"},clickSlide:function(a,c){return"image"===a.type?"toggleControls":"close"},dblclickContent:function(a,c){return"image"===a.type&&"zoom"},dblclickSlide:function(a,c){return"image"===a.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded.
Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden.
Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},D=k(C),b=k(x),z=0,m=function(a){return a&&a.hasOwnProperty&&a instanceof k},y=function(){return C.requestAnimationFrame||C.webkitRequestAnimationFrame||C.mozRequestAnimationFrame||C.oRequestAnimationFrame||function(a){return C.setTimeout(a,1000/60)}}(),B=function(){var c,d=x.createElement("fakeelement"),a={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(c in a){if(d.style[c]!==j){return a[c]}}return"transitionend"}(),w=function(a){return a&&a.length&&a[0].offsetHeight},g=function(a,c){var d=k.extend(!0,{},a,c);return k.each(c,function(f,h){k.isArray(h)&&(d[f]=h)}),d},v=function(e,f,d){var c=this;c.opts=g({index:d},k.fancybox.defaults),k.isPlainObject(f)&&(c.opts=g(c.opts,f)),k.fancybox.isMobile&&(c.opts=g(c.opts,c.opts.mobile)),c.id=c.opts.id||++z,c.currIndex=parseInt(c.opts.index,10)||0,c.prevIndex=null,c.prevPos=null,c.currPos=0,c.firstRun=!0,c.group=[],c.slides={},c.addContent(e),c.group.length&&(c.$lastFocus=k(x.activeElement).trigger("blur"),c.init())};k.extend(v.prototype,{init:function(){var h,f,n,o=this,t=o.group[o.currIndex],e=t.opts,p=k.fancybox.scrollbarWidth;k.fancybox.getInstance()||e.hideScrollbar===!1||(k("body").addClass("fancybox-active"),!k.fancybox.isMobile&&x.body.scrollHeight>C.innerHeight&&(p===j&&(h=k('
').appendTo("body"),p=k.fancybox.scrollbarWidth=h[0].offsetWidth-h[0].clientWidth,h.remove()),k("head").append('"),k("body").addClass("compensate-for-scrollbar"))),n="",k.each(e.buttons,function(a,c){n+=e.btnTpl[c]||""}),f=k(o.translate(o,e.baseTpl.replace("{{buttons}}",n).replace("{{arrows}}",e.btnTpl.arrowLeft+e.btnTpl.arrowRight))).attr("id","fancybox-container-"+o.id).addClass("fancybox-is-hidden").addClass(e.baseClass).data("FancyBox",o).appendTo(e.parentEl),o.$refs={container:f},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(a){o.$refs[a]=f.find(".fancybox-"+a)}),o.trigger("onInit"),o.activate(),o.jumpTo(o.currIndex)},translate:function(a,c){var d=a.opts.i18n[a.opts.lang];return c.replace(/\{\{(\w+)\}\}/g,function(h,l){var f=d[l];return f===j?h:f})},addContent:function(f){var h,d=this,c=k.makeArray(f);k.each(c,function(H,o){var F,I,i,E,n,p={},G={};k.isPlainObject(o)?(p=o,G=o.opts||o):"object"===k.type(o)&&k(o).length?(F=k(o),G=F.data()||{},G=k.extend(!0,{},G,G.options),G.$orig=F,p.src=d.opts.src||G.src||F.attr("href"),p.type||p.src||(p.type="inline",p.src=o)):p={type:"html",src:o+""},p.opts=k.extend(!0,{},d.opts,G),k.isArray(G.buttons)&&(p.opts.buttons=G.buttons),I=p.type||p.opts.type,E=p.src||"",!I&&E&&((i=E.match(/\.(mp4|mov|ogv)((\?|#).*)?$/i))?(I="video",p.opts.videoFormat||(p.opts.videoFormat="video/"+("ogv"===i[1]?"ogg":i[1]))):E.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?I="image":E.match(/\.(pdf)((\?|#).*)?$/i)?I="iframe":"#"===E.charAt(0)&&(I="inline")),I?p.type=I:d.trigger("objectNeedsType",p),p.contentType||(p.contentType=k.inArray(p.type,["html","inline","ajax"])>-1?"html":p.type),p.index=d.group.length,"auto"==p.opts.smallBtn&&(p.opts.smallBtn=k.inArray(p.type,["html","inline","ajax"])>-1),"auto"===p.opts.toolbar&&(p.opts.toolbar=!p.opts.smallBtn),p.opts.$trigger&&p.index===d.opts.index&&(p.opts.$thumb=p.opts.$trigger.find("img:first")),p.opts.$thumb&&p.opts.$thumb.length||!p.opts.$orig||(p.opts.$thumb=p.opts.$orig.find("img:first")),"function"===k.type(p.opts.caption)&&(p.opts.caption=p.opts.caption.apply(o,[d,p])),"function"===k.type(d.opts.caption)&&(p.opts.caption=d.opts.caption.apply(o,[d,p])),p.opts.caption instanceof k||(p.opts.caption=p.opts.caption===j?"":p.opts.caption+""),"ajax"===p.type&&(n=E.split(/\s+/,2),n.length>1&&(p.src=n.shift(),p.opts.filter=n.shift())),p.opts.modal&&(p.opts=k.extend(!0,p.opts,{infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),d.group.push(p)}),Object.keys(d.slides).length&&(d.updateControls(),h=d.Thumbs,h&&h.isActive&&(h.create(),h.focus()))},addEvents:function(){var a=this;a.removeEvents(),a.$refs.container.on("click.fb-close","[data-fancybox-close]",function(c){c.stopPropagation(),c.preventDefault(),a.close(c)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(c){c.stopPropagation(),c.preventDefault(),a.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(c){c.stopPropagation(),c.preventDefault(),a.next()}).on("click.fb","[data-fancybox-zoom]",function(c){a[a.isScaledDown()?"scaleToActual":"scaleToFit"]()}),D.on("orientationchange.fb resize.fb",function(c){c&&c.originalEvent&&"resize"===c.originalEvent.type?y(function(){a.update()}):(a.$refs.stage.hide(),setTimeout(function(){a.$refs.stage.show(),a.update()},k.fancybox.isMobile?600:250))}),b.on("focusin.fb",function(c){var d=k.fancybox?k.fancybox.getInstance():null;d.isClosing||!d.current||!d.current.opts.trapFocus||k(c.target).hasClass("fancybox-container")||k(c.target).is(x)||d&&"fixed"!==k(c.target).css("position")&&!d.$refs.container.has(c.target).length&&(c.stopPropagation(),d.focus())}),b.on("keydown.fb",function(d){var f=a.current,c=d.keyCode||d.which;if(f&&f.opts.keyboard&&!(d.ctrlKey||d.altKey||d.shiftKey||k(d.target).is("input")||k(d.target).is("textarea"))){return 8===c||27===c?(d.preventDefault(),void a.close(d)):37===c||38===c?(d.preventDefault(),void a.previous()):39===c||40===c?(d.preventDefault(),void a.next()):void a.trigger("afterKeydown",d,c)}}),a.group[a.currIndex].opts.idleTime&&(a.idleSecondsCounter=0,b.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(c){a.idleSecondsCounter=0,a.isIdle&&a.showControls(),a.isIdle=!1}),a.idleInterval=C.setInterval(function(){a.idleSecondsCounter++,a.idleSecondsCounter>=a.group[a.currIndex].opts.idleTime&&!a.isDragging&&(a.isIdle=!0,a.idleSecondsCounter=0,a.hideControls())},1000))},removeEvents:function(){var a=this;D.off("orientationchange.fb resize.fb"),b.off("focusin.fb keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),a.idleInterval&&(C.clearInterval(a.idleInterval),a.idleInterval=null)},previous:function(a){return this.jumpTo(this.currPos-1,a)},next:function(a){return this.jumpTo(this.currPos+1,a)},jumpTo:function(J,E){var o,H,K,f,G,n,F,I=this,h=I.group.length;if(!(I.isDragging||I.isClosing||I.isAnimating&&I.firstRun)){if(J=parseInt(J,10),H=I.current?I.current.opts.loop:I.opts.loop,!H&&(J<0||J>=h)){return !1}if(o=I.firstRun=!Object.keys(I.slides).length,!(h<2&&!o&&I.isDragging)){if(f=I.current,I.prevIndex=I.currIndex,I.prevPos=I.currPos,K=I.createSlide(J),h>1&&((H||K.index>0)&&I.createSlide(J-1),(H||K.indexK.pos?"next":"previous"),f.$slide.removeClass("fancybox-slide--complete fancybox-slide--current fancybox-slide--next fancybox-slide--previous"),f.isComplete=!1,E&&(K.isMoved||K.opts.transitionEffect)&&(K.isMoved?f.$slide.addClass(F):(F="fancybox-animated "+F+" fancybox-fx-"+K.opts.transitionEffect,k.fancybox.animate(f.$slide,F,E,function(){f.$slide.removeClass(F).removeAttr("style")}))))}}},createSlide:function(c){var d,f,a=this;return f=c%a.group.length,f=f<0?a.group.length+f:f,!a.slides[c]&&a.group[f]&&(d=k('
').appendTo(a.$refs.stage),a.slides[c]=k.extend(!0,{},a.group[f],{pos:c,$slide:d,isLoaded:!1}),a.updateSlide(a.slides[c])),a.slides[c]},scaleToActual:function(P,J,F){var N,Q,n,L,E,K=this,O=K.current,I=O.$content,o=k.fancybox.getTranslate(O.$slide).width,G=k.fancybox.getTranslate(O.$slide).height,H=O.width,M=O.height;!K.isAnimating&&I&&"image"==O.type&&O.isLoaded&&!O.hasError&&(k.fancybox.stop(I),K.isAnimating=!0,P=P===j?0.5*o:P,J=J===j?0.5*G:J,N=k.fancybox.getTranslate(I),N.top-=k.fancybox.getTranslate(O.$slide).top,N.left-=k.fancybox.getTranslate(O.$slide).left,L=H/N.width,E=M/N.height,Q=0.5*o-0.5*H,n=0.5*G-0.5*M,H>o&&(Q=N.left*L-(P*L-P),Q>0&&(Q=0),QG&&(n=N.top*E-(J*E-J),n>0&&(n=0),nH/I?u=H/I:H>u*I&&(H=u*I)),G.width=H,G.height=u,G)},update:function(){var a=this;k.each(a.slides,function(c,d){a.updateSlide(d)})},updateSlide:function(f,l){var n=this,d=f&&f.$content,c=f.width||f.opts.width,h=f.height||f.opts.height;d&&(c||h||"video"===f.contentType)&&!f.hasError&&(k.fancybox.stop(d),k.fancybox.setTranslate(d,n.getFitPos(f)),f.pos===n.currPos&&(n.isAnimating=!1,n.updateCursor())),f.$slide.trigger("refresh"),n.$refs.toolbar.toggleClass("compensate-for-scrollbar",f.$slide.get(0).scrollHeight>f.$slide.get(0).clientHeight),n.trigger("onUpdate",f)},centerSlide:function(f,l){var d,c,h=this;h.current&&(d=Math.round(f.$slide.width()),c=f.pos-h.current.pos,k.fancybox.animate(f.$slide,{top:0,left:c*d+c*f.opts.gutter,opacity:1},l===j?0:l,null,!1))},updateCursor:function(f,l){var n,d=this,c=d.current,h=d.$refs.container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-drag fancybox-can-zoomOut");c&&!d.isClosing&&(n=d.isZoomable(),h.toggleClass("fancybox-is-zoomable",n),k("[data-fancybox-zoom]").prop("disabled",!n),n&&("zoom"===c.opts.clickContent||k.isFunction(c.opts.clickContent)&&"zoom"===c.opts.clickContent(c))?d.isScaledDown(f,l)?h.addClass("fancybox-can-zoomIn"):c.opts.touch?h.addClass("fancybox-can-drag"):h.addClass("fancybox-can-zoomOut"):c.opts.touch&&"video"!==c.contentType&&h.addClass("fancybox-can-drag"))},isZoomable:function(){var a,c=this,d=c.current;if(d&&!c.isClosing&&"image"===d.type&&!d.hasError){if(!d.isLoaded){return !0}if(a=c.getFitPos(d),d.width>a.width||d.height>a.height){return !0}}return !1},isScaledDown:function(f,n){var d=this,c=!1,h=d.current,l=h.$content;return f!==j&&n!==j?c=f1||Math.abs(a.height()-f.height)>1),f},loadSlide:function(f){var h,l,d,c=this;if(!f.isLoading&&!f.isLoaded){switch(f.isLoading=!0,c.trigger("beforeLoad",f),h=f.type,l=f.$slide,l.off("refresh").trigger("onReset").addClass(f.opts.slideClass),h){case"image":c.setImage(f);break;case"iframe":c.setIframe(f);break;case"html":c.setContent(f,f.src||f.content);break;case"video":c.setContent(f,'