Warning: Undefined array key "SITE_CONFIG" in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/ui/get/jscript.php on line 26

Deprecated: Optional parameter $errorCode declared before required parameter $message is implicitly treated as a required parameter in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/engine/bin/classes/Page.class.php on line 711

Deprecated: Optional parameter $files declared before required parameter $file is implicitly treated as a required parameter in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/engine/bin/classes/Site.class.php on line 396

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /data01/virt60235/domeenid/www.aurakeskus.ee/htdocs/old/vendor/monolog/monolog/src/Monolog/Logger.php on line 324
var ADMIN_MODE = false; /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t").get(0).files!==undefined;t.formdata=window.FormData!==undefined;e.fn.ajaxSubmit=function(n){function T(t){var n=e.param(t).split("&");var r=n.length;var i={};var s,o;for(s=0;s').val(f.extraData[l].value).appendTo(s)[0])}else{a.push(e('').val(f.extraData[l]).appendTo(s)[0])}}}}if(!f.iframeTarget){p.appendTo("body");if(d.attachEvent)d.attachEvent("onload",_);else d.addEventListener("load",_,false)}setTimeout(o,15);s.submit()}finally{s.setAttribute("action",n);if(t){s.setAttribute("target",t)}else{u.removeAttr("target")}e(a).remove()}}function _(t){if(v.aborted||M){return}try{A=T(d)}catch(n){i("cannot access response document: ",n);t=x}if(t===S&&v){v.abort("timeout");E.reject(v,"timeout");return}else if(t==x&&v){v.abort("server abort");E.reject(v,"error","server abort");return}if(!A||A.location.href==f.iframeSrc){if(!y)return}if(d.detachEvent)d.detachEvent("onload",_);else d.removeEventListener("load",_,false);var r="success",s;try{if(y){throw"timeout"}var o=f.dataType=="xml"||A.XMLDocument||e.isXMLDoc(A);i("isXml="+o);if(!o&&window.opera&&(A.body===null||!A.body.innerHTML)){if(--O){i("requeing onLoad callback, DOM not available");setTimeout(_,250);return}}var u=A.body?A.body:A.documentElement;v.responseText=u?u.innerHTML:null;v.responseXML=A.XMLDocument?A.XMLDocument:A;if(o)f.dataType="xml";v.getResponseHeader=function(e){var t={"content-type":f.dataType};return t[e]};if(u){v.status=Number(u.getAttribute("status"))||v.status;v.statusText=u.getAttribute("statusText")||v.statusText}var a=(f.dataType||"").toLowerCase();var l=/(json|script|text)/.test(a);if(l||f.textarea){var h=A.getElementsByTagName("textarea")[0];if(h){v.responseText=h.value;v.status=Number(h.getAttribute("status"))||v.status;v.statusText=h.getAttribute("statusText")||v.statusText}else if(l){var m=A.getElementsByTagName("pre")[0];var g=A.getElementsByTagName("body")[0];if(m){v.responseText=m.textContent?m.textContent:m.innerText}else if(g){v.responseText=g.textContent?g.textContent:g.innerText}}}else if(a=="xml"&&!v.responseXML&&v.responseText){v.responseXML=D(v.responseText)}try{L=H(v,a,f)}catch(t){r="parsererror";v.error=s=t||r}}catch(t){i("error caught: ",t);r="error";v.error=s=t||r}if(v.aborted){i("upload aborted");r=null}if(v.status){r=v.status>=200&&v.status<300||v.status===304?"success":"error"}if(r==="success"){if(f.success)f.success.call(f.context,L,"success",v);E.resolve(v.responseText,"success",v);if(c)e.event.trigger("ajaxSuccess",[v,f])}else if(r){if(s===undefined)s=v.statusText;if(f.error)f.error.call(f.context,v,r,s);E.reject(v,"error",s);if(c)e.event.trigger("ajaxError",[v,f,s])}if(c)e.event.trigger("ajaxComplete",[v,f]);if(c&&!--e.active){e.event.trigger("ajaxStop")}if(f.complete)f.complete.call(f.context,v,r);M=true;if(f.timeout)clearTimeout(b);setTimeout(function(){if(!f.iframeTarget)p.remove();v.responseXML=null},100)}var s=u[0],o,a,f,c,h,p,d,v,m,g,y,b;var w=!!e.fn.prop;var E=e.Deferred();if(e("[name=submit],[id=submit]",s).length){alert('Error: Form elements must not have name or id of "submit".');E.reject();return E}if(t){for(a=0;a');p.css({position:"absolute",top:"-1000px",left:"-1000px"})}d=p[0];v={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var n=t==="timeout"?"timeout":"aborted";i("aborting upload... "+n);this.aborted=1;try{if(d.contentWindow.document.execCommand){d.contentWindow.document.execCommand("Stop")}}catch(r){}p.attr("src",f.iframeSrc);v.error=n;if(f.error)f.error.call(f.context,v,n,t);if(c)e.event.trigger("ajaxError",[v,f,n]);if(f.complete)f.complete.call(f.context,v,n)}};c=f.global;if(c&&0===e.active++){e.event.trigger("ajaxStart")}if(c){e.event.trigger("ajaxSend",[v,f])}if(f.beforeSend&&f.beforeSend.call(f.context,v,f)===false){if(f.global){e.active--}E.reject();return E}if(v.aborted){E.reject();return E}m=s.clk;if(m){g=m.name;if(g&&!m.disabled){f.extraData=f.extraData||{};f.extraData[g]=m.value;if(m.type=="image"){f.extraData[g+".x"]=s.clk_x;f.extraData[g+".y"]=s.clk_y}}}var S=1;var x=2;var N=e("meta[name=csrf-token]").attr("content");var C=e("meta[name=csrf-param]").attr("content");if(C&&N){f.extraData=f.extraData||{};f.extraData[C]=N}if(f.forceSync){k()}else{setTimeout(k,10)}var L,A,O=50,M;var D=e.parseXML||function(e,t){if(window.ActiveXObject){t=new ActiveXObject("Microsoft.XMLDOM");t.async="false";t.loadXML(e)}else{t=(new DOMParser).parseFromString(e,"text/xml")}return t&&t.documentElement&&t.documentElement.nodeName!="parsererror"?t:null};var P=e.parseJSON||function(e){return window["eval"]("("+e+")")};var H=function(t,n,r){var i=t.getResponseHeader("content-type")||"",s=n==="xml"||!n&&i.indexOf("xml")>=0,o=s?t.responseXML:t.responseText;if(s&&o.documentElement.nodeName==="parsererror"){if(e.error)e.error("parsererror")}if(r&&r.dataFilter){o=r.dataFilter(o,n)}if(typeof o==="string"){if(n==="json"||!n&&i.indexOf("json")>=0){o=P(o)}else if(n==="script"||!n&&i.indexOf("javascript")>=0){e.globalEval(o)}}return o};return E}if(!this.length){i("ajaxSubmit: skipping submit process - no element selected");return this}var r,s,o,u=this;if(typeof n=="function"){n={success:n}}r=this.attr("method");s=this.attr("action");o=typeof s==="string"?e.trim(s):"";o=o||window.location.href||"";if(o){o=(o.match(/^([^#]+)/)||[])[1]}n=e.extend(true,{url:o,success:e.ajaxSettings.success,type:r||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},n);var a={};this.trigger("form-pre-serialize",[this,n,a]);if(a.veto){i("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(n.beforeSerialize&&n.beforeSerialize(this,n)===false){i("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var f=n.traditional;if(f===undefined){f=e.ajaxSettings.traditional}var l=[];var c,h=this.formToArray(n.semantic,l);if(n.data){n.extraData=n.data;c=e.param(n.data,f)}if(n.beforeSubmit&&n.beforeSubmit(h,this,n)===false){i("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[h,this,n,a]);if(a.veto){i("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var p=e.param(h,f);if(c){p=p?p+"&"+c:c}if(n.type.toUpperCase()=="GET"){n.url+=(n.url.indexOf("?")>=0?"&":"?")+p;n.data=null}else{n.data=p}var d=[];if(n.resetForm){d.push(function(){u.resetForm()})}if(n.clearForm){d.push(function(){u.clearForm(n.includeHidden)})}if(!n.dataType&&n.target){var v=n.success||function(){};d.push(function(t){var r=n.replaceTarget?"replaceWith":"html";e(n.target)[r](t).each(v,arguments)})}else if(n.success){d.push(n.success)}n.success=function(e,t,r){var i=n.context||this;for(var s=0,o=d.length;s0;var y="multipart/form-data";var b=u.attr("enctype")==y||u.attr("encoding")==y;var w=t.fileapi&&t.formdata;i("fileAPI :"+w);var E=(g||b)&&!w;var S;if(n.iframe!==false&&(n.iframe||E)){if(n.closeKeepAlive){e.get(n.closeKeepAlive,function(){S=C(h)})}else{S=C(h)}}else if((g||b)&&w){S=N(h)}else{S=e.ajax(n)}u.removeData("jqxhr").data("jqxhr",S);for(var x=0;x').css({position:'absolute',top:-10000,left:-10000,width:$(this).width(),fontSize:$this.css('fontSize'),fontFamily:$this.css('fontFamily'),lineHeight:$this.css('lineHeight'),resize:'none'}).appendTo(document.body);var update = function() {var val = this.value.replace(//g, '>').replace(/&/g, '&').replace(/\n/g, '
');shadow.html(val);$(this).css('height', Math.max(shadow.height()+20,minHeight));}; $(this).change(update).keyup(update).keydown(update);update.apply(this);}); return this;}})(jQuery); /*theRotator*/ function theRotator(itemID,inter,time){if($(itemID+' li').length<=1){return false;}inter=(inter)?inter:6000;time=(time)?time:1000;$(itemID+' ul li').css({opacity:0.0}).hide();$(itemID+' ul li:first').css({opacity:1.0}).show();setInterval(function(){if(!$(itemID).hasClass('pause')){rotate(itemID,time);}},inter);} /*rotate*/ function rotate(itemID,time){var current=($(itemID+' ul li.show')?$(itemID+' ul li.show'):$(itemID+' ul li:first'));var next=((current.next().length)?((current.next().hasClass('show'))?$(itemID+' ul li:first'):current.next()):$(itemID+' ul li:first'));next.css({opacity:0.0}).show().addClass('show').animate({opacity:1.0},time);current.animate({opacity:0.0},time,function(){current.hide();}).removeClass('show');}; /*mailDecrypt*/ $.fn.mailDecrypt=function(){if($("b.mailAt").length){$("b.mailAt").replaceWith("@")}$(this).each(function(){$('body').on("mouseenter click",'a[data-menc]',function(){if($(this).data("menc")){e=$(this).data("menc").replace("/","@");$(this).attr("href","mailto:"+e).attr("title",e);$(this).removeAttr("data-menc")}})})}; /**/ function openUrl(url,useBase){useBase=(useBase)?useBase:false;if(useBase){baseUrl=$('base').attr('href');url=baseUrl+url;}window.location=url;} /**/ function reloadPage(){window.location=window.location;} /**/ function openWindow(url,name,height,width,s,r,t,l){l=(l)?l:'1';t=(t)?t:'1';s=(s)?s:'1';r=(r)?r:'1';if(!width)width=560;if(!height)height=590;var str="height="+height+",innerHeight="+height;str+=",width="+width+",innerWidth="+width; if(window.screen){var ah=screen.availHeight-30;var aw=screen.availWidth-10;var xc=(aw-width)/2;var yc=(ah-height)/2; str+=",left="+xc+",screenX="+xc;str+=",top="+yc+",screenY="+yc; str+=",scrollbars="+s+",resizable="+r+",location="+l+",toolbar="+t;} return window.open(url,name,str);} /*Hover*/ $.fn.hoverIt=function(cssClass,target){ var target=target?target:''; var thisItem = $(this); var cssClass=(cssClass)?cssClass:'ui-state-hover'; //if(target){ thisItem.on('mouseenter',target,function(){ $(this).addClass(cssClass); }); thisItem.on('mouseleave',target,function(){ $(this).removeClass(cssClass); }); } /* * E-mail validate */ function validateMail(formID) { var reg = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/i); var address = formID.val(); if (reg.test(address) == false) { formID.next('.required').removeClass('ok').addClass('emailFailed'); return false; } else { formID.next('.required').removeClass('emailFailed').addClass('emailOk'); return true; } } function validatePhone(elem){ if(!elem.val().trim()) return false; var val = elem.val().trim(); val = val.split(' ').join(''); if(val.indexOf('+') > 0 || (val.match(/\+/g) || []).length > 1) return false; val = val.split('+').join(''); val = val.split('.').join(','); if(isNaN(val)) return false; return true; } /* * Date object */ var dates = { convert:function(d) { // Converts the date in d to a date-object. The input can be: // a date object: returned without modification // an array : Interpreted as [year,month,day]. NOTE: month is 0-11. // a number : Interpreted as number of milliseconds // since 1 Jan 1970 (a timestamp) // a string : Any format supported by the javascript engine, like // "YYYY/MM/DD", "MM/DD/YYYY", "Jan 31 2009" etc. // an object : Interpreted as an object with year, month and date // attributes. **NOTE** month is 0-11. return ( d.constructor === Date ? d : d.constructor === Array ? new Date(d[0],d[1],d[2]) : d.constructor === Number ? new Date(d) : d.constructor === String ? new Date(d.replace(/(\d{2})\.(\d{2})\.(\d{4})/,'$3-$2-$1')) : typeof d === "object" ? new Date(d.year,d.month,d.date) : NaN ); }, compare:function(a,b) { // Compare two dates (could be of any type supported by the convert // function above) and returns: // -1 : if a < b // 0 : if a = b // 1 : if a > b // NaN : if a or b is an illegal date // NOTE: The code inside isFinite does an assignment (=). return ( isFinite(a=this.convert(a).valueOf()) && isFinite(b=this.convert(b).valueOf()) ? (a>b)-(a0)?'+'+n:n; }, inRange:function(d,start,end) { // Checks if date in d is between dates in start and end. // Returns a boolean or NaN: // true : if d is between start and end (inclusive) // false : if d is before start or after end // NaN : if one or more of the dates is illegal. // NOTE: The code inside isFinite does an assignment (=). return ( isFinite(d=this.convert(d).valueOf()) && isFinite(start=this.convert(start).valueOf()) && isFinite(end=this.convert(end).valueOf()) ? start <= d && d <= end : NaN ); } } /* * Validate Form */ function validateReferenceNumber(ref){ ref = ''+ref; if(ref.length!=6){ return false; } var preCheck = ref.substr(ref.length-1, ref.length); ref = ref.substr(0,(ref.length -1)); var weigths = [7, 3, 1]; var sl = ref.length; var st = ref.length; var total = 0; while(sl > 0 && ref.substr(--sl, 1) >='0'){ total += ref.substr((st-1)-sl, 1)*weigths[(sl%3)]; } var check = ((Math.ceil((total/10))*10)-total); if(check == preCheck){ return true; }else{ return false; } } $.fn.validateForm = function () { let reqElements = $(this).find('input.required,textarea.required,select.required'); var thisForm = $(this); reqElements.each(function () { var thisItem = $(this); //var thisRequiredItem = thisForm.find('.required[data-rel]'); let requiredItem = thisForm.find('.required[data-rel="'+thisItem.attr('id')+'"]'); if(!requiredItem.length){ requiredItem = thisItem.parents('.item').eq(0).find('span.required'); } let requiredMessage = thisForm.find('.requiredMessage[data-rel='+thisItem.attr('id')+']'); if ((thisItem.val() && !thisItem.hasClass('noValue') && !thisItem.is(':radio') && !thisItem.is(':checkbox')) || thisItem.is(':checked')) { if(thisItem.data('type')=='email'){ if(validateMail(thisItem) && thisItem.val()){ thisItem.removeClass('failed').addClass('ok'); if(requiredItem){ requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); } requiredMessage.slideUp(500); } }else if(thisItem.data('type')=='phone'){ if(validatePhone(thisItem) && thisItem.val()){ thisItem.removeClass('failed').addClass('ok'); thisItem.parents('.item').removeClass('failed').addClass('ok'); if(requiredItem){ requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); } requiredMessage.slideUp(500); } } else if(thisItem.data('type')=='number'){ if(thisItem.val() && $.isNumeric(thisItem.val())){ thisItem.removeClass('failed').addClass('ok'); thisItem.parents('.item').removeClass('failed').addClass('ok'); requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); requiredMessage.slideUp(500); } }else if(thisItem.data('type')=='reference'){ if(thisItem.val() && $.isNumeric(thisItem.val()) && validateReferenceNumber(thisItem.val())){ thisItem.removeClass('failed').addClass('ok'); thisItem.parents('.item').removeClass('failed').addClass('ok'); requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); requiredMessage.slideUp(500); } } else { thisItem.removeClass('failed').addClass('ok'); thisItem.parents('.item').removeClass('failed').addClass('ok'); requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); requiredMessage.slideUp(500); } } else if (thisItem.is(':radio') && thisItem.is(':checked')) { requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); thisItem.removeClass('failed').addClass('ok'); thisItem.parents('.item').removeClass('failed').addClass('ok'); thisItem.parents('.item').eq(0).find('.failed').removeClass('failed').addClass('ok'); requiredMessage.slideUp(500); } }); reqElements.on('change',function () { let error = false; let requiredItem = thisForm.find('.required[data-rel="'+$(this).attr('id')+'"]'); if(!requiredItem.length){ requiredItem = $(this).parents('.item').eq(0).find('span.required'); } let requiredMessage = thisForm.find('.requiredMessage[data-rel='+$(this).attr('id')+']'); if (!$(this).val() || ($(this).is(':checkbox') && !$(this).is(':checked'))) { error = true; requiredItem.removeClass('ok').addClass('failed'); requiredItem.parents('.item').removeClass('ok').addClass('failed'); $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); requiredMessage.fadeIn(500); } else if ($(this).is(':radio') && !$(this).is(':checked')) { requiredItem.addClass('failed').removeClass('ok'); $(this).parents('.item').eq(0).find('.required').addClass('failed').removeClass('ok'); $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); } else { $(this).parents('.item').eq(0).find('.required, .failed').removeClass('failed').addClass('ok'); requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); $(this).removeClass('failed').addClass('ok'); $(this).parents('.item').removeClass('failed').addClass('ok'); requiredMessage.slideUp(500); error = false; } }); thisForm.find('input[data-type="email"]').on('change',function () { let requiredItem = thisForm.find('.required[data-rel="'+$(this).attr('id')+'"]'); if(!requiredItem.length){ requiredItem = $(this).parents('.item').find('span.required'); } let requiredMessage = thisForm.find('.requiredMessage[data-rel='+$(this).attr('id')+']'); if (validateMail($(this)) && $(this).val()) { $(this).removeClass('failed').addClass('ok'); $(this).parents('.item').removeClass('failed').addClass('ok'); requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); requiredMessage.fadeOut(500); } else if($(this).val()){ $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); requiredItem.removeClass('ok').addClass('failed'); requiredItem.parents('.item').removeClass('ok').addClass('failed'); requiredMessage.fadeIn(500); } else if(!$(this).hasClass('required')) { $(this).removeClass('failed').removeClass('ok'); requiredMessage.fadeIn(500); } }); thisForm.find('input[data-type="phone"]').on('change',function () { let requiredItem = thisForm.find('.required[data-rel="'+$(this).attr('id')+'"]'); if(!requiredItem.length){ requiredItem = $(this).parents('.item').find('span.required'); } let requiredMessage = thisForm.find('.requiredMessage[data-rel='+$(this).attr('id')+']'); if (validatePhone($(this)) && $(this).val()) { $(this).removeClass('failed').addClass('ok'); $(this).parents('.item').removeClass('failed').addClass('ok'); requiredItem.removeClass('failed').addClass('ok'); requiredItem.parents('.item').removeClass('failed').addClass('ok'); requiredMessage.fadeOut(500); } else if($(this).val()){ $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); requiredItem.removeClass('ok').addClass('failed'); requiredItem.parents('.item').removeClass('ok').addClass('failed'); requiredMessage.fadeIn(500); } else if(!$(this).hasClass('required')) { $(this).removeClass('failed').removeClass('ok'); requiredMessage.fadeIn(500); } }); thisForm.find('input[data-type="date"], input[type="date"]').on('change',function () { var thisVal = $(this).val(); if(dates.convert(thisVal) != 'NaN' && dates.convert(thisVal) != 'Invalid Date'){ $(this).removeClass('failed').addClass('ok'); $(this).parents('.item').removeClass('failed').addClass('ok'); if($(this).attr('min') || $(this).attr('max')){ if(dates.inRange(thisVal,$(this).attr('min'),$(this).attr('max'))){ $(this).removeClass('failed').addClass('ok'); $(this).parents('.item').removeClass('failed').addClass('ok'); } else{ $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); } } } else{ $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); } } ); thisForm.find('input[data-type="number"],input[type="number"]').on('change',function () { var thisVal = $(this).val(); if(!$.isNumeric(thisVal) && thisVal){ $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); }else{ if($(this).attr('min') || $(this).attr('max')){ if(thisVal < parseInt($(this).attr('min')) || thisVal > parseInt($(this).attr('max'))){ $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); } else{ $(this).removeClass('failed').addClass('ok'); $(this).parents('.item').removeClass('failed').addClass('ok'); } } } }).keydown(function (e) { if(e.keyCode == 190){ if($(this).val().indexOf('.') != -1){ e.preventDefault(); return; } } if(e.keyCode == 188 || e.keyCode == 110){ if($(this).val().indexOf('.') == -1){ $(this).val($(this).val()+'.'); } e.preventDefault(); return; } if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190, 188]) !== -1 || (e.keyCode == 65 && e.ctrlKey === true) || (e.keyCode >= 35 && e.keyCode <= 39)) { return; } if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { e.preventDefault(); } }); thisForm.find('input[data-type="reference"]').on('change',function () { var thisVal = $(this).val(); if(!$.isNumeric(thisVal) || thisVal && !validateReferenceNumber(thisVal)){ $(this).addClass('failed').removeClass('ok'); $(this).parents('.item').addClass('failed').removeClass('ok'); }else{ $(this).addClass('ok').removeClass('failed'); $(this).parents('.item').addClass('ok').removeClass('failed'); } if($(this).val().length==0 && !$(this).hasClass('required')){ $(this).removeClass('failed'); } }).keydown(function (e) { if(e.keyCode == 190 || e.keyCode == 188){ e.preventDefault(); return; } if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190, 188]) !== -1 || (e.keyCode == 65 && e.ctrlKey === true) || (e.keyCode >= 35 && e.keyCode <= 39)) { return; } if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { e.preventDefault(); } }); }; /* scroll */ $.fn.scrollGo=function() { o = $(this).offset(); if(o){ var x = o.top - 100; $('html,body').animate({scrollTop: x}, 500); } } /**/ $.fn.checkForm = function(){ var parentForm = $(this); var reqElements = parentForm.find('input.required,textarea.required,select.required,input.failed'); parentForm.find('.requiredMessage').remove(); parentForm.find(reqElements).not('.ok').each(function(){ var reqItem = $(this); if($(this).is(':radio')){ if(!$(this).parents('.item').eq(0).find('input:checked').length){ $(this).parents('.item').eq(0).find('label, input:radio').addClass('failed'); }else{ $(this).parents('.item').eq(0).find('label, input:radio').removeClass('failed').addClass('ok') } } else{ reqItem.addClass('failed'); reqItem.parents('.item').addClass('failed'); } if(reqItem.data('required-msg')){ reqItem.parent().append('
'+reqItem.data('required-msg')+'
'); } if($(this).is(':radio')){ if(!$(this).parents('.item').eq(0).find('input:checked').length){ $(this).change(); }else{ $(this).parents('.item').eq(0).find('input:checked').change(); } }else if(!reqItem.hasClass('noValue')){ $(this).change(); } }); parentForm.find('.requiredMessage').eq(0).fadeIn(500); if($(reqElements).not('.ok').length==0 && $(reqElements).find('.failed').length==0){return true;} else{ parentForm.find(".showRequiredError").fadeIn(300); parentForm.find(reqElements).not('.ok').first().scrollGo(); return false; } }; /**/ var defaultValues = new Array(); $.fn.focusValue=function(cssClass){$(this).each(function(){cssClass=(cssClass)?cssClass:'focus';$(this).addClass('noValue').focus(function(){$(this).addClass(cssClass);if(!defaultValues[$(this).attr('id')]){defaultValues[$(this).attr('id')]=this.value;}if(this.value==defaultValues[$(this).attr('id')]){this.value="";}$(this).blur(function(){$(this).removeClass(cssClass);if(this.value==""){this.value=defaultValues[$(this).attr('id')];$(this).addClass('noValue');}else{$(this).removeClass('noValue');}});});});}; /**/ function doPostBack(value,url){url=(url)?url:'';$(document.body).append('
');$('#doPostBack').submit();} /**/ function logIn(url, hash){$.get("./engine/forms/logIn.php",{url:url, hash:hash},function(data){$(data).appendTo('body');/*$('#logInCont').overlay({speed:'slow',top:'30%',mask:{opacity:0.6,color:null},api: true}).load();*/$("#username").focus();});} /**/ $.fn.designTable=function(arg){if(typeof arg == 'undefined'){arg=new Object();}if(typeof arg.highlight == 'undefined'){arg.highlight=true;}$(this).attr('cellspacing','1');$(this).attr('cellpadding','0');var designItem = ($(this).find('tbody').length)?'tbody > tr':'tr';$(this).find(designItem+':even').addClass('table-even');$(this).find(designItem+':odd').addClass('table-odd');if(arg.highlight){$(this).find(designItem).hover(function(){$(this).addClass('table-hover');},function(){$(this).removeClass('table-hover');});}} /**/ $.fn.designList=function(){$(this).find('li:even').addClass('li-even');$(this).find('li:odd').addClass('li-odd');$(this).find('li').hover(function(){$(this).addClass('li-hover');},function(){$(this).removeClass('li-hover');});} /**/ $.fn.delay=function(t,n){return this.queue((n||"fx"),function(){var s=this;setTimeout(function(){$.dequeue(s);},t);});} /**/ $.preloadImages = function(){for(var i = 0; i").attr("src",arguments[i]);}} /*browser warning*/ function browserWarning(header,msg,linkName) { $('body').append('
'+header+'
'+msg+'
'); $("#browserWarningClose a").on('click',function(){$("#browserWarning").hide();return false;}); } /*videoconverter*/ function convertVideo(a){if((a+"").indexOf("youtu")>=0){videoName=a.split("v=");if(videoName.length>1){videoName=videoName[1].split("&");a="https://www.youtube.com/embed/"+videoName[0]}else{a=a.replace("youtu.be/","www.youtube.com/embed/")}a=a+"?wmode=transparent&autoplay=1&autohide=1&acontrols=1&showinfo=1"}else if((a+"").indexOf("vimeo")>=0 && (a+"").indexOf("vimeo.com/user")==0){a=a.replace("vimeo.com/","player.vimeo.com/video/")+"?title=0&byline=0&portrait=0&autoplay=1"}return a} /*! * jQuery Cookie Plugin v1.4.0 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl * Released under the MIT license */ (function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof exports==="object"){e(require("jquery"))}else{e(jQuery)}})(function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function r(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function s(e){if(e.indexOf('"')===0){e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{e=decodeURIComponent(e.replace(t," "));return u.json?JSON.parse(e):e}catch(n){}}function o(t,n){var r=u.raw?t:s(t);return e.isFunction(n)?n(r):r}var t=/\+/g;var u=e.cookie=function(t,s,a){if(s!==undefined&&!e.isFunction(s)){a=e.extend({},u.defaults,a);if(typeof a.expires==="number"){var f=a.expires,l=a.expires=new Date;l.setTime(+l+f*864e5)}return document.cookie=[n(t),"=",i(s),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=t?undefined:{};var h=document.cookie?document.cookie.split("; "):[];for(var p=0,d=h.length;p' + serverVariables['cookieAlertButtonText'] + ''; $elem = $(additionalHtml); $elem.find('#cookieAlertOkButton').click(function(){ $elem.remove(); addToStorage('cookieCheck', 'isDone', 'Done'); }); $('body').append($elem); } } }); /* COOKIE ALERT END */ /** * stripslashes * @param str * @returns {string} */ function stripslashes (str) { return (str + '').replace(/\\(.?)/g, function (s, n1) { switch (n1) { case '\\': return '\\'; case '0': return '\u0000'; case '': return ''; default: return n1; } }); }