(function($){"use strict";var _iCheck='iCheck',_iCheckHelper=_iCheck+'-helper',_checkbox='checkbox',_radio='radio',_checked='checked',_unchecked='un'+_checked,_disabled='disabled',_determinate='determinate',_indeterminate='in'+_determinate,_update='update',_type='type',_click='click',_touch='touchbegin.i touchend.i',_add='addClass',_remove='removeClass',_callback='trigger',_label='label',_cursor='cursor',_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);$.fn[_iCheck]=function(options,fire){var handle='input[type="'+_checkbox+'"], input[type="'+_radio+'"]',stack=$(),walker=function(object){object.each(function(){var self=$(this);if(self.is(handle)){stack=stack.add(self);}else{stack=stack.add(self.find(handle));}});};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(options)){options=options.toLowerCase();walker(this);return stack.each(function(){var self=$(this);if(options=='destroy'){tidy(self,'ifDestroyed');}else{operate(self,true,options);}if($.isFunction(fire)){fire();}});}else if(typeof options=='object'||!options){var settings=$.extend({checkedClass:_checked,disabledClass:_disabled,indeterminateClass:_indeterminate,labelHover:true},options),selector=settings.handle,hoverClass=settings.hoverClass||'hover',focusClass=settings.focusClass||'focus',activeClass=settings.activeClass||'active',labelHover=!!settings.labelHover,labelHoverClass=settings.labelHoverClass||'hover',area=(''+settings.increaseArea).replace('%','')|0;if(selector==_checkbox||selector==_radio){handle='input[type="'+selector+'"]';}if(area<-50){area=-50;}walker(this);return stack.each(function(){var self=$(this);tidy(self);var node=this,id=node.id,offset=-area+'%',size=100+(area*2)+'%',layer={position:'absolute',top:offset,left:offset,display:'block',width:size,height:size,margin:0,padding:0,background:'#fff',border:0,opacity:0},hide=_mobile?{position:'absolute',visibility:'hidden'}:area?layer:{position:'absolute',opacity:0},className=node[_type]==_checkbox?settings.checkboxClass||'i'+_checkbox:settings.radioClass||'i'+_radio,label=$(_label+'[for="'+id+'"]').add(self.closest(_label)),aria=!!settings.aria,ariaID=_iCheck+'-'+Math.random().toString(36).substr(2,6),parent='
')[_callback]('ifCreated').parent().append(settings.insert);helper=$('').css(layer).appendTo(parent);self.data(_iCheck,{o:settings,s:self.attr('style')}).css(hide);!!settings.inheritClass&&parent[_add](node.className||'');!!settings.inheritID&&id&&parent.attr('id',_iCheck+'-'+id);parent.css('position')=='static'&&parent.css('position','relative');operate(self,true,_update);if(label.length){label.on(_click+'.i mouseover.i mouseout.i '+_touch,function(event){var type=event[_type],item=$(this);if(!node[_disabled]){if(type==_click){if($(event.target).is('a')){return;}operate(self,false,true);}else if(labelHover){if(/ut|nd/.test(type)){parent[_remove](hoverClass);item[_remove](labelHoverClass);}else{parent[_add](hoverClass);item[_add](labelHoverClass);}}if(_mobile){event.stopPropagation();}else{return false;}}});}self.on(_click+'.i focus.i blur.i keyup.i keydown.i keypress.i',function(event){var type=event[_type],key=event.keyCode;if(type==_click){return false;}else if(type=='keydown'&&key==32){if(!(node[_type]==_radio&&node[_checked])){if(node[_checked]){off(self,_checked);}else{on(self,_checked);}}return false;}else if(type=='keyup'&&node[_type]==_radio){!node[_checked]&&on(self,_checked);}else if(/us|ur/.test(type)){parent[type=='blur'?_remove:_add](focusClass);}});helper.on(_click+' mousedown mouseup mouseover mouseout '+_touch,function(event){var type=event[_type],toggle=/wn|up/.test(type)?activeClass:hoverClass;if(!node[_disabled]){if(type==_click){operate(self,false,true);}else{if(/wn|er|in/.test(type)){parent[_add](toggle);}else{parent[_remove](toggle+' '+activeClass);}if(label.length&&labelHover&&toggle==hoverClass){label[/ut|nd/.test(type)?_remove:_add](labelHoverClass);}}if(_mobile){event.stopPropagation();}else{return false;}}});});}else{return this;}};function operate(input,direct,method){var node=input[0],state=/er/.test(method)?_indeterminate:/bl/.test(method)?_disabled:_checked,active=method==_update?{checked:node[_checked],disabled:node[_disabled],indeterminate:input.attr(_indeterminate)=='true'||input.attr(_determinate)=='false'}:node[state];if(/^(ch|di|in)/.test(method)&&!active){on(input,state);}else if(/^(un|en|de)/.test(method)&&active){off(input,state);}else if(method==_update){for(var each in active){if(active[each]){on(input,each,true);}else{off(input,each,true);}}}else if(!direct||method=='toggle'){if(!direct){input[_callback]('ifClicked');}if(active){if(node[_type]!==_radio){off(input,state);}}else{on(input,state);}}}function on(input,state,keep){var node=input[0],parent=input.parent(),checked=state==_checked,indeterminate=state==_indeterminate,disabled=state==_disabled,callback=indeterminate?_determinate:checked?_unchecked:'enabled',regular=option(input,callback+capitalize(node[_type])),specific=option(input,state+capitalize(node[_type]));if(node[state]!==true){if(!keep&&state==_checked&&node[_type]==_radio&&node.name){var form=input.closest('form'),inputs='input[name="'+node.name+'"]';inputs=form.length?form.find(inputs):$(inputs);inputs.each(function(){if(this!==node&&$(this).data(_iCheck)){off($(this),state);}});}if(indeterminate){node[state]=true;if(node[_checked]){off(input,_checked,'force');}}else{if(!keep){node[state]=true;}if(checked&&node[_indeterminate]){off(input,_indeterminate,false);}}callbacks(input,checked,state,keep);}if(node[_disabled]&&!!option(input,_cursor,true)){parent.find('.'+_iCheckHelper).css(_cursor,'default');}parent[_add](specific||option(input,state)||'');if(!!parent.attr('role')&&!indeterminate){parent.attr('aria-'+(disabled?_disabled:_checked),'true');}parent[_remove](regular||option(input,callback)||'');}function off(input,state,keep){var node=input[0],parent=input.parent(),checked=state==_checked,indeterminate=state==_indeterminate,disabled=state==_disabled,callback=indeterminate?_determinate:checked?_unchecked:'enabled',regular=option(input,callback+capitalize(node[_type])),specific=option(input,state+capitalize(node[_type]));if(node[state]!==false){if(indeterminate||!keep||keep=='force'){node[state]=false;}callbacks(input,checked,callback,keep);}if(!node[_disabled]&&!!option(input,_cursor,true)){parent.find('.'+_iCheckHelper).css(_cursor,'pointer');}parent[_remove](specific||option(input,state)||'');if(!!parent.attr('role')&&!indeterminate){parent.attr('aria-'+(disabled?_disabled:_checked),'false');}parent[_add](regular||option(input,callback)||'');}function tidy(input,callback){if(input.data(_iCheck)){input.parent().html(input.attr('style',input.data(_iCheck).s||''));if(callback){input[_callback](callback);}input.off('.i').unwrap();$(_label+'[for="'+input[0].id+'"]').add(input.closest(_label)).off('.i');}}function option(input,state,regular){if(input.data(_iCheck)){return input.data(_iCheck).o[state+(regular?'':'Class')];}}function capitalize(string){return string.charAt(0).toUpperCase()+string.slice(1);}function callbacks(input,checked,callback,keep){if(!keep){if(checked){input[_callback]('ifToggled');}input[_callback]('ifChanged')[_callback]('if'+capitalize(callback));}}})(window.jQuery||window.Zepto);// Ion.RangeSlider // version 1.9.0 Build: 167 // © 2013-2014 Denis Ineshin | IonDen.com // // Project page: http://ionden.com/a/plugins/ion.rangeSlider/ // GitHub page: https://github.com/IonDen/ion.rangeSlider // // Released under MIT licence: // http://ionden.com/a/plugins/licence-en.html // ===================================================================================================================== (function($,document,window,navigator){"use strict";var pluginCount=0,current;var isOldie=(function(){var n=navigator.userAgent,r=/msie\s\d+/i,v;if(n.search(r)>0){v=r.exec(n).toString();v=v.split(" ")[1];if(v<9){return true;}}return false;}());var isTouch=(('ontouchstart'in window)||(navigator.msMaxTouchPoints>0));var testNumber=function(num){if(typeof num==="Number"){if(isNaN(num)){return null;}else{return num;}}else{num=parseFloat(num);if(isNaN(num)){return null;}else{return num;}}};var methods={init:function(options){var baseHTML=''+''+'01'+'000'+''+'';var singleHTML='';var doubleHTML=''+''+'';var disableHTML='';return this.each(function(){var settings=$.extend({min:null,max:null,from:null,to:null,type:"single",step:null,prefix:"",postfix:"",maxPostfix:"",hasGrid:false,hideMinMax:false,hideFromTo:false,prettify:true,disable:false,values:null,onChange:null,onLoad:null,onFinish:null},options);var slider=$(this),self=this,allow_values=false,value_array=null;if(slider.data("isActive")){return;}slider.data("isActive",true);pluginCount+=1;this.pluginCount=pluginCount;if(slider.prop("value")){value_array=slider.prop("value").split(";");}if(settings.type==="single"){if(value_array&&value_array.length>1){if(typeof settings.min!=="number"){settings.min=parseFloat(value_array[0]);}else{if(typeof settings.from!=="number"){settings.from=parseFloat(value_array[0]);}}if(typeof settings.max!=="number"){settings.max=parseFloat(value_array[1]);}}else if(value_array&&value_array.length===1){if(typeof settings.from!=="number"){settings.from=parseFloat(value_array[0]);}}}else if(settings.type==="double"){if(value_array&&value_array.length>1){if(typeof settings.min!=="number"){settings.min=parseFloat(value_array[0]);}else{if(typeof settings.from!=="number"){settings.from=parseFloat(value_array[0]);}}if(typeof settings.max!=="number"){settings.max=parseFloat(value_array[1]);}else{if(typeof settings.to!=="number"){settings.to=parseFloat(value_array[1]);}}}else if(value_array&&value_array.length===1){if(typeof settings.min!=="number"){settings.min=parseFloat(value_array[0]);}else{if(typeof settings.from!=="number"){settings.from=parseFloat(value_array[0]);}}}}if(typeof slider.data("min")==="number"){settings.min=parseFloat(slider.data("min"));}if(typeof slider.data("max")==="number"){settings.max=parseFloat(slider.data("max"));}if(typeof slider.data("from")==="number"){settings.from=parseFloat(slider.data("from"));}if(typeof slider.data("to")==="number"){settings.to=parseFloat(slider.data("to"));}if(slider.data("step")){settings.step=parseFloat(slider.data("step"));}if(slider.data("type")){settings.type=slider.data("type");}if(slider.data("prefix")){settings.prefix=slider.data("prefix");}if(slider.data("postfix")){settings.postfix=slider.data("postfix");}if(slider.data("maxpostfix")){settings.maxPostfix=slider.data("maxpostfix");}if(slider.data("hasgrid")){settings.hasGrid=slider.data("hasgrid");}if(slider.data("hideminmax")){settings.hideMinMax=slider.data("hideminmax");}if(slider.data("hidefromto")){settings.hideFromTo=slider.data("hidefromto");}if(slider.data("prettify")){settings.prettify=slider.data("prettify");}if(slider.data("disable")){settings.disable=slider.data("disable");}if(slider.data("values")){settings.values=slider.data("values").split(",");}settings.min=testNumber(settings.min);if(!settings.min&&settings.min!==0){settings.min=10;}settings.max=testNumber(settings.max);if(!settings.max&&settings.max!==0){settings.max=100;}if(Object.prototype.toString.call(settings.values)!=="[object Array]"){settings.values=null;}if(settings.values&&settings.values.length>0){settings.min=0;settings.max=settings.values.length-1;settings.step=1;allow_values=true;}settings.from=testNumber(settings.from);if(!settings.from&&settings.from!==0){settings.from=settings.min;}settings.to=testNumber(settings.to);if(!settings.to&&settings.to!==0){settings.to=settings.max;}settings.step=testNumber(settings.step);if(!settings.step){settings.step=1;}if(settings.fromsettings.max){settings.from=settings.min;}if(settings.tosettings.max){settings.to=settings.max;}if(settings.type==="double"){if(settings.from>settings.to){settings.from=settings.to;}if(settings.to';slider[0].style.display="none";slider.before(containerHTML);var $container=slider.prev(),$body=$(document.body),$window=$(window),$rangeSlider,$fieldMin,$fieldMax,$fieldFrom,$fieldTo,$fieldSingle,$singleSlider,$fromSlider,$toSlider,$activeSlider,$diapason,$grid;var allowDrag=false,sliderIsActive=false,firstStart=true,numbers={};var mouseX=0,fieldMinWidth=0,fieldMaxWidth=0,normalWidth=0,fullWidth=0,sliderWidth=0,width=0,left=0,right=0,minusX=0,stepFloat=0;if(parseInt(settings.step,10)!==parseFloat(settings.step)){stepFloat=settings.step.toString().split(".")[1];stepFloat=Math.pow(10,stepFloat.length);}this.updateData=function(options){firstStart=true;settings=$.extend(settings,options);removeHTML();};this.removeSlider=function(){$container.find("*").off();$window.off("mouseup.irs"+self.pluginCount);$body.off("mouseup.irs"+self.pluginCount);$body.off("mousemove.irs"+self.pluginCount);$container.html("").remove();slider.data("isActive",false);slider.show();};var removeHTML=function(){$container.find("*").off();$window.off("mouseup.irs"+self.pluginCount);$body.off("mouseup.irs"+self.pluginCount);$body.off("mousemove.irs"+self.pluginCount);$container.html("");placeHTML();};var placeHTML=function(){$container.html(baseHTML);$rangeSlider=$container.find(".irs");$fieldMin=$rangeSlider.find(".irs-min");$fieldMax=$rangeSlider.find(".irs-max");$fieldFrom=$rangeSlider.find(".irs-from");$fieldTo=$rangeSlider.find(".irs-to");$fieldSingle=$rangeSlider.find(".irs-single");$grid=$container.find(".irs-grid");if(settings.hideMinMax){$fieldMin[0].style.display="none";$fieldMax[0].style.display="none";fieldMinWidth=0;fieldMaxWidth=0;}if(settings.hideFromTo){$fieldFrom[0].style.display="none";$fieldTo[0].style.display="none";$fieldSingle[0].style.display="none";}if(!settings.hideMinMax){if(settings.values){$fieldMin.html(settings.prefix+settings.values[0]+settings.postfix);$fieldMax.html(settings.prefix+settings.values[settings.values.length-1]+settings.maxPostfix+settings.postfix);}else{$fieldMin.html(settings.prefix+prettify(settings.min)+settings.postfix);$fieldMax.html(settings.prefix+prettify(settings.max)+settings.maxPostfix+settings.postfix);}fieldMinWidth=$fieldMin.outerWidth();fieldMaxWidth=$fieldMax.outerWidth();}if(settings.type==="single"){$rangeSlider.append(singleHTML);$singleSlider=$rangeSlider.find(".single");$singleSlider.on("mousedown",function(e){e.preventDefault();e.stopPropagation();calcDimensions(e,$(this),null);allowDrag=true;sliderIsActive=true;current=self.pluginCount;if(isOldie){$("*").prop("unselectable",true);}});if(isTouch){$singleSlider.on("touchstart",function(e){e.preventDefault();e.stopPropagation();calcDimensions(e.originalEvent.touches[0],$(this),null);allowDrag=true;sliderIsActive=true;current=self.pluginCount;});}}else if(settings.type==="double"){$rangeSlider.append(doubleHTML);$fromSlider=$rangeSlider.find(".from");$toSlider=$rangeSlider.find(".to");$diapason=$rangeSlider.find(".irs-diapason");setDiapason();$fromSlider.on("mousedown",function(e){e.preventDefault();e.stopPropagation();$(this).addClass("last");$toSlider.removeClass("last");calcDimensions(e,$(this),"from");allowDrag=true;sliderIsActive=true;current=self.pluginCount;if(isOldie){$("*").prop("unselectable",true);}});$toSlider.on("mousedown",function(e){e.preventDefault();e.stopPropagation();$(this).addClass("last");$fromSlider.removeClass("last");calcDimensions(e,$(this),"to");allowDrag=true;sliderIsActive=true;current=self.pluginCount;if(isOldie){$("*").prop("unselectable",true);}});if(isTouch){$fromSlider.on("touchstart",function(e){e.preventDefault();e.stopPropagation();$(this).addClass("last");$toSlider.removeClass("last");calcDimensions(e.originalEvent.touches[0],$(this),"from");allowDrag=true;sliderIsActive=true;current=self.pluginCount;});$toSlider.on("touchstart",function(e){e.preventDefault();e.stopPropagation();$(this).addClass("last");$fromSlider.removeClass("last");calcDimensions(e.originalEvent.touches[0],$(this),"to");allowDrag=true;sliderIsActive=true;current=self.pluginCount;});}if(settings.to===settings.max){$fromSlider.addClass("last");}}var mouseup=function(){if(current!==self.pluginCount){return;}if(allowDrag){sliderIsActive=false;allowDrag=false;$activeSlider.removeAttr("id");$activeSlider=null;if(settings.type==="double"){setDiapason();}getNumbers();if(isOldie){$("*").prop("unselectable",false);}}};$window.on("mouseup.irs"+self.pluginCount,function(){mouseup();});$body.on("mousemove.irs"+self.pluginCount,function(e){if(allowDrag){mouseX=e.pageX;dragSlider();}});$container.on("mousedown",function(){current=self.pluginCount;});$container.on("mouseup",function(e){if(current!==self.pluginCount){return;}if(allowDrag||settings.disable){return;}moveByClick(e.pageX);});if(isTouch){$window.on("touchend",function(){if(allowDrag){sliderIsActive=false;allowDrag=false;$activeSlider.removeAttr("id");$activeSlider=null;if(settings.type==="double"){setDiapason();}getNumbers();}});$window.on("touchmove",function(e){if(allowDrag){mouseX=e.originalEvent.touches[0].pageX;dragSlider();}});}getSize();setNumbers();if(settings.hasGrid){setGrid();}if(settings.disable){setMask();}else{removeMask();}};var getSize=function(){normalWidth=$rangeSlider.width();if($singleSlider){sliderWidth=$singleSlider.width();}else{sliderWidth=$fromSlider.width();}fullWidth=normalWidth-sliderWidth;};var calcDimensions=function(e,currentSlider,whichSlider){getSize();firstStart=false;$activeSlider=currentSlider;$activeSlider.attr("id","irs-active-slider");var _x1=$activeSlider.offset().left,_x2=e.pageX-_x1;minusX=_x1+_x2-$activeSlider.position().left;if(settings.type==="single"){width=$rangeSlider.width()-sliderWidth;}else if(settings.type==="double"){if(whichSlider==="from"){left=0;right=parseInt($toSlider.css("left"),10);}else{left=parseInt($fromSlider.css("left"),10);right=$rangeSlider.width()-sliderWidth;}}};var setDiapason=function(){var _w=$fromSlider.width(),_x=$.data($fromSlider[0],"x")||parseInt($fromSlider[0].style.left,10)||$fromSlider.position().left,_width=$.data($toSlider[0],"x")||parseInt($toSlider[0].style.left,10)||$toSlider.position().left,x=_x+(_w/2),w=_width-_x;$diapason[0].style.left=x+"px";$diapason[0].style.width=w+"px";};var dragSlider=function(manual_x){var x_pure=mouseX-minusX,x;if(manual_x){x_pure=manual_x;}else{x_pure=mouseX-minusX;}if(settings.type==="single"){if(x_pure<0){x_pure=0;}if(x_pure>width){x_pure=width;}}else if(settings.type==="double"){if(x_pureright){x_pure=right;}setDiapason();}$.data($activeSlider[0],"x",x_pure);getNumbers();x=Math.round(x_pure);$activeSlider[0].style.left=x+"px";};var getNumbers=function(){var nums={input:slider,slider:$container,min:settings.min,max:settings.max,fromNumber:0,toNumber:0,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0};var diapason=settings.max-settings.min,_from,_to;if(settings.type==="single"){nums.fromX=$.data($singleSlider[0],"x")||parseInt($singleSlider[0].style.left,10)||$singleSlider.position().left;nums.fromPers=nums.fromX/fullWidth*100;_from=(diapason/100*nums.fromPers)+settings.min;nums.fromNumber=Math.round(_from/settings.step)*settings.step;if(nums.fromNumbersettings.max){nums.fromNumber=settings.max;}if(stepFloat){nums.fromNumber=parseInt(nums.fromNumber*stepFloat,10)/stepFloat;}if(allow_values){nums.fromValue=settings.values[nums.fromNumber];}}else if(settings.type==="double"){nums.fromX=$.data($fromSlider[0],"x")||parseInt($fromSlider[0].style.left,10)||$fromSlider.position().left;nums.fromPers=nums.fromX/fullWidth*100;_from=(diapason/100*nums.fromPers)+settings.min;nums.fromNumber=Math.round(_from/settings.step)*settings.step;if(nums.fromNumbersettings.max){nums.toNumber=settings.max;}if(stepFloat){nums.fromNumber=parseInt(nums.fromNumber*stepFloat,10)/stepFloat;nums.toNumber=parseInt(nums.toNumber*stepFloat,10)/stepFloat;}if(allow_values){nums.fromValue=settings.values[nums.fromNumber];nums.toValue=settings.values[nums.toNumber];}}numbers=nums;setFields();};var setNumbers=function(){var nums={input:slider,slider:$container,min:settings.min,max:settings.max,fromNumber:settings.from,toNumber:settings.to,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0};var diapason=settings.max-settings.min;if(settings.type==="single"){nums.fromPers=(diapason!==0)?(nums.fromNumber-settings.min)/diapason*100:0;nums.fromX_pure=fullWidth/100*nums.fromPers;nums.fromX=Math.round(nums.fromX_pure);$singleSlider[0].style.left=nums.fromX+"px";$.data($singleSlider[0],"x",nums.fromX_pure);}else if(settings.type==="double"){nums.fromPers=(diapason!==0)?(nums.fromNumber-settings.min)/diapason*100:0;nums.fromX_pure=fullWidth/100*nums.fromPers;nums.fromX=Math.round(nums.fromX_pure);$fromSlider[0].style.left=nums.fromX+"px";$.data($fromSlider[0],"x",nums.fromX_pure);nums.toPers=(diapason!==0)?(nums.toNumber-settings.min)/diapason*100:1;nums.toX_pure=fullWidth/100*nums.toPers;nums.toX=Math.round(nums.toX_pure);$toSlider[0].style.left=nums.toX+"px";$.data($toSlider[0],"x",nums.toX_pure);setDiapason();}numbers=nums;setFields();};var moveByClick=function(page_x){var x=page_x-$container.offset().left,d=numbers.toX-numbers.fromX,zero_point=numbers.fromX+(d/2);left=0;width=$rangeSlider.width()-sliderWidth;right=$rangeSlider.width()-sliderWidth;if(settings.type==="single"){$activeSlider=$singleSlider;$activeSlider.attr("id","irs-active-slider");dragSlider(x);}else if(settings.type==="double"){if(x<=zero_point){$activeSlider=$fromSlider;}else{$activeSlider=$toSlider;}$activeSlider.attr("id","irs-active-slider");dragSlider(x);setDiapason();}$activeSlider.removeAttr("id");$activeSlider=null;};var setFields=function(){var _from,_fromW,_fromX,_to,_toW,_toX,_single,_singleW,_singleX,_slW=(sliderWidth/2),maxPostfix="";if(settings.type==="single"){if(numbers.fromNumber===settings.max){maxPostfix=settings.maxPostfix;}else{maxPostfix="";}if(!settings.hideText){$fieldFrom[0].style.display="none";$fieldTo[0].style.display="none";if(allow_values){_single=settings.prefix+settings.values[numbers.fromNumber]+maxPostfix+settings.postfix;}else{_single=settings.prefix+prettify(numbers.fromNumber)+maxPostfix+settings.postfix;}$fieldSingle.html(_single);_singleW=$fieldSingle.outerWidth();_singleX=numbers.fromX-(_singleW/2)+_slW;if(_singleX<0){_singleX=0;}if(_singleX>normalWidth-_singleW){_singleX=normalWidth-_singleW;}$fieldSingle[0].style.left=_singleX+"px";if(!settings.hideMinMax&&!settings.hideFromTo){if(_singleXnormalWidth-fieldMaxWidth){$fieldMax[0].style.display="none";}else{$fieldMax[0].style.display="block";}}}slider.attr("value",parseFloat(numbers.fromNumber));}else if(settings.type==="double"){if(numbers.fromNumber===settings.max){maxPostfix=settings.maxPostfix;}else{maxPostfix="";}if(numbers.toNumber===settings.max){maxPostfix=settings.maxPostfix;}else{maxPostfix="";}if(!settings.hideText){if(allow_values){_from=settings.prefix+settings.values[numbers.fromNumber]+settings.postfix;_to=settings.prefix+settings.values[numbers.toNumber]+maxPostfix+settings.postfix;if(numbers.fromNumber!==numbers.toNumber){_single=settings.prefix+settings.values[numbers.fromNumber]+" — "+settings.prefix+settings.values[numbers.toNumber]+maxPostfix+settings.postfix;}else{_single=settings.prefix+settings.values[numbers.fromNumber]+maxPostfix+settings.postfix;}}else{_from=settings.prefix+prettify(numbers.fromNumber)+settings.postfix;_to=settings.prefix+prettify(numbers.toNumber)+maxPostfix+settings.postfix;if(numbers.fromNumber!==numbers.toNumber){_single=settings.prefix+prettify(numbers.fromNumber)+" — "+settings.prefix+prettify(numbers.toNumber)+maxPostfix+settings.postfix;}else{_single=settings.prefix+prettify(numbers.fromNumber)+maxPostfix+settings.postfix;}}$fieldFrom.html(_from);$fieldTo.html(_to);$fieldSingle.html(_single);_fromW=$fieldFrom.outerWidth();_fromX=numbers.fromX-(_fromW/2)+_slW;if(_fromX<0){_fromX=0;}if(_fromX>normalWidth-_fromW){_fromX=normalWidth-_fromW;}$fieldFrom[0].style.left=_fromX+"px";_toW=$fieldTo.outerWidth();_toX=numbers.toX-(_toW/2)+_slW;if(_toX<0){_toX=0;}if(_toX>normalWidth-_toW){_toX=normalWidth-_toW;}$fieldTo[0].style.left=_toX+"px";_singleW=$fieldSingle.outerWidth();_singleX=numbers.fromX+((numbers.toX-numbers.fromX)/2)-(_singleW/2)+_slW;if(_singleX<0){_singleX=0;}if(_singleX>normalWidth-_singleW){_singleX=normalWidth-_singleW;}$fieldSingle[0].style.left=_singleX+"px";if(_fromX+_fromW<_toX){$fieldSingle[0].style.display="none";$fieldFrom[0].style.display="block";$fieldTo[0].style.display="block";}else{$fieldSingle[0].style.display="block";$fieldFrom[0].style.display="none";$fieldTo[0].style.display="none";}if(!settings.hideMinMax&&!settings.hideFromTo){if(_singleXnormalWidth-fieldMaxWidth||_toX+_toW>normalWidth-fieldMaxWidth){$fieldMax[0].style.display="none";}else{$fieldMax[0].style.display="block";}}}slider.attr("value",parseFloat(numbers.fromNumber)+";"+parseFloat(numbers.toNumber));}if(typeof settings.onFinish==="function"&&!sliderIsActive&&!firstStart){settings.onFinish.call(this,numbers);}if(typeof settings.onChange==="function"&&!firstStart){settings.onChange.call(this,numbers);}if(typeof settings.onLoad==="function"&&!sliderIsActive&&firstStart){settings.onLoad.call(this,numbers);firstStart=false;}};var setGrid=function(){$container.addClass("irs-with-grid");var i,text='',step=0,tStep=0,gridHTML='',smNum=20,bigNum=4;for(i=0;i<=smNum;i+=1){step=Math.floor(normalWidth/smNum*i);if(step>=normalWidth){step=normalWidth-1;}gridHTML+='';}for(i=0;i<=bigNum;i+=1){step=Math.floor(normalWidth/bigNum*i);if(step>=normalWidth){step=normalWidth-1;}gridHTML+='';if(stepFloat){text=(settings.min+((settings.max-settings.min)/bigNum*i));text=(text/settings.step)*settings.step;text=parseInt(text*stepFloat,10)/stepFloat;}else{text=Math.round(settings.min+((settings.max-settings.min)/bigNum*i));text=Math.round(text/settings.step)*settings.step;text=prettify(text);}if(allow_values){if(settings.hideMinMax){text=Math.round(settings.min+((settings.max-settings.min)/bigNum*i));text=Math.round(text/settings.step)*settings.step;if(i===0||i===bigNum){text=settings.values[text];}else{text="";}}else{text="";}}if(i===0){tStep=step;gridHTML+=''+text+'';}else if(i===bigNum){tStep=step-100;gridHTML+=''+text+'';}else{tStep=step-50;gridHTML+=''+text+'';}}$grid.html(gridHTML);};var setMask=function(){$container.addClass("irs-disabled");$container.append(disableHTML);};var removeMask=function(){$container.removeClass("irs-disabled");$container.find(".irs-disable-mask").remove();};placeHTML();});},update:function(options){return this.each(function(){this.updateData(options);});},remove:function(){return this.each(function(){this.removeSlider();});}};$.fn.ionRangeSlider=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist for jQuery.ionRangeSlider');}};}(jQuery,document,window,navigator));"use strict";(function(){var $,cardFromNumber,cardFromType,cards,defaultFormat,formatBackCardNumber,formatBackExpiry,formatCardNumber,formatExpiry,formatForwardExpiry,formatForwardSlash,hasTextSelected,luhnCheck,reFormatCardNumber,restrictCVC,restrictCardNumber,restrictExpiry,restrictNumeric,setCardType,__slice=[].slice,__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i9){digit-=9;}sum+=digit;}return sum%10===0;};hasTextSelected=function($target){var _ref;if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==$target.prop('selectionEnd')){return true;}if(typeof document!=="undefined"&&document!==null?(_ref=document.selection)!=null?typeof _ref.createRange==="function"?_ref.createRange().text:void 0:void 0:void 0){return true;}return false;};reFormatCardNumber=function(e){var _this=this;return setTimeout(function(){var $target,value;$target=$(e.currentTarget);value=$target.val();value=$.payment.formatCardNumber(value);return $target.val(value);});};formatCardNumber=function(e){var $target,card,digit,length,re,upperLength,value;digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;}$target=$(e.currentTarget);value=$target.val();card=cardFromNumber(value+digit);length=(value.replace(/\D/g,'')+digit).length;upperLength=16;if(card){upperLength=card.length[card.length.length-1];}if(length>=upperLength){return;}if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==value.length){return;}if(card&&card.type==='amex'){re=/^(\d{4}|\d{4}\s\d{6})$/;}else{re=/(?:^|\s)(\d{4})$/;}if(re.test(value)){e.preventDefault();return $target.val(value+' '+digit);}else if(re.test(value+digit)){e.preventDefault();return $target.val(value+digit+' ');}};formatBackCardNumber=function(e){var $target,value;$target=$(e.currentTarget);value=$target.val();if(e.meta){return;}if(e.which!==8){return;}if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==value.length){return;}if(/\d\s$/.test(value)){e.preventDefault();return $target.val(value.replace(/\d\s$/,''));}else if(/\s\d?$/.test(value)){e.preventDefault();return $target.val(value.replace(/\s\d?$/,''));}};formatExpiry=function(e){var $target,digit,val;digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;}$target=$(e.currentTarget);val=$target.val()+digit;if(/^\d$/.test(val)&&(val!=='0'&&val!=='1')){e.preventDefault();return $target.val("0"+val+" / ");}else if(/^\d\d$/.test(val)){e.preventDefault();return $target.val(""+val+" / ");}};formatForwardExpiry=function(e){var $target,digit,val;digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;}$target=$(e.currentTarget);val=$target.val();if(/^\d\d$/.test(val)){return $target.val(""+val+" / ");}};formatForwardSlash=function(e){var $target,slash,val;slash=String.fromCharCode(e.which);if(slash!=='/'){return;}$target=$(e.currentTarget);val=$target.val();if(/^\d$/.test(val)&&val!=='0'){return $target.val("0"+val+" / ");}};formatBackExpiry=function(e){var $target,value;if(e.meta){return;}$target=$(e.currentTarget);value=$target.val();if(e.which!==8){return;}if(($target.prop('selectionStart')!=null)&&$target.prop('selectionStart')!==value.length){return;}if(/\d(\s|\/)+$/.test(value)){e.preventDefault();return $target.val(value.replace(/\d(\s|\/)*$/,''));}else if(/\s\/\s?\d?$/.test(value)){e.preventDefault();return $target.val(value.replace(/\s\/\s?\d?$/,''));}};restrictNumeric=function(e){var input;if(e.metaKey||e.ctrlKey){return true;}if(e.which===32){return false;}if(e.which===0){return true;}if(e.which<33){return true;}input=String.fromCharCode(e.which);return!!/[\d\s]/.test(input);};restrictCardNumber=function(e){var $target,card,digit,value;$target=$(e.currentTarget);digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;}if(hasTextSelected($target)){return;}value=($target.val()+digit).replace(/\D/g,'');card=cardFromNumber(value);if(card){return value.length<=card.length[card.length.length-1];}else{return value.length<=16;}};restrictExpiry=function(e){var $target,digit,value;$target=$(e.currentTarget);digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;}if(hasTextSelected($target)){return;}value=$target.val()+digit;value=value.replace(/\D/g,'');if(value.length>6){return false;}};restrictCVC=function(e){var $target,digit,val;$target=$(e.currentTarget);digit=String.fromCharCode(e.which);if(!/^\d+$/.test(digit)){return;}val=$target.val()+digit;return val.length<=4;};setCardType=function(e){var $target,allTypes,card,cardType,val;$target=$(e.currentTarget);val=$target.val();cardType=$.payment.cardType(val)||'unknown';if(!$target.hasClass(cardType)){allTypes=(function(){var _i,_len,_results;_results=[];for(_i=0,_len=cards.length;_i<_len;_i++){card=cards[_i];_results.push(card.type);}return _results;})();$target.removeClass('unknown');$target.removeClass(allTypes.join(' '));$target.addClass(cardType);$target.toggleClass('identified',cardType!=='unknown');return $target.trigger('payment.cardType',cardType);}};$.payment.fn.formatCardCVC=function(){this.payment('restrictNumeric');this.on('keypress',restrictCVC);return this;};$.payment.fn.formatCardExpiry=function(){this.payment('restrictNumeric');this.on('keypress',restrictExpiry);this.on('keypress',formatExpiry);this.on('keypress',formatForwardSlash);this.on('keypress',formatForwardExpiry);this.on('keydown',formatBackExpiry);return this;};$.payment.fn.formatCardNumber=function(){this.payment('restrictNumeric');this.on('keypress',restrictCardNumber);this.on('keypress',formatCardNumber);this.on('keydown',formatBackCardNumber);this.on('keyup',setCardType);this.on('paste',reFormatCardNumber);return this;};$.payment.fn.restrictNumeric=function(){this.on('keypress',restrictNumeric);return this;};$.payment.fn.cardExpiryVal=function(){return $.payment.cardExpiryVal($(this).val());};$.payment.cardExpiryVal=function(value){var month,prefix,year,_ref;value=value.replace(/\s/g,'');_ref=value.split('/',2),month=_ref[0],year=_ref[1];if((year!=null?year.length:void 0)===2&&/^\d+$/.test(year)){prefix=(new Date).getFullYear();prefix=prefix.toString().slice(0,2);year=prefix+year;}month=parseInt(month,10);year=parseInt(year,10);return{month:month,year:year};};$.payment.validateCardNumber=function(num){var card,_ref;num=(num+'').replace(/\s+|-/g,'');if(!/^\d+$/.test(num)){return false;}card=cardFromNumber(num);if(!card){return false;}return(_ref=num.length,__indexOf.call(card.length,_ref)>=0)&&(card.luhn===false||luhnCheck(num));};$.payment.validateCardExpiry=function(month,year){var currentTime,expiry,prefix,_ref;if(typeof month==='object'&&'month'in month){_ref=month,month=_ref.month,year=_ref.year;}if(!(month&&year)){return false;}month=$.trim(month);year=$.trim(year);if(!/^\d+$/.test(month)){return false;}if(!/^\d+$/.test(year)){return false;}if(!(parseInt(month,10)<=12)){return false;}if(year.length===2){prefix=(new Date).getFullYear();prefix=prefix.toString().slice(0,2);year=prefix+year;}expiry=new Date(year,month);currentTime=new Date;expiry.setMonth(expiry.getMonth()-1);expiry.setMonth(expiry.getMonth()+1,1);return expiry>currentTime;};$.payment.validateCardCVC=function(cvc,type){var _ref,_ref1;cvc=$.trim(cvc);if(!/^\d+$/.test(cvc)){return false;}if(type){return _ref=cvc.length,__indexOf.call((_ref1=cardFromType(type))!=null?_ref1.cvcLength:void 0,_ref)>=0;}else{return cvc.length>=3&&cvc.length<=4;}};$.payment.cardType=function(num){var _ref;if(!num){return null;}return((_ref=cardFromNumber(num))!=null?_ref.type:void 0)||null;};$.payment.formatCardNumber=function(num){var card,groups,upperLength,_ref;card=cardFromNumber(num);if(!card){return num;}upperLength=card.length[card.length.length-1];num=num.replace(/\D/g,'');num=num.slice(0,+upperLength+1||9e9);if(card.format.global){return(_ref=num.match(card.format))!=null?_ref.join(' '):void 0;}else{groups=card.format.exec(num);if(groups!=null){groups.shift();}return groups!=null?groups.join(' '):void 0;}};}).call(this);/*************************************************************************************************** LoadingOverlay - A flexible loading overlay jQuery plugin Author : Gaspare Sganga Version : 1.4.1 License : MIT Documentation : http://gasparesganga.com/labs/jquery-loading-overlay/ ****************************************************************************************************/ !function(a,b){function d(c,d){c=a(c);var e=c.is("body"),g=c.data("LoadingOverlayCount");if(g===b&&(g=0),0==g){var h=a("
",{"class":"loadingoverlay",css:{"background-color":d.color,display:"flex","flex-direction":"column","align-items":"center","justify-content":"center"}});if(d.zIndex!==b&&h.css("z-index",d.zIndex),d.image&&h.css({"background-image":"url("+d.image+")","background-position":d.imagePosition,"background-repeat":"no-repeat"}),d.fontawesome&&a("
",{"class":"loadingoverlay_fontawesome "+d.fontawesome}).appendTo(h),d.custom&&a(d.custom).appendTo(h),e?h.css({position:"fixed",top:0,left:0,width:"100%",height:"100%"}):h.css("position","fixed"==c.css("position")?"fixed":"absolute"),f(c,h,d,e),d.resizeInterval>0){var i=setInterval(function(){f(c,h,d,e)},d.resizeInterval);c.data("LoadingOverlayResizeIntervalId",i)}d.fade?d.fade===!0?d.fade=[400,200]:("string"==typeof d.fade||"number"==typeof d.fade)&&(d.fade=[d.fade,d.fade]):d.fade=[0,0],c.data({LoadingOverlay:h,LoadingOverlayFadeOutDuration:d.fade[1]}),h.hide().appendTo("body").fadeIn(d.fade[0])}g++,c.data("LoadingOverlayCount",g)}function e(c,d){c=a(c);var e=c.data("LoadingOverlayCount");if(e!==b)if(e--,d||0>=e){var f=c.data("LoadingOverlayResizeIntervalId");f&&clearInterval(f),c.data("LoadingOverlay").fadeOut(c.data("LoadingOverlayFadeOutDuration"),function(){a(this).remove()}),c.removeData(["LoadingOverlay","LoadingOverlayCount","LoadingOverlayFadeOutDuration","LoadingOverlayResizeIntervalId"])}else c.data("LoadingOverlayCount",e)}function f(b,c,d,e){if(!e){var f="fixed"==b.css("position")?b.position():b.offset();c.css({top:f.top+parseInt(b.css("border-top-width"),10),left:f.left+parseInt(b.css("border-left-width"),10),width:b.innerWidth(),height:b.innerHeight()})}var g=e?a(window):b,h="auto";d.size&&"auto"!=d.size&&(h=Math.min(g.innerWidth(),g.innerHeight())*parseFloat(d.size)/100,d.maxSize&&h>parseInt(d.maxSize,10)&&(h=parseInt(d.maxSize,10)+"px"),d.minSize&&h 0)) { this.$stage.children('.cloned').remove(); this._clones = []; } } }, { filter: ['items', 'settings'], run: function() { var i, n, clones = this._clones, items = this._items, delta = this.settings.loop ? clones.length - Math.max(this.settings.items * 2, 4) : 0; for (i = 0, n = Math.abs(delta / 2); i < n; i++) { if (delta > 0) { this.$stage.children().eq(items.length + clones.length - 1).remove(); clones.pop(); this.$stage.children().eq(0).remove(); clones.pop(); } else { clones.push(clones.length / 2); this.$stage.append(items[clones[clones.length - 1]].clone().addClass('cloned')); clones.push(items.length - 1 - (clones.length - 1) / 2); this.$stage.prepend(items[clones[clones.length - 1]].clone().addClass('cloned')); } } } }, { filter: ['width', 'items', 'settings'], run: function() { var rtl = (this.settings.rtl ? 1 : -1), width = (this.width() / this.settings.items).toFixed(3), coordinate = 0, merge, i, n; this._coordinates = []; for (i = 0, n = this._clones.length + this._items.length; i < n; i++) { merge = this._mergers[this.relative(i)]; merge = (this.settings.mergeFit && Math.min(merge, this.settings.items)) || merge; coordinate += (this.settings.autoWidth ? this._items[this.relative(i)].width() + this.settings.margin : width * merge) * rtl; this._coordinates.push(coordinate); } } }, { filter: ['width', 'items', 'settings'], run: function() { var i, n, width = (this.width() / this.settings.items).toFixed(3), css = { 'width': Math.abs(this._coordinates[this._coordinates.length - 1]) + this.settings.stagePadding * 2, 'padding-left': this.settings.stagePadding || '', 'padding-right': this.settings.stagePadding || '' }; this.$stage.css(css); css = { 'width': this.settings.autoWidth ? 'auto' : width - this.settings.margin // tuk go smqta }; css[this.settings.rtl ? 'margin-left' : 'margin-right'] = this.settings.margin; if (!this.settings.autoWidth && $.grep(this._mergers, function(v) { return v > 1 }).length > 0) { for (i = 0, n = this._coordinates.length; i < n; i++) { css.width = Math.abs(this._coordinates[i]) - Math.abs(this._coordinates[i - 1] || 0) - this.settings.margin; this.$stage.children().eq(i).css(css); } } else { this.$stage.children().css(css); this.$stage.children().children().css(css); } }, }, { filter: ['width', 'items', 'settings'], run: function(cache) { cache.current && this.reset(this.$stage.children().index(cache.current)); } }, { filter: ['position'], run: function() { this.animate(this.coordinates(this._current)); } }, { filter: ['width', 'position', 'items', 'settings'], run: function() { var rtl = this.settings.rtl ? 1 : -1, padding = this.settings.stagePadding * 2, begin = this.coordinates(this.current()) + padding, end = begin + this.width() * rtl, inner, outer, matches = [], i, n; for (i = 0, n = this._coordinates.length; i < n; i++) { inner = this._coordinates[i - 1] || 0; outer = Math.abs(this._coordinates[i]) + padding * rtl; if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end))) || (this.op(outer, '<', begin) && this.op(outer, '>', end))) { matches.push(i); } } this.$stage.children('.' + this.settings.activeClass).removeClass(this.settings.activeClass); this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass(this.settings.activeClass); if (this.settings.center) { this.$stage.children('.' + this.settings.centerClass).removeClass(this.settings.centerClass); this.$stage.children().eq(this.current()).addClass(this.settings.centerClass); } } }]; Owl.prototype.initialize = function() { this.trigger('initialize'); this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass('owl-rtl', this.settings.rtl); this.browserSupport(); if (this.settings.autoWidth && this.state.imagesLoaded !== true) { var imgs, nestedSelector, width; imgs = this.$element.find('img'); nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined; width = this.$element.children(nestedSelector).width(); if (imgs.length && width <= 0) { this.preloadAutoWidthImages(imgs); return false; } } this.$element.addClass('owl-loading'); this.$stage = $('<' + this.settings.stageElement + ' class="owl-stage"/>').wrap('
'); this.$element.append(this.$stage.parent()); this.replace(this.$element.children().not(this.$stage.parent())); this._width = this.$element.width(); // * 2 / 10 this.refresh(); this.$element.removeClass('owl-loading').addClass('owl-loaded'); this.$element.removeClass('owl-load-before').addClass('owl-loaded'); this.eventsCall(); this.internalEvents(); this.addTriggerableEvents(); this.trigger('initialized'); }; Owl.prototype.setup = function() { var viewport = this.viewport(), overwrites = this.options.responsive, match = -1, settings = null; if (!overwrites) { settings = $.extend({}, this.options); } else { $.each(overwrites, function(breakpoint) { if (breakpoint <= viewport && breakpoint > match) { match = Number(breakpoint); } }); settings = $.extend({}, this.options, overwrites[match]); delete settings.responsive; if (settings.responsiveClass) { this.$element.attr('class', function(i, c) { return c.replace(/\b owl-responsive-\S+/g, ''); }).addClass('owl-responsive-' + match); } } if (this.settings === null || this._breakpoint !== match) { this.trigger('change', { property: { name: 'settings', value: settings } }); this._breakpoint = match; this.settings = settings; this.invalidate('settings'); this.trigger('changed', { property: { name: 'settings', value: this.settings } }); } }; Owl.prototype.optionsLogic = function() { this.$element.toggleClass('owl-center', this.settings.center); if (this.settings.loop && this._items.length < this.settings.items) { this.settings.loop = false; } if (this.settings.autoWidth) { this.settings.stagePadding = false; this.settings.merge = false; } }; Owl.prototype.prepare = function(item) { var event = this.trigger('prepare', { content: item }); if (!event.data) { event.data = $('<' + this.settings.itemElement + '/>').addClass(this.settings.itemClass).append(item) } this.trigger('prepared', { content: event.data }); return event.data; }; Owl.prototype.update = function() { var i = 0, n = this._pipe.length, filter = $.proxy(function(p) { return this[p] }, this._invalidated), cache = {}; while (i < n) { if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) { this._pipe[i].run(cache); } i++; } this._invalidated = {}; }; Owl.prototype.width = function(dimension) { dimension = dimension || Owl.Width.Default; switch (dimension) { case Owl.Width.Inner: case Owl.Width.Outer: return this._width; default: return this._width - this.settings.stagePadding * 2 + this.settings.margin; } }; Owl.prototype.refresh = function() { if (this._items.length === 0) { return false; } var start = new Date().getTime(); this.trigger('refresh'); this.setup(); this.optionsLogic(); this.$stage.addClass('owl-refresh'); this.update(); this.$stage.removeClass('owl-refresh'); this.state.orientation = window.orientation; this.watchVisibility(); this.trigger('refreshed'); }; Owl.prototype.eventsCall = function() { this.e._onDragStart = $.proxy(function(e) { this.onDragStart(e); }, this); this.e._onDragMove = $.proxy(function(e) { this.onDragMove(e); }, this); this.e._onDragEnd = $.proxy(function(e) { this.onDragEnd(e); }, this); this.e._onResize = $.proxy(function(e) { this.onResize(e); }, this); this.e._transitionEnd = $.proxy(function(e) { this.transitionEnd(e); }, this); this.e._preventClick = $.proxy(function(e) { this.preventClick(e); }, this); }; Owl.prototype.onThrottledResize = function() { window.clearTimeout(this.resizeTimer); this.resizeTimer = window.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate); }; Owl.prototype.onResize = function() { if (!this._items.length) { return false; } if (this._width === this.$element.width()) { return false; } if (this.trigger('resize').isDefaultPrevented()) { return false; } this._width = this.$element.width(); this.invalidate('width'); this.refresh(); this.trigger('resized'); }; Owl.prototype.eventsRouter = function(event) { var type = event.type; if (type === "mousedown" || type === "touchstart") { this.onDragStart(event); } else if (type === "mousemove" || type === "touchmove") { this.onDragMove(event); } else if (type === "mouseup" || type === "touchend") { this.onDragEnd(event); } else if (type === "touchcancel") { this.onDragEnd(event); } }; Owl.prototype.internalEvents = function() { var isTouch = isTouchSupport(), isTouchIE = isTouchSupportIE(); if (this.settings.mouseDrag) { this.$stage.on('mousedown', $.proxy(function(event) { this.eventsRouter(event) }, this)); this.$stage.on('dragstart', function() { return false }); this.$stage.get(0).onselectstart = function() { return false }; } else { this.$element.addClass('owl-text-select-on'); } if (this.settings.touchDrag && !isTouchIE) { this.$stage.on('touchstart touchcancel', $.proxy(function(event) { this.eventsRouter(event) }, this)); } if (this.transitionEndVendor) { this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, false); } if (this.settings.responsive !== false) { this.on(window, 'resize', $.proxy(this.onThrottledResize, this)); } }; Owl.prototype.onDragStart = function(event) { var ev, isTouchEvent, pageX, pageY, animatedPos; ev = event.originalEvent || event || window.event; if (ev.which === 3 || this.state.isTouch) { return false; } if (ev.type === 'mousedown') { this.$stage.addClass('owl-grab'); } this.trigger('drag'); this.drag.startTime = new Date().getTime(); this.speed(0); this.state.isTouch = true; this.state.isScrolling = false; this.state.isSwiping = false; this.drag.distance = 0; pageX = getTouches(ev).x; pageY = getTouches(ev).y; this.drag.offsetX = this.$stage.position().left; this.drag.offsetY = this.$stage.position().top; if (this.settings.rtl) { this.drag.offsetX = this.$stage.position().left + this.$stage.width() - this.width() + this.settings.margin; } if (this.state.inMotion && this.support3d) { animatedPos = this.getTransformProperty(); this.drag.offsetX = animatedPos; this.animate(animatedPos); this.state.inMotion = true; } else if (this.state.inMotion && !this.support3d) { this.state.inMotion = false; return false; } this.drag.startX = pageX - this.drag.offsetX; this.drag.startY = pageY - this.drag.offsetY; this.drag.start = pageX - this.drag.startX; this.drag.targetEl = ev.target || ev.srcElement; this.drag.updatedX = this.drag.start; if (this.drag.targetEl.tagName === "IMG" || this.drag.targetEl.tagName === "A") { this.drag.targetEl.draggable = false; } $(document).on('mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents', $.proxy(function(event) { this.eventsRouter(event) }, this)); }; Owl.prototype.onDragMove = function(event) { var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull; if (!this.state.isTouch) { return; } if (this.state.isScrolling) { return; } ev = event.originalEvent || event || window.event; pageX = getTouches(ev).x; pageY = getTouches(ev).y; this.drag.currentX = pageX - this.drag.startX; this.drag.currentY = pageY - this.drag.startY; this.drag.distance = this.drag.currentX - this.drag.offsetX; if (this.drag.distance < 0) { this.state.direction = this.settings.rtl ? 'right' : 'left'; } else if (this.drag.distance > 0) { this.state.direction = this.settings.rtl ? 'left' : 'right'; } if (this.settings.loop) { if (this.op(this.drag.currentX, '>', this.coordinates(this.minimum())) && this.state.direction === 'right') { this.drag.currentX -= (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length); } else if (this.op(this.drag.currentX, '<', this.coordinates(this.maximum())) && this.state.direction === 'left') { this.drag.currentX += (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length); } } else { minValue = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()); maxValue = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()); pull = this.settings.pullDrag ? this.drag.distance / 5 : 0; this.drag.currentX = Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull); } if ((this.drag.distance > 8 || this.drag.distance < -8)) { if (ev.preventDefault !== undefined) { ev.preventDefault(); } else { ev.returnValue = false; } this.state.isSwiping = true; } this.drag.updatedX = this.drag.currentX; if ((this.drag.currentY > 16 || this.drag.currentY < -16) && this.state.isSwiping === false) { this.state.isScrolling = true; this.drag.updatedX = this.drag.start; } this.animate(this.drag.updatedX); }; Owl.prototype.onDragEnd = function(event) { var compareTimes, distanceAbs, closest; if (!this.state.isTouch) { return; } if (event.type === 'mouseup') { this.$stage.removeClass('owl-grab'); } this.trigger('dragged'); this.drag.targetEl.removeAttribute("draggable"); this.state.isTouch = false; this.state.isScrolling = false; this.state.isSwiping = false; if (this.drag.distance === 0 && this.state.inMotion !== true) { this.state.inMotion = false; return false; } this.drag.endTime = new Date().getTime(); compareTimes = this.drag.endTime - this.drag.startTime; distanceAbs = Math.abs(this.drag.distance); if (distanceAbs > 3 || compareTimes > 300) { this.removeClick(this.drag.targetEl); } closest = this.closest(this.drag.updatedX); this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed); this.current(closest); this.invalidate('position'); this.update(); if (!this.settings.pullDrag && this.drag.updatedX === this.coordinates(closest)) { this.transitionEnd(); } this.drag.distance = 0; $(document).off('.owl.dragEvents'); }; Owl.prototype.removeClick = function(target) { this.drag.targetEl = target; $(target).on('click.preventClick', this.e._preventClick); window.setTimeout(function() { $(target).off('click.preventClick'); }, 300); }; Owl.prototype.preventClick = function(ev) { if (ev.preventDefault) { ev.preventDefault(); } else { ev.returnValue = false; } if (ev.stopPropagation) { ev.stopPropagation(); } $(ev.target).off('click.preventClick'); }; Owl.prototype.getTransformProperty = function() { var transform, matrix3d; transform = window.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + 'transform'); transform = transform.replace(/matrix(3d)?\(|\)/g, '').split(','); matrix3d = transform.length === 16; return matrix3d !== true ? transform[4] : transform[12]; }; Owl.prototype.closest = function(coordinate) { var position = -1, pull = 30, width = this.width(), coordinates = this.coordinates(); if (!this.settings.freeDrag) { $.each(coordinates, $.proxy(function(index, value) { if (coordinate > value - pull && coordinate < value + pull) { position = index; } else if (this.op(coordinate, '<', value) && this.op(coordinate, '>', coordinates[index + 1] || value - width)) { position = this.state.direction === 'left' ? index + 1 : index; } return position === -1; }, this)); } if (!this.settings.loop) { if (this.op(coordinate, '>', coordinates[this.minimum()])) { position = coordinate = this.minimum(); } else if (this.op(coordinate, '<', coordinates[this.maximum()])) { position = coordinate = this.maximum(); } } return position; }; Owl.prototype.animate = function(coordinate) { this.trigger('translate'); this.state.inMotion = this.speed() > 0; if (this.support3d) { this.$stage.css({ transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)', transition: (this.speed() / 1000) + 's' }); } else if (this.state.isTouch) { this.$stage.css({ left: coordinate + 'px' }); } else { this.$stage.animate({ left: coordinate }, this.speed() / 1000, this.settings.fallbackEasing, $.proxy(function() { if (this.state.inMotion) { this.transitionEnd(); } }, this)); } }; Owl.prototype.current = function(position) { if (position === undefined) { return this._current; } if (this._items.length === 0) { return undefined; } position = this.normalize(position); if (this._current !== position) { var event = this.trigger('change', { property: { name: 'position', value: position } }); if (event.data !== undefined) { position = this.normalize(event.data); } this._current = position; this.invalidate('position'); this.trigger('changed', { property: { name: 'position', value: this._current } }); } return this._current; }; Owl.prototype.invalidate = function(part) { this._invalidated[part] = true; } Owl.prototype.reset = function(position) { position = this.normalize(position); if (position === undefined) { return; } this._speed = 0; this._current = position; this.suppress(['translate', 'translated']); this.animate(this.coordinates(position)); this.release(['translate', 'translated']); }; Owl.prototype.normalize = function(position, relative) { var n = (relative ? this._items.length : this._items.length + this._clones.length); if (!$.isNumeric(position) || n < 1) { return undefined; } if (this._clones.length) { position = ((position % n) + n) % n; } else { position = Math.max(this.minimum(relative), Math.min(this.maximum(relative), position)); } return position; }; Owl.prototype.relative = function(position) { position = this.normalize(position); position = position - this._clones.length / 2; return this.normalize(position, true); }; Owl.prototype.maximum = function(relative) { var maximum, width, i = 0, coordinate, settings = this.settings; if (relative) { return this._items.length - 1; } if (!settings.loop && settings.center) { maximum = this._items.length - 1; } else if (!settings.loop && !settings.center) { maximum = this._items.length - settings.items; } else if (settings.loop || settings.center) { maximum = this._items.length + settings.items; } else if (settings.autoWidth || settings.merge) { revert = settings.rtl ? 1 : -1; width = this.$stage.width() - this.$element.width(); while (coordinate = this.coordinates(i)) { if (coordinate * revert >= width) { break; } maximum = ++i; } } else { throw 'Can not detect maximum absolute position.' } return maximum; }; Owl.prototype.minimum = function(relative) { if (relative) { return 0; } return this._clones.length / 2; }; Owl.prototype.items = function(position) { if (position === undefined) { return this._items.slice(); } position = this.normalize(position, true); return this._items[position]; }; Owl.prototype.mergers = function(position) { if (position === undefined) { return this._mergers.slice(); } position = this.normalize(position, true); return this._mergers[position]; }; Owl.prototype.clones = function(position) { var odd = this._clones.length / 2, even = odd + this._items.length, map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 }; if (position === undefined) { return $.map(this._clones, function(v, i) { return map(i) }); } return $.map(this._clones, function(v, i) { return v === position ? map(i) : null }); }; Owl.prototype.speed = function(speed) { if (speed !== undefined) { this._speed = speed; } return this._speed; }; Owl.prototype.coordinates = function(position) { var coordinate = null; if (position === undefined) { return $.map(this._coordinates, $.proxy(function(coordinate, index) { return this.coordinates(index); }, this)); } if (this.settings.center) { coordinate = this._coordinates[position]; coordinate += (this.width() - coordinate + (this._coordinates[position - 1] || 0)) / 2 * (this.settings.rtl ? -1 : 1); } else { coordinate = this._coordinates[position - 1] || 0; } return coordinate; }; Owl.prototype.duration = function(from, to, factor) { return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed)); }; Owl.prototype.to = function(position, speed) { if (this.settings.loop) { var distance = position - this.relative(this.current()), revert = this.current(), before = this.current(), after = this.current() + distance, direction = before - after < 0 ? true : false, items = this._clones.length + this._items.length; if (after < this.settings.items && direction === false) { revert = before + this._items.length; this.reset(revert); } else if (after >= items - this.settings.items && direction === true) { revert = before - this._items.length; this.reset(revert); } window.clearTimeout(this.e._goToLoop); this.e._goToLoop = window.setTimeout($.proxy(function() { this.speed(this.duration(this.current(), revert + distance, speed)); this.current(revert + distance); this.update(); }, this), 30); } else { this.speed(this.duration(this.current(), position, speed)); this.current(position); this.update(); } }; Owl.prototype.next = function(speed) { speed = speed || false; this.to(this.relative(this.current()) + 1, speed); }; Owl.prototype.prev = function(speed) { speed = speed || false; this.to(this.relative(this.current()) - 1, speed); }; Owl.prototype.transitionEnd = function(event) { if (event !== undefined) { event.stopPropagation(); if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) { return false; } } this.state.inMotion = false; this.trigger('translated'); }; Owl.prototype.viewport = function() { var width; if (this.options.responsiveBaseElement !== window) { width = $(this.options.responsiveBaseElement).width(); } else if (window.innerWidth) { width = window.innerWidth; } else if (document.documentElement && document.documentElement.clientWidth) { width = document.documentElement.clientWidth; } else { throw 'Can not detect viewport width.'; } return width; }; Owl.prototype.replace = function(content) { this.$stage.empty(); this._items = []; if (content) { content = (content instanceof jQuery) ? content : $(content); } if (this.settings.nestedItemSelector) { content = content.find('.' + this.settings.nestedItemSelector); } content.filter(function() { return this.nodeType === 1; }).each($.proxy(function(index, item) { item = this.prepare(item); this.$stage.append(item); this._items.push(item); this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1); }, this)); this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0); this.invalidate('items'); }; Owl.prototype.add = function(content, position) { position = position === undefined ? this._items.length : this.normalize(position, true); this.trigger('add', { content: content, position: position }); if (this._items.length === 0 || position === this._items.length) { this.$stage.append(content); this._items.push(content); this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1); } else { this._items[position].before(content); this._items.splice(position, 0, content); this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1); } this.invalidate('items'); this.trigger('added', { content: content, position: position }); }; Owl.prototype.remove = function(position) { position = this.normalize(position, true); if (position === undefined) { return; } this.trigger('remove', { content: this._items[position], position: position }); this._items[position].remove(); this._items.splice(position, 1); this._mergers.splice(position, 1); this.invalidate('items'); this.trigger('removed', { content: null, position: position }); }; Owl.prototype.addTriggerableEvents = function() { var handler = $.proxy(function(callback, event) { return $.proxy(function(e) { if (e.relatedTarget !== this) { this.suppress([event]); callback.apply(this, [].slice.call(arguments, 1)); this.release([event]); } }, this); }, this); $.each({ 'next': this.next, 'prev': this.prev, 'to': this.to, 'destroy': this.destroy, 'refresh': this.refresh, 'replace': this.replace, 'add': this.add, 'remove': this.remove }, $.proxy(function(event, callback) { this.$element.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel')); }, this)); }; Owl.prototype.watchVisibility = function() { if (!isElVisible(this.$element.get(0))) { this.$element.addClass('owl-hidden'); window.clearInterval(this.e._checkVisibile); this.e._checkVisibile = window.setInterval($.proxy(checkVisible, this), 500); } function isElVisible(el) { return el.offsetWidth > 0 && el.offsetHeight > 0; } function checkVisible() { if (isElVisible(this.$element.get(0))) { this.$element.removeClass('owl-hidden'); this.refresh(); window.clearInterval(this.e._checkVisibile); } } }; Owl.prototype.preloadAutoWidthImages = function(imgs) { var loaded, that, $el, img; loaded = 0; that = this; imgs.each(function(i, el) { $el = $(el); img = new Image(); img.onload = function() { loaded++; $el.attr('src', img.src); $el.css('opacity', 1); if (loaded >= imgs.length) { that.state.imagesLoaded = true; that.initialize(); } }; img.src = $el.attr('src') || $el.attr('data-src') || $el.attr('data-src-retina'); }); }; Owl.prototype.destroy = function() { if (this.$element.hasClass(this.settings.themeClass)) { this.$element.removeClass(this.settings.themeClass); } if (this.settings.responsive !== false) { $(window).off('resize.owl.carousel'); } if (this.transitionEndVendor) { this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd); } for (var i in this._plugins) { this._plugins[i].destroy(); } if (this.settings.mouseDrag || this.settings.touchDrag) { this.$stage.off('mousedown touchstart touchcancel'); $(document).off('.owl.dragEvents'); this.$stage.get(0).onselectstart = function() {}; this.$stage.off('dragstart', function() { return false }); } this.$element.off('.owl'); this.$stage.children('.cloned').remove(); this.e = null; this.$element.removeData('owlCarousel'); this.$stage.children().contents().unwrap(); this.$stage.children().unwrap(); this.$stage.unwrap(); }; Owl.prototype.op = function(a, o, b) { var rtl = this.settings.rtl; switch (o) { case '<': return rtl ? a > b : a < b; case '>': return rtl ? a < b : a > b; case '>=': return rtl ? a <= b : a >= b; case '<=': return rtl ? a >= b : a <= b; default: break; } }; Owl.prototype.on = function(element, event, listener, capture) { if (element.addEventListener) { element.addEventListener(event, listener, capture); } else if (element.attachEvent) { element.attachEvent('on' + event, listener); } }; Owl.prototype.off = function(element, event, listener, capture) { if (element.removeEventListener) { element.removeEventListener(event, listener, capture); } else if (element.detachEvent) { element.detachEvent('on' + event, listener); } }; Owl.prototype.trigger = function(name, data, namespace) { var status = { item: { count: this._items.length, index: this.current() } }, handler = $.camelCase($.grep(['on', name, namespace], function(v) { return v }).join('-').toLowerCase()), event = $.Event([name, 'owl', namespace || 'carousel'].join('.').toLowerCase(), $.extend({ relatedTarget: this }, status, data)); if (!this._supress[name]) { $.each(this._plugins, function(name, plugin) { if (plugin.onTrigger) { plugin.onTrigger(event); } }); this.$element.trigger(event); if (this.settings && typeof this.settings[handler] === 'function') { this.settings[handler].apply(this, event); } } return event; }; Owl.prototype.suppress = function(events) { $.each(events, $.proxy(function(index, event) { this._supress[event] = true; }, this)); } Owl.prototype.release = function(events) { $.each(events, $.proxy(function(index, event) { delete this._supress[event]; }, this)); } Owl.prototype.browserSupport = function() { this.support3d = isPerspective(); if (this.support3d) { this.transformVendor = isTransform(); var endVendors = ['transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd']; this.transitionEndVendor = endVendors[isTransition()]; this.vendorName = this.transformVendor.replace(/Transform/i, ''); this.vendorName = this.vendorName !== '' ? '-' + this.vendorName.toLowerCase() + '-' : ''; } this.state.orientation = window.orientation; }; function getTouches(event) { if (event.touches !== undefined) { return { x: event.touches[0].pageX, y: event.touches[0].pageY }; } if (event.touches === undefined) { if (event.pageX !== undefined) { return { x: event.pageX, y: event.pageY }; } if (event.pageX === undefined) { return { x: event.clientX, y: event.clientY }; } } } function isStyleSupported(array) { var p, s, fake = document.createElement('div'), list = array; for (p in list) { s = list[p]; if (typeof fake.style[s] !== 'undefined') { fake = null; return [s, p]; } } return [false]; } function isTransition() { return isStyleSupported(['transition', 'WebkitTransition', 'MozTransition', 'OTransition'])[1]; } function isTransform() { return isStyleSupported(['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'])[0]; } function isPerspective() { return isStyleSupported(['perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective'])[0]; } function isTouchSupport() { return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints); } function isTouchSupportIE() { return window.navigator.msPointerEnabled; } $.fn.owlCarousel = function(options) { options = $.extend(true, {}, options, this.data('options')); return this.each(function() { if (!$(this).data('owlCarousel')) { $(this).data('owlCarousel', new Owl(this, options)); } }); }; $.fn.owlCarousel.Constructor = Owl; })(window.Zepto || window.jQuery, window, document);; (function($, window, document, undefined) { var Lazy = function(carousel) { this._core = carousel; this._loaded = []; this._handlers = { 'initialized.owl.carousel change.owl.carousel': $.proxy(function(e) { if (!e.namespace) { return; } if (!this._core.settings || !this._core.settings.lazyLoad) { return; } if ((e.property && e.property.name == 'position') || e.type == 'initialized') { var settings = this._core.settings, n = (settings.center && Math.ceil(settings.items / 2) || settings.items), i = ((settings.center && n * -1) || 0), position = ((e.property && e.property.value) || this._core.current()) + i, clones = this._core.clones().length, load = $.proxy(function(i, v) { this.load(v) }, this); while (i++ < n) { this.load(clones / 2 + this._core.relative(position)); clones && $.each(this._core.clones(this._core.relative(position++)), load); } } }, this) }; this._core.options = $.extend({}, Lazy.Defaults, this._core.options); this._core.$element.on(this._handlers); } Lazy.Defaults = { lazyLoad: false } Lazy.prototype.load = function(position) { var $item = this._core.$stage.children().eq(position), $elements = $item && $item.find('.owl-lazy'); if (!$elements || $.inArray($item.get(0), this._loaded) > -1) { return; } $elements.each($.proxy(function(index, element) { var $element = $(element), image, url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src'); this._core.trigger('load', { element: $element, url: url }, 'lazy'); if ($element.is('img')) { $element.one('load.owl.lazy', $.proxy(function() { $element.css('opacity', 1); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this)).attr('src', url); } else { image = new Image(); image.onload = $.proxy(function() { $element.css({ 'background-image': 'url(' + url + ')', 'opacity': '1' }); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this); image.src = url; } }, this)); this._loaded.push($item.get(0)); } Lazy.prototype.destroy = function() { var handler, property; for (handler in this.handlers) { this._core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } } $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy; })(window.Zepto || window.jQuery, window, document);; (function($, window, document, undefined) { var AutoHeight = function(carousel) { this._core = carousel; this._handlers = { 'initialized.owl.carousel': $.proxy(function() { if (this._core.settings.autoHeight) { this.update(); } }, this), 'changed.owl.carousel': $.proxy(function(e) { if (this._core.settings.autoHeight && e.property.name == 'position') { this.update(); } }, this), 'loaded.owl.lazy': $.proxy(function(e) { if (this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass) === this._core.$stage.children().eq(this._core.current())) { this.update(); } }, this) }; this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options); this._core.$element.on(this._handlers); }; AutoHeight.Defaults = { autoHeight: false, autoHeightClass: 'owl-height' }; AutoHeight.prototype.update = function() { this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass); }; AutoHeight.prototype.destroy = function() { var handler, property; for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight; })(window.Zepto || window.jQuery, window, document);; (function($, window, document, undefined) { var Video = function(carousel) { this._core = carousel; this._videos = {}; this._playing = null; this._fullscreen = false; this._handlers = { 'resize.owl.carousel': $.proxy(function(e) { if (this._core.settings.video && !this.isInFullScreen()) { e.preventDefault(); } }, this), 'refresh.owl.carousel changed.owl.carousel': $.proxy(function(e) { if (this._playing) { this.stop(); } }, this), 'prepared.owl.carousel': $.proxy(function(e) { var $element = $(e.content).find('.owl-video'); if ($element.length) { $element.css('display', 'none'); this.fetch($element, $(e.content)); } }, this) }; this._core.options = $.extend({}, Video.Defaults, this._core.options); this._core.$element.on(this._handlers); this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) { this.play(e); }, this)); }; Video.Defaults = { video: false, videoHeight: false, videoWidth: false }; Video.prototype.fetch = function(target, item) { var type = target.attr('data-vimeo-id') ? 'vimeo' : 'youtube', id = target.attr('data-vimeo-id') || target.attr('data-youtube-id'), width = target.attr('data-width') || this._core.settings.videoWidth, height = target.attr('data-height') || this._core.settings.videoHeight, url = target.attr('href'); if (url) { id = url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); if (id[3].indexOf('youtu') > -1) { type = 'youtube'; } else if (id[3].indexOf('vimeo') > -1) { type = 'vimeo'; } else { throw new Error('Video URL not supported.'); } id = id[6]; } else { throw new Error('Missing video URL.'); } this._videos[url] = { type: type, id: id, width: width, height: height }; item.attr('data-video', url); this.thumbnail(target, this._videos[url]); }; Video.prototype.thumbnail = function(target, video) { var tnLink, icon, path, dimensions = video.width && video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"' : '', customTn = target.find('img'), srcType = 'src', lazyClass = '', settings = this._core.settings, create = function(path) { icon = '
'; if (settings.lazyLoad) { tnLink = '
'; } else { tnLink = '
'; } target.after(tnLink); target.after(icon); }; target.wrap('
'); if (this._core.settings.lazyLoad) { srcType = 'data-src'; lazyClass = 'owl-lazy'; } if (customTn.length) { create(customTn.attr(srcType)); customTn.remove(); return false; } if (video.type === 'youtube') { path = "http://img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; create(path); } else if (video.type === 'vimeo') { $.ajax({ type: 'GET', url: 'http://vimeo.com/api/v2/video/' + video.id + '.json', jsonp: 'callback', dataType: 'jsonp', success: function(data) { path = data[0].thumbnail_large; create(path); } }); } }; Video.prototype.stop = function() { this._core.trigger('stop', null, 'video'); this._playing.find('.owl-video-frame').remove(); this._playing.removeClass('owl-video-playing'); this._playing = null; }; Video.prototype.play = function(ev) { this._core.trigger('play', null, 'video'); if (this._playing) { this.stop(); } var target = $(ev.target || ev.srcElement), item = target.closest('.' + this._core.settings.itemClass), video = this._videos[item.attr('data-video')], width = video.width || '100%', height = video.height || this._core.$stage.height(), html, wrap; if (video.type === 'youtube') { html = ''; } else if (video.type === 'vimeo') { html = ''; } item.addClass('owl-video-playing'); this._playing = item; wrap = $('
' + html + '
'); target.after(wrap); }; Video.prototype.isInFullScreen = function() { var element = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; if (element && $(element).parent().hasClass('owl-video-frame')) { this._core.speed(0); this._fullscreen = true; } if (element && this._fullscreen && this._playing) { return false; } if (this._fullscreen) { this._fullscreen = false; return false; } if (this._playing) { if (this._core.state.orientation !== window.orientation) { this._core.state.orientation = window.orientation; return false; } } return true; }; Video.prototype.destroy = function() { var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Video = Video; })(window.Zepto || window.jQuery, window, document);; (function($, window, document, undefined) { var Animate = function(scope) { this.core = scope; this.core.options = $.extend({}, Animate.Defaults, this.core.options); this.swapping = true; this.previous = undefined; this.next = undefined; this.handlers = { 'change.owl.carousel': $.proxy(function(e) { if (e.property.name == 'position') { this.previous = this.core.current(); this.next = e.property.value; } }, this), 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) { this.swapping = e.type == 'translated'; }, this), 'translate.owl.carousel': $.proxy(function(e) { if (this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { this.swap(); } }, this) }; this.core.$element.on(this.handlers); }; Animate.Defaults = { animateOut: false, animateIn: false }; Animate.prototype.swap = function() { if (this.core.settings.items !== 1 || !this.core.support3d) { return; } this.core.speed(0); var left, clear = $.proxy(this.clear, this), previous = this.core.$stage.children().eq(this.previous), next = this.core.$stage.children().eq(this.next), incoming = this.core.settings.animateIn, outgoing = this.core.settings.animateOut; if (this.core.current() === this.previous) { return; } if (outgoing) { left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.css({ 'left': left + 'px' }).addClass('animated owl-animated-out').addClass(outgoing).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear); } if (incoming) { next.addClass('animated owl-animated-in').addClass(incoming).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear); } }; Animate.prototype.clear = function(e) { $(e.target).css({ 'left': '' }).removeClass('animated owl-animated-out owl-animated-in').removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut); this.core.transitionEnd(); } Animate.prototype.destroy = function() { var handler, property; for (handler in this.handlers) { this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Animate = Animate; })(window.Zepto || window.jQuery, window, document);; (function($, window, document, undefined) { var Autoplay = function(scope) { this.core = scope; this.core.options = $.extend({}, Autoplay.Defaults, this.core.options); this.handlers = { 'translated.owl.carousel refreshed.owl.carousel': $.proxy(function() { this.autoplay(); }, this), 'play.owl.autoplay': $.proxy(function(e, t, s) { this.play(t, s); }, this), 'stop.owl.autoplay': $.proxy(function() { this.stop(); }, this), 'mouseover.owl.autoplay': $.proxy(function() { if (this.core.settings.autoplayHoverPause) { this.pause(); } }, this), 'mouseleave.owl.autoplay': $.proxy(function() { if (this.core.settings.autoplayHoverPause) { this.autoplay(); } }, this) }; this.core.$element.on(this.handlers); }; Autoplay.Defaults = { autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: false, autoplaySpeed: false }; Autoplay.prototype.autoplay = function() { if (this.core.settings.autoplay && !this.core.state.videoPlay) { window.clearInterval(this.interval); this.interval = window.setInterval($.proxy(function() { this.play(); }, this), this.core.settings.autoplayTimeout); } else { window.clearInterval(this.interval); } }; Autoplay.prototype.play = function(timeout, speed) { if (document.hidden === true) { return; } if (this.core.state.isTouch || this.core.state.isScrolling || this.core.state.isSwiping || this.core.state.inMotion) { return; } if (this.core.settings.autoplay === false) { window.clearInterval(this.interval); return; } this.core.next(this.core.settings.autoplaySpeed); }; Autoplay.prototype.stop = function() { window.clearInterval(this.interval); }; Autoplay.prototype.pause = function() { window.clearInterval(this.interval); }; Autoplay.prototype.destroy = function() { var handler, property; window.clearInterval(this.interval); for (handler in this.handlers) { this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay; })(window.Zepto || window.jQuery, window, document);; (function($, window, document, undefined) { 'use strict'; var Navigation = function(carousel) { this._core = carousel; this._initialized = false; this._pages = []; this._controls = {}; this._templates = []; this.$element = this._core.$element; this._overrides = { next: this._core.next, prev: this._core.prev, to: this._core.to }; this._handlers = { 'prepared.owl.carousel': $.proxy(function(e) { if (this._core.settings.dotsData) { this._templates.push($(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot')); } }, this), 'add.owl.carousel': $.proxy(function(e) { if (this._core.settings.dotsData) { this._templates.splice(e.position, 0, $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot')); } }, this), 'remove.owl.carousel prepared.owl.carousel': $.proxy(function(e) { if (this._core.settings.dotsData) { this._templates.splice(e.position, 1); } }, this), 'change.owl.carousel': $.proxy(function(e) { if (e.property.name == 'position') { if (!this._core.state.revert && !this._core.settings.loop && this._core.settings.navRewind) { var current = this._core.current(), maximum = this._core.maximum(), minimum = this._core.minimum(); e.data = e.property.value > maximum ? current >= maximum ? minimum : maximum : e.property.value < minimum ? maximum : e.property.value; } } }, this), 'changed.owl.carousel': $.proxy(function(e) { if (e.property.name == 'position') { this.draw(); } }, this), 'refreshed.owl.carousel': $.proxy(function() { if (!this._initialized) { this.initialize(); this._initialized = true; } this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation'); }, this) }; this._core.options = $.extend({}, Navigation.Defaults, this._core.options); this.$element.on(this._handlers); } Navigation.Defaults = { nav: false, navRewind: true, navText: ['', ''], navSpeed: false, navElement: 'div', navContainer: false, navContainerClass: 'owl-nav', navClass: ['owl-prev', 'owl-next'], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: true, dotsEach: false, dotData: false, dotsSpeed: false, dotsContainer: false, controlsClass: 'owl-controls' } Navigation.prototype.initialize = function() { var $container, override, options = this._core.settings; if (!options.dotsData) { this._templates = [$('
').addClass(options.dotClass).append($('')).prop('outerHTML')]; } if (!options.navContainer || !options.dotsContainer) { this._controls.$container = $('
').addClass(options.controlsClass).appendTo(this.$element); } this._controls.$indicators = options.dotsContainer ? $(options.dotsContainer) : $('
').hide().addClass(options.dotsClass).appendTo(this._controls.$container); this._controls.$indicators.on('click', 'div', $.proxy(function(e) { var index = $(e.target).parent().is(this._controls.$indicators) ? $(e.target).index() : $(e.target).parent().index(); e.preventDefault(); this.to(index, options.dotsSpeed); }, this)); $container = options.navContainer ? $(options.navContainer) : $('
').addClass(options.navContainerClass).prependTo(this._controls.$container); this._controls.$next = $('<' + options.navElement + '>'); this._controls.$previous = this._controls.$next.clone(); this._controls.$previous.addClass(options.navClass[0]).html(options.navText[0]).hide().prependTo($container).on('click', $.proxy(function(e) { this.prev(options.navSpeed); }, this)); this._controls.$next.addClass(options.navClass[1]).html(options.navText[1]).hide().appendTo($container).on('click', $.proxy(function(e) { this.next(options.navSpeed); }, this)); for (override in this._overrides) { this._core[override] = $.proxy(this[override], this); } } Navigation.prototype.destroy = function() { var handler, control, property, override; for (handler in this._handlers) { this.$element.off(handler, this._handlers[handler]); } for (control in this._controls) { this._controls[control].remove(); } for (override in this.overides) { this._core[override] = this._overrides[override]; } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } } Navigation.prototype.update = function() { var i, j, k, options = this._core.settings, lower = this._core.clones().length / 2, upper = lower + this._core.items().length, size = options.center || options.autoWidth || options.dotData ? 1 : options.dotsEach || options.items; if (options.slideBy !== 'page') { options.slideBy = Math.min(options.slideBy, options.items); } if (options.dots || options.slideBy == 'page') { this._pages = []; for (i = lower, j = 0, k = 0; i < upper; i++) { if (j >= size || j === 0) { this._pages.push({ start: i - lower, end: i - lower + size - 1 }); j = 0, ++k; } j += this._core.mergers(this._core.relative(i)); } } } Navigation.prototype.draw = function() { var difference, i, html = '', options = this._core.settings, $items = this._core.$stage.children(), index = this._core.relative(this._core.current()); if (options.nav && !options.loop && !options.navRewind) { this._controls.$previous.toggleClass('disabled', index <= 0); this._controls.$next.toggleClass('disabled', index >= this._core.maximum()); } this._controls.$previous.toggle(options.nav); this._controls.$next.toggle(options.nav); if (options.dots) { difference = this._pages.length - this._controls.$indicators.children().length; if (options.dotData && difference !== 0) { for (i = 0; i < this._controls.$indicators.children().length; i++) { html += this._templates[this._core.relative(i)]; } this._controls.$indicators.html(html); } else if (difference > 0) { html = new Array(difference + 1).join(this._templates[0]); this._controls.$indicators.append(html); } else if (difference < 0) { this._controls.$indicators.children().slice(difference).remove(); } this._controls.$indicators.find('.active').removeClass('active'); this._controls.$indicators.children().eq($.inArray(this.current(), this._pages)).addClass('active'); } this._controls.$indicators.toggle(options.dots); } Navigation.prototype.onTrigger = function(event) { var settings = this._core.settings; event.page = { index: $.inArray(this.current(), this._pages), count: this._pages.length, size: settings && (settings.center || settings.autoWidth || settings.dotData ? 1 : settings.dotsEach || settings.items) }; } Navigation.prototype.current = function() { var index = this._core.relative(this._core.current()); return $.grep(this._pages, function(o) { return o.start <= index && o.end >= index; }).pop(); } Navigation.prototype.getPosition = function(successor) { var position, length, options = this._core.settings; if (options.slideBy == 'page') { position = $.inArray(this.current(), this._pages); length = this._pages.length; successor ? ++position : --position; position = this._pages[((position % length) + length) % length].start; } else { position = this._core.relative(this._core.current()); length = this._core.items().length; successor ? position += options.slideBy : position -= options.slideBy; } return position; } Navigation.prototype.next = function(speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); } Navigation.prototype.prev = function(speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); } Navigation.prototype.to = function(position, speed, standard) { var length; if (!standard) { length = this._pages.length; $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed); } else { $.proxy(this._overrides.to, this._core)(position, speed); } } $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation; })(window.Zepto || window.jQuery, window, document);; (function($, window, document, undefined) { 'use strict'; var Hash = function(carousel) { this._core = carousel; this._hashes = {}; this.$element = this._core.$element; this._handlers = { 'initialized.owl.carousel': $.proxy(function() { if (this._core.settings.startPosition == 'URLHash') { $(window).trigger('hashchange.owl.navigation'); } }, this), 'prepared.owl.carousel': $.proxy(function(e) { var hash = $(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash'); this._hashes[hash] = e.content; }, this) }; this._core.options = $.extend({}, Hash.Defaults, this._core.options); this.$element.on(this._handlers); $(window).on('hashchange.owl.navigation', $.proxy(function() { var hash = window.location.hash.substring(1), items = this._core.$stage.children(), position = this._hashes[hash] && items.index(this._hashes[hash]) || 0; if (!hash) { return false; } this._core.to(position, false, true); }, this)); } Hash.Defaults = { URLhashListener: false } Hash.prototype.destroy = function() { var handler, property; $(window).off('hashchange.owl.navigation'); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } } $.fn.owlCarousel.Constructor.Plugins.Hash = Hash; })(window.Zepto || window.jQuery, window, document); "use strict";;(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(window.jQuery||window.Zepto);}}(function($){var CLOSE_EVENT='Close',BEFORE_CLOSE_EVENT='BeforeClose',AFTER_CLOSE_EVENT='AfterClose',BEFORE_APPEND_EVENT='BeforeAppend',MARKUP_PARSE_EVENT='MarkupParse',OPEN_EVENT='Open',CHANGE_EVENT='Change',NS='mfp',EVENT_NS='.'+NS,READY_CLASS='mfp-ready',REMOVING_CLASS='mfp-removing',PREVENT_CLOSE_CLASS='mfp-prevent-close';var mfp,MagnificPopup=function(){},_isJQ=!!(window.jQuery),_prevStatus,_window=$(window),_document,_prevContentType,_wrapClasses,_currPopupType;var _mfpOn=function(name,f){mfp.ev.on(NS+name+EVENT_NS,f);},_getEl=function(className,appendTo,html,raw){var el=document.createElement('div');el.className='mfp-'+className;if(html){el.innerHTML=html;}if(!raw){el=$(el);if(appendTo){el.appendTo(appendTo);}}else if(appendTo){appendTo.appendChild(el);}return el;},_mfpTrigger=function(e,data){mfp.ev.triggerHandler(NS+e,data);if(mfp.st.callbacks){e=e.charAt(0).toLowerCase()+e.slice(1);if(mfp.st.callbacks[e]){mfp.st.callbacks[e].apply(mfp,$.isArray(data)?data:[data]);}}},_getCloseBtn=function(type){if(type!==_currPopupType||!mfp.currTemplate.closeBtn){mfp.currTemplate.closeBtn=$(mfp.st.closeMarkup.replace('%title%',mfp.st.tClose));_currPopupType=type;}return mfp.currTemplate.closeBtn;},_checkInstance=function(){if(!$.magnificPopup.instance){mfp=new MagnificPopup();mfp.init();$.magnificPopup.instance=mfp;}},supportsTransitions=function(){var s=document.createElement('p').style,v=['ms','O','Moz','Webkit'];if(s['transition']!==undefined){return true;}while(v.length){if(v.pop()+'Transition'in s){return true;}}return false;};MagnificPopup.prototype={constructor:MagnificPopup,init:function(){var appVersion=navigator.appVersion;mfp.isIE7=appVersion.indexOf("MSIE 7.")!==-1;mfp.isIE8=appVersion.indexOf("MSIE 8.")!==-1;mfp.isLowIE=mfp.isIE7||mfp.isIE8;mfp.isAndroid=(/android/gi).test(appVersion);mfp.isIOS=(/iphone|ipad|ipod/gi).test(appVersion);mfp.supportsTransition=supportsTransitions();mfp.probablyMobile=(mfp.isAndroid||mfp.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent));_document=$(document);mfp.popupsCache={};},open:function(data){var i;if(data.isObj===false){mfp.items=data.items.toArray();mfp.index=0;var items=data.items,item;for(i=0;i(winHeight||_window.height()));},_setFocus:function(){(mfp.st.focus?mfp.content.find(mfp.st.focus).eq(0):mfp.wrap).focus();},_onFocusIn:function(e){if(e.target!==mfp.wrap[0]&&!$.contains(mfp.wrap[0],e.target)){mfp._setFocus();return false;}},_parseMarkup:function(template,values,item){var arr;if(item.data){values=$.extend(item.data,values);}_mfpTrigger(MARKUP_PARSE_EVENT,[template,values,item]);$.each(values,function(key,value){if(value===undefined||value===false){return true;}arr=key.split('_');if(arr.length>1){var el=template.find(EVENT_NS+'-'+arr[0]);if(el.length>0){var attr=arr[1];if(attr==='replaceWith'){if(el[0]!==value[0]){el.replaceWith(value);}}else if(attr==='img'){if(el.is('img')){el.attr('src',value);}else{el.replaceWith('');}}else{el.attr(arr[1],value);}}}else{template.find(EVENT_NS+'-'+key).html(value);}});},_getScrollbarSize:function(){if(mfp.scrollbarSize===undefined){var scrollDiv=document.createElement("div");scrollDiv.style.cssText='width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';document.body.appendChild(scrollDiv);mfp.scrollbarSize=scrollDiv.offsetWidth-scrollDiv.clientWidth;document.body.removeChild(scrollDiv);}return mfp.scrollbarSize;}};$.magnificPopup={instance:null,proto:MagnificPopup.prototype,modules:[],open:function(options,index){_checkInstance();if(!options){options={};}else{options=$.extend(true,{},options);}options.isObj=true;options.index=index||0;return this.instance.open(options);},close:function(){return $.magnificPopup.instance&&$.magnificPopup.instance.close();},registerModule:function(name,module){if(module.options){$.magnificPopup.defaults[name]=module.options;}$.extend(this.proto,module.proto);this.modules.push(name);},defaults:{disableOn:0,key:null,midClick:false,mainClass:'',preloader:true,focus:'',closeOnContentClick:false,closeOnBgClick:true,closeBtnInside:false,showCloseBtn:false,enableEscapeKey:true,modal:false,alignTop:false,removalDelay:0,prependTo:null,fixedContentPos:'auto',fixedBgPos:'auto',overflowY:'auto',closeMarkup:'',tClose:'Close (Esc)',tLoading:'Loading...'}};$.fn.magnificPopup=function(options){_checkInstance();var jqEl=$(this);if(typeof options==="string"){if(options==='open'){var items,itemOpts=_isJQ?jqEl.data('magnificPopup'):jqEl[0].magnificPopup,index=parseInt(arguments[1],10)||0;if(itemOpts.items){items=itemOpts.items[index];}else{items=jqEl;if(itemOpts.delegate){items=items.find(itemOpts.delegate);}items=items.eq(index);}mfp._openClick({mfpEl:items},jqEl,itemOpts);}else{if(mfp.isOpen)mfp[options].apply(mfp,Array.prototype.slice.call(arguments,1));}}else{options=$.extend(true,{},options);if(_isJQ){jqEl.data('magnificPopup',options);}else{jqEl[0].magnificPopup=options;}mfp.addGroup(jqEl,options);}return jqEl;};var INLINE_NS='inline',_hiddenClass,_inlinePlaceholder,_lastInlineElement,_putInlineElementsBack=function(){if(_lastInlineElement){_inlinePlaceholder.after(_lastInlineElement.addClass(_hiddenClass)).detach();_lastInlineElement=null;}};$.magnificPopup.registerModule(INLINE_NS,{options:{hiddenClass:'hide',markup:'',tNotFound:'Вече сте влезли в профила си.'},proto:{initInline:function(){mfp.types.push(INLINE_NS);_mfpOn(CLOSE_EVENT+'.'+INLINE_NS,function(){_putInlineElementsBack();});},getInline:function(item,template){_putInlineElementsBack();if(item.src){var inlineSt=mfp.st.inline,el=$(item.src);if(el.length){var parent=el[0].parentNode;if(parent&&parent.tagName){if(!_inlinePlaceholder){_hiddenClass=inlineSt.hiddenClass;_inlinePlaceholder=_getEl(_hiddenClass);_hiddenClass='mfp-'+_hiddenClass;}_lastInlineElement=el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);}mfp.updateStatus('ready');}else{mfp.updateStatus('error',inlineSt.tNotFound);el=$('
');}item.inlineElement=el;return el;}mfp.updateStatus('ready');mfp._parseMarkup(template,{},item);return template;}}});var AJAX_NS='ajax',_ajaxCur,_removeAjaxCursor=function(){if(_ajaxCur){$(document.body).removeClass(_ajaxCur);}},_destroyAjaxRequest=function(){_removeAjaxCursor();if(mfp.req){mfp.req.abort();}};$.magnificPopup.registerModule(AJAX_NS,{options:{settings:null,cursor:'mfp-ajax-cur',tError:'The content could not be loaded.'},proto:{initAjax:function(){mfp.types.push(AJAX_NS);_ajaxCur=mfp.st.ajax.cursor;_mfpOn(CLOSE_EVENT+'.'+AJAX_NS,_destroyAjaxRequest);_mfpOn('BeforeChange.'+AJAX_NS,_destroyAjaxRequest);},getAjax:function(item){if(_ajaxCur){$(document.body).addClass(_ajaxCur);}mfp.updateStatus('loading');var opts=$.extend({url:item.src,success:function(data,textStatus,jqXHR){var temp={data:data,xhr:jqXHR};_mfpTrigger('ParseAjax',temp);mfp.appendContent($(temp.data),AJAX_NS);item.finished=true;_removeAjaxCursor();mfp._setFocus();setTimeout(function(){mfp.wrap.addClass(READY_CLASS);},16);mfp.updateStatus('ready');_mfpTrigger('AjaxContentAdded');},error:function(){_removeAjaxCursor();item.finished=item.loadError=true;mfp.updateStatus('error',mfp.st.ajax.tError.replace('%url%',item.src));}},mfp.st.ajax.settings);mfp.req=$.ajax(opts);return'';}}});var _imgInterval,_getTitle=function(item){if(item.data&&item.data.title!==undefined)return item.data.title;var src=mfp.st.image.titleSrc;if(src){if($.isFunction(src)){return src.call(mfp,item);}else if(item.el){return item.el.attr(src)||'';}}return'';};$.magnificPopup.registerModule('image',{options:{markup:'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
',cursor:'mfp-zoom-out-cur',titleSrc:'title',verticalFit:true,tError:'The image could not be loaded.'},proto:{initImage:function(){var imgSt=mfp.st.image,ns='.image';mfp.types.push('image');_mfpOn(OPEN_EVENT+ns,function(){if(mfp.currItem.type==='image'&&imgSt.cursor){$(document.body).addClass(imgSt.cursor);}});_mfpOn(CLOSE_EVENT+ns,function(){if(imgSt.cursor){$(document.body).removeClass(imgSt.cursor);}_window.off('resize'+EVENT_NS);});_mfpOn('Resize'+ns,mfp.resizeImage);if(mfp.isLowIE){_mfpOn('AfterChange',mfp.resizeImage);}},resizeImage:function(){var item=mfp.currItem;if(!item||!item.img)return;if(mfp.st.image.verticalFit){var decr=0;if(mfp.isLowIE){decr=parseInt(item.img.css('padding-top'),10)+parseInt(item.img.css('padding-bottom'),10);}item.img.css('max-height',mfp.wH-decr);}},_onImageHasSize:function(item){if(item.img){item.hasSize=true;if(_imgInterval){clearInterval(_imgInterval);}item.isCheckingImgSize=false;_mfpTrigger('ImageHasSize',item);if(item.imgHidden){if(mfp.content)mfp.content.removeClass('mfp-loading');item.imgHidden=false;}}},findImageSize:function(item){var counter=0,img=item.img[0],mfpSetInterval=function(delay){if(_imgInterval){clearInterval(_imgInterval);}_imgInterval=setInterval(function(){if(img.naturalWidth>0){mfp._onImageHasSize(item);return;}if(counter>200){clearInterval(_imgInterval);}counter++;if(counter===3){mfpSetInterval(10);}else if(counter===40){mfpSetInterval(50);}else if(counter===100){mfpSetInterval(500);}},delay);};mfpSetInterval(1);},getImage:function(item,template){var guard=0,onLoadComplete=function(){if(item){if(item.img[0].complete){item.img.off('.mfploader');if(item===mfp.currItem){mfp._onImageHasSize(item);mfp.updateStatus('ready');}item.hasSize=true;item.loaded=true;_mfpTrigger('ImageLoadComplete');}else{guard++;if(guard<200){setTimeout(onLoadComplete,100);}else{onLoadError();}}}},onLoadError=function(){if(item){item.img.off('.mfploader');if(item===mfp.currItem){mfp._onImageHasSize(item);mfp.updateStatus('error',imgSt.tError.replace('%url%',item.src));}item.hasSize=true;item.loaded=true;item.loadError=true;}},imgSt=mfp.st.image;var el=template.find('.mfp-img');if(el.length){var img=document.createElement('img');img.className='mfp-img';if(item.el&&item.el.find('img').length){img.alt=item.el.find('img').attr('alt');}item.img=$(img).on('load.mfploader',onLoadComplete).on('error.mfploader',onLoadError);img.src=item.src;if(el.is('img')){item.img=item.img.clone();}img=item.img[0];if(img.naturalWidth>0){item.hasSize=true;}else if(!img.width){item.hasSize=false;}}mfp._parseMarkup(template,{title:_getTitle(item),img_replaceWith:item.img},item);mfp.resizeImage();if(item.hasSize){if(_imgInterval)clearInterval(_imgInterval);if(item.loadError){template.addClass('mfp-loading');mfp.updateStatus('error',imgSt.tError.replace('%url%',item.src));}else{template.removeClass('mfp-loading');mfp.updateStatus('ready');}return template;}mfp.updateStatus('loading');item.loading=true;if(!item.hasSize){item.imgHidden=true;template.addClass('mfp-loading');mfp.findImageSize(item);}return template;}}});var hasMozTransform,getHasMozTransform=function(){if(hasMozTransform===undefined){hasMozTransform=document.createElement('p').style.MozTransform!==undefined;}return hasMozTransform;};$.magnificPopup.registerModule('zoom',{options:{enabled:false,easing:'ease-in-out',duration:300,opener:function(element){return element.is('img')?element:element.find('img');}},proto:{initZoom:function(){var zoomSt=mfp.st.zoom,ns='.zoom',image;if(!zoomSt.enabled||!mfp.supportsTransition){return;}var duration=zoomSt.duration,getElToAnimate=function(image){var newImg=image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),transition='all '+(zoomSt.duration/1000)+'s '+zoomSt.easing,cssObj={position:'fixed',zIndex:9999,left:0,top:0,'-webkit-backface-visibility':'hidden'},t='transition';cssObj['-webkit-'+t]=cssObj['-moz-'+t]=cssObj['-o-'+t]=cssObj[t]=transition;newImg.css(cssObj);return newImg;},showMainContent=function(){mfp.content.css('visibility','visible');},openTimeout,animatedImg;_mfpOn('BuildControls'+ns,function(){if(mfp._allowZoom()){clearTimeout(openTimeout);mfp.content.css('visibility','hidden');image=mfp._getItemToZoom();if(!image){showMainContent();return;}animatedImg=getElToAnimate(image);animatedImg.css(mfp._getOffset());mfp.wrap.append(animatedImg);openTimeout=setTimeout(function(){animatedImg.css(mfp._getOffset(true));openTimeout=setTimeout(function(){showMainContent();setTimeout(function(){animatedImg.remove();image=animatedImg=null;_mfpTrigger('ZoomAnimationEnded');},16);},duration);},16);}});_mfpOn(BEFORE_CLOSE_EVENT+ns,function(){if(mfp._allowZoom()){clearTimeout(openTimeout);mfp.st.removalDelay=duration;if(!image){image=mfp._getItemToZoom();if(!image){return;}animatedImg=getElToAnimate(image);}animatedImg.css(mfp._getOffset(true));mfp.wrap.append(animatedImg);mfp.content.css('visibility','hidden');setTimeout(function(){animatedImg.css(mfp._getOffset());},16);}});_mfpOn(CLOSE_EVENT+ns,function(){if(mfp._allowZoom()){showMainContent();if(animatedImg){animatedImg.remove();}image=null;}});},_allowZoom:function(){return mfp.currItem.type==='image';},_getItemToZoom:function(){if(mfp.currItem.hasSize){return mfp.currItem.img;}else{return false;}},_getOffset:function(isLarge){var el;if(isLarge){el=mfp.currItem.img;}else{el=mfp.st.zoom.opener(mfp.currItem.el||mfp.currItem);}var offset=el.offset();var paddingTop=parseInt(el.css('padding-top'),10);var paddingBottom=parseInt(el.css('padding-bottom'),10);offset.top-=($(window).scrollTop()-paddingTop);var obj={width:el.width(),height:(_isJQ?el.innerHeight():el[0].offsetHeight)-paddingBottom-paddingTop};if(getHasMozTransform()){obj['-moz-transform']=obj['transform']='translate('+offset.left+'px,'+offset.top+'px)';}else{obj.left=offset.left;obj.top=offset.top;}return obj;}}});var IFRAME_NS='iframe',_emptyPage='//about:blank',_fixIframeBugs=function(isShowing){if(mfp.currTemplate[IFRAME_NS]){var el=mfp.currTemplate[IFRAME_NS].find('iframe');if(el.length){if(!isShowing){el[0].src=_emptyPage;}if(mfp.isIE8){el.css('display',isShowing?'block':'none');}}}};$.magnificPopup.registerModule(IFRAME_NS,{options:{markup:'
'+'
'+''+'
',srcAction:'iframe_src',patterns:{youtube:{index:'youtube.com',id:'v=',src:'//www.youtube.com/embed/%id%?autoplay=1'},vimeo:{index:'vimeo.com/',id:'/',src:'//player.vimeo.com/video/%id%?autoplay=1'},gmaps:{index:'//maps.google.',src:'%id%&output=embed'}}},proto:{initIframe:function(){mfp.types.push(IFRAME_NS);_mfpOn('BeforeChange',function(e,prevType,newType){if(prevType!==newType){if(prevType===IFRAME_NS){_fixIframeBugs();}else if(newType===IFRAME_NS){_fixIframeBugs(true);}}});_mfpOn(CLOSE_EVENT+'.'+IFRAME_NS,function(){_fixIframeBugs();});},getIframe:function(item,template){var embedSrc=item.src;var iframeSt=mfp.st.iframe;$.each(iframeSt.patterns,function(){if(embedSrc.indexOf(this.index)>-1){if(this.id){if(typeof this.id==='string'){embedSrc=embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length,embedSrc.length);}else{embedSrc=this.id.call(this,embedSrc);}}embedSrc=this.src.replace('%id%',embedSrc);return false;}});var dataObj={};if(iframeSt.srcAction){dataObj[iframeSt.srcAction]=embedSrc;}mfp._parseMarkup(template,dataObj,item);mfp.updateStatus('ready');return template;}}});var _getLoopedId=function(index){var numSlides=mfp.items.length;if(index>numSlides-1){return index-numSlides;}else if(index<0){return numSlides+index;}return index;},_replaceCurrTotal=function(text,curr,total){return text.replace(/%curr%/gi,curr+1).replace(/%total%/gi,total);};$.magnificPopup.registerModule('gallery',{options:{enabled:false,arrowMarkup:'',preload:[0,2],navigateByImgClick:true,arrows:true,tPrev:'Previous (Left arrow key)',tNext:'Next (Right arrow key)',tCounter:'%curr% of %total%'},proto:{initGallery:function(){var gSt=mfp.st.gallery,ns='.mfp-gallery',supportsFastClick=Boolean($.fn.mfpFastClick);mfp.direction=true;if(!gSt||!gSt.enabled)return false;_wrapClasses+=' mfp-gallery';_mfpOn(OPEN_EVENT+ns,function(){if(gSt.navigateByImgClick){mfp.wrap.on('click'+ns,'.mfp-img',function(){if(mfp.items.length>1){mfp.next();return false;}});}_document.on('keydown'+ns,function(e){if(e.keyCode===37){mfp.prev();}else if(e.keyCode===39){mfp.next();}});});_mfpOn('UpdateStatus'+ns,function(e,data){if(data.text){data.text=_replaceCurrTotal(data.text,mfp.currItem.index,mfp.items.length);}});_mfpOn(MARKUP_PARSE_EVENT+ns,function(e,element,values,item){var l=mfp.items.length;values.counter=l>1?_replaceCurrTotal(gSt.tCounter,item.index,l):'';});_mfpOn('BuildControls'+ns,function(){if(mfp.items.length>1&&gSt.arrows&&!mfp.arrowLeft){var markup=gSt.arrowMarkup,arrowLeft=mfp.arrowLeft=$(markup.replace(/%title%/gi,gSt.tPrev).replace(/%dir%/gi,'left')).addClass(PREVENT_CLOSE_CLASS),arrowRight=mfp.arrowRight=$(markup.replace(/%title%/gi,gSt.tNext).replace(/%dir%/gi,'right')).addClass(PREVENT_CLOSE_CLASS);var eName=supportsFastClick?'mfpFastClick':'click';arrowLeft[eName](function(){mfp.prev();});arrowRight[eName](function(){mfp.next();});if(mfp.isIE7){_getEl('b',arrowLeft[0],false,true);_getEl('a',arrowLeft[0],false,true);_getEl('b',arrowRight[0],false,true);_getEl('a',arrowRight[0],false,true);}mfp.container.append(arrowLeft.add(arrowRight));}});_mfpOn(CHANGE_EVENT+ns,function(){if(mfp._preloadTimeout)clearTimeout(mfp._preloadTimeout);mfp._preloadTimeout=setTimeout(function(){mfp.preloadNearbyImages();mfp._preloadTimeout=null;},16);});_mfpOn(CLOSE_EVENT+ns,function(){_document.off(ns);mfp.wrap.off('click'+ns);if(mfp.arrowLeft&&supportsFastClick){mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();}mfp.arrowRight=mfp.arrowLeft=null;});},next:function(){mfp.direction=true;mfp.index=_getLoopedId(mfp.index+1);mfp.updateItemHTML();},prev:function(){mfp.direction=false;mfp.index=_getLoopedId(mfp.index-1);mfp.updateItemHTML();},goTo:function(newIndex){mfp.direction=(newIndex>=mfp.index);mfp.index=newIndex;mfp.updateItemHTML();},preloadNearbyImages:function(){var p=mfp.st.gallery.preload,preloadBefore=Math.min(p[0],mfp.items.length),preloadAfter=Math.min(p[1],mfp.items.length),i;for(i=1;i<=(mfp.direction?preloadAfter:preloadBefore);i++){mfp._preloadItem(mfp.index+i);}for(i=1;i<=(mfp.direction?preloadBefore:preloadAfter);i++){mfp._preloadItem(mfp.index-i);}},_preloadItem:function(index){index=_getLoopedId(index);if(mfp.items[index].preloaded){return;}var item=mfp.items[index];if(!item.parsed){item=mfp.parseEl(index);}_mfpTrigger('LazyLoad',item);if(item.type==='image'){item.img=$('').on('load.mfploader',function(){item.hasSize=true;}).on('error.mfploader',function(){item.hasSize=true;item.loadError=true;_mfpTrigger('LazyLoadError',item);}).attr('src',item.src);}item.preloaded=true;}}});var RETINA_NS='retina';$.magnificPopup.registerModule(RETINA_NS,{options:{replaceSrc:function(item){return item.src.replace(/\.\w+$/,function(m){return'@2x'+m;});},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var st=mfp.st.retina,ratio=st.ratio;ratio=!isNaN(ratio)?ratio:ratio();if(ratio>1){_mfpOn('ImageHasSize'+'.'+RETINA_NS,function(e,item){item.img.css({'max-width':item.img[0].naturalWidth/ratio,'width':'100%'});});_mfpOn('ElementParse'+'.'+RETINA_NS,function(e,item){item.src=st.replaceSrc(item,ratio);});}}}}});(function(){var ghostClickDelay=1000,supportsTouch='ontouchstart'in window,unbindTouchMove=function(){_window.off('touchmove'+ns+' touchend'+ns);},eName='mfpFastClick',ns='.'+eName;$.fn.mfpFastClick=function(callback){return $(this).each(function(){var elem=$(this),lock;if(supportsTouch){var timeout,startX,startY,pointerMoved,point,numPointers;elem.on('touchstart'+ns,function(e){pointerMoved=false;numPointers=1;point=e.originalEvent?e.originalEvent.touches[0]:e.touches[0];startX=point.clientX;startY=point.clientY;_window.on('touchmove'+ns,function(e){point=e.originalEvent?e.originalEvent.touches:e.touches;numPointers=point.length;point=point[0];if(Math.abs(point.clientX-startX)>10||Math.abs(point.clientY-startY)>10){pointerMoved=true;unbindTouchMove();}}).on('touchend'+ns,function(e){unbindTouchMove();if(pointerMoved||numPointers>1){return;}lock=true;e.preventDefault();clearTimeout(timeout);timeout=setTimeout(function(){lock=false;},ghostClickDelay);callback();});});}elem.on('click'+ns,function(){if(!lock){callback();}});});};$.fn.destroyMfpFastClick=function(){$(this).off('touchstart'+ns+' click'+ns);if(supportsTouch)_window.off('touchmove'+ns+' touchend'+ns);};})();_checkInstance();}));/*! * jQuery Form Plugin * version: 3.51.0-2014.06.20 * Requires jQuery v1.5 or later * Copyright (c) 2014 M. Alsup * Examples and documentation at: http://malsup.com/jquery/form/ * Project repository: https://github.com/malsup/form * Dual licensed under the MIT and GPL licenses. * https://github.com/malsup/form#copyright-and-license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;i').val(m.extraData[d].value).appendTo(w)[0]:e('').val(m.extraData[d]).appendTo(w)[0]);m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(h){var x=document.createElement("form").submit;x.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",c),r?w.setAttribute("target",r):f.removeAttr("target"),e(l).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t==k&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(m.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(l){var p=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];p?x.responseText=p.textContent?p.textContent:p.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==c&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,c,m)}catch(y){i="parsererror",x.error=r=y||i}}catch(y){a("error caught: ",y),i="error",x.error=r=y||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,m,r])),d&&e.event.trigger("ajaxComplete",[x,m]),d&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var c,l,m,d,p,v,g,x,y,b,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;l'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),d&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},d=m.global,d&&0===e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;y=w.clk,y&&(b=y.name,b&&!y.disabled&&(m.extraData=m.extraData||{},m.extraData[b]=y.value,"image"==y.type&&(m.extraData[b+".x"]=w.clk_x,m.extraData[b+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,c,l,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),c=t.url||this.attr2("action"),l="string"==typeof c?e.trim(c):"",l=l||window.location.href||"",l&&(l=(l.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:l,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var d=t.traditional;void 0===d&&(d=e.ajaxSettings.traditional);var p,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,p=e.param(t.data,d)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,d);p&&(g=g?g+"&"+p:p),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var y=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(y,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var b=t.error;t.error=function(e,r,a){var n=t.context||this;b.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;Ec;c++)if(d=u[c],f=d.name,f&&!d.disabled)if(t&&o.clk&&"image"==d.type)o.clk==d&&(a.push({name:f,value:e(d).val(),type:d.type}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}));else if(m=e.fieldValue(d,!0),m&&m.constructor==Array)for(r&&r.push(d),l=0,h=m.length;h>l;l++)a.push({name:f,value:m[l]});else if(n.fileapi&&"file"==d.type){r&&r.push(d);var v=d.files;if(v.length)for(l=0;li;i++)r.push({name:a,value:n[i]});else null!==n&&"undefined"!=typeof n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||"undefined"==typeof o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,c="select-one"==n,l=c?o+1:u.length,f=c?o:0;l>f;f++){var m=u[f];if(m.selected){var d=m.value;if(d||(d=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),c)return d;s.push(d)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1});var slice=[].slice;(function($,window){var Starrr;window.Starrr=Starrr=(function(){Starrr.prototype.defaults={rating:void 0,max:5,readOnly:false,emptyClass:'icon-star-empty',fullClass:'icon-star',change:function(e,value){}};function Starrr($el,options){this.options=$.extend({},this.defaults,options);this.$el=$el;this.createStars();this.syncRating();if(this.options.readOnly){return;}this.$el.on('mouseover.starrr','a',(function(_this){return function(e){return _this.syncRating(_this.getStars().index(e.currentTarget)+1);};})(this));this.$el.on('mouseout.starrr',(function(_this){return function(){return _this.syncRating();};})(this));this.$el.on('click.starrr','a',(function(_this){return function(e){e.preventDefault();return _this.setRating(_this.getStars().index(e.currentTarget)+1);};})(this));this.$el.on('starrr:change',this.options.change);}Starrr.prototype.getStars=function(){return this.$el.find('a');};Starrr.prototype.createStars=function(){var j,ref,results;results=[];for(j=1,ref=this.options.max;1<=ref?j<=ref:j>=ref;1<=ref?j++:j--){results.push(this.$el.append(""));}return results;};Starrr.prototype.setRating=function(rating){if(this.options.rating===rating){rating=void 0;}this.options.rating=rating;this.syncRating();return this.$el.trigger('starrr:change',rating);};Starrr.prototype.getRating=function(){return this.options.rating;};Starrr.prototype.syncRating=function(rating){var $stars,i,j,ref,results;rating||(rating=this.options.rating);$stars=this.getStars();results=[];for(i=j=1,ref=this.options.max;1<=ref?j<=ref:j>=ref;i=1<=ref?++j:--j){results.push($stars.eq(i-1).removeClass(rating>=i?this.options.emptyClass:this.options.fullClass).addClass(rating>=i?this.options.fullClass:this.options.emptyClass));}return results;};return Starrr;})();return $.fn.extend({starrr:function(){var args,option;option=arguments[0],args=2<=arguments.length?slice.call(arguments,1):[];return this.each(function(){var data;data=$(this).data('starrr');if(!data){$(this).data('starrr',(data=new Starrr($(this),option)));}if(typeof option==='string'){return data[option].apply(data,args);}});}});})(window.jQuery,window);;(function($){$.fn.extend({donetyping:function(callback,timeout){timeout=timeout||1e3;var timeoutReference,doneTyping=function(el){if(!timeoutReference)return;timeoutReference=null;callback.call(el);};return this.each(function(i,el){var $el=$(el);$el.is(':input')&&$el.on('keyup keypress paste',function(e){if(e.type=='keyup'&&e.keyCode!=8)return;if(timeoutReference)clearTimeout(timeoutReference);timeoutReference=setTimeout(function(){doneTyping(el);},timeout);}).on('blur',function(){doneTyping(el);});});}});})(jQuery);+(function(window,$,undefined){'use strict';var support={calc:false};$.fn.rrssb=function(options){var settings=$.extend({description:undefined,emailAddress:undefined,emailBody:undefined,emailSubject:undefined,image:undefined,title:undefined,url:undefined,phone:undefined,},options);settings.emailSubject=settings.emailSubject||settings.title;settings.emailBody=settings.emailBody||((settings.description?settings.description:'')+(settings.url?'\n\n'+settings.url:''));for(var key in settings){if(settings.hasOwnProperty(key)&&settings[key]!==undefined){settings[key]=encodeString(settings[key]);}};if(settings.url!==undefined){$(this).find('.rrssb-facebook a').attr('href','https://www.facebook.com/sharer/sharer.php?u='+settings.url);$(this).find('.rrssb-tumblr a').attr('href','http://tumblr.com/share/link?url='+settings.url+(settings.title!==undefined?'&name='+settings.title:'')+(settings.description!==undefined?'&description='+settings.description:''));$(this).find('.rrssb-linkedin a').attr('href','http://www.linkedin.com/shareArticle?mini=true&url='+settings.url+(settings.title!==undefined?'&title='+settings.title:'')+(settings.description!==undefined?'&summary='+settings.description:''));$(this).find('.rrssb-twitter a').attr('href','https://twitter.com/intent/tweet?text='+(settings.description!==undefined?settings.description:'')+'%20'+settings.url);$(this).find('.rrssb-hackernews a').attr('href','https://news.ycombinator.com/submitlink?u='+settings.url+(settings.title!==undefined?'&text='+settings.title:''));$(this).find('.rrssb-vk a').attr('href','https://vk.com/share.php?url='+settings.url);$(this).find('.rrssb-reddit a').attr('href','http://www.reddit.com/submit?url='+settings.url+(settings.description!==undefined?'&text='+settings.description:'')+(settings.title!==undefined?'&title='+settings.title:''));$(this).find('.rrssb-googleplus a').attr('href','https://plus.google.com/share?url='+(settings.description!==undefined?settings.description:'')+'%20'+settings.url);$(this).find('.rrssb-pinterest a').attr('href','http://pinterest.com/pin/create/button/?url='+settings.url+((settings.image!==undefined)?'&media='+settings.image:'')+(settings.description!==undefined?'&description='+settings.description:''));$(this).find('.rrssb-pocket a').attr('href','https://getpocket.com/save?url='+settings.url);$(this).find('.rrssb-github a').attr('href',settings.url);$(this).find('.rrssb-print a').attr('href','javascript:window.print()');$(this).find('.rrssb-whatsapp a').attr('href','whatsapp://send?text='+(settings.description!==undefined?settings.description+'%20':(settings.title!==undefined?settings.title+'%20':''))+settings.url);$(this).find('.rrssb-viber a').attr('href','viber://forward?text='+encodeURIComponent(window.location.href));}if(settings.emailAddress!==undefined||settings.emailSubject){$(this).find('.rrssb-email a').attr('href','mailto:'+(settings.emailAddress?settings.emailAddress:'')+'?'+(settings.emailSubject!==undefined?'subject='+settings.emailSubject:'')+(settings.emailBody!==undefined?'&body='+settings.emailBody:''));}};var detectCalcSupport=function(){var el=$('
');var calcProps=['calc','-webkit-calc','-moz-calc'];$('body').append(el);for(var i=0;i170&&buttonCountSmall<1){self.addClass('large-format');var fontSize=buttonWidth/12+'px';self.css('font-size',fontSize);}else{self.removeClass('large-format');self.css('font-size','');}if(containerWidthbtnWidth){var btn2small=buttons.not('.small').last();$(btn2small).addClass('small');sizeSmallBtns();}}if(!--count)backUpFromSmall();});});if(init===true){rrssbMagicLayout(sizeSmallBtns);}};var sizeSmallBtns=function(){$('.rrssb-buttons').each(function(index){var self=$(this);var regButtonCount;var regPercent;var pixelsOff;var magicWidth;var smallBtnFraction;var buttons=$('li',self);var smallButtons=buttons.filter('.small');var smallBtnCount=smallButtons.length;if(smallBtnCount>0&&smallBtnCount!==buttons.length){self.removeClass('small-format');smallButtons.css('width','42px');pixelsOff=smallBtnCount*42;regButtonCount=buttons.not('.small').length;regPercent=100/regButtonCount;smallBtnFraction=pixelsOff/regButtonCount;if(support.calc===false){magicWidth=((self.innerWidth()-1)/regButtonCount)-smallBtnFraction;magicWidth=Math.floor(magicWidth*1000)/1000;magicWidth+='px';}else{magicWidth=support.calc+'('+regPercent+'% - '+smallBtnFraction+'px)';}buttons.not('.small').css('width',magicWidth);}else if(smallBtnCount===buttons.length){self.addClass('small-format');setPercentBtns();}else{self.removeClass('small-format');setPercentBtns();}});makeExtremityBtns();};var rrssbInit=function(){$('.rrssb-buttons').each(function(index){$(this).addClass('rrssb-'+(index+1));});detectCalcSupport();setPercentBtns();$('.rrssb-buttons li .rrssb-text').each(function(index){var buttonTxt=$(this);var txtWdth=buttonTxt.width();buttonTxt.closest('li').attr('data-size',txtWdth);});checkSize(true);};var rrssbMagicLayout=function(callback){$('.rrssb-buttons li.small').removeClass('small');checkSize();callback();};var popupCenter=function(url,title,w,h){var dualScreenLeft=window.screenLeft!==undefined?window.screenLeft:screen.left;var dualScreenTop=window.screenTop!==undefined?window.screenTop:screen.top;var width=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width;var height=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;var left=((width/2)-(w/2))+dualScreenLeft;var top=((height/3)-(h/3))+dualScreenTop;var newWindow=window.open(url,title,'scrollbars=yes, width='+w+', height='+h+', top='+top+', left='+left);if(newWindow&&newWindow.focus){newWindow.focus();}};var waitForFinalEvent=(function(){var timers={};return function(callback,ms,uniqueId){if(!uniqueId){uniqueId="Don't call this twice without a uniqueId";}if(timers[uniqueId]){clearTimeout(timers[uniqueId]);}timers[uniqueId]=setTimeout(callback,ms);};})();$(document).ready(function(){try{$(document).on('click','.rrssb-buttons a.popup',{},function popUp(e){var self=$(this);popupCenter(self.attr('href'),self.find('.rrssb-text').html(),580,470);e.preventDefault();});}catch(e){}$(window).resize(function(){rrssbMagicLayout(sizeSmallBtns);waitForFinalEvent(function(){rrssbMagicLayout(sizeSmallBtns);},200,"finished resizing");});rrssbInit();});window.rrssbInit=rrssbInit;})(window,jQuery);/*! * MockJax - jQuery Plugin to Mock Ajax requests * * Version: 1.5.0pre * Released: * Home: http://github.com/appendto/jquery-mockjax * Author: Jonathan Sharp (http://jdsharp.com) * License: MIT,GPL * * Copyright (c) 2011 appendTo LLC. * Dual licensed under the MIT or GPL licenses. * http://appendto.com/open-source-licenses */ (function($){var _ajax=$.ajax,mockHandlers=[],CALLBACK_REGEX=/=\?(&|$)/,jsc=(new Date()).getTime();function parseXML(xml){if(window['DOMParser']==undefined&&window.ActiveXObject){DOMParser=function(){};DOMParser.prototype.parseFromString=function(xmlString){var doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(xmlString);return doc;};}try{var xmlDoc=(new DOMParser()).parseFromString(xml,'text/xml');if($.isXMLDoc(xmlDoc)){var err=$('parsererror',xmlDoc);if(err.length==1){throw('Error: '+$(xmlDoc).text());}}else{throw('Unable to parse XML');}}catch(e){var msg=(e.name==undefined?e:e.name+': '+e.message);$(document).trigger('xmlParseError',[msg]);return undefined;}return xmlDoc;}function trigger(s,type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args);}function isMockDataEqual(mock,live){var identical=false;if(typeof live==='string'){return $.isFunction(mock.test)?mock.test(live):mock==live;}$.each(mock,function(k,v){if(live[k]===undefined){identical=false;return identical;}else{identical=true;if(typeof live[k]=='object'){return isMockDataEqual(mock[k],live[k]);}else{if($.isFunction(mock[k].test)){identical=mock[k].test(live[k]);}else{identical=(mock[k]==live[k]);}return identical;}}});return identical;}function getMockForRequest(handler,requestSettings){if($.isFunction(handler)){return handler(requestSettings);}if($.isFunction(handler.url.test)){if(!handler.url.test(requestSettings.url)){return null;}}else{var star=handler.url.indexOf('*');if(handler.url!==requestSettings.url&&star===-1||!new RegExp(handler.url.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace('*','.+')).test(requestSettings.url)){return null;}}if(handler.data&&requestSettings.data){if(!isMockDataEqual(handler.data,requestSettings.data)){return null;}}if(handler&&handler.type&&handler.type.toLowerCase()!=requestSettings.type.toLowerCase()){return null;}return handler;}function logMock(mockHandler,requestSettings){var c=$.extend({},$.mockjaxSettings,mockHandler);if(c.log&&$.isFunction(c.log)){c.log('MOCK '+requestSettings.type.toUpperCase()+': '+requestSettings.url,$.extend({},requestSettings));}}function _xhrSend(mockHandler,requestSettings,origSettings){var process=(function(that){return function(){return(function(){this.status=mockHandler.status;this.statusText=mockHandler.statusText;this.readyState=4;if($.isFunction(mockHandler.response)){mockHandler.response(origSettings);}if(requestSettings.dataType=='json'&&(typeof mockHandler.responseText=='object')){this.responseText=JSON.stringify(mockHandler.responseText);}else if(requestSettings.dataType=='xml'){if(typeof mockHandler.responseXML=='string'){this.responseXML=parseXML(mockHandler.responseXML);}else{this.responseXML=mockHandler.responseXML;}}else{this.responseText=mockHandler.responseText;}if(typeof mockHandler.status=='number'||typeof mockHandler.status=='string'){this.status=mockHandler.status;}if(typeof mockHandler.statusText==="string"){this.statusText=mockHandler.statusText;}if($.isFunction(this.onreadystatechange)){if(mockHandler.isTimeout){this.status=-1;}this.onreadystatechange(mockHandler.isTimeout?'timeout':undefined);}else if(mockHandler.isTimeout){this.status=-1;}}).apply(that);};})(this);if(mockHandler.proxy){_ajax({global:false,url:mockHandler.proxy,type:mockHandler.proxyType,data:mockHandler.data,dataType:requestSettings.dataType==="script"?"text/plain":requestSettings.dataType,complete:function(xhr,txt){mockHandler.responseXML=xhr.responseXML;mockHandler.responseText=xhr.responseText;mockHandler.status=xhr.status;mockHandler.statusText=xhr.statusText;this.responseTimer=setTimeout(process,mockHandler.responseTime||0);}});}else{if(requestSettings.async===false){process();}else{this.responseTimer=setTimeout(process,mockHandler.responseTime||50);}}}function xhr(mockHandler,requestSettings,origSettings,origHandler){mockHandler=$.extend({},$.mockjaxSettings,mockHandler);if(typeof mockHandler.headers==='undefined'){mockHandler.headers={};}if(mockHandler.contentType){mockHandler.headers['content-type']=mockHandler.contentType;}return{status:mockHandler.status,statusText:mockHandler.statusText,readyState:1,open:function(){},send:function(){origHandler.fired=true;_xhrSend.call(this,mockHandler,requestSettings,origSettings);},abort:function(){clearTimeout(this.responseTimer);},setRequestHeader:function(header,value){mockHandler.headers[header]=value;},getResponseHeader:function(header){if(mockHandler.headers&&mockHandler.headers[header]){return mockHandler.headers[header];}else if(header.toLowerCase()=='last-modified'){return mockHandler.lastModified||(new Date()).toString();}else if(header.toLowerCase()=='etag'){return mockHandler.etag||'';}else if(header.toLowerCase()=='content-type'){return mockHandler.contentType||'text/plain';}},getAllResponseHeaders:function(){var headers='';$.each(mockHandler.headers,function(k,v){headers+=k+': '+v+"\n";});return headers;}};}function processJsonpMock(requestSettings,mockHandler,origSettings){processJsonpUrl(requestSettings);requestSettings.dataType="json";if(requestSettings.data&&CALLBACK_REGEX.test(requestSettings.data)||CALLBACK_REGEX.test(requestSettings.url)){createJsonpCallback(requestSettings,mockHandler);var rurl=/^(\w+:)?\/\/([^\/?#]+)/,parts=rurl.exec(requestSettings.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);requestSettings.dataType="script";if(requestSettings.type.toUpperCase()==="GET"&&remote){var newMockReturn=processJsonpRequest(requestSettings,mockHandler,origSettings);if(newMockReturn){return newMockReturn;}else{return true;}}}return null;}function processJsonpUrl(requestSettings){if(requestSettings.type.toUpperCase()==="GET"){if(!CALLBACK_REGEX.test(requestSettings.url)){requestSettings.url+=(/\?/.test(requestSettings.url)?"&":"?")+(requestSettings.jsonp||"callback")+"=?";}}else if(!requestSettings.data||!CALLBACK_REGEX.test(requestSettings.data)){requestSettings.data=(requestSettings.data?requestSettings.data+"&":"")+(requestSettings.jsonp||"callback")+"=?";}}function processJsonpRequest(requestSettings,mockHandler,origSettings){var callbackContext=origSettings&&origSettings.context||requestSettings,newMock=null;if(mockHandler.response&&$.isFunction(mockHandler.response)){mockHandler.response(origSettings);}else{if(typeof mockHandler.responseText==='object'){$.globalEval('('+JSON.stringify(mockHandler.responseText)+')');}else{$.globalEval('('+mockHandler.responseText+')');}}jsonpSuccess(requestSettings,mockHandler);jsonpComplete(requestSettings,mockHandler);if(jQuery.Deferred){newMock=new jQuery.Deferred();if(typeof mockHandler.responseText=="object"){newMock.resolve(mockHandler.responseText);}else{newMock.resolve(jQuery.parseJSON(mockHandler.responseText));}}return newMock;}function createJsonpCallback(requestSettings,mockHandler){jsonp=requestSettings.jsonpCallback||("jsonp"+jsc++);if(requestSettings.data){requestSettings.data=(requestSettings.data+"").replace(CALLBACK_REGEX,"="+jsonp+"$1");}requestSettings.url=requestSettings.url.replace(CALLBACK_REGEX,"="+jsonp+"$1");window[jsonp]=window[jsonp]||function(tmp){data=tmp;jsonpSuccess(requestSettings,mockHandler);jsonpComplete(requestSettings,mockHandler);window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head){head.removeChild(script);}};}function jsonpSuccess(requestSettings,mockHandler){if(requestSettings.success){requestSettings.success.call(callbackContext,(mockHandler.response?mockHandler.response.toString():mockHandler.responseText||''),status,{});}if(requestSettings.global){trigger(requestSettings,"ajaxSuccess",[{},requestSettings]);}}function jsonpComplete(requestSettings,mockHandler){if(requestSettings.complete){requestSettings.complete.call(callbackContext,{},status);}if(requestSettings.global){trigger("ajaxComplete",[{},requestSettings]);}if(requestSettings.global&&! --jQuery.active){jQuery.event.trigger("ajaxStop");}}function handleAjax(url,origSettings){var mockRequest,requestSettings,mockHandler;if(typeof url==="object"){origSettings=url;url=undefined;}else{origSettings.url=url;}requestSettings=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);for(var k=0;k").text(i[r]).html();e=i.join("
")}n.addClass(t.fn.editableform.errorGroupClass),o.addClass(t.fn.editableform.errorBlockClass).html(e).show()}},submit:function(e){e.stopPropagation(),e.preventDefault();var i,n=this.input.input2value();if(i=this.validate(n))return this.error(i),this.showForm(),void 0;if(!this.options.savenochange&&this.input.value2str(n)==this.input.value2str(this.value))return this.$div.triggerHandler("nochange"),void 0;var o=this.input.value2submit(n);this.isSaving=!0,t.when(this.save(o)).done(t.proxy(function(t){this.isSaving=!1;var e="function"==typeof this.options.success?this.options.success.call(this.options.scope,t,n):null;return e===!1?(this.error(!1),this.showForm(!1),void 0):"string"==typeof e?(this.error(e),this.showForm(),void 0):(e&&"object"==typeof e&&e.hasOwnProperty("newValue")&&(n=e.newValue),this.error(!1),this.value=n,this.$div.triggerHandler("save",{newValue:n,submitValue:o,response:t}),void 0)},this)).fail(t.proxy(function(t){this.isSaving=!1;var e;e="function"==typeof this.options.error?this.options.error.call(this.options.scope,t,n):"string"==typeof t?t:t.responseText||t.statusText||"Unknown error!",this.error(e),this.showForm()},this))},save:function(e){this.options.pk=t.fn.editableutils.tryParseJson(this.options.pk,!0);var i,n="function"==typeof this.options.pk?this.options.pk.call(this.options.scope):this.options.pk,o=!!("function"==typeof this.options.url||this.options.url&&("always"===this.options.send||"auto"===this.options.send&&null!==n&&void 0!==n));return o?(this.showLoading(),i={name:this.options.name||"",value:e,pk:n},"function"==typeof this.options.params?i=this.options.params.call(this.options.scope,i):(this.options.params=t.fn.editableutils.tryParseJson(this.options.params,!0),t.extend(i,this.options.params)),"function"==typeof this.options.url?this.options.url.call(this.options.scope,i):t.ajax(t.extend({url:this.options.url,data:i,type:"POST"},this.options.ajaxOptions))):void 0},validate:function(t){return void 0===t&&(t=this.value),"function"==typeof this.options.validate?this.options.validate.call(this.options.scope,t):void 0},option:function(t,e){t in this.options&&(this.options[t]=e),"value"===t&&this.setValue(e)},setValue:function(t,e){this.value=e?this.input.str2value(t):t,this.$form&&this.$form.is(":visible")&&this.input.value2input(this.value)}},t.fn.editableform=function(i){var n=arguments;return this.each(function(){var o=t(this),r=o.data("editableform"),s="object"==typeof i&&i;r||o.data("editableform",r=new e(this,s)),"string"==typeof i&&r[i].apply(r,Array.prototype.slice.call(n,1))})},t.fn.editableform.Constructor=e,t.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,defaultValue:null,send:"auto",validate:null,success:null,error:null,ajaxOptions:null,showbuttons:!0,scope:null,savenochange:!1},t.fn.editableform.template='
',t.fn.editableform.loading='
',t.fn.editableform.buttons='',t.fn.editableform.errorGroupClass="has-error",t.fn.editableform.errorBlockClass="editable-error"}(window.jQuery),function(t){"use strict";t.fn.editableutils={inherit:function(t,e){var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.superclass=e.prototype},setCursorPosition:function(t,e){if(t.setSelectionRange)t.setSelectionRange(e,e);else if(t.createTextRange){var i=t.createTextRange();i.collapse(!0),i.moveEnd("character",e),i.moveStart("character",e),i.select()}},tryParseJson:function(t,e){if("string"==typeof t&&t.length&&t.match(/^[\{\[].*[\}\]]$/))if(e)try{t=new Function("return "+t)()}catch(i){}finally{return t}else t=new Function("return "+t)();return t},sliceObj:function(e,i,n){var o,r,s={};if(!t.isArray(i)||!i.length)return s;for(var a=0;a").text(e).html()},itemsByValue:function(e,i,n){if(!i||null===e)return[];if("function"!=typeof n){var o=n||"value";n=function(t){return t[o]}}var r=t.isArray(e),s=[],a=this;return t.each(i,function(i,o){if(o.children)s=s.concat(a.itemsByValue(e,o.children,n));else if(r)t.grep(e,function(t){return t==(o&&"object"==typeof o?n(o):o)}).length&&s.push(o);else{var l=o&&"object"==typeof o?n(o):o;e==l&&s.push(o)}}),s},createInput:function(e){var i,n,o,r=e.type;return"date"===r&&("inline"===e.mode?t.fn.editabletypes.datefield?r="datefield":t.fn.editabletypes.dateuifield&&(r="dateuifield"):t.fn.editabletypes.date?r="date":t.fn.editabletypes.dateui&&(r="dateui"),"date"!==r||t.fn.editabletypes.date||(r="combodate")),"datetime"===r&&"inline"===e.mode&&(r="datetimefield"),"wysihtml5"!==r||t.fn.editabletypes[r]||(r="textarea"),"function"==typeof t.fn.editabletypes[r]?(i=t.fn.editabletypes[r],n=this.sliceObj(e,this.objectKeys(i.defaults)),o=new i(n)):(t.error("Unknown type: "+r),!1)},supportsTransitions:function(){var t=document.body||document.documentElement,e=t.style,i="transition",n=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof e[i])return!0;i=i.charAt(0).toUpperCase()+i.substr(1);for(var o=0;o"),this.tip().is(this.innerCss)?this.tip().append(this.$form):this.tip().find(this.innerCss).append(this.$form),this.renderForm()},hide:function(t){if(this.tip()&&this.tip().is(":visible")&&this.$element.hasClass("editable-open")){if(this.$form.data("editableform").isSaving)return this.delayedHide={reason:t},void 0;this.delayedHide=!1,this.$element.removeClass("editable-open"),this.innerHide(),this.$element.triggerHandler("hidden",t||"manual")}},innerShow:function(){},innerHide:function(){},toggle:function(t){this.container()&&this.tip()&&this.tip().is(":visible")?this.hide():this.show(t)},setPosition:function(){},save:function(t,e){this.$element.triggerHandler("save",e),this.hide("save")},option:function(t,e){this.options[t]=e,t in this.containerOptions?(this.containerOptions[t]=e,this.setContainerOption(t,e)):(this.formOptions[t]=e,this.$form&&this.$form.editableform("option",t,e))},setContainerOption:function(t,e){this.call("option",t,e)},destroy:function(){this.hide(),this.innerDestroy(),this.$element.off("destroyed"),this.$element.removeData("editableContainer")},innerDestroy:function(){},closeOthers:function(e){t(".editable-open").each(function(i,n){if(n!==e&&!t(n).find(e).length){var o=t(n),r=o.data("editableContainer");r&&("cancel"===r.options.onblur?o.data("editableContainer").hide("onblur"):"submit"===r.options.onblur&&o.data("editableContainer").tip().find("form").submit())}})},activate:function(){this.tip&&this.tip().is(":visible")&&this.$form&&this.$form.data("editableform").input.activate()}},t.fn.editableContainer=function(n){var o=arguments;return this.each(function(){var r=t(this),s="editableContainer",a=r.data(s),l="object"==typeof n&&n,c="inline"===l.mode?i:e;a||r.data(s,a=new c(this,l)),"string"==typeof n&&a[n].apply(a,Array.prototype.slice.call(o,1))})},t.fn.editableContainer.Popup=e,t.fn.editableContainer.Inline=i,t.fn.editableContainer.defaults={value:null,placement:"top",autohide:!0,onblur:"cancel",anim:!1,mode:"popup"},jQuery.event.special.destroyed={remove:function(t){t.handler&&t.handler()}}}(window.jQuery),function(t){"use strict";t.extend(t.fn.editableContainer.Inline.prototype,t.fn.editableContainer.Popup.prototype,{containerName:"editableform",innerCss:".editable-inline",containerClass:"editable-container editable-inline",initContainer:function(){this.$tip=t(""),this.options.anim||(this.options.anim=0)},splitOptions:function(){this.containerOptions={},this.formOptions=this.options},tip:function(){return this.$tip},innerShow:function(){this.$element.hide(),this.tip().insertAfter(this.$element).show()},innerHide:function(){this.$tip.hide(this.options.anim,t.proxy(function(){this.$element.show(),this.innerDestroy()},this))},innerDestroy:function(){this.tip()&&this.tip().empty().remove()}})}(window.jQuery),function(t){"use strict";var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.editable.defaults,i,t.fn.editableutils.getConfigData(this.$element)),this.options.selector?this.initLive():this.init(),this.options.highlight&&!t.fn.editableutils.supportsTransitions()&&(this.options.highlight=!1)};e.prototype={constructor:e,init:function(){var e,i=!1;if(this.options.name=this.options.name||this.$element.attr("id"),this.options.scope=this.$element[0],this.input=t.fn.editableutils.createInput(this.options),this.input){switch(void 0===this.options.value||null===this.options.value?(this.value=this.input.html2value(t.trim(this.$element.html())),i=!0):(this.options.value=t.fn.editableutils.tryParseJson(this.options.value,!0),this.value="string"==typeof this.options.value?this.input.str2value(this.options.value):this.options.value),this.$element.addClass("editable"),"textarea"===this.input.type&&this.$element.addClass("editable-pre-wrapped"),"manual"!==this.options.toggle?(this.$element.addClass("editable-click"),this.$element.on(this.options.toggle+".editable",t.proxy(function(t){if(this.options.disabled||t.preventDefault(),"mouseenter"===this.options.toggle)this.show();else{var e="click"!==this.options.toggle;this.toggle(e)}},this))):this.$element.attr("tabindex",-1),"function"==typeof this.options.display&&(this.options.autotext="always"),this.options.autotext){case"always":e=!0;break;case"auto":e=!t.trim(this.$element.text()).length&&null!==this.value&&void 0!==this.value&&!i;break;default:e=!1}t.when(e?this.render():!0).then(t.proxy(function(){this.options.disabled?this.disable():this.enable(),this.$element.triggerHandler("init",this)},this))}},initLive:function(){var e=this.options.selector;this.options.selector=!1,this.options.autotext="never",this.$element.on(this.options.toggle+".editable",e,t.proxy(function(e){var i=t(e.target);i.data("editable")||(i.hasClass(this.options.emptyclass)&&i.empty(),i.editable(this.options).trigger(e))},this))},render:function(t){return this.options.display!==!1?this.input.value2htmlFinal?this.input.value2html(this.value,this.$element[0],this.options.display,t):"function"==typeof this.options.display?this.options.display.call(this.$element[0],this.value,t):this.input.value2html(this.value,this.$element[0]):void 0},enable:function(){this.options.disabled=!1,this.$element.removeClass("editable-disabled"),this.handleEmpty(this.isEmpty),"manual"!==this.options.toggle&&"-1"===this.$element.attr("tabindex")&&this.$element.removeAttr("tabindex")},disable:function(){this.options.disabled=!0,this.hide(),this.$element.addClass("editable-disabled"),this.handleEmpty(this.isEmpty),this.$element.attr("tabindex",-1)},toggleDisabled:function(){this.options.disabled?this.enable():this.disable()},option:function(e,i){return e&&"object"==typeof e?(t.each(e,t.proxy(function(e,i){this.option(t.trim(e),i)},this)),void 0):(this.options[e]=i,"disabled"===e?i?this.disable():this.enable():("value"===e&&this.setValue(i),this.container&&this.container.option(e,i),this.input.option&&this.input.option(e,i),void 0))},handleEmpty:function(e){this.options.display!==!1&&(this.isEmpty=void 0!==e?e:""===t.trim(this.$element.html())?!0:""!==t.trim(this.$element.text())?!1:!this.$element.height()||!this.$element.width(),this.options.disabled?this.isEmpty&&(this.$element.empty(),this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass)):this.isEmpty?(this.$element.html(this.options.emptytext),this.options.emptyclass&&this.$element.addClass(this.options.emptyclass)):this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass))},show:function(e){if(!this.options.disabled){if(this.container){if(this.container.tip().is(":visible"))return}else{var i=t.extend({},this.options,{value:this.value,input:this.input});this.$element.editableContainer(i),this.$element.on("save.internal",t.proxy(this.save,this)),this.container=this.$element.data("editableContainer")}this.container.show(e)}},hide:function(){this.container&&this.container.hide()},toggle:function(t){this.container&&this.container.tip().is(":visible")?this.hide():this.show(t)},save:function(t,e){if(this.options.unsavedclass){var i=!1;i=i||"function"==typeof this.options.url,i=i||this.options.display===!1,i=i||void 0!==e.response,i=i||this.options.savenochange&&this.input.value2str(this.value)!==this.input.value2str(e.newValue),i?this.$element.removeClass(this.options.unsavedclass):this.$element.addClass(this.options.unsavedclass)}if(this.options.highlight){var n=this.$element,o=n.css("background-color");n.css("background-color",this.options.highlight),setTimeout(function(){"transparent"===o&&(o=""),n.css("background-color",o),n.addClass("editable-bg-transition"),setTimeout(function(){n.removeClass("editable-bg-transition")},1700)},10)}this.setValue(e.newValue,!1,e.response)},validate:function(){return"function"==typeof this.options.validate?this.options.validate.call(this,this.value):void 0},setValue:function(e,i,n){this.value=i?this.input.str2value(e):e,this.container&&this.container.option("value",this.value),t.when(this.render(n)).then(t.proxy(function(){this.handleEmpty()},this))},activate:function(){this.container&&this.container.activate()},destroy:function(){this.disable(),this.container&&this.container.destroy(),this.input.destroy(),"manual"!==this.options.toggle&&(this.$element.removeClass("editable-click"),this.$element.off(this.options.toggle+".editable")),this.$element.off("save.internal"),this.$element.removeClass("editable editable-open editable-disabled"),this.$element.removeData("editable")}},t.fn.editable=function(i){var n={},o=arguments,r="editable";switch(i){case"validate":return this.each(function(){var e,i=t(this),o=i.data(r);o&&(e=o.validate())&&(n[o.options.name]=e)}),n;case"getValue":return 2===arguments.length&&arguments[1]===!0?n=this.eq(0).data(r).value:this.each(function(){var e=t(this),i=e.data(r);i&&void 0!==i.value&&null!==i.value&&(n[i.options.name]=i.input.value2submit(i.value))}),n;case"submit":var s,a=arguments[1]||{},l=this,c=this.editable("validate");return t.isEmptyObject(c)?(s=this.editable("getValue"),a.data&&t.extend(s,a.data),t.ajax(t.extend({url:a.url,data:s,type:"POST"},a.ajaxOptions)).success(function(t){"function"==typeof a.success&&a.success.call(l,t,a)}).error(function(){"function"==typeof a.error&&a.error.apply(l,arguments)})):"function"==typeof a.error&&a.error.call(l,c),this}return this.each(function(){var n=t(this),s=n.data(r),a="object"==typeof i&&i;return a&&a.selector?(s=new e(this,a),void 0):(s||n.data(r,s=new e(this,a)),"string"==typeof i&&s[i].apply(s,Array.prototype.slice.call(o,1)),void 0)})},t.fn.editable.defaults={type:"text",disabled:!1,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null,emptyclass:"editable-empty",unsavedclass:"editable-unsaved",selector:null,highlight:"#FFFF80"}}(window.jQuery),function(t){"use strict";t.fn.editabletypes={};var e=function(){};e.prototype={init:function(e,i,n){this.type=e,this.options=t.extend({},n,i)},prerender:function(){this.$tpl=t(this.options.tpl),this.$input=this.$tpl,this.$clear=null,this.error=null},render:function(){},value2html:function(e,i){t(i).text(t.trim(e))},html2value:function(e){return t("
").html(e).text()},value2str:function(t){return t},str2value:function(t){return t},value2submit:function(t){return t},value2input:function(t){this.$input.val(t)},input2value:function(){return this.$input.val()},activate:function(){this.$input.is(":visible")&&this.$input.focus()},clear:function(){this.$input.val(null)},escape:function(e){return t("
").text(e).html()},autosubmit:function(){},destroy:function(){},setClass:function(){this.options.inputclass&&this.$input.addClass(this.options.inputclass)},setAttr:function(t){void 0!==this.options[t]&&null!==this.options[t]&&this.$input.attr(t,this.options[t])},option:function(t,e){this.options[t]=e}},e.defaults={tpl:"",inputclass:"input-medium",scope:null,showbuttons:!0},t.extend(t.fn.editabletypes,{abstractinput:e})}(window.jQuery),function(t){"use strict";var e=function(){};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{render:function(){var e=t.Deferred();return this.error=null,this.onSourceReady(function(){this.renderList(),e.resolve()},function(){this.error=this.options.sourceError,e.resolve()}),e.promise()},html2value:function(){return null},value2html:function(e,i,n,o){var r=t.Deferred(),s=function(){"function"==typeof n?n.call(i,e,this.sourceData,o):this.value2htmlFinal(e,i),r.resolve()};return null===e?s.call(this):this.onSourceReady(s,function(){r.resolve()}),r.promise()},onSourceReady:function(e,i){var n;if(t.isFunction(this.options.source)?(n=this.options.source.call(this.options.scope),this.sourceData=null):n=this.options.source,this.options.sourceCache&&t.isArray(this.sourceData))return e.call(this),void 0;try{n=t.fn.editableutils.tryParseJson(n,!1)}catch(o){return i.call(this),void 0}if("string"==typeof n){if(this.options.sourceCache){var r,s=n;if(t(document).data(s)||t(document).data(s,{}),r=t(document).data(s),r.loading===!1&&r.sourceData)return this.sourceData=r.sourceData,this.doPrepend(),e.call(this),void 0;if(r.loading===!0)return r.callbacks.push(t.proxy(function(){this.sourceData=r.sourceData,this.doPrepend(),e.call(this)},this)),r.err_callbacks.push(t.proxy(i,this)),void 0;r.loading=!0,r.callbacks=[],r.err_callbacks=[]}t.ajax({url:n,type:"get",cache:!1,dataType:"json",success:t.proxy(function(n){r&&(r.loading=!1),this.sourceData=this.makeArray(n),t.isArray(this.sourceData)?(r&&(r.sourceData=this.sourceData,t.each(r.callbacks,function(){this.call()})),this.doPrepend(),e.call(this)):(i.call(this),r&&t.each(r.err_callbacks,function(){this.call()}))},this),error:t.proxy(function(){i.call(this),r&&(r.loading=!1,t.each(r.err_callbacks,function(){this.call()}))},this)})}else this.sourceData=this.makeArray(n),t.isArray(this.sourceData)?(this.doPrepend(),e.call(this)):i.call(this)},doPrepend:function(){null!==this.options.prepend&&void 0!==this.options.prepend&&(t.isArray(this.prependData)||(t.isFunction(this.options.prepend)&&(this.options.prepend=this.options.prepend.call(this.options.scope)),this.options.prepend=t.fn.editableutils.tryParseJson(this.options.prepend,!0),"string"==typeof this.options.prepend&&(this.options.prepend={"":this.options.prepend}),this.prependData=this.makeArray(this.options.prepend)),t.isArray(this.prependData)&&t.isArray(this.sourceData)&&(this.sourceData=this.prependData.concat(this.sourceData)))},renderList:function(){},value2htmlFinal:function(){},makeArray:function(e){var i,n,o,r,s=[];if(!e||"string"==typeof e)return null;if(t.isArray(e)){r=function(t,e){return n={value:t,text:e},i++>=2?!1:void 0};for(var a=0;a1&&(o.children&&(o.children=this.makeArray(o.children)),s.push(o))):s.push({value:o,text:o})}else t.each(e,function(t,e){s.push({value:t,text:e})});return s},option:function(t,e){this.options[t]=e,"source"===t&&(this.sourceData=null),"prepend"===t&&(this.prependData=null)}}),e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{source:null,prepend:!1,sourceError:"Error when loading list",sourceCache:!0}),t.fn.editabletypes.list=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("text",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{render:function(){this.renderClear(),this.setClass(),this.setAttr("placeholder")},activate:function(){this.$input.is(":visible")&&(this.$input.focus(),t.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length),this.toggleClear&&this.toggleClear())},renderClear:function(){this.options.clear&&(this.$clear=t(''),this.$input.after(this.$clear).css("padding-right",24).keyup(t.proxy(function(e){if(!~t.inArray(e.keyCode,[40,38,9,13,27])){clearTimeout(this.t);var i=this;this.t=setTimeout(function(){i.toggleClear(e)},100)}},this)).parent().css("position","relative"),this.$clear.click(t.proxy(this.clear,this)))},postrender:function(){},toggleClear:function(){if(this.$clear){var t=this.$input.val().length,e=this.$clear.is(":visible");t&&!e&&this.$clear.show(),!t&&e&&this.$clear.hide()}},clear:function(){this.$clear.hide(),this.$input.val("").focus()}}),e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{tpl:'',placeholder:null,clear:!0}),t.fn.editabletypes.text=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("textarea",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{render:function(){this.setClass(),this.setAttr("placeholder"),this.setAttr("rows"),this.$input.keydown(function(e){e.ctrlKey&&13===e.which&&t(this).closest("form").submit()})},activate:function(){t.fn.editabletypes.text.prototype.activate.call(this)}}),e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{tpl:"",inputclass:"input-large",placeholder:null,rows:7}),t.fn.editabletypes.textarea=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("select",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.list),t.extend(e.prototype,{renderList:function(){this.$input.empty();var e=function(i,n){var o;if(t.isArray(n))for(var r=0;r",o),n[r].children))):(o.value=n[r].value,n[r].disabled&&(o.disabled=!0),i.append(t("
").append(e).appendTo(this.$tpl);this.$input=this.$tpl.find('input[type="checkbox"]'),this.setClass()}},value2str:function(e){return t.isArray(e)?e.sort().join(t.trim(this.options.separator)):""},str2value:function(e){var i,n=null;return"string"==typeof e&&e.length?(i=new RegExp("\\s*"+t.trim(this.options.separator)+"\\s*"),n=e.split(i)):n=t.isArray(e)?e:[e],n},value2input:function(e){this.$input.prop("checked",!1),t.isArray(e)&&e.length&&this.$input.each(function(i,n){var o=t(n);t.each(e,function(t,e){o.val()==e&&o.prop("checked",!0)})})},input2value:function(){var e=[];return this.$input.filter(":checked").each(function(i,n){e.push(t(n).val())}),e},value2htmlFinal:function(e,i){var n=[],o=t.fn.editableutils.itemsByValue(e,this.sourceData);o.length?(t.each(o,function(e,i){n.push(t.fn.editableutils.escape(i.text))}),t(i).html(n.join("
"))):t(i).empty()},activate:function(){this.$input.first().focus()},autosubmit:function(){this.$input.on("keydown",function(e){13===e.which&&t(this).closest("form").submit()})}}),e.defaults=t.extend({},t.fn.editabletypes.list.defaults,{tpl:'
',inputclass:null,separator:","}),t.fn.editabletypes.checklist=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("password",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text),t.extend(e.prototype,{value2html:function(e,i){e?t(i).text("[hidden]"):t(i).empty()},html2value:function(){return null}}),e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:''}),t.fn.editabletypes.password=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("email",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text),e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:''}),t.fn.editabletypes.email=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("url",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text),e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:''}),t.fn.editabletypes.url=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("tel",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text),e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:''}),t.fn.editabletypes.tel=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("number",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text),t.extend(e.prototype,{render:function(){e.superclass.render.call(this),this.setAttr("min"),this.setAttr("max"),this.setAttr("step")},postrender:function(){this.$clear&&this.$clear.css({right:24})}}),e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:'',inputclass:"form-control input-small",min:null,max:null,step:null}),t.fn.editabletypes.number=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("range",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.number),t.extend(e.prototype,{render:function(){this.$input=this.$tpl.filter("input"),this.setClass(),this.setAttr("min"),this.setAttr("max"),this.setAttr("step"),this.$input.on("input",function(){t(this).siblings("output").text(t(this).val())})},activate:function(){this.$input.focus()}}),e.defaults=t.extend({},t.fn.editabletypes.number.defaults,{tpl:'',inputclass:"form-control input-medium"}),t.fn.editabletypes.range=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("time",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{render:function(){this.setClass()}}),e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{tpl:''}),t.fn.editabletypes.time=e }(window.jQuery),function(t){"use strict";var e=function(i){if(this.init("select2",i,e.defaults),i.select2=i.select2||{},this.sourceData=null,i.placeholder&&(i.select2.placeholder=i.placeholder),!i.select2.tags&&i.source){var n=i.source;t.isFunction(i.source)&&(n=i.source.call(i.scope)),"string"==typeof n?(i.select2.ajax=i.select2.ajax||{},i.select2.ajax.data||(i.select2.ajax.data=function(t){return{query:t}}),i.select2.ajax.results||(i.select2.ajax.results=function(t){return{results:t}}),i.select2.ajax.url=n):(this.sourceData=this.convertSource(n),i.select2.data=this.sourceData)}if(this.options.select2=t.extend({},e.defaults.select2,i.select2),this.isMultiple=this.options.select2.tags||this.options.select2.multiple,this.isRemote="ajax"in this.options.select2,this.idFunc=this.options.select2.id,"function"!=typeof this.idFunc){var o=this.idFunc||"id";this.idFunc=function(t){return t[o]}}this.formatSelection=this.options.select2.formatSelection,"function"!=typeof this.formatSelection&&(this.formatSelection=function(t){return t.text})};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{render:function(){this.setClass(),this.$input.select2(this.options.select2),this.isRemote&&this.$input.on("select2-loaded",t.proxy(function(t){this.sourceData=t.items.results},this)),this.isMultiple&&this.$input.on("change",function(){t(this).closest("form").parent().triggerHandler("resize")})},value2html:function(e,i){var n,o="",r=this;this.options.select2.tags?n=e:this.sourceData&&(n=t.fn.editableutils.itemsByValue(e,this.sourceData,this.idFunc)),t.isArray(n)?(o=[],t.each(n,function(t,e){o.push(e&&"object"==typeof e?r.formatSelection(e):e)})):n&&(o=r.formatSelection(n)),o=t.isArray(o)?o.join(this.options.viewseparator):o,t(i).text(o)},html2value:function(t){return this.options.select2.tags?this.str2value(t,this.options.viewseparator):null},value2input:function(e){if(this.$input.val(e).trigger("change",!0),this.isRemote&&!this.isMultiple&&!this.options.select2.initSelection){var i=this.options.select2.id,n=this.options.select2.formatSelection;if(!i&&!n){var o={id:e,text:t(this.options.scope).text()};this.$input.select2("data",o)}}},input2value:function(){return this.$input.select2("val")},str2value:function(e,i){if("string"!=typeof e||!this.isMultiple)return e;i=i||this.options.select2.separator||t.fn.select2.defaults.separator;var n,o,r;if(null===e||e.length<1)return null;for(n=e.split(i),o=0,r=n.length;r>o;o+=1)n[o]=t.trim(n[o]);return n},autosubmit:function(){this.$input.on("change",function(e,i){i||t(this).closest("form").submit()})},convertSource:function(e){if(t.isArray(e)&&e.length&&void 0!==e[0].value)for(var i=0;i',select2:null,placeholder:null,source:null,viewseparator:", "}),t.fn.editabletypes.select2=e}(window.jQuery),function(t){var e=function(e,i){return this.$element=t(e),this.$element.is("input")?(this.options=t.extend({},t.fn.combodate.defaults,i,this.$element.data()),this.init(),void 0):(t.error("Combodate should be applied to INPUT element"),void 0)};e.prototype={constructor:e,init:function(){this.map={day:["D","date"],month:["M","month"],year:["Y","year"],hour:["[Hh]","hours"],minute:["m","minutes"],second:["s","seconds"],ampm:["[Aa]",""]},this.$widget=t('').html(this.getTemplate()),this.initCombos(),this.$widget.on("change","select",t.proxy(function(){this.$element.val(this.getValue())},this)),this.$widget.find("select").css("width","auto"),this.$element.hide().after(this.$widget),this.setValue(this.$element.val()||this.options.value)},getTemplate:function(){var e=this.options.template;return t.each(this.map,function(t,i){i=i[0];var n=new RegExp(i+"+"),o=i.length>1?i.substring(1,2):i;e=e.replace(n,"{"+o+"}")}),e=e.replace(/ /g," "),t.each(this.map,function(t,i){i=i[0];var n=i.length>1?i.substring(1,2):i;e=e.replace("{"+n+"}",'')}),e},initCombos:function(){var e=this;t.each(this.map,function(t){var i,n,o=e.$widget.find("."+t);o.length&&(e["$"+t]=o,i="fill"+t.charAt(0).toUpperCase()+t.slice(1),n=e[i](),e["$"+t].html(e.renderItems(n)))})},initItems:function(t){var e,i=[];if("name"===this.options.firstItem){e=moment.relativeTime||moment.langData()._relativeTime;var n="function"==typeof e[t]?e[t](1,!0,t,!1):e[t];n=n.split(" ").reverse()[0],i.push(["",n])}else"empty"===this.options.firstItem&&i.push(["",""]);return i},renderItems:function(t){for(var e=[],i=0;i'+t[i][1]+"");return e.join("\n")},fillDay:function(){var t,e,i=this.initItems("d"),n=-1!==this.options.template.indexOf("DD");for(e=1;31>=e;e++)t=n?this.leadZero(e):e,i.push([e,t]);return i},fillMonth:function(){var t,e,i=this.initItems("M"),n=-1!==this.options.template.indexOf("MMMM"),o=-1!==this.options.template.indexOf("MMM"),r=-1!==this.options.template.indexOf("MM");for(e=0;11>=e;e++)t=n?moment().date(1).month(e).format("MMMM"):o?moment().date(1).month(e).format("MMM"):r?this.leadZero(e+1):e+1,i.push([e,t]);return i},fillYear:function(){var t,e,i=[],n=-1!==this.options.template.indexOf("YYYY");for(e=this.options.maxYear;e>=this.options.minYear;e--)t=n?e:(e+"").substring(2),i[this.options.yearDescending?"push":"unshift"]([e,t]);return i=this.initItems("y").concat(i)},fillHour:function(){var t,e,i=this.initItems("h"),n=-1!==this.options.template.indexOf("h"),o=(-1!==this.options.template.indexOf("H"),-1!==this.options.template.toLowerCase().indexOf("hh")),r=n?1:0,s=n?12:23;for(e=r;s>=e;e++)t=o?this.leadZero(e):e,i.push([e,t]);return i},fillMinute:function(){var t,e,i=this.initItems("m"),n=-1!==this.options.template.indexOf("mm");for(e=0;59>=e;e+=this.options.minuteStep)t=n?this.leadZero(e):e,i.push([e,t]);return i},fillSecond:function(){var t,e,i=this.initItems("s"),n=-1!==this.options.template.indexOf("ss");for(e=0;59>=e;e+=this.options.secondStep)t=n?this.leadZero(e):e,i.push([e,t]);return i},fillAmpm:function(){var t=-1!==this.options.template.indexOf("a"),e=(-1!==this.options.template.indexOf("A"),[["am",t?"am":"AM"],["pm",t?"pm":"PM"]]);return e},getValue:function(e){var i,n={},o=this,r=!1;return t.each(this.map,function(t){if("ampm"!==t){var e="day"===t?1:0;return n[t]=o["$"+t]?parseInt(o["$"+t].val(),10):e,isNaN(n[t])?(r=!0,!1):void 0}}),r?"":(this.$ampm&&(n.hour=12===n.hour?"am"===this.$ampm.val()?0:12:"am"===this.$ampm.val()?n.hour:n.hour+12),i=moment([n.year,n.month,n.day,n.hour,n.minute,n.second]),this.highlight(i),e=void 0===e?this.options.format:e,null===e?i.isValid()?i:null:i.isValid()?i.format(e):"")},setValue:function(e){function i(e,i){var n={};return e.children("option").each(function(e,o){var r,s=t(o).attr("value");""!==s&&(r=Math.abs(s-i),("undefined"==typeof n.distance||r=12?(r.ampm="pm",r.hour>12&&(r.hour-=12)):(r.ampm="am",0===r.hour&&(r.hour=12))),t.each(r,function(t,e){o["$"+t]&&("minute"===t&&o.options.minuteStep>1&&o.options.roundTime&&(e=i(o["$"+t],e)),"second"===t&&o.options.secondStep>1&&o.options.roundTime&&(e=i(o["$"+t],e)),o["$"+t].val(e))}),this.$element.val(n.format(this.options.format)))}},highlight:function(t){t.isValid()?this.options.errorClass?this.$widget.removeClass(this.options.errorClass):this.$widget.find("select").css("border-color",this.borderColor):this.options.errorClass?this.$widget.addClass(this.options.errorClass):(this.borderColor||(this.borderColor=this.$widget.find("select").css("border-color")),this.$widget.find("select").css("border-color","red"))},leadZero:function(t){return 9>=t?"0"+t:t},destroy:function(){this.$widget.remove(),this.$element.removeData("combodate").show()}},t.fn.combodate=function(i){var n,o=Array.apply(null,arguments);return o.shift(),"getValue"===i&&this.length&&(n=this.eq(0).data("combodate"))?n.getValue.apply(n,o):this.each(function(){var n=t(this),r=n.data("combodate"),s="object"==typeof i&&i;r||n.data("combodate",r=new e(this,s)),"string"==typeof i&&"function"==typeof r[i]&&r[i].apply(r,o)})},t.fn.combodate.defaults={format:"DD-MM-YYYY HH:mm",template:"D / MMM / YYYY H : mm",value:null,minYear:1970,maxYear:2015,yearDescending:!0,minuteStep:5,secondStep:1,firstItem:"empty",errorClass:"has-error",roundTime:!0}}(window.jQuery),function(t){"use strict";var e=function(i){this.init("combodate",i,e.defaults),this.options.viewformat||(this.options.viewformat=this.options.format),i.combodate=t.fn.editableutils.tryParseJson(i.combodate,!0),this.options.combodate=t.extend({},e.defaults.combodate,i.combodate,{format:this.options.format,template:this.options.template})};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{render:function(){this.$input.combodate(this.options.combodate)},value2html:function(e,i){var n=e?e.format(this.options.viewformat):"";t(i).text(n)},html2value:function(t){return t?moment(t,this.options.viewformat):null},value2str:function(t){return t?t.format(this.options.format):""},str2value:function(t){return t?moment(t,this.options.format):null},value2submit:function(t){return this.value2str(t)},value2input:function(t){this.$input.combodate("setValue",t)},input2value:function(){return this.$input.combodate("getValue",null)},activate:function(){this.$input.siblings(".combodate").find("select").eq(0).focus()},autosubmit:function(){}}),e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{tpl:'',inputclass:null,format:"YYYY-MM-DD",viewformat:null,template:"D / MMM / YYYY",combodate:null}),t.fn.editabletypes.combodate=e}(window.jQuery),function(t){"use strict";t.extend(t.fn.editableform.Constructor.prototype,{initTemplate:function(){this.$form=t(t.fn.editableform.template),this.$form.find(".editable-error-block").addClass("help-block")}}),t.fn.editableform.buttons='',t.fn.editableform.errorGroupClass="has-error",t.fn.editableform.errorBlockClass=null}(window.jQuery),function(t){"use strict";t.fn.popover.defaults=t.fn.popover.Constructor.DEFAULTS,t.extend(t.fn.editableContainer.Popup.prototype,{containerName:"popover",containerDataName:"bs.popover",innerCss:t.fn.popover&&t(t.fn.popover.defaults.template).find("p").length?".popover-content p":".popover-content",initContainer:function(){t.extend(this.containerOptions,{trigger:"manual",selector:!1,content:" ",template:t.fn.popover.defaults.template});var e;this.$element.data("template")&&(e=this.$element.data("template"),this.$element.removeData("template")),this.call(this.containerOptions),e&&this.$element.data("template",e)},innerShow:function(){this.call("show")},innerHide:function(){this.call("hide")},innerDestroy:function(){this.call("destroy")},setContainerOption:function(t,e){this.container().options[t]=e},setPosition:function(){!function(){var e,i,n,o,r,s,a,l,c,h,d=this.tip();switch(r="function"==typeof this.options.placement?this.options.placement.call(this,d[0],this.$element[0]):this.options.placement,e=/in/.test(r),d.removeClass("top right bottom left").css({top:0,left:0,display:"block"}),i=this.getPosition(e),n=d[0].offsetWidth,o=d[0].offsetHeight,r=e?r.split(" ")[1]:r,l={top:i.top+i.height,left:i.left+i.width/2-n/2},a={top:i.top-o,left:i.left+i.width/2-n/2},c={top:i.top+i.height/2-o/2,left:i.left-n},h={top:i.top+i.height/2-o/2,left:i.left+i.width},r){case"bottom":l.top+o>t(window).scrollTop()+t(window).height()&&(r=a.top>t(window).scrollTop()?"top":h.left+nt(window).scrollLeft()?"left":"right");break;case"top":a.topt(window).scrollLeft()?"left":"right");break;case"left":c.leftt(window).scrollTop()?"top":a.top>t(window).scrollTop()?"bottom":"right");break;case"right":h.left+n>t(window).scrollLeft()+t(window).width()&&(c.left>t(window).scrollLeft()?r="left":a.top>t(window).scrollTop()?r="top":a.top>t(window).scrollTop()&&(r="bottom"))}switch(r){case"bottom":s=l;break;case"top":s=a;break;case"left":s=c;break;case"right":s=h}d.offset(s).addClass(r).addClass("in")}.call(this.container())}})}(window.jQuery),function(t){function e(){return new Date(Date.UTC.apply(Date,arguments))}function i(e,i){var n,o=t(e).data(),r={},s=new RegExp("^"+i.toLowerCase()+"([A-Z])"),i=new RegExp("^"+i.toLowerCase());for(var a in o)i.test(a)&&(n=a.replace(s,function(t,e){return e.toLowerCase()}),r[n]=o[a]);return r}function n(e){var i={};if(h[e]||(e=e.split("-")[0],h[e])){var n=h[e];return t.each(c,function(t,e){e in n&&(i[e]=n[e])}),i}}var o=function(e,i){this._process_options(i),this.element=t(e),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=t(d.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("fa-angle-left fa-angle-right")),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(t,e){return parseInt(e)+1}),this._allow_update=!1,this.setStartDate(this.o.startDate),this.setEndDate(this.o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};o.prototype={constructor:o,_process_options:function(e){this._o=t.extend({},this._o,e);var i=this.o=t.extend({},this._o),n=i.language;switch(h[n]||(n=n.split("-")[0],h[n]||(n=l.language)),i.language=n,i.startView){case 2:case"decade":i.startView=2;break;case 1:case"year":i.startView=1;break;default:i.startView=0}switch(i.minViewMode){case 1:case"months":i.minViewMode=1;break;case 2:case"years":i.minViewMode=2;break;default:i.minViewMode=0}i.startView=Math.max(i.startView,i.minViewMode),i.weekStart%=7,i.weekEnd=(i.weekStart+6)%7;var o=d.parseFormat(i.format);i.startDate!==-1/0&&(i.startDate=d.parseDate(i.startDate,o,i.language)),1/0!==i.endDate&&(i.endDate=d.parseDate(i.endDate,o,i.language)),i.daysOfWeekDisabled=i.daysOfWeekDisabled||[],t.isArray(i.daysOfWeekDisabled)||(i.daysOfWeekDisabled=i.daysOfWeekDisabled.split(/[,\s]*/)),i.daysOfWeekDisabled=t.map(i.daysOfWeekDisabled,function(t){return parseInt(t,10)})},_events:[],_secondaryEvents:[],_applyEvents:function(t){for(var e,i,n=0;nthis.o.endDate?new Date(this.o.endDate):new Date(this.date),this.fill()}},fillDow:function(){var t=this.o.weekStart,e="";if(this.o.calendarWeeks){var i=' ';e+=i,this.picker.find(".datepicker-days thead tr:first-child").prepend(i)}for(;t'+h[this.o.language].daysMin[t++%7]+"";e+="",this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;12>e;)t+=''+h[this.o.language].monthsShort[e++]+"";this.picker.find(".datepicker-months td").html(t)},setRange:function(e){e&&e.length?this.range=t.map(e,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(e){var i=[],n=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),r=this.date.valueOf(),s=new Date;return e.getUTCFullYear()n||e.getUTCFullYear()==n&&e.getUTCMonth()>o)&&i.push("new"),this.o.todayHighlight&&e.getUTCFullYear()==s.getFullYear()&&e.getUTCMonth()==s.getMonth()&&e.getUTCDate()==s.getDate()&&i.push("today"),r&&e.valueOf()==r&&i.push("active"),(e.valueOf()this.o.endDate||-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekDisabled))&&i.push("disabled"),this.range&&(e>this.range[0]&&e"),this.o.calendarWeeks)){var v=new Date(+u+864e5*((this.o.weekStart-u.getUTCDay()-7)%7)),y=new Date(+v+864e5*((11-v.getUTCDay())%7)),b=new Date(+(b=e(y.getUTCFullYear(),0,1))+864e5*((11-b.getUTCDay())%7)),x=(y-b)/864e5/7+1;m.push(''+x+"")}g=this.getClassNames(u),g.push("day");var w=this.o.beforeShowDay(u);void 0===w?w={}:"boolean"==typeof w?w={enabled:w}:"string"==typeof w&&(w={classes:w}),w.enabled===!1&&g.push("disabled"),w.classes&&(g=g.concat(w.classes.split(/\s+/))),w.tooltip&&(i=w.tooltip),g=t.unique(g),m.push('"+u.getUTCDate()+""),u.getUTCDay()==this.o.weekEnd&&m.push(""),u.setUTCDate(u.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(m.join(""));var _=this.date&&this.date.getUTCFullYear(),C=this.picker.find(".datepicker-months").find("th:eq(1)").text(o).end().find("span").removeClass("active");_&&_==o&&C.eq(this.date.getUTCMonth()).addClass("active"),(s>o||o>l)&&C.addClass("disabled"),o==s&&C.slice(0,a).addClass("disabled"),o==l&&C.slice(c+1).addClass("disabled"),m="",o=10*parseInt(o/10,10);var S=this.picker.find(".datepicker-years").find("th:eq(1)").text(o+"-"+(o+9)).end().find("td");o-=1;for(var $=-1;11>$;$++)m+='o||o>l?" disabled":"")+'">'+o+"",o+=1;S.html(m)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&e>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&e>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(i){i.preventDefault();var n=t(i.target).closest("span, td, th");if(1==n.length)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var o=d.modes[this.viewMode].navStep*("prev"==n[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,o);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,o)}this.fill();break;case"today":var r=new Date;r=e(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0),this.showMode(-2);var s="linked"==this.o.todayBtn?null:"view";this._setDate(r,s);break;case"clear":var a;this.isInput?a=this.element:this.component&&(a=this.element.find("input")),a&&a.val("").change(),this._trigger("changeDate"),this.update(),this.o.autoclose&&this.hide()}break;case"span":if(!n.is(".disabled")){if(this.viewDate.setUTCDate(1),n.is(".month")){var l=1,c=n.parent().find("span").index(n),h=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(c),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(e(h,c,l,0,0,0,0))}else{var h=parseInt(n.text(),10)||0,l=1,c=0;this.viewDate.setUTCFullYear(h),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(e(h,c,l,0,0,0,0))}this.showMode(-1),this.fill()}break;case"td":if(n.is(".day")&&!n.is(".disabled")){var l=parseInt(n.text(),10)||1,h=this.viewDate.getUTCFullYear(),c=this.viewDate.getUTCMonth();n.is(".old")?0===c?(c=11,h-=1):c-=1:n.is(".new")&&(11==c?(c=0,h+=1):c+=1),this._setDate(e(h,c,l,0,0,0,0))}}},_setDate:function(t,e){e&&"date"!=e||(this.date=new Date(t)),e&&"view"!=e||(this.viewDate=new Date(t)),this.fill(),this.setValue(),this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&(i.change(),!this.o.autoclose||e&&"date"!=e||this.hide())},moveMonth:function(t,e){if(!e)return t;var i,n,o=new Date(t.valueOf()),r=o.getUTCDate(),s=o.getUTCMonth(),a=Math.abs(e);if(e=e>0?1:-1,1==a)n=-1==e?function(){return o.getUTCMonth()==s}:function(){return o.getUTCMonth()!=i},i=s+e,o.setUTCMonth(i),(0>i||i>11)&&(i=(i+12)%12);else{for(var l=0;a>l;l++)o=this.moveMonth(o,e);i=o.getUTCMonth(),o.setUTCDate(r),n=function(){return i!=o.getUTCMonth()}}for(;n();)o.setUTCDate(--r),o.setUTCMonth(i);return o},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return 27==t.keyCode&&this.show(),void 0;var e,i,n,o=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;e=37==t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.date,e),n=this.moveYear(this.viewDate,e)):t.shiftKey?(i=this.moveMonth(this.date,e),n=this.moveMonth(this.viewDate,e)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+e),n=new Date(this.viewDate),n.setUTCDate(this.viewDate.getUTCDate()+e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;e=38==t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.date,e),n=this.moveYear(this.viewDate,e)):t.shiftKey?(i=this.moveMonth(this.date,e),n=this.moveMonth(this.viewDate,e)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+7*e),n=new Date(this.viewDate),n.setUTCDate(this.viewDate.getUTCDate()+7*e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 13:this.hide(),t.preventDefault();break;case 9:this.hide()}if(o){this._trigger("changeDate");var r;this.isInput?r=this.element:this.component&&(r=this.element.find("input")),r&&r.change()}},showMode:function(t){t&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))),this.picker.find(">div").hide().filter(".datepicker-"+d.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var r=function(e,i){this.element=t(e),this.inputs=t.map(i.inputs,function(t){return t.jquery?t[0]:t}),delete i.inputs,t(this.inputs).datepicker(i).bind("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t(e).data("datepicker")}),this.updateDates()};r.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.date}),this.updateRanges()},updateRanges:function(){var e=t.map(this.dates,function(t){return t.valueOf()});t.each(this.pickers,function(t,i){i.setRange(e)})},dateUpdated:function(e){var i=t(e.target).data("datepicker"),n=i.getUTCDate(),o=t.inArray(e.target,this.inputs),r=this.inputs.length;if(-1!=o){if(n=0&&nthis.dates[o])for(;r>o&&n>this.dates[o];)this.pickers[o++].setUTCDate(n);this.updateDates()}},remove:function(){t.map(this.pickers,function(t){t.remove()}),delete this.element.data().datepicker}};var s=t.fn.datepicker,a=t.fn.datepicker=function(e){var s=Array.apply(null,arguments);s.shift();var a;return this.each(function(){var c=t(this),h=c.data("datepicker"),d="object"==typeof e&&e;if(!h){var u=i(this,"date"),p=t.extend({},l,u,d),f=n(p.language),g=t.extend({},l,f,u,d);if(c.is(".input-daterange")||g.inputs){var m={inputs:g.inputs||c.find("input").toArray()};c.data("datepicker",h=new r(this,t.extend(g,m)))}else c.data("datepicker",h=new o(this,g))}return"string"==typeof e&&"function"==typeof h[e]&&(a=h[e].apply(h,s),void 0!==a)?!1:void 0}),void 0!==a?a:this},l=t.fn.datepicker.defaults={autoclose:!1,beforeShowDay:t.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},c=t.fn.datepicker.locale_opts=["format","rtl","weekStart"];t.fn.datepicker.Constructor=o;var h=t.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},d={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return 0===t%4&&0!==t%100||0===t%400},getDaysInMonth:function(t,e){return[31,d.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(t){var e=t.replace(this.validParts,"\0").split("\0"),i=t.match(this.validParts);if(!e||!e.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:e,parts:i}},parseDate:function(i,n,r){if(i instanceof Date)return i;if("string"==typeof n&&(n=d.parseFormat(n)),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(i)){var s,a,l=/([\-+]\d+)([dmwy])/,c=i.match(/([\-+]\d+)([dmwy])/g);i=new Date;for(var u=0;ue;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!=e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)}};v.M=v.MM=v.mm=v.m,v.dd=v.d,i=e(i.getFullYear(),i.getMonth(),i.getDate(),0,0,0);var y=n.parts.slice();if(c.length!=y.length&&(y=t(y).filter(function(e,i){return-1!==t.inArray(i,m) }).toArray()),c.length==y.length){for(var u=0,b=y.length;b>u;u++){if(p=parseInt(c[u],10),s=y[u],isNaN(p))switch(s){case"MM":f=t(h[r].months).filter(function(){var t=this.slice(0,c[u].length),e=c[u].slice(0,t.length);return t==e}),p=t.inArray(f[0],h[r].months)+1;break;case"M":f=t(h[r].monthsShort).filter(function(){var t=this.slice(0,c[u].length),e=c[u].slice(0,t.length);return t==e}),p=t.inArray(f[0],h[r].monthsShort)+1}g[s]=p}for(var x,u=0;u=s;s++)r.length&&e.push(r.shift()),e.push(o[i.parts[s]]);return e.join("")},headTemplate:'',contTemplate:'',footTemplate:''};d.template='
'+d.headTemplate+""+d.footTemplate+"
"+"
"+'
'+''+d.headTemplate+d.contTemplate+d.footTemplate+"
"+"
"+'
'+''+d.headTemplate+d.contTemplate+d.footTemplate+"
"+"
"+"
",t.fn.datepicker.DPGlobal=d,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=s,this},t(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var i=t(this);i.data("datepicker")||(e.preventDefault(),a.call(i,"show"))}),t(function(){a.call(t('[data-provide="datepicker-inline"]'))})}(window.jQuery),function(t){"use strict";t.fn.bdatepicker=t.fn.datepicker.noConflict(),t.fn.datepicker||(t.fn.datepicker=t.fn.bdatepicker);var e=function(t){this.init("date",t,e.defaults),this.initPicker(t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{initPicker:function(e,i){this.options.viewformat||(this.options.viewformat=this.options.format),e.datepicker=t.fn.editableutils.tryParseJson(e.datepicker,!0),this.options.datepicker=t.extend({},i.datepicker,e.datepicker,{format:this.options.viewformat}),this.options.datepicker.language=this.options.datepicker.language||"en",this.dpg=t.fn.bdatepicker.DPGlobal,this.parsedFormat=this.dpg.parseFormat(this.options.format),this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat)},render:function(){this.$input.bdatepicker(this.options.datepicker),this.options.clear&&(this.$clear=t('
').html(this.options.clear).click(t.proxy(function(t){t.preventDefault(),t.stopPropagation(),this.clear()},this)),this.$tpl.parent().append(t('
').append(this.$clear)))},value2html:function(t,i){var n=t?this.dpg.formatDate(t,this.parsedViewFormat,this.options.datepicker.language):"";e.superclass.value2html(n,i)},html2value:function(t){return this.parseDate(t,this.parsedViewFormat)},value2str:function(t){return t?this.dpg.formatDate(t,this.parsedFormat,this.options.datepicker.language):""},str2value:function(t){return this.parseDate(t,this.parsedFormat)},value2submit:function(t){return this.value2str(t)},value2input:function(t){this.$input.bdatepicker("update",t)},input2value:function(){return this.$input.data("datepicker").date},activate:function(){},clear:function(){this.$input.data("datepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".day",function(e){if(!t(e.currentTarget).is(".old")&&!t(e.currentTarget).is(".new")){var i=t(this).closest("form");setTimeout(function(){i.submit()},200)}})},parseDate:function(t,e){var i,n=null;return t&&(n=this.dpg.parseDate(t,e,this.options.datepicker.language),"string"==typeof t&&(i=this.dpg.formatDate(n,e,this.options.datepicker.language),t!==i&&(n=null))),n}}),e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{tpl:'
',inputclass:null,format:"yyyy-mm-dd",viewformat:null,datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:!1},clear:'clear '}),t.fn.editabletypes.date=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("datefield",t,e.defaults),this.initPicker(t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.date),t.extend(e.prototype,{render:function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$tpl.bdatepicker(this.options.datepicker),this.$input.off("focus keydown"),this.$input.keyup(t.proxy(function(){this.$tpl.removeData("date"),this.$tpl.bdatepicker("update")},this))},value2input:function(t){this.$input.val(t?this.dpg.formatDate(t,this.parsedViewFormat,this.options.datepicker.language):""),this.$tpl.bdatepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){t.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}}),e.defaults=t.extend({},t.fn.editabletypes.date.defaults,{tpl:'
',inputclass:"form-control input-medium",datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:!0}}),t.fn.editabletypes.datefield=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("datetime",t,e.defaults),this.initPicker(t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput),t.extend(e.prototype,{initPicker:function(e,i){this.options.viewformat||(this.options.viewformat=this.options.format),e.datetimepicker=t.fn.editableutils.tryParseJson(e.datetimepicker,!0),this.options.datetimepicker=t.extend({},i.datetimepicker,e.datetimepicker,{format:this.options.viewformat}),this.options.datetimepicker.language=this.options.datetimepicker.language||"en",this.dpg=t.fn.datetimepicker.DPGlobal,this.parsedFormat=this.dpg.parseFormat(this.options.format,this.options.formatType),this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat,this.options.formatType)},render:function(){this.$input.datetimepicker(this.options.datetimepicker),this.$input.on("changeMode",function(){var e=t(this).closest("form").parent();setTimeout(function(){e.triggerHandler("resize")},0)}),this.options.clear&&(this.$clear=t('').html(this.options.clear).click(t.proxy(function(t){t.preventDefault(),t.stopPropagation(),this.clear()},this)),this.$tpl.parent().append(t('
').append(this.$clear)))},value2html:function(t,i){var n=t?this.dpg.formatDate(this.toUTC(t),this.parsedViewFormat,this.options.datetimepicker.language,this.options.formatType):"";return i?(e.superclass.value2html(n,i),void 0):n},html2value:function(t){var e=this.parseDate(t,this.parsedViewFormat);return e?this.fromUTC(e):null},value2str:function(t){return t?this.dpg.formatDate(this.toUTC(t),this.parsedFormat,this.options.datetimepicker.language,this.options.formatType):""},str2value:function(t){var e=this.parseDate(t,this.parsedFormat);return e?this.fromUTC(e):null},value2submit:function(t){return this.value2str(t)},value2input:function(t){t&&this.$input.data("datetimepicker").setDate(t)},input2value:function(){var t=this.$input.data("datetimepicker");return t.date?t.getDate():null},activate:function(){},clear:function(){this.$input.data("datetimepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".minute",function(){var e=t(this).closest("form");setTimeout(function(){e.submit()},200)})},toUTC:function(t){return t?new Date(t.valueOf()-6e4*t.getTimezoneOffset()):t},fromUTC:function(t){return t?new Date(t.valueOf()+6e4*t.getTimezoneOffset()):t},parseDate:function(t,e){var i,n=null;return t&&(n=this.dpg.parseDate(t,e,this.options.datetimepicker.language,this.options.formatType),"string"==typeof t&&(i=this.dpg.formatDate(n,e,this.options.datetimepicker.language,this.options.formatType),t!==i&&(n=null))),n}}),e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{tpl:'
',inputclass:null,format:"yyyy-mm-dd hh:ii",formatType:"standard",viewformat:null,datetimepicker:{todayHighlight:!1,autoclose:!1},clear:'clear '}),t.fn.editabletypes.datetime=e}(window.jQuery),function(t){"use strict";var e=function(t){this.init("datetimefield",t,e.defaults),this.initPicker(t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.datetime),t.extend(e.prototype,{render:function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$tpl.datetimepicker(this.options.datetimepicker),this.$input.off("focus keydown"),this.$input.keyup(t.proxy(function(){this.$tpl.removeData("date"),this.$tpl.datetimepicker("update")},this))},value2input:function(t){this.$input.val(this.value2html(t)),this.$tpl.datetimepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){t.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}}),e.defaults=t.extend({},t.fn.editabletypes.datetime.defaults,{tpl:'
',inputclass:"form-control input-medium",datetimepicker:{todayHighlight:!1,autoclose:!0}}),t.fn.editabletypes.datetimefield=e}(window.jQuery),function(t){"use strict";var e=function(i){this.init("typeahead",i,e.defaults),this.options.typeahead=t.extend({},e.defaults.typeahead,{matcher:this.matcher,sorter:this.sorter,highlighter:this.highlighter,updater:this.updater},i.typeahead)};t.fn.editableutils.inherit(e,t.fn.editabletypes.list),t.extend(e.prototype,{renderList:function(){this.$input=this.$tpl.is("input")?this.$tpl:this.$tpl.find('input[type="text"]'),this.options.typeahead.source=this.sourceData,this.$input.typeahead(this.options.typeahead);var e=this.$input.data("typeahead");e.render=t.proxy(this.typeaheadRender,e),e.select=t.proxy(this.typeaheadSelect,e),e.move=t.proxy(this.typeaheadMove,e),this.renderClear(),this.setClass(),this.setAttr("placeholder")},value2htmlFinal:function(e,i){if(this.getIsObjects()){var n=t.fn.editableutils.itemsByValue(e,this.sourceData);t(i).text(n.length?n[0].text:"")}else t(i).text(e)},html2value:function(t){return t?t:null},value2input:function(e){if(this.getIsObjects()){var i=t.fn.editableutils.itemsByValue(e,this.sourceData);this.$input.data("value",e).val(i.length?i[0].text:"")}else this.$input.val(e)},input2value:function(){if(this.getIsObjects()){var e=this.$input.data("value"),i=t.fn.editableutils.itemsByValue(e,this.sourceData);return i.length&&i[0].text.toLowerCase()===this.$input.val().toLowerCase()?e:null}return this.$input.val()},getIsObjects:function(){if(void 0===this.isObjects){this.isObjects=!1;for(var t=0;t',typeahead:null,clear:!0}),t.fn.editabletypes.typeahead=e}(window.jQuery);