").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip;var f="ui-effects-",g="ui-effects-style",m="ui-effects-animated",_=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,o){var a,r=o.re.exec(i),l=r&&o.parse(r),h=o.space||"rgba";return l?(a=s[h](l),s[c[h].cache]=a[c[h].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("
")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,a,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,l],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),o=c[n],a=0===this.alpha()?h("transparent"):this,r=a[o.cache]||o.to(a._rgba),l=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],h=s[o],c=u[n.type]||{};null!==h&&(null===a?l[o]=h:(c.mod&&(h-a>c.mod/2?a+=c.mod:a-h>c.mod/2&&(a-=c.mod)),l[o]=i((h-a)*e+a,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),l=Math.min(s,n,o),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-o)/h+360:n===r?60*(o-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[a]&&(this[a]=l(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[a]=d,n):h(d)},f(o,function(e,i){h.fn[e]||(h.fn[e]=function(n){var o,a=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=h(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(_),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(_.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var l=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(m)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(f+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(f+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},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,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(g,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(g)||"",t.removeData(g)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(f+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=f+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(m),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(l)&&l.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[h](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===h:"show"===h)?(r[h](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",l=s.complete,h=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,h)||o;i.data(m,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?h?this[h](s.duration,l):this.each(function(){l&&l.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,l=o?a.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("
").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{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,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var v=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},l=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),l&&l.css(t.effects.clipToBox(r)),r.clip=a),l&&l.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,l="hide"===r,h="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(h||l?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),h&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),l&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=l?2*u:u/2;l&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,l=r||"horizontal"===a,h=r||"vertical"===a;s=o.cssClip(),n.clip={top:h?(s.bottom-s.top)/2:s.top,right:l?(s.right-s.left)/2:s.right,bottom:h?(s.bottom-s.top)/2:s.bottom,left:l?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r?"-=":"+=",c="+="===h?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,u[l]=h+s,a&&(n.css(u),u[l]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(l=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,h=a-(d-1)/2,p.clone().appendTo("body").wrap("
").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?h*_:0),top:l+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:h*_),top:l+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,l=/([0-9]+)%/.exec(r),h=!!e.horizFirst,c=h?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;l&&(r=parseInt(l[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],l=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,l,n.from.y,_),v=t.effects.setTransition(a,l,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,h,n.from.x,_),v=t.effects.setTransition(a,h,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(l=l.concat(["marginTop","marginBottom"]).concat(r),h=h.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,l,n.from.y,o),a=t.effects.setTransition(i,l,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,h,n.from.x,o),a=t.effects.setTransition(i,h,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,l=2*(e.times||5)+(r?1:0),h=e.duration/l,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);l>u;u++)s.animate({opacity:c},h,e.easing),c=1-c;s.animate({opacity:c},h,e.easing),s.queue(i),t.effects.unshift(s,d,l+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,l=2*r+1,h=Math.round(e.duration/l),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,h,e.easing);r>s;s++)n.animate(p,h,e.easing).animate(f,h,e.easing);n.animate(p,h,e.easing).animate(d,h/2,e.easing).queue(i),t.effects.unshift(n,g,l+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u=e.distance||o["top"===h?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[h],d[h]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[l][1]]=d.clip[a[l][0]],"show"===r&&(o.cssClip(d.clip),o.css(h,d[h]),d.clip=s,d[h]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var v;t.uiBackCompat!==!1&&(v=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)}))});
/**
* GATrackEvents v230629-10
*/
var GATrackEvents = {
init: function() {
const _gaTrackBtns = document.querySelectorAll('.gaTrack:not(.clicked)');
_gaTrackBtns.forEach((_btn) => {
_btn.addEventListener('click', (event) => {
const _elem = event.target;
//console.log(_elem);
if (!_elem.classList.contains('clicked')) {
//console.log('click');
GATrackEvents.trackEvent(_elem);
}
});
});
},
trackEvent: function(category, action, label, value) {
if (typeof category === 'object') {
const elem = category;
try{
category = elem.getAttribute('data-ga-category');
action = elem.getAttribute('data-ga-action');
label = elem.getAttribute('data-ga-label');
value = elem.getAttribute('data-ga-value');
} catch (er) {
console.log(er);
}
}
//console.log(category,action,label,value);
if ( category && action ){
try {
gtag('event', action, {
event_category: category,
event_label: label
});
} catch (u) {
console.log('catch error');
try {
console.log("Google Error: " + u.toString())
} catch (f) {}
}
} else {
console.log('GA Track Error ===', category, action, label);
}
},
// format to pascal case - eg. SampleText
formatText: function(str) {
str = str.trim().toLowerCase();
str = str.replace(/\b[a-z]/g, function(letter) {return letter.toUpperCase();});
str = str.replace(/(<([^>]+)>)/ig,""); //strip html
str = str.replace(/ /g,''); // remove spaces
str = str.replace(/[^a-zA-Z0-9]+/g,"");
return str;
},
};
window.addEventListener("load", (event) => {
GATrackEvents.init();
});
/**
* jQuery Validation Plugin 1.9.0
*
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
* http://docs.jquery.com/Plugins/Validation
*
* Copyright (c) 2006 - 2011 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;this.attr("novalidate","novalidate");b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){a=this.find("input, button");a.filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&a.filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("
").attr("name",
b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form();
else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name];
return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a,
b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",
validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)},
onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).addClass(b).removeClass(d):c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).removeClass(b).addClass(d):c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults,
a)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."),
minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator"),g="on"+e.type.replace(/^validate/,
"");f.settings[g]&&f.settings[g].call(f,this[0],e)}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d=
this.settings.rules;c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate("[type='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",a).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",
a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(a){this.lastElement=
a=this.validationTargetFor(this.clean(a));this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors?
this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==
0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&
a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},
prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.validationTargetFor(this.clean(a));var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g=c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+
a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;a
Warning: No message defined for "+a.name+"")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]=
d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);
if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b||"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow=
this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];return a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d,
e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this,
c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=
false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings,
a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={};a=c(a);for(var d in c.validator.methods){var e;if(e=d==="required"&&typeof c.fn.prop==="function"?a.prop(d):a.attr(d))b[d]=e;else if(a[0].getAttribute("type")===d)b[d]=true}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};
var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined?
e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;
return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,
b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d,
mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]=e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,
b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)||a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)},
url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},
date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 -]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>=
0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery);
(function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery);
(function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a,
b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery);
/**
* jQuery Validation Plugin 1.9.0
*
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
* http://docs.jquery.com/Plugins/Validation
*
* Copyright (c) 2006 - 2011 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function(){function a(b){return b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,"")}jQuery.validator.addMethod("maxWords",function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length=d},jQuery.validator.format("Please enter at least {0} words."));jQuery.validator.addMethod("rangeWords",
function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length>=d[0]&&b.match(/bw+b/g).length9&&a.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number");jQuery.validator.addMethod("phoneUK",function(a,b){return this.optional(b)||a.length>9&&a.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/)},"Please specify a valid phone number");
jQuery.validator.addMethod("mobileUK",function(a,b){return this.optional(b)||a.length>9&&a.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/)},"Please specify a valid mobile number");jQuery.validator.addMethod("strippedminlength",function(a,b,c){return jQuery(a).text().length>=c},jQuery.validator.format("Please enter at least {0} characters"));
jQuery.validator.addMethod("email2",function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)},jQuery.validator.messages.email);
jQuery.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},
jQuery.validator.messages.url);
jQuery.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9-]+/.test(a))return false;a=a.replace(/\D/g,"");b=0;if(c.mastercard)b|=1;if(c.visa)b|=2;if(c.amex)b|=4;if(c.dinersclub)b|=8;if(c.enroute)b|=16;if(c.discover)b|=32;if(c.jcb)b|=64;if(c.unknown)b|=128;if(c.all)b=255;if(b&1&&/^(51|52|53|54|55)/.test(a))return a.length==16;if(b&2&&/^(4)/.test(a))return a.length==16;if(b&4&&/^(34|37)/.test(a))return a.length==15;if(b&8&&/^(300|301|302|303|304|305|36|38)/.test(a))return a.length==14;if(b&
16&&/^(2014|2149)/.test(a))return a.length==15;if(b&32&&/^(6011)/.test(a))return a.length==16;if(b&64&&/^(3)/.test(a))return a.length==16;if(b&64&&/^(2131|1800)/.test(a))return a.length==15;if(b&128)return true;return false},"Please enter a valid credit card number.");
jQuery.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(a)},"Please enter a valid IP v4 address.");
jQuery.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address.");
jQuery.validator.addMethod("pattern",function(a,b,c){return this.optional(b)||c.test(a)},"Invalid format.");
/** Abstract base class for collection plugins v1.0.1.
Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
Licensed under the MIT (http://keith-wood.name/licence.html) license. */
(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);
/* http://keith-wood.name/realPerson.html
Real Person Form Submission for jQuery v2.0.1.
Written by Keith Wood (kwood{at}iinet.com.au) June 2009.
Available under the MIT (http://keith-wood.name/licence.html) license.
Please attribute the author if you use it. */
(function($){var h='realperson';var k='ABCDEFGHIJKLMNOPQRSTUVWXYZ';var l=k+'0123456789';var m=[[' * ',' * * ',' * * ',' * * ',' ***** ','* *','* *'],['****** ','* *','* *','****** ','* *','* *','****** '],[' ***** ','* *','* ','* ','* ','* *',' ***** '],['****** ','* *','* *','* *','* *','* *','****** '],['*******','* ','* ','**** ','* ','* ','*******'],['*******','* ','* ','**** ','* ','* ','* '],[' ***** ','* *','* ','* ','* ***','* *',' ***** '],['* *','* *','* *','*******','* *','* *','* *'],['*******',' * ',' * ',' * ',' * ',' * ','*******'],[' *',' *',' *',' *',' *','* *',' ***** '],['* *','* ** ','* ** ','** ','* ** ','* ** ','* *'],['* ','* ','* ','* ','* ','* ','*******'],['* *','** **','* * * *','* * *','* *','* *','* *'],['* *','** *','* * *','* * *','* * *','* **','* *'],[' ***** ','* *','* *','* *','* *','* *',' ***** '],['****** ','* *','* *','****** ','* ','* ','* '],[' ***** ','* *','* *','* *','* * *','* * ',' **** *'],['****** ','* *','* *','****** ','* * ','* * ','* *'],[' ***** ','* *','* ',' ***** ',' *','* *',' ***** '],['*******',' * ',' * ',' * ',' * ',' * ',' * '],['* *','* *','* *','* *','* *','* *',' ***** '],['* *','* *',' * * ',' * * ',' * * ',' * * ',' * '],['* *','* *','* *','* * *','* * * *','** **','* *'],['* *',' * * ',' * * ',' * ',' * * ',' * * ','* *'],['* *',' * * ',' * * ',' * ',' * ',' * ',' * '],['*******',' * ',' * ',' * ',' * ',' * ','*******'],[' *** ',' * * ','* * *','* * *','* * *',' * * ',' *** '],[' * ',' ** ',' * * ',' * ',' * ',' * ','*******'],[' ***** ','* *',' *',' * ',' ** ',' ** ','*******'],[' ***** ','* *',' *',' ** ',' *','* *',' ***** '],[' * ',' ** ',' * * ',' * * ','*******',' * ',' * '],['*******','* ','****** ',' *',' *','* *',' ***** '],[' **** ',' * ','* ','****** ','* *','* *',' ***** '],['*******',' * ',' * ',' * ',' * ',' * ','* '],[' ***** ','* *','* *',' ***** ','* *','* *',' ***** '],[' ***** ','* *','* *',' ******',' *',' * ',' **** ']];$.JQPlugin.createPlugin({name:h,alphabetic:k,alphanumeric:l,defaultDots:m,defaultOptions:{length:6,regenerate:'Click to change',hashName:'{n}Hash',dot:'*',dots:m,chars:k},_getters:['getHash'],_challengeClass:h+'-challenge',_disabledClass:h+'-disabled',_hashClass:h+'-hash',_regenerateClass:h+'-regen',_textClass:h+'-text',_optionsChanged:function(c,d,e){$.extend(d.options,e);var f='';for(var i=0;i');setTimeout(function(){b.find('input[name="'+a+'"]').remove()},0)});c.prevAll('.'+this._challengeClass+',.'+this._hashClass).remove().end().before(this._generateHTML(d,f)).prevAll('div.'+this._challengeClass).click(function(){if(!$(this).hasClass(g._disabledClass)){c.realperson('option',{})}})},enable:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}a.removeClass(this._disabledClass).prop('disabled',false).prevAll('.'+this._challengeClass).removeClass(this._disabledClass)},disable:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}a.addClass(this._disabledClass).prop('disabled',true).prevAll('.'+this._challengeClass).addClass(this._disabledClass)},getHash:function(a){var b=this._getInst(a);return b?b.hash:0},_generateHTML:function(a,b){var c=''+'
'+a.options.regenerate+'
';return c},_preDestroy:function(a,b){a.closest('form').off('.'+b.name);a.prevAll('.'+this._challengeClass+',.'+this._hashClass).remove()}});var n=$.salt||'#salt';delete $.salt;$(function(){var a=$(n);if(a.length){n=a.text();a.remove()}if(n==='#salt'){n=''}});function hash(a){var b=5381;for(var i=0;i=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0)}function d(t){return v=e("
").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'× ',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)}),E.onclick&&I.click(function(e){E.onclick(e),b()})}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("
"),M=e("
"),B=e("
"),q=e("
"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.4",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)});
function fixPageHeight(){
}
function fixContentRightWidth(){ // safari fix - no support for calc
if ( $(window).width() > 769 ){
cwidth = $('#content').width() - 200 - 10;
if ( cwidth != $('#content_right').width() ){
$('#content_right').css("width", cwidth + 'px');
}
} else {
$('#content_right').css('width', '100%');
}
//console.log( $(window).width() );
//console.log( $('#content_left').width() );
}
function closeMobileRightMenu() {
menuBtn = $('a.btn_show_mobile_menu');
if ( menuBtn.hasClass('btn_active') ){
menuBtn.removeClass('btn_active');
$('#header_menu ul').removeClass('hm_active');
}
}
function closeMobileLeftMenu( animate ){
$('.btn_show_mobile_zones').removeClass('btn_active');
if ( animate ){ // click close btn
$( "#header" ).animate({ left: "0" }, 600, function() {});
$( "#body" ).animate({ left: "0" }, 600, function() {
$( "body" ).removeClass('open_menu_mobile');
//fixPageHeight();
});
} else { // resize window
$( "body" ).removeClass('open_menu_mobile');
$( "#body" ).css("left","0");
$( "#header" ).css("left","0");
//fixPageHeight();
}
}
var isSafari = ( navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 ) ? true : false;
$(document).ready(function(){
if ( isSafari ) {
fixContentRightWidth();
}
$("#nav > li > a").on("click", function(e){
if($(this).parent().has("ul")) { e.preventDefault(); }
if(!$(this).hasClass("active")) {
$("#nav li ul").slideUp(350);
$("#nav li a").removeClass("active");
$(this).next("ul").slideDown(350);
$(this).addClass("active");
}
else {
$(this).removeClass("active");
$(this).next("ul").slideUp(350);
}
});
$("#nav > li.multi_levels li a").on("click", function(e){
if ( !$(this).hasClass('menu_city') ) {
if($(this).parent().has("ul") ) { e.preventDefault(); }
if(!$(this).hasClass("active")) {
$("#nav li li ul").slideUp(350);
$("#nav li li a").removeClass("active");
$(this).next("ul").slideDown(350);
$(this).addClass("active");
}
else {
$(this).removeClass("active");
$(this).next("ul").slideUp(350);
}
}
});
$('.menu_item_city').on("click", function(){
menuopen = $(this).attr('openmenu');
if ( menuopen ){
setCookie( "openmenu", menuopen, 7 );
}
});
$('.btn_show_mobile_zones').on( "click", function() {
$( "body" ).addClass('open_menu_mobile');
if ( !$(this).hasClass('btn_active') ){
$(this).addClass('btn_active');
$('.' + $(this).attr('rel')).show();
$( "#body" ).animate({ left: "210px" }, 600, function() { $('html, body').animate({scrollTop: 0}, 1000, function(){ }); });
$( "#header" ).animate({ left: "210px" }, 600, function() { });
closeMobileRightMenu();
} else {
closeMobileLeftMenu( true );
closeMobileRightMenu();
}
});
$('.btn_show_mobile_search').on( "click", function() {
$('html, body').animate({scrollTop: 0}, 400, function(){ });
$('#search_find').focus();
closeMobileLeftMenu();
closeMobileRightMenu();
});
$('.btn_show_mobile_menu').on( "click", function() {
if ( $(this).hasClass('btn_active') ){
$(this).removeClass('btn_active');
$('#header_menu ul').removeClass('hm_active');
} else {
$(this).addClass('btn_active');
$('#header_menu ul').addClass('hm_active');
}
});
});
var delay_on_resize;
window.onresize = function(){
// safari fix - no support for calc
if ( isSafari ) {
fixContentRightWidth();
}
clearTimeout(delay_on_resize);
delay_on_resize = setTimeout( function(){
if ( $("body").hasClass('open_menu_mobile') ){ // switch to desktop - close left menu if opened
if ( $(window).width() > 769){
closeMobileLeftMenu( false );
}
}
} , 100);
};
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setTime(+t + days * 864e+5);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {};
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var cookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');
if (key && key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key) === undefined) {
return false;
}
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};
}));
function chars_number_left(elementCount, elementDisplay) {
var charsno = elementCount.val().length;
var charleft = 10000 - charsno;
elementDisplay.html(charleft + " characters left ");
}
function loading_message(message) {
$("
").html(message).hide().show().prependTo("div#header");
var loading = $(".loading_custom");
setTimeout(function () {
loading.hide();
}, 5000);
$(".loading_custom").on("click", function () {
$(this).remove();
});
}
function loading(message) {
if (!message) {
message = 'Loading ...';
}
$("
").html(message).hide().show().prependTo("div#header");
$(".loading_custom").on("click", function () {
$(this).remove();
});
}
function removeLoading() {
$(".loading_custom").remove();
}
function setRealperson(elementId, length = 4) {
$(elementId).realperson({
length: length,
regenerate: 'Click to get a new code',
dot: '$',
hashName: '{n}Hash',
chars: $.realperson.alphanumeric
});
}
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut",
"tapToDismiss": false
}
function showNotification(type, title, message, options) {
if (typeof options != 'undefined') {
toastr.options.timeOut = options.timeOut;
toastr.options.extendedTimeOut = options.extendedTimeOut;
toastr.options.tapToDismiss = options.tapToDismiss;
}
toastr[type](message, title);
}
$(function () {
$("#move_review").click(function () {
$("#move_review_form").toggle();
});
$(window).scroll(function (e) {
scrollPosition = $(window).scrollTop();
if (scrollPosition > 50) {
$('body').addClass("fix-header");
} else {
$('body').removeClass("fix-header");
}
//FIXED BREADCRUMB MOBILE
if (scrollPosition > 102) {
$('body').addClass("mobile");
} else {
$('body').removeClass("mobile");
}
if (scrollPosition > 240) {
$('body').addClass("fix-breadcrumb");
} else {
$('body').removeClass("fix-breadcrumb");
}
});
if ($('#profile-fixed-mobile-nav').length && screen.width <= 481) {
// get position once, not on every click
$("[data-scrollto]").each(function () {
_this = $(this);
_thisNavTab = _this.data('scrollto');
if ($("[data-scrolltoitem=" + _thisNavTab + "]").length) {
_div = $("[data-scrolltoitem=" + _thisNavTab + "]");
switch (_thisNavTab) {
case 'contact':
_offset = -22;
break;
//case 'info': _offset = 10; break;
//case 'rates': _offset = 20; break;
//case 'reviews': _offset = 25; break;
default:
_offset = 5;
}
_this.attr('data-scrollto-px', _div.position().top - (112 + _offset)); // + H of header,breadcrumb,profile-fixed-mobile-nav + some offset
}
});
$(document).on("click", "[data-scrollto-px]", function () {
body = $("body, html");
body.animate({scrollTop: $(this).data('scrollto-px')}, 400, function () {
});
});
}
$("#addEscort").click(function () {
$.ajax({
type: "POST",
url: '/index.php',
data: 'postAjax=/addescort',
success: function (data) {
return true;
}
});
});
$("#addSuggestedCity").click(function () {
$("#suggestCity").show();
$(this).hide();
});
// New Switch toggle safe browsing
$('.Switch').click(function () {
$(this).toggleClass('On').toggleClass('Off');
if ($(this).hasClass('On')) {
$("#body").addClass('safe_browsing');
setCookie("safe_browsing", 'on', 365);
//GATrackEvents.trackEvent('Safe Browsing', 'On', $(this).data('ga-label') );
//if ( getCookie("safe_browsing_ts")) { GATrackEvents.trackEvent('Safe Browsing', getCookie("safe_browsing_ts"), 'On' ); }
} else {
$("#body").removeClass('safe_browsing');
setCookie("safe_browsing", 'off', 365);
//GATrackEvents.trackEvent('Safe Browsing', 'Off', $(this).data('ga-label') );
//if ( getCookie("safe_browsing_ts")) { GATrackEvents.trackEvent('Safe Browsing', getCookie("safe_browsing_ts"), 'Off' ); }
}
});
// ON/OFF text
$('.on_off').on("click", function () {
$('.Switch').toggleClass('On').toggleClass('Off');
if ($('.Switch').hasClass('On')) {
$("#body").addClass('safe_browsing');
setCookie("safe_browsing", 'on', 365);
//GATrackEvents.trackEvent('Safe Browsing', 'On', $('.Switch').data('ga-label') );
//if ( getCookie("safe_browsing_ts")) { GATrackEvents.trackEvent('Safe Browsing', getCookie("safe_browsing_ts"), 'On' ); }
} else {
$("#body").removeClass('safe_browsing');
setCookie("safe_browsing", 'off', 365);
//GATrackEvents.trackEvent('Safe Browsing', 'Off', $('.Switch').data('ga-label') );
//if ( getCookie("safe_browsing_ts")) { GATrackEvents.trackEvent('Safe Browsing', getCookie("safe_browsing_ts"), 'Off' ); }
}
});
//END - New Switch toggle safe browsing
$(".btn_view_type").on("click", function (e) {
if ($('#body').hasClass("view_type_grid")) {
$('#body').removeClass("view_type_grid");
setCookie("view_type", 'list', 365);
} else {
$('#body').addClass("view_type_grid");
setCookie("view_type", 'grid', 365);
}
e.preventDefault();
});
$(".entersitenotice_enter").on("click", function () {
//document.cookie = "agecheck=true";
setCookie("agecheck", "true", 7);
$("#entersitenotice_bg").fadeOut();
$("#entersitenotice").remove();
$("#body").fadeIn();
fixPageHeight(); // menu.js
fixContentRightWidth(); // menu.js
});
/**********************************/
$("#change_user_location").on("click", function (e) {
$("#change_location").stop().hide(500, function () {
$(this).remove();
});
var $html = '';
$($html).appendTo("body").show(500, function () {
$("#change_location a").on("click", function () {
$("#change_location").stop().hide(500, function () {
$(this).remove();
});
});
$("#change_location button[name=change]").on("click", function () {
$val = $("#change_location input").val();
$.ajax({
type: "POST",
url: "/",
data: "userZipCode=" + $val,
success: function (data) {
GATrackEvents.trackEvent('GeoLocation', 'Compass', data == 'Error' ? 'Zip not found' : data);
window.location.reload();
}
});
});
});
});
$("#change_user_location2").on("click", function (e) {
$('html, body').animate({scrollTop: 0}, 1000, function () {
});
$("#change_location2").stop().hide(500, function () {
$(this).remove();
});
var $html = '';
$($html).appendTo("body").show(500, function () {
$("#change_location2 a").on("click", function () {
$("#change_location2").stop().hide(500, function () {
$(this).remove();
});
});
$("#change_location2 button[name=change]").on("click", function () {
$val = $("#change_location2 input").val();
$.ajax({
type: "POST",
url: "/",
data: "userZipCode=" + $val,
success: function (data) {
//$("#user_location_set").text(data);
//$("#change_location").hide(500, function() { $(this).remove(); });
window.location.reload();
}
});
});
});
});
$("#bubble_follow").click(function (e) {
e.preventDefault();
window.location = '/users-favorites';
});
$("#bubble_message").click(function (e) {
e.preventDefault();
window.location = '/users-messages';
});
$("#bubble_message, #bubble_follow").tooltip();
if ($('body').hasClass('body-go_premium')) { // go premium page
$(".bitcoin-atm").on("click", function () {
$("body").toggleClass('bitcoin-atm-active');
});
$(".visamc_choose_card label").on("click", function () {
var selected_radio = $(this).find("input:checked").val();
if (selected_radio) {
$(".visamc_choose_card .card_type_labels").removeClass('active');
$(this).closest('.card_type_labels').addClass('active');
}
});
$(".select-currency-type").on("click", "a", function () {
_this = $(this);
if ($('body').is('[class*="selected-premium-bitcoin"]') ||
$('body').is('[class*="selected-premium-ethereum"]') ||
$('body').is('[class*="selected-premium-tether"]') ) { // already selected crypto option
if (!_this.hasClass('active')) { // only if switch to other currency
$(".select-currency-type a").removeClass('active');
_this.addClass('active');
_this.closest('.payment-block').attr('data-active-currency', _this.data('currency'));
$(".select-currency-type .right").text(_this.data('text')); // exchage rate
//console.log( _this.closest('.payment-block').find('.selectduration.active').length );
// if radio already checked
// on switch currency, auto-select corresponding radio
if (_this.closest('.payment-block').find('.selectduration.active').length) {
radioID = _this.closest('.payment-block').find('.selectduration.active input').attr('id');
if ( radioID.includes("bitcoin") ){
switchToRadioID = radioID.replace("bitcoin", _this.data('currency-name'));
} else if ( radioID.includes("ethereum") ){
switchToRadioID = radioID.replace("ethereum", _this.data('currency-name'));
} else if ( radioID.includes("tether") ){
switchToRadioID = radioID.replace("tether", _this.data('currency-name'));
}
//console.log(radioID + ' => ' + switchToRadioID);
$('#' + switchToRadioID)[0].click();
}
_this.find('input').prop("checked", true); // fake input
}
} else { // direct click on currency , auto select a crypto option
$(".select-currency-type a").removeClass('active');
_this.addClass('active');
_this.closest('.payment-block').attr('data-active-currency', _this.data('currency') );
$(".select-currency-type .right").text( _this.data('text') ); // exchage rate
checkRadioID = $('.currency-type-'+_this.data('currency')).find('.selectduration input').attr('id');
$('#'+checkRadioID)[0].click();
_this.find('input').prop("checked", true); // fake input
}
});
$(".selectduration").on("click", function () {
var selected_radio = $(this).find("input:checked").val();
var selected_amount = $(this).attr('data-amount');
var selected_currency = $(this).attr('data-currency');
var selected_period = $(this).attr('data-period');
if (selected_radio) {
$(".selectduration").removeClass('active');
$(this).addClass('active');
$("body").removeClass("selected-premium-1month selected-premium-12months selected-premium-option1 selected-premium-option2 selected-premium-option3 selected-premium-option4 selected-premium-bitcoin1 selected-premium-bitcoin2 selected-premium-bitcoin3 selected-premium-bitcoin4 selected-premium-ethereum1 selected-premium-ethereum2 selected-premium-ethereum3 selected-premium-ethereum4 selected-premium-tether1 selected-premium-tether2 selected-premium-tether3 selected-premium-tether4 selected-premium-gift1 selected-premium-gift2");
$("body").addClass("selected-premium-" + selected_radio);
// check / uncheck fake radio from cryptocurrency
var credit_card_options = ["1month", "12months"];
var gift_card_options = ["gift1", "gift2"];
if (credit_card_options.includes(selected_radio)) { // credit card selected
$('.select-currency-type').find('input').prop("checked", false);
} else if (gift_card_options.includes(selected_radio)) { // gift card selected
$('.select-currency-type').find('input').prop("checked", false);
} else { // crypto selected
$('.select-currency-type .active').find('input').prop("checked", true);
}
if (selected_amount){
$('.selected-amount').text(selected_amount);
}
if (selected_currency){
$('.selected-currency').text(selected_currency);
}
if (selected_period){
$('.selected-period').text(selected_period);
}
}
});
$("#form-go-premium").on("submit", function (e) {
var options = ['option1', 'option2', 'option3', 'option4'];
var selectedValue = $('#form-go-premium input[name=duration]:checked').val();
if (options.indexOf(selectedValue) >= 0) {
e.preventDefault();
$('button#deposit2Bp_' + selectedValue).trigger('click');
}
});
}
});
function getHostName() {
return window.location.hostname.substring(window.location.hostname.lastIndexOf(".", window.location.hostname.lastIndexOf(".") - 1) + 1);
}
function setCookie(c_name, value, exdays) {
if (exdays === undefined) {
exdays = 1;
}
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
if (c_name == 'agecheck' || c_name == 'safe_browsing') { // common for forum+website
document.cookie = c_name + "=" + c_value + ";path=/;domain=" + getHostName(); // agecheck only for forum
} else {
document.cookie = c_name + "=" + c_value + ";path=/"; // no dot at domain
}
}
function getCookie(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x == c_name) {
return unescape(y);
}
}
}
function deleteCookie(name) {
var expiration_date = new Date();
expiration_date.setYear(expiration_date.getYear() - 1);
expiration_date = expiration_date.toUTCString();
var cookie_string = escape(name) + "=; expires=" + expiration_date;
document.cookie = cookie_string;
}
function updateHash(hashToUpdate, forceReload) {
newHash = new Array();
reload = false;
for (i = 0; i < hashToUpdate.length; ++i) {
cookieName = hashToUpdate[i][0];
cookieVal = hashToUpdate[i][1];
//console.log(cookieVal);
if (cookieName && cookieVal && validCookies.indexOf(cookieName) != -1) { // exists && is a valid cookie name
setCookie(cookieName, cookieVal, 365); // maybe .. if forceReload don't overwrite
newHash.push(cookieName + '=' + cookieVal);
reload = true;
}
}
newHash = newHash.join('/');
window.location.hash = newHash;
if (forceReload && reload) {
removeHash();
window.location.reload();
}
}
function checkCookieEqualsHash(cookieName, cookieVal) {
thisCookie = getCookie(cookieName);
if (thisCookie && thisCookie == cookieVal) {
return true;
} else {
return false;
}
}
//http://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-with-javascript-without-page-refresh/5298684#5298684
function removeHash() {
var scrollV, scrollH, loc = window.location;
if ("pushState" in history)
history.pushState("", document.title, loc.pathname + loc.search);
else {
// Prevent scrolling by storing the page's current scroll offset
scrollV = document.body.scrollTop;
scrollH = document.body.scrollLeft;
loc.hash = "";
// Restore the scroll offset, should be flicker free
document.body.scrollTop = scrollV;
document.body.scrollLeft = scrollH;
}
}
var hashToUpdate = new Array();
var validCookies = new Array(); // ['sortby','filters','sortbyreviews'];
$(document).ready(function () {
$(document).on("click", ".realperson-challenge", function () {
$('.is-realperson').val('');
});
$(document).on("click", ".verify_profile_intro .btn", function () {
_this = $(this);
_showDiv = _this.data('show');
iframeFrom = $(this).attr('data-iframeFrom');
if (_showDiv == '.verify_profile_video') {
iframeURL = '/videoverify/';
if (iframeFrom) {
iframeURL += '?iframeFrom=' + iframeFrom;
}
$(_showDiv).find('.iframegoeshere').html('');
}
$(_showDiv).show();
$('.verify_profile_intro').hide();
});
/* =============== hash ================ */
// different pages, different hashes
if ($('#body').hasClass('page-dancers') || $('#body').hasClass('page-simple_search')) {
validCookies.push('sortby');
validCookies.push('filters');
} else if ($('#body').hasClass('page-home')) {
validCookies.push('sortbyreviews');
}
var windowHash = decodeURI(window.location.hash.substring(1));
var windowHashVals = windowHash ? windowHash.split("/") : false;
if (windowHashVals.length) {
for (i = 0; i < windowHashVals.length; ++i) {
this_hash = windowHashVals[i].split("=");
//console.log(this_hash);
if (this_hash.length == 2) { // #name=value only
if (validCookies.indexOf(this_hash[0]) == -1) { // invalid cookie
//console.log('continue');
continue;
}
if (this_hash[1]) { // has value ??
hasSameValue = checkCookieEqualsHash(this_hash[0], this_hash[1]);
if (!hasSameValue) {
hashToUpdate.push([this_hash[0], this_hash[1]]);
}
}
}
}
}
// UPDATE HASH
// even fron hash or cookies
//
if (hashToUpdate.length) { // new values found .. update
updateHash(hashToUpdate, 1);
} else { // check for cookies .. make hash for sharing
for (i = 0; i < validCookies.length; ++i) {
this_cookie = validCookies[i];
if (getCookie(this_cookie)) {
hashToUpdate.push([this_cookie, getCookie(this_cookie)]);
}
}
if (hashToUpdate.length) {
updateHash(hashToUpdate, 0); // make hash only, based on cookie vals, don't reload
}
}
/* =============== // hash ================ */
/* =============== filters ================ */
function updateFiltersPosition() {
filtersPosition = filtersDIv.position().top + filtersDIv.outerHeight(true);
//console.log(filtersPosition);
}
function makeApplyFiltersFixed() {
isVisible = filtersDIv.is(":visible");
if (isVisible === true) {
scrollBottomPosition = $(window).scrollTop() + document.documentElement.clientHeight;
if (scrollBottomPosition < filtersPosition) {
$('body').addClass("fix-btn_apply_filters");
} else {
$('body').removeClass("fix-btn_apply_filters");
}
}
}
var scrollBottomPosition, filtersPosition, filtersDIv = $('#filters');
$(".btn_show_filters").on("click", function () {
if (screen.width <= 480 || screen.width >= 1000) {
filtersPositionTop = $('#filtersPosition').position().top;
scrollTopVal = filtersPositionTop - (screen.width <= 480 ? 90 : 55);
} else {
scrollTopVal = $('#content_right').position().top + 2;
}
isVisible = $('#filters').is(":visible");
var body = $("body, html");
body.animate({scrollTop: scrollTopVal}, 400, function () {
});
if (isVisible === true) { // already open
if (body.scrollTop() >= 530) { // open but user scrolled down and is not visible on the screen
} else { // visible on the screen
$("#filters").slideToggle('500', function () {
}); // close
}
} else {// hidden
$("#filters").slideToggle('500', function () {
});
}
});
$(".btn_filters_more ").on("click", function () {
//console.log('test');
this_parent = $(this).closest('.filters-col');
if (this_parent.hasClass('filters-active-all')) {
this_parent.removeClass('filters-active-all');
} else {
this_parent.addClass('filters-active-all');
}
updateFiltersPosition();
makeApplyFiltersFixed();
});
$("#filters li").on("click", function () {
//$("#btn_delete_filters").show();
$("#btn_apply_filters").show();
updateFiltersPosition();
makeApplyFiltersFixed();
});
// mobile filter btn - fixed
if (screen.width <= 768 && $('#filters').length) {
updateFiltersPosition();
$(window).scroll(function (e) {
makeApplyFiltersFixed();
});
}
$.fn.serializeObject = function () {
var o = {};
var a = this.serializeArray();
///return a;
$.each(a, function () {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
//console.log(o);
return o;
};
$("#btn_apply_filters").on("click", function () {
filters_vars = JSON.stringify($('#form-filters').serializeObject());
if (filters_vars == '{}') { // empty
deleteCookie('filters');
} else {
setCookie('filters', filters_vars, 365);
}
removeHash();
window.location.reload();
});
$("#btn_delete_filters").on("click", function () {
deleteCookie('filters');
removeHash();
window.location.reload();
});
/* =============== //filters ================ */
/* ====== Country cities =======*/
$(".btn_country_cities_more").on("click", function () {
//$(".country_cities div").addClass("active");
this_parent = $(this).closest('.country_cities');
//console.log(this_parent);
if (this_parent.hasClass('country_cities-active-all')) {
this_parent.removeClass('country_cities-active-all');
//$(".country_cities div").removeClass('active');
} else {
this_parent.addClass('country_cities-active-all');
//$(".country_cities div").addClass('active');
}
});
/* ====== //Country cities =======*/
$(".panel_heading").on("click", function () {
th = $(this);
el = th.next();
if (el.is(":visible")) {
el.hide();
th.find('.open_minus').removeClass('open_minus').addClass('open_plus');
} else {
el.show();
th.find('.open_plus').removeClass('open_plus').addClass('open_minus');
}
});
$("#select_city_review").on("change", function (elem) {
if (elem.currentTarget.value !== "") {
$("#zipCodeRadius").hide();
} else {
$("#zipCodeRadius").show();
}
$("#suggestCity input").val("");
});
$('li.sort_by_dropdown-item').on("click", function () {
if ($(this).attr("sortby") !== getCookie('sortby')) {
setCookie("sortby", $(this).attr("sortby"), 365);
window.location.href = '/' + $("#sort_by").attr("rel");
}
});
$('#sort_by').dropdown({
inDuration: screen.width < 1200 ? 2000 : 300,
outDuration: 225,
constrain_width: true, // Does not change width of dropdown to that of the activator
hover: true, // Activate on hover
gutter: 3, // Spacing from edge
belowOrigin: false, // Displays dropdown below the button
alignment: 'left', // Displays dropdown with edge aligned to the left of button,
coverTrigger: true
}
);
$("input#photos_only").on("click", function () {
if (getCookie("photos_only")) {
if (getCookie("photos_only") == "true") {
document.cookie = "photos_only=false";
} else {
document.cookie = "photos_only=true";
}
} else {
document.cookie = "photos_only=true";
}
window.location.href = $(this).attr("rel");
});
/***************Login***************/
$("#login_form").validate({
errorClass: 'register_error',
rules: {
email: {required: true},
password: {required: true}
},
messages: {
email: {required: "Please insert a valid email or username",}, /*email : "Please insert a valid email", */
password: {required: "Password is incorrect"}
},
submitHandler: function (form) {
var $form = form;
var $url = '/users-sign-in';
$.ajax({
type: "POST",
url: $url,
data: "login=1&email=" + $("#login_form input[name=email]").val() + "&password=" + $("#login_form input[name=password]").val(),
success: function (data) {
//data = data.replace(/(\r\n|\n|\r)/gm,"");
if (data == 'loggedin') {
var http_referer = getCookie('http_referer');
//console.log(http_referer);
if (http_referer) {
deleteCookie('http_referer');
window.location.href = http_referer;
} else {
var fromRaw = window.location.href;
var regex = /\?from=(.*)/gi;
var found = fromRaw.match(regex);
if (found) {
var urlRedirect = 'https://' + decodeURIComponent(found[0].replace('?from=', ''));
window.location.href = urlRedirect;
} else {
window.location.reload();
}
}
} else if (data == 'isbanned') {
$("#login_form .register_error").remove();
$("#InputEmail").after(" Your account is banned! ");
} else if (data == 'error_email') {
$("#login_form .register_error").remove();
$("#InputEmail").after(" The email or username is not registered ");
} else if (data == 'error_password') {
$("#login_form .register_error").remove();
$("#InputPassword").after(" The password is incorrect ");
} else if (data == 'notconfirmed') {
$("#login_form .register_error").remove();
$("#InputEmail").after(" Please check the registration email and confirm your account! Resend confirmation token ");
}
}
});
return false;
}
});
$("#reset_form").validate({
errorClass: 'register_error',
rules: {
email: {email: true, required: true,}
},
messages: {
email: {email: "Please insert a valid email", required: "Please insert a valid email",}
},
submitHandler: function (form) {
form.submit();
return false;
}
});
/***************end - Login***************/
$("#singupnow").click(function () {
$("#register_col").css('display', 'block');
});
$("#users-login").on("click", function (e) {
e.preventDefault();
$("#head-login").slideToggle();
$("#head-login input:first").focus();
});
/* ============= HEADER SEARCH ===================== */
(function change_location_select() {
var button = $("#change_location_submit");
var container = $("#change_location");
var search_input = $("#search_near");
search_input.focus(function () {
container.show();
});
/*$("#select_zone").change(function(){
button.css('display', 'none');
}); */
$("#select_countries").change(function () {
//button.css('display', 'none');
});
$("#select_countries, #select_city").change(function () {
if ($(this).val() > 0) {
button.css('display', 'block');
}
});
$(".closeBTN").click(function () {
container.hide();
button.css('display', 'none');
});
button.click(function () {
$(".location_inputs").remove();
var state = $("#select_countries option:selected").text();
var city = ($("#select_city").val() > 0) ? $("#select_city option:selected").text() : '';
var state_and_city = city ? state + ", " + city : state;
search_input.val(state_and_city);
//search_input.val(city);
//search_input.after(" ");
search_input.after(" ");
//search_input.after(" ");
//search_input.parent('form').submit();
$("#header_search_form").submit();
});
})();
$("#header_search_form .search_submit").on("click", function () {
if ($('#search_find').val().length < 2) {
$('#search_find').focus();
$('#search_find').css('border-color', 'red');
return false;
}
});
$("#search_find").on("keyup", function () {
if ($('#search_find').val().length > 2) {
$('#search_find').attr('style', '');
}
});
$("#search_find").on("focus", function () {
$('#search_find').attr('placeholder', '');
});
/* ============= // HEADER SEARCH ===================== */
$("form.new_comment").submit(function () {
var ln = $(this).children("#info").val().length;
if (ln < 20) {
loading_message('Please insert a minimum 20 chars Comment !');
return false;
}
});
$(".comment_vote").click(function () {
var comment_id = $(this).attr('cid');
var value = $(this).attr('val');
var el_votes = $(this).children('span');
$.ajax({
type: "POST",
data: "action=vote&comment_id=" + comment_id + "&value=" + value,
url: location.href,
success: function (data) {
data = $.trim(data);
if (data == 'voted') {
var text = "You've already voted.";
} else if (data == 'success') {
var text = "Vote recorded.";
el_votes.text(parseInt(el_votes.text()) + 1);
} else if (data == 'login') {
var text = "Please login";
}
loading_message(text);
}
});
});
function clear_form_elements(ele) {
tags = ele.getElementsByTagName('input');
for (i = 0; i < tags.length; i++) {
switch (tags[i].type) {
case 'password':
case 'text':
tags[i].value = '';
break;
case 'checkbox':
case 'radio':
tags[i].checked = false;
break;
}
}
tags = ele.getElementsByTagName('select');
for (i = 0; i < tags.length; i++) {
if (tags[i].type == 'select-one') {
tags[i].selectedIndex = 0;
} else {
for (j = 0; j < tags[i].options.length; j++) {
tags[i].options[j].selected = false;
}
}
}
tags = ele.getElementsByTagName('textarea');
for (i = 0; i < tags.length; i++) {
tags[i].value = '';
}
}
function agency_name() {
var agency_name = $("#agency_name_message").attr('rel');
if (agency_name) {
$("#agency_field input").val(agency_name).attr('disabled', 'disabled');
//$("#agency_field").slideDown();
} else {
$("#agency_field input").val('').removeAttr('disabled');
//$("#agency_field").slideUp();
}
}
/******** SEARCH ***********/
if ($('#current_search_values').length) {
//$('#current_search_values').insertBefore('#adv_search_results');
//$('#current_search_values').insertBefore('#adv_search_title');
}
$("#btn_save_search").on("click", function () {
this_btn = $(this);
this_rel = this_btn.attr("rel");
if (this_btn.hasClass('active')) { // is saved
$.ajax({
type: "POST",
url: window.location.href,
data: 'remove_search=1',
success: function () {
this_btn.text('Save Search');
this_btn.removeClass('active');
}
});
} else {
$.ajax({
type: "POST",
url: window.location.href,
data: 'save_search=1',
success: function () {
this_btn.text('Remove Search');
this_btn.addClass('active');
}
});
}
});
$("#btn_change_search_options").on("click", function () {
this_btn = $(this);
if (this_btn.hasClass('active')) {
this_btn.removeClass('active');
$('#adv_search_results').slideUp();
} else {
this_btn.addClass('active');
$('#adv_search_results').slideDown();
$(".remove_csv_item").show();
}
});
$("#reset").on("click", function () {
clear_form_elements(this.form);
$("#current_search_values").hide();
$("#btn_save_search").hide();
});
$(".remove_csv_item").on("click", function () {
var th = $(this);
var field = th.attr("rel");
th.parent().remove();
var tags = $("#adv_search_results [name='" + field + "']");
var tags_name = tags.prop('tagName')
if (tags_name == 'INPUT') {
for (i = 0; i < tags.length; i++) {
tags_type = tags[i].type;
switch (tags_type) {
case 'password':
case 'text':
tags[i].value = '';
break;
case 'checkbox':
case 'radio':
tags[i].checked = false;
break;
}
}
}
if (tags_name == 'SELECT') {
for (i = 0; i < tags.length; i++) {
if (tags[i].type == 'select-one') {
tags[i].selectedIndex = 0;
} else {
for (j = 0; j < tags[i].options.length; j++) {
tags[i].options[j].selected = false;
}
}
}
}
if (tags_name == 'TEXTAREA') {
for (i = 0; i < tags.length; i++) {
tags[i].value = '';
}
}
$(".reset").hide();
$(".refine_search_btn").hide();
$("Loading...
").insertAfter($(".refine_search_btn"));
$("#adv_search_results").submit();
});
$("#delete_review").on("click", function (e) {
e.preventDefault();
if (confirm('Are you sure you want to delete ?')) {
var $dancer_url = $(this).attr("rel");
var $url = $(this).attr("href");
$.ajax({
type: "POST",
url: $url,
success: function (data) {
window.location.href = $dancer_url;
}
});
}
});
$("#delete_dancer").on("click", function (e) {
e.preventDefault();
/* // not in use anymore => with modal from 07.12.2017
if ( confirm('Are you sure you want to delete ?') ) {
var $url = $(this).attr("href");
$.ajax({
type : "POST",
url : $url,
success : function( data ) {
window.location.href='/';
}
});
}*/
});
$(".newest, .oldest").on("click", function () {
if (getCookie('oldest')) {
setCookie("oldest", true, 0); // chrome fix
} else {
setCookie("oldest", true, 365);
}
window.location.reload();
});
$('#textAreaPost').keyup(function () {
chars_number_left($(this), $('#char_namb'));
});
$('#comment_apperance').keyup(function () {
chars_number_left($(this), $('#char_number'));
});
$("#rate_currency").on("change", function () {
var optionSelected = $(this).find("option:selected").val();
if (optionSelected == 239) {
$("#other_currency").show();
} else {
$("#other_currency").hide();
$("#other_currency").val('');
}
});
$(".click_to_open, .click_to_close").on("click", function () {
if ($(".fetish_tab").is(":visible")) {
$(".fetish_tab").hide();
$(".click_to_open").show();
$(".click_to_close").hide();
$(".arrow_to_open").show();
$(".arrow_to_close").hide();
} else {
$(".fetish_tab").show();
$(".click_to_open").hide();
$(".click_to_close").show();
$(".arrow_to_open").hide();
$(".arrow_to_close").show();
}
});
$("#btn-add-comment-review").on("click", function (e) {
$(this).hide();
$('.single_review_row_add_comment').show();
});
$("#form_add_comment_to_review input[name='submit_comment']").on("click", function (e) {
$isOK = true;
$data_to_send = "";
error_to_display = "";
var $commentToReview = $("#form_add_comment_to_review textarea[name='comment-to-review']");
if ($commentToReview.length) {
if ($commentToReview.val().length < 10) {
$commentToReview.addClass("hightlight_required");
$isOK = false;
error_to_display = "Please add a minimum 10 characters";
} else $commentToReview.removeClass("hightlight_required");
$data_to_send += "&commentToReview=" + $commentToReview.val();
}
if (!$isOK) {
$(".notice_error").remove();
$("#comment-to-review").after('' + error_to_display + '
');
e.preventDefault();
return false;
} else {
$(".notice_error").remove();
$("#submit_add_comment").hide();
$("Loading...
").insertAfter($("#submit_add_comment"));
}
});
$(".alt_website_plus").on("click", function () {
if ($("#alt_website_2").hasClass("hidden")) {
$("#alt_website_2").removeClass("hidden").show();
} else {
if ($("#alt_website_3").hasClass("hidden")) {
$("#alt_website_3").removeClass("hidden").show();
$(this).hide();
} else {
$(this).hide();
}
}
});
$(".phone_plus").on("click", function () {
if ($("#phone_2").hasClass("hidden")) {
$("#phone_2").removeClass("hidden").show();
$(this).hide();
} else {
$(this).hide();
}
});
const $name = $("input[name='dancer[name]']");
const $email = $("input[name='dancer[email]']");
const $phone = $("input[name='dancer[phone]']");
const $phone2 = $("input[name='dancer[phone2]']");
// var $website = $("#add_an_escort input[name='dancer[website]']");
// var $website2 = $("#add_an_escort input[name='dancer[website2]']");
// var $website3 = $("#add_an_escort input[name='dancer[website3]']");
// var $website4 = $("#add_an_escort input[name='dancer[website4]']");
$email.on("change", function () {
var error_to_display = "";
var message_to_display = "";
if ($email.val().length > 3) {
$(".notice_success").remove();
$(".notice_error").remove();
if (isValidEmailAddress($email.val())) {
$email.removeClass("hightlight_required");
$phone.removeClass("hightlight_required");
$phone2.removeClass("hightlight_required");
$.ajax({
type: "POST",
async: false,
url: "/controller/ajax/verify_email.php?just_email=1",
data: "email=" + $email.val(),
success: function (data) {
if (data) {
$email.removeClass("hightlight_required");
$email.addClass("hightlight_required");
message_to_display = data;
} else {
$email.removeClass("hightlight_required");
}
}
});
} else {
$email.addClass("hightlight_required");
error_to_display = "Email - Please complete a valid email address";
}
}
if (error_to_display) {
$(".providerinfo").before('' + error_to_display + '
');
}
if (message_to_display) {
$(".providerinfo").before('' + message_to_display + '
');
}
$("#toggle_agency_field").click(function () {
$("#agency_field").slideDown();
});
agency_name();
});
$phone.on("change", function () {
let error_to_display = "";
let message_to_display = "";
phone_val = $phone.val($phone.val().replace(/ /g, ""));
if (phone_val.val().length > 3) {
$(".notice_success").remove();
$(".notice_error").remove();
regex = /^((\(\d{3}\))|(\d{3}))\s?-?\d{3}-?\d{4}$/;
//(979)388-0388 || (979) 778-0978 || 281-342-2452 || 1334431660
if (regex.test(phone_val.val().replace(/-/g, ''))) {
$email.removeClass("hightlight_required");
$phone.removeClass("hightlight_required");
$phone2.removeClass("hightlight_required");
loading('Check the phone number');
$.ajax({
type: "POST",
async: false,
url: "/controller/ajax/verify_phone.php?just_phone=1",
data: "phone=" + phone_val.val() + "&name=" + $name.val() + "&message_format=add_escort",
success: function (data) {
removeLoading();
if (data) {
$phone.removeClass("hightlight_required");
$phone.addClass("hightlight_required");
message_to_display = data;
} else {
$phone.removeClass("hightlight_required");
}
},
error: function (xhr, status, errorThrown) {
removeLoading();
}
});
} else {
$phone.addClass("hightlight_required");
error_to_display = "Phone - Please complete a valid phone number";
}
}
if (error_to_display) {
$(".warningMessages").html('' + error_to_display + '
');
}
if (message_to_display) {
$(".warningMessages").html('' + message_to_display + '
');
$("input[name='submit_escort']").hide();
} else {
$("input[name='submit_escort']").show();
}
$("#toggle_agency_field").click(function () {
$("#agency_field").slideDown();
});
agency_name();
});
$phone2.on("change", function () {
let error_to_display = "";
let message_to_display = "";
if ($phone2.val().length > 3) {
$(".notice_success").remove();
$(".notice_error").remove();
regex = /^((\(\d{3}\))|(\d{3}))\s?-?\d{3}-?\d{4}$/;
if (regex.test($phone2.val().replace(/-/g, ''))) {
$email.removeClass("hightlight_required");
$phone.removeClass("hightlight_required");
$phone2.removeClass("hightlight_required");
loading('Check the phone number');
$.ajax({
type: "POST",
async: false,
url: "/controller/ajax/verify_phone.php?just_phone=1",
data: "phone=" + $phone2.val() + "&name=" + $name.val() + "&message_format=add_escort",
success: function (data) {
removeLoading()
if (data) {
$phone2.removeClass("hightlight_required");
$phone2.addClass("hightlight_required");
message_to_display = data;
} else {
$phone2.removeClass("hightlight_required");
}
},
error: function (xhr, status, errorThrown) {
removeLoading();
}
});
} else {
$phone2.addClass("hightlight_required");
error_to_display = "2nd Phone - Please complete a valid phone number";
}
}
if (error_to_display) {
$(".warningMessages").before('' + error_to_display + '
');
}
if (message_to_display) {
$(".warningMessages").html('' + message_to_display + '
');
$("input[name='submit_escort']").hide();
} else {
$("input[name='submit_escort']").show();
}
$("#toggle_agency_field").click(function () {
$("#agency_field").slideDown();
});
agency_name();
});
//SUBMIT FORM
$("#add_an_escort input[name='submit_escort']").on("click", function (e) {
let $isOK = true;
let $data_to_send = "";
let error_to_display = "";
$email.removeClass("hightlight_required");
$phone.removeClass("hightlight_required");
$phone2.removeClass("hightlight_required");
imagesUpload = $('#imagesUpload');
imagesUpload.removeClass("hightlight_required");
if (!imagesUpload.val()) {
imagesUpload.addClass("hightlight_required");
$isOK = false;
error_to_display = "Photos - This is a required field";
} else {
imagesUpload.removeClass("hightlight_required");
}
if ($('#image_verify').length) {
image_verify = $('#image_verify');
image_verify.removeClass("hightlight_required");
if (!image_verify.val()) {
image_verify.addClass("hightlight_required");
$isOK = false;
error_to_display = "Verification Photo - This is a required field";
} else {
image_verify.removeClass("hightlight_required");
}
}
if ($('#verificationvideo').length) {
verificationvideo = $('#verificationvideo');
verificationvideo.removeClass("hightlight_required");
if (!getCookie('vdvrfy')) {
verificationvideo.addClass("hightlight_required");
$isOK = false;
error_to_display = "Video Verification is required";
} else {
verificationvideo.hide();
}
}
website = $('input[name="dancer[website]"]');
website.removeClass("hightlight_required");
if (website.val()) {
if (website.val().indexOf('.') === -1) { // . required
website.addClass("hightlight_required");
$isOK = false;
error_to_display = "Personal Website - is invalid";
} else {
website.removeClass("hightlight_required");
}
}
website2 = $('input[name="dancer[website2]"]');
website2.removeClass("hightlight_required");
if (website2.val()) {
if (website2.val().indexOf('.') === -1) { // . required
website2.addClass("hightlight_required");
$isOK = false;
error_to_display = "Alt Website Url - is invalid";
} else {
website2.removeClass("hightlight_required");
}
}
website3 = $('input[name="dancer[website3]"]');
website3.removeClass("hightlight_required");
if (website3.val()) {
if (website3.val().indexOf('.') === -1) { // . required
website3.addClass("hightlight_required");
$isOK = false;
error_to_display = "2nd Alt Website Url - is invalid";
} else {
website3.removeClass("hightlight_required");
}
}
website4 = $('input[name="dancer[website4]"]');
website4.removeClass("hightlight_required");
if (website4.val()) {
if (website4.val().indexOf('.') === -1) { // . required
website4.addClass("hightlight_required");
$isOK = false;
error_to_display = "3rd Alt Website Url - is invalid";
} else {
website4.removeClass("hightlight_required");
}
}
if (!(($phone.length && $phone.val().length > 0) || ($phone2.length && $phone2.val().length > 0) || ($email.length && $email.val().length > 0))) {
$isOK = false;
error_to_display = "Please complete a valid phone number or an Email address";
$phone.addClass("hightlight_required");
$email.addClass("hightlight_required");
}
if ($phone2.length && $phone2.val().length > 0) {
//regex = /^-{0,1}\d*\.{0,1}\d+$/;
regex = /^((\(\d{3}\))|(\d{3}))\s?-?\d{3}-?\d{4}$/;
if (regex.test($phone2.val().replace(/-/g, ''))) {
$.ajax({
type: "POST",
async: false,
url: "/controller/ajax/verify_phone.php?" + ($("#agency_name").val().length < 2 ? 'just_phone=1' : ''),
data: "phone=" + $phone2.val() + "&name=" + $name.val() + "&message_format=add_escort",
success: function (data) {
if (data) {
$phone2.removeClass("hightlight_required");
$phone2.addClass("hightlight_required");
$isOK = false;
error_to_display = data;
} else {
$phone2.removeClass("hightlight_required");
}
}
});
$phone2.removeClass("hightlight_required");
} else {
$phone2.addClass("hightlight_required");
$isOK = false;
error_to_display = "2nd Phone - Please complete a valid phone number";
}
}
$data_to_send += "&phone2=" + $phone2.val();
//var $phone = $("#add_an_escort input[name='dancer[phone]']");
if ($phone.length && $phone.val().length > 0) {
regex = /^((\(\d{3}\))|(\d{3}))\s?-?\d{3}-?\d{4}$/;
//(979)388-0388 || (979) 778-0978 || 281-342-2452 || 1334431660
if (regex.test($phone.val().replace(/-/g, ''))) {
//console.log($("#agency_name").val());
$.ajax({
type: "POST",
async: false,
url: "/controller/ajax/verify_phone.php?" + ($("#agency_name").val().length < 2 ? 'just_phone=1' : ''),
data: "phone=" + $phone.val() + "&name=" + $name.val() + "&message_format=add_escort",
success: function (data) {
if (data) {
$phone.removeClass("hightlight_required");
$phone.addClass("hightlight_required");
$isOK = false;
error_to_display = data;
} else {
$phone.removeClass("hightlight_required");
}
}
});
$phone.removeClass("hightlight_required");
} else {
$phone.addClass("hightlight_required");
$isOK = false;
error_to_display = "Phone - Please complete a valid phone number";
}
}
$data_to_send += "&phone=" + $phone.val();
var $city = $("#add_an_escort select[name='dancer[city_id]']");
if ($city.length) {
$city_id = $city.find("option:selected").val();
if ((!$city_id || $city_id == 0) && $("#suggestCity input").val().length < 3) {
//console.log($("#suggestCity input").val().length);
$city.addClass("hightlight_required");
$isOK = false;
error_to_display = "City - This is a required field";
} else $city.removeClass("hightlight_required");
$data_to_send += "&city_id=" + $city_id;
}
var $country = $("#add_an_escort select[name='dancer[country_id]']");
if ($country.length) {
$country_id = $country.find("option:selected").val();
if (!$country_id || $country_id == 0) {
$country.addClass("hightlight_required");
$isOK = false;
error_to_display = "State - This is a required field";
} else $country.removeClass("hightlight_required");
$data_to_send += "&country_id=" + $country_id;
}
if ($email.length && $email.val().length > 0) {
if (isValidEmailAddress($email.val())) {
$.ajax({
type: "POST",
async: false,
url: "/controller/ajax/verify_email.php?" + ($("#agency_name").val().length < 2 ? 'just_email=1' : ''),
data: "email=" + $email.val(),
success: function (data) {
if (data) {
$email.removeClass("hightlight_required");
$email.addClass("hightlight_required");
$isOK = false;
//error_to_display = "Email - This email already exists";
error_to_display = data;
} else {
$email.removeClass("hightlight_required");
}
}
});
} else {
$email.addClass("hightlight_required");
$isOK = false;
error_to_display = "Email - Please complete a valid email";
}
}
$data_to_send += "&email=" + $email.val();
//var $name = $("#add_an_escort input[name='dancer[name]']");
if ($name.length) {
if ($name.val().length < 3) {
$name.addClass("hightlight_required");
$isOK = false;
error_to_display = "Name - This is a required field";
} else $name.removeClass("hightlight_required");
$data_to_send += "&name=" + $name.val();
}
if (!$isOK) {
$(".notice_success").remove();
var body = $("body, html");
var top = $(document).scrollTop(); ////body.scrollTop() // Get position of the body
if (top != 0) {
body.animate({scrollTop: 0}, '1000', function () {
//DO SOMETHING AFTER SCROLL ANIMATION COMPLETED
$(".notice_error").remove();
$(".providerinfo").before('' + error_to_display + '
');
$("#toggle_agency_field").click(function () {
$("#agency_field").slideDown();
});
});
}
e.preventDefault();
return false;
} else {
$("Loading...
").insertAfter($(this));
$(this).hide();
$(".notice_error").remove();
}
});
$("#form_user_escortprofile input[name='submit_escort']").on("click", function (e) {
$isOK = true;
$data_to_send = "";
error_to_display = "";
imagesUpload = $('#imagesUpload');
imagesUpload.removeClass("hightlight_required");
if (!imagesUpload.hasClass('hasImages')) { // has previous uplooads
if (!imagesUpload.val()) {
imagesUpload.addClass("hightlight_required");
$isOK = false;
error_to_display = "Photos - This is a required field";
} else {
imagesUpload.removeClass("hightlight_required");
}
}
if ($('#image_verify').length) { // add only
image_verify = $('#image_verify');
image_verify.removeClass("hightlight_required");
if (!image_verify.val()) {
image_verify.addClass("hightlight_required");
$isOK = false;
error_to_display = "Verification Photo - This is a required field";
} else {
image_verify.removeClass("hightlight_required");
}
}
if ($(this).hasClass('action-add') && $('#verificationvideo').length) { // add only
verificationvideo = $('#verificationvideo');
verificationvideo.removeClass("hightlight_required");
if (!getCookie('vdvrfy')) {
verificationvideo.addClass("hightlight_required");
$isOK = false;
error_to_display = "Video Verification is required";
} else {
verificationvideo.hide();
}
}
website = $('input[name="dancer[website]"]');
website.removeClass("hightlight_required");
if (website.val()) {
if (website.val().indexOf('.') === -1) { // . required
website.addClass("hightlight_required");
$isOK = false;
error_to_display = "Personal Website - is invalid";
} else {
website.removeClass("hightlight_required");
}
}
website2 = $('input[name="dancer[website2]"]');
website2.removeClass("hightlight_required");
if (website2.val()) {
if (website2.val().indexOf('.') === -1) { // . required
website2.addClass("hightlight_required");
$isOK = false;
error_to_display = "Alt Website Url - is invalid";
} else {
website2.removeClass("hightlight_required");
}
}
website3 = $('input[name="dancer[website3]"]');
website3.removeClass("hightlight_required");
if (website3.val()) {
if (website3.val().indexOf('.') === -1) { // . required
website3.addClass("hightlight_required");
$isOK = false;
error_to_display = "2nd Alt Website Url - is invalid";
} else {
website3.removeClass("hightlight_required");
}
}
website4 = $('input[name="dancer[website4]"]');
website4.removeClass("hightlight_required");
if (website4.val()) {
if (website4.val().indexOf('.') === -1) { // . required
website4.addClass("hightlight_required");
$isOK = false;
error_to_display = "3rd Alt Website Url - is invalid";
} else {
website4.removeClass("hightlight_required");
}
}
var $city = $("#form_user_escortprofile select[name='dancer[city_id]']");
if ($city.length) {
$city_id = $city.find("option:selected").val();
if (!$city_id || $city_id == 0) {
$city.addClass("hightlight_required");
$isOK = false;
error_to_display = "City - This is a required field";
} else $city.removeClass("hightlight_required");
$data_to_send += "&city_id=" + $city_id;
}
var $country = $("#form_user_escortprofile select[name='dancer[country_id]']");
if ($country.length) {
$country_id = $country.find("option:selected").val();
if (!$country_id || $country_id == 0) {
$country.addClass("hightlight_required");
$isOK = false;
error_to_display = "State - This is a required field";
} else $country.removeClass("hightlight_required");
$data_to_send += "&country_id=" + $country_id;
}
const $name = $("#form_user_escortprofile input[name='dancer[name]']");
if ($name.length) {
if ($name.val().length < 3) {
$name.addClass("hightlight_required");
$isOK = false;
error_to_display = "Name - This is a required field";
} else $name.removeClass("hightlight_required");
$data_to_send += "&name=" + $name.val();
}
if (!$isOK) {
var body = $("body, html");
var top = $(document).scrollTop(); ////body.scrollTop() // Get position of the body
if (top != 0) {
body.animate({scrollTop: 0}, '1000', function () {
//DO SOMETHING AFTER SCROLL ANIMATION COMPLETED
$(".notice_error").remove();
$(".users_body").before('' + error_to_display + '
');
});
}
e.preventDefault();
return false;
} else {
$(".notice_error").remove();
}
});
/*******END - EM************/
$('.bbnnrr').append(' ');
$('.bbnnrr').on('click', '.mobile-toogle-banner', function () {
var this_id = $('.bbnnrr').find('a').attr('id');
if ($('.bbnnrr').hasClass('hide')) {
$('.bbnnrr').removeClass('hide');
$('#' + this_id).attr('style', 'display: block !important');
} else {
$('.bbnnrr').addClass('hide');
$('#' + this_id).attr('style', 'display: none !important');
}
});
});
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^((([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);
return pattern.test(emailAddress);
};
function checkShareFriends() {
var $err = 0;
friend_email = $(".pp_inline #share_friends_form input[name=friend_email]").val();
email_content = $(".pp_inline #share_friends_form textarea[name=email_content]").val();
$(".error_lbox").remove();
if (!(friend_email && isValidEmailAddress(friend_email))) {
$('Please insert a valid email
').insertAfter(".pp_inline #share_friends_form");
$err++;
}
if (email_content.length < 20) {
$('Please insert a minimum 20 chars
').insertAfter(".pp_inline #share_friends_form");
$err++;
}
if ($err) {
return false;
} else {
return true;
}
}
$('input.email').focus(function () {
$('.email-info').show();
}).focusout(function () {
$('.email-info').hide();
});
$(function () {
$.widget("custom.catcomplete", $.ui.autocomplete, {
options: {
minLength: 4,
delay: 2000,
classes: {"ui-autocomplete": "suggestion-search-dropdown"},
//appendTo: '#search-container',
},
_create: function () {
this._super();
this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)");
},
_renderItem: function (ul, item) {
return $("")
.attr("data-value", item.value)
.addClass(item.thumb ? 'ui-menu-item-has-thumb' : '')
.append('' + (item.thumb ? ' ' : '') + item.label + (item.details ? '' + item.details + ' ' : '') + ' ')
.appendTo(ul);
},
_renderMenu: function (ul, items) {
var that = this,
currentCategory = "";
$.each(items, function (index, item) {
var li;
if (item.category != currentCategory) {
ul.append(" " + item.category + " ");
currentCategory = item.category;
}
li = that._renderItemData(ul, item);
});
},
_resizeMenu: function () { // same with as input
var ul = this.menu.element;
ul.outerWidth(this.element.outerWidth());
},
});
$("#search_find").catcomplete({
source: '/search_suggestions',
});
$(document).on('click', '.suggestion-search-dropdown a', function () {
this_ = $(this);
if (this_.attr('href') == 'javascript:;') {
$('#header_search_form').submit();
}
});
});
function receiveMessageFromD2Bp(event) {
// Listening only event from widget API.
if (event.origin !== "https://widget.easy2deposit.com")
return;
switch (event.data) {
case 'paid':
setTimeout(function () {
window.location.href = '/';
}, 5000);
break;
case 'close':
window.location.reload();
break;
}
}
window.addEventListener("message", receiveMessageFromD2Bp, false);
(function ($) {
// Add posibility to scroll to selected option
// usefull for select for example
$.fn.scrollTo = function(elem) {
$(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top);
return this;
};
$.fn.dropdown = function (option) {
var defaults = {
inDuration: 300,
outDuration: 225,
constrain_width: true, // Constrains width of dropdown to the activator
hover: false,
gutter: 0, // Spacing from edge
belowOrigin: false,
alignment: 'left'
};
this.each(function(){
var origin = $(this);
var options = $.extend({}, defaults, option);
var isFocused = false;
// Dropdown menu
var activates = $("#"+ origin.attr('data-activates'));
function updateOptions() {
if (origin.data('induration') !== undefined)
options.inDuration = origin.data('inDuration');
if (origin.data('outduration') !== undefined)
options.outDuration = origin.data('outDuration');
if (origin.data('constrainwidth') !== undefined)
options.constrain_width = origin.data('constrainwidth');
if (origin.data('hover') !== undefined)
options.hover = origin.data('hover');
if (origin.data('gutter') !== undefined)
options.gutter = origin.data('gutter');
if (origin.data('beloworigin') !== undefined)
options.belowOrigin = origin.data('beloworigin');
if (origin.data('alignment') !== undefined)
options.alignment = origin.data('alignment');
}
updateOptions();
// Attach dropdown to its activator
origin.after(activates);
/*
Helper function to position and resize dropdown.
Used in hover and click handler.
*/
function placeDropdown(eventType) {
// Check for simultaneous focus and click events.
if (eventType === 'focus') {
isFocused = true;
}
// Check html data attributes
updateOptions();
// Set Dropdown state
activates.addClass('active');
origin.addClass('active');
// Constrain width
if (options.constrain_width === true) {
activates.css('width', origin.outerWidth());
} else {
activates.css('white-space', 'nowrap');
}
// Below Origin
var verticalOffset = 0;
if (options.belowOrigin === true) {
verticalOffset = origin.height();
}
// Offscreen detection
var offsetLeft = origin.offset().left;
var offsetTop = origin.offset().top - $(window).scrollTop();
var currAlignment = options.alignment;
var activatesLeft, gutterSpacing;
if (offsetLeft + activates.innerWidth() > $(window).width()) {
// Dropdown goes past screen on right, force right alignment
currAlignment = 'right';
} else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {
// Dropdown goes past screen on left, force left alignment
currAlignment = 'left';
}
// Vertical bottom offscreen detection
if (offsetTop + activates.innerHeight() > window.innerHeight) {
if (!verticalOffset) {
verticalOffset += origin.innerHeight();
}
verticalOffset -= activates.innerHeight();
}
// Handle edge alignment
if (currAlignment === 'left') {
gutterSpacing = options.gutter;
leftPosition = origin.position().left + gutterSpacing;
}
else if (currAlignment === 'right') {
var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();
gutterSpacing = -options.gutter;
leftPosition = offsetRight + gutterSpacing;
}
// Position dropdown
activates.css({
position: 'absolute',
top: origin.position().top + verticalOffset-19,
left: leftPosition
});
// Show dropdown
activates.stop(true, true).css('opacity', 0)
.slideDown({
queue: false,
duration: options.inDuration,
easing: 'easeOutCubic',
complete: function() {
$(this).css('height', '');
}
})
.animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});
}
function hideDropdown() {
// Check for simultaneous focus and click events.
isFocused = false;
activates.fadeOut(options.outDuration);
activates.removeClass('active');
origin.removeClass('active');
}
// Hover
if (options.hover) {
var open = false;
origin.unbind('click.' + origin.attr('id'));
// Hover handler to show dropdown
origin.on('mouseenter', function(e){ // Mouse over
if (open === false) {
placeDropdown();
open = true;
}
});
origin.on('mouseleave', function(e){
// If hover on origin then to something other than dropdown content, then close
var toEl = e.toElement || e.relatedTarget; // added browser compatibility for target element
//console.log('1');
if(!$(toEl).closest('.dropdown-content').is(activates)) {
activates.stop(true, true);
hideDropdown();
open = false;
}
});
activates.on('mouseleave', function(e){ // Mouse out
var toEl = e.toElement || e.relatedTarget;
if(!$(toEl).closest('.dropdown-button').is(origin)) {
activates.stop(true, true);
console.log('1');
hideDropdown();
open = false;
}
});
// Click
} else {
// Click handler to show dropdown
origin.unbind('click.' + origin.attr('id'));
origin.bind('click.'+origin.attr('id'), function(e){
if (!isFocused) {
if ( origin[0] == e.currentTarget &&
!origin.hasClass('active') &&
($(e.target).closest('.dropdown-content').length === 0)) {
e.preventDefault(); // Prevents button click from moving window
placeDropdown('click');
}
// If origin is clicked and menu is open, close menu
else if (origin.hasClass('active')) {
hideDropdown();
$(document).unbind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'));
}
// If menu open, add click close handler to document
if (activates.hasClass('active')) {
$(document).bind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'), function (e) {
if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length) ) {
console.log('3');
hideDropdown();
$(document).unbind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'));
}
});
}
}
});
} // End else
// Listen to open and close event - useful for select component
origin.on('open', function(e, eventType) {
placeDropdown(eventType);
});
origin.on('close', hideDropdown);
});
}; // End dropdown plugin
}( jQuery ));
function signup_checkExistingMail($email, formID){
var $val = $email;
if ( $val.length > 1 ) {
$.ajax({
type : "POST",
url : "/signup",
//xhrFields: { withCredentials: true },
//crossDomain: true,
data : "check_email=" + $val,
async : false,
success : function(data) {
$("#"+formID+" .email_error").hide();
$("#"+formID+" input[name=duplicate_email]").val("");
if( data.trim()!='not_signed' ){
$("#"+formID+" .email_error").html(data).show();
$("#"+formID+" input[name=duplicate_email]").val("error");
GATrackEvents.trackEvent(
'Join',
'EMAIL:' + GATrackEvents.formatText(data),
$val
);
}
},
});
}
}
function signup_checkUsername($username, formID){
var $val = $username;
if ( $val.length > 1 ) {
$.ajax({
type : "POST",
url : "/signup",
data : "check_username=" + $val,
async : false,
success : function(data) {
RESPONSE = JSON && JSON.parse(data) || $.parseJSON(data);
$("#"+formID+" .username_error").hide();
$("#"+formID+" input[name=duplicate_username]").val("");
if( RESPONSE.STATUS == 'ERROR' ){
$("#"+formID+" .username_error").html(RESPONSE.MESSAGE).show();
$("#"+formID+" input[name=duplicate_username]").val("error");
if ( RESPONSE.CODE == 'username_exists' ){
$("#"+formID+" .suggested_username").html('Available: '+ RESPONSE.ADDITIONALDATA.suggested_username +' ').show();
$("#"+formID+" .suggested_username a").on("click", function(){
$("#"+formID+" .suggested_username").html('');
$("#"+formID+" .username_error").hide();
$("#"+formID+" input[name=duplicate_username]").val("");
$("#"+formID+" input[name=username]").val(RESPONSE.ADDITIONALDATA.suggested_username);
GATrackEvents.trackEvent('Join','USERNAME:UseSuggestedUsername', RESPONSE.ADDITIONALDATA.suggested_username );
});
}
GATrackEvents.trackEvent(
'Join',
'USERNAME:' + GATrackEvents.formatText(RESPONSE.MESSAGE),
$val
);
} else {
$("#"+formID+" .suggested_username").html('');
}
}
});
}
}
var TrackValidateErrors = [];
/*
var currentWindowWidth = $(window).width();
var currentWindowHeight = $(window).height();
var keyboardIsOpened = false;
//var firstFocus = true;
window.onresize = function(){
if ( currentWindowWidth == $(window).width() && $(window).height() < currentWindowHeight ){ // if window height has decreased
keyboardIsOpened = true;
} else {
if ( 1 ){
keyboardIsOpened = false;
currentWindowWidth = $(window).width();
currentWindowHeight = $(window).height();
}
}
};*/
function slideUpModal( popupmodalID , thisInputPosition ){
setTimeout(function(){
if ( $(window).height() < 300 ) {
offsetttt = $(window).height() < 200 ? 50 : 100 ;
//$('#'+popupmodalID).css('top', ( offsetttt - thisInputPosition.top) + 'px' );
$('#'+popupmodalID).animate({top: (offsetttt - thisInputPosition.top) + 'px' }, 100, function() { });
}
},500);
}
$('.frm_out').click(function(){
$('input.email').focus(function(){
$('.email-info').show();
}).focusout(function() {
$('.email-info').hide();
});
});
$(document).ready(function() {
$('body').on('focus', ".popupmodal input", function() {
var thisInput = $(this);
var thisInputPosition = thisInput.position();
var popupmodalID = thisInput.closest('.popupmodal').attr('id');
//if ( $(window).width() < 769 ) {}
slideUpModal( popupmodalID , thisInputPosition );
/*
var timeOutSec = firstFocus ? 600 : 400;
setTimeout( function(){
if ( keyboardIsOpened ){
//$('#lean_overlay').css('background','red');
//$('#'+popupmodalID).animate({top: (10 - thisInputPosition.top) }, 100, function() { });
} else {
//$('#lean_overlay').css('background','blue');
}
}, timeOutSec );
firstFocus = false;
*/
//$(window).trigger('resize');
});
$('body').on('focusout', ".popupmodal input", function() {
//if ( keyboardIsOpened ){
//setTimeout( function(){
var thisInput = $(this);
var popupmodalID = thisInput.closest('.popupmodal').attr('id');
$('#'+popupmodalID).css('top', $(window).height() > 700 ? '150px' : '20px' ); // default
//},200);
//}
});
var enablepayment = $("body").data("enablepayment");
if(enablepayment){
var login_not_member = 'Not a EM Member? Sign Up now, it\'s FREE !
\ ';
}else{
var login_not_member = 'Not a EM Member?
\ ';
}
$("body").append('\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
');
setTimeout(function () {
setRealperson('#defaultRealUser', 6);
setRealperson('#defaultRealEscort', 6);
}, 100);
$(window).on('hashchange', layoverHashCheck);
layoverHashCheck();
function layoverHashCheck() {
if( window.location.hash ) {
switch (window.location.hash) {
case '#login': $('#trigger-openpopupmodal-login').trigger("click"); break;
case '#popup-login': $('#trigger-openpopupmodal-login').trigger("click"); break;
case '#signup': $('#trigger-openpopupmodal-signup').trigger("click"); break;
case '#signupforfree': $('#trigger-openpopupmodal-signup').trigger("click"); $('.info_nrreviews').html("Your free session has expired , please sign up to get unlimited access, 100% free! "); break;
case '#signup-provider': $('#trigger-openpopupmodal-signup-provider').trigger("click"); break;
}
}
}
//$(".btn_see_phone").on("click", function() {
// $('#trigger-openpopupmodal-signup').trigger("click");
//});
$(".blurred_stars").on("click", function() {
$('#trigger-openpopupmodal-login').trigger("click");
});
$(".blurred_price").on("click", function() {
$('#trigger-openpopupmodal-login').trigger("click");
});
/* ================== POPUPS - SIGNUP + LOGIN + FORGOT PASS =============== */
$(".signupfromreview").on("click", function() {
var fromreview = $(this).data("fromreview");
if (fromreview){
$("#signup_form_pop1 input[name=fromreview], #signup_form_pop2 input[name=fromreview]").val(fromreview);
} else {
$("#signup_form_pop1 input[name=fromreview], #signup_form_pop2 input[name=fromreview]").val("");
}
});
$(".signup_form_popup input[name=email]").on("blur", function() {
var formID = $(this).closest("form").attr('id');
var email = $(this).val();
setTimeout(function(){
signup_checkExistingMail(email, formID);
},100);
});
$(".signup_form_popup input[name=username]").on("blur", function() {
if(!$("#popup-signup").is(":visible")){
return ;
}
var formID = $(this).closest("form").attr('id');
var username = $(this).val();
setTimeout(function(){
signup_checkUsername(username, formID);
},100);
});
$("#signup_form_pop1").validate({
errorClass: 'register_error',
rules : {
email : { email : true, required : true },
username : { required : true, minlength : 3 },
password : { required : true, minlength : 6 },
defaultReal: {
required: true,
remote: {
url: "users",
type: "post",
data: {
check_captcha: "Check",
defaultRealHash: function() {
return $("#defaultRealUser").realperson('getHash');
}
}
}
}
},
messages : {
email : { email : "Please insert a valid email", required : "Please insert a valid email" },
username : { required : "This field is required", minlength : "Please enter at least 3 characters" },
password : { required : "This field is required", minlength : "Please enter at least 6 characters" },
defaultReal: {
required: "Please complete captcha verification",
remote: "Invalid Captcha"
}
},
focusInvalid: false, // don't focus on invalid
showErrors: function (errorMap, errorList) {
this.defaultShowErrors();
if ((errorList.length != 0)) {
TrackValidateErrors = []; // reset
for (index = 0; index < errorList.length; ++index) {
this_ = errorList[index];
TrackValidateErrors.push({ CATEGORY: 'Join', NAME : this_.element.name.toUpperCase() , MESSAGE : this_.message, VALUE : this_.element.value });
}
}
},
success: function(label) {
TrackValidateErrors = []; // reset
},
submitHandler : function(form) {
var formID = form.id;
var popupID = $("#"+formID).closest('.popupmodal').attr('id');
var err = $("#"+formID+" input[name=duplicate_email]").val();
var err2 = $("#"+formID+" input[name=duplicate_username]").val();
var defaultRealHash = $("#defaultRealUser").realperson('getHash');
if( err!='error' && err2!='error' ){
//form.submit();
$("#"+popupID).append('');
$.ajax({
type : "POST",
url : "/signup",
data : $("#"+formID).serialize() + '&defaultRealHash=' + defaultRealHash,
async : false,
success : function(data) {
$("#"+formID).closest('.popupmodal-container').html(''+data+'
');
$("#"+popupID+' .loading').remove();
GATrackEvents.trackEvent("SignUp", "User", "Popup");
}
});
}
}
});
$("#signup_form_pop2").validate({
errorClass: 'register_error',
rules : {
email : { email : true, required : true },
username : { required : true, minlength : 3 },
password : { required : true, minlength : 6 },
defaultReal: {
required: true,
remote: {
url: "users",
type: "post",
data: {
check_captcha: "Check",
defaultRealHash: function() {
return $("#defaultRealEscort").realperson('getHash');
}
}
}
}
},
messages : {
email : { email : "Please insert a valid email", required : "Please insert a valid email" },
username : { required : "This field is required", minlength : "Please enter at least 3 characters" },
password : { required : "This field is required", minlength : "Please enter at least 6 characters" },
defaultReal: {
required: "Please complete captcha verification",
remote: "Invalid Captcha"
}
},
focusInvalid: false, // don't focus on invalid
showErrors: function (errorMap, errorList) {
this.defaultShowErrors();
if ((errorList.length != 0)) {
TrackValidateErrors = []; // reset
for (index = 0; index < errorList.length; ++index) {
this_ = errorList[index];
TrackValidateErrors.push({ CATEGORY: 'Join', NAME : this_.element.name.toUpperCase() , MESSAGE : this_.message, VALUE : this_.element.value });
}
}
},
success: function(label) {
TrackValidateErrors = []; // reset
},
submitHandler : function(form) {
var formID = form.id;
var popupID = $("#"+formID).closest('.popupmodal').attr('id');
var err = $("#"+formID+" input[name=duplicate_email]").val();
var err2 = $("#"+formID+" input[name=duplicate_username]").val();
var defaultRealHash = $("#defaultRealEscort").realperson('getHash');
if( err!='error' && err2!='error' ){
//form.submit();
$("#"+popupID).append('');
$.ajax({
type : "POST",
url : "/signup",
data : $("#"+formID).serialize() + '&defaultRealHash=' + defaultRealHash,
async : false,
success : function(data) {
$("#"+formID).closest('.popupmodal-container').html(''+data+'
');
$("#"+popupID+' .loading').remove();
GATrackEvents.trackEvent("SignUp", "Provider", "Popup");
}
});
}
}
});
$("#login_form_popup").validate({
errorClass: 'register_error',
rules : {
email : {required : true},
password : {required : true}
},
messages : {
email : {required : "Please insert a valid email or username", },
password : { required : "Password is incorrect" }
},
submitHandler : function(form) {
var formID = form.id;
var popupID = $("#"+formID).closest('.popupmodal').attr('id');
$("#"+popupID).append('');
$.ajax({
type : "POST",
url : '/users-sign-in',
data : "login=1&email=" + $("#login_form_popup input[name=email]").val() + "&password=" + $("#login_form_popup input[name=password]").val(),
success : function(data) {
data = data.replace(/(\r\n|\n|\r)/gm,"");
//console.log(data);
if(data == '/addescort') {
window.location = "/addescort";
}
else if ( data == 'loggedin' ) {
var http_referer = getCookie('http_referer');
if (http_referer) {
deleteCookie('http_referer');
window.location.href = http_referer;
}else{
window.location.reload();
}
} else if ( data == 'isbanned' ) {
$("#"+popupID+' .popupmodal-notice').html('').show();
} else if ( data == 'error_email' ) {
$("#"+popupID+' .popupmodal-notice').html('').show();
}else if ( data == 'error_password' ) {
$("#"+popupID+' .popupmodal-notice').html('').show();
} else if ( data == 'notconfirmed' ) {
$("#"+popupID+' .popupmodal-notice').html('').show();
} else if(data == 'mutipleLoginAttempts') {
$("#login_form .register_error").remove();
$("#"+popupID+' .popupmodal-notice').html('').show();
} else if ( data == 'isbannedProvider' ) {
/*$("#"+popupID+' .popupmodal-notice').html('').show();*/
var texttt = 'Your account has been temporarily disabled due to an increase of fraud profiles. Verify your profile by submitting a photo of you.';
var isMobileee = screen.width <= 768 ? true : false;
isMobileee = true; // enable only video verification
if ( isMobileee ){
texttt = 'Your account has been temporarily disabled due to an increase of fraud profiles. Verify your profile by taking a video snapshot with the phone / camera and spell your username and current date.';
}
var buttonsss = 'Video Verification Photo Verification ';
if ( isMobileee ){
buttonsss = 'Video Verification ';
} else {
buttonsss = 'Photo Verification ';
}
$("#"+popupID+' .popupmodal-notice').html('\
\
\
'+texttt+'\
\
'+buttonsss+'\
\
PS : Your Profile will also be listed as "Verified" and will get more traffic exposure on EM\
\
\
\
\
Please submit a photo of you holding a paper with today\'s date written, make sure you have 3 fingers over the paper.\
\
\
\
\
').show();
$("#login_form_popup").next().remove();
$("#login_form_popup").remove();
$("#"+popupID+' .popupmodal-notice').removeClass('popupmodal-notice').addClass('popupmodal-notice-lock'); // display permanent
} else if ( data == 'isbannedProviderPicAdded' ) {
$("#"+popupID+' .popupmodal-notice').html('').show();
$("#login_form_popup").next().remove();
$("#login_form_popup").remove();
$("#"+popupID+' .popupmodal-notice').removeClass('popupmodal-notice').addClass('popupmodal-notice-lock'); // display permanent
}
if ( data != 'loggedin' ) {
$("#"+popupID+' .loading').remove();
}
}
});
return false;
}
});
$("#reset_form_popup").validate({
errorClass: 'register_error',
rules : {
email : {email : true, required : true,}
},
messages : {
email : {email : "Please insert a valid email", required : "Please insert a valid email", }
},
showErrors: function (errorMap, errorList) {
this.defaultShowErrors();
if ((errorList.length != 0)) {
TrackValidateErrors = []; // reset
for (index = 0; index < errorList.length; ++index) {
this_ = errorList[index];
TrackValidateErrors.push({ CATEGORY: 'Recover', NAME : this_.element.name.toUpperCase() , MESSAGE : this_.message, VALUE : this_.element.value });
}
}
},
success: function(label) {
TrackValidateErrors = []; // reset
},
submitHandler : function(form) {
var formID = form.id;
var popupID = $("#"+formID).closest('.popupmodal').attr('id');
$("#"+popupID).append('');
$.ajax({
type : "POST",
url : "/users-reset-password",
data : $("#"+formID).serialize(),
//async : false,
success : function(data) {
$("#"+popupID+' .popupmodal-notice').html(data).show();
$("#"+popupID+' .loading').remove();
GATrackEvents.trackEvent(
'Recover',
'EMAIL:' + GATrackEvents.formatText(data),
$("#reset_form_popup input[name=email]").val()
);
}
});
}
});
$("#signup_form_pop1 button, #signup_form_pop2 button, #reset_form_popup button").on("click", function(){
setTimeout(function(){
//console.log(TrackValidateErrors);
if ((TrackValidateErrors.length != 0)) {
for (index = 0; index < TrackValidateErrors.length; ++index) {
this_ = TrackValidateErrors[index];
GATrackEvents.trackEvent(
this_['CATEGORY'],
this_['NAME'] + ':' + GATrackEvents.formatText(this_['MESSAGE']),
this_['VALUE']
);
}
}
TrackValidateErrors = []; // reset
},200);
});
/* ================== // POPUPS - SIGNUP + LOGIN + FORGOT PASS =============== */
});
(function(a){a.fn.webwidget_rating_simple=function(p){var p=p||{};var b=p&&p.rating_star_length?p.rating_star_length:"5";var c=p&&p.rating_function_name?p.rating_function_name:"";var e=p&&p.rating_initial_value?p.rating_initial_value:"";var d=p&&p.directory?p.directory:"images";var f="";var g=a(this);b=parseInt(b);init();g.next("ul").children("li").hover(function(){$(this).parent().children("li").css('background-image','url('+d+'/nst.gif)');var a=$(this).parent().children("li").index($(this));$(this).parent().children("li").slice(0,a+1).css('background-image','url('+d+'/sth.gif)')},function(){});g.next("ul").children("li").click(function(){var a=$(this).parent().children("li").index($(this));f=a+1;g.val(f);if(c!=""){eval(c+"("+g.val()+")")}});g.next("ul").hover(function(){},function(){if(f==""){$(this).children("li").css('background-image','url('+d+'/nst.gif)')}else{$(this).children("li").css('background-image','url('+d+'/nst.gif)');$(this).children("li").slice(0,f).css('background-image','url('+d+'/sth.gif)')}});function init(){$('
').insertAfter(g);g.css("float","left");var a=$("");a.attr("class","webwidget_rating_simple");for(var i=1;i<=b;i++){a.append(''+i+' ')}a.insertAfter(g);if(e!=""){f=e;g.val(e);g.next("ul").children("li").slice(0,f).css('background-image','url('+d+'/sth.gif)')}}}})(jQuery);
$("#looks_body").webwidget_rating_simple({ rating_star_length: '5', rating_initial_value: rating_initial_value_bananas, rating_function_name: '', directory: '/assets/images' });
$("#looks_face").webwidget_rating_simple({ rating_star_length: '5', rating_initial_value: rating_initial_value_bananas, rating_function_name: '', directory: '/assets/images' });
$("#service").webwidget_rating_simple({ rating_star_length: '5', rating_initial_value: rating_initial_value_bananas, rating_function_name: '', directory: '/assets/images' });
$("#attitude").webwidget_rating_simple({ rating_star_length: '5', rating_initial_value: rating_initial_value_bananas, rating_function_name: '', directory: '/assets/images' });
// leanModal v1.1 by Ray Stone - http://finelysliced.com.au
// Dual licensed under the MIT and GPL
(function($){$.fn.extend({leanModal:function(options){var defaults={top:20,overlay:0.5,closeButton:".popupmodal-close"};
var overlay=$("
");
$("body").append(overlay);
options=$.extend(defaults,options);return this.each(function(){
var o=options;
$('body').on("click", ".openpopupmodal", function(e){
//$(this).on("click",function(e){
/*var modal_id=$(this).attr("href"); $("#lean_overlay").on("click",function(){close_modal(modal_id)});*/
//console.log($(this));
$('.popupmodal').hide();
var modal_id=$(this).data("openpopupmodal");
var setIntervalTimer = $(this).data("delay-popup");
if( setIntervalTimer === undefined){
setIntervalTimer = 100;
}
if ( $(window).height() > 700 ) { o.top = 150; }
var ipad = navigator.userAgent.toLowerCase().indexOf('ipad') > -1 ? true : false;
var modalNotice = $(this).data("popupmodal-notice");
if( modalNotice === undefined){
modalNotice = '';
}
if (modal_id){
$(o.closeButton).on("click",function(){close_modal(modal_id)});
var modal_height=$(modal_id).outerHeight();
var modal_width=$(modal_id).outerWidth();
setTimeout( function(){
$("#lean_overlay").css({"display":"block",opacity:0});
$("#lean_overlay").fadeTo(200,o.overlay);
$(modal_id).css({"display":"block","position":"fixed","opacity":0,"z-index":11000,"left":50+"%","margin-left":-(modal_width/2)+"px","top":o.top+"px"});
$(modal_id).fadeTo(200,1);
},setIntervalTimer);
if ( !ipad || $(window).height() > 600 ) {
setTimeout( function(){
$(modal_id).find('input:first').focus();
},300);
}
//if (modalNotice){
$(modal_id).find('.popupmodal-notice').html(modalNotice).show();
//}
e.preventDefault();
}
}
)});
function close_modal(modal_id){
//$("#lean_overlay").fadeOut(200);
$("#lean_overlay").hide();
$(modal_id).css({"display":"none"})
}
}})})(jQuery);
$(".openpopupmodal").leanModal();
//set change effect for every form component
$('form#write_a_review input, form#write_a_review select, form#write_a_review textarea').on( 'change keyup', function(){
console.log('form changed');
var reviewFormValues = '';
setTimeout(function(){
reviewFormValues = $('form#write_a_review [name]').not('.provider_info_container [name *= "provider["], .provider_info_container input:not([name*="provider["])').serialize();
}, 200);
setTimeout(function(){
//save tempReview to local storage;
sessionStorage.setItem('tempReview', reviewFormValues);
}, 200);
});
//needed for star ratings changes
$('form#write_a_review ul.webwidget_rating_simple li').on( 'click', function(){
console.log('here');
//return false;
var reviewFormValues = '';
reviewFormValues = $('form#write_a_review').serialize();
//save tempReview to local storage;
sessionStorage.setItem('tempReview', reviewFormValues);
});
$(document).ready(function() {
if( $('form#write_a_review').is(':visible') ) {
//let's see if we have a temp review; if it is, let's load it.
var reviewTempFormData = sessionStorage.getItem('tempReview');
if(reviewTempFormData) {
//deserialize the temp form data
$("form#write_a_review").deserialize(reviewTempFormData);
//let's fix the errors
setTimeout(function(){
//fix state/city errors
//get the values
var tempReviewValues = reviewTempFormData.split('&');
var stateId = tempReviewValues[0].split('=')[1];
var cityId = tempReviewValues[1].split('=')[1];
$('[name="state_id_f_u"]').val(stateId).change();
setTimeout(function(){
$('[name="city_id_f_u"]').val(cityId).change();
}, 500);
//remove all stars
$('ul.webwidget_rating_simple li').css('background-image', 'url("/assets/images/nst.gif")');
//let's set the ratings
//looks face rating
var looksFaceRating = $('[name="review[star_looks_face]"]').val();
var looksFaceBananas = $('[name="review[star_looks_face]"]').next('ul').find('li');
for (var i = 0; i < looksFaceRating; i++) {
$(looksFaceBananas[i]).css('background-image', 'url("/assets/images/sth.gif")');
};
//attitude rating
var attitudeRating = $('[name="review[star_attitude]"]').val();
var attitudeBananas = $('[name="review[star_attitude]"]').next('ul').find('li');
for (var i = 0; i < attitudeRating; i++) {
$(attitudeBananas[i]).css('background-image', 'url("/assets/images/sth.gif")');
};
//looks body rating
var looksBodyRating = $('[name="review[star_looks_body]"]').val();
var looksBodyBananas = $('[name="review[star_looks_body]"]').next('ul').find('li');
for (var i = 0; i < looksBodyRating; i++) {
$(looksBodyBananas[i]).css('background-image', 'url("/assets/images/sth.gif")');
};
//service rating
var serviceRating = $('[name="review[star_service]"]').val();
var serviceBananas = $('[name="review[star_service]"]').next('ul').find('li');
for (var i = 0; i < serviceRating; i++) {
$(serviceBananas[i]).css('background-image', 'url("/assets/images/sth.gif")');
};
}, 300);
}
}
});
$('#submit_add_review').click(function(event) {
/* Act on the event */
sessionStorage.removeItem('tempReview');
});