!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery-var-for-color","./vendor/jquery-color/jquery.color","./version"],t):t(jQuery)}(function(u){"use strict";var s,o,r,a,c,e,n,i,f,l,d="ui-effects-",h="ui-effects-style",p="ui-effects-animated";function m(t){var e,n,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,o={};if(i&&i.length&&i[0]&&i[i[0]])for(n=i.length;n--;)"string"==typeof i[e=i[n]]&&(o[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=i[e]);else for(e in i)"string"==typeof i[e]&&(o[e]=i[e]);return o}function g(t,e,n,i){return t={effect:t=u.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(i=e,n=null,e={}),"number"!=typeof e&&!u.fx.speeds[e]||(i=n,n=e,e={}),"function"==typeof n&&(i=n,n=null),e&&u.extend(t,e),n=n||e.duration,t.duration=u.fx.off?0:"number"==typeof n?n:n in u.fx.speeds?u.fx.speeds[n]:u.fx.speeds._default,t.complete=i||e.complete,t}function v(t){return!t||"number"==typeof t||u.fx.speeds[t]||"string"==typeof t&&!u.effects.effect[t]||"function"==typeof t||"object"==typeof t&&!t.effect}function y(t,e){var n=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,n,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?n:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}return u.effects={effect:{}},a=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},u.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){u.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,e,t.end),t.setAttr=!0)}}),u.fn.addBack||(u.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),u.effects.animateClass=function(o,t,e,n){var s=u.speed(t,e,n);return this.queue(function(){var n=u(this),t=n.attr("class")||"",e=(e=s.children?n.find("*").addBack():n).map(function(){return{el:u(this),start:m(this)}}),i=function(){u.each(a,function(t,e){o[e]&&n[e+"Class"](o[e])})};i(),e=e.map(function(){return this.end=m(this.el[0]),this.diff=function(t,e){var n,i,o={};for(n in e)i=e[n],t[n]===i||c[n]||!u.fx.step[n]&&isNaN(parseFloat(i))||(o[n]=i);return o}(this.start,this.end),this}),n.attr("class",t),e=e.map(function(){var t=this,e=u.Deferred(),n=u.extend({},s,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,n),e.promise()}),u.when.apply(u,e.get()).done(function(){i(),u.each(arguments,function(){var e=this.el;u.each(this.diff,function(t){e.css(t,"")})}),s.complete.call(n[0])})})},u.fn.extend({addClass:(r=u.fn.addClass,function(t,e,n,i){return e?u.effects.animateClass.call(this,{add:t},e,n,i):r.apply(this,arguments)}),removeClass:(o=u.fn.removeClass,function(t,e,n,i){return 1<arguments.length?u.effects.animateClass.call(this,{remove:t},e,n,i):o.apply(this,arguments)}),toggleClass:(s=u.fn.toggleClass,function(t,e,n,i,o){return"boolean"==typeof e||void 0===e?n?u.effects.animateClass.call(this,e?{add:t}:{remove:t},n,i,o):s.apply(this,arguments):u.effects.animateClass.call(this,{toggle:t},e,n,i)}),switchClass:function(t,e,n,i,o){return u.effects.animateClass.call(this,{add:e,remove:t},n,i,o)}}),u.expr&&u.expr.pseudos&&u.expr.pseudos.animated&&(u.expr.pseudos.animated=(e=u.expr.pseudos.animated,function(t){return!!u(t).data(p)||e(t)})),!1!==u.uiBackCompat&&u.extend(u.effects,{save:function(t,e){for(var n=0,i=e.length;n<i;n++)null!==e[n]&&t.data(d+e[n],t[0].style[e[n]])},restore:function(t,e){for(var n,i=0,o=e.length;i<o;i++)null!==e[i]&&(n=t.data(d+e[i]),t.css(e[i],n))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(n){if(n.parent().is(".ui-effects-wrapper"))return n.parent();var i={width:n.outerWidth(!0),height:n.outerHeight(!0),float:n.css("float")},t=u("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!u.contains(n[0],o)||u(o).trigger("focus"),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(u.extend(i,{position:n.css("position"),zIndex:n.css("z-index")}),u.each(["top","left","bottom","right"],function(t,e){i[e]=n.css(e),isNaN(parseInt(i[e],10))&&(i[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(i).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!u.contains(t[0],e)||u(e).trigger("focus")),t}}),u.extend(u.effects,{version:"1.13.3",define:function(t,e,n){return n||(n=e,e="effect"),u.effects.effect[t]=n,u.effects.effect[t].mode=e,n},scaledDimensions:function(t,e,n){var i;return 0===e?{height:0,width:0,outerHeight:0,outerWidth:0}:(i="horizontal"!==n?(e||100)/100:1,n="vertical"!==n?(e||100)/100:1,{height:t.height()*n,width:t.width()*i,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*i})},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,n){var i=t.queue();1<e&&i.splice.apply(i,[1,0].concat(i.splice(e,n))),t.dequeue()},saveStyle:function(t){t.data(h,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(h)||"",t.removeData(h)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var n,i;switch(t[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=t[0]/e.height}switch(t[1]){case"left":i=0;break;case"center":i=.5;break;case"right":i=1;break;default:i=t[1]/e.width}return{x:i,y:n}},createPlaceholder:function(t){var e,n=t.css("position"),i=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",e=u("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(d+"placeholder",e)),t.css({position:n,left:i.left,top:i.top}),e},removePlaceholder:function(t){var e=d+"placeholder",n=t.data(e);n&&(n.remove(),t.removeData(e))},cleanUp:function(t){u.effects.restoreStyle(t),u.effects.removePlaceholder(t)},setTransition:function(i,t,o,s){return s=s||{},u.each(t,function(t,e){var n=i.cssUnit(e);0<n[0]&&(s[e]=n[0]*o+n[1])}),s}}),u.fn.extend({effect:function(){function t(t){var e=u(this),n=u.effects.mode(e,a)||s;e.data(p,!0),c.push(n),s&&("show"===n||n===s&&"hide"===n)&&e.show(),s&&"none"===n||u.effects.saveStyle(e),"function"==typeof t&&t()}var i=g.apply(this,arguments),o=u.effects.effect[i.effect],s=o.mode,e=i.queue,n=e||"fx",r=i.complete,a=i.mode,c=[];return u.fx.off||!o?a?this[a](i.duration,r):this.each(function(){r&&r.call(this)}):!1===e?this.each(t).each(f):this.queue(n,t).queue(n,f);function f(t){var e=u(this);function n(){"function"==typeof r&&r.call(e[0]),"function"==typeof t&&t()}i.mode=c.shift(),!1===u.uiBackCompat||s?"none"===i.mode?(e[a](),n()):o.call(e[0],i,function(){e.removeData(p),u.effects.cleanUp(e),"hide"===i.mode&&e.hide(),n()}):(e.is(":hidden")?"hide"===a:"show"===a)?(e[a](),n()):o.call(e[0],i,n)}},show:(f=u.fn.show,function(t){return v(t)?f.apply(this,arguments):((t=g.apply(this,arguments)).mode="show",this.effect.call(this,t))}),hide:(i=u.fn.hide,function(t){return v(t)?i.apply(this,arguments):((t=g.apply(this,arguments)).mode="hide",this.effect.call(this,t))}),toggle:(n=u.fn.toggle,function(t){return v(t)||"boolean"==typeof t?n.apply(this,arguments):((t=g.apply(this,arguments)).mode="toggle",this.effect.call(this,t))}),cssUnit:function(t){var n=this.css(t),i=[];return u.each(["em","px","%","pt"],function(t,e){0<n.indexOf(e)&&(i=[parseFloat(n),e])}),i},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):y(this.css("clip"),this)},transfer:function(t,e){var n=u(this),i=u(t.to),o="fixed"===i.css("position"),s=u("body"),r=o?s.scrollTop():0,s=o?s.scrollLeft():0,a=i.offset(),a={top:a.top-r,left:a.left-s,height:i.innerHeight(),width:i.innerWidth()},i=n.offset(),c=u("<div class='ui-effects-transfer'></div>");c.appendTo("body").addClass(t.className).css({top:i.top-r,left:i.left-s,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(a,t.duration,t.easing,function(){c.remove(),"function"==typeof e&&e()})}}),u.fx.step.clip=function(t){t.clipInit||(t.start=u(t.elem).cssClip(),"string"==typeof t.end&&(t.end=y(t.end,t.elem)),t.clipInit=!0),u(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},l={},u.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){l[t]=function(t){return Math.pow(t,e+2)}}),u.extend(l,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),u.each(l,function(t,e){u.easing["easeIn"+t]=e,u.easing["easeOut"+t]=function(t){return 1-e(1-t)},u.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}}),u.effects});
(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("<input type='hidden'/>").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return this.validate().form();var e=!0,i=t(this[0].form).validate();return this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var i={},s=this;return t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var s=this[0];if(e){var r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return delete n[s.name],a;var u={};return t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var l=o.required;delete o.required,o=t.extend({required:l},o)}return o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){var i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var i=this.check(e)!==!1;return i?delete this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var i in e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e=0;for(var i in t)e++;return e},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" ",".");return t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var u={method:a,parameters:s[a]};try{if(i=t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return this.formatAndAdd(e,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return r?void 0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return void 0},defaultMessage:function(e,i){return this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i],"<strong>Warning: No message defined for "+e.name+"</strong>")},formatAndAdd:function(e,i){var s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e;for(t=0;this.errorList[t];t++){var i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.idOrName(e);return this.errors().filter(function(){return t(this).attr("for")===i})},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0},dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},attributeRules:function(e){var i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 0!==s&&(r[i]=s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return delete e[s],void 0;if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:delete e[s]}}),t.each(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return this.optional(e)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)},url:function(t,e){return this.optional(e)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(""+new Date(t))},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var n=t.length-1;n>=0;n--){var a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 0===i%10},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s[0]&&s[1]>=r},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{url:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var a=s===!0||"true"===s;if(a){var u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete n.invalid[i.name],n.showErrors()}else{var o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var i=t.ajax;t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arguments):void 0})}})}(jQuery);
(function($){
if($.fn.validate){
$.extend($.datepicker.regional[''], {
validateDate: 'Please enter a valid date',
validateDateMin: 'Please enter a date on or after {0}',
validateDateMax: 'Please enter a date on or before {0}',
validateDateMinMax: 'Please enter a date between {0} and {1}',
validateDateCompare: 'Please enter a date {0} {1}'
});
$.extend($.datepicker._defaults, $.datepicker.regional['']);
$.extend($.datepicker, {
errorFormat: function(inst, message, params){
var format=$.datepicker._get(inst, 'dateFormat');
$.each(params, function(i, v){
if(message){
message=message.replace(new RegExp('\\{' + i + '\\}', 'g'),
$.datepicker.formatDate(format, v)||'nothing');
}});
return message;
}});
jQuery.validator.addMethod("dateFormatDate", function(value, element, params){
lastElement=element;
var inst=$.datepicker._getInst(element);
try {
var date=$.datepicker.parseDate(window.datepickerDateFormat, value, $.datepicker._getFormatConfig(inst));
var minDate=$.datepicker._determineDate(inst, $.datepicker._get(inst, 'minDate'), null);
var maxDate=$.datepicker._determineDate(inst, $.datepicker._get(inst, 'maxDate'), null);
var beforeShowDay=$.datepicker._get(inst, 'beforeShowDay');
return this.optional(element)||!date ||
((!minDate||date >=minDate)&&(!maxDate||date <=maxDate) &&
(!beforeShowDay||beforeShowDay.apply(element, [date])[0]));
}
catch (e){
return false;
}}, function(params){
var inst=$.datepicker._getInst(lastElement);
var minDate=$.datepicker._determineDate(inst, $.datepicker._get(inst, 'minDate'), null);
var maxDate=$.datepicker._determineDate(inst, $.datepicker._get(inst, 'maxDate'), null);
var messages=$.datepicker._defaults;
return (minDate&&maxDate ?
$.datepicker.errorFormat(inst, messages.validateDateMinMax, [minDate, maxDate]) :
(minDate ? $.datepicker.errorFormat(inst, messages.validateDateMin, [minDate]) :
(maxDate ? $.datepicker.errorFormat(inst, messages.validateDateMax, [maxDate]) :
messages.validateDate)));
});
$.validator.addClassRules('dateFormatDate', {dateFormatDate: true});
}})(jQuery);
!function(e){function t(){var e=location.href;return hashtag=-1!==e.indexOf("#prettyPhoto")?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):!1,hashtag&&(hashtag=hashtag.replace(/<|>/g,"")),hashtag}function i(){"undefined"!=typeof theRel&&(location.hash=theRel+"/"+rel_index+"/")}function p(){-1!==location.href.indexOf("#prettyPhoto")&&(location.hash="prettyPhoto")}function o(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+e+"=([^&#]*)",p=new RegExp(i),o=p.exec(t);return null==o?"":o[1]}e.prettyPhoto={version:"3.1.6"},e.fn.prettyPhoto=function(a){function s(){e(".pp_loaderIcon").hide(),projectedTop=scroll_pos.scrollTop+(I/2-f.containerHeight/2),projectedTop<0&&(projectedTop=0),$ppt.fadeTo(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:f.contentHeight,width:f.contentWidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedTop,left:j/2-f.containerWidth/2<0?0:j/2-f.containerWidth/2,width:f.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(f.height).width(f.width),$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed),isSet&&"image"==h(pp_images[set_position])?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide(),settings.allow_expand&&(f.resized?e("a.pp_expand,a.pp_contract").show():e("a.pp_expand").hide()),!settings.autoplay_slideshow||P||v||e.prettyPhoto.startSlideshow(),settings.changepicturecallback(),v=!0}),m(),a.ajaxcallback()}function n(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden"),$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show(),t()})}function r(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function l(e,t){if(resized=!1,d(e,t),imageWidth=e,imageHeight=t,(k>j||b>I)&&doresize&&settings.allow_resize&&!$){for(resized=!0,fitting=!1;!fitting;)k>j?(imageWidth=j-200,imageHeight=t/e*imageWidth):b>I?(imageHeight=I-200,imageWidth=e/t*imageHeight):fitting=!0,b=imageHeight,k=imageWidth;(k>j||b>I)&&l(k,b),d(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(b),containerWidth:Math.floor(k)+2*settings.horizontal_padding,contentHeight:Math.floor(y),contentWidth:Math.floor(w),resized:resized}}function d(t,i){t=parseFloat(t),i=parseFloat(i),$pp_details=$pp_pic_holder.find(".pp_details"),$pp_details.width(t),detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom")),$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4}),detailsHeight+=$pp_details.height(),detailsHeight=detailsHeight<=34?36:detailsHeight,$pp_details.remove(),$pp_title=$pp_pic_holder.find(".ppt"),$pp_title.width(t),titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom")),$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4}),titleHeight+=$pp_title.height(),$pp_title.remove(),y=i+detailsHeight,w=t,b=y+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),k=t}function h(e){return e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)?"youtube":e.match(/vimeo\.com/i)?"vimeo":e.match(/\b.mov\b/i)?"quicktime":e.match(/\b.swf\b/i)?"flash":e.match(/\biframe=true\b/i)?"iframe":e.match(/\bajax=true\b/i)?"ajax":e.match(/\bcustom=true\b/i)?"custom":"#"==e.substr(0,1)?"inline":"image"}function c(){if(doresize&&"undefined"!=typeof $pp_pic_holder){if(scroll_pos=_(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=I/2+scroll_pos.scrollTop-contentHeight/2,projectedTop<0&&(projectedTop=0),contentHeight>I)return;$pp_pic_holder.css({top:projectedTop,left:j/2+scroll_pos.scrollLeft-contentwidth/2})}}function _(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function g(){I=e(window).height(),j=e(window).width(),"undefined"!=typeof $pp_overlay&&$pp_overlay.height(e(document).height()).width(j)}function m(){isSet&&settings.overlay_gallery&&"image"==h(pp_images[set_position])?(itemWidth=57,navWidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsPerPage=Math.floor((f.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length,totalPage=Math.ceil(pp_images.length/itemsPerPage)-1,0==totalPage?(navWidth=0,$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()):$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show(),galleryWidth=itemsPerPage*itemWidth,fullGalleryWidth=pp_images.length*itemWidth,$pp_gallery.css("margin-left",-(galleryWidth/2+navWidth/2)).find("div:first").width(galleryWidth+5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected"),goToPage=Math.floor(set_position/itemsPerPage)<totalPage?Math.floor(set_position/itemsPerPage):totalPage,e.prettyPhoto.changeGalleryPage(goToPage),$pp_gallery_li.filter(":eq("+set_position+")").addClass("selected")):$pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")}function u(){if(settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href))),settings.markup=settings.markup.replace("{pp_social}",""),e("body").append(settings.markup),$pp_pic_holder=e(".pp_pic_holder"),$ppt=e(".ppt"),$pp_overlay=e("div.pp_overlay"),isSet&&settings.overlay_gallery){currentGalleryPage=0,toInject="";for(var t=0;t<pp_images.length;t++)pp_images[t].match(/\b(jpg|jpeg|png|gif)\b/gi)?(classname="",img_src=pp_images[t]):(classname="default",img_src=""),toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>";toInject=settings.gallery_markup.replace(/{gallery}/g,toInject),$pp_pic_holder.find("#pp_full_res").after(toInject),$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li"),$pp_gallery.find(".pp_arrow_next").click(function(){return e.prettyPhoto.changeGalleryPage("next"),e.prettyPhoto.stopSlideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").click(function(){return e.prettyPhoto.changeGalleryPage("previous"),e.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()}),itemWidth=57,$pp_gallery_li.each(function(t){e(this).find("a").click(function(){return e.prettyPhoto.changePage(t),e.prettyPhoto.stopSlideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){return e.prettyPhoto.startSlideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){settings.modal||e.prettyPhoto.close()}),e("a.pp_close").bind("click",function(){return e.prettyPhoto.close(),!1}),settings.allow_expand&&e("a.pp_expand").bind("click",function(){return e(this).hasClass("pp_expand")?(e(this).removeClass("pp_expand").addClass("pp_contract"),doresize=!1):(e(this).removeClass("pp_contract").addClass("pp_expand"),doresize=!0),n(function(){e.prettyPhoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){return e.prettyPhoto.changePage("previous"),e.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){return e.prettyPhoto.changePage("next"),e.prettyPhoto.stopSlideshow(),!1}),c()}a=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,overlay_gallery_max:30,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:'<div class="pp_pic_holder"> 						<div class="ppt">&nbsp;</div> 						<div class="pp_top"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 						<div class="pp_content_container"> 							<div class="pp_left"> 							<div class="pp_right"> 								<div class="pp_content"> 									<div class="pp_loaderIcon"></div> 									<div class="pp_fade"> 										<a href="#" class="pp_expand" title="Expand the image">Expand</a> 										<div class="pp_hoverContainer"> 											<a class="pp_next" href="#">next</a> 											<a class="pp_previous" href="#">previous</a> 										</div> 										<div id="pp_full_res"></div> 										<div class="pp_details"> 											<div class="pp_nav"> 												<a href="#" class="pp_arrow_previous">Previous</a> 												<p class="currentTextHolder">0/0</p> 												<a href="#" class="pp_arrow_next">Next</a> 											</div> 											<p class="pp_description"></p> 											<div class="pp_social">{pp_social}</div> 											<a class="pp_close" href="#">Close</a> 										</div> 									</div> 								</div> 							</div> 							</div> 						</div> 						<div class="pp_bottom"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 					</div> 					<div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> 								<a href="#" class="pp_arrow_previous">Previous</a> 								<div> 									<ul> 										{gallery} 									</ul> 								</div> 								<a href="#" class="pp_arrow_next">Next</a> 							</div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:"",social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},a);var f,v,y,w,b,k,P,x=this,$=!1,I=e(window).height(),j=e(window).width();return doresize=!0,scroll_pos=_(),e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){c(),g()}),a.keyboard_shortcuts&&e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if("undefined"!=typeof $pp_pic_holder&&$pp_pic_holder.is(":visible"))switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous"),t.preventDefault();break;case 39:e.prettyPhoto.changePage("next"),t.preventDefault();break;case 27:settings.modal||e.prettyPhoto.close(),t.preventDefault()}}),e.prettyPhoto.initialize=function(){return settings=a,"pp_default"==settings.theme&&(settings.horizontal_padding=16),theRel=e(this).attr(settings.hook),galleryRegExp=/\[(?:.*)\]/,isSet=galleryRegExp.exec(theRel)?!0:!1,pp_images=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).attr("href"):void 0}):e.makeArray(e(this).attr("href")),pp_titles=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):"":void 0}):e.makeArray(e(this).find("img").attr("alt")),pp_descriptions=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).attr("title")?e(t).attr("title"):"":void 0}):e.makeArray(e(this).attr("title")),pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1),set_position=jQuery.inArray(e(this).attr("href"),pp_images),rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this)),u(this),settings.allow_resize&&e(window).bind("scroll.prettyphoto",function(){c()}),e.prettyPhoto.open(),!1},e.prettyPhoto.open=function(t){return"undefined"==typeof settings&&(settings=a,pp_images=e.makeArray(arguments[0]),pp_titles=e.makeArray(arguments[1]?arguments[1]:""),pp_descriptions=e.makeArray(arguments[2]?arguments[2]:""),isSet=pp_images.length>1?!0:!1,set_position=arguments[3]?arguments[3]:0,u(t.target)),settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),r(e(pp_images).size()),e(".pp_loaderIcon").show(),settings.deeplinking&&i(),settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href)),$pp_pic_holder.find(".pp_social").html(facebook_like_link)),$ppt.is(":hidden")&&$ppt.css("opacity",0).show(),$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity),$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size()),"undefined"!=typeof pp_descriptions[set_position]&&""!=pp_descriptions[set_position]?$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])):$pp_pic_holder.find(".pp_description").hide(),movie_width=parseFloat(o("width",pp_images[set_position]))?o("width",pp_images[set_position]):settings.default_width.toString(),movie_height=parseFloat(o("height",pp_images[set_position]))?o("height",pp_images[set_position]):settings.default_height.toString(),$=!1,-1!=movie_height.indexOf("%")&&(movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150),$=!0),-1!=movie_width.indexOf("%")&&(movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150),$=!0),$pp_pic_holder.fadeIn(function(){switch($ppt.html(settings.show_title&&""!=pp_titles[set_position]&&"undefined"!=typeof pp_titles[set_position]?unescape(pp_titles[set_position]):"&nbsp;"),imgPreloader="",skipInjection=!1,h(pp_images[set_position])){case"image":imgPreloader=new Image,nextImage=new Image,isSet&&set_position<e(pp_images).size()-1&&(nextImage.src=pp_images[set_position+1]),prevImage=new Image,isSet&&pp_images[set_position-1]&&(prevImage.src=pp_images[set_position-1]),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]),imgPreloader.onload=function(){f=l(imgPreloader.width,imgPreloader.height),s()},imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist."),e.prettyPhoto.close()},imgPreloader.src=pp_images[set_position];break;case"youtube":f=l(movie_width,movie_height),movie_id=o("v",pp_images[set_position]),""==movie_id&&(movie_id=pp_images[set_position].split("youtu.be/"),movie_id=movie_id[1],movie_id.indexOf("?")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("?"))),movie_id.indexOf("&")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("&")))),movie="http://www.youtube.com/embed/"+movie_id,movie+=o("rel",pp_images[set_position])?"?rel="+o("rel",pp_images[set_position]):"?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toInject=settings.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":f=l(movie_width,movie_height),movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/,i=movie_id.match(t);movie="http://player.vimeo.com/video/"+i[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=f.width+"/embed/?moog_width="+f.width,toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,f.height).replace(/{path}/g,movie);break;case"quicktime":f=l(movie_width,movie_height),f.height+=15,f.contentHeight+=15,f.containerHeight+=15,toInject=settings.quicktime_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":f=l(movie_width,movie_height),flash_vars=pp_images[set_position],flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length),filename=pp_images[set_position],filename=filename.substring(0,filename.indexOf("?")),toInject=settings.flash_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":f=l(movie_width,movie_height),frame_url=pp_images[set_position],frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1),toInject=settings.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,f=l(movie_width,movie_height),doresize=!0,skipInjection=!0,e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,s()});break;case"custom":f=l(movie_width,movie_height),toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('<br clear="all" />').css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(e("body")).show(),doresize=!1,f=l(e(myClone).width(),e(myClone).height()),doresize=!0,e(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html())}imgPreloader||skipInjection||($pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,s())}),!1},e.prettyPhoto.changePage=function(t){currentGalleryPage=0,"previous"==t?(set_position--,set_position<0&&(set_position=e(pp_images).size()-1)):"next"==t?(set_position++,set_position>e(pp_images).size()-1&&(set_position=0)):set_position=t,rel_index=set_position,doresize||(doresize=!0),settings.allow_expand&&e(".pp_contract").removeClass("pp_contract").addClass("pp_expand"),n(function(){e.prettyPhoto.open()})},e.prettyPhoto.changeGalleryPage=function(e){"next"==e?(currentGalleryPage++,currentGalleryPage>totalPage&&(currentGalleryPage=0)):"previous"==e?(currentGalleryPage--,currentGalleryPage<0&&(currentGalleryPage=totalPage)):currentGalleryPage=e,slide_speed="next"==e||"previous"==e?settings.animation_speed:0,slide_to=currentGalleryPage*itemsPerPage*itemWidth,$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)},e.prettyPhoto.startSlideshow=function(){"undefined"==typeof P?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){return e.prettyPhoto.stopSlideshow(),!1}),P=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)):e.prettyPhoto.changePage("next")},e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){return e.prettyPhoto.startSlideshow(),!1}),clearInterval(P),P=void 0},e.prettyPhoto.close=function(){$pp_overlay.is(":animated")||(e.prettyPhoto.stopSlideshow(),$pp_pic_holder.stop().find("object,embed").css("visibility","hidden"),e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()}),$pp_overlay.fadeOut(settings.animation_speed,function(){settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible"),e(this).remove(),e(window).unbind("scroll.prettyphoto"),p(),settings.callback(),doresize=!0,v=!1,delete settings}))},!pp_alreadyInitialized&&t()&&(pp_alreadyInitialized=!0,hashIndex=t(),hashRel=hashIndex,hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){e("a["+a.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)),this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)}}(jQuery);var pp_alreadyInitialized=!1;
;(function(b){var a={init:function(c){return this.each(function(){var d=this,h=b(d).empty();d.opt=b.extend(true,{},b.fn.raty.defaults,c);h.data("settings",d.opt);d.opt.number=a.between(d.opt.number,0,20);if(d.opt.path.substring(d.opt.path.length-1,d.opt.path.length)!="/"){d.opt.path+="/";}if(typeof d.opt.score=="function"){d.opt.score=d.opt.score.call(d);}if(d.opt.score){d.opt.score=a.between(d.opt.score,0,d.opt.number);}for(var e=1;e<=d.opt.number;e++){b("<img />",{src:d.opt.path+((!d.opt.score||d.opt.score<e)?d.opt.starOff:d.opt.starOn),alt:e,title:(e<=d.opt.hints.length&&d.opt.hints[e-1]!==null)?d.opt.hints[e-1]:e}).appendTo(d);if(d.opt.space){h.append((e<d.opt.number)?"&#160;":"");}}d.stars=h.children('img:not(".raty-cancel")');d.score=b("<input />",{type:"hidden",name:d.opt.scoreName}).appendTo(d);if(d.opt.score&&d.opt.score>0){d.score.val(d.opt.score);a.roundStar.call(d,d.opt.score);}if(d.opt.iconRange){a.fill.call(d,d.opt.score);}a.setTarget.call(d,d.opt.score,d.opt.targetKeep);var g=d.opt.space?4:0,f=d.opt.width||(d.opt.number*d.opt.size+d.opt.number*g);if(d.opt.cancel){d.cancel=b("<img />",{src:d.opt.path+d.opt.cancelOff,alt:"x",title:d.opt.cancelHint,"class":"raty-cancel"});if(d.opt.cancelPlace=="left"){h.prepend("&#160;").prepend(d.cancel);}else{h.append("&#160;").append(d.cancel);}f+=(d.opt.size+g);}if(d.opt.readOnly){a.fixHint.call(d);if(d.cancel){d.cancel.hide();}}else{h.css("cursor","pointer");a.bindAction.call(d);}h.css("width",f);});},between:function(e,d,c){return Math.min(Math.max(parseFloat(e),d),c);},bindAction:function(){var c=this,e=b(c);e.mouseleave(function(){var f=c.score.val()||undefined;a.initialize.call(c,f);a.setTarget.call(c,f,c.opt.targetKeep);if(c.opt.mouseover){c.opt.mouseover.call(c,f);}});var d=c.opt.half?"mousemove":"mouseover";if(c.opt.cancel){c.cancel.mouseenter(function(){b(this).attr("src",c.opt.path+c.opt.cancelOn);c.stars.attr("src",c.opt.path+c.opt.starOff);a.setTarget.call(c,null,true);if(c.opt.mouseover){c.opt.mouseover.call(c,null);}}).mouseleave(function(){b(this).attr("src",c.opt.path+c.opt.cancelOff);if(c.opt.mouseover){c.opt.mouseover.call(c,c.score.val()||null);}}).click(function(f){c.score.removeAttr("value");if(c.opt.click){c.opt.click.call(c,null,f);}});}c.stars.bind(d,function(g){var h=parseInt(this.alt,10);if(c.opt.half){var f=parseFloat((g.pageX-b(this).offset().left)/c.opt.size),i=(f>0.5)?1:0.5;h=parseFloat(this.alt)-1+i;a.fill.call(c,h);if(c.opt.precision){h=h-i+f;}a.showHalf.call(c,h);}else{a.fill.call(c,h);}e.data("score",h);a.setTarget.call(c,h,true);if(c.opt.mouseover){c.opt.mouseover.call(c,h,g);}}).click(function(f){c.score.val((c.opt.half||c.opt.precision)?e.data("score"):this.alt);if(c.opt.click){c.opt.click.call(c,c.score.val(),f);}});},cancel:function(c){return b(this).each(function(){var d=this,e=b(d);if(e.data("readonly")===true){return this;}if(c){a.click.call(d,null);}else{a.score.call(d,null);}d.score.removeAttr("value");});},click:function(c){return b(this).each(function(){if(b(this).data("readonly")===true){return this;}a.initialize.call(this,c);if(this.opt.click){this.opt.click.call(this,c);}else{a.error.call(this,'you must add the "click: function(score, evt){ }" callback.');}a.setTarget.call(this,c,true);});},error:function(c){b(this).html(c);b.error(c);},fill:function(k){var c=this,h=c.stars.length,g=0,d,j,f;for(var e=1;e<=h;e++){d=c.stars.eq(e-1);if(c.opt.iconRange&&c.opt.iconRange.length>g){j=c.opt.iconRange[g];if(c.opt.single){f=(e==k)?(j.on||c.opt.starOn):(j.off||c.opt.starOff);}else{f=(e<=k)?(j.on||c.opt.starOn):(j.off||c.opt.starOff);}if(e<=j.range){d.attr("src",c.opt.path+f);}if(e==j.range){g++;}}else{if(c.opt.single){f=(e==k)?c.opt.starOn:c.opt.starOff;}else{f=(e<=k)?c.opt.starOn:c.opt.starOff;}d.attr("src",c.opt.path+f);}}},fixHint:function(){var c=b(this),e=parseInt(this.score.val(),10),d=this.opt.noRatedMsg;if(!isNaN(e)&&e>0){d=(e<=this.opt.hints.length&&this.opt.hints[e-1]!==null)?this.opt.hints[e-1]:e;}c.data("readonly",true).css("cursor","default").attr("title",d);this.score.attr("readonly","readonly");this.stars.attr("title",d);},getScore:function(){var d=[],c;b(this).each(function(){c=this.score.val();d.push(c?parseFloat(c):undefined);});return(d.length>1)?d:d[0];},readOnly:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")===c){return this;}if(this.cancel){if(c){this.cancel.hide();}else{this.cancel.show();}}if(c){d.unbind();d.children("img").unbind();a.fixHint.call(this);}else{a.bindAction.call(this);a.unfixHint.call(this);}d.data("readonly",c);});},reload:function(){return a.set.call(this,{});},roundStar:function(e){var d=(e-Math.floor(e)).toFixed(2);if(d>this.opt.round.down){var c=this.opt.starOn;if(d<this.opt.round.up&&this.opt.halfShow){c=this.opt.starHalf;}else{if(d<this.opt.round.full){c=this.opt.starOff;}}this.stars.eq(Math.ceil(e)-1).attr("src",this.opt.path+c);}},score:function(){return arguments.length?a.setScore.apply(this,arguments):a.getScore.call(this);},set:function(c){this.each(function(){var d=b(this),f=d.data("settings"),e=d.clone().removeAttr("style").insertBefore(d);d.remove();e.raty(b.extend(f,c));});return b(this.selector);},setScore:function(c){return b(this).each(function(){if(b(this).data("readonly")===true){return this;}a.initialize.call(this,c);a.setTarget.call(this,c,true);});},setTarget:function(e,d){if(this.opt.target){var c=b(this.opt.target);if(c.length==0){a.error.call(this,"target selector invalid or missing!");}var f=e;if(!d||f===undefined){f=this.opt.targetText;}else{if(this.opt.targetType=="hint"){f=(f===null&&this.opt.cancel)?this.opt.cancelHint:this.opt.hints[Math.ceil(f-1)];}else{f=this.opt.precision?parseFloat(f).toFixed(1):parseInt(f,10);}}if(this.opt.targetFormat.indexOf("{score}")<0){a.error.call(this,'template "{score}" missing!');}if(e!==null){f=this.opt.targetFormat.toString().replace("{score}",f);}if(c.is(":input")){c.val(f);}else{c.html(f);}}},showHalf:function(d){var c=(d-Math.floor(d)).toFixed(1);if(c>0&&c<0.6){this.stars.eq(Math.ceil(d)-1).attr("src",this.opt.path+this.opt.starHalf);}},initialize:function(c){c=!c?0:a.between(c,0,this.opt.number);a.fill.call(this,c);if(c>0){if(this.opt.halfShow){a.roundStar.call(this,c);}this.score.val(c);}},unfixHint:function(){for(var c=0;c<this.opt.number;c++){this.stars.eq(c).attr("title",(c<this.opt.hints.length&&this.opt.hints[c]!==null)?this.opt.hints[c]:c);}b(this).data("readonly",false).css("cursor","pointer").removeAttr("title");this.score.attr("readonly","readonly");}};b.fn.raty=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments);}else{b.error("Method "+c+" does not exist!");}}};b.fn.raty.defaults={cancel:false,cancelHint:"cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good","gorgeous"],iconRange:undefined,mouseover:undefined,noRatedMsg:"not rated yet",number:5,path:window.themePath + "/images/ico",precision:false,round:{down:0.25,full:0.6,up:0.76},readOnly:false,score:undefined,scoreName:"score",single:false,size:18,space:true,starHalf:"star-half.png",starOff:"star-rating-off.png",starOn:"star-rating-on.png",target:undefined,targetFormat:"{score}",targetKeep:false,targetText:"",targetType:"hint",width:undefined};})(jQuery);
(function(w){
"use strict";
var respond={};
w.respond=respond;
respond.update=function(){};
var requestQueue=[],
xmlHttp=(function(){
var xmlhttpmethod=false;
try {
xmlhttpmethod=new w.XMLHttpRequest();
}
catch(e){
xmlhttpmethod=new w.ActiveXObject("Microsoft.XMLHTTP");
}
return function(){
return xmlhttpmethod;
};})(),
ajax=function(url, callback){
var req=xmlHttp();
if(!req){
return;
}
req.open("GET", url, true);
req.onreadystatechange=function (){
if(req.readyState!==4||req.status!==200&&req.status!==304){
return;
}
callback(req.responseText);
};
if(req.readyState===4){
return;
}
req.send(null);
},
isUnsupportedMediaQuery=function(query){
return query.replace(respond.regex.minmaxwh, '').match(respond.regex.other);
};
respond.ajax=ajax;
respond.queue=requestQueue;
respond.unsupportedmq=isUnsupportedMediaQuery;
respond.regex={
media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,
urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
only: /(only\s+)?([a-zA-Z]+)\s?/,
minw: /\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
maxw: /\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
minmaxwh: /\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,
other: /\([^\)]*\)/g
};
respond.mediaQueriesSupported=w.matchMedia&&w.matchMedia("only all")!==null&&w.matchMedia("only all").matches;
if(respond.mediaQueriesSupported){
return;
}
var doc=w.document,
docElem=doc.documentElement,
mediastyles=[],
rules=[],
appendedEls=[],
parsedSheets={},
resizeThrottle=30,
head=doc.getElementsByTagName("head")[0]||docElem,
base=doc.getElementsByTagName("base")[0],
links=head.getElementsByTagName("link"),
lastCall,
resizeDefer,
eminpx,
getEmValue=function(){
var ret,
div=doc.createElement('div'),
body=doc.body,
originalHTMLFontSize=docElem.style.fontSize,
originalBodyFontSize=body&&body.style.fontSize,
fakeUsed=false;
div.style.cssText="position:absolute;font-size:1em;width:1em";
if(!body){
body=fakeUsed=doc.createElement("body");
body.style.background="none";
}
docElem.style.fontSize="100%";
body.style.fontSize="100%";
body.appendChild(div);
if(fakeUsed){
docElem.insertBefore(body, docElem.firstChild);
}
ret=div.offsetWidth;
if(fakeUsed){
docElem.removeChild(body);
}else{
body.removeChild(div);
}
docElem.style.fontSize=originalHTMLFontSize;
if(originalBodyFontSize){
body.style.fontSize=originalBodyFontSize;
}
ret=eminpx=parseFloat(ret);
return ret;
},
applyMedia=function(fromResize){
var name="clientWidth",
docElemProp=docElem[ name ],
currWidth=doc.compatMode==="CSS1Compat"&&docElemProp||doc.body[ name ]||docElemProp,
styleBlocks={},
lastLink=links[ links.length-1 ],
now=(new Date()).getTime();
if(fromResize&&lastCall&&now - lastCall < resizeThrottle){
w.clearTimeout(resizeDefer);
resizeDefer=w.setTimeout(applyMedia, resizeThrottle);
return;
}else{
lastCall=now;
}
for(var i in mediastyles){
if(mediastyles.hasOwnProperty(i)){
var thisstyle=mediastyles[ i ],
min=thisstyle.minw,
max=thisstyle.maxw,
minnull=min===null,
maxnull=max===null,
em="em";
if(!!min){
min=parseFloat(min) *(min.indexOf(em) > -1 ?(eminpx||getEmValue()):1);
}
if(!!max){
max=parseFloat(max) *(max.indexOf(em) > -1 ?(eminpx||getEmValue()):1);
}
if(!thisstyle.hasquery||(!minnull||!maxnull)&&(minnull||currWidth >=min)&&(maxnull||currWidth <=max)){
if(!styleBlocks[ thisstyle.media ]){
styleBlocks[ thisstyle.media ]=[];
}
styleBlocks[ thisstyle.media ].push(rules[ thisstyle.rules ]);
}}
}
for(var j in appendedEls){
if(appendedEls.hasOwnProperty(j)){
if(appendedEls[ j ]&&appendedEls[ j ].parentNode===head){
head.removeChild(appendedEls[ j ]);
}}
}
appendedEls.length=0;
for(var k in styleBlocks){
if(styleBlocks.hasOwnProperty(k)){
var ss=doc.createElement("style"),
css=styleBlocks[ k ].join("\n");
ss.type="text/css";
ss.media=k;
head.insertBefore(ss, lastLink.nextSibling);
if(ss.styleSheet){
ss.styleSheet.cssText=css;
}else{
ss.appendChild(doc.createTextNode(css));
}
appendedEls.push(ss);
}}
},
translate=function(styles, href, media){
var qs=styles.replace(respond.regex.comments, '')
.replace(respond.regex.keyframes, '')
.match(respond.regex.media),
ql=qs&&qs.length||0;
href=href.substring(0, href.lastIndexOf("/"));
var repUrls=function(css){
return css.replace(respond.regex.urls, "$1" + href + "$2$3");
},
useMedia = !ql&&media;
if(href.length){ href +="/"; }
if(useMedia){
ql=1;
}
for(var i=0; i < ql; i++){
var fullq, thisq, eachq, eql;
if(useMedia){
fullq=media;
rules.push(repUrls(styles));
}else{
fullq=qs[ i ].match(respond.regex.findStyles)&&RegExp.$1;
rules.push(RegExp.$2&&repUrls(RegExp.$2));
}
eachq=fullq.split(",");
eql=eachq.length;
for(var j=0; j < eql; j++){
thisq=eachq[ j ];
if(isUnsupportedMediaQuery(thisq)){
continue;
}
mediastyles.push({
media:thisq.split("(")[ 0 ].match(respond.regex.only)&&RegExp.$2||"all",
rules:rules.length - 1,
hasquery:thisq.indexOf("(") > -1,
minw:thisq.match(respond.regex.minw)&&parseFloat(RegExp.$1) +(RegExp.$2||""),
maxw:thisq.match(respond.regex.maxw)&&parseFloat(RegExp.$1) +(RegExp.$2||"")
});
}}
applyMedia();
},
makeRequests=function(){
if(requestQueue.length){
var thisRequest=requestQueue.shift();
ajax(thisRequest.href, function(styles){
translate(styles, thisRequest.href, thisRequest.media);
parsedSheets[ thisRequest.href ]=true;
w.setTimeout(function(){ makeRequests(); },0);
});
}},
ripCSS=function(){
for(var i=0; i < links.length; i++){
var sheet=links[ i ],
href=sheet.href,
media=sheet.media,
isCSS=sheet.rel&&sheet.rel.toLowerCase()==="stylesheet";
if(!!href&&isCSS&&!parsedSheets[ href ]){
if(sheet.styleSheet&&sheet.styleSheet.rawCssText){
translate(sheet.styleSheet.rawCssText, href, media);
parsedSheets[ href ]=true;
}else{
if((!/^([a-zA-Z:]*\/\/)/.test(href)&&!base) ||
href.replace(RegExp.$1, "").split("/")[0]===w.location.host){
if(href.substring(0,2)==="//"){ href=w.location.protocol + href; }
requestQueue.push({
href: href,
media: media
});
}}
}}
makeRequests();
};
ripCSS();
respond.update=ripCSS;
respond.getEmValue=getEmValue;
function callMedia(){
applyMedia(true);
}
if(w.addEventListener){
w.addEventListener("resize", callMedia, false);
}
else if(w.attachEvent){
w.attachEvent("onresize", callMedia);
}})(this);
(function($){
$(document).ready(function (){
bookyourtravel_scripts.init();
});
$(window).load(function(){
bookyourtravel_scripts.load();
});
var bookyourtravel_scripts={
init: function (){
$('.toggle_lightbox').on('click', function(e){
var isLoginLightbox=$(this).hasClass('login_lightbox');
var isRegisterLightbox=$(this).hasClass('register_lightbox');
if(!isLoginLightbox&&$('#login_lightbox').is(":visible")){
$('#login_lightbox').hide();
}
else if(!isRegisterLightbox&&$('#register_lightbox').is(":visible")){
$('#register_lightbox').hide();
}
if(isRegisterLightbox){
$('#register_lightbox').toggle(500);
}
if(isLoginLightbox){
$('#login_lightbox').toggle(500);
}});
$("input[type=radio]").uniform();
$("input[type=checkbox]").uniform();
$("select").not(".dynamic_control,.woocommerce select").uniform();
$("input[type=checkbox]").not(".woocommerce-checkout input[type=checkbox]").uniform();
$('.scroll-to-top').click(function (){
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
$('.ribbon .profile-nav li').hide();
$('.ribbon .profile-nav .active').show();
$(".ribbon li a").click(bookyourtravel_scripts.handleRibbonClick);
$("a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square'});
$(".tab-content").hide();
$(".tab-content.initial").show();
var activeIndex=$('.inner-nav li.active').index();
var currentMenuItemIndex=$('.inner-nav li.current-menu-item').index();
if(activeIndex==-1)
$(".inner-nav li:first").addClass("active");
if(currentMenuItemIndex > -1){
$(".inner-nav li").removeClass("active");
}
$(".inner-nav a").click(function(e){
$(".inner-nav li").removeClass("active");
$(this).parent().addClass("active");
var currentTab=$(this).attr("href");
$(".tab-content").hide();
$(currentTab).show();
if(currentTab=="#location"||currentTab=="#map"){
window.InitializeMap();
$mapIframe=$('.gmap iframe');
if(typeof ($mapIframe)!='undefined'&&$mapIframe.length > 0){
$mapIframe.attr('src', $mapIframe.attr('src'));
}}
e.preventDefault();
});
var hash=window.location.hash;
if(hash.length > 0){
var hashbang=hash.replace('#', '');
if(hashbang.length > 0){
var anchor=$('.inner-nav li a[href="#' + hashbang + '"]');
if(anchor.length > 0){
var li=anchor.parent();
if(li.length > 0){
$(".inner-nav li").removeClass('active');
li.addClass('active');
$(".tab-content").hide();
$(".tab-content#" + hashbang).show();
}}
}}
$(".more-information").slideUp();
$(".more-info").click(function(e){
var moreinformation=$(this).closest("li").find(".more-information");
var txt=moreinformation.is(':visible') ? window.moreInfoText:window.lessInfoText;
$(this).text(txt);
moreinformation.stop(true, true).slideToggle("slow");
e.preventDefault();
});
$(".f-item .radio").click(function(e){
$(".f-item").removeClass("active");
$(this).parent().addClass("active");
});
$('.grid-view').click(function(e){
var currentClass=$(".three-fourth article").attr("class");
if(typeof currentClass!='undefined'&&currentClass.length > 0){
currentClass=currentClass.replace('last', '');
currentClass=currentClass.replace('full-width', window.itemClass);
$(".three-fourth article").attr("class", currentClass);
$(".view-type li").removeClass("active");
$(this).addClass("active");
bookyourtravel_scripts.resizeFluidItems();
}
e.preventDefault();
});
$('.list-view').click(function(e){
var currentClass=$(".three-fourth article").attr("class");
if(typeof currentClass!='undefined'&&currentClass.length > 0){
currentClass=currentClass.replace('last', '');
currentClass=currentClass.replace(window.itemClass, 'full-width');
$(".three-fourth article").attr("class", currentClass);
$(".view-type li").removeClass("active");
$(this).addClass("active");
}
e.preventDefault();
});
if(window.defaultResultsView===0)
$('.view-type li.grid-view').trigger('click');
else
$('.view-type li.list-view').trigger('click');
},
load:function (){
bookyourtravel_scripts.resizeFluidItems();
},
resizeFluidItems: function(){
bookyourtravel_scripts.resizeFluidItem(".one-half.accommodation_item,.one-third.accommodation_item,.one-fourth.accommodation_item,.one-fifth.accommodation_item");
bookyourtravel_scripts.resizeFluidItem(".one-half.location_item,.one-third.location_item,.one-fourth.location_item,.one-fifth.location_item");
bookyourtravel_scripts.resizeFluidItem(".one-half.tour_item,.one-third.tour_item,.one-fourth.tour_item,.one-fifth.tour_item");
bookyourtravel_scripts.resizeFluidItem(".one-half.car_rental_item,.one-third.car_rental_item,.one-fourth.car_rental_item,.one-fifth.car_rental_item");
bookyourtravel_scripts.resizeFluidItem(".one-half.cruise_item,.one-third.cruise_item,.one-fourth.cruise_item,.one-fifth.cruise_item");
},
handleRibbonClick:function (e){
if($(this).hasClass('fn')){
return true;
}
else if(!$(this).hasClass('.lang_sel_sel,.lang_sel_other')&&$(this).closest("#lang_sel,#lang_sel_list,.wpml-ls").length > 0){
return true;
}else{
$(".ribbon .profile-nav li").hide();
if($(this).parent().parent().hasClass('open'))
$(this).parent().parent().removeClass('open');
else {
$(".ribbon .profile-nav").removeClass('open');
$(this).parent().parent().addClass('open');
}
$(this).parent().siblings().each(function(){
$(this).removeClass('active');
});
$(this).parent().attr('class', 'active');
$('.ribbon .profile-nav li.active').show();
$('.ribbon .profile-nav.open li').show();
return false;
}},
resizeFluidItem:function (filters){
var filterArray=filters.split(',');
var arrayLength=filterArray.length;
for (var i=0; i < arrayLength; i++){
var filter=filterArray[i];
var maxHeight=0;
$(filter + " .details").each(function(){
if($(this).height() > maxHeight){
maxHeight=$(this).height();
}});
$(filter + ":not(.fluid-item) .details").height(maxHeight);
}}
};})(jQuery);
if(!String.prototype.format){
String.prototype.format=function(){
var args=arguments;
return this.replace(/{(\d+)}/g, function(match, number){
return typeof args[number]!='undefined' ? args[number]:match;
});
};}
window.RedrawMap=(function(){
google.maps.event.trigger(MapInstance,'resize');
});
window.InitializeMap=(function(){
if(typeof window.entityLatitude!='undefined' &&
typeof window.entityLongitude!='undefined' &&
window.entityLatitude.length > 0 &&
window.entityLongitude.length > 0){
var latLong=new google.maps.LatLng(window.entityLatitude, window.entityLongitude);
var myMapOptions={
zoom: 15,
center: latLong,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var theMap=new google.maps.Map(document.getElementById("map_canvas"), myMapOptions);
google.maps.event.trigger(theMap, 'resize');
var marker=new google.maps.Marker({
map: theMap,
draggable: true,
position: new google.maps.LatLng(window.entityLatitude, window.entityLongitude),
visible: true
});
var boxText=document.createElement("div");
boxText.innerHTML=window.entityInfoboxText;
var myOptions={
content: boxText,
disableAutoPan: false,
maxWidth: 0,
pixelOffset: new google.maps.Size(-163, -32),
zIndex: null,
closeBoxURL: "",
infoBoxClearance: new google.maps.Size(1, 1),
isHidden: false,
pane: "floatPane",
enableEventPropagation: false
};
google.maps.event.addListener(marker, "click", function (e){
ib.open(theMap, this);
});
var ib=new InfoBox(myOptions);
ib.open(theMap, marker);
}});
Object.size=function(obj){
var size=0, key;
for (key in obj){
if(obj.hasOwnProperty(key)) size++;
}
return size;
};
;
(function ($, undefined){
"use strict";
var defaults={
item: 3,
autoWidth: false,
slideMove: 1,
slideMargin: 10,
addClass: '',
mode: "slide",
useCSS: true,
cssEasing: 'ease', //'cubic-bezier(0.25, 0, 0.25, 1)',//
easing: 'linear', //'for jquery animation',//
speed: 400, //ms'
auto: false,
loop: false,
slideEndAnimatoin: true,
pause: 2000,
keyPress: false,
controls: true,
prevHtml: '',
nextHtml: '',
rtl: false,
adaptiveHeight: false,
vertical: false,
verticalHeight: 500,
vThumbWidth: 100,
thumbItem: 10,
pager: true,
gallery: false,
galleryMargin: 5,
thumbMargin: 5,
currentPagerPosition: 'middle',
enableTouch: true,
enableDrag: true,
freeMove: true,
swipeThreshold: 40,
responsive: [],
onBeforeStart: function ($el){},
onSliderLoad: function ($el){},
onBeforeSlide: function ($el, scene){},
onAfterSlide: function ($el, scene){},
onBeforeNextSlide: function ($el, scene){},
onBeforePrevSlide: function ($el, scene){}};
$.fn.lightSlider=function (options){
if(this.length===0){
return this;
}
if(this.length > 1){
this.each(function (){
$(this).lightSlider(options);
});
return this;
}
var plugin={},
settings=$.extend(true, {}, defaults, options),
settingsTemp={},
$el=this;
plugin.$el=this;
if(settings.mode==='fade'){
settings.vertical=false;
}
var $children=$el.children(),
windowW=$(window).width(),
breakpoint=null,
resposiveObj=null,
length=0,
w=0,
on=false,
elSize=0,
$slide='',
scene=0,
property=(settings.vertical===true) ? "height":"width",
gutter=(settings.vertical===true) ? "margin-bottom":"margin-right",
slideValue=0,
pagerWidth=0,
slideWidth=0,
thumbWidth=0,
interval=null,
isTouch=('ontouchstart' in document.documentElement);
var refresh=new Object();
refresh.chbreakpoint=function (){
windowW=$(window).width();
if(settings.responsive.length){
if(settings.autoWidth===false){
var item=settings.item;
}
if(windowW < settings.responsive[0].breakpoint){
for (var i=0; i < settings.responsive.length; i++){
if(windowW < settings.responsive[i].breakpoint){
breakpoint=settings.responsive[i].breakpoint;
resposiveObj=settings.responsive[i];
}}
}
if(typeof resposiveObj!=="undefined"&&resposiveObj!=null){
for (i in resposiveObj.settings){
if(typeof settingsTemp[i]=="undefined"||settingsTemp[i]==null){
settingsTemp[i]=settings[i];
}
settings[i]=resposiveObj.settings[i];
}}
if(!$.isEmptyObject(settingsTemp)&&windowW > settings.responsive[0].breakpoint){
for (i in settingsTemp){
settings[i]=settingsTemp[i];
}}
if(settings.autoWidth===false){
if(slideValue > 0&&slideWidth > 0){
if(item!==settings.item){
scene=Math.round(slideValue / ((slideWidth + settings.slideMargin) * settings.slideMove));
}}
}}
};
refresh.calSW=function (){
if(settings.autoWidth===false){
slideWidth=(elSize - ((settings.item * (settings.slideMargin)) - settings.slideMargin)) / settings.item;
}};
refresh.calWidth=function (cln){
var ln=cln===true ? $slide.find('.lslide').length:$children.length;
if(settings.autoWidth===false){
w=ln * (slideWidth + settings.slideMargin);
}else{
w=0;
for (var i=0; i < ln; i++){
w +=(parseInt($children.eq(i).width()) + settings.slideMargin);
}}
if(w % 1!==0){
w=w + 1;
}
return w;
};
plugin={
doCss: function (){
var support=function (){
var transition=['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
var root=document.documentElement;
for (var i=0; i < transition.length; i++){
if(transition[i] in root.style){
return true;
}}
};
if(settings.useCSS&&support()){
return true;
}
return false;
},
keyPress: function (){
if(settings.keyPress){
$(document).on('keyup.lightslider', function (e){
e.preventDefault();
if(e.keyCode===37){
$el.goToPrevSlide();
clearInterval(interval);
}else if(e.keyCode===39){
$el.goToNextSlide();
clearInterval(interval);
}});
}},
controls: function (){
if(settings.controls){
$el.after('<div class="lSAction"><a class="lSPrev">' + settings.prevHtml + '</a><a class="lSNext">' + settings.nextHtml + '</a></div>');
if(!settings.autoWidth){
if(length <=settings.item){
$slide.find('.lSAction').hide();
}}else{
if(refresh.calWidth(false) < elSize){
$slide.find('.lSAction').hide();
}}
$slide.find('.lSAction a').on('click', function (e){
e.preventDefault();
if($(this).attr('class')==='lSPrev'){
$el.goToPrevSlide();
}else{
$el.goToNextSlide();
}
clearInterval(interval);
return false;
});
}},
initialStyle: function (){
var $this=this;
if(settings.mode==='fade'){
settings.autoWidth=false;
settings.slideEndAnimatoin=false;
}
if(settings.auto){
settings.slideEndAnimatoin=false;
};
if(settings.autoWidth){
settings.slideMove=1;
settings.item=1;
}
if(settings.loop){
settings.slideMove=1;
settings.freeMove=false;
}
settings.onBeforeStart.call(this, $el);
refresh.chbreakpoint();
$el.addClass('lightSlider').wrap("<div class='lSSlideOuter " + settings.addClass + "'><div class='lSSlideWrapper'></div></div>");
$slide=$el.parent('.lSSlideWrapper');
if(settings.rtl===true){
$slide.parent().addClass('lSrtl');
}
if(settings.vertical){
$slide.parent().addClass('vertical');
elSize=settings.verticalHeight;
$slide.css('height', elSize + 'px');
}else{
elSize=$el.outerWidth();
}
$children.addClass('lslide');
if(settings.loop===true&&settings.mode==='slide'){
refresh.calSW();
refresh.clone=function (){
if(refresh.calWidth(true) > elSize){
var tWr=0,
tI=0;
for (var k=0; k < $children.length; k++){
tWr +=(parseInt($el.find('.lslide').eq(k).width()) + settings.slideMargin);
tI++;
if(tWr >=(elSize + settings.slideMargin)){
break;
}}
var tItem=settings.autoWidth===true ? tI:settings.item;
if(tItem < $el.find('.clone.left').length){
for (var i=0; i < $el.find('.clone.left').length - tItem; i++){
$children.eq(i).remove();
}}
if(tItem < $el.find('.clone.right').length){
for (var j=$children.length - 1; j > ($children.length - 1 - $el.find('.clone.right').length); j--){
scene--;
$children.eq(j).remove();
}}
for (var k=$el.find('.clone.right').length; k < tItem; k++){
$el.find('.lslide').eq(k).clone().removeClass('lslide').addClass('clone right').appendTo($el);
scene++;
}
for (var m=$el.find('.lslide').length - $el.find('.clone.left').length; m > ($el.find('.lslide').length - tItem); m--){
$el.find('.lslide').eq(m - 1).clone().removeClass('lslide').addClass('clone left').prependTo($el);
}
$children=$el.children();
}else{
if($children.hasClass('clone')){
$el.find('.clone').remove();
$this.move($el, 0);
}}
};
refresh.clone();
}
refresh.sSW=function (){
length=$children.length;
if(settings.rtl===true&&settings.vertical===false){
gutter="margin-left";
}
if(settings.autoWidth===false){
$children.css(property, slideWidth + 'px');
}
$children.css(gutter, settings.slideMargin + 'px');
w=refresh.calWidth(false);
$el.css(property, w + 'px');
if(settings.loop===true&&settings.mode==='slide'){
if(on===false){
scene=$el.find('.clone.left').length;
}}
};
refresh.calL=function (){
$children=$el.children();
length=$children.length;
};
if(this.doCss()){
$slide.addClass('usingCss');
}
refresh.calL();
if(settings.mode==="slide"){
refresh.calSW();
refresh.sSW();
if(settings.loop===true){
slideValue=$this.slideValue();
this.move($el, slideValue);
}
if(settings.vertical===false){
this.setHeight($el, false, true);
}}else{
this.setHeight($el, true, true);
$el.addClass('lSFade');
if(!this.doCss()){
$children.not(".active").css('display', 'none');
}}
if(settings.loop===true&&settings.mode==='slide'){
$children.eq(scene).addClass('active');
}else{
$children.first().addClass('active');
}},
pager: function (){
var $this=this;
refresh.createPager=function (){
thumbWidth=(elSize - ((settings.thumbItem * (settings.thumbMargin)) - settings.thumbMargin)) / settings.thumbItem;
var $children=$slide.find('.lslide');
var length=$slide.find('.lslide').length;
var i=0,
pagers='',
v=0;
for (i=0; i < length; i++){
if(settings.mode==='slide'){
if(!settings.autoWidth){
v=i * ((slideWidth + settings.slideMargin) * settings.slideMove);
}else{
v +=((parseInt($children.eq(i).width()) + settings.slideMargin) * settings.slideMove);
}}
var thumb=$children.eq(i * settings.slideMove).attr('data-thumb');
if(settings.gallery===true){
pagers +='<li style="width:100%;' + property + ':' + thumbWidth + 'px;' + gutter + ':' + settings.thumbMargin + 'px"><a href="#"><img src="' + thumb + '" /></a></li>';
}else{
pagers +='<li><a href="#">' + (i + 1) + '</a></li>';
}
if(settings.mode==='slide'){
if((v) >=w - elSize - settings.slideMargin){
i=i + 1;
var minPgr=2;
if(settings.autoWidth){
pagers +='<li><a href="#">' + (i + 1) + '</a></li>';
minPgr=1;
}
if(i < minPgr){
pagers=null;
$slide.parent().addClass('noPager');
}else{
$slide.parent().removeClass('noPager');
}
break;
}}
}
var $cSouter=$slide.parent();
$cSouter.find('.lSPager').html(pagers);
if(!settings.vertical&&settings.gallery){
var $pgr=$slide.parent().find('.lSGallery');
setTimeout(function (){
$this.setHeight($pgr, false, false);
});
}
if(settings.gallery===true){
if(settings.vertical===true){
$cSouter.find('.lSPager').css('width', settings.vThumbWidth + 'px');
}
pagerWidth=(i * (settings.thumbMargin + thumbWidth)) + 0.5;
$cSouter.find('.lSPager').css({
property: pagerWidth + 'px',
'transition-duration': settings.speed + 'ms'
});
if(settings.vertical===true){
$slide.parent().css('padding-right', (settings.vThumbWidth + settings.galleryMargin) + 'px');
}
$cSouter.find('.lSPager').css(property, pagerWidth + 'px');
}
var $pager=$cSouter.find('.lSPager').find('li');
$pager.first().addClass('active');
$pager.on('click', function (){
if(settings.loop===true&&settings.mode==='slide'){
scene=scene + ($pager.index(this) - $cSouter.find('.lSPager').find('li.active').index());
}else{
scene=$pager.index(this);
}
$el.mode(false);
if(settings.gallery===true){
$this.slideThumb();
}
clearInterval(interval);
return false;
});
};
if(settings.pager){
var cl='lSpg';
if(settings.gallery){
cl='lSGallery';
}
$slide.after('<ul class="lSPager ' + cl + '"></ul>');
var gMargin=(settings.vertical) ? "margin-left":"margin-top";
$slide.parent().find('.lSPager').css(gMargin, settings.galleryMargin + 'px');
refresh.createPager();
}
setTimeout(function (){
refresh.init();
}, 0);
},
setHeight: function (ob, fade, loop){
var obj=null;
if(loop){
obj=ob.children(".lslide ").first();
}else{
obj=ob.children().first();
}
var setCss=function (){
var tH=obj.height(),
tP=0,
tHT=tH;
if(fade){
tH=0;
tP=((tHT) * 100) / elSize;
}
ob.css({
'height': tH + 'px',
'padding-bottom': tP + '%'
});
};
setCss();
obj.find('img').load(function (){
setTimeout(function(){
setCss();
},100);
});
},
active: function (ob, t){
if(this.doCss()&&settings.mode==="fade"){
$slide.addClass('on');
}
var sc=0;
if(scene * settings.slideMove < length){
ob.removeClass('active');
if(!this.doCss()&&settings.mode==="fade"&&t===false){
ob.fadeOut(settings.speed);
}
t===true ? sc=scene:sc=scene * settings.slideMove;
if(t===true){
var l=ob.length;
var nl=l - 1;
if(sc + 1 >=l){
sc=nl;
}}
if(settings.loop===true&&settings.mode==='slide'){
t===true ? sc=scene - $el.find('.clone.left').length:sc=scene * settings.slideMove;
if(t===true){
var l=ob.length;
var nl=l - 1;
if(sc + 1==l){
sc=nl;
}else if(sc + 1 > l){
sc=0;
}}
}
if(!this.doCss()&&settings.mode==="fade"&&t===false){
ob.eq(sc).fadeIn(settings.speed);
}
ob.eq(sc).addClass('active');
}else{
ob.removeClass('active');
ob.eq(ob.length - 1).addClass('active');
if(!this.doCss()&&settings.mode==="fade"&&t===false){
ob.fadeOut(settings.speed);
ob.eq(sc).fadeIn(settings.speed);
}}
},
move: function (ob, v){
if(settings.rtl===true){
v=-v;
}
if(this.doCss()){
if(settings.vertical===true){
ob.css({
'transform': 'translate3d(0px, ' + (-v) + 'px, 0px)',
'-webkit-transform': 'translate3d(0px, ' + (-v) + 'px, 0px)'
});
}else{
ob.css({
'transform': 'translate3d(' + (-v) + 'px, 0px, 0px)',
'-webkit-transform': 'translate3d(' + (-v) + 'px, 0px, 0px)',
});
}}else{
if(settings.vertical===true){
ob.css('position', 'relative').animate({
top: -v + 'px'
}, settings.speed, settings.easing);
}else{
ob.css('position', 'relative').animate({
left: -v + 'px'
}, settings.speed, settings.easing);
}}
var $thumb=$slide.parent().find('.lSPager').find('li');
this.active($thumb, true);
},
fade: function (){
this.active($children, false);
var $thumb=$slide.parent().find('.lSPager').find('li');
this.active($thumb, true);
},
slide: function (){
var $this=this;
refresh.calSlide=function (){
if(w > elSize){
slideValue=$this.slideValue();
$this.active($children, false);
if((slideValue) > w - elSize - settings.slideMargin){
slideValue=w - elSize - settings.slideMargin;
}else if(slideValue < 0){
slideValue=0;
}
$this.move($el, slideValue);
if(settings.loop===true&&settings.mode==='slide'){
if(scene >=(length - ($el.find('.clone.left').length / settings.slideMove))){
$this.resetSlide($el.find('.clone.left').length);
}
if(scene===0){
$this.resetSlide($slide.find('.lslide').length);
}}
}};
refresh.calSlide();
},
resetSlide: function (s){
var $this=this;
$slide.find('.lSAction a').addClass('disabled');
setTimeout(function (){
scene=s;
$slide.css('transition-duration', '0ms');
slideValue=$this.slideValue();
$this.active($children, false);
plugin.move($el, slideValue);
setTimeout(function (){
$slide.css('transition-duration', settings.speed + 'ms');
$slide.find('.lSAction a').removeClass('disabled');
}, 50);
}, settings.speed + 100);
},
slideValue: function (){
var _sV=0;
if(settings.autoWidth===false){
_sV=scene * ((slideWidth + settings.slideMargin) * settings.slideMove);
}else{
_sV=0;
for (var i=0; i < scene; i++){
_sV +=(parseInt($children.eq(i).width()) + settings.slideMargin);
}}
return _sV;
},
slideThumb: function (){
var position;
switch (settings.currentPagerPosition){
case 'left':
position=0;
break;
case 'middle':
position=(elSize / 2) - (thumbWidth / 2);
break;
case 'right':
position=elSize - thumbWidth;
}
var sc=scene - $el.find('.clone.left').length;
var $pager=$slide.parent().find('.lSPager');
if(settings.mode==='slide'&&settings.loop===true){
if(sc >=$pager.children().length){
sc=0;
}else if(sc < 0){
sc=$pager.children().length;
}}
var thumbSlide=sc * ((thumbWidth + settings.thumbMargin)) - (position);
if((thumbSlide + elSize) > pagerWidth){
thumbSlide=pagerWidth - elSize - settings.thumbMargin;
}
if(thumbSlide < 0){
thumbSlide=0;
}
this.move($pager, thumbSlide);
},
auto: function (){
if(settings.auto){
interval=setInterval(function (){
$el.goToNextSlide();
}, settings.pause);
}},
touchMove: function (endCoords, startCoords){
$slide.css('transition-duration', '0ms');
if(settings.mode==='slide'){
var distance=endCoords - startCoords;
var swipeVal=slideValue - distance;
if((swipeVal) >=w - elSize - settings.slideMargin){
if(settings.freeMove===false){
swipeVal=w - elSize - settings.slideMargin;
}else{
var swipeValT=w - elSize - settings.slideMargin;
swipeVal=swipeValT + ((swipeVal - swipeValT) / 5);
}}else if(swipeVal < 0){
if(settings.freeMove===false){
swipeVal=0;
}else{
swipeVal=swipeVal / 5;
}}
this.move($el, swipeVal);
}},
touchEnd: function (distance){
$slide.css('transition-duration', settings.speed + 'ms');
clearInterval(interval);
if(settings.mode==='slide'){
var mxVal=false;
var _next=true;
slideValue=slideValue - distance;
if((slideValue) > w - elSize - settings.slideMargin){
slideValue=w - elSize - settings.slideMargin;
if(settings.autoWidth===false){
mxVal=true;
}}else if(slideValue < 0){
slideValue=0;
}
var gC=function (next){
var ad=0;
if(!mxVal){
if(next){
ad=1;
};}
if(!settings.autoWidth){
var num=slideValue / ((slideWidth + settings.slideMargin) * settings.slideMove);
scene=parseInt(num) + ad;
if(slideValue >=(w - elSize - settings.slideMargin)){
if(num % 1!==0){
scene++;
}}
}else{
var tW=0;
for (var i=0; i < $children.length; i++){
tW +=(parseInt($children.eq(i).width()) + settings.slideMargin);
scene=i + ad;
if(tW >=slideValue){
break;
}}
}};
if(distance >=settings.swipeThreshold){
gC(false);
_next=false;
}else if(distance <=-settings.swipeThreshold){
gC(true);
_next=false;
}
$el.mode(_next);
this.slideThumb();
}else{
if(distance >=settings.swipeThreshold){
$el.goToPrevSlide();
}else if(distance <=-settings.swipeThreshold){
$el.goToNextSlide();
}}
},
enableDrag: function (){
var $this=this;
if(!isTouch){
var startCoords=0,
endCoords=0,
isDraging=false;
$slide.on('mousedown', function (e){
if(w < elSize){
if(w!==0){
return false;
}}
if($(e.target).attr('class')!==('lSPrev')&&$(e.target).attr('class')!==('lSNext')){
startCoords=(settings.vertical===true) ? e.pageY:e.pageX;
isDraging=true;
e.preventDefault();
}});
$(window).on('mousemove', function (e){
if(isDraging){
endCoords=(settings.vertical===true) ? e.pageY:e.pageX;
$this.touchMove(endCoords, startCoords);
}});
$(window).on('mouseup', function (e){
if(isDraging){
isDraging=false;
endCoords=(settings.vertical===true) ? e.pageY:e.pageX;
var distance=endCoords - startCoords;
if(Math.abs(distance) >=settings.swipeThreshold){
$(window).on('click.ls', function(e){
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
$(window).off('click.ls');
});
}
$this.touchEnd(distance);
}});
}},
enableTouch: function (){
var $this=this;
if(isTouch){
var startCoords={},
endCoords={};
$slide.on('touchstart', function (e){
endCoords=e.originalEvent.targetTouches[0];
startCoords.pageX=e.originalEvent.targetTouches[0].pageX;
startCoords.pageY=e.originalEvent.targetTouches[0].pageY;
});
$slide.on('touchmove', function (e){
if(w < elSize){
if(w!==0){
return false;
}}
var orig=e.originalEvent;
endCoords=orig.targetTouches[0];
var xMovement=Math.abs(endCoords.pageX - startCoords.pageX);
var yMovement=Math.abs(endCoords.pageY - startCoords.pageY);
if(settings.vertical===true){
if((yMovement * 3) > xMovement){
e.preventDefault();
}
$this.touchMove(endCoords.pageY, startCoords.pageY);
}else{
if((xMovement * 3) > yMovement){
e.preventDefault();
}
$this.touchMove(endCoords.pageX, startCoords.pageX);
}});
$slide.on('touchend', function (){
if(w < elSize){
if(w!==0){
return false;
}}
if(settings.vertical===true){
var distance=endCoords.pageY - startCoords.pageY;
}else{
var distance=endCoords.pageX - startCoords.pageX;
}
$this.touchEnd(distance);
});
}},
build: function (){
var $this=this;
$this.initialStyle();
$this.auto();
if(this.doCss()){
if(settings.enableTouch===true){
$this.enableTouch();
}
if(settings.enableDrag===true){
$this.enableDrag();
}}
$this.pager();
$this.controls();
$this.keyPress();
}};
plugin.build();
refresh.init=function (){
refresh.chbreakpoint();
if(settings.vertical===true){
if(settings.item > 1){
elSize=settings.verticalHeight;
}else{
elSize=$children.outerHeight();
}
$slide.css('height', elSize + 'px');
}else{
elSize=$slide.outerWidth();
}
if(settings.loop===true&&settings.mode==='slide'){
refresh.clone();
}
refresh.calL();
if(settings.mode==="slide"){
$el.removeClass('lSSlide');
}
if(settings.mode==="slide"){
refresh.calSW();
refresh.sSW();
}
setTimeout(function (){
if(settings.mode==="slide"){
$el.addClass('lSSlide');
}}, 1000);
if(settings.pager){
refresh.createPager();
}
if(settings.adaptiveHeight===true&&settings.vertical===false){
$el.css('height', $children.eq(scene).height());
}
if(settings.gallery===true){
plugin.slideThumb();
}
if(settings.mode==="slide"){
plugin.slide();
}
if(settings.autoWidth===false){
if($children.length <=settings.item){
$slide.find('.lSAction').hide();
}else{
$slide.find('.lSAction').show();
}}else{
if((refresh.calWidth(false) < elSize)&&(w!==0)){
$slide.find('.lSAction').hide();
}else{
$slide.find('.lSAction').show();
}}
};
$el.goToPrevSlide=function (){
if(scene > 0){
settings.onBeforePrevSlide.call(this, $el, scene);
scene--;
$el.mode(false);
if(settings.gallery===true){
plugin.slideThumb();
}}else{
if(settings.loop===true){
settings.onBeforePrevSlide.call(this, $el, scene);
if(settings.mode==='fade'){
var l=(length - 1);
scene=parseInt(l / settings.slideMove);
}
$el.mode(false);
if(settings.gallery===true){
plugin.slideThumb();
}}else if(settings.slideEndAnimatoin===true){
$el.addClass('leftEnd');
setTimeout(function (){
$el.removeClass('leftEnd');
}, 400);
}}
};
$el.goToNextSlide=function (){
var nextI=true;
if(settings.mode==='slide'){
var _slideValue=plugin.slideValue();
var nextI=_slideValue < w - elSize - settings.slideMargin;
}
if(((scene * settings.slideMove) < length - settings.slideMove)&&nextI){
settings.onBeforeNextSlide.call(this, $el, scene);
scene++;
$el.mode(false);
if(settings.gallery===true){
plugin.slideThumb();
}}else{
if(settings.loop===true){
settings.onBeforeNextSlide.call(this, $el, scene);
scene=0;
$el.mode(false);
if(settings.gallery===true){
plugin.slideThumb();
}}else if(settings.slideEndAnimatoin===true){
$el.addClass('rightEnd');
setTimeout(function (){
$el.removeClass('rightEnd');
}, 400);
}}
};
$el.mode=function (_touch){
if(settings.adaptiveHeight===true&&settings.vertical===false){
$el.css('height', $children.eq(scene).height());
}
if(on===false){
if(settings.mode==="slide"){
if(plugin.doCss()){
$el.addClass('lSSlide');
if(settings.speed!==''){
$slide.css('transition-duration', settings.speed + 'ms');
}
if(settings.cssEasing!==''){
$slide.css('transition-timing-function', settings.cssEasing);
}}
}else{
if(plugin.doCss()){
if(settings.speed!==''){
$el.css('transition-duration', settings.speed + 'ms');
}
if(settings.cssEasing!==''){
$el.css('transition-timing-function', settings.cssEasing);
}}
}}
if(!_touch){
settings.onBeforeSlide.call(this, $el, scene);
}
if(settings.mode==="slide"){
plugin.slide();
}else{
plugin.fade();
}
setTimeout(function (){
if(!_touch){
settings.onAfterSlide.call(this, $el, scene);
}}, settings.speed);
on=true;
};
$el.play=function (){
clearInterval(interval);
$el.goToNextSlide();
interval=setInterval(function (){
$el.goToNextSlide();
}, settings.pause);
};
$el.pause=function (){
clearInterval(interval);
};
$el.refresh=function (){
refresh.init();
};
$el.getCurrentSlideCount=function (){
var sc=scene;
if(settings.loop){
var ln=$slide.find('.lslide').length,
cl=$el.find('.clone.left').length;
if(scene<=cl-1){
sc=ln  + (scene-cl);
}else if(scene >=(ln+cl)){
sc=scene - ln - cl;
}else{
sc=scene - cl;
}};
return sc+1;
};
$el.getTotalSlideCount=function(){
return $slide.find('.lslide').length;
};
$el.goToSlide=function (s){
if(settings.loop){
scene=(s + $el.find('.clone.left').length -1);
}else{
scene=s;
}
$el.mode(false);
if(settings.gallery===true){
plugin.slideThumb();
}};
setTimeout(function(){
settings.onSliderLoad.call(this, $el);
},10);
$(window).on('resize orientationchange', function (e){
setTimeout(function (){
e.preventDefault();
refresh.init();
}, 200);
});
return this;
};}(jQuery));