jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){f==undefined&&(f=1.70158);return d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){f==undefined&&(f=1.70158);return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){f==undefined&&(f=1.70158);if((b/=e/2)<1)return d/2*b*b*(((f*=1.525)+1)*b-f)+c;return d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(a,b,c,d,e){if(b<e/2)return jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c;return jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}}),function(a){function d(a){a=a.replace(/left|top/g,"0px"),a=a.replace(/right|bottom/g,"100%"),a=a.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var b=a.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(b[1],10),b[2],parseFloat(b[3],10),b[4]]}if(!document.defaultView||!document.defaultView.getComputedStyle){var b=a.curCSS;a.curCSS=function(a,c,d){c==="background-position"&&(c="backgroundPosition");if(c!=="backgroundPosition"||!a.currentStyle||a.currentStyle[c])return b.apply(this,arguments);var e=a.style;if(!d&&e&&e[c])return e[c];return b(a,"backgroundPositionX",d)+" "+b(a,"backgroundPositionY",d)}}var c=a.fn.animate;a.fn.animate=function(a){"background-position"in a&&(a.backgroundPosition=a["background-position"],delete a["background-position"]),"backgroundPosition"in a&&(a.backgroundPosition="("+a.backgroundPosition);return c.apply(this,arguments)},a.fx.step.backgroundPosition=function(b){if(!b.bgPosReady){var c=a.curCSS(b.elem,"backgroundPosition");c||(c="0px 0px"),c=d(c),b.start=[c[0],c[2]];var e=d(b.end);b.end=[e[0],e[2]],b.unit=[e[1],e[3]],b.bgPosReady=!0}var f=[];f[0]=(b.end[0]-b.start[0])*b.pos+b.start[0]+b.unit[0],f[1]=(b.end[1]-b.start[1])*b.pos+b.start[1]+b.unit[1],b.elem.style.backgroundPosition=f[0]+" "+f[1]}}(jQuery),function(a){function d(a,b,d){var e=a[0].parentNode,f=e.cycleTimeout;f&&(clearTimeout(f),e.cycleTimeout=0),b.nextSlide=b.currSlide+d,b.nextSlide<0?b.nextSlide=a.length-1:b.nextSlide>=a.length&&(b.nextSlide=0),c(a,b,1,d>=0);return!1}function c(b,d,e,f){if(!d.busy){var g=b[0].parentNode,h=b[d.currSlide],i=b[d.nextSlide];if(g.cycleTimeout===0&&!e)return;if(e||!g.cyclePause){d.before.length&&a.each(d.before,function(a,b){b.apply(i,[h,i,d,f])});var j=function(){a.browser.msie&&this.style.removeAttribute("filter"),a.each(d.after,function(a,b){b.apply(i,[h,i,d,f])})};d.nextSlide!=d.currSlide&&(d.busy=1,a.fn.cycle.custom(h,i,d,j));var k=d.nextSlide+1==b.length;d.nextSlide=k?0:d.nextSlide+1,d.currSlide=k?b.length-1:d.nextSlide-1}d.timeout&&(g.cycleTimeout=setTimeout(function(){c(b,d,0,!d.rev)},d.timeout))}}var b="Lite-1.0";a.fn.cycle=function(b){return this.each(function(){b=b||{},this.cycleTimeout&&clearTimeout(this.cycleTimeout),this.cycleTimeout=0,this.cyclePause=0;var e=a(this),f=b.slideExpr?a(b.slideExpr,this):e.children(),g=f.get();if(g.length<2)window.console&&window.console.log&&window.console.log("terminating; too few slides: "+g.length);else{var h=a.extend({},a.fn.cycle.defaults,b||{},a.metadata?e.metadata():a.meta?e.data():{});h.before=h.before?[h.before]:[],h.after=h.after?[h.after]:[],h.after.unshift(function(){h.busy=0});var i=this.className;h.width=parseInt((i.match(/w:(\d+)/)||[])[1])||h.width,h.height=parseInt((i.match(/h:(\d+)/)||[])[1])||h.height,h.timeout=parseInt((i.match(/t:(\d+)/)||[])[1])||h.timeout,e.css("position")=="static"&&e.css("position","relative"),h.width&&e.width(h.width),h.height&&h.height!="auto"&&e.height(h.height);var j=0;f.css({position:"absolute",top:0,left:0}).hide().each(function(b){a(this).css("z-index",g.length-b)}),a(g[j]).css("opacity",1).show(),a.browser.msie&&g[j].style.removeAttribute("filter"),h.fit&&h.width&&f.width(h.width),h.fit&&h.height&&h.height!="auto"&&f.height(h.height),h.pause&&e.hover(function(){this.cyclePause=1},function(){this.cyclePause=0}),a.fn.cycle.transitions.fade(e,f,h),f.each(function(){var b=a(this);this.cycleH=h.fit&&h.height?h.height:b.height(),this.cycleW=h.fit&&h.width?h.width:b.width()}),f.not(":eq("+j+")").css({opacity:0}),h.cssFirst&&a(f[j]).css(h.cssFirst);if(h.timeout){h.speed.constructor==String&&(h.speed={slow:600,fast:200}[h.speed]||400),h.sync||(h.speed=h.speed/2);while(h.timeout-h.speed<250)h.timeout+=h.speed}h.speedIn=h.speed,h.speedOut=h.speed,h.slideCount=g.length,h.currSlide=j,h.nextSlide=1;var k=f[j];h.before.length&&h.before[0].apply(k,[k,k,h,!0]),h.after.length>1&&h.after[1].apply(k,[k,k,h,!0]),h.click&&!h.next&&(h.next=h.click),h.next&&a(h.next).bind("click",function(){return d(g,h,h.rev?-1:1)}),h.prev&&a(h.prev).bind("click",function(){return d(g,h,h.rev?1:-1)}),h.timeout&&(this.cycleTimeout=setTimeout(function(){c(g,h,0,!h.rev)},h.timeout+(h.delay||0)))}})},a.fn.cycle.custom=function(b,c,d,e){var f=a(b),g=a(c);g.css({opacity:0});var h=function(){g.animate({opacity:1},d.speedIn,d.easeIn,e)};f.animate({opacity:0},d.speedOut,d.easeOut,function(){f.css({display:"none"}),d.sync||h()}),d.sync&&h()},a.fn.cycle.transitions={fade:function(b,c,d){c.not(":eq(0)").css("opacity",0),d.before.push(function(){a(this).show()})}},a.fn.cycle.ver=function(){return b},a.fn.cycle.defaults={timeout:4e3,speed:1e3,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}}(jQuery),function(a){a.extend(a.fn,{validate:function(b){if(!this.length)b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");else{var c=a.data(this[0],"validator");if(c)return c;c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=!0}),c.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){c.submitButton=this}),this.submit(function(b){function d(){if(c.settings.submitHandler){if(c.submitButton)var b=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm);c.settings.submitHandler.call(c,c.currentForm),c.submitButton&&b.remove();return!1}return!0}c.settings.debug&&b.preventDefault();if(c.cancelSubmit){c.cancelSubmit=!1;return d()}if(c.form()){if(c.pendingRequest){c.formSubmitted=!0;return!1}return d()}c.focusInvalid();return!1}));return c}},valid:function(){if(a(this[0]).is("form"))return this.validate().form();var b=!0,c=a(this[0].form).validate();this.each(function(){b&=c.element(this)});return b},removeAttrs:function(b){var c={},d=this;a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)});return c},rules:function(b,c){var d=this[0];if(b){var e=a.data(d.form,"validator").settings,f=e.rules,g=a.validator.staticRules(d);switch(b){case"add":a.extend(g,a.validator.normalizeRule(c)),f[d.name]=g,c.messages&&(e.messages[d.name]=a.extend(e.messages[d.name],c.messages));break;case"remove":if(!c){delete f[d.name];return g}var h={};a.each(c.split(/\s/),function(a,b){h[b]=g[b],delete g[b]});return h}}var i=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(d),a.validator.classRules(d),a.validator.attributeRules(d),a.validator.staticRules(d)),d);if(i.required){var j=i.required;delete i.required,i=a.extend({required:j},i)}return i}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+b.value)},filled:function(b){return!!a.trim(""+b.value)},unchecked:function(a){return!a.checked}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){if(arguments.length==1)return function(){var c=a.makeArray(arguments);c.unshift(b);return a.validator.format.apply(this,c)};arguments.length>2&&c.constructor!=Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!=Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),c)});return b},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:[],ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a){!this.checkable(a)&&(a.name in this.submitted||!this.optional(a))&&this.element(a)},onkeyup:function(a){(a.name in this.submitted||a==this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function d(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,"");c.settings[d]&&c.settings[d].call(c,this[0])}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var b=this.groups={};a.each(this.settings.groups,function(c,d){a.each(d.split(/\s/),function(a,d){b[d]=c})});var c=this.settings.rules;a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",d).validateDelegate(":radio, :checkbox, select, option","click",d),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){b=this.clean(b),this.lastElement=b,this.prepareElement(b),this.currentElements=a(b);var c=this.check(b);c?delete this.invalid[b.name]:this.invalid[b.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors();return c},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0;for(var c in a)b++;return b},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{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(a){return a.element.name==b.name}).length==1&&b},elements:function(){var b=this,c={};return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in c||!b.objectLength(a(this).rules()))return!1;c[this.name]=!0;return!0})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},check:function(b){b=this.clean(b),this.checkable(b)&&(b=this.findByName(b.name).not(this.settings.ignore)[0]);var c=a(b).rules(),d=!1;for(method in c){var e={method:method,parameters:c[method]};try{var f=a.validator.methods[method].call(this,b.value.replace(/\r/g,""),b,e.parameters);if(f=="dependency-mismatch"){d=!0;continue}d=!1;if(f=="pending"){this.toHide=this.toHide.not(this.errorsFor(b));return}if(!f){this.formatAndAdd(b,e);return!1}}catch(g){this.settings.debug&&window.console&&console.log("exception occured when checking element "+b.id+", check the '"+e.method+"' method",g);throw g}}if(!d){this.objectLength(c)&&this.successList.push(b);return!0}},customMetaMessage:function(b,c){if(!!a.metadata){var d=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return d&&d.messages&&d.messages[c]}},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor==String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==undefined)return arguments[a];return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b.method),d=/\$?\{(\d+)\}/g;typeof c=="function"?c=c.call(this,b.parameters,a):d.test(c)&&(c=jQuery.format(c.replace(d,"{$1}"),b.parameters)),this.errorList.push({message:c,element:a}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper)));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass),this.showLabel(b.element,b.message)}this.errorList.length&&(this.toShow=this.toShow.add(this.containers));if(this.settings.success)for(var a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(var a=0,c=this.validElements();c[a];a++)this.settings.unhighlight.call(this,c[a],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 a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d=this.errorsFor(b);d.length?(d.removeClass().addClass(this.settings.errorClass),d.attr("generated")&&d.html(c)):(d=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(b),generated:!0}).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)),this.toShow=this.toShow.add(d)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")==c})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(a,d){return d.form==c&&d.name==b&&d||null})},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a,b){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){return!a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&this.pendingRequest==0&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&this.pendingRequest==0&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},dateDE:{dateDE:!0},number:{number:!0},numberDE:{numberDE:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])});return c},attributeRules:function(b){var c={},d=a(b);for(method in a.validator.methods){var e=d.attr(method);e&&(c[method]=e)}c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength;return c},metadataRules:function(b){if(!a.metadata)return{};var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(b){var c={},d=a.data(b.form,"validator");d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{});return c},normalizeRules:function(b,c){a.each(b,function(d,e){if(e===!1)delete b[d];else if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=e.param!==undefined?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength","min","max"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){b[this]&&(b[this]=[Number(b[this][0]),Number(b[this][1])])}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b.messages&&delete b.messages;return b},normalizeRule:function(b){if(typeof b=="string"){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=d!=undefined?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";switch(c.nodeName.toLowerCase()){case"select":var e=a(c).val();return e&&e.length>0;case"input":if(this.checkable(c))return this.getLength(b,c)>0;default:return a.trim(b).length>0}},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e=this.previousValue(c);this.settings.messages[c.name]||(this.settings.messages[c.name]={}),e.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=e.message,d=typeof d=="string"&&{url:d}||d;if(e.old!==b){e.old=b;var f=this;this.startRequest(c);var g={};g[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:g,success:function(d){f.settings.messages[c.name].remote=e.originalMessage;var g=d===!0;if(g){var h=f.formSubmitted;f.prepareElement(c),f.formSubmitted=h,f.successList.push(c),f.showErrors()}else{var i={},j=e.message=d||f.defaultMessage(c,"remote");i[c.name]=a.isFunction(j)?j(b):j,f.showErrors(i)}e.valid=g,f.stopRequest(c,g)}},d));return"pending"}if(this.pending[c.name])return"pending";return e.valid},minlength:function(b,c,d){return this.optional(c)||this.getLength(a.trim(b),c)>=d},maxlength:function(b,c,d){return this.optional(c)||this.getLength(a.trim(b),c)<=d},rangelength:function(b,c,d){var e=this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},email:function(a,b){return this.optional(b)||/^((([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(a)},url:function(a,b){return this.optional(b)||/^(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(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return!1;var c=0,d=0,e=!1;a=a.replace(/\D/g,"");for(var f=a.length-1;f>=0;f--){var g=a.charAt(f),d=parseInt(g,10);e&&(d*=2)>9&&(d-=9),c+=d,e=!e}return c%10==0},accept:function(a,b,c){c=typeof c=="string"?c.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(new RegExp(".("+c+")$","i"))},equalTo:function(b,c,d){var e=a(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()});return b==e.val()}}}),a.format=a.validator.format}(jQuery),function(a){var b=a.ajax,c={};a.ajax=function(d){d=a.extend(d,a.extend({},a.ajaxSettings,d));var e=d.port;if(d.mode=="abort"){c[e]&&c[e].abort();return c[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}(jQuery),function(a){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&a.each({focus:"focusin",blur:"focusout"},function(b,c){function d(b){b=a.event.fix(b),b.type=c;return a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(b,d,!0)},teardown:function(){this.removeEventListener(b,d,!0)},handler:function(b){arguments[0]=a.event.fix(b),arguments[0].type=c;return a.event.handle.apply(this,arguments)}}}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);if(e.is(b))return d.apply(e,arguments)})}})}(jQuery),jQuery.cookie=function(a,b,c){if(typeof b=="undefined"){var i=null;if(document.cookie&&document.cookie!=""){var j=document.cookie.split(";");for(var k=0;k<j.length;k++){var l=jQuery.trim(j[k]);if(l.substring(0,a.length+1)==a+"="){i=decodeURIComponent(l.substring(a.length+1));break}}}return i}c=c||{},b===null&&(b="",c.expires=-1);var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){var e;typeof c.expires=="number"?(e=new Date,e.setTime(e.getTime()+c.expires*24*60*60*1e3)):e=c.expires,d="; expires="+e.toUTCString()}var f=c.path?"; path="+c.path:"",g=c.domain?"; domain="+c.domain:"",h=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,f,g,h].join("")};var jQueryChrono;jQueryChrono=function(){function o(){var a={delay:null,units:null,when:null,callback:null};if(arguments.length<2||arguments.length>3)throw"$.after and $.every - Accept only 2 or 3 arguments";a=m(a,arguments),typeof arguments[0]=="string"&&arguments[0].search(",")>-1?a=n(a,arguments):(a=j(a,arguments),a=l(a,arguments)),a.delay<c.delay&&a.units===c.units&&(a.delay=c.delay),a.delay<0&&(a.delay=c.delay,a.units=c.units),a.when=a.delay*i[a.units];return a}function n(a,b){var c,d,e="",f,g=[];c=typeof b[0]=="string"?b[0].split(","):[];for(d in c){if(!/\d\s?\w+/.test(c[d]))throw"$.after and $.every - Invalid delays with units sequence: "+c.join(",");f=o.call(this,c[d],a.callback);if(e===""||i[f.units]<=i[e])e=f.units;g[d]=f}a.units=e;for(d in g)a.delay+=g[d].delay*(i[g[d].units]/i[e]);return a}function m(a,b){a.callback=b[b.length-1];if(typeof a.callback!="function")throw"$.after and $.every - Require a callback as the last argument";return a}function l(a,b){typeof b[0]=="string"&&a.delay!==null&&(a.units=k(b[0].replace(a.delay,""))||null),typeof b[1]=="string"&&(a.units=b[1]),a.units===null&&b.length===2&&(a.units=c.units);if(typeof i[a.units]!="number")throw"$.after and $.every - Require a valid unit of time as the 2nd argument";return a}function j(a,b){typeof b[0]=="string"?(a.delay=parseFloat(b[0],10),isNaN(a.delay)&&(a.delay=i[b[0]]>d?1:c.delay)):a.delay=b[0];if(typeof a.delay!="number"||isNaN(a.delay))throw"$.after and $.every - Require a numerical delay as the 1st argument";return a}function b(){var a=jQueryChrono.create_timer.apply(this,arguments);return setInterval(a.callback,a.when)}function a(){var a=jQueryChrono.create_timer.apply(this,arguments);return setTimeout(a.callback,a.when)}var c={delay:4,units:"milliseconds"},d=1,e=d*1e3,f=e*60,g=f*60,h=g*24,i={millisecond:d,milliseconds:d,ms:d,second:e,seconds:e,sec:e,secs:e,s:e,minute:f,minutes:f,min:f,mins:f,m:f,hour:g,hours:g,hr:g,hrs:g,h:g,day:h,days:h,d:h},k=String.prototype.trim2?function(a){return a==null?"":String.prototype.trim.call(a)}:function(a){return a==null?"":a.toString().replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")};return{every:b,after:a,defaults:c,valid_units:i,create_timer:function(){return o.apply(this,arguments)}}}(),typeof jQuery!="undefined"&&jQuery.extend({after:jQueryChrono.after,every:jQueryChrono.every}),function(a){a.expr.match.ROLE=/@((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,a.expr.preFilter.ROLE=function(a,b,c,d,e,f){a=" "+a[1]+" ";return a},a.expr.filter.ROLE=function(a,b){return(" "+a.getAttribute("role")+" ").indexOf(b)>-1};for(var b in a.expr.match)a.expr.match[b]=new RegExp(a.expr.match[b].source+/(?![^\[]*\])(?![^\(]*\))/.source),a.expr.leftMatch[b]=new RegExp(/(^(?:.|\r|\n)*?)/.source+a.expr.match[b].source.replace(/\\(\d+)/g,function(a,b){return"\\"+(b-0+1)}));a.role=function(b,c){var d;b.charAt(0)==="#"?d="#role-"+b.substring(1):d='[role="'+b+'"]';return a(d,c)},typeof a.r=="undefined"&&(a.r=a.role)}(jQuery),jQuery(function(a){var b=window.token,c="authenticity_token";a.fn.extend({triggerAndReturn:function(b,c){var d=new a.Event(b);this.trigger(d,c);return d.result!==!1},callRemote:function(){var b=this,c=b.attr("method")||b.attr("data-method")||"GET",d=b.attr("action")||b.attr("href"),e=b.attr("data-type")||"script";if(d===undefined)throw"No URL specified for remote call (action or href must be present).";if(b.triggerAndReturn("ajax:before")){var f=b.is("form")?b.serializeArray():[];a.ajax({url:d,data:f,dataType:e,type:c.toUpperCase(),beforeSend:function(a){b.trigger("ajax:loading",a)},success:function(a,c,d){b.trigger("ajax:success",[a,c,d])},complete:function(a){b.trigger("ajax:complete",a)},error:function(a,c,d){b.trigger("ajax:failure",[a,c,d])}})}b.trigger("ajax:after")}}),a("a[data-confirm],input[data-confirm]").live("click",function(){var b=a(this);if(b.triggerAndReturn("confirm")&&!confirm(b.attr("data-confirm")))return!1}),a("form[data-remote]").live("submit",function(b){a(this).callRemote(),b.preventDefault()}),a("a[data-remote],input[data-remote]").live("click",function(b){a(this).callRemote(),b.preventDefault()}),a("a[data-method]:not([data-remote])").live("click",function(d){var e=a(this),f=e.attr("href"),g=e.attr("data-method"),h=a('<form method="post" action="'+f+'"></form>'),i='<input name="_method" value="'+g+'" type="hidden" />';c!=null&&b!=null&&(i+='<input name="'+c+'" value="'+b+'" type="hidden" />'),h.hide().append(i).appendTo("body"),d.preventDefault(),h.submit()});var d="input[data-disable-with]",e="form[data-remote]:has("+d+")",f="form:not([data-remote]):has("+d+")",g=function(){a(this).find(d).each(function(){var b=a(this);b.data("enable-with",b.val()).attr("value",b.attr("data-disable-with")).attr("disabled","disabled")})};a(e).live("ajax:before",g),a(f).live("submit",g),a(e).live("ajax:complete",function(){a(this).find(d).each(function(){var b=a(this);b.removeAttr("disabled").val(b.data("enable-with"))})})}),function(a){var b=[],c=[38,38,40,40,37,39,37,39,66,65],d=0;a.extend({konami:function(a,d){b.push(a),d&&(c=d)}}),a(document).bind("keyup",function(e){var f=e.keyCode;f==c[d]?d++:d=f==c[0]?1:0,d==c.length&&b.length>0&&a.each(b,function(a){this()})})}(jQuery),function(){"use strict";var a=function(a){return"undefined"!=typeof a};window.Visibility={_doc:window.document,_prefixes:["webkit","moz","o","ms"],_chechedPrefix:null,_listening:!1,_changeCallbacks:[],_onVisibleCallbacks:[],_afterPrerenderingCallbacks:[],_lastTimer:0,_timers:{},_hiddenBefore:!1,_init:function(){this._hiddenBefore=this.hidden(),a(window.jQuery)&&a(jQuery.every)?this._setInterval=this._chronoSetInterval:this._setInterval=this._originalSetInterval},_prefix:function(){if(null!==this._chechedPrefix)return this._chechedPrefix;if(a(this._doc.visibilityState))return this._chechedPrefix="";var b;for(var c=0;c<this._prefixes.length;c++){b=this._prefixes[c]+"VisibilityState";if(a(this._doc[b]))return this._chechedPrefix=this._prefixes[c]}},_name:function(a){var b=this._prefix();return""==b?a:b+a.substr(0,1).toUpperCase()+a.substr(1)},_prop:function(a){return this._doc[this._name(a)]},_onVisibilityChange:function(a){var b=this.hidden(),c=this.state();for(var d=0;d<this._changeCallbacks.length;d++)this._changeCallbacks[d].call(this._doc,a,c);var e=this._hiddenBefore;if(b&&!e||!b&&e)for(d in this._timers)this._stopTimer(d),this._runTimer(d,!b);if(!b){for(var d=0;d<this._onVisibleCallbacks.length;d++)this._onVisibleCallbacks[d]();this._onVisibleCallbacks=[]}if("prerender"!=this.state()){var f=this._afterPrerenderingCallbacks.length;for(var d=0;d<f;d++)this._afterPrerenderingCallbacks[d]();this._afterPrerenderingCallbacks=[]}this._hiddenBefore=b},_setListener:function(){if(!this._listening){var a=this._prefix()+"visibilitychange",b=function(){Visibility._onVisibilityChange.apply(Visibility,arguments)};this._doc.addEventListener?this._doc.addEventListener(a,b,!1):this._doc.attachEvent(a,b),this._listening=!0,this._hiddenBefore=this.hidden()}},_originalSetInterval:function(a,b){return setInterval(a,b)},_chronoSetInterval:function(a,b){return jQuery.every(b,a)},_setInterval:null,_runTimer:function(a,b){var c,d=this._timers[a];if(this.hidden()){if(null===d.hiddenInterval)return;c=d.hiddenInterval}else c=d.interval;b&&d.callback.call(window),d.intervalID=this._setInterval(d.callback,c)},_stopTimer:function(a){var b=this._timers[a];clearInterval(b.intervalID),delete b.intervalID},isSupported:function(){return a(this._prefix())},hidden:function(){if(!this.isSupported())return!1;return this._prop("hidden")},state:function(){if(!this.isSupported())return"visible";return this._prop("visibilityState")},change:function(a){if(!this.isSupported())return!1;this._changeCallbacks.push(a),this._setListener();return!0},onVisible:function(a){if(!this.isSupported()||!this.hidden()){a();return!0}this._onVisibleCallbacks.push(a),this._setListener()},afterPrerendering:function(a){if(!this.isSupported()||"prerender"!=this.state()){a();return!0}this._afterPrerenderingCallbacks.push(a),this._setListener()},every:function(b,c,d){a(d)||(d=c,c=null),this._lastTimer+=1;var e=this._lastTimer;this._timers[e]={interval:b,hiddenInterval:c,callback:d},this._runTimer(e,!1),this.isSupported()&&this._setListener();return e},stop:function(b){var c=this._timers[b];if(!a(c))return!1;this._stopTimer(b),delete this._timers[b];return c}},Visibility._init()}(),function(a){a.fn.hoverIntent=function(b,c){var d={sensitivity:10,interval:50,timeout:0};c||(c=function(){}),d=a.extend(d,c?{over:b,out:c}:b);var e,f,g,h,i=function(a){e=a.pageX,f=a.pageY},j=function(b,c){c.hoverIntent_t=clearTimeout(c.hoverIntent_t);if(Math.abs(g-e)+Math.abs(h-f)<d.sensitivity){a(c).unbind("mousemove",i),c.hoverIntent_s=1;return d.over.apply(c,[b])}g=e,h=f,c.hoverIntent_t=setTimeout(function(){j(b,c)},d.interval)},k=function(a,b){b.hoverIntent_t=clearTimeout(b.hoverIntent_t),b.hoverIntent_s=0;return d.out.apply(b,[a])},l=function(b){var c=jQuery.extend({},b),e=this;e.hoverIntent_t&&(e.hoverIntent_t=clearTimeout(e.hoverIntent_t)),b.type=="mouseenter"?(g=c.pageX,h=c.pageY,a(e).bind("mousemove",i),e.hoverIntent_s!=1&&(e.hoverIntent_t=setTimeout(function(){j(c,e)},d.interval))):(a(e).unbind("mousemove",i),e.hoverIntent_s==1&&(e.hoverIntent_t=setTimeout(function(){k(c,e)},d.timeout)))};return this.bind("mouseenter",l).bind("mouseleave",l)}}(jQuery),function(){var a;a={pluralize:function(a,b,c,d,e){var f,g,h;if(0===a)return e||"";g=a%10,h=a%100,1===g&&11!==h?f=b:2<=g&&4>=g&&(10>h||20<=h)?f=c:f=d;return a+" "+f},formatNumber:function(a){var b;if(a==null)return"";b=a.toString();if(b.match(/^(-)?\d\d\d\d$/))return b;return b.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1 ")},timeLeftInWordsShort:function(a){var b,c,d,e;e=Math.floor(a/1e3),d=Math.floor(e/60),c=Math.floor(d/60),b=Math.floor(c/24);return c>24?this.pluralize(b,"день","дня","дней"):d>60?this.pluralize(c,"час","часа","часов"):e>60?this.pluralize(d,"минута","минуты","минут"):this.pluralize(e,"секунда","секунды","секунд")}},a.p=a.pluralize,window.Russian=a}.call(this),function(){var a=Array.prototype.slice;window.app={domain:function(a){var b;a==null&&(a=""),b=document.domain.match(".com.ua")?".com.ua":".ru";return"http://groupon"+b+a},autoConnect:{enabled:function(){return document.cookie.indexOf("auto-connect=false")===-1},disable:function(){return document.cookie="auto-connect=false; domain="+app.domain().replace("http://",".")}},shadow:{loader:function(a){var b,c,d;a==null&&(a=300),this.show(a),c=$("<div class='shadow-loader' />").appendTo("body"),d=parseInt(c.css("width")),b=-(d/2);return c.css({width:0,height:0,marginTop:0,marginLeft:0}).animate({width:d,height:d,marginTop:b,marginLeft:b},a)},finish:function(a){a==null&&(a=300),$(".fullscreen-shadow.loader").removeClass("loader");return $(".shadow-loader").animate({width:0,height:0,marginTop:0,marginLeft:0},a,function(){return $(this).remove()})},show:function(a){a==null&&(a=300);return $("<div class='fullscreen-shadow' />").appendTo("body").css({opacity:0}).animate({opacity:.8},a,"easeOutQuad")},hide:function(a){a==null&&(a=300),this.finish(a);return $(".fullscreen-shadow:last").fadeOut(a,function(){return $(this).remove()})}},pl:Russian.pluralize,time:function(a){var b,c,d,e,f;d=a/1e3,b=Math.floor(d/86400)%86400,c=Math.floor(d/3600)%24,e=Math.floor(d/60)%60,f=Math.floor(d)%60;return{days:b,hours:(""+c).length<2?"0"+c:c,min:(""+e).length<2?"0"+e:e,sec:(""+f).length<2?"0"+f:f}},difference:function(a,b){a[0]&&a[0].uid&&(b=$.map(b,function(a){return a.uid}));return $.grep(a,function(a){return $.inArray(a.uid,b)===-1})},track:function(a){var b;if(typeof _gat!="undefined"&&_gat!==null){b=_gat._getTracker("UA-15152456-1");return b._trackPageview(a)}},log:function(){var a;return typeof console!="undefined"&&console!==null?(a=console.log)!=null?a.apply(console,arguments):void 0:void 0},on:function(a,b){return jQuery(function(){var c,d;d=$(a);if(d.length){c=function(a){return jQuery(a,d)};return b.apply(d,[jQuery,c,d])}})},ie:function(){var b,c,d,e,f;d=1<=arguments.length?a.call(arguments,0):[];if(!$.browser.msie)return!1;if(0===d.length)return!0;b=parseInt($.browser.version[0]);for(e=0,f=d.length;e<f;e++){c=d[e];if(c===b)return!0}},prefix:function(){if($.browser.mozilla)return"moz";if($.browser.webkit)return"webkit";if($.browser.opera)return"o";if($.browser.msie)return"ms"},css3prop:function(a){document.body.style[a]==null&&(a="-"+this.prefix()+"-"+a);return a},media:function(a){var b;if(window.matchMedia==null)return!1;b=matchMedia("all and ("+a+")");if(b.matches)return!0;return matchMedia("all and (-"+app.prefix()+"-"+a+")").matches},tablet:function(){var a;a=navigator.userAgent;return a.match(/(iPad).*OS\s([\d_]+)/)||a.match(/(Android)\s+([\d.]+)/)},parts:{}}}.call(this),function(){$.extend($,{put:function(a,b,c){$.isFunction(b)&&(c=b,b={}),b._method="PUT";return $.ajax({type:"POST",url:a,data:b,success:c})},del:function(a,b,c){$.isFunction(b)&&(c=b,b={}),b._method="DELETE";return $.ajax({type:"POST",url:a,data:b,success:c})},scrollTo:function(a,b,c){var d;d=$.browser.webkit?$("body"):$("html"),d.animate({scrollTop:a},b,c);return a}}),$.extend($.fn,{ajaxForm:function(a){a==null&&(a={});return this.submit(function(b){var c,d,e;c=$(this);if(a.condition!=null&&!a.condition.call(c))return!1;if(c.data("submiting")&&!a.multisubmit)return!1;c.data("submiting",!0).addClass("submiting");if(b.isPropagationStopped())return!1;d=a.url,d||(d=c.attr("action"),a.noJSON||(d+=".json")),(e=a.submiting)!=null&&e.call(c),$.ajax({url:d,data:c.serialize(),type:"POST",error:function(b){var d;500===b.status?app.flash.error("Внутренняя ошибка сервера"):302===b.status?window.location=b.responseText||"/":b.responseText&&app.flash.error(b.responseText);return(d=a.error)!=null?d.call(c,b.responseText):void 0},success:function(b){var d;$.isPlainObject(b)&&b.notice&&app.flash.notice(b.notice);return(d=a.success)!=null?d.call(c,b):void 0},complete:function(){var b;c.data("submiting",null).removeClass("submiting");return(b=a.complete)!=null?b.call(c):void 0}});return!1})},ask:function(a){return this.click(function(){app.question.ask($(this),a);return!1})},scrollTo:function(a){a==null&&(a=0);return $.scrollTo(this.offset().top+a)},linkProxy:function(a){return this.hover(function(){return a.addClass("hover")},function(){return a.removeClass("hover")}).mousedown(function(){return a.addClass("active")}).bind("mouseup, mouseleave",function(){return a.removeClass("active")})}}),$(function(){var a,b,c,d,e,f;e=$(".enable-after-loading"),f=[];for(c=0,d=e.length;c<d;c++)b=e[c],a=$(b),f.push(a.html(a.text()));return f}),window.after=jQuery.after,window.every=jQuery.every}.call(this),function(){app.flash={error:function(a){return this._show(this._div("error",a))},notice:function(a){return this._show(this._div("notice",a))},autoHide:function(a){if(!!a.length){Visibility.onVisible(function(){return after("2.5sec",function(){return app.flash._hide(a,1e3)})});return a.click(function(){return app.flash._hide(a)})}},_show:function(a){a.find("span").css({opacity:0}).animate({opacity:1},600),a.css({backgroundPosition:"0px -261px"}).show().animate({backgroundPosition:"0px 0px"},600);return this.autoHide(a)},_div:function(a,b){$(".flash").remove();return $("<div class='flash "+a+"' />").html($("<span />").text(b).prepend("<div>")).prependTo("body")},_hide:function(a,b){b==null&&(b=400),a.animate({backgroundPosition:"0px -261px"},b);return a.find("span").animate({opacity:0},b,function(){return a.remove()})}},$(function(){return app.flash.autoHide($(".flash"))})}.call(this),function(){jQuery(function(){var a,b,c,d,e,f,g;$("a[rel=submit]").live("click",function(){$(this).hasClass("disabled")||$(this).closest("form").submit();return!1}),$("a[rel=refresh]").live("click",function(){location.reload(!0);return!1}),$("a[rel=submit-subscription]").click(function(){$("#user_subscribed").val()===0&&app.track("/unsubscribe/?"+current_user),$(this).closest("form").submit();return!1}),b=navigator.userAgent,g=/Safari/.test(b)&&/Windows/.test(b),e=25,g&&(e=43),/Macintosh/.test(b)&&(e=12),/Opera/.test(b)&&(e=30),f=function(a){return a.find(".front div").text(a.find("option:selected").text())},app.styledSelects=function(a){return a.find(".styled-select").each(function(){var a,b;a=$(this),b=a.find("select"),b.css({padding:0}),!b.hasClass("width")&&!a.hasClass("width")&&b.width(b.width()+e);return f(a)}).find("select").bind("focus blur",function(){return $(this).parent().find(".front div").toggleClass("focus")}).change(function(){return f($(this).parent())})},app.styledSelects($("body")),$(".styled-combobox input").live("focus",function(){return $(this).closest(".styled-combobox").find(".hjsel_ddImage").addClass("focus")}).live("blur",function(){return $(this).closest(".styled-combobox").find(".hjsel_ddImage").removeClass("focus")}),app.nextPage=function(){var a,b,c,d,e,f,g,h;d=$(".next-page");if(d.length){e=1,b=$(".loader",d),c=$("a",d),f=$(".progress",d),a=d.data("count"),h=d.data("url");if(!h)return;h+=h.match(/\?/)?"&":"?",g=function(b){b=$(".entry",d.parent()).length,b>=a&&d.hide();return f.css({width:Math.round(100*b/a)+"%"})},a&&g();return c.click(function(){c.hide(),b.show(),e+=1,$.get(""+h+"page="+e,function(a){var e;e=d.triggerHandler("add",[a]),e||(e=$(a).insertBefore(b.hide().parent()),e.hide().fadeIn(400)),c.show(),d.trigger("nextpage",[e]);return g()});return!1})}},app.nextPage(),c=function(a){var b,c;b=function(a){if(a.val()==="")return a.parent().find(".placeholder").show()},c=$(""+a+" input").attr({placeholder:""}),c.each(function(){return b($(this))}),c.blur(function(){return b($(this))}),c.focus(function(){return $(this).parent().find(".placeholder").hide()});return $(".with-placeholder .placeholder").click(function(){return $(this).parent().find("input").focus()})},a=navigator.userAgent,d=$.browser.msie||a.match(/Safari/)&&!a.match(/Chrome/),d?c(".with-placeholder"):c(".with-placeholder.all");if($.fn.hoverIntent!=null)return $(".with-tooltip.intent").hoverIntent(function(){return $(this).addClass("show")},function(){return $(this).removeClass("show")})})}.call(this),function(){var a,b;a=document.location.hostname.match(/\.(\w+)$/)[1],b=a==="ru",window.MAILRU_APP_ID=b?"491951":"552797",window.MAILRU_KEY=b?"681de51f5d569dc18e7d408b014ac893":"257c61c30e816620a7377d5b20ec3a6f",window.VK_APP_ID=function(){switch(a){case"ua":return 2003852;case"dev":return 2268537;case"ru":return 1984390}}()}.call(this),function(){app.popup={open:function(a,b){var c;b==null&&(b={}),"string"==typeof a?a=$(a):a=a.clone(!0).removeClass("hide").show(),b.noShadow||app.shadow.show(150),c=$('<div class="popup" />').appendTo("body").append('<a class="close" href="#" />').append('<div class="wrap" />').data("popup.options",b),b.cls&&c.addClass(b.cls),c.find(".wrap").append(a),this._callback(c,"open"),after("150ms",function(){return app.popup._show(c.show())});return this._events(c.hide())},ajax:function(a,b){var c,d;app.shadow.loader(),b.noShadow=!0,c=a.error,d=a.success,a.error=function(a){app.shadow.hide(),500===a.status||415===a.status?app.flash.error("Внутренняя ошибка сервера"):a.responseText&&app.flash.error(a.responseText);return c!=null?c.apply(this,arguments):void 0},a.success=function(a){app.shadow.finish(),app.popup.open($(a),b);return d!=null?d.apply(this,arguments):void 0};return $.ajax(a)},close:function(a){a||(a=$(".popup"));if(!!a.length){after("450ms",function(){return app.shadow.hide(150)});return a.css({marginTop:0,top:this._top(a)}).animate({top:$(window).height()},450,"easeInQuad",function(){app.popup._callback(a,"close");return a.remove()})}},_show:function(a){app.styledSelects(a),this._width(a);return a.css({top:-a.outerHeight()}).animate({top:this._top(a)},450,"easeOutQuad",function(){$.browser.msie||app.popup._height(a.css({top:"50%"}));return app.popup._callback(a,"show")})},_events:function(a){a.find("a.close").add(".fullscreen-shadow").click(function(){app.popup.close(a);return!1});return a},_top:function(a){var b;b=($(window).height()-$(a).outerHeight())/2;return $.browser.msie?b+=$(window).scrollTop():b},_width:function(a){var b;b=a.outerWidth(),$(window).width()<b&&(b=$(window).width()-100,a.width(b));return a.css({marginLeft:-b/2})},_height:function(a){var b;b=a.outerHeight(),$(window).height()<b&&(b=$(window).height()-100,a.height(b));return a.css({marginTop:-b/2})},_callback:function(a,b){var c;return(c=a.data("popup.options")[b])!=null?c.call(a):void 0}},app.confirm={open:function(a,b,c,d){var e,f,g,h,i,j,k,l;i=app.shadow.show(150),f=$('<div class="confirm">').appendTo("body").append('<a class="close" href="#" />').append("<div class='top'><h3>"+b+"</h3><p>"+c+"</p></div>").append("<div class='bottom'><a class='styled-button m' href='#'>Да</a><a class='cancel' href='#'>Отменить</a></div>"),f.find("a.close, a.cancel").add(i).click(function(){app.confirm.close(f);return!1}),l=f.find("a.styled-button"),j=!1,l.click(function(a){if(j){a.stopImmediatePropagation();return!1}return j=!0}),"string"==typeof d?l.attr({href:d}):$.isPlainObject(d)?l.attr(d):l.click(d),e=$("#center"),k=a.pageX-f.width()/2-2,g=e.offset().left,h=g+e.width()-f.width()-4,g>k&&(k=g),h<k&&(k=h);return f.css({top:a.pageY-(f.height()-20),left:k,opacity:0}).animate({opacity:1},150)},close:function(a){return a.animate({marginLeft:-300,opacity:0},150,function(){app.shadow.hide(150);return a.remove()})}},app.question={ask:function(a,b){var c,d,e,f;f=b.data("question");if(f&&!f.data("close"))app.question.close(f);else{f?f.data({close:null}):(f=b.show().wrap('<div class="wrap" />').parent().wrap('<div class="question" />').parent(),b.data({question:f}),f.find(".wrap").prepend('<div class="arrow" />').prepend('<a class="close" href="#" />')),c=f.height(),d=a.offset(),f.show().css({top:d.top+a.height()+12,left:d.left+(a.width()-f.innerWidth())/2,opacity:0,height:0,marginTop:-10}),e={opacity:1,height:c},$.browser.mozilla?f.css(e):f.animate(e,200),f.find("a.close").click(function(){app.question.close(f);return!1}),$("body").one("click",function(){return app.question.close(f)}),f.click(function(a){return a.stopPropagation()}),f.find("input:text").focus().keyup(function(a){if("13"===a.keyCode)return $(this).closest("form").submit()});return f}},close:function(a){a.data({close:!0});return a.animate({opacity:0,marginTop:10},200,function(){return a.hide()})}},$(function(){var a;a=$(".confirm.fallback");if(a.length)return $("input",a).linkProxy($(".styled-button",a))})}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};app.vk={_initCallbacks:[],initialized:!1,initializing:!1,init:function(b){if(this.initialized)return typeof b=="function"?b():void 0;typeof b=="function"&&this._initCallbacks.push(b);if(!this.initializing){this.initializing=!0;return $.getScript("http://userapi.com/js/api/openapi.js",a(function(){var a,b,c,d;VK.init({apiId:VK_APP_ID,onlyWidgets:!0}),this.initialized=!0,d=this._initCallbacks;for(b=0,c=d.length;b<c;b++)a=d[b],a();return this._initCallbacks=[]},this))}},like:function(a,b,c){return app.vk.init(function(){return VK.Widgets.Like(a,b,c)})},likeID:0,autoLike:function(a){var b,c,d,e,f,g,h,i;a==null&&(a=document.body),e=$(".vk-like",a),i=[];for(g=0,h=e.length;g<h;g++)d=e[g],this.likeID+=1,c="#vk-like-"+this.likeID,b=$(d).attr({id:c}),f={type:b.data("type")||"button"},b.data("url")&&(f.pageUrl=b.data("url")),b.data("title")&&(f.pageTitle=b.data("title")),i.push(app.vk.like(c,f,b.data("target")));return i}},$(function(){return app.vk.autoLike()})}.call(this),function(){app.on("#how-it-works",function(a,b){var c,d;if(a.browser.msie||a.browser.opera)b(".slider .b1").hide(),b(".slider .b2").css({left:425});a.konami(function(){return b(".slider div").css({background:"url(/images/how-it-works/alone/konami.png)"})}),c=function(a,c){if(c!==a){b(".ncslider-pages .here").removeClass("here"),b(".ncslider-pages [href=#"+a.data("id")+"]").addClass("here"),c.fadeOut(500);return a.fadeIn(500)}},d=Visibility.every("5sec",function(){var a,d;a=b(".campaign:visible"),d=a.next(),d.length||(d=b(".campaign:first"));return c(d,a)});return b(".ncslider-pages a").click(function(){var e;Visibility.stop(d),e=a(this).addClass("here").attr("href").slice(1),c(b(".campaign[data-id="+e+"]"),b(".campaign:visible"));return!1})})}.call(this),function(){app.on("#coupons",function(a,b,c){var d,e,f,g;e=b("@actual-coupons"),d=b("@actual-coupons-count"),b("@archive-coupon").live("click",function(){var b,c,f,g;g=a(this);if(g.hasClass("disabled"))return!1;g.addClass("disabled"),f=g.closest(".entry"),c=parseInt(d.text()),f.hasClass("archived")?(b=g.find(".from-archive"),a.put(b.data("url"),function(){g.removeClass("disabled"),d.text(c+1),e.removeClass("without-count");return f.removeClass("archived")})):(b=g.find(".to-archive"),b.data("hide")&&f.fadeTo(100,.6),a.put(b.data("url"),function(){g.removeClass("disabled"),d.text(c-1),c===1&&e.addClass("without-count");if(b.data("hide")){app.flash.notice("Купон архивирован. Его можно найти в разделе «Все купоны».");return f.fadeOut(400)}return f.addClass("archived")}));return!1}),typeof YMaps!="undefined"&&YMaps!==null&&b("@choose_place").live("click",function(){app.popup.ajax({url:a(this).data("url")},{cls:"b-modal-biggest",show:function(){var b,c,d,e,f,g;d=a("@places_map"),c=new YMaps.Map(d),c.addControl(new YMaps.Zoom),f=function(b){a("li.showed",d).removeClass("showed"),b.addClass("showed"),c.setCenter(b.data("place").getGeoPoint(),10);return b.data("place").openBalloon()},g=new YMaps.Style,g.iconStyle=new YMaps.IconStyle(new YMaps.Template('<div class="pin-icon">$[number]</div>')),g.balloonStyle=new YMaps.BalloonStyle(new YMaps.Template("$[balloon]")),b=function(b,e){var h;h=new YMaps.Placemark(e,{style:g}),h.number=b.children(".pin-icon").text(),h.balloon=b.children(".balloon").html(),b.data({place:h}),c.addOverlay(h),YMaps.Events.observe(h,h.Events.BalloonOpen,function(){var b;b=a(".place-balloon",d),b.css({top:-b.outerHeight()-5}),b.css({left:-b.outerWidth()/2+10});return a("a[rel=submit]",b).click(function(){a(this).closest("form").submit();return!1})});if(h.number==="1")return f(b)},e=a("#coupons_choose_place li"),e.each(function(){var c,d;d=a(this);if(d.data("lng"))return b(d,new YMaps.GeoPoint(d.data("lng"),d.data("lat")));c=new YMaps.Geocoder(d.data("address"));return YMaps.Events.observe(c,c.Events.Load,function(a){if(a.length())return b(d,a.get(0).getGeoPoint())})});return e.click(function(){f(a(this));return!1})}});return!1}),a("@send_sms").click(function(){a(this).closest("form").submit();return!1}),b("@sms_coupon").live("click",function(){var b;b=a(this),app.question.ask(b,a(".sms-form").attr({action:b.data("url")}));return!1}),b(".editable .placefold").live("click",function(){return a(this).parent().find("input").focus()}),g=b(".editable input"),g.live("focus",function(){var b;b=a(this).closest(".editable").addClass("editing");return b.find(".placefold").hide()}),g.live("blur",function(){var b;b=a(this).closest(".editable"),after("100ms",function(){return b.removeClass("editing")});if(""===a(this).val())return b.find(".placefold").show()}),b(".editable a.save").live("click",function(){a(this).hide().closest(".editable").submit();return!1}),f=function(b){return a(".editable",b).ajaxForm({submiting:function(){return this.find(".loader").show().end().find(".save").hide()},complete:function(){return this.find(".loader").hide().end().find(".save").show()}})},f(c),b(".next-page").bind("nextpage",function(a,b){app.vk.autoLike(b);return f(b)});return a("#shipment_address_way").live("change",function(){return b("@shipment-address").toggle()})})}.call(this),function(){app.on("#top",function(a,b){var c,d,e;b("@cities").click(function(){var c;a(this).toggleClass("open"),c=a(this).hasClass("open")?b(".cities").height():0,a("#holiday.womenday").length&&a(this).hasClass("open")&&a("#root").css({paddingTop:c,top:-c,backgroundPosition:"50% "+c+"px"}),app.ie(7)?a("body").css({paddingTop:c}):a("body").animate({paddingTop:c},400,"easeInOutQuad");return!1}),d=b(".dropdown"),e=b(".overflow"),c=d.outerHeight()+3;return app.tablet()?b(".profile .open").click(function(){e.toggleClass("ipad");return!1}):b(".profile").hover(function(){e.stop().animate({height:c},200);return d.stop().animate({top:0},200)},function(){e.stop().animate({height:0},200);return d.stop().animate({top:-c},200)})})}.call(this),function(){app.on("#faq",function(a,b){return b("dl.faq.faq-imp").click(function(){return a(this).toggleClass("faq-closed faq-open").find("dd").slideToggle(300)})})}.call(this),function(){app.on("#partners",function(a,b){var c,d;d=b(".fdbc-form"),b("a[href=#business-feedback]").click(function(){d.slideToggle(),a(this).hasClass("feedback-formlink")&&a("a[href=#business-feedback]").toggleClass("feedbackform-on");return!1}),b("a[href=#business-feedback-open]").click(function(){d.show().scrollTo(-15);return!1}),"#business-feedback"===location.hash&&b("a[href=#business-feedback-open]").click(),c=function(){b("label[for=url] .req").hide(),a(".metro",d).show(),a(".metro select",d).attr({name:""}).hide();if("Москва"===a(this).val()){a("label[for=url] .req",d).show();return a(".metro select.moscow",d).show().attr({name:"metro_station"})}return a(this).val()==="Санкт-Петербург"?a(".metro select.piter",d).show().attr({name:"metro_station"}):a(this).val()==="Киев"?a(".metro select.kiev",d).show().attr({name:"metro_station"}):a(".metro",d).hide()},a("select[name=city]",d).change(c),c.apply(a("select[name=city]",d)[0]),a.validator.methods.requiredForCities=function(b,c,e){var f,g;f=!1,g=a("select[name=city]",d).val(),a.each(e,function(a,b){if(b===g)return f=!0});return f?""!==b:!0},a.validator.methods.completeUrl=function(b,c){if(b.length===0)return!0;/^(https?|ftp):\/\//i.test(b)||(b="http://"+b,a(c).val(b));return/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:)*@)?(((\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})|[!\$&amp;'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(b)},d.validate({rules:{name:"required",company:"required",email:{required:!0,email:!0},metro_station:"required",telephone:"required",address:"required",url:{completeUrl:!0,requiredForCities:["Москва"]}},errorClass:"row-error",validClass:"row-valid",highlight:function(b,c,d){return a(b).parent(".row").addClass(c).removeClass(d)},unhighlight:function(b,c,d){return a(b).parent(".row").removeClass(c).addClass(d)},errorPlacement:function(a,b){}});return a(".cases-wrap").cycle({fx:"fade",timeout:0,next:a(".cases-next"),prev:a(".cases-prev")})})}.call(this),function(){app.on("#all_offers",function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;if(location.hash==="#chuck"){n=a("@slideshow");if(n.length<6)return;e=a("<div class='chuck-offers' />").appendTo("body"),p=a("<div class='wrap' />").appendTo(e);for(j=1;j<=6;j++)a("<div class='part"+j+" part' />").appendTo(p);i=a("<div class='full' />").appendTo(p).css({opacity:0}),a('<a href="#" class="popup-close" />').appendTo(i),f=0,m=function(){return a.scrollTo(250,function(){var b;e.show(),p.show().css({top:a(n[0]).offset().top}),b=p.offset().top,a(".part3, .part4",p).css({top:a(n[2]).offset().top-b}),a(".part5, .part6",p).css({top:a(n[4]).offset().top-b}),app.shadow.show(),a(".part",p).css({opacity:0}).show().animate({opacity:1},300),after("350ms",function(){var b;b=a(".part1",p).height(),a(".part1").animate({left:"+=19px"},800),a(".part2").animate({left:"-=19px"},800),a(".part3").animate({left:"+=19px",top:b},800),a(".part4").animate({left:"-=19px",top:b},800),a(".part5").animate({left:"+=19px",top:2*b},800);return a(".part6").animate({left:"-=19px",top:2*b},800)}),after("1500ms",function(){return i.animate({opacity:1},400)});return a(".fullscreen-shadow, .chuck-offers a").click(function(){a(".part",p).hide(),b=a(window).height()-i.offset().top,i.animate({top:b},600,"easeInQuad",function(){app.shadow.hide(),a(".part1, .part3, .part5").css({left:"-=19px"}),a(".part2, .part4, .part6").css({left:"+=19px"}),i.css({top:0,opacity:0});return e.hide()});return!1})})},window.showChuck=m,r=[];for(j=0,q=n.length;j<q;j++){g=n[j];if(j>5)return;k=a("img",g),l=Math.round((k.length+.49)*Math.random()),d=a("<img />").attr({src:"/images/all-offers/chuck/"+(j+1)+".jpg"}),l===0?(h=a(k[0]).removeClass("first"),d.insertBefore(h).addClass("first")):d.insertAfter(k[l-1]),o=a("@switcher",g),a("<div data-slide='"+k.length+"' role='switcher' />").insertAfter(o[o.length-1]),r.push(function(a){l===0&&(a.addClass("chuck"),f+=1),d.bind("open",function(){f+=1,a.addClass("chuck");if(f===6)return after("250ms",function(){if(f===6)return m()})});return k.bind("open",function(){a.hasClass("chuck")&&(f-=1);return a.removeClass("chuck")})}(a(g).closest("@offer")))}return r}})}.call(this),function(){app.on("#all_offers",function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;b(".line").each(function(){var b,c;b=a(".offer.left  h2 a",this),c=a(".offer.right h2 a",this);return b.height()>c.height()?c.height(b.height()):b.height(c.height())}),A=b("@offer");for(t=0,w=A.length;t<w;t++)e=A[t],j=a(e),j.data("distance")!=null&&j.data("distance")!==""&&a('<div class="distance" />').text(j.data("distance")).appendTo(j.find(".images")),i=j.find(".metro"),i.hasClass(c.data("city"))||i.hide();g=function(b){var c;c=a('<img role="img">').attr({src:b.data("src")}).replaceAll(b);return c.addClass(b.attr("class")).removeClass("unloaded")},B=b(".line.scroll-load");for(e=0,x=B.length;e<x;e++){f=B[e];if(e>=3)break;C=a(f).removeClass("scroll-load").find(".offer");for(u=0,y=C.length;u<y;u++)j=C[u],g(a(".unloaded.first",a(j)))}k=b(".line.scroll-load").length,k&&a(window).bind("scroll.image-loading",function(){var c,d,e,h,i,j,l,m;h=a(window).scrollTop(),c=a(window).height(),l=b(".line.scroll-load"),m=[];for(i=0,j=l.length;i<j;i++){d=l[i],f=a(d);if(f.offset().top>h+c)break;f.removeClass("scroll-load"),k-=1,k===0&&a(window).unbind("scroll.image-loading"),f.removeClass("scroll-load"),m.push(function(){var b,c,d,h;d=f.find(".offer"),h=[];for(b=0,c=d.length;b<c;b++)e=d[b],h.push(g(a(".unloaded:first",a(e))));return h}())}return m}),a(window).bind("load",function(){return after(1,function(){return a(window).trigger("scroll.image-loading")})}),h=function(b){var c,d,e,f,h;if(!b.data("loaded")){b.data({loaded:!0}),b.addClass("loading"),d=b.find(".unloaded"),h=[];for(e=0,f=d.length;e<f;e++)c=d[e],h.push(g(a(c)));return h}},b("@highlight").hoverIntent(function(){return h(a(this).closest(".offer").addClass("hover"))},function(){return a(this).closest(".offer").removeClass("hover")}),r=b("@countdown"),n=(new Date(c.data("now")*1e3)).valueOf(),m=new Date,r.each(function(){return a(this).data({saleTo:new Date(a(this).data("timestamp")*1e3)})}),Visibility.every("second",function(){var b;b=n+(new Date-m);return r.each(function(){var c,d,e,f;f=a(this),e=(f.data("saleTo")-b).valueOf();if(e<0)return f.addClass("finished").text("Акция закончена");d=app.time(e),c=app.pl(d.days,"день","дня","дней");return f.find("@time").text(""+c+" "+d.hours+":"+d.min+":"+d.sec)})}),l=b("@slideshow").each(function(){var b,c,d;c=a(this),b=c.find("@img").length,d=Math.round(c.width()/b),c.find("@progress").width(d),c.find("@switcher").width(Math.floor(c.width()/b));return c.data({slide:c.width(),progress:d})}),l.find("@switcher").hoverIntent(function(){var b,c,d;d=a(this),c=parseInt(d.data("slide")),b=d.closest("@slideshow"),b.find("@img:eq("+c+")").trigger("open"),b.find("@slider").animate({left:-c*b.data("slide")},250,"easeInCubic");return b.find("@progress").animate({left:c*b.data("progress")},250,"easeInCubic")}),q=b(".tags"),s=b(".user-tags").data("tags"),p=q.find("li");if(s)for(v=0,z=p.length;v<z;v++)d=p[v],o=a(d),s.indexOf(o.data("tagId"))>=0&&o.addClass("checked");else q.hide();p.click(function(){var b,c,d;d=a(this);if(!d.hasClass("uploading")){b=d.hasClass("checked")?"remove":"add",c=d.data("tagId"),o=a("li[data-tag-id="+c+"]"),o.toggleClass("uploading");return a.post("/user/edit_tags",{id:c,tag_action:b},function(a){if(a!=="double")return o.toggleClass("uploading checked")})}});return a("@user-place").change(function(){var b,c;c=location.href.replace(/place=\d+/,""),b=a(this).val();if(b){c+=c.match(/\?/)?"&":"?";return location.href=c+"place="+b}return location.href=c.replace(/\?$/,"")})})}.call(this),function(){$(function(){return $("@hide_notification_notice").click(function(){var a,b;a=$(this).closest(".notice-about-notification"),a.animate({bottom:-a.height()-5},400),b=(new Date).valueOf()/1e3,$.cookie("hidden_notification",b,{path:"/"});return!1})})}.call(this),function(){app.on("#offer",function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;o=b(".offer-info"),e=a(".about",o),q=a(".map",o),r=a("#offer-map"),B=b(".tabs"),d=function(){function c(){this.element=a(b(".balloons .template").html()),this.close=this.element.find(".close"),this.content=this.element.find(".content")}c.prototype.disableClose=function(){return this.close.unbind("click").hide()},c.prototype.enableClose=function(a){return this.close.show().click(function(){a.apply(this,arguments);return!1})},c.prototype.onAddToParent=function(a){this.element.appendTo(a),this.element.css({opacity:0}).animate({opacity:1},300);return this.update()},c.prototype.onRemoveFromParent=function(){return this.element.animate({opacity:0},300,function(){return a(this).remove()})},c.prototype.setContent=function(a){return a.onAddToParent(this.content[0])},c.prototype.update=function(){var a;a=this.getOffset();return this.element.css({marginTop:a.getY(),marginLeft:a.getX()})},c.prototype.getOffset=function(){return new YMaps.Point(-173,-this.element.height()-16)},c.prototype.getSize=function(){return new YMaps.Size(this.element.width(),this.element.height())},c.prototype.setMaxSize=function(a,b){};return c}(),w={},s=!1,z=function(){var c,f,g,h,i,j;if(typeof YMaps!="undefined"&&YMaps!==null){r.css({visibility:"visible"});if(s)return;s=!0;if(!r.length)return;c=b(".offer-card").height(),q.height()<c&&a(".wrap",q).height(c),h=new YMaps.Map(r),h.addControl(new YMaps.SmallZoom),j=new YMaps.Style,j.iconStyle=new YMaps.IconStyle(new YMaps.Template('<div class="pin"><div>$[number]</div></div>')),j.balloonStyle={template:new YMaps.LayoutTemplate(d)},i=[],f=function(a,c,d){var e;i.push(a),e=new YMaps.Placemark(a,{style:j,hideIcon:!1,zIndexActive:YMaps.ZIndex.OVERLAY}),e.number=d+1,e.setBalloonContent(b(".balloons .place"+c.id).html()),w[c.id]=e;return h.addOverlay(e)},a.each(r.data("places"),function(a,b){var c;c=new YMaps.GeoPoint(b.longitude,b.latitude);return f(c,b,a)}),i.length===1?h.setCenter(i[0],r.data("places")[0].zoom):(h.setBounds(new YMaps.GeoCollectionBounds(i)),h.setZoom(h.getZoom()-1)),g=null;return a(".few-places a",e).click(function(){var b;b=w[a(this).data("id")],b.getBalloon()?h.closeBalloon():b.openBalloon();return!1})}},i=a(".comments",o),j=a("form",i),g=a("li.comment",B),f=!1,m=function(){var b;if(!!f){f=!1;if(a.browser.msie){g.animate({top:0},150);return j.hide()}g.delay(150).animate({top:0},150),b=-j.height();return j.animate({marginTop:b,opacity:0},300,function(){return a(this).hide()})}},j.ajaxForm({noJSON:!0,success:function(b){a("textarea",j).val(""),a(".empty",i).slideUp();return a(b).prependTo(a(".list",i)).hide().slideDown(function(){return location.hash="#comments"})}}),j.find("textarea").keydown(function(a){if("13"===a.keyCode&&a.metaKey)return j.submit()}),l=!0,k=e,u=!1,o.find("> div").each(function(b){return a(this).data({pos:b})}),y=function(a,b){var c,d;if(!u){m();if(a===k){typeof b=="function"&&b();return}u=!0;if(l){k.hide(),k=a.show(),typeof b=="function"&&b();return u=!1}d=k.data("pos")<a.data("pos")?"left":"right",c={},c[d]=0,o.height(a.outerHeight(!0));return a.show().css({position:"absolute",zIndex:40}).css(d,a.width()).animate(c,300,"easeInOutQuart",function(){k.hide(),k=a.css({position:"static",zIndex:"auto"}).css(d,"auto"),o.css({height:"auto"}),typeof b=="function"&&b();return u=!1})}},v=function(b){a(".open",B).removeClass("open");return a("a[href="+b+"]",B).closest("li").addClass("open")},A=function(){z();return a("iframe",e).css({visibility:"visible"})},n=function(){r.css({visibility:"hidden"});return a("iframe",e).css({visibility:"hidden"})},h=a("a",B).map(function(a,b){return b.href.substr(b.href.indexOf("#"))}),x=null,t=function(b){var c,d;d="#terms"===b,"#terms"===b&&(b="#about");if(x===""&&b==="#about"&&e.is(":visible"))x=b;else{x=b,c=!1,a.each(h,function(a,d){if(b===d)return c=!0}),c||(b="#about"),v("#add"===b?"#comments":b),n();if("#about"===b)return y(e,function(){A();if(d)return a(".cols",e).scrollTo()});if("#comments"===b)return y(i);if("#add"===b)return y(i,function(){var b;f=!0,l?(j.show(),g.css({top:g.height()})):(g.animate({top:g.height()},150),a.browser.msie?j.show():(b=-j.height(),j.show().css({marginTop:b,opacity:0}).animate({marginTop:0,opacity:1},300)));return j.find("textarea").focus()})}},p="onhashchange"in window&&!app.ie(7),p?a(window).bind("hashchange",function(){return t(location.hash)}):b(".tabs a, .comments a.cancel").click(function(){return t(a(this).attr("href"))}),t(location.hash),l=!1,b(".tabs .about span").click(function(){if(!!a(this).closest("li").hasClass("open")){a(".cols",e).scrollTo(),location.hash="#terms";return!1}});return e.find(".description a, .cols a").click(function(){return app.track("/counterlink/"+c.data("permalink"))})})}.call(this),function(){app.on("#offer .main-box",function(a,b){var c,d,e,f,g,h,i;a(window).bind("load",function(){var c,d,e,f,g,h,i,j;e=b(".slideshow li"),h=[];for(i=0,j=e.length;i<j;i++)d=e[i],a("img",d).width()>100&&h.push(a(d));g=0,c=h[g],f=function(){var c;c=b(".slideshow .unloaded:first");if(!!c.length)return after("2sec",function(){var b;b=a("<img>").attr({src:c.data("src")}).replaceAll(c),b.load(function(){if(b.width()>100)return h.push(b.parent())});return after("3sec",function(){return f()})})},f();return Visibility.every("5sec",function(){var a;if(!(h.length<=1)){g=g===h.length-1?0:g+1,a=h[g],a.show().css({opacity:1});return c.animate({opacity:0},1e3,"easeInOutQuad",function(){c.removeClass("show").hide().css({opacity:1});return c=a.addClass("show")})}})}),b(".price a").click(function(){return app.track("/click/buy_kupon/?"+window.current_user)}),a("a[rel=bonus]").click(function(b){var c;c=parseInt(a(".price strong").text()),app.confirm.open(b,"Подтверждение оплаты","С вашего счета будет списано "+app.pl(c,"бонус.","бонуса.","бонусов."),{"data-method":"post",href:a(this).data("pay")});return!1}),a("a[rel=group]").click(function(){var b,c;b=a(".main-box .price .old-styled-button").offset(),c=a(".dealspopup"),c.css({top:b.top+55,left:b.left-c.width()+110}),c.is(":visible")?c.fadeOut(300):c.fadeIn(200,function(){return c.scrollTo(-60)});return!1}),a(".dealspopup-close").click(function(){a(".dealspopup").fadeOut(300);return!1}),i=function(a){return a.toggleClass("pdeal-more-opened").siblings(".pdeal-content").slideToggle()},a(".pdeal-more a").click(function(){var b,c;c=a(".pdeal-more-opened"),b=a(this).parent(),c.length&&i(c),b[0]!==c[0]&&i(b);return!1}),b(".gift a").click(function(){a(".subbuy").hasClass("disabled")||app.question.ask(a(this),a(".ask-gift-email"));return!1}),a(".question .ask-gift-email").submit(function(){if(a.trim(a(".question #gift_email").val())==="")return!1}),b("a.oneclick").click(function(){var b;if(a(".subbuy").hasClass("disabled"))return!1;b=a(this).find("div").addClass("loader"),a.ajax({url:a(this).attr("rel"),data:{},type:"POST",success:function(b){a(b).appendTo("body");return a("form:last").submit()},error:function(){b.removeClass("loader");return app.flash.error("Ошибка на сервере. Попробуйте обычную оплату.")}});return!1}),h=b(".time strong"),h.length&&(d=new Date(h.data("timestamp")*1e3),f=(new Date(h.data("now")*1e3)).valueOf(),e=new Date,Visibility.every("second",function(){var a,b,c,g;c=f+(new Date-e),b=(d-c).valueOf();if(b<0)return h.text("Акция закончена");a=app.time(b),g=app.pl(a.days,"день ","дня ","дней "),g+=a.hours+":"+a.min+":"+a.sec+"";return h.text(g)})),"#buy"===location.hash&&b(".price .old-styled-button").click(),g=b(".tags"),c=function(b){var c,d;if(!b.hasClass("uploading")){c=b.hasClass("checked")?"remove":"add",b.toggleClass("uploading"),d={id:b.attr("tag_id"),tag_action:c};return a.post("/user/edit_tags",d,function(a){if(a!=="double"){b.toggleClass("uploading");return b.toggleClass("checked")}})}},a("li",g).click(function(){return c(a(this))});if(a("body").hasClass("not-logged")){a(".price a:not(.multioffer), .buy a, .pdeal-buy a").click(function(){var b;b=a(this).attr("href"),a("@show-auth-popup").trigger("click",b);return!1});return a(".pdeal-buy a").click(function(){a(".dealspopup-close").click();return!1})}})}.call(this),function(){app.on("#offer",function(a,b){var c;c=b("@additional-offers").data("url");return a.get(c,function(a){return b("@additional-offers").append(a)})})}.call(this),function(){app.on(".top-message-content",function(a,b,c){var d,e,f,g,h;e=function(){return c.animate({opacity:0},400,function(){return c.animate({height:0},200,function(){return c.remove()})})},b("@hide-top-message").click(function(){a.cookie("no_sex_request",1,{expires:1,path:"/"}),e();return!1}),b("@i-am-men, @i-am-women").click(function(){var b;b=a(this).hasClass("men-button")?1:2,a.put("/user",{user:{gender:b}}),e();return!1}),h=b(".time"),g=new Date,f=6e4;return d=Visibility.every("1sec",function(){var b,e;b=f-(new Date-g);if(b<0)c.animate({opacity:0},400),Visibility.stop(d),a.cookie("no_sex_request",1,{expires:1,path:"/"});else{e=app.time(b);return h.text(""+e.min+":"+e.sec)}})})}.call(this),function(){var a;a=function(a,b){var c;b==null&&(b=void 0),c=parseInt(a.val()),c>0||a.val(c=1).select(),b!=null&&c>b&&a.val(c=100),c.toString()!==a.val()&&a.val(c);return c},app.on(".payment-content:not(.deposit-content)",function(b,c,d){var e,f,g,h,i,j,k,l;e=c("@amount"),f=null,h=c("@quantity-disabler"),d.bind("disable-quantity",function(){return h.addClass("disabled").find("input").attr({disabled:!0})}),b("@select-user-to-gift").ask(b(".ask-gift-email")),c("@quantity-up, @quantity-down").click(function(){var c,d;if(h.hasClass("disabled"))return!1;c=a(e,100),d=b(this).is("@quantity-up");if(c===1&&!d)return!1;f&&f.stop(!0,!0),e.stop(!0,!0),e.val(c+(d?1:-1)),f=b('<div class="before-value" />').text(c),d?(e.after(f),e.css({marginTop:-e.height()}),e.animate({marginTop:0},300,function(){return f.remove()})):(e.before(f),f.animate({marginTop:-e.height()},300,function(){return f.remove()})),e.change();return!1}),i=parseInt(e.val()),i>0||(i=1),e.click(function(){return e.select()}),g=null,k=c("@sum"),j=c("@price").data("price"),l=c("@sum-value");return e.bind("change keyup",function(){var d;d=a(e,100);if(i!==d){g&&g.stop(!0,!0),k.stop(!0,!0),g=b('<div class="before-value" />').text(k.text()),l.text(Russian.formatNumber(d*j)),d>i?(k.after(g),k.css({marginTop:-k.height()}),k.animate({marginTop:0},300,function(){return g.remove()})):(k.before(g),g.animate({marginTop:-k.height()},300,function(){return g.remove()})),i=d,c(".payment-methods").addClass("updating");return b.put(location.pathname,{"payment[quantity]":d},function(a){return c(".payment-methods").replaceWith(a)})}})}),app.on(".deposit-content",function(b,c){var d,e;d=c("@deposit"),d.click(function(){return d.select()}),e=d.width(),d.bind("change keyup",function(){var f,g;g=d.val(),g.length>3?d.width(e+(g.length-3)*13):d.width(e),f=a(d),c(".payment-methods").addClass("updating");return b.get(location.pathname,{amount:f},function(a){return c(".payment-methods").replaceWith(a)})});return d.change()})}.call(this),function(){app.on(".payment-methods",function(a){var b,c,d,e,f,g;b=function(b){return a(".payment-methods "+b)},c=function(b){return b!=null?a(".payment-methods").data(b):a(".payment-methods")},g=function(b,d){return a.get(b.data("url"),function(e){var f;b.removeClass("loading").addClass("open"),f=a(e).appendTo(c()).hide().slideDown(300),f.scrollTo(),c().one("close-method",function(){b.removeClass("open"),f.slideUp(300,function(){return f.remove()});return a(".payment-content").scrollTo()});return d(f)})},f={},e=function(a,b){return f[a]=b},d=function(a){var b,c,d;d=[];for(c in f){b=f[c];if(a.is(c)){b.call(a);break}}return d},b(".blocker").live("click",function(){return app.flash.error("Подождите немного, пока платёжка обновится")}),b("a.from-balance").live("click",function(){var b,c,d,e;if(!a.browser.msie){d=a(this),b=d.data("currency"),d.data("balance")<d.data("price")?(c=Russian.formatNumber(d.data("price")-d.data("balance")),app.confirm.open(event,"На балансе не хватает "+c+" "+b,"Пополнить баланс в личном кабинете?",d.attr("href"))):(e=Russian.formatNumber(d.data("price")),app.confirm.open(event,"Подтверждение оплаты","С вашего счёта будет списано "+e+" "+b,{"data-method":"post",href:d.data("pay")}));return!1}}),b(".methods a").live("click",function(){var b,e;e=a(this);if(e.hasClass("loading"))return!1;if(e.hasClass("open"))return!1;c().trigger("close-method"),e=a(this).addClass("loading"),a(".payment-content").trigger("disable-quantity"),e.data("form")?b=a("#"+e.data("form")).attr("gateway"):b=e.data("gateway"),app.track("/payments/initiate/"+b+"/"+c("id")),b==null?d(e):a.put(c("url")+".json",{payment:{last_gateway:b}}).complete(function(){return d(e)});return!1}),b("@close-method").live("click",function(){c().trigger("close-method");return!1}),e("[data-form]",function(){return a("#"+this.data("form")).submit()}),e("[role=href]",function(){return location.href=this.attr("href")}),e("[role=terminal]",function(){return g(this,function(b){var c;c=b.find(".screenshots .step1");return b.find(".steps a").click(function(){var d,e,f,g;e=a(this),b.find(".steps a.open").removeClass("open"),e.addClass("open"),f=b.find(".screenshots .step"+e.data("number"));if(f.attr("class")===c.attr("class"))return!1;a(".screenshots li").css({zIndex:19}),g=parseInt(f.attr("class").substr(4)),d=parseInt(c.attr("class").substr(4)),g>d?(c.css({zIndex:21}).animate({left:-c.width()},300,"linear"),c=f.show().css({zIndex:20,left:0})):(c.css({zIndex:20}),c=f.show().css({zIndex:21,left:-f.width()}).animate({left:0},300,"linear"));return!1})})}),e("[role=cash]",function(){var b;b=this;return g(b,function(b){var c,d,e,f,g,h;f=b.find("@offices-map");if(!!f.length){e=new YMaps.Map(f),d=new YMaps.Geocoder(f.data("city")),h=new YMaps.TypeControl([YMaps.MapType.MAP,YMaps.MapType.SATELLITE,YMaps.MapType.HYBRID],[1,2]),e.addControl(h),e.addControl(new YMaps.Zoom),e.enableScrollZoom(),g=new YMaps.Style,g.iconStyle=new YMaps.IconStyle,g.iconStyle.href=f.data("marker"),g.iconStyle.size=new YMaps.Point(62,64),g.iconStyle.offset=new YMaps.Point(-21,-64),c=new PlacemarkClusterer(e,null,{style:{url:f.data("empty"),width:62,height:64}});return YMaps.Events.observe(d,d.Events.Load,function(b){if(!!b.length()){e.setBounds(b.get(0).getBounds());return a.getJSON(f.data("offices"),function(a){var b,d,e,f,h;h=[];for(e=0,f=a.length;e<f;e++)b=a[e],d=new YMaps.Placemark(new YMaps.GeoPoint(b.t,b.n),{style:g}),d.description=b.a,h.push(c.addPlacemark(d));return h})}})}})});return e("[role=sms]",function(){return g(this,function(b){var d,e;d=every("5sec",function(){return a.getJSON(c("url"),function(a){if(a.payed){b.find(".sms-status").addClass("done");return clearInterval(d)}})}),c().one("close-method",function(){return clearInterval(d)}),e=b.find(".phone-request");if(e!=null)return e.submit(function(){var b;b=e.find(":text").val();if(b.replace(/[^\d]/g,"").length!==10){app.flash.error("Телефон введён неправильно");return!1}e.find(".loader").show(),a.post(e.attr("action"),e.serialize(),function(){return e.closest(".phone-required").addClass("phone")});return!1})})})})}.call(this),function(){$(document).ready(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;g=$(".newyear-snow"),a=$(".newyear-snow .back"),c=$(".newyear-snow .left  .front"),e=$(".newyear-snow .top   .front"),d=$(".newyear-snow .right .front"),f=b=0,l=1,k=!1,j=null,h=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame,h||(h=function(a){return setTimeout(function(){return a((new Date).valueOf())},10)}),i=function(m){var n,o;k?(l<1&&(l*=1.2),l>1&&(l=1)):(l>.001&&(l/=1.2),l<.001&&(l=0)),n=m-j,j=m,b+=n/70*l,a.css({backgroundPosition:"0 "+Math.round(b)+"px"}),f+=n/30*l,o=Math.round(f),c.css({backgroundPosition:" 100%  "+o+"px"}),e.css({backgroundPosition:"   0   "+o+"px"}),d.css({backgroundPosition:"-900px "+o+"px"});return l===0?g.removeClass("snowing"):h(i)},m=function(){g.addClass("snowing"),k=!0,j=(new Date).valueOf(),l=.01;return h(i)},n=function(){return k=!1};return $("a.home").hover(function(){return m()},function(){return n()})}),app.on(".ny2012-big-banner",function(a,b,c){b(".close").click(function(){c.fadeOut(),a.cookie("no_ny2012_big_banner",1,{expires:365,path:"/"});return!1}),b(".open").click(function(){b(".content").show(),after(0,function(){return c.addClass("opened")});return!1}),b(".sample").click(function(){var b,c;c=a(this).attr("href"),app.shadow.loader(),b=new Image,b.onload=function(){var a;a="Пример праздничного купона",app.shadow.finish();return app.popup.open("<img src='"+c+"' alt='"+a+"' title='"+a+"' />",{cls:"ny2012-sample-certificate",noShadow:!0,open:function(){return this.find(".close").html("<div></div>Закрыть")}})},b.src=c;return!1});return b(".hide").click(function(){c.removeClass("opened"),after("800ms",function(){return b(".content").hide()});return!1})})}.call(this)
