(function($,document,window){var defaults={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:0.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:'@2x.$1',current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return $(this).attr('href')},title:function(){return this.title}},colorbox='colorbox',prefix='cbox',boxElement=prefix+'Element',event_open=prefix+'_open',event_load=prefix+'_load',event_complete=prefix+'_complete',event_cleanup=prefix+'_cleanup',event_closed=prefix+'_closed',event_purge=prefix+'_purge',$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$groupControls,$events=$(''),settings,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,index,photo,open,active,closing,loadingTimer,publicMethod,div="div",requests=0,previousCSS={},init;function $tag(tag,id,css){var element=document.createElement(tag);if(id){element.id=prefix+id} if(css){element.style.cssText=css} return $(element)} function winheight(){return window.innerHeight?window.innerHeight:$(window).height()} function Settings(element,options){if(options!==Object(options)){options={}} this.cache={};this.el=element;this.value=function(key){var dataAttr;if(this.cache[key]===undefined){dataAttr=$(this.el).attr('data-cbox-'+key);if(dataAttr!==undefined){this.cache[key]=dataAttr}else if(options[key]!==undefined){this.cache[key]=options[key]}else if(defaults[key]!==undefined){this.cache[key]=defaults[key]}} return this.cache[key]};this.get=function(key){var value=this.value(key);return $.isFunction(value)?value.call(this.el,this):value}} function getIndex(increment){var max=$related.length,newIndex=(index+increment)%max;return(newIndex<0)?max+newIndex:newIndex} function setSize(size,dimension){return Math.round((/%/.test(size)?((dimension==='x'?$window.width():winheight())/100):1)*parseInt(size,10))} function isImage(settings,url){return settings.get('photo')||settings.get('photoRegex').test(url)} function retinaUrl(settings,url){return settings.get('retinaUrl')&&window.devicePixelRatio>1?url.replace(settings.get('photoRegex'),settings.get('retinaSuffix')):url} function trapFocus(e){if('contains'in $box[0]&&!$box[0].contains(e.target)&&e.target!==$overlay[0]){e.stopPropagation();$box.focus()}} function setClass(str){if(setClass.str!==str){$box.add($overlay).removeClass(setClass.str).addClass(str);setClass.str=str}} function getRelated(){index=0;if(rel&&rel!=='nofollow'){$related=$('.'+boxElement).filter(function(){var options=$.data(this,colorbox);var settings=new Settings(this,options);return(settings.get('rel')===rel)});index=$related.index(settings.el);if(index===-1){$related=$related.add(settings.el);index=$related.length-1}}else{$related=$(settings.el)}} function trigger(event){$(document).trigger(event);$events.triggerHandler(event)} var slideshow=(function(){var active,className=prefix+"Slideshow_",click="click."+prefix,timeOut;function clear(){clearTimeout(timeOut)} function set(){if(settings.get('loop')||$related[index+1]){clear();timeOut=setTimeout(publicMethod.next,settings.get('slideshowSpeed'))}} function start(){$slideshow.html(settings.get('slideshowStop')).unbind(click).one(click,stop);$events.bind(event_complete,set).bind(event_load,clear);$box.removeClass(className+"off").addClass(className+"on")} function stop(){clear();$events.unbind(event_complete,set).unbind(event_load,clear);$slideshow.html(settings.get('slideshowStart')).unbind(click).one(click,function(){publicMethod.next();start()});$box.removeClass(className+"on").addClass(className+"off")} function reset(){active=!1;$slideshow.hide();clear();$events.unbind(event_complete,set).unbind(event_load,clear);$box.removeClass(className+"off "+className+"on")} return function(){if(active){if(!settings.get('slideshow')){$events.unbind(event_cleanup,reset);reset()}}else{if(settings.get('slideshow')&&$related[1]){active=!0;$events.one(event_cleanup,reset);if(settings.get('slideshowAuto')){start()}else{stop()} $slideshow.show()}}}}());function launch(element){var options;if(!closing){options=$(element).data('colorbox');settings=new Settings(element,options);rel=settings.get('rel');getRelated();if(!open){open=active=!0;setClass(settings.get('className'));$box.css({visibility:'hidden',display:'block'});$loaded=$tag(div,'LoadedContent','width:0; height:0; overflow:hidden; visibility:hidden');$content.css({width:'',height:''}).append($loaded);interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(!0)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(!0)-$content.width();loadedHeight=$loaded.outerHeight(!0);loadedWidth=$loaded.outerWidth(!0);settings.w=setSize(settings.get('initialWidth'),'x');settings.h=setSize(settings.get('initialHeight'),'y');$loaded.css({width:'',height:settings.h});publicMethod.position();trigger(event_open);settings.get('onOpen');$groupControls.add($title).hide();$box.focus();if(settings.get('trapFocus')){if(document.addEventListener){document.addEventListener('focus',trapFocus,!0);$events.one(event_closed,function(){document.removeEventListener('focus',trapFocus,!0)})}} if(settings.get('returnFocus')){$events.one(event_closed,function(){$(settings.el).focus()})}} $overlay.css({opacity:parseFloat(settings.get('opacity')),cursor:settings.get('overlayClose')?"pointer":"auto",visibility:'visible'}).show();if(settings.get('closeButton')){$close.html(settings.get('close')).appendTo($content)}else{$close.appendTo('
')} load()}} function appendHTML(){if(!$box&&document.body){init=!1;$window=$(window);$box=$tag(div).attr({id:colorbox,'class':$.support.opacity===!1?prefix+'IE':'',role:'dialog',tabindex:'-1'}).hide();$overlay=$tag(div,"Overlay").hide();$loadingOverlay=$([$tag(div,"LoadingOverlay")[0],$tag(div,"LoadingGraphic")[0]]);$wrap=$tag(div,"Wrapper");$content=$tag(div,"Content").append($title=$tag(div,"Title"),$current=$tag(div,"Current"),$prev=$('\n
\n
\n
\n \n \n
\n \n \n
\n \n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n').replace(/(^|\n)\s*/g,""),vt=function(t){var e,n,o,i,r,a,c,s,u,l,d,p,f,m,h,g=!!(e=Y())&&(e.parentNode.removeChild(e),ft([document.documentElement,document.body],[W["no-backdrop"],W["toast-shown"],W["has-column"]]),!0);ct()?U("SweetAlert2 requires document to initialize"):((n=document.createElement("div")).className=W.container,g&&pt(n,W["no-transition"]),V(n,gt),(o="string"==typeof(i=t.target)?document.querySelector(i):i).appendChild(n),r=t,(a=Z()).setAttribute("role",r.toast?"alert":"dialog"),a.setAttribute("aria-live",r.toast?"polite":"assertive"),r.toast||a.setAttribute("aria-modal","true"),c=o,"rtl"===window.getComputedStyle(c).direction&&pt(Y(),W.rtl),s=k(),u=mt(s,W.input),l=mt(s,W.file),d=s.querySelector(".".concat(W.range," input")),p=s.querySelector(".".concat(W.range," output")),f=mt(s,W.select),m=s.querySelector(".".concat(W.checkbox," input")),h=mt(s,W.textarea),u.oninput=st,l.onchange=st,f.onchange=st,m.onchange=st,h.oninput=st,d.oninput=function(t){st(t),p.value=d.value},d.onchange=function(t){st(t),d.nextSibling.value=d.value})},bt=function(t,e){t.jquery?yt(e,t):V(e,t.toString())},yt=function(t,e){if(t.textContent="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},wt=function(){if(ct())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&void 0!==t.style[n])return e[n];return!1}();function Ct(t,e,n){var o;ot(t,n["show".concat((o=e).charAt(0).toUpperCase()+o.slice(1),"Button")],"inline-block"),V(t,n["".concat(e,"ButtonText")]),t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=W[e],H(t,n,"".concat(e,"Button")),pt(t,n["".concat(e,"ButtonClass")])}function kt(t,e){var n,o,i,r,a,c,s,u,l=Y();l&&(n=l,"string"==typeof(o=e.backdrop)?n.style.background=o:o||pt([document.documentElement,document.body],W["no-backdrop"]),!e.backdrop&&e.allowOutsideClick&&N('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),i=l,(r=e.position)in W?pt(i,W[r]):(N('The "position" parameter is not valid, defaulting to "center"'),pt(i,W.center)),a=l,!(c=e.grow)||"string"!=typeof c||(s="grow-".concat(c))in W&&pt(a,W[s]),H(l,e,"container"),(u=document.body.getAttribute("data-swal2-queue-step"))&&(l.setAttribute("data-queue-step",u),document.body.removeAttribute("data-swal2-queue-step")))}function xt(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}var Pt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},At=["input","file","range","select","radio","checkbox","textarea"],Et=function(t){if(!Tt[t.input])return U('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=Ot(t.input),n=Tt[t.input](e,t);et(n),setTimeout(function(){X(n)})},Bt=function(t,e){var n=J(k(),t);if(n)for(var o in!function(t){for(var e=0;e=s.progressSteps.length&&N("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.progressSteps.forEach(function(t,e){var n,o,i,r,a,c=(n=t,o=document.createElement("li"),pt(o,W["progress-step"]),V(o,n),o);u.appendChild(c),e===l&&pt(c,W["active-progress-step"]),e!==s.progressSteps.length-1&&(r=t,a=document.createElement("li"),pt(a,W["progress-step-line"]),r.progressStepsDistance&&(a.style.width=r.progressStepsDistance),i=a,u.appendChild(i))})}function It(t,e){var n,o,i,r,a,c,s,u,l=O();H(l,e,"header"),qt(0,e),n=t,o=e,(r=Pt.innerParams.get(n))&&o.icon===r.icon&&w()?H(w(),o,"icon"):(Rt(),o.icon&&(-1!==Object.keys(K).indexOf(o.icon)?(i=y(".".concat(W.icon,".").concat(K[o.icon])),et(i),Dt(i,o),Ht(),H(i,o,"icon"),pt(i,o.showClass.icon)):U('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(o.icon,'"')))),function(t){var e=x();if(!t.imageUrl)return nt(e);et(e,""),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),tt(e,"width",t.imageWidth),tt(e,"height",t.imageHeight),e.className=W.image,H(e,t,"image")}(e),a=e,c=C(),ot(c,a.title||a.titleText),a.title&&ut(a.title,c),a.titleText&&(c.innerText=a.titleText),H(c,a,"title"),s=e,u=j(),V(u,s.closeButtonHtml),H(u,s,"closeButton"),ot(u,s.showCloseButton),u.setAttribute("aria-label",s.closeButtonAriaLabel)}function Mt(t,e){var n,o,i,r;n=e,o=Z(),tt(o,"width",n.width),tt(o,"padding",n.padding),n.background&&(o.style.background=n.background),_t(o,n),kt(0,e),It(t,e),Lt(t,e),lt(0,e),i=e,r=T(),ot(r,i.footer),i.footer&&ut(i.footer,r),H(r,i,"footer"),"function"==typeof e.onRender&&e.onRender(Z())}function Vt(){return E()&&E().click()}var Rt=function(){for(var t=n(),e=0;e\n \n
\n
\n '):"error"===e.icon?V(t,'\n \n \n \n \n '):V(t,Nt({question:"?",warning:"!",info:"i"}[e.icon]))},Nt=function(t){return'
').concat(t,"
")},Ut=[],_t=function(t,e){t.className="".concat(W.popup," ").concat(ht(t)?e.showClass.popup:""),e.toast?(pt([document.documentElement,document.body],W["toast-shown"]),pt(t,W.toast)):pt(t,W.modal),H(t,e,"popup"),"string"==typeof e.customClass&&pt(t,e.customClass),e.icon&&pt(t,W["icon-".concat(e.icon)])};function Ft(){var t=Z();t||rn.fire(),t=Z();var e=S(),n=E();et(e),et(n,"inline-block"),pt([t,e],W.loading),n.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()}function zt(){return new Promise(function(t){var e=window.scrollX,n=window.scrollY;$t.restoreFocusTimeout=setTimeout(function(){$t.previousActiveElement&&$t.previousActiveElement.focus?($t.previousActiveElement.focus(),$t.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)})}function Wt(){if($t.timeout)return function(){var t=L(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),o=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(o,"%")}(),$t.timeout.stop()}function Kt(){if($t.timeout){var t=$t.timeout.start();return at(t),t}}function Yt(t){return Object.prototype.hasOwnProperty.call(Jt,t)}function Zt(t){return Gt[t]}function Qt(t){for(var e in t)Yt(i=e)||N('Unknown parameter "'.concat(i,'"')),t.toast&&(o=e,-1!==te.indexOf(o)&&N('The parameter "'.concat(o,'" is incompatible with toasts'))),Zt(n=e)&&g(n,Zt(n));var n,o,i}var $t={},Jt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,onRender:void 0,onClose:void 0,onAfterClose:void 0,onDestroy:void 0,scrollbarPadding:!0},Xt=["title","titleText","text","html","footer","icon","hideClass","customClass","allowOutsideClick","allowEscapeKey","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","buttonsStyling","reverseButtons","imageUrl","imageWidth","imageHeight","imageAlt","progressSteps","currentProgressStep","onClose","onAfterClose","onDestroy"],Gt={animation:'showClass" and "hideClass'},te=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],ee=Object.freeze({isValidParameter:Yt,isUpdatableParameter:function(t){return-1!==Xt.indexOf(t)},isDeprecatedParameter:Zt,argsToParams:function(o){var i={};return"object"!==r(o[0])||b(o[0])?["title","html","icon"].forEach(function(t,e){var n=o[e];"string"==typeof n||b(n)?i[t]=n:void 0!==n&&U("Unexpected type of ".concat(t,'! Expected "string" or "Element", got ').concat(r(n)))}):s(i,o[0]),i},isVisible:function(){return ht(Z())},clickConfirm:Vt,clickCancel:function(){return B()&&B().click()},getContainer:Y,getPopup:Z,getTitle:C,getContent:k,getHtmlContainer:function(){return e(W["html-container"])},getImage:x,getIcon:w,getIcons:n,getCloseButton:j,getActions:S,getConfirmButton:E,getCancelButton:B,getHeader:O,getFooter:T,getTimerProgressBar:L,getFocusableElements:q,getValidationMessage:A,isLoading:M,fire:function(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.innerHeight&&($.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat($.previousBodyPadding+function(){var t=document.createElement("div");t.className=W["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))}function ie(){return!!window.MSInputMethodContext&&!!document.documentMode}function re(){var t=Y(),e=Z();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")}var ae=function(){var e,t=Y();t.ontouchstart=function(t){e=ce(t.target)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())}},ce=function(t){var e=Y();return t===e||!(it(e)||"INPUT"===t.tagName||it(k())&&k().contains(t))},se={swalPromiseResolve:new WeakMap};function ue(t,e,n,o){var i;n?pe(t,o):(zt().then(function(){return pe(t,o)}),$t.keydownTarget.removeEventListener("keydown",$t.keydownHandler,{capture:$t.keydownListenerCapture}),$t.keydownHandlerAdded=!1),e.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&e.parentNode.removeChild(e),I()&&(null!==$.previousBodyPadding&&(document.body.style.paddingRight="".concat($.previousBodyPadding,"px"),$.previousBodyPadding=null),R(document.body,W.iosfix)&&(i=parseInt(document.body.style.top,10),ft(document.body,W.iosfix),document.body.style.top="",document.body.scrollTop=-1*i),"undefined"!=typeof window&&ie()&&window.removeEventListener("resize",re),h(document.body.children).forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})),ft([document.documentElement,document.body],[W.shown,W["height-auto"],W["no-backdrop"],W["toast-shown"],W["toast-column"]])}function le(t){var e,n,o,i=Z();i&&(e=Pt.innerParams.get(this))&&!R(i,e.hideClass.popup)&&(n=se.swalPromiseResolve.get(this),ft(i,e.showClass.popup),pt(i,e.hideClass.popup),o=Y(),ft(o,e.showClass.backdrop),pt(o,e.hideClass.backdrop),function(t,e,n){var o=Y(),i=wt&&rt(e),r=n.onClose,a=n.onAfterClose;if(r!==null&&typeof r==="function"){r(e)}if(i){de(t,e,o,a)}else{ue(t,o,Q(),a)}}(this,i,e),void 0!==t?(t.isDismissed=void 0!==t.dismiss,t.isConfirmed=void 0===t.dismiss):t={isDismissed:!0,isConfirmed:!1},n(t||{}))}var de=function(t,e,n,o){$t.swalCloseEventFinishedCallback=ue.bind(null,t,n,Q(),o),e.addEventListener(wt,function(t){t.target===e&&($t.swalCloseEventFinishedCallback(),delete $t.swalCloseEventFinishedCallback)})},pe=function(t,e){setTimeout(function(){"function"==typeof e&&e(),t._destroy()})};function fe(t,e,n){var o=Pt.domCache.get(t);e.forEach(function(t){o[t].disabled=n})}function me(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode.querySelectorAll("input"),o=0;o")),vt(t)}function be(t){var e=Y(),n=Z();"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n),Oe(e,n,t),Be(e,n),I()&&Se(e,t.scrollbarPadding),Q()||$t.previousActiveElement||($t.previousActiveElement=document.activeElement),"function"==typeof t.onOpen&&setTimeout(function(){return t.onOpen(n)}),ft(e,W["no-transition"])}function ye(t){var e,n=Z();t.target===n&&(e=Y(),n.removeEventListener(wt,ye),e.style.overflowY="auto")}function we(t,e){"select"===e.input||"radio"===e.input?qe(t,e):-1!==["text","email","number","tel","textarea"].indexOf(e.input)&&v(e.inputValue)&&Ie(t,e)}function Ce(t,e){t.disableButtons(),e.input?Re(t,e):He(t,e,!0)}function ke(t,e){t.disableButtons(),e(z.cancel)}function xe(t,e){t.closePopup({value:e})}function Pe(e,t,n,o){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1),n.toast||(t.keydownHandler=function(t){return Ue(e,t,o)},t.keydownTarget=n.keydownListenerCapture?window:Z(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}function Ae(t,e,n){var o=q(),i=0;if(i');if(title)$m.append('

'+title+'

');if(message)$m.append('

'+message+'

');if(timeout===undefined)timeout=3000;var callBlock=function(opts){opts=opts||{};$.blockUI({message:$m,fadeIn:typeof opts.fadeIn!=='undefined'?opts.fadeIn:700,fadeOut:typeof opts.fadeOut!=='undefined'?opts.fadeOut:1000,timeout:typeof opts.timeout!=='undefined'?opts.timeout:timeout,centerY:false,showOverlay:false,onUnblock:onClose,css:$.blockUI.defaults.growlCSS});};callBlock();var nonmousedOpacity=$m.css('opacity');$m.mouseover(function(){callBlock({fadeIn:0,timeout:30000});var displayBlock=$('.blockMsg');displayBlock.stop();displayBlock.fadeTo(300,1);}).mouseout(function(){$('.blockMsg').fadeOut(1000);});};$.fn.block=function(opts){if(this[0]===window){$.blockUI(opts);return this;} var fullOpts=$.extend({},$.blockUI.defaults,opts||{});this.each(function(){var $el=$(this);if(fullOpts.ignoreIfBlocked&&$el.data('blockUI.isBlocked')) return;$el.unblock({fadeOut:0});});return this.each(function(){if($.css(this,'position')=='static'){this.style.position='relative';$(this).data('blockUI.static',true);} this.style.zoom=1;install(this,opts);});};$.fn.unblock=function(opts){if(this[0]===window){$.unblockUI(opts);return this;} return this.each(function(){remove(this,opts);});};$.blockUI.version=2.70;$.blockUI.defaults={message:'

Please wait...

',title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:'30%',top:'40%',left:'35%',textAlign:'center',color:'#000',border:'3px solid #aaa',backgroundColor:'#fff',cursor:'wait'},themedCSS:{width:'30%',top:'40%',left:'35%'},overlayCSS:{backgroundColor:'#000',opacity:0.6,cursor:'wait'},cursorReset:'default',growlCSS:{width:'350px',top:'10px',left:'',right:'10px',border:'none',padding:'5px',opacity:0.6,cursor:'default',color:'#fff',backgroundColor:'#000','-webkit-border-radius':'10px','-moz-border-radius':'10px','border-radius':'10px'},iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank',forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,focusableElements:':input:enabled:visible',onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:'blockMsg',ignoreIfBlocked:false};var pageBlock=null;var pageBlockEls=[];function install(el,opts){var css,themedCSS;var full=(el==window);var msg=(opts&&opts.message!==undefined?opts.message:undefined);opts=$.extend({},$.blockUI.defaults,opts||{});if(opts.ignoreIfBlocked&&$(el).data('blockUI.isBlocked')) return;opts.overlayCSS=$.extend({},$.blockUI.defaults.overlayCSS,opts.overlayCSS||{});css=$.extend({},$.blockUI.defaults.css,opts.css||{});if(opts.onOverlayClick) opts.overlayCSS.cursor='pointer';themedCSS=$.extend({},$.blockUI.defaults.themedCSS,opts.themedCSS||{});msg=msg===undefined?opts.message:msg;if(full&&pageBlock) remove(window,{fadeOut:0});if(msg&&typeof msg!='string'&&(msg.parentNode||msg.jquery)){var node=msg.jquery?msg[0]:msg;var data={};$(el).data('blockUI.history',data);data.el=node;data.parent=node.parentNode;data.display=node.style.display;data.position=node.style.position;if(data.parent) data.parent.removeChild(node);} $(el).data('blockUI.onUnblock',opts.onUnblock);var z=opts.baseZ;var lyr1,lyr2,lyr3,s;if(msie||opts.forceIframe) lyr1=$('');else lyr1=$('');if(opts.theme) lyr2=$('');else lyr2=$('');if(opts.theme&&full){s='';} else if(opts.theme){s='';} else if(full){s='';} else{s='';} lyr3=$(s);if(msg){if(opts.theme){lyr3.css(themedCSS);lyr3.addClass('ui-widget-content');} else lyr3.css(css);} if(!opts.theme) lyr2.css(opts.overlayCSS);lyr2.css('position',full?'fixed':'absolute');if(msie||opts.forceIframe) lyr1.css('opacity',0.0);var layers=[lyr1,lyr2,lyr3],$par=full?$('body'):$(el);$.each(layers,function(){this.appendTo($par);});if(opts.theme&&opts.draggable&&$.fn.draggable){lyr3.draggable({handle:'.ui-dialog-titlebar',cancel:'li'});} var expr=setExpr&&(!$.support.boxModel||$('object,embed',full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.support.boxModel) $('html,body').css('height','100%');if((ie6||!$.support.boxModel)&&!full){var t=sz(el,'borderTopWidth'),l=sz(el,'borderLeftWidth');var fixT=t?'(0 - '+t+')':0;var fixL=l?'(0 - '+l+')':0;} $.each(layers,function(i,o){var s=o[0].style;s.position='absolute';if(i<2){if(full) s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');else s.setExpression('height','this.parentNode.offsetHeight + "px"');if(full) s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');else s.setExpression('width','this.parentNode.offsetWidth + "px"');if(fixL)s.setExpression('left',fixL);if(fixT)s.setExpression('top',fixT);} else if(opts.centerY){if(full)s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');s.marginTop=0;} else if(!opts.centerY&&full){var top=(opts.css&&opts.css.top)?parseInt(opts.css.top,10):0;var expression='((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';s.setExpression('top',expression);}});} if(msg){if(opts.theme) lyr3.find('.ui-widget-content').append(msg);else lyr3.append(msg);if(msg.jquery||msg.nodeType) $(msg).show();} if((msie||opts.forceIframe)&&opts.showOverlay) lyr1.show();if(opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp;var cb1=(opts.showOverlay&&!msg)?cb:noOp;var cb2=msg?cb:noOp;if(opts.showOverlay) lyr2._fadeIn(opts.fadeIn,cb1);if(msg) lyr3._fadeIn(opts.fadeIn,cb2);} else{if(opts.showOverlay) lyr2.show();if(msg) lyr3.show();if(opts.onBlock) opts.onBlock.bind(lyr3)();} bind(1,el,opts);if(full){pageBlock=lyr3[0];pageBlockEls=$(opts.focusableElements,pageBlock);if(opts.focusInput) setTimeout(focus,20);} else center(lyr3[0],opts.centerX,opts.centerY);if(opts.timeout){var to=setTimeout(function(){if(full) $.unblockUI(opts);else $(el).unblock(opts);},opts.timeout);$(el).data('blockUI.timeout',to);}} function remove(el,opts){var count;var full=(el==window);var $el=$(el);var data=$el.data('blockUI.history');var to=$el.data('blockUI.timeout');if(to){clearTimeout(to);$el.removeData('blockUI.timeout');} opts=$.extend({},$.blockUI.defaults,opts||{});bind(0,el,opts);if(opts.onUnblock===null){opts.onUnblock=$el.data('blockUI.onUnblock');$el.removeData('blockUI.onUnblock');} var els;if(full) els=$('body').children().filter('.blockUI').add('body > .blockUI');else els=$el.find('>.blockUI');if(opts.cursorReset){if(els.length>1) els[1].style.cursor=opts.cursorReset;if(els.length>2) els[2].style.cursor=opts.cursorReset;} if(full) pageBlock=pageBlockEls=null;if(opts.fadeOut){count=els.length;els.stop().fadeOut(opts.fadeOut,function(){if(--count===0) reset(els,data,opts,el);});} else reset(els,data,opts,el);} function reset(els,data,opts,el){var $el=$(el);if($el.data('blockUI.isBlocked')) return;els.each(function(i,o){if(this.parentNode) this.parentNode.removeChild(this);});if(data&&data.el){data.el.style.display=data.display;data.el.style.position=data.position;data.el.style.cursor='default';if(data.parent) data.parent.appendChild(data.el);$el.removeData('blockUI.history');} if($el.data('blockUI.static')){$el.css('position','static');} if(typeof opts.onUnblock=='function') opts.onUnblock(el,opts);var body=$(document.body),w=body.width(),cssW=body[0].style.width;body.width(w-1).width(w);body[0].style.width=cssW;} function bind(b,el,opts){var full=el==window,$el=$(el);if(!b&&(full&&!pageBlock||!full&&!$el.data('blockUI.isBlocked'))) return;$el.data('blockUI.isBlocked',b);if(!full||!opts.bindEvents||(b&&!opts.showOverlay)) return;var events='mousedown mouseup keydown keypress keyup touchstart touchend touchmove';if(b) $(document).bind(events,opts,handler);else $(document).unbind(events,handler);} function handler(e){if(e.type==='keydown'&&e.keyCode&&e.keyCode==9){if(pageBlock&&e.data.constrainTabKey){var els=pageBlockEls;var fwd=!e.shiftKey&&e.target===els[els.length-1];var back=e.shiftKey&&e.target===els[0];if(fwd||back){setTimeout(function(){focus(back);},10);return false;}}} var opts=e.data;var target=$(e.target);if(target.hasClass('blockOverlay')&&opts.onOverlayClick) opts.onOverlayClick(e);if(target.parents('div.'+opts.blockMsgClass).length>0) return true;return target.parents().children().filter('div.blockUI').length===0;} function focus(back){if(!pageBlockEls) return;var e=pageBlockEls[back===true?pageBlockEls.length-1:0];if(e) e.focus();} function center(el,x,y){var p=el.parentNode,s=el.style;var l=((p.offsetWidth-el.offsetWidth)/2)-sz(p,'borderLeftWidth');var t=((p.offsetHeight-el.offsetHeight)/2)-sz(p,'borderTopWidth');if(x)s.left=l>0?(l+'px'):'0';if(y)s.top=t>0?(t+'px'):'0';} function sz(el,p){return parseInt($.css(el,p),10)||0;}} if(typeof define==='function'&&define.amd&&define.amd.jQuery){define(['jquery'],setup);}else{setup(jQuery);}})(); (function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;} var validator=$.data(this[0],'validator');if(validator){return validator;} validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});} this.submit(function(event){if(validator.settings.debug) event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);} validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();} return false;} return true;} if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();} if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;} return handle();}else{validator.focusInvalid();return false;}});} return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages) settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;} var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}} var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);} return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1) return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&¶ms.constructor!=Array){params=$.makeArray(arguments).slice(1);} if(params.constructor!=Array){params=[params];} $.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted) this.element(element);else if(element.parentNode.name in this.submitted) this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);$(element).parent().find(".checkmark").addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);$(element).parent().find(".checkmark").removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"
Este campo es obligatorio",remote:"Please fix this field.",email:"
Debe ser una dirección email válida.",url:"Please enter a valid URL.",date:"
Introduzca una fecha válida.",dateISO:"Please enter a valid date (ISO).",number:"
Introduzca un número válido.",digits:"
Introduzca sólo números",phone:"
Introduzca sólo números + y espacios",creditcard:"Please enter a valid credit card number.",equalTo:"
No coinciden los valores introducidos.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("
No introduzca más de {0} caracteres."),minlength:$.validator.format("
Introduzca al menos {0} caracteres."),rangelength:$.validator.format("
Introduzca un valor entre {0} y {1} caracteres."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);} $(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler) $(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()) $(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);} return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;} if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);} this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});} this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});} this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm) $(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj) count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules())) return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];} var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;} dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;} if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id +", check the '"+rule.method+"' method",e);throw e;}} if(dependencyMismatch) return;if(this.objectLength(rules)) this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata) return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;iWarning: No message defined for "+element.name+"");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);} this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper) toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);} if(this.errorList.length){this.toShow=this.toShow.add(this.containers);} if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}} if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}} this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();} if(!this.labelContainer.append(label).length) this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);} if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);} this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return /radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element)) return this.findByName(element.name).filter(':checked').length;} return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0) this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},phone:{phone:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}} if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;} return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};} return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;} if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;} if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;} if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}} if(rules.messages){delete rules.messages;} return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;} return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element)) return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element)) return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element)) return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name]) this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);} previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";} return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){var d=new Date();return this.optional(element)||!/Invalid|NaN/.test(new Date(d.toLocaleDateString(value)))||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},phone:function(value,element){return this.optional(element)||/^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)])?([-.]?[\s]?[0-9])+$/.test(value);},creditcard:function(value,element){if(this.optional(element)) return"dependency-mismatch";if(/[^0-9-]+/.test(value)) return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9) nDigit-=9;} nCheck+=nDigit;bEven=!bEven;} return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery); (function($){$.fn.TinyToggle={defaults:{labels:{both:null,check:null,uncheck:null},type:"toggle",size:"medium",palette:"standard",colors:null,icons:null,group:null,disabled:false,onReady:null,onClick:null,onChange:null,onCheck:null,onUncheck:null,onEnabled:null,onDisabled:null},types:{toggle:{checked:"tt-switch-on",unchecked:"tt-switch-off"},check:{checked:"tt-check-v",unchecked:"tt-check-v"},circle:{checked:"tt-check-circle-empty-v",unchecked:"tt-check-circle-empty-v"},square:{checked:"tt-check-square",unchecked:"tt-uncheck-square"},square_v:{checked:"tt-check-square-outbound-v",unchecked:"tt-check-square-outbound-v"},power:{checked:"tt-power",unchecked:"tt-power"},dot:{checked:"tt-check-circle",unchecked:"tt-uncheck-circle"},like:{checked:"tt-like",unchecked:"tt-like"},watch:{checked:"tt-watch",unchecked:"tt-watch"},star:{checked:"tt-star",unchecked:"tt-star"},lock:{checked:"tt-lock",unchecked:"tt-lock"},heart:{checked:"tt-heart",unchecked:"tt-heart"},smile:{checked:"tt-smile",unchecked:"tt-smile"},},palettes:{standard:{check:"#009900",uncheck:"#999999"},black:{check:"#000000",uncheck:"#999999"},white:{check:"#FFFFFF",uncheck:"#999999"},blue:{check:"#0066FF",uncheck:"#999999"},red:{check:"#CC0000",uncheck:"#999999"},green:{check:"#009933",uncheck:"#999999"},purple:{check:"#CC3399",uncheck:"#999999"},yellow:{check:"#FFCC00",uncheck:"#999999"}},sizes:{mini:"1em",small:"1.2em",medium:"1.5em",large:"2em",big:"2.5em",huge:"3em",monster:"4em",giant:"5em"}};$.fn.tinyToggle=function(method){if(_tinyToggleMethods[method]){return _tinyToggleMethods[method].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof method==="object"||!method){return _tinyToggleMethods.init.apply(this,arguments)}else{$.error("Method "+method+" does not exist on $.tinyToggle")}}};var _tinyToggleMethods={init:function(options){if(!options){options={}}return this.each(function(){var opt=$.extend({},$.fn.TinyToggle.defaults,options);var me=$(this);me.hide();var wrapper=me.parent();var container=$("
").addClass("tt").append(me);var span=$("").addClass("tt-icon");var icon=$("");span.append(icon);if(me.data("tt-group")!=undefined){opt.group=me.data("tt-group")}opt.labels=$.extend({},options.labels);if(me.data("tt-label")!=undefined){opt.labels.both=me.data("tt-label")}if(me.data("tt-label-check")!=undefined){opt.labels.check=me.data("tt-label-check")}if(me.data("tt-label-uncheck")!=undefined){opt.labels.uncheck=me.data("tt-label-uncheck")}if(me.attr("disabled")!=undefined){opt.disabled=true}if(opt.disabled){container.addClass("tt-disabled")}if(me.data("tt-size")!=undefined){opt.size=me.data("tt-size")}var fontsize=$.fn.TinyToggle.sizes[opt.size];if(me.data("tt-custom-size")!=undefined){fontsize=me.data("tt-custom-size")}container.css("font-size",fontsize);opt.icons=null;if(me.data("tt-type")!=undefined){if($.fn.TinyToggle.types[me.data("tt-type")]!=undefined){opt.type=me.data("tt-type")}}opt.icons=$.extend({},$.fn.TinyToggle.types[opt.type]);if(me.data("tt-icon-check")!=undefined){opt.icons={checked:me.data("tt-icon-check"),unchecked:me.data("tt-icon-check")}}if(me.data("tt-icon-uncheck")!=undefined){opt.icons.unchecked=me.data("tt-icon-uncheck")}if(me.data("tt-palette")!=undefined){if($.fn.TinyToggle.palettes[me.data("tt-palette")]!=undefined){opt.palette=me.data("tt-palette")}}if(options.colors!=null){opt.colors=$.extend({},options.colors)}else{opt.colors=$.extend({},$.fn.TinyToggle.palettes[opt.palette])}if(me.data("tt-color-check")!=undefined){opt.colors.check=me.data("tt-color-check")}if(me.data("tt-color-uncheck")!=undefined){opt.colors.uncheck=me.data("tt-color-uncheck")}var check=me.is(":checked");if(check){icon.addClass(opt.icons.checked);span.css("color",opt.colors.check)}else{icon.addClass(opt.icons.unchecked);span.css("color",opt.colors.uncheck)}span.addClass("tt-switch-color");container.append(span);if(opt.labels){var init_label=opt.labels.both;if(check&&opt.labels.check){init_label=opt.labels.check}else{if(!check&&opt.labels.uncheck){init_label=opt.labels.uncheck}}if(init_label!=null&&init_label!=""){var label_tag=$("").addClass("tt-label").html(init_label);label_tag.click(function(){if(!me.data().disabled){me.tinyToggle("toggle");if($.isFunction(me.data().onClick)){me.data().onClick.call(this,me)}}});label_tag.hover(function(){if(!me.data("disabled")){$(this).parent().find("span.tt-icon").addClass("tt-hover")}},function(){if(!me.data("disabled")){$(this).parent().find("span.tt-icon").removeClass("tt-hover")}});container.append(label_tag)}}wrapper.append(container);opt.ui=container;icon.click(function(){if(!me.data().disabled){me.tinyToggle("toggle");if($.isFunction(me.data().onClick)){me.data().onClick.call(this,me)}}});icon.hover(function(){if(!me.data("disabled")){$(this).addClass("tt-hover")}},function(){if(!me.data("disabled")){$(this).removeClass("tt-hover")}});if($.isFunction(opt.onReady)){opt.onReady.call(this,me)}me.data(opt)})},toggle:function(group){return this.each(function(){var me=$(this);var data=me.data();var check=me.is(":checked");if(group==undefined||data.group==group){if(check){me.prop("checked",false).removeAttr("checked")}else{me.prop("checked",true).attr("checked","checked")}me.tinyToggle("refresh");if($.isFunction(data.onChange)){data.onChange.call(this,me,me.is(":checked"))}}})},refresh:function(group){return this.each(function(){var me=$(this);var data=me.data();var check=me.is(":checked");if(group==undefined||data.group==group){if(check){data.ui.find("i").removeClass(data.icons.unchecked).addClass(data.icons.checked);data.ui.find("span.tt-icon").css("color",data.colors.check);if(data.labels.check){data.ui.find(".tt-label").html(data.labels.check)}if($.isFunction(data.onCheck)){data.onCheck.call(this,me)}}else{data.ui.find("i").removeClass(data.icons.checked).addClass(data.icons.unchecked);data.ui.find("span.tt-icon").css("color",data.colors.uncheck);if(data.labels.uncheck){data.ui.find(".tt-label").html(data.labels.uncheck)}if($.isFunction(data.onUncheck)){data.onUncheck.call(this,me)}}}})},check:function(group){return this.each(function(){var me=$(this);var data=me.data();if(group==undefined||data.group==group){if(!me.is(":checked")){me.tinyToggle("toggle")}}})},uncheck:function(group){return this.each(function(){var me=$(this);var data=me.data();if(group==undefined||data.group==group){if(me.is(":checked")){me.tinyToggle("toggle")}}})},disable:function(group){return this.each(function(){var me=$(this);var data=me.data();if(group==undefined||data.group==group){if(data.disabled==false){me.data("disabled",true);me.data("ui").addClass("tt-disabled");if($.isFunction(data.onDisabled)){data.onDisabled.call(this,me,me.is(":checked"))}}}})},enable:function(group){return this.each(function(){var me=$(this);var data=me.data();if(group==undefined||data.group==group){if(data.disabled==true){me.data("disabled",false);me.data("ui").removeClass("tt-disabled");if($.isFunction(data.onEnabled)){data.onEnabled.call(this,me,me.is(":checked"))}}}})},event:function(event_name,handler){return this.each(function(){var me=$(this);me.data(event_name,handler)})}}})(jQuery);