Notice: Constant ENV_CONFIGURATION_IMPORT_RESALES_NPT already defined in /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php on line 211

Warning: Use of undefined constant ENV_WK_RO_API_V6_AGENCY_FILTER_OWN_SALE - assumed 'ENV_WK_RO_API_V6_AGENCY_FILTER_OWN_SALE' (this will throw an Error in a future version of PHP) in /home/h00/public_html/sd/sh4u/inc/inc.environment.php on line 116

Warning: Use of undefined constant ENV_WK_RO_API_V6_AGENCY_FILTER_OWN_SHORT - assumed 'ENV_WK_RO_API_V6_AGENCY_FILTER_OWN_SHORT' (this will throw an Error in a future version of PHP) in /home/h00/public_html/sd/sh4u/inc/inc.environment.php on line 117

Warning: Use of undefined constant ENV_WK_RO_API_V6_AGENCY_FILTER_OWN_LONG - assumed 'ENV_WK_RO_API_V6_AGENCY_FILTER_OWN_LONG' (this will throw an Error in a future version of PHP) in /home/h00/public_html/sd/sh4u/inc/inc.environment.php on line 118

Warning: Cannot modify header information - headers already sent by (output started at /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php:211) in /home/h00/public_html/sd/sh4u/mn/lib/Minify.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php:211) in /home/h00/public_html/sd/sh4u/mn/lib/Minify.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php:211) in /home/h00/public_html/sd/sh4u/mn/lib/Minify.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php:211) in /home/h00/public_html/sd/sh4u/mn/lib/Minify.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php:211) in /home/h00/public_html/sd/sh4u/mn/lib/Minify.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php:211) in /home/h00/public_html/sd/sh4u/mn/lib/Minify.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /home/h00/public_html/sd/sh4u/inc/inc.qresod.sh4u.php:211) in /home/h00/public_html/sd/sh4u/mn/lib/Minify.php on line 335
/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; }catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("');else lyr1=$('');if(opts.theme) lyr2=$('');else lyr2=$('');if(opts.theme&&full){s='';} else if(opts.theme){s='';} else if(full){s='';} else{s='';} lyr3=$(s);if(msg){if(opts.theme){lyr3.css(themedCSS);lyr3.addClass('ui-widget-content');} else lyr3.css(css);} if(!opts.theme) lyr2.css(opts.overlayCSS);lyr2.css('position',full?'fixed':'absolute');if(msie||opts.forceIframe) lyr1.css('opacity',0.0);var layers=[lyr1,lyr2,lyr3],$par=full?$('body'):$(el);$.each(layers,function(){this.appendTo($par);});if(opts.theme&&opts.draggable&&$.fn.draggable){lyr3.draggable({handle:'.ui-dialog-titlebar',cancel:'li'});} var expr=setExpr&&(!$.support.boxModel||$('object,embed',full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.support.boxModel) $('html,body').css('height','100%');if((ie6||!$.support.boxModel)&&!full){var t=sz(el,'borderTopWidth'),l=sz(el,'borderLeftWidth');var fixT=t?'(0 - '+t+')':0;var fixL=l?'(0 - '+l+')':0;} $.each(layers,function(i,o){var s=o[0].style;s.position='absolute';if(i<2){if(full) s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');else s.setExpression('height','this.parentNode.offsetHeight + "px"');if(full) s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');else s.setExpression('width','this.parentNode.offsetWidth + "px"');if(fixL)s.setExpression('left',fixL);if(fixT)s.setExpression('top',fixT);} else if(opts.centerY){if(full)s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');s.marginTop=0;} else if(!opts.centerY&&full){var top=(opts.css&&opts.css.top)?parseInt(opts.css.top,10):0;var expression='((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';s.setExpression('top',expression);}});} if(msg){if(opts.theme) lyr3.find('.ui-widget-content').append(msg);else lyr3.append(msg);if(msg.jquery||msg.nodeType) $(msg).show();} if((msie||opts.forceIframe)&&opts.showOverlay) lyr1.show();if(opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp;var cb1=(opts.showOverlay&&!msg)?cb:noOp;var cb2=msg?cb:noOp;if(opts.showOverlay) lyr2._fadeIn(opts.fadeIn,cb1);if(msg) lyr3._fadeIn(opts.fadeIn,cb2);} else{if(opts.showOverlay) lyr2.show();if(msg) lyr3.show();if(opts.onBlock) opts.onBlock.bind(lyr3)();} bind(1,el,opts);if(full){pageBlock=lyr3[0];pageBlockEls=$(opts.focusableElements,pageBlock);if(opts.focusInput) setTimeout(focus,20);} else center(lyr3[0],opts.centerX,opts.centerY);if(opts.timeout){var to=setTimeout(function(){if(full) $.unblockUI(opts);else $(el).unblock(opts);},opts.timeout);$(el).data('blockUI.timeout',to);}} function remove(el,opts){var count;var full=(el==window);var $el=$(el);var data=$el.data('blockUI.history');var to=$el.data('blockUI.timeout');if(to){clearTimeout(to);$el.removeData('blockUI.timeout');} opts=$.extend({},$.blockUI.defaults,opts||{});bind(0,el,opts);if(opts.onUnblock===null){opts.onUnblock=$el.data('blockUI.onUnblock');$el.removeData('blockUI.onUnblock');} var els;if(full) els=$('body').children().filter('.blockUI').add('body > .blockUI');else els=$el.find('>.blockUI');if(opts.cursorReset){if(els.length>1) els[1].style.cursor=opts.cursorReset;if(els.length>2) els[2].style.cursor=opts.cursorReset;} if(full) pageBlock=pageBlockEls=null;if(opts.fadeOut){count=els.length;els.stop().fadeOut(opts.fadeOut,function(){if(--count===0) reset(els,data,opts,el);});} else reset(els,data,opts,el);} function reset(els,data,opts,el){var $el=$(el);if($el.data('blockUI.isBlocked')) return;els.each(function(i,o){if(this.parentNode) this.parentNode.removeChild(this);});if(data&&data.el){data.el.style.display=data.display;data.el.style.position=data.position;data.el.style.cursor='default';if(data.parent) data.parent.appendChild(data.el);$el.removeData('blockUI.history');} if($el.data('blockUI.static')){$el.css('position','static');} if(typeof opts.onUnblock=='function') opts.onUnblock(el,opts);var body=$(document.body),w=body.width(),cssW=body[0].style.width;body.width(w-1).width(w);body[0].style.width=cssW;} function bind(b,el,opts){var full=el==window,$el=$(el);if(!b&&(full&&!pageBlock||!full&&!$el.data('blockUI.isBlocked'))) return;$el.data('blockUI.isBlocked',b);if(!full||!opts.bindEvents||(b&&!opts.showOverlay)) return;var events='mousedown mouseup keydown keypress keyup touchstart touchend touchmove';if(b) $(document).bind(events,opts,handler);else $(document).unbind(events,handler);} function handler(e){if(e.type==='keydown'&&e.keyCode&&e.keyCode==9){if(pageBlock&&e.data.constrainTabKey){var els=pageBlockEls;var fwd=!e.shiftKey&&e.target===els[els.length-1];var back=e.shiftKey&&e.target===els[0];if(fwd||back){setTimeout(function(){focus(back);},10);return false;}}} var opts=e.data;var target=$(e.target);if(target.hasClass('blockOverlay')&&opts.onOverlayClick) opts.onOverlayClick(e);if(target.parents('div.'+opts.blockMsgClass).length>0) return true;return target.parents().children().filter('div.blockUI').length===0;} function focus(back){if(!pageBlockEls) return;var e=pageBlockEls[back===true?pageBlockEls.length-1:0];if(e) e.focus();} function center(el,x,y){var p=el.parentNode,s=el.style;var l=((p.offsetWidth-el.offsetWidth)/2)-sz(p,'borderLeftWidth');var t=((p.offsetHeight-el.offsetHeight)/2)-sz(p,'borderTopWidth');if(x)s.left=l>0?(l+'px'):'0';if(y)s.top=t>0?(t+'px'):'0';} function sz(el,p){return parseInt($.css(el,p),10)||0;}} if(typeof define==='function'&&define.amd&&define.amd.jQuery){define(['jquery'],setup);}else{setup(jQuery);}})();; /*! * jQuery Validation Plugin v1.13.0 * * http://jqueryvalidation.org/ * * Copyright (c) 2014 Jörn Zaefferer * Released under the MIT license */ (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{factory(jQuery);}}(function($){$.extend($.fn,{validate:function(options){if(!this.length){if(options&&options.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.");} return;} var validator=$.data(this[0],"validator");if(validator){return validator;} this.attr("novalidate","novalidate");validator=new $.validator(options,this[0]);$.data(this[0],"validator",validator);if(validator.settings.onsubmit){this.validateDelegate(":submit","click",function(event){if(validator.settings.submitHandler){validator.submitButton=event.target;} if($(event.target).hasClass("cancel")){validator.cancelSubmit=true;} if($(event.target).attr("formnovalidate")!==undefined){validator.cancelSubmit=true;}});this.submit(function(event){if(validator.settings.debug){event.preventDefault();} function handle(){var hidden;if(validator.settings.submitHandler){if(validator.submitButton){hidden=$("").attr("name",validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm);} validator.settings.submitHandler.call(validator,validator.currentForm,event);if(validator.submitButton){hidden.remove();} return false;} return true;} if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();} if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;} return handle();}else{validator.focusInvalid();return false;}});} return validator;},valid:function(){var valid,validator;if($(this[0]).is("form")){valid=this.validate().form();}else{valid=true;validator=$(this[0].form).validate();this.each(function(){valid=validator.element(this)&&valid;});} return valid;},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0],settings,staticRules,existingRules,data,param,filtered;if(command){settings=$.data(element.form,"validator").settings;staticRules=settings.rules;existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));delete existingRules.messages;staticRules[element.name]=existingRules;if(argument.messages){settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);} break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;} filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];if(method==="required"){$(element).removeAttr("aria-required");}});return filtered;}} data=$.validator.normalizeRules($.extend({},$.validator.classRules(element),$.validator.attributeRules(element),$.validator.dataRules(element),$.validator.staticRules(element)),element);if(data.required){param=data.required;delete data.required;data=$.extend({required:param},data);$(element).attr("aria-required","true");} if(data.remote){param=data.remote;delete data.remote;data=$.extend(data,{remote:param});} return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+$(a).val());},filled:function(a){return!!$.trim(""+$(a).val());},unchecked:function(a){return!$(a).prop("checked");}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length===1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};} if(arguments.length>2&¶ms.constructor!==Array){params=$.makeArray(arguments).slice(1);} if(params.constructor!==Array){params=[params];} $.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),function(){return n;});});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);} this.hideThese(this.errorsFor(element));}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element,event){if(event.which===9&&this.elementValue(element)===""){return;}else if(element.name in this.submitted||element===this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted){this.element(element);}else if(element.parentNode.name in this.submitted){this.element(element.parentNode);}},highlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).addClass(errorClass).removeClass(validClass);}else{$(element).addClass(errorClass).removeClass(validClass);}},unhighlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).removeClass(errorClass).addClass(validClass);}else{$(element).removeClass(errorClass).addClass(validClass);}}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={}),rules;$.each(this.settings.groups,function(key,value){if(typeof value==="string"){value=value.split(/\s/);} $.each(value,function(index,name){groups[name]=key;});});rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,""),settings=validator.settings;if(settings[eventType]&&!this.is(settings.ignore)){settings[eventType].call(validator,this[0],event);}} $(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, "+"[type='number'], [type='search'] ,[type='tel'], [type='url'], "+"[type='email'], [type='datetime'], [type='date'], [type='month'], "+"[type='week'], [type='time'], [type='datetime-local'], "+"[type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",delegate).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",delegate);if(this.settings.invalidHandler){$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);} $(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true");},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()){$(this.currentForm).triggerHandler("invalid-form",[this]);} this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);} return this.valid();},element:function(element){var cleanElement=this.clean(element),checkElement=this.validationTargetFor(cleanElement),result=true;this.lastElement=checkElement;if(checkElement===undefined){delete this.invalid[cleanElement.name];}else{this.prepareElement(checkElement);this.currentElements=$(checkElement);result=this.check(checkElement)!==false;if(result){delete this.invalid[checkElement.name];}else{this.invalid[checkElement.name]=true;}} $(element).attr("aria-invalid",!result);if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);} this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});} this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});} if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList);}else{this.defaultShowErrors();}},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm();} this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid");},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0,i;for(i in obj){count++;} return count;},hideErrors:function(){this.hideThese(this.toHide);},hideThese:function(errors){errors.not(this.containers).text("");this.addWrapper(errors).hide();},valid:function(){return this.size()===0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name===lastActive.name;}).length===1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){if(!this.name&&validator.settings.debug&&window.console){console.error("%o has no name assigned",this);} if(this.name in rulesCache||!validator.objectLength($(this).rules())){return false;} rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){var errorClass=this.settings.errorClass.split(" ").join(".");return $(this.settings.errorElement+"."+errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},elementValue:function(element){var val,$element=$(element),type=element.type;if(type==="radio"||type==="checkbox"){return $("input[name='"+element.name+"']:checked").val();}else if(type==="number"&&typeof element.validity!=="undefined"){return element.validity.badInput?false:$element.val();} val=$element.val();if(typeof val==="string"){return val.replace(/\r/g,"");} return val;},check:function(element){element=this.validationTargetFor(this.clean(element));var rules=$(element).rules(),rulesCount=$.map(rules,function(n,i){return i;}).length,dependencyMismatch=false,val=this.elementValue(element),result,method,rule;for(method in rules){rule={method:method,parameters:rules[method]};try{result=$.validator.methods[method].call(this,val,element,rule.parameters);if(result==="dependency-mismatch"&&rulesCount===1){dependencyMismatch=true;continue;} dependencyMismatch=false;if(result==="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;} if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method.",e);} throw e;}} if(dependencyMismatch){return;} if(this.objectLength(rules)){this.successList.push(element);} return true;},customDataMessage:function(element,method){return $(element).data("msg"+method.charAt(0).toUpperCase()+ method.substring(1).toLowerCase())||$(element).data("msg");},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method]);},findDefined:function(){for(var i=0;iWarning: No message defined for "+element.name+"");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message==="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters);} this.errorList.push({message:message,element:element,method:rule.method});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));} return toToggle;},defaultShowErrors:function(){var i,elements,error;for(i=0;this.errorList[i];i++){error=this.errorList[i];if(this.settings.highlight){this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);} this.showLabel(error.element,error.message);} if(this.errorList.length){this.toShow=this.toShow.add(this.containers);} if(this.settings.success){for(i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}} if(this.settings.unhighlight){for(i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}} this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var place,group,errorID,error=this.errorsFor(element),elementID=this.idOrName(element),describedBy=$(element).attr("aria-describedby");if(error.length){error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);error.html(message);}else{error=$("<"+this.settings.errorElement+">").attr("id",elementID+"-error").addClass(this.settings.errorClass).html(message||"");place=error;if(this.settings.wrapper){place=error.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();} if(this.labelContainer.length){this.labelContainer.append(place);}else if(this.settings.errorPlacement){this.settings.errorPlacement(place,$(element));}else{place.insertAfter(element);} if(error.is("label")){error.attr("for",elementID);}else if(error.parents("label[for='"+elementID+"']").length===0){errorID=error.attr("id");if(!describedBy){describedBy=errorID;}else if(!describedBy.match(new RegExp("\b"+errorID+"\b"))){describedBy+=" "+errorID;} $(element).attr("aria-describedby",describedBy);group=this.groups[element.name];if(group){$.each(this.groups,function(name,testgroup){if(testgroup===group){$("[name='"+name+"']",this.currentForm).attr("aria-describedby",error.attr("id"));}});}}} if(!message&&this.settings.success){error.text("");if(typeof this.settings.success==="string"){error.addClass(this.settings.success);}else{this.settings.success(error,element);}} this.toShow=this.toShow.add(error);},errorsFor:function(element){var name=this.idOrName(element),describer=$(element).attr("aria-describedby"),selector="label[for='"+name+"'], label[for='"+name+"'] *";if(describer){selector=selector+", #"+describer.replace(/\s+/g,", #");} return this.errors().filter(selector);},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},validationTargetFor:function(element){if(this.checkable(element)){element=this.findByName(element.name).not(this.settings.ignore)[0];} return element;},checkable:function(element){return(/radio|checkbox/i).test(element.type);},findByName:function(name){return $(this.currentForm).find("[name='"+name+"']");},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length;}} return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0;} delete this.pending[element.name];if(valid&&this.pendingRequest===0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest===0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},number:{number:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){if(className.constructor===String){this.classRuleSettings[className]=rules;}else{$.extend(this.classRuleSettings,className);}},classRules:function(element){var rules={},classes=$(element).attr("class");if(classes){$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});} return rules;},attributeRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){if(method==="required"){value=element.getAttribute(method);if(value===""){value=true;} value=!!value;}else{value=$element.attr(method);} if(/min|max/.test(method)&&(type===null||/number|range|text/.test(type))){value=Number(value);} if(value||value===0){rules[method]=value;}else if(type===method&&type!=="range"){rules[method]=true;}} if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;} return rules;},dataRules:function(element){var method,value,rules={},$element=$(element);for(method in $.validator.methods){value=$element.data("rule"+method.charAt(0).toUpperCase()+method.substring(1).toLowerCase());if(value!==undefined){rules[method]=value;}} return rules;},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};} return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;} if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;} if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(["minlength","maxlength"],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(["rangelength","range"],function(){var parts;if(rules[this]){if($.isArray(rules[this])){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}else if(typeof rules[this]==="string"){parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/);rules[this]=[Number(parts[0]),Number(parts[1])];}}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;} if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}} return rules;},normalizeRule:function(data){if(typeof data==="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;} return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!==undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element)){return"dependency-mismatch";} if(element.nodeName.toLowerCase()==="select"){var val=$(element).val();return val&&val.length>0;} if(this.checkable(element)){return this.getLength(value,element)>0;} return $.trim(value).length>0;},email:function(value,element){return this.optional(element)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);},url:function(value,element){return this.optional(element)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value).toString());},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element)){return"dependency-mismatch";} if(/[^0-9 \-]+/.test(value)){return false;} var nCheck=0,nDigit=0,bEven=false,n,cDigit;value=value.replace(/\D/g,"");if(value.length<13||value.length>19){return false;} for(n=value.length-1;n>=0;n--){cDigit=value.charAt(n);nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9){nDigit-=9;}} nCheck+=nDigit;bEven=!bEven;} return(nCheck%10)===0;},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param;},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length<=param;},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},equalTo:function(value,element,param){var target=$(param);if(this.settings.onfocusout){target.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});} return value===target.val();},remote:function(value,element,param){if(this.optional(element)){return"dependency-mismatch";} var previous=this.previousValue(element),validator,data;if(!this.settings.messages[element.name]){this.settings.messages[element.name]={};} previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param==="string"&&{url:param}||param;if(previous.old===value){return previous.valid;} previous.old=value;validator=this;this.startRequest(element);data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,context:validator.currentForm,success:function(response){var valid=response===true||response==="true",errors,message,submitted;validator.settings.messages[element.name].remote=previous.originalMessage;if(valid){submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);delete validator.invalid[element.name];validator.showErrors();}else{errors={};message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message;validator.invalid[element.name]=true;validator.showErrors(errors);} previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}}});$.format=function deprecated(){throw"$.format has been deprecated. Please use $.validator.format instead.";};var pendingRequests={},ajax;if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;if(settings.mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort();} pendingRequests[port]=xhr;}});}else{ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;if(mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort();} pendingRequests[port]=ajax.apply(this,arguments);return pendingRequests[port];} return ajax.apply(this,arguments);};} $.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});}));;;(function($){$.cookiesDirective=function(options){var settings=$.extend({explicitConsent:true,position:'top',duration:10,limit:0,message:null,cookieScripts:null,privacyPolicyUri:'privacy.html',scriptWrapper:function(){},fontFamily:'helvetica',fontColor:'#FFFFFF',fontSize:'13px',backgroundColor:'#000000',backgroundOpacity:'80',linkColor:'#CA0000'},options);if(!getCookie('cookiesDirective')){if(settings.limit>0){if(!getCookie('cookiesDisclosureCount')){setCookie('cookiesDisclosureCount',1,1);}else{var disclosureCount=getCookie('cookiesDisclosureCount');disclosureCount++;setCookie('cookiesDisclosureCount',disclosureCount,1);} if(settings.limit>=getCookie('cookiesDisclosureCount')){disclosure(settings);}}else{disclosure(settings);} if(!settings.explicitConsent){settings.scriptWrapper.call();}}else{settings.scriptWrapper.call();}};$.cookiesDirective.loadScript=function(options){var settings=$.extend({uri:'',appendTo:'body'},options);var elementId=String(settings.appendTo);var sA=document.createElement("script");sA.src=settings.uri;sA.type="text/javascript";sA.onload=sA.onreadystatechange=function(){if((!sA.readyState||sA.readyState=="loaded"||sA.readyState=="complete")){return;}} switch(settings.appendTo){case'head':$('head').append(sA);break;case'body':$('body').append(sA);break;default:$('#'+elementId).append(sA);}} var getCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i1){for(var t=0;tprivacy policy.
';html+='' html+='
I accept cookies from this site  ';html+='
';}else{html+=scriptsDisclosure+' More details can be found in our privacy policy.';html+='
';} html+='';$('body').append(html);var dp=settings.position.toLowerCase();if(dp!='top'&&dp!='bottom'){dp='top';} var opts=new Array();if(dp=='top'){opts['in']={'top':'0'};opts['out']={'top':'-300'};}else{opts['in']={'bottom':'0'};opts['out']={'bottom':'-300'};} $('#cookiesdirective').animate(opts['in'],1000,function(){if(settings.explicitConsent){$('#explicitsubmit').click(function(){if($('#epdagree').is(':checked')){setCookie('cookiesDirective',1,365);$('#cookiesdirective').animate(opts['out'],1000,function(){$('#cookiesdirective').remove();location.reload(true);});}else{$('#epdnotick').css('display','block');}});}else{$('#impliedsubmit').click(function(){setCookie('cookiesDirective',1,365);$('#cookiesdirective').animate(opts['out'],1000,function(){$('#cookiesdirective').remove();});});} setTimeout(function(){$('#cookiesdirective').animate({opacity:'0'},2000,function(){$('#cookiesdirective').css(dp,'-300px');});},settings.duration*1000);});}})(jQuery); ;/*! * Master Slider – Responsive Touch Swipe Slider * Copyright © 2017 All Rights Reserved. * * @author Averta [www.averta.net] * @version 2.51.2 * @date Jun 2017 */ window.averta={},function($){function getVendorPrefix(){if("result"in arguments.callee)return arguments.callee.result;var regex=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,someScript=document.getElementsByTagName("script")[0];for(var prop in someScript.style)if(regex.test(prop))return arguments.callee.result=prop.match(regex)[0];return arguments.callee.result="WebkitOpacity"in someScript.style?"Webkit":"KhtmlOpacity"in someScript.style?"Khtml":""}function checkStyleValue(prop){var b=document.body||document.documentElement,s=b.style,p=prop;if("string"==typeof s[p])return!0;v=["Moz","Webkit","Khtml","O","ms"],p=p.charAt(0).toUpperCase()+p.substr(1);for(var i=0;i0&&"none"!==has3d}window["package"]=function(name){window[name]||(window[name]={})};var extend=function(target,object){for(var key in object)target[key]=object[key]};Function.prototype.extend=function(superclass){"function"==typeof superclass.prototype.constructor?(extend(this.prototype,superclass.prototype),this.prototype.constructor=this):(this.prototype.extend(superclass),this.prototype.constructor=this)};var trans={Moz:"-moz-",Webkit:"-webkit-",Khtml:"-khtml-",O:"-o-",ms:"-ms-",Icab:"-icab-"};window._mobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),window._touch="ontouchstart"in document,$(document).ready(function(){window._jcsspfx=getVendorPrefix(),window._csspfx=trans[window._jcsspfx],window._cssanim=supportsTransitions(),window._css3d=supports3DTransforms(),window._css2d=supportsTransforms()}),window.parseQueryString=function(url){var queryString={};return url.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function($0,$1,$2,$3){queryString[$1]=$3}),queryString};var fps60=50/3;if(window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,fps60)}}()),window.getComputedStyle||(window.getComputedStyle=function(el){return this.el=el,this.getPropertyValue=function(prop){var re=/(\-([a-z]){1})/g;return"float"==prop&&(prop="styleFloat"),re.test(prop)&&(prop=prop.replace(re,function(){return arguments[2].toUpperCase()})),el.currentStyle[prop]?el.currentStyle[prop]:null},el.currentStyle}),Array.prototype.indexOf||(Array.prototype.indexOf=function(elt){var len=this.length>>>0,from=Number(arguments[1])||0;for(from=0>from?Math.ceil(from):Math.floor(from),0>from&&(from+=len);len>from;from++)if(from in this&&this[from]===elt)return from;return-1}),window.isMSIE=function(version){if(!$.browser.msie)return!1;if(!version)return!0;var ieVer=$.browser.version.slice(0,$.browser.version.indexOf("."));return"string"==typeof version?eval(-1!==version.indexOf("<")||-1!==version.indexOf(">")?ieVer+version:version+"=="+ieVer):version==ieVer},$.removeDataAttrs=function($target,exclude){var i,attrName,dataAttrsToDelete=[],dataAttrs=$target[0].attributes,dataAttrsLen=dataAttrs.length;for(exclude=exclude||[],i=0;dataAttrsLen>i;i++)attrName=dataAttrs[i].name,"data-"===attrName.substring(0,5)&&-1===exclude.indexOf(attrName)&&dataAttrsToDelete.push(dataAttrs[i].name);$.each(dataAttrsToDelete,function(index,attrName){$target.removeAttr(attrName)})},jQuery){$.jqLoadFix=function(){if(this.complete){var that=this;setTimeout(function(){$(that).trigger("load")},1)}},jQuery.uaMatch=jQuery.uaMatch||function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}},matched=jQuery.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0);var isIE11=!!navigator.userAgent.match(/Trident\/7\./);isIE11&&(browser.msie="true",delete browser.mozilla),jQuery.browser=browser,$.fn.preloadImg=function(src,_event){return this.each(function(){var $this=$(this),self=this,img=new Image;img.onload=function(event){null==event&&(event={}),$this.attr("src",src),event.width=img.width,event.height=img.height,$this.data("width",img.width),$this.data("height",img.height),setTimeout(function(){_event.call(self,event)},50),img=null},img.src=src}),this}}}(jQuery),function(){"use strict";averta.EventDispatcher=function(){this.listeners={}},averta.EventDispatcher.extend=function(_proto){var instance=new averta.EventDispatcher;for(var key in instance)"constructor"!=key&&(_proto[key]=averta.EventDispatcher.prototype[key])},averta.EventDispatcher.prototype={constructor:averta.EventDispatcher,addEventListener:function(event,listener,ref){this.listeners[event]||(this.listeners[event]=[]),this.listeners[event].push({listener:listener,ref:ref})},removeEventListener:function(event,listener,ref){if(this.listeners[event]){for(var i=0;ii;++i)this.listeners[event.type][i].listener.call(this.listeners[event.type][i].ref,event)}}}(),function($){"use strict";var isTouch="ontouchstart"in document,isPointer=window.navigator.pointerEnabled,isMSPoiner=!isPointer&&window.navigator.msPointerEnabled,usePointer=isPointer||isMSPoiner,ev_start=(isPointer?"pointerdown ":"")+(isMSPoiner?"MSPointerDown ":"")+(isTouch?"touchstart ":"")+"mousedown",ev_move=(isPointer?"pointermove ":"")+(isMSPoiner?"MSPointerMove ":"")+(isTouch?"touchmove ":"")+"mousemove",ev_end=(isPointer?"pointerup ":"")+(isMSPoiner?"MSPointerUp ":"")+(isTouch?"touchend ":"")+"mouseup",ev_cancel=(isPointer?"pointercancel ":"")+(isMSPoiner?"MSPointerCancel ":"")+"touchcancel";averta.TouchSwipe=function($element){this.$element=$element,this.enabled=!0,$element.bind(ev_start,{target:this},this.__touchStart),$element[0].swipe=this,this.onSwipe=null,this.swipeType="horizontal",this.noSwipeSelector="input, textarea, button, .no-swipe, .ms-no-swipe",this.lastStatus={}};var p=averta.TouchSwipe.prototype;p.getDirection=function(new_x,new_y){switch(this.swipeType){case"horizontal":return new_x<=this.start_x?"left":"right";case"vertical":return new_y<=this.start_y?"up":"down";case"all":return Math.abs(new_x-this.start_x)>Math.abs(new_y-this.start_y)?new_x<=this.start_x?"left":"right":new_y<=this.start_y?"up":"down"}},p.priventDefultEvent=function(new_x,new_y){var dx=Math.abs(new_x-this.start_x),dy=Math.abs(new_y-this.start_y),horiz=dx>dy;return"horizontal"===this.swipeType&&horiz||"vertical"===this.swipeType&&!horiz},p.createStatusObject=function(evt){var temp_x,temp_y,status_data={};return temp_x=this.lastStatus.distanceX||0,temp_y=this.lastStatus.distanceY||0,status_data.distanceX=evt.pageX-this.start_x,status_data.distanceY=evt.pageY-this.start_y,status_data.moveX=status_data.distanceX-temp_x,status_data.moveY=status_data.distanceY-temp_y,status_data.distance=parseInt(Math.sqrt(Math.pow(status_data.distanceX,2)+Math.pow(status_data.distanceY,2))),status_data.duration=(new Date).getTime()-this.start_time,status_data.direction=this.getDirection(evt.pageX,evt.pageY),status_data},p.__reset=function(event,jqevt){this.reset=!1,this.lastStatus={},this.start_time=(new Date).getTime();var point=this.__getPoint(event,jqevt);this.start_x=point.pageX,this.start_y=point.pageY},p.__touchStart=function(event){var swipe=event.data.target,jqevt=event;if(swipe.enabled&&!($(event.target).closest(swipe.noSwipeSelector,swipe.$element).length>0)){if(event=event.originalEvent,usePointer&&$(this).css("-ms-touch-action","horizontal"===swipe.swipeType?"pan-y":"pan-x"),!swipe.onSwipe)return void $.error("Swipe listener is undefined");if(!(swipe.touchStarted||isTouch&&swipe.start_time&&"mousedown"===event.type&&(new Date).getTime()-swipe.start_time<600)){var point=swipe.__getPoint(event,jqevt);swipe.start_x=point.pageX,swipe.start_y=point.pageY,swipe.start_time=(new Date).getTime(),$(document).bind(ev_end,{target:swipe},swipe.__touchEnd).bind(ev_move,{target:swipe},swipe.__touchMove).bind(ev_cancel,{target:swipe},swipe.__touchCancel);var status=swipe.createStatusObject(point);status.phase="start",swipe.onSwipe.call(null,status),isTouch||jqevt.preventDefault(),swipe.lastStatus=status,swipe.touchStarted=!0}}},p.__touchMove=function(event){var swipe=event.data.target,jqevt=event;if(event=event.originalEvent,swipe.touchStarted){clearTimeout(swipe.timo),swipe.timo=setTimeout(function(){swipe.__reset(event,jqevt)},60);var point=swipe.__getPoint(event,jqevt),status=swipe.createStatusObject(point);swipe.priventDefultEvent(point.pageX,point.pageY)&&jqevt.preventDefault(),status.phase="move",swipe.lastStatus=status,swipe.onSwipe.call(null,status)}},p.__touchEnd=function(event){var swipe=event.data.target,jqevt=event;event=event.originalEvent,clearTimeout(swipe.timo);var status=swipe.lastStatus;isTouch||jqevt.preventDefault(),status.phase="end",swipe.touchStarted=!1,swipe.priventEvt=null,$(document).unbind(ev_end,swipe.__touchEnd).unbind(ev_move,swipe.__touchMove).unbind(ev_cancel,swipe.__touchCancel),status.speed=status.distance/status.duration,swipe.onSwipe.call(null,status)},p.__touchCancel=function(event){var swipe=event.data.target;swipe.__touchEnd(event)},p.__getPoint=function(event,jqEvent){return isTouch&&-1===event.type.indexOf("mouse")?event.touches[0]:usePointer?event:jqEvent},p.enable=function(){this.enabled||(this.enabled=!0)},p.disable=function(){this.enabled&&(this.enabled=!1)}}(jQuery),function(){"use strict";averta.Ticker=function(){};var st=averta.Ticker,list=[],len=0,__stopped=!0;st.add=function(listener,ref){return list.push([listener,ref]),1===list.length&&st.start(),len=list.length},st.remove=function(listener,ref){for(var i=0,l=list.length;l>i;++i)list[i]&&list[i][0]===listener&&list[i][1]===ref&&list.splice(i,1);len=list.length,0===len&&st.stop()},st.start=function(){__stopped&&(__stopped=!1,__tick())},st.stop=function(){__stopped=!0};var __tick=function(){if(!st.__stopped){for(var item,i=0;i!==len;i++)item=list[i],item[0].call(item[1]);requestAnimationFrame(__tick)}}}(),function(){"use strict";Date.now||(Date.now=function(){return(new Date).getTime()}),averta.Timer=function(delay,autoStart){this.delay=delay,this.currentCount=0,this.paused=!1,this.onTimer=null,this.refrence=null,autoStart&&this.start()},averta.Timer.prototype={constructor:averta.Timer,start:function(){this.paused=!1,this.lastTime=Date.now(),averta.Ticker.add(this.update,this)},stop:function(){this.paused=!0,averta.Ticker.remove(this.update,this)},reset:function(){this.currentCount=0,this.paused=!0,this.lastTime=Date.now()},update:function(){this.paused||Date.now()-this.lastTime0?that.delay+"ms":"",element.style[window._jcsspfx+"TransitionTimingFunction"]=that.ease,that.to_cb&&that.to_cb.call(that.to_cb_target),that.end_to=setTimeout(function(){that.onTransComplete()},that.duration+(that.delay||0)))},1),this}}(),function(){"use strict";function transPos(element,properties){if(void 0!==properties.x||void 0!==properties.y)if(_cssanim){var trans=window._jcsspfx+"Transform";void 0!==properties.x&&(properties[trans]=(properties[trans]||"")+" translateX("+properties.x+"px)",delete properties.x),void 0!==properties.y&&(properties[trans]=(properties[trans]||"")+" translateY("+properties.y+"px)",delete properties.y)}else{if(void 0!==properties.x){var posx="auto"!==element.css("right")?"right":"left";properties[posx]=properties.x+"px",delete properties.x}if(void 0!==properties.y){var posy="auto"!==element.css("bottom")?"bottom":"top";properties[posy]=properties.y+"px",delete properties.y}}return properties}var _cssanim=null;window.CTween={},CTween.setPos=function(element,pos){element.css(transPos(element,pos))},CTween.animate=function(element,duration,properties,options){if(null==_cssanim&&(_cssanim=window._cssanim),options=options||{},transPos(element,properties),_cssanim){var tween=new CSSTween(element,duration,options.delay,EaseDic[options.ease]);return options.transProperty&&(tween.transProperty=options.transProperty),tween.to(function(){element.css(properties)}),options.complete&&tween.onComplete(options.complete,options.target),tween.start(),tween.stop=tween.reset,tween}var onCl;return options.delay&&element.delay(options.delay),options.complete&&(onCl=function(){options.complete.call(options.target)}),element.stop(!0).animate(properties,duration,options.ease||"linear",onCl),element},CTween.fadeOut=function(target,duration,remove){var options={};remove===!0?options.complete=function(){target.remove()}:2===remove&&(options.complete=function(){target.css("display","none")}),CTween.animate(target,duration||1e3,{opacity:0},options)},CTween.fadeIn=function(target,duration,reset){reset!==!1&&target.css("opacity",0).css("display",""),CTween.animate(target,duration||1e3,{opacity:1})}}(),function(){window.EaseDic={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",easeInCubic:"cubic-bezier(.55,.055,.675,.19)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"}}(),function(){"use strict";window.MSAligner=function(type,$container,$img){this.$container=$container,this.$img=$img,this.type=type||"stretch",this.widthOnly=!1,this.heightOnly=!1};var p=MSAligner.prototype;p.init=function(w,h){switch(this.baseWidth=w,this.baseHeight=h,this.imgRatio=w/h,this.imgRatio2=h/w,this.type){case"tile":this.$container.css("background-image","url("+this.$img.attr("src")+")"),this.$img.remove();break;case"center":this.$container.css("background-image","url("+this.$img.attr("src")+")"),this.$container.css({backgroundPosition:"center center",backgroundRepeat:"no-repeat"}),this.$img.remove();break;case"stretch":this.$img.css({width:"100%",height:"100%"});break;case"fill":case"fit":this.needAlign=!0,this.align()}},p.align=function(){if(this.needAlign){var cont_w=this.$container[0].offsetWidth,cont_h=this.$container[0].offsetHeight,contRatio=cont_w/cont_h;"fill"==this.type?this.imgRatio */ function($){var Polyfill=function(userOptions){this.options=$.extend({},Polyfill.defaultOptions,userOptions),this.isEnabled=!1,(this.options.forcePolyfill||!this.supportsPointerEvents())&&(this.registerEvents(),this.isEnabled=!0)};Polyfill.defaultOptions={forcePolyfill:!1,selector:"*",listenOn:["click","dblclick","mousedown","mouseup"],pointerEventsNoneClass:null,pointerEventsAllClass:null,eventNamespace:"pointer-events-polyfill"},Polyfill.prototype.registerEvents=function(){$(document).on(this.getEventNames(),this.options.selector,$.proxy(this.onElementClick,this))},Polyfill.prototype.getEventNames=function(){var eventNamespace=this.options.eventNamespace?"."+this.options.eventNamespace:"";return this.options.listenOn.join(eventNamespace+" ")+eventNamespace},Polyfill.prototype.supportsPointerEvents=function(){var style=document.createElement("a").style;return style.cssText="pointer-events:auto","auto"===style.pointerEvents},Polyfill.prototype.isClickThrough=function($el){var elPointerEventsCss=$el.css("pointer-events");return 0===$el.length||"all"===elPointerEventsCss||$el.is(":root")||$el.hasClass(this.options.pointerEventsAllClass)?!1:"none"===elPointerEventsCss||$el.hasClass(this.options.pointerEventsNoneClass)||this.isClickThrough($el.parent())?!0:!1},Polyfill.prototype.onElementClick=function(e){var $elOrg=$(e.target);if(!this.isClickThrough($elOrg))return!0;$elOrg.hide();var elBelow=document.elementFromPoint(e.clientX,e.clientY);return e.target=elBelow,$(elBelow).trigger(e),"A"===elBelow.tagName&&(2===e.which?window.open(elBelow.getAttribute("href"),"_blank"):elBelow.click()),$elOrg.show(),!1},Polyfill.prototype.destroy=function(){$(document).off(this.getEventNames()),this.isEnabled=!1},window.pointerEventsPolyfill=function(userOptions){return new Polyfill(userOptions)}}(jQuery),function(){"use strict";var _options={bouncing:!0,snapping:!1,snapsize:null,friction:.05,outFriction:.05,outAcceleration:.09,minValidDist:.3,snappingMinSpeed:2,paging:!1,endless:!1,maxSpeed:160},Controller=function(min,max,options){if(null===max||null===min)throw new Error("Max and Min values are required.");this.options=options||{};for(var key in _options)key in this.options||(this.options[key]=_options[key]);this._max_value=max,this._min_value=min,this.value=min,this.end_loc=min,this.current_snap=this.getSnapNum(min),this.__extrStep=0,this.__extraMove=0,this.__animID=-1},p=Controller.prototype;p.changeTo=function(value,animate,speed,snap_num,dispatch){if(this.stopped=!1,this._internalStop(),value=this._checkLimits(value),speed=Math.abs(speed||0),this.options.snapping&&(snap_num=snap_num||this.getSnapNum(value),dispatch!==!1&&this._callsnapChange(snap_num),this.current_snap=snap_num),animate){this.animating=!0;var self=this,active_id=++self.__animID,amplitude=value-self.value,timeStep=0,targetPosition=value,animFrict=1-self.options.friction,timeconst=animFrict+(speed-20)*animFrict*1.3/self.options.maxSpeed,tick=function(){if(active_id===self.__animID){var dis=value-self.value;if(!(Math.abs(dis)>self.options.minValidDist&&self.animating))return self.animating&&(self.value=value,self._callrenderer()),self.animating=!1,active_id!==self.__animID&&(self.__animID=-1),void self._callonComplete("anim");window.requestAnimationFrame(tick),self.value=targetPosition-amplitude*Math.exp(-++timeStep*timeconst),self._callrenderer()}};return void tick()}this.value=value,this._callrenderer()},p.drag=function(move){this.start_drag&&(this.drag_start_loc=this.value,this.start_drag=!1),this.animating=!1,this._deceleration=!1,this.value-=move,!this.options.endless&&(this.value>this._max_value||this.value<0)?this.options.bouncing?(this.__isout=!0,this.value+=.6*move):this.value=this.value>this._max_value?this._max_value:0:!this.options.endless&&this.options.bouncing&&(this.__isout=!1),this._callrenderer()},p.push=function(speed){if(this.stopped=!1,this.options.snapping&&Math.abs(speed)<=this.options.snappingMinSpeed)return void this.cancel();if(this.__speed=speed,this.__startSpeed=speed,this.end_loc=this._calculateEnd(),this.options.snapping){var snap_loc=this.getSnapNum(this.value),end_snap=this.getSnapNum(this.end_loc);if(this.options.paging)return snap_loc=this.getSnapNum(this.drag_start_loc),this.__isout=!1,void(speed>0?this.gotoSnap(snap_loc+1,!0,speed):this.gotoSnap(snap_loc-1,!0,speed));if(snap_loc===end_snap)return void this.cancel();this._callsnapChange(end_snap),this.current_snap=end_snap}this.animating=!1,this.__needsSnap=this.options.endless||this.end_loc>this._min_value&&this.end_locthis._max_value?(this.__speed=8,this.__needsSnap=!1,this._startDecelaration()):this.gotoSnap(curr_snap+1,!0)},p.prevSnap=function(){this._internalStop();var curr_snap=this.getSnapNum(this.value);!this.options.endless&&(curr_snap-1)*this.options.snapsizethis.options.minValidDist;)temp_value+=temp_speed,temp_speed*=this.options.friction,i++;return step?i:temp_value},p._checkLimits=function(value){return this.options.endless?value:valuethis._max_value?this._max_value:value},p._callrenderer=function(){this.__renderHook&&this.__renderHook.fun.call(this.__renderHook.ref,this,this.value)},p._callsnapChange=function(targetSnap){this.__snapHook&&targetSnap!==this.current_snap&&this.__snapHook.fun.call(this.__snapHook.ref,this,targetSnap,targetSnap-this.current_snap)},p._callonComplete=function(type){this.__compHook&&!this.stopped&&this.__compHook.fun.call(this.__compHook.ref,this,this.current_snap,type)},p._computeDeceleration=function(){if(this.options.snapping&&this.__needsSnap){var xtr_move=(this.__startSpeed-this.__speed)/this.__startSpeed*this.__extraMove;this.value+=this.__speed+xtr_move-this.__extrStep,this.__extrStep=xtr_move}else this.value+=this.__speed;if(this.__speed*=this.options.friction,this.options.endless||this.options.bouncing||(this.value<=this._min_value?(this.value=this._min_value,this.__speed=0):this.value>=this._max_value&&(this.value=this._max_value,this.__speed=0)),this._callrenderer(),!this.options.endless&&this.options.bouncing){var out_value=0;this.valuethis._max_value&&(out_value=this._max_value-this.value),this.__isout=Math.abs(out_value)>=this.options.minValidDist,this.__isout&&(this.__speed*out_value<=0?this.__speed+=out_value*this.options.outFriction:this.__speed=out_value*this.options.outAcceleration)}},p._startDecelaration=function(){if(!this._deceleration){this._deceleration=!0;var self=this,tick=function(){self._deceleration&&(self._computeDeceleration(),Math.abs(self.__speed)>self.options.minValidDist||self.__isout?window.requestAnimationFrame(tick):(self._deceleration=!1,self.__isout=!1,self.value=self.__needsSnap&&self.options.snapping&&!self.options.paging?self._checkLimits(self.end_loc+self.__extraMove):Math.round(self.value),self._callrenderer(),self._callonComplete("decel")))};tick()}},window.Controller=Controller}(),function(window,document,$){window.MSLayerController=function(slide){this.slide=slide,this.slider=slide.slider,this.layers=[],this.layersCount=0,this.preloadCount=0,this.$layers=$("
").addClass("ms-slide-layers"),this.$staticLayers=$("
").addClass("ms-static-layers"),this.$fixedLayers=$("
").addClass("ms-fixed-layers"),this.$animLayers=$("
").addClass("ms-anim-layers")};var p=MSLayerController.prototype;p.addLayer=function(layer){switch(layer.slide=this.slide,layer.controller=this,layer.$element.data("position")){case"static":this.hasStaticLayer=!0,layer.$element.appendTo(this.$staticLayers);break;case"fixed":this.hasFixedLayer=!0,layer.$element.appendTo(this.$fixedLayers);break;default:layer.$element.appendTo(this.$animLayers)}layer.create(),this.layers.push(layer),this.layersCount++,layer.parallax&&(this.hasParallaxLayer=!0),layer.needPreload&&this.preloadCount++},p.create=function(){this.slide.$element.append(this.$layers),this.$layers.append(this.$animLayers),this.hasStaticLayer&&this.$layers.append(this.$staticLayers),"center"==this.slider.options.layersMode&&(this.$layers.css("max-width",this.slider.options.width+"px"),this.hasFixedLayer&&this.$fixedLayers.css("max-width",this.slider.options.width+"px"))},p.loadLayers=function(callback){if(this._onReadyCallback=callback,0===this.preloadCount)return void this._onlayersReady();for(var i=0;i!==this.layersCount;++i)this.layers[i].needPreload&&this.layers[i].loadImage()},p.prepareToShow=function(){this.hasParallaxLayer&&this._enableParallaxEffect(),this.hasFixedLayer&&this.$fixedLayers.prependTo(this.slide.view.$element)},p.showLayers=function(){this.layersHideTween&&this.layersHideTween.stop(!0),this.fixedLayersHideTween&&this.fixedLayersHideTween.stop(!0),this._resetLayers(),this.$animLayers.css("opacity","").css("display",""),this.hasFixedLayer&&this.$fixedLayers.css("opacity","").css("display",""),this.ready&&(this._initLayers(),this._locateLayers(),this._startLayers())},p.hideLayers=function(){if(this.slide.selected||this.slider.options.instantStartLayers){var that=this;that.layersHideTween=CTween.animate(this.$animLayers,500,{opacity:0},{complete:function(){that._resetLayers()}}),this.hasFixedLayer&&(this.fixedLayersHideTween=CTween.animate(this.$fixedLayers,500,{opacity:0},{complete:function(){that.$fixedLayers.detach()}})),this.hasParallaxLayer&&this._disableParallaxEffect()}},p.animHideLayers=function(){if(this.ready)for(var i=0;i!==this.layersCount;++i)this.layers[i].hide()},p.setSize=function(width,height,hard){if(this.ready&&(this.slide.selected||this.hasStaticLayer)&&(hard&&this._initLayers(!0),this._locateLayers(!this.slide.selected)),this.slider.options.autoHeight&&this.updateHeight(),"center"==this.slider.options.layersMode){var left=Math.max(0,(width-this.slider.options.width)/2)+"px";this.$layers[0].style.left=left,this.$fixedLayers[0].style.left=left}},p.updateHeight=function(){},p._onlayersReady=function(){this.ready=!0,this.hasStaticLayer&&!this.slide.isSleeping&&this._initLayers(!1,!0),this._onReadyCallback.call(this.slide)},p.onSlideSleep=function(){},p.onSlideWakeup=function(){this.hasStaticLayer&&this.ready&&this._initLayers(!1,!0)},p.getLayerById=function(layerId){if(!layerId)return null;for(var i=0;i").addClass("ms-layer-mask"),this.link?(this.link.wrap(this.$mask),this.$mask=this.link.parent()):(this.$element.wrap(this.$mask),this.$mask=this.$element.parent()),this.maskWidth&&this.$mask.width(this.maskWidth),this.maskHeight&&(this.$mask.height(this.maskHeight),-1===this.__cssConfig.indexOf("height")&&this.__cssConfig.push("height")));var layerOrigin=this.layerOrigin=this.$element.data("origin");if(layerOrigin){var vOrigin=layerOrigin.charAt(0),hOrigin=layerOrigin.charAt(1),offsetX=this.$element.data("offset-x"),offsetY=this.$element.data("offset-y"),layerEle=this.masked?this.$mask[0]:this.$element[0];switch(void 0===offsetY&&(offsetY=0),vOrigin){case"t":layerEle.style.top=offsetY+"px";break;case"b":layerEle.style.bottom=offsetY+"px";break;case"m":layerEle.style.top=offsetY+"px",this.middleAlign=!0}switch(void 0===offsetX&&(offsetX=0),hOrigin){case"l":layerEle.style.left=offsetX+"px";break;case"r":layerEle.style.right=offsetX+"px";break;case"c":layerEle.style.left=offsetX+"px",this.centerAlign=!0}}this.parallax=this.$element.data("parallax"),null!=this.parallax&&(this.parallax/=100,this.$parallaxElement=$("
").addClass("ms-parallax-layer"),this.masked?(this.$mask.wrap(this.$parallaxElement),this.$parallaxElement=this.$mask.parent()):this.link?(this.link.wrap(this.$parallaxElement),this.$parallaxElement=this.link.parent()):(this.$element.wrap(this.$parallaxElement),this.$parallaxElement=this.$element.parent()),this._lastParaX=0,this._lastParaY=0,this._paraX=0,this._paraY=0,this.alignedToBot=this.layerOrigin&&-1!==this.layerOrigin.indexOf("b"),this.alignedToBot&&this.$parallaxElement.css("bottom",0),this.parallaxRender=window._css3d?this._parallaxCSS3DRenderer:window._css2d?this._parallaxCSS2DRenderer:this._parallax2DRenderer,"swipe"!==this.slider.options.parallaxMode&&averta.Ticker.add(this.parallaxRender,this)),$.removeDataAttrs(this.$element,["data-src"])},p.init=function(){this.initialized=!0;var value;this.$element.css("visibility","");for(var i=0,l=this.__cssConfig.length;l>i;i++){var key=this.__cssConfig[i];if(this._isPosition(key)&&this.masked)value=this.$mask.css(key);else if("text"!==this.type||"width"!==key||this.masked||this.maskWidth){value=this.$element.css(key);var isSize="width"===key||"height"===key;isSize&&this.masked&&(this.maskWidth&&"width"===key?value=this.maskWidth+"px":this.maskHeight&&"height"===key&&(value=this.maskHeight+"px")),isSize&&"0px"===value&&(value=this.$element.data(key)+"px")}else value=this.$element[0].style.width;this.layerOrigin&&("top"===key&&-1===this.layerOrigin.indexOf("t")&&-1===this.layerOrigin.indexOf("m")||"bottom"===key&&-1===this.layerOrigin.indexOf("b")||"left"===key&&-1===this.layerOrigin.indexOf("l")&&-1===this.layerOrigin.indexOf("c")||"right"===key&&-1===this.layerOrigin.indexOf("r"))||"auto"!=value&&""!=value&&"normal"!=value&&(this.baseStyle[key]=parseInt(value))}this.middleAlign&&(this.baseHeight=this.$element.outerHeight(!1)),this.centerAlign&&(this.baseWidth=this.$element.outerWidth(!1))},p.locate=function(){if(this.slide.ready){var factor,isPosition,isSize,width=parseFloat(this.layersCont.css("width")),height=parseFloat(this.layersCont.css("height"));!this.staticLayer&&"none"===this.$element.css("display")&&this.isVisible&&this.$element.css("display","").css("visibility","hidden"),this.staticLayer&&this.$element.addClass("ms-hover-active"),factor=this.resizeFactor=width/this.slide.slider.options.width;var $layerEle=this.masked?this.$mask:this.$element;for(var key in this.baseStyle)isPosition=this._isPosition(key),isSize="width"===key||"height"===key,factor=this.fixed&&isPosition?1:this.resizeFactor,(this.resizable||isPosition)&&("top"===key&&this.middleAlign?($layerEle[0].style.top="0px",this.baseHeight=$layerEle.outerHeight(!1),$layerEle[0].style.top=this.baseStyle.top*factor+(height-this.baseHeight)/2+"px"):"left"===key&&this.centerAlign?($layerEle[0].style.left="0px",this.baseWidth=$layerEle.outerWidth(!1),$layerEle[0].style.left=this.baseStyle.left*factor+(width-this.baseWidth)/2+"px"):isPosition&&this.masked?$layerEle[0].style[key]=this.baseStyle[key]*factor+"px":isSize&&("width"===key&&this.maskWidth||"height"===key&&this.maskHeight)?$layerEle[0].style[key]=this.baseStyle[key]*factor+"px":this.$element.css(key,this.baseStyle[key]*factor+"px")); this.visible(this.minWidthi;++i)value=eff_params[i],value in MSLayerEffects.presetEffParams&&(value=MSLayerEffects.presetEffParams[value]),eff_params[i]=value}return{eff_name:eff_name,eff_params:eff_params}},p._parseEffParams=function(params){for(var eff_params=[],i=0,l=params.length;l>i;++i){var value=params[i];"string"==typeof value&&-1!==value.indexOf("|")&&(value=this._randomParam(value)),eff_params[i]=value}return eff_params},p._checkPosKey=function(key,style){return"left"===key&&!(key in this.baseStyle)&&"right"in this.baseStyle?(style.right=-parseInt(style.left)+"px",delete style.left,!0):"top"===key&&!(key in this.baseStyle)&&"bottom"in this.baseStyle?(style.bottom=-parseInt(style.top)+"px",delete style.top,!0):!1},p._isPosition=function(key){return"top"===key||"left"===key||"bottom"===key||"right"===key},p._parallaxCalc=function(){var x_def=this._paraX-this._lastParaX,y_def=this._paraY-this._lastParaY;this._lastParaX+=x_def/12,this._lastParaY+=y_def/12,Math.abs(x_def)<.019&&(this._lastParaX=this._paraX),Math.abs(y_def)<.019&&(this._lastParaY=this._paraY)},p._parallaxCSS3DRenderer=function(){this._parallaxCalc(),this.$parallaxElement[0].style[window._jcsspfx+"Transform"]="translateX("+this._lastParaX*this.parallax+"px) translateY("+this._lastParaY*this.parallax+"px) translateZ(0)"},p._parallaxCSS2DRenderer=function(){this._parallaxCalc(),this.$parallaxElement[0].style[window._jcsspfx+"Transform"]="translateX("+this._lastParaX*this.parallax+"px) translateY("+this._lastParaY*this.parallax+"px)"},p._parallax2DRenderer=function(){this._parallaxCalc(),this.alignedToBot?this.$parallaxElement[0].style.bottom=this._lastParaY*this.parallax+"px":this.$parallaxElement[0].style.top=this._lastParaY*this.parallax+"px",this.$parallaxElement[0].style.left=this._lastParaX*this.parallax+"px"}}(jQuery),function($){window.MSImageLayerElement=function(){MSLayerElement.call(this),this.needPreload=!0,this.__cssConfig=["width","height","margin-top","padding-top","margin-bottom","padding-left","margin-right","padding-right","margin-left","padding-bottom","left","right","top","bottom"],this.type="image"},MSImageLayerElement.extend(MSLayerElement);var p=MSImageLayerElement.prototype,_super=MSLayerElement.prototype;p.create=function(){if(this.link){var p=this.$element.parent();p.append(this.link),this.link.append(this.$element),this.link.removeClass("ms-layer"),this.$element.addClass("ms-layer"),p=null}if(_super.create.call(this),void 0!=this.$element.data("src"))this.img_src=this.$element.data("src"),this.$element.removeAttr("data-src");else{var that=this;this.$element.on("load",function(){that.controller.preloadCount--,0===that.controller.preloadCount&&that.controller._onlayersReady()}).each($.jqLoadFix)}$.browser.msie&&this.$element.on("dragstart",function(event){event.preventDefault()})},p.loadImage=function(){var that=this;this.$element.preloadImg(this.img_src,function(){that.controller.preloadCount--,0===that.controller.preloadCount&&that.controller._onlayersReady()})}}(jQuery),function($){window.MSVideoLayerElement=function(){MSLayerElement.call(this),this.__cssConfig.push("height"),this.type="video"},MSVideoLayerElement.extend(MSLayerElement);var p=MSVideoLayerElement.prototype,_super=MSLayerElement.prototype;p.__playVideo=function(){this.img&&CTween.fadeOut(this.img,500,2),CTween.fadeOut(this.video_btn,500,2),this.video_frame.attr("src","about:blank").css("display","block"),-1==this.video_url.indexOf("?")&&(this.video_url+="?"),this.video_frame.attr("src",this.video_url+"&autoplay=1")},p.start=function(){_super.start.call(this),this.$element.data("autoplay")&&this.__playVideo()},p.reset=function(){return _super.reset.call(this),(this.needPreload||this.$element.data("btn"))&&(this.video_btn.css("opacity",1).css("display","block"),this.video_frame.attr("src","about:blank").css("display","none")),this.needPreload?void this.img.css("opacity",1).css("display","block"):void this.video_frame.attr("src",this.video_url)},p.create=function(){_super.create.call(this),this.video_frame=this.$element.find("iframe").css({width:"100%",height:"100%"}),this.video_url=this.video_frame.attr("src");var has_img=0!=this.$element.has("img").length;if(has_img||this.$element.data("btn")){this.video_frame.attr("src","about:blank").css("display","none");var that=this;if(this.video_btn=$("
").appendTo(this.$element).addClass("ms-video-btn").click(function(){that.__playVideo()}),has_img){if(this.needPreload=!0,this.img=this.$element.find("img:first").addClass("ms-video-img"),void 0!==this.img.data("src"))this.img_src=this.img.data("src"),this.img.removeAttr("data-src");else{var that=this;this.img.attr("src",this.img_src).on("load",function(){that.controller.preloadCount--,0===that.controller.preloadCount&&that.controller._onlayersReady()}).each($.jqLoadFix)}$.browser.msie&&this.img.on("dragstart",function(event){event.preventDefault()})}}},p.loadImage=function(){var that=this;this.img.preloadImg(this.img_src,function(){that.controller.preloadCount--,0===that.controller.preloadCount&&that.controller._onlayersReady()})}}(jQuery),function($){"use strict";window.MSHotspotLayer=function(){MSLayerElement.call(this),this.__cssConfig=["margin-top","padding-top","margin-bottom","padding-left","margin-right","padding-right","margin-left","padding-bottom","left","right","top","bottom"],this.ease="Expo",this.hide_start=!0,this.type="hotspot"},MSHotspotLayer.extend(MSLayerElement);var p=MSHotspotLayer.prototype,_super=MSLayerElement.prototype;p._showTT=function(){this.show_cl&&(clearTimeout(this.hto),this._tween&&this._tween.stop(!0),this.hide_start&&(this.align=this._orgAlign,this._locateTT(),this.tt.css({display:"block"}),this._tween=CTween.animate(this.tt,900,this.to,{ease:"easeOut"+this.ease}),this.hide_start=!1))},p._hideTT=function(){if(this.show_cl){this._tween&&this._tween.stop(!0);var that=this;clearTimeout(this.hto),this.hto=setTimeout(function(){that.hide_start=!0,that._tween=CTween.animate(that.tt,900,that.from,{ease:"easeOut"+that.ease,complete:function(){that.tt.css("display","none")}})},200)}},p._updateClassName=function(name){this._lastClass&&this.tt.removeClass(this._lastClass),this.tt.addClass(name),this._lastClass=name},p._alignPolicy=function(){{var w=(this.tt.outerHeight(!1),Math.max(this.tt.outerWidth(!1),parseInt(this.tt.css("max-width")))),ww=window.innerWidth;window.innerHeight}switch(this.align){case"top":if(this.base_t<0)return"bottom";break;case"right":if(this.base_l+w>ww||this.base_t<0)return"bottom";break;case"left":if(this.base_l<0||this.base_t<0)return"bottom"}return null},p._locateTT=function(){var os=this.$element.offset(),os2=this.slide.slider.$element.offset(),dist=50,space=15;this.pos_x=os.left-os2.left-this.slide.slider.$element.scrollLeft(),this.pos_y=os.top-os2.top-this.slide.slider.$element.scrollTop(),this.from={opacity:0},this.to={opacity:1},this._updateClassName("ms-tooltip-"+this.align),this.tt_arrow.css("margin-left","");var arrow_w=15,arrow_h=15;switch(this.align){case"top":var w=Math.min(this.tt.outerWidth(!1),parseInt(this.tt.css("max-width")));this.base_t=this.pos_y-this.tt.outerHeight(!1)-arrow_h-space,this.base_l=this.pos_x-w/2,this.base_l+w>window.innerWidth&&(this.tt_arrow.css("margin-left",-arrow_w/2+this.base_l+w-window.innerWidth+"px"),this.base_l=window.innerWidth-w),this.base_l<0&&(this.base_l=0,this.tt_arrow.css("margin-left",-arrow_w/2+this.pos_x-this.tt.outerWidth(!1)/2+"px")),window._css3d?(this.from[window._jcsspfx+"Transform"]="translateY(-"+dist+"px)",this.to[window._jcsspfx+"Transform"]=""):(this.from.top=this.base_t-dist+"px",this.to.top=this.base_t+"px");break;case"bottom":var w=Math.min(this.tt.outerWidth(!1),parseInt(this.tt.css("max-width")));this.base_t=this.pos_y+arrow_h+space,this.base_l=this.pos_x-w/2,this.base_l+w>window.innerWidth&&(this.tt_arrow.css("margin-left",-arrow_w/2+this.base_l+w-window.innerWidth+"px"),this.base_l=window.innerWidth-w),this.base_l<0&&(this.base_l=0,this.tt_arrow.css("margin-left",-arrow_w/2+this.pos_x-this.tt.outerWidth(!1)/2+"px")),window._css3d?(this.from[window._jcsspfx+"Transform"]="translateY("+dist+"px)",this.to[window._jcsspfx+"Transform"]=""):(this.from.top=this.base_t+dist+"px",this.to.top=this.base_t+"px");break;case"right":this.base_l=this.pos_x+arrow_w+space,this.base_t=this.pos_y-this.tt.outerHeight(!1)/2,window._css3d?(this.from[window._jcsspfx+"Transform"]="translateX("+dist+"px)",this.to[window._jcsspfx+"Transform"]=""):(this.from.left=this.base_l+dist+"px",this.to.left=this.base_l+"px");break;case"left":this.base_l=this.pos_x-arrow_w-this.tt.outerWidth(!1)-space,this.base_t=this.pos_y-this.tt.outerHeight(!1)/2,window._css3d?(this.from[window._jcsspfx+"Transform"]="translateX(-"+dist+"px)",this.to[window._jcsspfx+"Transform"]=""):(this.from.left=this.base_l-dist+"px",this.to.left=this.base_l+"px")}var policyAlign=this._alignPolicy();return null!==policyAlign?(this.align=policyAlign,void this._locateTT()):(this.tt.css("top",parseInt(this.base_t)+"px").css("left",parseInt(this.base_l)+"px"),void this.tt.css(this.from))},p.start=function(){_super.start.call(this),this.tt.appendTo(this.slide.slider.$element),this.tt.css("display","none")},p.reset=function(){_super.reset.call(this),this.tt.detach()},p.create=function(){var that=this;this._orgAlign=this.align=void 0!==this.$element.data("align")?this.$element.data("align"):"top",this.data=this.$element.html(),this.$element.html("").on("mouseenter",function(){that._showTT()}).on("mouseleave",function(){that._hideTT()}),this.point=$('
').addClass("ms-tooltip-point").appendTo(this.$element);var link=this.$element.data("link"),target=this.$element.data("target");link&&this.point.on("click",function(){window.open(link,target||"_self")}),this.tt=$("
").addClass("ms-tooltip").css("display","hidden").css("opacity",0),void 0!==this.$element.data("width")&&this.tt.css("width",this.$element.data("width")).css("max-width",this.$element.data("width")),this.tt_arrow=$("
").addClass("ms-tooltip-arrow").appendTo(this.tt),this._updateClassName("ms-tooltip-"+this.align),this.ttcont=$("
").addClass("ms-tooltip-cont").html(this.data).appendTo(this.tt),this.$element.data("stay-hover")===!0&&this.tt.on("mouseenter",function(){that.hide_start||(clearTimeout(that.hto),that._tween.stop(!0),that._showTT())}).on("mouseleave",function(){that._hideTT()}),_super.create.call(this)}}(jQuery),function(){window.MSButtonLayer=function(){MSLayerElement.call(this),this.type="button"},MSButtonLayer.extend(MSLayerElement);var p=MSButtonLayer.prototype,_super=MSLayerElement.prototype,positionKies=["top","left","bottom","right"];p.create=function(){_super.create.call(this),this.$element.wrap('
').css("position","relative"),this.$container=this.$element.parent()},p.locate=function(){_super.locate.call(this);for(var key,tempValue,i=0;4>i;i++)key=positionKies[i],key in this.baseStyle&&(tempValue=this.$element.css(key),this.$element.css(key,""),this.$container.css(key,tempValue));this.$container.width(this.$element.outerWidth(!0)).height(this.$element.outerHeight(!0))}}(jQuery),window.MSSliderEvent=function(type){this.type=type},MSSliderEvent.CHANGE_START="ms_changestart",MSSliderEvent.CHANGE_END="ms_changeend",MSSliderEvent.WAITING="ms_waiting",MSSliderEvent.AUTOPLAY_CHANGE="ms_autoplaychange",MSSliderEvent.VIDEO_PLAY="ms_videoPlay",MSSliderEvent.VIDEO_CLOSE="ms_videoclose",MSSliderEvent.INIT="ms_init",MSSliderEvent.HARD_UPDATE="ms_hard_update",MSSliderEvent.RESIZE="ms_resize",MSSliderEvent.RESERVED_SPACE_CHANGE="ms_rsc",MSSliderEvent.DESTROY="ms_destroy",function(window,document,$){"use strict";window.MSSlide=function(){this.$element=null,this.$loading=$("
").addClass("ms-slide-loading"),this.view=null,this.index=-1,this.__width=0,this.__height=0,this.fillMode="fill",this.selected=!1,this.pselected=!1,this.autoAppend=!0,this.isSleeping=!0,this.moz=$.browser.mozilla};var p=MSSlide.prototype;p.onSwipeStart=function(){this.link&&(this.linkdis=!0),this.video&&(this.videodis=!0)},p.onSwipeMove=function(e){var move=Math.max(Math.abs(e.data.distanceX),Math.abs(e.data.distanceY));this.swipeMoved=move>4},p.onSwipeCancel=function(){return this.swipeMoved?void(this.swipeMoved=!1):(this.link&&(this.linkdis=!1),void(this.video&&(this.videodis=!1)))},p.setupLayerController=function(){this.hasLayers=!0,this.layerController=new MSLayerController(this)},p.assetsLoaded=function(){this.ready=!0,this.slider.api._startTimer(),(this.selected||this.pselected&&this.slider.options.instantStartLayers)&&(this.hasLayers&&this.layerController.showLayers(),this.vinit&&(this.bgvideo.play(),this.autoPauseBgVid||(this.bgvideo.currentTime=0))),this.isSleeping||this.setupBG(),CTween.fadeOut(this.$loading,300,!0),(0===this.slider.options.preload||"all"===this.slider.options.preload)&&this.index").addClass("ms-slide-bgcont"),this.$element.append(this.$loading).append(this.$imgcont),this.$bg_img=$(img).css("visibility","hidden"),this.$imgcont.append(this.$bg_img),this.bgAligner=new MSAligner(that.fillMode,that.$imgcont,that.$bg_img),this.bgAligner.widthOnly=this.slider.options.autoHeight,that.slider.options.autoHeight&&(that.pselected||that.selected)&&that.slider.setHeight(that.slider.options.height),void 0!==this.$bg_img.data("src")?(this.bg_src=this.$bg_img.data("src"),this.$bg_img.removeAttr("data-src")):this.$bg_img.one("load",function(event){that._onBGLoad(event)}).each($.jqLoadFix)},p.setupBG=function(){!this.initBG&&this.bgLoaded&&(this.initBG=!0,this.$bg_img.css("visibility",""),this.bgWidth=this.bgNatrualWidth||this.$bg_img.width(),this.bgHeight=this.bgNatrualHeight||this.$bg_img.height(),CTween.fadeIn(this.$imgcont,300),this.slider.options.autoHeight&&this.$imgcont.height(this.bgHeight*this.ratio),this.bgAligner.init(this.bgWidth,this.bgHeight),this.setSize(this.__width,this.__height),this.slider.options.autoHeight&&(this.pselected||this.selected)&&this.slider.setHeight(this.getHeight()))},p.loadImages=function(){if(!this.ls){if(this.ls=!0,this.bgvideo&&this.bgvideo.load(),this.hasBG&&this.bg_src){var that=this;this.$bg_img.preloadImg(this.bg_src,function(event){that._onBGLoad(event)})}this.hasLayers&&this.layerController.loadLayers(this._onLayersLoad),this.hasBG||this.hasLayers||this.assetsLoaded()}},p._onLayersLoad=function(){this.layersLoaded=!0,(!this.hasBG||this.bgLoaded)&&this.assetsLoaded()},p._onBGLoad=function(event){this.bgNatrualWidth=event.width,this.bgNatrualHeight=event.height,this.bgLoaded=!0,$.browser.msie&&this.$bg_img.on("dragstart",function(event){event.preventDefault()}),(!this.hasLayers||this.layerController.ready)&&this.assetsLoaded()},p.setBGVideo=function($video){if($video[0].play){if(window._mobile&&!this.slider.options.mobileBGVideo)return void $video.remove();this.bgvideo=$video[0];var that=this;$video.addClass("ms-slide-bgvideo"),$video.data("loop")!==!1&&this.bgvideo.addEventListener("ended",function(){that.bgvideo.play()}),$video.data("mute")!==!1&&(this.bgvideo.muted=!0),$video.data("autopause")===!0&&(this.autoPauseBgVid=!0),this.bgvideo_fillmode=$video.data("fill-mode")||"fill","none"!==this.bgvideo_fillmode&&(this.bgVideoAligner=new MSAligner(this.bgvideo_fillmode,this.$element,$video),this.bgvideo.addEventListener("loadedmetadata",function(){that.vinit||(that.vinit=!0,that.video_aspect=that.bgVideoAligner.baseHeight/that.bgVideoAligner.baseWidth,that.bgVideoAligner.init(that.bgvideo.videoWidth,that.bgvideo.videoHeight),that._alignBGVideo(),CTween.fadeIn($(that.bgvideo),200),that.selected&&that.bgvideo.play())})),$video.css("opacity",0),this.$bgvideocont=$("
").addClass("ms-slide-bgvideocont").append($video),this.hasBG?this.$imgcont.before(this.$bgvideocont):this.$bgvideocont.appendTo(this.$element)}},p._alignBGVideo=function(){this.bgvideo_fillmode&&"none"!==this.bgvideo_fillmode&&this.bgVideoAligner.align()},p.setSize=function(width,height,hard){this.__width=width,this.slider.options.autoHeight&&(this.bgLoaded?(this.ratio=this.__width/this.bgWidth,height=Math.floor(this.ratio*this.bgHeight),this.$imgcont.height(height)):(this.ratio=width/this.slider.options.width,height=this.slider.options.height*this.ratio)),this.__height=height,this.$element.width(width).height(height),this.hasBG&&this.bgLoaded&&this.bgAligner.align(),this._alignBGVideo(),this.hasLayers&&this.layerController.setSize(width,height,hard)},p.getHeight=function(){return this.hasBG&&this.bgLoaded?this.bgHeight*this.ratio:Math.max(this.$element[0].clientHeight,this.slider.options.height*this.ratio)},p.__playVideo=function(){this.vplayed||this.videodis||(this.vplayed=!0,this.slider.api.paused||(this.slider.api.pause(),this.roc=!0),this.vcbtn.css("display",""),CTween.fadeOut(this.vpbtn,500,!1),CTween.fadeIn(this.vcbtn,500),CTween.fadeIn(this.vframe,500),this.vframe.css("display","block").attr("src",this.video+"&autoplay=1"),this.view.$element.addClass("ms-def-cursor"),this.moz&&this.view.$element.css("perspective","none"),this.view.swipeControl&&this.view.swipeControl.disable(),this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_PLAY)))},p.__closeVideo=function(){if(this.vplayed){this.vplayed=!1,this.roc&&this.slider.api.resume();var that=this;CTween.fadeIn(this.vpbtn,500),CTween.animate(this.vcbtn,500,{opacity:0},{complete:function(){that.vcbtn.css("display","none")}}),CTween.animate(this.vframe,500,{opacity:0},{complete:function(){that.vframe.attr("src","about:blank").css("display","none")}}),this.moz&&this.view.$element.css("perspective",""),this.view.swipeControl&&this.view.swipeControl.enable(),this.view.$element.removeClass("ms-def-cursor"),this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_CLOSE))}},p.create=function(){var that=this;this.hasLayers&&this.layerController.create(),this.link&&this.link.addClass("ms-slide-link").html("").click(function(e){that.linkdis&&e.preventDefault()}),this.video&&(-1===this.video.indexOf("?")&&(this.video+="?"),this.vframe=$("").addClass("ms-slide-video").css({width:"100%",height:"100%",display:"none"}).attr("src","about:blank").attr("allowfullscreen","true").appendTo(this.$element),this.vpbtn=$("
").addClass("ms-slide-vpbtn").click(function(){that.__playVideo()}).appendTo(this.$element),this.vcbtn=$("
").addClass("ms-slide-vcbtn").click(function(){that.__closeVideo()}).appendTo(this.$element).css("display","none"),window._touch&&this.vcbtn.removeClass("ms-slide-vcbtn").addClass("ms-slide-vcbtn-mobile").append('
Close video
').appendTo(this.view.$element.parent())),!this.slider.options.autoHeight&&this.hasBG&&(this.$imgcont.css("height","100%"),("center"===this.fillMode||"stretch"===this.fillMode)&&(this.fillMode="fill")),this.slider.options.autoHeight&&this.$element.addClass("ms-slide-auto-height"),this.sleep(!0)},p.destroy=function(){this.hasLayers&&(this.layerController.destroy(),this.layerController=null),this.$element.remove(),this.$element=null},p.prepareToSelect=function(){this.pselected||this.selected||(this.pselected=!0,(this.link||this.video)&&(this.view.addEventListener(MSViewEvents.SWIPE_START,this.onSwipeStart,this),this.view.addEventListener(MSViewEvents.SWIPE_MOVE,this.onSwipeMove,this),this.view.addEventListener(MSViewEvents.SWIPE_CANCEL,this.onSwipeCancel,this),this.linkdis=!1,this.swipeMoved=!1),this.loadImages(),this.hasLayers&&this.layerController.prepareToShow(),this.ready&&(this.bgvideo&&this.bgvideo.play(),this.hasLayers&&this.slider.options.instantStartLayers&&this.layerController.showLayers()),this.moz&&this.$element.css("margin-top",""))},p.select=function(){this.selected||(this.selected=!0,this.pselected=!1,this.$element.addClass("ms-sl-selected"),this.hasLayers&&(this.slider.options.autoHeight&&this.layerController.updateHeight(),this.slider.options.instantStartLayers||this.layerController.showLayers()),this.ready&&this.bgvideo&&this.bgvideo.play(),this.videoAutoPlay&&(this.videodis=!1,this.vpbtn.trigger("click")))},p.unselect=function(){this.pselected=!1,this.moz&&this.$element.css("margin-top","0.1px"),(this.link||this.video)&&(this.view.removeEventListener(MSViewEvents.SWIPE_START,this.onSwipeStart,this),this.view.removeEventListener(MSViewEvents.SWIPE_MOVE,this.onSwipeMove,this),this.view.removeEventListener(MSViewEvents.SWIPE_CANCEL,this.onSwipeCancel,this)),this.bgvideo&&(this.bgvideo.pause(),!this.autoPauseBgVid&&this.vinit&&(this.bgvideo.currentTime=0)),this.hasLayers&&this.layerController.hideLayers(),this.selected&&(this.selected=!1,this.$element.removeClass("ms-sl-selected"),this.video&&this.vplayed&&(this.__closeVideo(),this.roc=!1))},p.sleep=function(force){(!this.isSleeping||force)&&(this.isSleeping=!0,this.autoAppend&&this.$element.detach(),this.hasLayers&&this.layerController.onSlideSleep())},p.wakeup=function(){this.isSleeping&&(this.isSleeping=!1,this.autoAppend&&this.view.$slideCont.append(this.$element),this.moz&&this.$element.css("margin-top","0.1px"),this.setupBG(),this.hasBG&&this.bgAligner.align(),this.hasLayers&&this.layerController.onSlideWakeup())}}(window,document,jQuery),function($){"use strict";var SliderViewList={};window.MSSlideController=function(slider){this._delayProgress=0,this._timer=new averta.Timer(100),this._timer.onTimer=this.onTimer,this._timer.refrence=this,this.currentSlide=null,this.slider=slider,this.so=slider.options,averta.EventDispatcher.call(this)},MSSlideController.registerView=function(name,_class){if(name in SliderViewList)throw new Error(name+", is already registered.");SliderViewList[name]=_class},MSSlideController.SliderControlList={},MSSlideController.registerControl=function(name,_class){if(name in MSSlideController.SliderControlList)throw new Error(name+", is already registered.");MSSlideController.SliderControlList[name]=_class};var p=MSSlideController.prototype;p.setupView=function(){var that=this;this.resize_listener=function(){that.__resize()};var viewOptions={spacing:this.so.space,mouseSwipe:this.so.mouse,loop:this.so.loop,autoHeight:this.so.autoHeight,swipe:this.so.swipe,speed:this.so.speed,dir:this.so.dir,viewNum:this.so.inView,critMargin:this.so.critMargin};this.so.viewOptions&&$.extend(viewOptions,this.so.viewOptions),this.so.autoHeight&&(this.so.heightLimit=!1);var viewClass=SliderViewList[this.slider.options.view]||MSBasicView;if(!viewClass._3dreq||window._css3d&&!$.browser.msie||(viewClass=viewClass._fallback||MSBasicView),this.view=new viewClass(viewOptions),this.so.overPause){var that=this;this.slider.$element.mouseenter(function(){that.is_over=!0,that._stopTimer()}).mouseleave(function(){that.is_over=!1,that._startTimer()})}},p.onChangeStart=function(){this.change_started=!0,this.currentSlide&&this.currentSlide.unselect(),this.currentSlide=this.view.currentSlide,this.currentSlide.prepareToSelect(),this.so.endPause&&this.currentSlide.index===this.slider.slides.length-1&&(this.pause(),this.skipTimer()),this.so.autoHeight&&this.slider.setHeight(this.currentSlide.getHeight()),this.so.deepLink&&this.__updateWindowHash(),this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_START))},p.onChangeEnd=function(){if(this.change_started=!1,this._startTimer(),this.currentSlide.select(),this.so.preload>1){var loc,i,slide,l=this.so.preload-1;for(i=1;l>=i;++i){if(loc=this.view.index+i,loc>=this.view.slideList.length){if(!this.so.loop){i=l;continue}loc-=this.view.slideList.length}slide=this.view.slideList[loc],slide&&slide.loadImages()}for(l>this.view.slideList.length/2&&(l=Math.floor(this.view.slideList.length/2)),i=1;l>=i;++i){if(loc=this.view.index-i,0>loc){if(!this.so.loop){i=l;continue}loc=this.view.slideList.length+loc}slide=this.view.slideList[loc],slide&&slide.loadImages()}}this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_END))},p.onSwipeStart=function(){this.skipTimer()},p.skipTimer=function(){this._timer.reset(),this._delayProgress=0,this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING))},p.onTimer=function(){if(this._timer.getTime()>=1e3*this.view.currentSlide.delay&&(this.skipTimer(),this.view.next(),this.hideCalled=!1),this._delayProgress=this._timer.getTime()/(10*this.view.currentSlide.delay),this.so.hideLayers&&!this.hideCalled&&1e3*this.view.currentSlide.delay-this._timer.getTime()<=300){var currentSlide=this.view.currentSlide;currentSlide.hasLayers&¤tSlide.layerController.animHideLayers(),this.hideCalled=!0}this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING))},p._stopTimer=function(){this._timer&&this._timer.stop()},p._startTimer=function(){this.paused||this.is_over||!this.currentSlide||!this.currentSlide.ready||this.change_started||this._timer.start()},p.__appendSlides=function(){var slide,loc,i=0,l=this.view.slideList.length-1;for(i;l>i;++i)slide=this.view.slideList[i],slide.detached||(slide.$element.detach(),slide.detached=!0);for(this.view.appendSlide(this.view.slideList[this.view.index]),l=3,i=1;l>=i;++i){if(loc=this.view.index+i,loc>=this.view.slideList.length){if(!this.so.loop){i=l;continue}loc-=this.view.slideList.length}slide=this.view.slideList[loc],slide.detached=!1,this.view.appendSlide(slide)}for(l>this.view.slideList.length/2&&(l=Math.floor(this.view.slideList.length/2)),i=1;l>=i;++i){if(loc=this.view.index-i,0>loc){if(!this.so.loop){i=l;continue}loc=this.view.slideList.length+loc}slide=this.view.slideList[loc],slide.detached=!1,this.view.appendSlide(slide)}},p.__resize=function(hard){this.created&&(this.width=this.slider.$element[0].clientWidth||this.so.width,this.so.fullwidth||(this.width=Math.min(this.width,this.so.width)),this.so.fullheight?(this.so.heightLimit=!1,this.so.autoHeight=!1,this.height=this.slider.$element[0].clientHeight):this.height=this.width/this.slider.aspect,this.so.autoHeight?(this.currentSlide.setSize(this.width,null,hard),this.view.setSize(this.width,this.currentSlide.getHeight(),hard)):this.view.setSize(this.width,Math.max(this.so.minHeight,this.so.heightLimit?Math.min(this.height,this.so.height):this.height),hard),this.slider.$controlsCont&&this.so.centerControls&&this.so.fullwidth&&this.view.$element.css("left",Math.min(0,-(this.slider.$element[0].clientWidth-this.so.width)/2)+"px"),this.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESIZE)))},p.__dispatchInit=function(){this.dispatchEvent(new MSSliderEvent(MSSliderEvent.INIT))},p.__updateWindowHash=function(){var hash=window.location.hash,dl=this.so.deepLink,dlt=this.so.deepLinkType,eq="path"===dlt?"/":"=",sep="path"===dlt?"/":"&",sliderHash=dl+eq+(this.view.index+1),regTest=new RegExp(dl+eq+"[0-9]+","g");window.location.hash=""===hash?sep+sliderHash:regTest.test(hash)?hash.replace(regTest,sliderHash):hash+sep+sliderHash},p.__curentSlideInHash=function(){var hash=window.location.hash,dl=this.so.deepLink,dlt=this.so.deepLinkType,eq="path"===dlt?"/":"=",regTest=new RegExp(dl+eq+"[0-9]+","g");if(regTest.test(hash)){var index=Number(hash.match(regTest)[0].match(/[0-9]+/g).pop());if(!isNaN(index))return index-1}return-1},p.__onHashChanged=function(){var index=this.__curentSlideInHash();-1!==index&&this.gotoSlide(index)},p.__findLayerById=function(layerId){if(!this.currentSlide)return null;var layer;return this.currentSlide.layerController&&(layer=this.currentSlide.layerController.getLayerById(layerId)),!layer&&this.slider.overlayLayers?this.slider.overlayLayers.layerController.getLayerById(layerId):layer},p.setup=function(){this.created=!0,this.paused=!this.so.autoplay,this.view.addEventListener(MSViewEvents.CHANGE_START,this.onChangeStart,this),this.view.addEventListener(MSViewEvents.CHANGE_END,this.onChangeEnd,this),this.view.addEventListener(MSViewEvents.SWIPE_START,this.onSwipeStart,this),this.currentSlide=this.view.slideList[this.so.start-1],this.__resize();var slideInHash=this.__curentSlideInHash(),startSlide=-1!==slideInHash?slideInHash:this.so.start-1;if(this.view.create(startSlide),0===this.so.preload&&this.view.slideList[0].loadImages(),this.scroller=this.view.controller,this.so.wheel){var that=this,last_time=(new Date).getTime();this.wheellistener=function(event){var e=window.event||event.orginalEvent||event;e.preventDefault();var current_time=(new Date).getTime();if(!(400>current_time-last_time)){last_time=current_time;var delta=Math.abs(e.detail||e.wheelDelta);$.browser.mozilla&&(delta*=100);var scrollThreshold=15;return e.detail<0||e.wheelDelta>0?delta>=scrollThreshold&&that.previous(!0):delta>=scrollThreshold&&that.next(!0),!1 }},$.browser.mozilla?this.slider.$element[0].addEventListener("DOMMouseScroll",this.wheellistener):this.slider.$element.bind("mousewheel",this.wheellistener)}0===this.slider.$element[0].clientWidth&&(this.slider.init_safemode=!0),this.__resize();var that=this;this.so.deepLink&&$(window).on("hashchange",function(){that.__onHashChanged()})},p.index=function(){return this.view.index},p.count=function(){return this.view.slidesCount},p.next=function(checkLoop){this.skipTimer(),this.view.next(checkLoop)},p.previous=function(checkLoop){this.skipTimer(),this.view.previous(checkLoop)},p.gotoSlide=function(index){index=Math.min(index,this.count()-1),this.skipTimer(),this.view.gotoSlide(index)},p.destroy=function(reset){this.dispatchEvent(new MSSliderEvent(MSSliderEvent.DESTROY)),this.slider.destroy(reset)},p._destroy=function(){this._timer.reset(),this._timer=null,$(window).unbind("resize",this.resize_listener),this.view.destroy(),this.view=null,this.so.wheel&&($.browser.mozilla?this.slider.$element[0].removeEventListener("DOMMouseScroll",this.wheellistener):this.slider.$element.unbind("mousewheel",this.wheellistener),this.wheellistener=null),this.so=null},p.runAction=function(action){var actionParams=[];if(-1!==action.indexOf("(")){var temp=action.slice(0,action.indexOf("("));actionParams=action.slice(action.indexOf("(")+1,-1).replace(/\"|\'|\s/g,"").split(","),action=temp}action in this?this[action].apply(this,actionParams):console},p.update=function(hard){this.slider.init_safemode&&hard&&(this.slider.init_safemode=!1),this.__resize(hard),hard&&this.dispatchEvent(new MSSliderEvent(MSSliderEvent.HARD_UPDATE))},p.locate=function(){this.__resize()},p.resume=function(){this.paused&&(this.paused=!1,this._startTimer())},p.pause=function(){this.paused||(this.paused=!0,this._stopTimer())},p.currentTime=function(){return this._delayProgress},p.showLayer=function(layerId,delay){var layer=this.__findLayerById(layerId);layer&&(delay?(clearTimeout(layer.actionTimeout),layer.actionTimeout=setTimeout(this.showLayer,delay,layerId,0)):layer.start())},p.hideLayer=function(layerId,delay){var layer=this.__findLayerById(layerId);layer&&(delay?(clearTimeout(layer.actionTimeout),layer.actionTimeout=setTimeout(this.hideLayer,delay,layerId,0)):layer.hide())},p.toggleLayer=function(layerId,delay){var layer=this.__findLayerById(layerId);layer&&(delay?(clearTimeout(layer.actionTimeout),layer.actionTimeout=setTimeout(this.toggleLayer,delay,layerId,0)):layer.isShowing?layer.hide():layer.start())},p.showLayers=function(layerIds,delay){var self=this;$.each(layerIds.replace(/\s+/g,"").split("|"),function(index,layerId){self.showLayer(layerId,delay)})},p.hideLayers=function(layerIds,delay){var self=this;$.each(layerIds.replace(/\s+/g,"").split("|"),function(index,layerId){self.hideLayer(layerId,delay)})},p.toggleLayers=function(layerIds,delay){var self=this;$.each(layerIds.replace(/\s+/g,"").split("|"),function(index,layerId){self.toggleLayer(layerId,delay)})},averta.EventDispatcher.extend(p)}(jQuery),function($){"use strict";var LayerTypes={image:MSImageLayerElement,text:MSLayerElement,video:MSVideoLayerElement,hotspot:MSHotspotLayer,button:MSButtonLayer};window.MasterSlider=function(){this.options={forceInit:!0,autoplay:!1,loop:!1,mouse:!0,swipe:!0,grabCursor:!0,space:0,fillMode:"fill",start:1,view:"basic",width:300,height:150,inView:15,critMargin:1,mobileBGVideo:!1,heightLimit:!0,smoothHeight:!0,autoHeight:!1,minHeight:-1,fullwidth:!1,fullheight:!1,autofill:!1,layersMode:"center",hideLayers:!1,endPause:!1,centerControls:!0,overPause:!0,shuffle:!1,speed:17,dir:"h",preload:0,wheel:!1,layout:"boxed",autofillTarget:null,fullscreenMargin:0,instantStartLayers:!1,parallaxMode:"mouse",rtl:!1,deepLink:null,deepLinkType:"path",disablePlugins:[]},this.slides=[],this.activePlugins=[],this.$element=null,this.lastMargin=0,this.leftSpace=0,this.topSpace=0,this.rightSpace=0,this.bottomSpace=0,this._holdOn=0;var that=this;this.resize_listener=function(){that._resize()},$(window).bind("resize",this.resize_listener)},MasterSlider.author="Averta Ltd. (www.averta.net)",MasterSlider.version="2.51.2",MasterSlider.releaseDate="Jun 2017",MasterSlider._plugins=[];var MS=MasterSlider;MS.registerPlugin=function(plugin){-1===MS._plugins.indexOf(plugin)&&MS._plugins.push(plugin)};var p=MasterSlider.prototype;p.__setupSlides=function(){var new_slide,that=this,ind=0;this.$element.children(".ms-slide").each(function(){var $slide_ele=$(this);new_slide=new MSSlide,new_slide.$element=$slide_ele,new_slide.slider=that,new_slide.delay=void 0!==$slide_ele.data("delay")?$slide_ele.data("delay"):3,new_slide.fillMode=void 0!==$slide_ele.data("fill-mode")?$slide_ele.data("fill-mode"):that.options.fillMode,new_slide.index=ind++,new_slide.id=$slide_ele.data("id");var slide_img=$slide_ele.children("img:not(.ms-layer)");slide_img.length>0&&new_slide.setBG(slide_img[0]);var slide_video=$slide_ele.children("video");if(slide_video.length>0&&new_slide.setBGVideo(slide_video),that.controls)for(var i=0,l=that.controls.length;l>i;++i)that.controls[i].slideAction(new_slide);$slide_ele.children("a").each(function(){var $this=$(this);"video"===this.getAttribute("data-type")?(new_slide.video=this.getAttribute("href"),new_slide.videoAutoPlay=$this.data("autoplay"),$this.remove()):$this.hasClass("ms-layer")||(new_slide.link=$(this))});that.__createSlideLayers(new_slide,$slide_ele.find(".ms-layer")),that.slides.push(new_slide),that.slideController.view.addSlide(new_slide)})},p._setupOverlayLayers=function(){var self=this,$ollayers=this.$element.children(".ms-overlay-layers").eq(0);if($ollayers.length){var overlayLayers=new MSOverlayLayers(this);overlayLayers.$element=$ollayers,self.__createSlideLayers(overlayLayers,$ollayers.find(".ms-layer")),this.view.$element.prepend($ollayers),this.overlayLayers=overlayLayers,overlayLayers.create()}},p.__createSlideLayers=function(slide,layers){0!=layers.length&&(slide.setupLayerController(),layers.each(function(index,domEle){var $parent_ele,$layer_element=$(this);"A"===domEle.nodeName&&"image"===$layer_element.find(">img").data("type")&&($parent_ele=$(this),$layer_element=$parent_ele.find("img"));var layer=new(LayerTypes[$layer_element.data("type")||"text"]);layer.$element=$layer_element,layer.link=$parent_ele,layer.id=layer.$element.data("id"),layer.waitForAction=layer.$element.data("wait"),layer.masked=layer.$element.data("masked"),layer.maskWidth=layer.$element.data("mask-width"),layer.maskHeight=layer.$element.data("mask-height");var eff_parameters={},end_eff_parameters={};void 0!==$layer_element.data("effect")&&(eff_parameters.name=$layer_element.data("effect")),void 0!==$layer_element.data("ease")&&(eff_parameters.ease=$layer_element.data("ease")),void 0!==$layer_element.data("duration")&&(eff_parameters.duration=$layer_element.data("duration")),void 0!==$layer_element.data("delay")&&(eff_parameters.delay=$layer_element.data("delay")),$layer_element.data("hide-effect")&&(end_eff_parameters.name=$layer_element.data("hide-effect")),$layer_element.data("hide-ease")&&(end_eff_parameters.ease=$layer_element.data("hide-ease")),void 0!==$layer_element.data("hide-duration")&&(end_eff_parameters.duration=$layer_element.data("hide-duration")),void 0!==$layer_element.data("hide-time")&&(end_eff_parameters.time=$layer_element.data("hide-time")),layer.setStartAnim(eff_parameters),layer.setEndAnim(end_eff_parameters),slide.layerController.addLayer(layer)}))},p._removeLoading=function(){$(window).unbind("resize",this.resize_listener),this.$element.removeClass("before-init").css("visibility","visible").css("height","").css("opacity",0),CTween.fadeIn(this.$element),this.$loading.remove(),this.slideController&&this.slideController.__resize()},p._resize=function(){if(this.$loading){var h=this.$loading[0].clientWidth/this.aspect;h=this.options.heightLimit?Math.min(h,this.options.height):h,this.$loading.height(h),this.$element.height(h)}},p._shuffleSlides=function(){for(var r,slides=this.$element.children(".ms-slide"),i=0,l=slides.length;l>i;++i)r=Math.floor(Math.random()*(l-1)),i!=r&&(this.$element[0].insertBefore(slides[i],slides[r]),slides=this.$element.children(".ms-slide"))},p._setupSliderLayout=function(){this._updateSideMargins(),this.lastMargin=this.leftSpace;var lo=this.options.layout;"boxed"!==lo&&"partialview"!==lo&&(this.options.fullwidth=!0),("fullscreen"===lo||"autofill"===lo)&&(this.options.fullheight=!0,"autofill"===lo&&(this.$autofillTarget=$(this.options.autofillTarget),0===this.$autofillTarget.length&&(this.$autofillTarget=this.$element.parent()))),"partialview"===lo&&this.$element.addClass("ms-layout-partialview"),("fullscreen"===lo||"fullwidth"===lo||"autofill"===lo)&&($(window).bind("resize",{that:this},this._updateLayout),this._updateLayout()),$(window).bind("resize",this.slideController.resize_listener)},p._updateLayout=function(event){var that=event?event.data.that:this,lo=that.options.layout,$element=that.$element,$win=$(window);if("fullscreen"===lo)document.body.style.overflow="hidden",$element.height($win.height()-that.options.fullscreenMargin-that.topSpace-that.bottomSpace),document.body.style.overflow="";else if("autofill"===lo)return void $element.height(that.$autofillTarget.height()-that.options.fullscreenMargin-that.topSpace-that.bottomSpace).width(that.$autofillTarget.width()-that.leftSpace-that.rightSpace);$element.width($win.width()-that.leftSpace-that.rightSpace);var margin=-$element.offset().left+that.leftSpace+that.lastMargin;$element.css("margin-left",margin),that.lastMargin=margin},p._init=function(){if(!(this._holdOn>0)&&this._docReady){if(this.initialized=!0,"all"!==this.options.preload&&this._removeLoading(),this.options.shuffle&&this._shuffleSlides(),MSLayerEffects.setup(),this.slideController.setupView(),this.view=this.slideController.view,this.$controlsCont=$("
").addClass("ms-inner-controls-cont"),this.options.centerControls&&this.$controlsCont.css("max-width",this.options.width+"px"),this.$controlsCont.prepend(this.view.$element),this.$msContainer=$("
").addClass("ms-container").prependTo(this.$element).append(this.$controlsCont),this.controls)for(var i=0,l=this.controls.length;l>i;++i)this.controls[i].setup();if(this._setupSliderLayout(),this.__setupSlides(),this.slideController.setup(),this._setupOverlayLayers(),this.controls)for(i=0,l=this.controls.length;l>i;++i)this.controls[i].create();if(this.options.autoHeight&&this.slideController.view.$element.height(this.slideController.currentSlide.getHeight()),this.options.swipe&&!window._touch&&this.options.grabCursor&&this.options.mouse){var $view=this.view.$element;$view.mousedown(function(){$view.removeClass("ms-grab-cursor"),$view.addClass("ms-grabbing-cursor"),$.browser.msie&&window.ms_grabbing_curosr&&($view[0].style.cursor="url("+window.ms_grabbing_curosr+"), move")}).addClass("ms-grab-cursor"),$(document).mouseup(function(){$view.removeClass("ms-grabbing-cursor"),$view.addClass("ms-grab-cursor"),$.browser.msie&&window.ms_grab_curosr&&($view[0].style.cursor="url("+window.ms_grab_curosr+"), move")})}this.slideController.__dispatchInit()}},p.setHeight=function(value){this.options.smoothHeight?(this.htween&&(this.htween.reset?this.htween.reset():this.htween.stop(!0)),this.htween=CTween.animate(this.slideController.view.$element,500,{height:value},{ease:"easeOutQuart"})):this.slideController.view.$element.height(value)},p.reserveSpace=function(side,space){var sideSpace=side+"Space",pos=this[sideSpace];return this[sideSpace]+=space,this._updateSideMargins(),pos},p._updateSideMargins=function(){this.$element.css("margin",this.topSpace+"px "+this.rightSpace+"px "+this.bottomSpace+"px "+this.leftSpace+"px")},p._realignControls=function(){this.rightSpace=this.leftSpace=this.topSpace=this.bottomSpace=0,this._updateSideMargins(),this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE))},p.control=function(control,options){if(control in MSSlideController.SliderControlList){this.controls||(this.controls=[]);var ins=new MSSlideController.SliderControlList[control](options);return ins.slider=this,this.controls.push(ins),this}},p.holdOn=function(){this._holdOn++},p.release=function(){this._holdOn--,this._init()},p.setup=function(target,options){if(this.$element="string"==typeof target?$("#"+target):target.eq(0),this.setupMarkup=this.$element.html(),0!==this.$element.length){this.$element.addClass("master-slider").addClass("before-init"),$.browser.msie?this.$element.addClass("ms-ie").addClass("ms-ie"+$.browser.version.slice(0,$.browser.version.indexOf("."))):$.browser.webkit?this.$element.addClass("ms-wk"):$.browser.mozilla&&this.$element.addClass("ms-moz");var ua=navigator.userAgent.toLowerCase(),isAndroid=ua.indexOf("android")>-1;isAndroid&&this.$element.addClass("ms-android");var that=this;$.extend(this.options,options),this.aspect=this.options.width/this.options.height,this.$loading=$("
").addClass("ms-loading-container").insertBefore(this.$element).append($("
").addClass("ms-loading")),this.$loading.parent().css("position","relative"),this.options.autofill&&(this.options.fullwidth=!0,this.options.fullheight=!0),this.options.fullheight&&this.$element.addClass("ms-fullheight"),this._resize(),this.slideController=new MSSlideController(this),this.api=this.slideController;for(var i=0,l=MS._plugins.length;i!==l;i++){var plugin=MS._plugins[i];-1===this.options.disablePlugins.indexOf(plugin.name)&&this.activePlugins.push(new plugin(this))}return this.options.forceInit&&MasterSlider.addJQReadyErrorCheck(this),$(document).ready(function(){that.initialized||(that._docReady=!0,that._init())}),this}},p.destroy=function(insertMarkup){for(var i=0,l=this.activePlugins.length;i!==l;i++)this.activePlugins[i].destroy();if(this.controls)for(i=0,l=this.controls.length;i!==l;i++)this.controls[i].destroy();this.slideController&&this.slideController._destroy(),this.$loading&&this.$loading.remove(),insertMarkup?this.$element.html(this.setupMarkup).css("visibility","hidden"):this.$element.remove();var lo=this.options.layout;("fullscreen"===lo||"fullwidth"===lo)&&$(window).unbind("resize",this._updateLayout),this.view=null,this.slides=null,this.options=null,this.slideController=null,this.api=null,this.resize_listener=null,this.activePlugins=null}}(jQuery),function($,window,document,undefined){function MasterSliderPlugin(element,options){this.element=element,this.$element=$(element),this.settings=$.extend({},defaults,options),this._defaults=defaults,this._name=pluginName,this.init()}var pluginName="masterslider",defaults={controls:{}};$.extend(MasterSliderPlugin.prototype,{init:function(){var self=this;this._slider=new MasterSlider;for(var control in this.settings.controls)this._slider.control(control,this.settings.controls[control]);this._slider.setup(this.$element,this.settings);var _superDispatch=this._slider.api.dispatchEvent;this._slider.api.dispatchEvent=function(event){self.$element.trigger(event.type),_superDispatch.call(this,event)}},api:function(){return this._slider.api},slider:function(){return this._slider}}),$.fn[pluginName]=function(options){var args=arguments,plugin="plugin_"+pluginName;if(options===undefined||"object"==typeof options)return this.each(function(){$.data(this,plugin)||$.data(this,plugin,new MasterSliderPlugin(this,options))});if("string"==typeof options&&"_"!==options[0]&&"init"!==options){var returns;return this.each(function(){var instance=$.data(this,plugin);instance instanceof MasterSliderPlugin&&"function"==typeof instance[options]&&(returns=instance[options].apply(instance,Array.prototype.slice.call(args,1))),instance instanceof MasterSliderPlugin&&"function"==typeof instance._slider.api[options]&&(returns=instance._slider.api[options].apply(instance._slider.api,Array.prototype.slice.call(args,1))),"destroy"===options&&$.data(this,plugin,null)}),returns!==undefined?returns:this}}}(jQuery,window,document),function($,window){"use strict";var sliderInstances=[];MasterSlider.addJQReadyErrorCheck=function(slider){sliderInstances.push(slider)};var _ready=$.fn.ready,_onerror=window.onerror;$.fn.ready=function(){return window.onerror=function(){if(0!==sliderInstances.length)for(var i=0,l=sliderInstances.length;i!==l;i++){var slider=sliderInstances[i];slider.initialized||(slider._docReady=!0,slider._init())}return _onerror?_onerror.apply(this,arguments):!1},_ready.apply(this,arguments)}}(jQuery,window,document),window.MSViewEvents=function(type,data){this.type=type,this.data=data},MSViewEvents.SWIPE_START="swipeStart",MSViewEvents.SWIPE_END="swipeEnd",MSViewEvents.SWIPE_MOVE="swipeMove",MSViewEvents.SWIPE_CANCEL="swipeCancel",MSViewEvents.SCROLL="scroll",MSViewEvents.CHANGE_START="slideChangeStart",MSViewEvents.CHANGE_END="slideChangeEnd",function($){"use strict";window.MSBasicView=function(options){this.options={loop:!1,dir:"h",autoHeight:!1,spacing:5,mouseSwipe:!0,swipe:!0,speed:17,minSlideSpeed:2,viewNum:20,critMargin:1},$.extend(this.options,options),this.dir=this.options.dir,this.loop=this.options.loop,this.spacing=this.options.spacing,this.__width=0,this.__height=0,this.__cssProb="h"===this.dir?"left":"top",this.__offset="h"===this.dir?"offsetLeft":"offsetTop",this.__dimension="h"===this.dir?"__width":"__height",this.__translate_end=window._css3d?" translateZ(0px)":"",this.$slideCont=$("
").addClass("ms-slide-container"),this.$element=$("
").addClass("ms-view").addClass("ms-basic-view").append(this.$slideCont),this.currentSlide=null,this.index=-1,this.slidesCount=0,this.slides=[],this.slideList=[],this.viewSlidesList=[],this.css3=window._cssanim,this.start_buffer=0,this.firstslide_snap=0,this.slideChanged=!1,this.controller=new Controller(0,0,{snapping:!0,snapsize:100,paging:!0,snappingMinSpeed:this.options.minSlideSpeed,friction:(100-.5*this.options.speed)/100,endless:this.loop}),this.controller.renderCallback("h"===this.dir?this._horizUpdate:this._vertiUpdate,this),this.controller.snappingCallback(this.__snapUpdate,this),this.controller.snapCompleteCallback(this.__snapCompelet,this),averta.EventDispatcher.call(this)};var p=MSBasicView.prototype;p.__snapCompelet=function(){this.slideChanged&&(this.slideChanged=!1,this.__locateSlides(),this.start_buffer=0,this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END)))},p.__snapUpdate=function(controller,snap,change){if(this.loop){var target_index=this.index+change;this.updateLoop(target_index),target_index>=this.slidesCount&&(target_index-=this.slidesCount),0>target_index&&(target_index=this.slidesCount+target_index),this.index=target_index}else{if(0>snap||snap>=this.slidesCount)return;this.index=snap}this._checkCritMargins(),$.browser.mozilla&&(this.slideList[this.index].$element[0].style.marginTop="0.1px",this.currentSlide&&(this.currentSlide.$element[0].style.marginTop=""));var new_slide=this.slideList[this.index];new_slide!==this.currentSlide&&(this.currentSlide=new_slide,this.autoUpdateZIndex&&this.__updateSlidesZindex(),this.slideChanged=!0,this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START)))},p._checkCritMargins=function(){if(!this.normalMode){var hlf=Math.floor(this.options.viewNum/2),inView=this.viewSlidesList.indexOf(this.slideList[this.index]),size=this[this.__dimension]+this.spacing,cm=this.options.critMargin;return this.loop?void((cm>=inView||inView>=this.viewSlidesList.length-cm)&&(size*=inView-hlf,this.__locateSlides(!1,size+this.start_buffer),this.start_buffer+=size)):void((cm>inView&&this.index>=cm||inView>=this.viewSlidesList.length-cm&&this.index=i;++i)return_arr.unshift(this.slideList[this.index-i<0?this.slidesCount-i+this.index:this.index-i]);for(return_arr.push(this.slideList[this.index]),i=1;after_count>=i;++i)return_arr.push(this.slideList[this.index+i>=this.slidesCount?this.index+i-this.slidesCount:this.index+i]);return return_arr},p.__getSteps=function(index,target){var right=index>target?this.slidesCount-index+target:target-index,left=Math.abs(this.slidesCount-right);return left>right?right:-left},p.__pushEnd=function(){var first_slide=this.slides.shift(),last_slide=this.slides[this.slidesCount-2];if(this.slides.push(first_slide),this.normalMode){var pos=last_slide.$element[0][this.__offset]+this.spacing+this[this.__dimension];first_slide.$element[0].style[this.__cssProb]=pos+"px",first_slide.position=pos}},p.__pushStart=function(){var last_slide=this.slides.pop(),first_slide=this.slides[0];if(this.slides.unshift(last_slide),this.normalMode){var pos=first_slide.$element[0][this.__offset]-this.spacing-this[this.__dimension];last_slide.$element[0].style[this.__cssProb]=pos+"px",last_slide.position=pos}},p.__updateSlidesZindex=function(){{var slide,l=this.viewSlidesList.length;Math.floor(l/2)}if(this.loop)for(var loc=this.viewSlidesList.indexOf(this.currentSlide),i=0;i!==l;i++)slide=this.viewSlidesList[i],this.viewSlidesList[i].$element.css("z-index",loc>=i?i+1:l-i);else{for(var beforeNum=this.currentSlide.index-this.viewSlidesList[0].index,i=0;i!==l;i++)this.viewSlidesList[i].$element.css("z-index",beforeNum>=i?i+1:l-i);this.currentSlide.$element.css("z-index",l)}},p.addSlide=function(slide){slide.view=this,this.slides.push(slide),this.slideList.push(slide),this.slidesCount++},p.appendSlide=function(slide){this.$slideCont.append(slide.$element)},p.updateLoop=function(index){if(this.loop)for(var steps=this.__getSteps(this.index,index),i=0,l=Math.abs(steps);l>i;++i)0>steps?this.__pushStart():this.__pushEnd()},p.gotoSlide=function(index,fast){this.updateLoop(index),this.index=index;var target_slide=this.slideList[index];this._checkCritMargins(),this.controller.changeTo(target_slide.position,!fast,null,null,!1),target_slide!==this.currentSlide&&(this.slideChanged=!0,this.currentSlide=target_slide,this.autoUpdateZIndex&&this.__updateSlidesZindex(),this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START)),fast&&this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END)))},p.next=function(checkLoop){return checkLoop&&!this.loop&&this.index+1>=this.slidesCount?void this.controller.bounce(10):void this.gotoSlide(this.index+1>=this.slidesCount?0:this.index+1)},p.previous=function(checkLoop){return checkLoop&&!this.loop&&this.index-1<0?void this.controller.bounce(-10):void this.gotoSlide(this.index-1<0?this.slidesCount-1:this.index-1)},p.setupSwipe=function(){this.swipeControl=new averta.TouchSwipe(this.$element),this.swipeControl.swipeType="h"===this.dir?"horizontal":"vertical";var that=this;this.swipeControl.onSwipe="h"===this.dir?function(status){that.horizSwipeMove(status)}:function(status){that.vertSwipeMove(status)}},p.vertSwipeMove=function(status){var phase=status.phase;if("start"===phase)this.controller.stop(),this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START,status));else if("move"===phase&&(!this.loop||Math.abs(this.currentSlide.position-this.controller.value+status.moveY).1&&Math.abs(speed)>=speedh?(this.controller.push(-speed),speed>this.controller.options.snappingMinSpeed&&this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END,status))):(this.controller.cancel(),this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL,status)))}},p.horizSwipeMove=function(status){var phase=status.phase;if("start"===phase)this.controller.stop(),this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START,status));else if("move"===phase&&(!this.loop||Math.abs(this.currentSlide.position-this.controller.value+status.moveX).1&&Math.abs(speed)>=speedv?(this.controller.push(-speed),speed>this.controller.options.snappingMinSpeed&&this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END,status))):(this.controller.cancel(),this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL,status)))}},p.setSize=function(width,height,hard){if(this.lastWidth!==width||height!==this.lastHeight||hard){this.$element.width(width).height(height);for(var i=0;idistance?-1:1),zvalue=1.2*value;slide.$element[0].style[window._jcsspfx+"Transform"]="translateZ("+5*-zvalue+"px) rotateY("+rvalue+"deg) "},p.__updateSlidesVertic=function(slide,distance){var value=Math.abs(100*distance/this.__width),rvalue=Math.min(.3*value,30)*(0>distance?-1:1),zvalue=1.2*value;slide.$element[0].style[window._jcsspfx+"Transform"]="translateZ("+5*-zvalue+"px) rotateX("+-rvalue+"deg) "},MSSlideController.registerView("flow",MSFlowView)}(jQuery),function(){window.MSFadeFlowView=function(options){MSWaveView.call(this,options),this.$element.removeClass("ms-wave-view").addClass("ms-fade-flow-view")},MSFadeFlowView.extend(MSWaveView),MSFadeFlowView._3dreq=!0;{var p=MSFadeFlowView.prototype;MSWaveView.prototype}p.__calculate=function(distance){var value=Math.min(Math.abs(100*distance/this.__width),100),rvalue=Math.min(.5*value,50)*(0>distance?-1:1);return{value:value,rvalue:rvalue}},p.__updateSlidesHoriz=function(slide,distance){var clc=this.__calculate(distance);slide.$element.css("opacity",1-clc.value/300),slide.$element[0].style[window._jcsspfx+"Transform"]="translateZ("+-clc.value+"px) rotateY("+clc.rvalue+"deg) "},p.__updateSlidesVertic=function(slide,distance){var clc=this.__calculate(distance); slide.$element.css("opacity",1-clc.value/300),slide.$element[0].style[window._jcsspfx+"Transform"]="translateZ("+-clc.value+"px) rotateX("+-clc.rvalue+"deg) "},MSSlideController.registerView("fadeFlow",MSFadeFlowView)}(),function($){"use strict";window.MSMaskView=function(options){MSBasicView.call(this,options),this.$element.removeClass("ms-basic-view").addClass("ms-mask-view")},MSMaskView.extend(MSBasicView);var p=MSMaskView.prototype,_super=MSBasicView.prototype;p.addSlide=function(slide){slide.view=this,slide.$frame=$("
").addClass("ms-mask-frame").append(slide.$element),slide.$element[0].style.position="relative",slide.autoAppend=!1,this.slides.push(slide),this.slideList.push(slide),this.slidesCount++},p.setSize=function(width,height){for(var slider=this.slides[0].slider,i=0;i=1-value?slide.$element.fadeTo(0,0).css("visibility","hidden"):slide.$element.fadeTo(0,1-value).css("visibility","")},p.__locateSlides=function(move,start){this.__updateViewList(),start=this.loop?start||0:this.slides.indexOf(this.viewSlidesList[0])*(this[this.__dimension]+this.spacing);for(var slide,l=this.viewSlidesList.length,i=0;i!==l;i++){var pos=start+i*this[this.__dimension];slide=this.viewSlidesList[i],slide.wakeup(),slide.position=pos}move!==!1&&this.controller.changeTo(this.slideList[this.index].position,!1,null,null,!1)},p.__pushEnd=function(){var first_slide=this.slides.shift(),last_slide=this.slides[this.slidesCount-2];this.slides.push(first_slide),first_slide.position=last_slide.position+this[this.__dimension]},p.__pushStart=function(){var last_slide=this.slides.pop(),first_slide=this.slides[0];this.slides.unshift(last_slide),last_slide.position=first_slide.position-this[this.__dimension]},p.create=function(index){_super.create.call(this,index),this.spacing=0,this.controller.options.minValidDist=10},MSSlideController.registerView("fade",MSFadeView)}(jQuery),function(){"use strict";window.MSScaleView=function(options){MSBasicView.call(this,options),this.$element.removeClass("ms-basic-view").addClass("ms-scale-view"),this.controller.renderCallback(this.__update,this)},MSScaleView.extend(MSFadeView);var p=MSScaleView.prototype,_super=MSFadeView.prototype;p.__updateSlides=function(slide,distance){var value=Math.abs(distance/this[this.__dimension]),element=slide.$element[0];0>=1-value?(element.style.opacity=0,element.style.visibility="hidden",element.style[window._jcsspfx+"Transform"]=""):(element.style.opacity=1-value,element.style.visibility="",element.style[window._jcsspfx+"Transform"]="perspective(2000px) translateZ("+value*(0>distance?-.5:.5)*300+"px)")},p.create=function(index){_super.create.call(this,index),this.controller.options.minValidDist=.03},MSSlideController.registerView("scale",MSScaleView)}(jQuery),function(){"use strict";window.MSStackView=function(options){MSBasicView.call(this,options),this.$element.removeClass("ms-basic-view").addClass("ms-stack-view"),this.controller.renderCallback(this.__update,this),this.autoUpdateZIndex=!0},MSStackView.extend(MSFadeView),MSStackView._3dreq=!0,MSStackView._fallback=MSFadeView;var p=MSStackView.prototype,_super=MSFadeView.prototype;p.__updateSlidesZindex=function(){for(var slide,l=this.viewSlidesList.length,i=0;i!==l;i++)slide=this.viewSlidesList[i],this.viewSlidesList[i].$element.css("z-index",l-i)},p.__updateSlides=function(slide,distance){var value=Math.abs(distance/this[this.__dimension]),element=slide.$element[0];0>=1-value?(element.style.opacity=1,element.style.visibility="hidden",element.style[window._jcsspfx+"Transform"]=""):(element.style.visibility="",element.style[window._jcsspfx+"Transform"]=0>distance?"perspective(2000px) translateZ("+-300*value+"px)":this.__translate+"("+-value*this[this.__dimension]+"px)")},p.create=function(index){_super.create.call(this,index),this.controller.options.minValidDist=.03,this.__translate="h"===this.dir?"translateX":"translateY"},MSSlideController.registerView("stack",MSStackView)}(jQuery),function(){"use strict";var perspective=2e3;window.MSFocusView=function(options){MSWaveView.call(this,options),this.$element.removeClass("ms-wave-view").addClass("ms-focus-view"),this.options.centerSpace=this.options.centerSpace||1},MSFocusView.extend(MSWaveView),MSFocusView._3dreq=!0,MSFocusView._fallback=MSFadeBasicView;{var p=MSFocusView.prototype;MSWaveView.prototype}p.__calcview=function(z,w){var a=w/2*z/(z+perspective);return a*(z+perspective)/perspective},p.__updateSlidesHoriz=function(slide,distance){var value=Math.abs(100*distance/this.__width);value=15*-Math.min(value,100),slide.$element.css(window._csspfx+"transform","translateZ("+(value+1)+"px) rotateY(0.01deg) translateX("+(0>distance?1:-1)*-this.__calcview(value,this.__width)*this.options.centerSpace+"px)")},p.__updateSlidesVertic=function(slide,distance){var value=Math.abs(100*distance/this.__width);value=15*-Math.min(value,100),slide.$element.css(window._csspfx+"transform","translateZ("+(value+1)+"px) rotateY(0.01deg) translateY("+(0>distance?1:-1)*-this.__calcview(value,this.__width)*this.options.centerSpace+"px)")},MSSlideController.registerView("focus",MSFocusView)}(),function(){window.MSPartialWaveView=function(options){MSWaveView.call(this,options),this.$element.removeClass("ms-wave-view").addClass("ms-partial-wave-view")},MSPartialWaveView.extend(MSWaveView),MSPartialWaveView._3dreq=!0,MSPartialWaveView._fallback=MSFadeBasicView;{var p=MSPartialWaveView.prototype;MSWaveView.prototype}p.__updateSlidesHoriz=function(slide,distance){var value=Math.abs(100*distance/this.__width);slide.hasBG&&slide.$bg_img.css("opacity",(100-Math.abs(120*distance/this.__width/3))/100),slide.$element.css(window._csspfx+"transform","translateZ("+3*-value+"px) rotateY(0.01deg) translateX("+.75*distance+"px)")},p.__updateSlidesVertic=function(slide,distance){var value=Math.abs(100*distance/this.__width);slide.hasBG&&slide.$bg_img.css("opacity",(100-Math.abs(120*distance/this.__width/3))/100),slide.$element.css(window._csspfx+"transform","translateZ("+3*-value+"px) rotateY(0.01deg) translateY("+.75*distance+"px)")},MSSlideController.registerView("partialWave",MSPartialWaveView)}(),function(){"use strict";window.MSBoxView=function(options){MSBasicView.call(this,options),this.$element.removeClass("ms-basic-view").addClass("ms-box-view"),this.controller.renderCallback(this.__update,this)},MSBoxView.extend(MSFadeView),MSBoxView._3dreq=!0;var p=MSBoxView.prototype,_super=MSFadeView.prototype;p.__updateSlides=function(slide,distance){var value=Math.abs(distance/this[this.__dimension]),element=slide.$element[0];0>=1-value?(element.style.visibility="hidden",element.style[window._jcsspfx+"Transform"]=""):(element.style.visibility="",element.style[window._jcsspfx+"Transform"]="rotate"+this._rotateDir+"("+value*(0>distance?1:-1)*90*this._calcFactor+"deg)",element.style[window._jcsspfx+"TransformOrigin"]="50% 50% -"+slide[this.__dimension]/2+"px",element.style.zIndex=Math.ceil(2*(1-value)))},p.create=function(index){_super.create.call(this,index),this.controller.options.minValidDist=.03,this._rotateDir="h"===this.options.dir?"Y":"X",this._calcFactor="h"===this.options.dir?1:-1},MSSlideController.registerView("box",MSBoxView)}(jQuery),function($){"use strict";var BaseControl=function(){this.options={prefix:"ms-",autohide:!0,overVideo:!0,customClass:null}},p=BaseControl.prototype;p.slideAction=function(){},p.setup=function(){this.cont=this.options.insertTo?$(this.options.insertTo):this.slider.$controlsCont,this.options.overVideo||this._hideOnvideoStarts()},p.checkHideUnder=function(){this.options.hideUnder&&(this.needsRealign=!this.options.insetTo&&("left"===this.options.align||"right"===this.options.align)&&this.options.inset===!1,$(window).bind("resize",{that:this},this.onResize),this.onResize())},p.onResize=function(event){var that=event&&event.data.that||this,w=window.innerWidth;w<=that.options.hideUnder&&!that.detached?(that.hide(!0),that.detached=!0,that.onDetach()):w>=that.options.hideUnder&&that.detached&&(that.detached=!1,that.visible(),that.onAppend())},p.create=function(){this.options.autohide&&(this.hide(!0),this.slider.$controlsCont.mouseenter($.proxy(this._onMouseEnter,this)).mouseleave($.proxy(this._onMouseLeave,this)).mousedown($.proxy(this._onMouseDown,this)),this.$element&&this.$element.mouseenter($.proxy(this._onMouseEnter,this)).mouseleave($.proxy(this._onMouseLeave,this)).mousedown($.proxy(this._onMouseDown,this)),$(document).mouseup($.proxy(this._onMouseUp,this))),this.options.align&&this.$element.addClass("ms-align-"+this.options.align),this.options.customClass&&this.$element&&this.$element.addClass(this.options.customClass)},p._onMouseEnter=function(){this._disableAH||this.mdown||this.visible(),this.mleave=!1},p._onMouseLeave=function(){this.mdown||this.hide(),this.mleave=!0},p._onMouseDown=function(){this.mdown=!0},p._onMouseUp=function(){this.mdown&&this.mleave&&this.hide(),this.mdown=!1},p.onAppend=function(){this.needsRealign&&this.slider._realignControls()},p.onDetach=function(){this.needsRealign&&this.slider._realignControls()},p._hideOnvideoStarts=function(){var that=this;this.slider.api.addEventListener(MSSliderEvent.VIDEO_PLAY,function(){that._disableAH=!0,that.hide()}),this.slider.api.addEventListener(MSSliderEvent.VIDEO_CLOSE,function(){that._disableAH=!1,that.visible()})},p.hide=function(fast){if(fast)this.$element.css("opacity",0),this.$element.css("display","none");else{clearTimeout(this.hideTo);var $element=this.$element;this.hideTo=setTimeout(function(){CTween.fadeOut($element,400,!1)},20)}this.$element.addClass("ms-ctrl-hide")},p.visible=function(){this.detached||(clearTimeout(this.hideTo),this.$element.css("display",""),CTween.fadeIn(this.$element,400,!1),this.$element.removeClass("ms-ctrl-hide"))},p.destroy=function(){this.options&&this.options.hideUnder&&$(window).unbind("resize",this.onResize)},window.BaseControl=BaseControl}(jQuery),function($){"use strict";var MSArrows=function(options){BaseControl.call(this),$.extend(this.options,options)};MSArrows.extend(BaseControl);var p=MSArrows.prototype,_super=BaseControl.prototype;p.setup=function(){var that=this;this.$next=$("
").addClass(this.options.prefix+"nav-next").bind("click",function(){that.slider.api.next(!0)}),this.$prev=$("
").addClass(this.options.prefix+"nav-prev").bind("click",function(){that.slider.api.previous(!0)}),_super.setup.call(this),this.cont.append(this.$next),this.cont.append(this.$prev),this.checkHideUnder()},p.hide=function(fast){return fast?(this.$prev.css("opacity",0).css("display","none"),void this.$next.css("opacity",0).css("display","none")):(CTween.fadeOut(this.$prev,400,!1),CTween.fadeOut(this.$next,400,!1),this.$prev.addClass("ms-ctrl-hide"),void this.$next.addClass("ms-ctrl-hide"))},p.visible=function(){this.detached||(CTween.fadeIn(this.$prev,400),CTween.fadeIn(this.$next,400),this.$prev.removeClass("ms-ctrl-hide").css("display",""),this.$next.removeClass("ms-ctrl-hide").css("display",""))},p.destroy=function(){_super.destroy(),this.$next.remove(),this.$prev.remove()},window.MSArrows=MSArrows,MSSlideController.registerControl("arrows",MSArrows)}(jQuery),function($){"use strict";var MSThumblist=function(options){BaseControl.call(this),this.options.dir="h",this.options.wheel="v"===options.dir,this.options.arrows=!1,this.options.speed=17,this.options.align=null,this.options.inset=!1,this.options.margin=10,this.options.space=10,this.options.width=100,this.options.height=100,this.options.type="thumbs",this.options.hover=!1,$.extend(this.options,options),this.thumbs=[],this.index_count=0,this.__dimen="h"===this.options.dir?"width":"height",this.__alignsize="h"===this.options.dir?"height":"width",this.__jdimen="h"===this.options.dir?"outerWidth":"outerHeight",this.__pos="h"===this.options.dir?"left":"top",this.click_enable=!0};MSThumblist.extend(BaseControl);var p=MSThumblist.prototype,_super=BaseControl.prototype;p.setup=function(){if(this.$element=$("
").addClass(this.options.prefix+"thumb-list"),"tabs"===this.options.type&&this.$element.addClass(this.options.prefix+"tabs"),this.$element.addClass("ms-dir-"+this.options.dir),_super.setup.call(this),this.$element.appendTo(this.slider.$controlsCont===this.cont?this.slider.$element:this.cont),this.$thumbscont=$("
").addClass("ms-thumbs-cont").appendTo(this.$element),this.options.arrows){var that=this;this.$fwd=$("
").addClass("ms-thumblist-fwd").appendTo(this.$element).click(function(){that.controller.push(-15)}),this.$bwd=$("
").addClass("ms-thumblist-bwd").appendTo(this.$element).click(function(){that.controller.push(15)})}if(!this.options.insetTo&&this.options.align){var align=this.options.align;this.options.inset?this.$element.css(align,this.options.margin):"top"===align?this.$element.detach().prependTo(this.slider.$element).css({"margin-bottom":this.options.margin,position:"relative"}):"bottom"===align?this.$element.css({"margin-top":this.options.margin,position:"relative"}):(this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.align()),"v"===this.options.dir?this.$element.width(this.options.width):this.$element.height(this.options.height)}this.checkHideUnder()},p.align=function(){if(!this.detached){var align=this.options.align,pos=this.slider.reserveSpace(align,this.options[this.__alignsize]+2*this.options.margin);this.$element.css(align,-pos-this.options[this.__alignsize]-this.options.margin)}},p.slideAction=function(slide){var thumb_ele=slide.$element.find(".ms-thumb"),that=this,thumb_frame=$("
").addClass("ms-thumb-frame").append(thumb_ele).append($('
')).bind(this.options.hover?"hover":"click",function(){that.changeSlide(thumb_frame)});if(this.options.align&&thumb_frame.width(this.options.width-("v"===this.options.dir&&"tabs"===this.options.type?12:0)).height(this.options.height).css("margin-"+("v"===this.options.dir?"bottom":"right"),this.options.space),thumb_frame[0].index=this.index_count++,this.$thumbscont.append(thumb_frame),this.options.fillMode&&thumb_ele.is("img")){var aligner=new window.MSAligner(this.options.fillMode,thumb_frame,thumb_ele);thumb_ele[0].aligner=aligner,thumb_ele.one("load",function(){var $this=$(this);$this[0].aligner.init($this.width(),$this.height()),$this[0].aligner.align()}).each($.jqLoadFix)}$.browser.msie&&thumb_ele.on("dragstart",function(event){event.preventDefault()}),this.thumbs.push(thumb_frame)},p.create=function(){_super.create.call(this),this.__translate_end=window._css3d?" translateZ(0px)":"",this.controller=new Controller(0,0,{snappingMinSpeed:2,friction:(100-.5*this.options.speed)/100}),this.controller.renderCallback("h"===this.options.dir?this._hMove:this._vMove,this);var that=this;this.resize_listener=function(){that.__resize()},$(window).bind("resize",this.resize_listener),this.thumbSize=this.thumbs[0][this.__jdimen](!0),this.setupSwipe(),this.__resize();var that=this;this.options.wheel&&(this.wheellistener=function(event){var e=window.event||event.orginalEvent||event,delta=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));return that.controller.push(10*-delta),!1},$.browser.mozilla?this.$element[0].addEventListener("DOMMouseScroll",this.wheellistener):this.$element.bind("mousewheel",this.wheellistener)),this.slider.api.addEventListener(MSSliderEvent.CHANGE_START,this.update,this),this.slider.api.addEventListener(MSSliderEvent.HARD_UPDATE,this.realignThumbs,this),this.cindex=this.slider.api.index(),this.select(this.thumbs[this.cindex])},p._hMove=function(controller,value){return this.__contPos=value,window._cssanim?void(this.$thumbscont[0].style[window._jcsspfx+"Transform"]="translateX("+-value+"px)"+this.__translate_end):void(this.$thumbscont[0].style.left=-value+"px")},p._vMove=function(controller,value){return this.__contPos=value,window._cssanim?void(this.$thumbscont[0].style[window._jcsspfx+"Transform"]="translateY("+-value+"px)"+this.__translate_end):void(this.$thumbscont[0].style.top=-value+"px")},p.setupSwipe=function(){this.swipeControl=new averta.TouchSwipe(this.$element),this.swipeControl.swipeType="h"===this.options.dir?"horizontal":"vertical";var that=this;this.swipeControl.onSwipe="h"===this.options.dir?function(status){that.horizSwipeMove(status)}:function(status){that.vertSwipeMove(status)}},p.vertSwipeMove=function(status){if(!this.dTouch){var phase=status.phase;if("start"===phase)this.controller.stop();else if("move"===phase)this.controller.drag(status.moveY);else if("end"===phase||"cancel"===phase){var speed=Math.abs(status.distanceY/status.duration*50/3);speed>.1?this.controller.push(-status.distanceY/status.duration*50/3):(this.click_enable=!0,this.controller.cancel())}}},p.horizSwipeMove=function(status){if(!this.dTouch){var phase=status.phase;if("start"===phase)this.controller.stop(),this.click_enable=!1;else if("move"===phase)this.controller.drag(status.moveX);else if("end"===phase||"cancel"===phase){var speed=Math.abs(status.distanceX/status.duration*50/3);speed>.1?this.controller.push(-status.distanceX/status.duration*50/3):(this.click_enable=!0,this.controller.cancel())}}},p.update=function(){var nindex=this.slider.api.index();this.cindex!==nindex&&(null!=this.cindex&&this.unselect(this.thumbs[this.cindex]),this.cindex=nindex,this.select(this.thumbs[this.cindex]),this.dTouch||this.updateThumbscroll())},p.realignThumbs=function(){this.$element.find(".ms-thumb").each(function(index,thumb){thumb.aligner&&thumb.aligner.align()})},p.updateThumbscroll=function(){var pos=this.thumbSize*this.cindex;if(0/0==this.controller.value&&(this.controller.value=0),pos-this.controller.value<0)return void this.controller.gotoSnap(this.cindex,!0);if(pos+this.thumbSize-this.controller.value>this.$element[this.__dimen]()){var first_snap=this.cindex-Math.floor(this.$element[this.__dimen]()/this.thumbSize)+1;return void this.controller.gotoSnap(first_snap,!0)}},p.changeSlide=function(thumb){this.click_enable&&this.cindex!==thumb[0].index&&this.slider.api.gotoSlide(thumb[0].index)},p.unselect=function(ele){ele.removeClass("ms-thumb-frame-selected")},p.select=function(ele){ele.addClass("ms-thumb-frame-selected")},p.__resize=function(){var size=this.$element[this.__dimen]();if(this.ls!==size){this.ls=size,this.thumbSize=this.thumbs[0][this.__jdimen](!0);var len=this.slider.api.count()*this.thumbSize;this.$thumbscont[0].style[this.__dimen]=len+"px",size>=len?(this.dTouch=!0,this.controller.stop(),this.$thumbscont[0].style[this.__pos]=.5*(size-len)+"px",this.$thumbscont[0].style[window._jcsspfx+"Transform"]=""):(this.dTouch=!1,this.click_enable=!0,this.$thumbscont[0].style[this.__pos]="",this.controller._max_value=len-size,this.controller.options.snapsize=this.thumbSize,this.updateThumbscroll())}},p.destroy=function(){_super.destroy(),this.options.wheel&&($.browser.mozilla?this.$element[0].removeEventListener("DOMMouseScroll",this.wheellistener):this.$element.unbind("mousewheel",this.wheellistener),this.wheellistener=null),$(window).unbind("resize",this.resize_listener),this.$element.remove(),this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START,this.update,this)},window.MSThumblist=MSThumblist,MSSlideController.registerControl("thumblist",MSThumblist)}(jQuery),function($){"use strict";var MSBulltes=function(options){BaseControl.call(this),this.options.dir="h",this.options.inset=!0,this.options.margin=10,this.options.space=10,$.extend(this.options,options),this.bullets=[]};MSBulltes.extend(BaseControl);var p=MSBulltes.prototype,_super=BaseControl.prototype;p.setup=function(){if(_super.setup.call(this),this.$element=$("
").addClass(this.options.prefix+"bullets").addClass("ms-dir-"+this.options.dir).appendTo(this.cont),this.$bullet_cont=$("
").addClass("ms-bullets-count").appendTo(this.$element),!this.options.insetTo&&this.options.align){var align=this.options.align;this.options.inset&&this.$element.css(align,this.options.margin)}this.checkHideUnder()},p.create=function(){_super.create.call(this);var that=this;this.slider.api.addEventListener(MSSliderEvent.CHANGE_START,this.update,this),this.cindex=this.slider.api.index();for(var i=0;i").addClass("ms-bullet");bullet[0].index=i,bullet.on("click",function(){that.changeSlide(this.index)}),this.$bullet_cont.append(bullet),this.bullets.push(bullet),"h"===this.options.dir?bullet.css("margin",this.options.space/2):bullet.css("margin",this.options.space)}"h"===this.options.dir?this.$element.width(bullet.outerWidth(!0)*this.slider.api.count()):this.$element.css("margin-top",-this.$element.outerHeight(!0)/2),this.select(this.bullets[this.cindex])},p.update=function(){var nindex=this.slider.api.index();this.cindex!==nindex&&(null!=this.cindex&&this.unselect(this.bullets[this.cindex]),this.cindex=nindex,this.select(this.bullets[this.cindex]))},p.changeSlide=function(index){this.cindex!==index&&this.slider.api.gotoSlide(index)},p.unselect=function(ele){ele.removeClass("ms-bullet-selected")},p.select=function(ele){ele.addClass("ms-bullet-selected")},p.destroy=function(){_super.destroy(),this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START,this.update,this),this.$element.remove()},window.MSBulltes=MSBulltes,MSSlideController.registerControl("bullets",MSBulltes)}(jQuery),function($){"use strict";var MSScrollbar=function(options){BaseControl.call(this),this.options.dir="h",this.options.autohide=!0,this.options.width=4,this.options.color="#3D3D3D",this.options.margin=10,$.extend(this.options,options),this.__dimen="h"===this.options.dir?"width":"height",this.__jdimen="h"===this.options.dir?"outerWidth":"outerHeight",this.__pos="h"===this.options.dir?"left":"top",this.__translate_end=window._css3d?" translateZ(0px)":"",this.__translate_start="h"===this.options.dir?" translateX(":"translateY("};MSScrollbar.extend(BaseControl);var p=MSScrollbar.prototype,_super=BaseControl.prototype;p.setup=function(){if(this.$element=$("
").addClass(this.options.prefix+"sbar").addClass("ms-dir-"+this.options.dir),_super.setup.call(this),this.$element.appendTo(this.slider.$controlsCont===this.cont?this.slider.$element:this.cont),this.$bar=$("
").addClass(this.options.prefix+"bar").appendTo(this.$element),this.slider.options.loop&&(this.disable=!0,this.$element.remove()),"v"===this.options.dir?this.$bar.width(this.options.width):this.$bar.height(this.options.width),this.$bar.css("background-color",this.options.color),!this.options.insetTo&&this.options.align){this.$element.css("v"===this.options.dir?{right:"auto",left:"auto"}:{top:"auto",bottom:"auto"});var align=this.options.align;this.options.inset?this.$element.css(align,this.options.margin):"top"===align?this.$element.prependTo(this.slider.$element).css({"margin-bottom":this.options.margin,position:"relative"}):"bottom"===align?this.$element.css({"margin-top":this.options.margin,position:"relative"}):(this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.align())}this.checkHideUnder()},p.align=function(){if(!this.detached){var align=this.options.align,pos=this.slider.reserveSpace(align,2*this.options.margin+this.options.width);this.$element.css(align,-pos-this.options.margin-this.options.width)}},p.create=function(){if(!this.disable){this.scroller=this.slider.api.scroller,this.slider.api.view.addEventListener(MSViewEvents.SCROLL,this._update,this),this.slider.api.addEventListener(MSSliderEvent.RESIZE,this._resize,this),this._resize(),this.options.autohide&&this.$bar.css("opacity","0")}},p._resize=function(){this.vdimen=this.$element[this.__dimen](),this.bar_dimen=this.slider.api.view["__"+this.__dimen]*this.vdimen/this.scroller._max_value,this.$bar[this.__dimen](this.bar_dimen)},p._update=function(){var value=this.scroller.value*(this.vdimen-this.bar_dimen)/this.scroller._max_value;if(this.lvalue!==value){if(this.lvalue=value,this.options.autohide){clearTimeout(this.hto),this.$bar.css("opacity","1");var that=this;this.hto=setTimeout(function(){that.$bar.css("opacity","0")},150)}return 0>value?void(this.$bar[0].style[this.__dimen]=this.bar_dimen+value+"px"):(value>this.vdimen-this.bar_dimen&&(this.$bar[0].style[this.__dimen]=this.vdimen-value+"px"),window._cssanim?void(this.$bar[0].style[window._jcsspfx+"Transform"]=this.__translate_start+value+"px)"+this.__translate_end):void(this.$bar[0].style[this.__pos]=value+"px"))}},p.destroy=function(){_super.destroy(),this.slider.api.view.removeEventListener(MSViewEvents.SCROLL,this._update,this),this.slider.api.removeEventListener(MSSliderEvent.RESIZE,this._resize,this),this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.$element.remove()},window.MSScrollbar=MSScrollbar,MSSlideController.registerControl("scrollbar",MSScrollbar)}(jQuery),function($){"use strict";var MSTimerbar=function(options){BaseControl.call(this),this.options.autohide=!1,this.options.width=4,this.options.color="#FFFFFF",this.options.inset=!0,this.options.margin=0,$.extend(this.options,options)};MSTimerbar.extend(BaseControl);var p=MSTimerbar.prototype,_super=BaseControl.prototype;p.setup=function(){if(_super.setup.call(this),this.$element=$("
").addClass(this.options.prefix+"timerbar"),_super.setup.call(this),this.$element.appendTo(this.slider.$controlsCont===this.cont?this.slider.$element:this.cont),this.$bar=$("
").addClass("ms-time-bar").appendTo(this.$element),"v"===this.options.dir?(this.$bar.width(this.options.width),this.$element.width(this.options.width)):(this.$bar.height(this.options.width),this.$element.height(this.options.width)),this.$bar.css("background-color",this.options.color),!this.options.insetTo&&this.options.align){this.$element.css({top:"auto",bottom:"auto"});var align=this.options.align;this.options.inset?this.$element.css(align,this.options.margin):"top"===align?this.$element.prependTo(this.slider.$element).css({"margin-bottom":this.options.margin,position:"relative"}):"bottom"===align?this.$element.css({"margin-top":this.options.margin,position:"relative"}):(this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.align())}this.checkHideUnder()},p.align=function(){if(!this.detached){var align=this.options.align,pos=this.slider.reserveSpace(align,2*this.options.margin+this.options.width);this.$element.css(align,-pos-this.options.margin-this.options.width)}},p.create=function(){_super.create.call(this),this.slider.api.addEventListener(MSSliderEvent.WAITING,this._update,this),this._update()},p._update=function(){this.$bar[0].style.width=this.slider.api._delayProgress+"%"},p.destroy=function(){_super.destroy(),this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.slider.api.removeEventListener(MSSliderEvent.WAITING,this._update,this),this.$element.remove()},window.MSTimerbar=MSTimerbar,MSSlideController.registerControl("timebar",MSTimerbar)}(jQuery),function($){"use strict";var MSCircleTimer=function(options){BaseControl.call(this),this.options.color="#A2A2A2",this.options.stroke=10,this.options.radius=4,this.options.autohide=!1,$.extend(this.options,options) };MSCircleTimer.extend(BaseControl);var p=MSCircleTimer.prototype,_super=BaseControl.prototype;p.setup=function(){return _super.setup.call(this),this.$element=$("
").addClass(this.options.prefix+"ctimer").appendTo(this.cont),this.$canvas=$("").addClass("ms-ctimer-canvas").appendTo(this.$element),this.$bar=$("
").addClass("ms-ctimer-bullet").appendTo(this.$element),this.$canvas[0].getContext?(this.ctx=this.$canvas[0].getContext("2d"),this.prog=0,this.__w=2*(this.options.radius+this.options.stroke/2),this.$canvas[0].width=this.__w,this.$canvas[0].height=this.__w,void this.checkHideUnder()):(this.destroy(),void(this.disable=!0))},p.create=function(){if(!this.disable){_super.create.call(this),this.slider.api.addEventListener(MSSliderEvent.WAITING,this._update,this);var that=this;this.$element.click(function(){that.slider.api.paused?that.slider.api.resume():that.slider.api.pause()}),this._update()}},p._update=function(){var that=this;$(this).stop(!0).animate({prog:.01*this.slider.api._delayProgress},{duration:200,step:function(){that._draw()}})},p._draw=function(){this.ctx.clearRect(0,0,this.__w,this.__w),this.ctx.beginPath(),this.ctx.arc(.5*this.__w,.5*this.__w,this.options.radius,1.5*Math.PI,1.5*Math.PI+2*Math.PI*this.prog,!1),this.ctx.strokeStyle=this.options.color,this.ctx.lineWidth=this.options.stroke,this.ctx.stroke()},p.destroy=function(){_super.destroy(),this.disable||($(this).stop(!0),this.slider.api.removeEventListener(MSSliderEvent.WAITING,this._update,this),this.$element.remove())},window.MSCircleTimer=MSCircleTimer,MSSlideController.registerControl("circletimer",MSCircleTimer)}(jQuery),function($){"use strict";window.MSLightbox=function(options){BaseControl.call(this,options),this.options.autohide=!1,$.extend(this.options,options),this.data_list=[]},MSLightbox.fadeDuratation=400,MSLightbox.extend(BaseControl);var p=MSLightbox.prototype,_super=BaseControl.prototype;p.setup=function(){_super.setup.call(this),this.$element=$("
").addClass(this.options.prefix+"lightbox-btn").appendTo(this.cont),this.checkHideUnder()},p.slideAction=function(slide){$("
").addClass(this.options.prefix+"lightbox-btn").appendTo(slide.$element).append($(slide.$element.find(".ms-lightbox")))},p.create=function(){_super.create.call(this)},MSSlideController.registerControl("lightbox",MSLightbox)}(jQuery),function($){"use strict";window.MSSlideInfo=function(options){BaseControl.call(this,options),this.options.autohide=!1,this.options.align=null,this.options.inset=!1,this.options.margin=10,this.options.size=100,this.options.dir="h",$.extend(this.options,options),this.data_list=[]},MSSlideInfo.fadeDuratation=400,MSSlideInfo.extend(BaseControl);var p=MSSlideInfo.prototype,_super=BaseControl.prototype;p.setup=function(){if(this.$element=$("
").addClass(this.options.prefix+"slide-info").addClass("ms-dir-"+this.options.dir),_super.setup.call(this),this.$element.appendTo(this.slider.$controlsCont===this.cont?this.slider.$element:this.cont),!this.options.insetTo&&this.options.align){var align=this.options.align;this.options.inset?this.$element.css(align,this.options.margin):"top"===align?this.$element.prependTo(this.slider.$element).css({"margin-bottom":this.options.margin,position:"relative"}):"bottom"===align?this.$element.css({"margin-top":this.options.margin,position:"relative"}):(this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.align()),"v"===this.options.dir?this.$element.width(this.options.size):this.$element.css("min-height",this.options.size)}this.checkHideUnder()},p.align=function(){if(!this.detached){var align=this.options.align,pos=this.slider.reserveSpace(align,this.options.size+2*this.options.margin);this.$element.css(align,-pos-this.options.size-this.options.margin)}},p.slideAction=function(slide){var info_ele=$(slide.$element.find(".ms-info"));info_ele.detach(),this.data_list[slide.index]=info_ele},p.create=function(){_super.create.call(this),this.slider.api.addEventListener(MSSliderEvent.CHANGE_START,this.update,this),this.cindex=this.slider.api.index(),this.switchEle(this.data_list[this.cindex])},p.update=function(){var nindex=this.slider.api.index();this.switchEle(this.data_list[nindex]),this.cindex=nindex},p.switchEle=function(ele){if(this.current_ele){this.current_ele[0].tween&&this.current_ele[0].tween.stop(!0),this.current_ele[0].tween=CTween.animate(this.current_ele,MSSlideInfo.fadeDuratation,{opacity:0},{complete:function(){this.detach(),this[0].tween=null,ele.css("position","relative")},target:this.current_ele}),ele.css("position","absolute")}this.__show(ele)},p.__show=function(ele){ele.appendTo(this.$element).css("opacity","0"),this.current_ele&&ele.height(Math.max(ele.height(),this.current_ele.height())),clearTimeout(this.tou),this.tou=setTimeout(function(){CTween.fadeIn(ele,MSSlideInfo.fadeDuratation),ele.css("height","")},MSSlideInfo.fadeDuratation),ele[0].tween&&ele[0].tween.stop(!0),this.current_ele=ele},p.destroy=function(){_super.destroy(),clearTimeout(this.tou),this.current_ele&&this.current_ele[0].tween&&this.current_ele[0].tween.stop("true"),this.$element.remove(),this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE,this.align,this),this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START,this.update,this)},MSSlideController.registerControl("slideinfo",MSSlideInfo)}(jQuery),function($){window.MSGallery=function(id,slider){this.id=id,this.slider=slider,this.telement=$("#"+id),this.botcont=$("
").addClass("ms-gallery-botcont").appendTo(this.telement),this.thumbcont=$("
").addClass("ms-gal-thumbcont hide-thumbs").appendTo(this.botcont),this.playbtn=$("
").addClass("ms-gal-playbtn").appendTo(this.botcont),this.thumbtoggle=$("
").addClass("ms-gal-thumbtoggle").appendTo(this.botcont),slider.control("thumblist",{insertTo:this.thumbcont,autohide:!1,dir:"h"}),slider.control("slidenum",{insertTo:this.botcont,autohide:!1}),slider.control("slideinfo",{insertTo:this.botcont,autohide:!1}),slider.control("timebar",{insertTo:this.botcont,autohide:!1}),slider.control("bullets",{insertTo:this.botcont,autohide:!1})};var p=MSGallery.prototype;p._init=function(){var that=this;this.slider.api.paused||this.playbtn.addClass("btn-pause"),this.playbtn.click(function(){that.slider.api.paused?(that.slider.api.resume(),that.playbtn.addClass("btn-pause")):(that.slider.api.pause(),that.playbtn.removeClass("btn-pause"))}),this.thumbtoggle.click(function(){that.vthumbs?(that.thumbtoggle.removeClass("btn-hide"),that.vthumbs=!1,that.thumbcont.addClass("hide-thumbs")):(that.thumbtoggle.addClass("btn-hide"),that.thumbcont.removeClass("hide-thumbs"),that.vthumbs=!0)})},p.setup=function(){var that=this;$(document).ready(function(){that._init()})}}(jQuery),function($){var getPhotosetURL=function(key,id,count){return"https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key="+key+"&photoset_id="+id+"&per_page="+count+"&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?"},getUserPublicURL=function(key,id,count){return"https://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key="+key+"&user_id="+id+"&per_page="+count+"&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?"},getImageSource=function(fid,server,id,secret,size,data){return"_o"===size&&data?data.url_o:"https://farm"+fid+".staticflickr.com/"+server+"/"+id+"_"+secret+size+".jpg"};window.MSFlickrV2=function(slider,options){var _options={count:10,type:"photoset",thumbSize:"q",imgSize:"c"};if(this.slider=slider,this.slider.holdOn(),!options.key)return void this.errMsg("Flickr API Key required. Please add it in settings.");$.extend(_options,options),this.options=_options;var that=this;"photoset"===this.options.type?$.getJSON(getPhotosetURL(this.options.key,this.options.id,this.options.count),function(data){that._photosData(data)}):$.getJSON(getUserPublicURL(this.options.key,this.options.id,this.options.count),function(data){that.options.type="photos",that._photosData(data)}),""!==this.options.imgSize&&"-"!==this.options.imgSize&&(this.options.imgSize="_"+this.options.imgSize),this.options.thumbSize="_"+this.options.thumbSize,this.slideTemplate=this.slider.$element.find(".ms-slide")[0].outerHTML,this.slider.$element.find(".ms-slide").remove()};var p=MSFlickrV2.prototype;p._photosData=function(data){if("fail"===data.stat)return void this.errMsg("Flickr API ERROR#"+data.code+": "+data.message);{var that=this;this.options.author||this.options.desc}$.each(data[this.options.type].photo,function(i,item){var slide_cont=that.slideTemplate.replace(/{{[\w-]+}}/g,function(match){return match=match.replace(/{{|}}/g,""),shortCodes[match]?shortCodes[match](item,that):"{{"+match+"}}"});$(slide_cont).appendTo(that.slider.$element)}),that._initSlider()},p.errMsg=function(msg){this.slider.$element.css("display","block"),this.errEle||(this.errEle=$('
').appendTo(this.slider.$loading)),this.errEle.html(msg)},p._initSlider=function(){this.slider.release()};var shortCodes={image:function(data,that){return getImageSource(data.farm,data.server,data.id,data.secret,that.options.imgSize,data)},thumb:function(data,that){return getImageSource(data.farm,data.server,data.id,data.secret,that.options.thumbSize)},title:function(data){return data.title},"owner-name":function(data){return data.ownername},"date-taken":function(data){return data.datetaken},views:function(data){return data.views},description:function(data){return data.description._content}}}(jQuery),function($){window.MSFacebookGallery=function(slider,options){var _options={count:10,type:"photostream",thumbSize:"320",imgSize:"orginal",https:!1,token:""};this.slider=slider,this.slider.holdOn(),$.extend(_options,options),this.options=_options,this.graph="https://graph.facebook.com";var that=this;"photostream"===this.options.type?$.getJSON(this.graph+"/"+this.options.username+"/photos/uploaded/?fields=source,name,link,images,from&limit="+this.options.count+"&access_token="+this.options.token,function(data){that._photosData(data)}):$.getJSON(this.graph+"/"+this.options.albumId+"/photos?fields=source,name,link,images,from&limit="+this.options.count+"&access_token="+this.options.token,function(data){that._photosData(data)}),this.slideTemplate=this.slider.$element.find(".ms-slide")[0].outerHTML,this.slider.$element.find(".ms-slide").remove()};var p=MSFacebookGallery.prototype;p._photosData=function(content){if(content.error)return void this.errMsg("Facebook API ERROR#"+content.error.code+"("+content.error.type+"): "+content.error.message);for(var that=this,i=(this.options.author||this.options.desc,0),l=content.data.length;i!==l;i++){var slide_cont=that.slideTemplate.replace(/{{[\w-]+}}/g,function(match){return match=match.replace(/{{|}}/g,""),shortCodes[match]?shortCodes[match](content.data[i],that):"{{"+match+"}}"});$(slide_cont).appendTo(that.slider.$element)}that._initSlider()},p.errMsg=function(msg){this.slider.$element.css("display","block"),this.errEle||(this.errEle=$('
').appendTo(this.slider.$loading)),this.errEle.html(msg)},p._initSlider=function(){this.slider.release()};var getImageSource=function(images,size){if("orginal"===size)return images[0].source;for(var i=0,l=images.length;i!==l;i++)if(-1!==images[i].source.indexOf(size+"x"+size))return images[i].source;return images[0].source},shortCodes={image:function(data,that){return getImageSource(data.images,that.options.imgSize)},thumb:function(data,that){return getImageSource(data.images,that.options.thumbSize)},name:function(data){return data.name},"owner-name":function(data){return data.from.name},link:function(data){return data.link}}}(jQuery),function($){"use strict";window.MSScrollParallax=function(slider,parallax,bgparallax,fade){this.fade=fade,this.slider=slider,this.parallax=parallax/100,this.bgparallax=bgparallax/100,slider.api.addEventListener(MSSliderEvent.INIT,this.init,this),slider.api.addEventListener(MSSliderEvent.DESTROY,this.destory,this),slider.api.addEventListener(MSSliderEvent.CHANGE_END,this.resetLayers,this),slider.api.addEventListener(MSSliderEvent.CHANGE_START,this.updateCurrentSlide,this)},window.MSScrollParallax.setup=function(slider,parallax,bgparallax,fade){return window._mobile?void 0:(null==parallax&&(parallax=50),null==bgparallax&&(bgparallax=40),new MSScrollParallax(slider,parallax,bgparallax,fade))};var p=window.MSScrollParallax.prototype;p.init=function(){this.slider.$element.addClass("ms-scroll-parallax"),this.sliderOffset=this.slider.$element.offset().top,this.updateCurrentSlide();for(var slide,slides=this.slider.api.view.slideList,i=0,l=slides.length;i!==l;i++)slide=slides[i],slide.hasLayers&&(slide.layerController.$layers.wrap('
'),slide.$scrollParallaxCont=slide.layerController.$layers.parent());$(window).on("scroll",{that:this},this.moveParallax).trigger("scroll")},p.resetLayers=function(){if(this.lastSlide){var layers=this.lastSlide.$scrollParallaxCont;window._css2d?(layers&&(layers[0].style[window._jcsspfx+"Transform"]=""),this.lastSlide.hasBG&&(this.lastSlide.$imgcont[0].style[window._jcsspfx+"Transform"]="")):(layers&&(layers[0].style.top=""),this.lastSlide.hasBG&&(this.lastSlide.$imgcont[0].style.top="0px"))}},p.updateCurrentSlide=function(){this.lastSlide=this.currentSlide,this.currentSlide=this.slider.api.currentSlide,this.moveParallax({data:{that:this}})},p.moveParallax=function(e){var that=e.data.that,slider=that.slider,offset=that.sliderOffset,scrollTop=$(window).scrollTop(),layers=that.currentSlide.$scrollParallaxCont,out=offset-scrollTop;0>=out?(layers&&(window._css3d?layers[0].style[window._jcsspfx+"Transform"]="translateY("+-out*that.parallax+"px) translateZ(0.4px)":window._css2d?layers[0].style[window._jcsspfx+"Transform"]="translateY("+-out*that.parallax+"px)":layers[0].style.top=-out*that.parallax+"px"),that.updateSlidesBG(-out*that.bgparallax+"px",!0),layers&&that.fade&&layers.css("opacity",1-Math.min(1,-out/slider.api.height))):(layers&&(window._css2d?layers[0].style[window._jcsspfx+"Transform"]="":layers[0].style.top=""),that.updateSlidesBG("0px",!1),layers&&that.fade&&layers.css("opacity",1))},p.updateSlidesBG=function(pos,fixed){for(var slides=this.slider.api.view.slideList,position=!fixed||$.browser.msie||$.browser.opera?"":"fixed",i=0,l=slides.length;i!==l;i++)slides[i].hasBG&&(slides[i].$imgcont[0].style.position=position,slides[i].$imgcont[0].style.top=pos),slides[i].$bgvideocont&&(slides[i].$bgvideocont[0].style.position=position,slides[i].$bgvideocont[0].style.top=pos)},p.destory=function(){slider.api.removeEventListener(MSSliderEvent.INIT,this.init,this),slider.api.removeEventListener(MSSliderEvent.DESTROY,this.destory,this),slider.api.removeEventListener(MSSliderEvent.CHANGE_END,this.resetLayers,this),slider.api.removeEventListener(MSSliderEvent.CHANGE_START,this.updateCurrentSlide,this),$(window).off("scroll",this.moveParallax)}}(jQuery),function($,document,window){var PId=0;if(window.MasterSlider){var KeyboardNav=function(slider){this.slider=slider,this.PId=PId++,this.slider.options.keyboard&&slider.api.addEventListener(MSSliderEvent.INIT,this.init,this)};KeyboardNav.name="MSKeyboardNav";var p=KeyboardNav.prototype;p.init=function(){var api=this.slider.api;$(document).on("keydown.kbnav"+this.PId,function(event){var which=event.which;37===which||40===which?api.previous(!0):(38===which||39===which)&&api.next(!0)})},p.destroy=function(){$(document).off("keydown.kbnav"+this.PId),this.slider.api.removeEventListener(MSSliderEvent.INIT,this.init,this)},MasterSlider.registerPlugin(KeyboardNav)}}(jQuery,document,window),function($,document,window){var PId=0,$window=$(window),$doc=$(document);if(window.MasterSlider){var StartOnAppear=function(slider){this.PId=PId++,this.slider=slider,this.$slider=slider.$element,this.slider.options.startOnAppear&&(slider.holdOn(),$doc.ready($.proxy(this.init,this)))};StartOnAppear.name="MSStartOnAppear";var p=StartOnAppear.prototype;p.init=function(){this.slider.api;$window.on("scroll.soa"+this.PId,$.proxy(this._onScroll,this)).trigger("scroll")},p._onScroll=function(){var vpBottom=$window.scrollTop()+$window.height(),top=this.$slider.offset().top;vpBottom>top&&($window.off("scroll.soa"+this.PId),this.slider.release())},p.destroy=function(){},MasterSlider.registerPlugin(StartOnAppear)}}(jQuery,document,window),function(document,window){var filterUnits={"hue-rotate":"deg",blur:"px"},initialValues={opacity:1,contrast:1,brightness:1,saturate:1,"hue-rotate":0,invert:0,sepia:0,blur:0,grayscale:0};if(window.MasterSlider){var Filters=function(slider){this.slider=slider,this.slider.options.filters&&slider.api.addEventListener(MSSliderEvent.INIT,this.init,this)};Filters.name="MSFilters";var p=Filters.prototype;p.init=function(){var api=this.slider.api,view=api.view;this.filters=this.slider.options.filters,this.slideList=view.slideList,this.slidesCount=view.slidesCount,this.dimension=view[view.__dimension],this.target="slide"===this.slider.options.filterTarget?"$element":"$bg_img",this.filterName=$.browser.webkit?"WebkitFilter":"filter";var superFun=view.controller.__renderHook.fun,superRef=view.controller.__renderHook.ref;view.controller.renderCallback(function(controller,value){superFun.call(superRef,controller,value),this.applyEffect(value)},this),this.applyEffect(view.controller.value)},p.applyEffect=function(value){for(var factor,slide,i=0;i \
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\

\
{pp_social}
\ Close \
\
\
\
\
\
\
\
\
\
\
\ \
',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'
{content}
',custom_markup:'',social_tools:''},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal) $.prettyPhoto.close();e.preventDefault();break;};};};});};$.prettyPhoto.initialize=function(){settings=pp_settings;if(settings.theme=='pp_default')settings.horizontal_padding=16;theRel=$(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr(settings.hook).indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr(settings.hook).indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr(settings.hook).indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray($(this).attr('href'),pp_images);rel_index=(isSet)?set_position:$("a["+settings.hook+"^='"+theRel+"']").index($(this));_build_overlay(this);if(settings.allow_resize) $(window).bind('scroll.prettyphoto',function(){_center_overlay();});$.prettyPhoto.open();return false;} $.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=(arguments[3])?arguments[3]:0;_build_overlay(event.target);} if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if(settings.deeplinking) setHashtag();if(settings.social_tools){facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));$pp_pic_holder.find('.pp_social').html(facebook_like_link);} if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());if(typeof pp_descriptions[set_position]!='undefined'&&pp_descriptions[set_position]!=""){$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));}else{$pp_pic_holder.find('.pp_description').hide();} movie_width=(parseFloat(getParam('width',pp_images[set_position])))?getParam('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(getParam('height',pp_images[set_position])))?getParam('height',pp_images[set_position]):settings.default_height.toString();percentBased=false;if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;} if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;} $pp_pic_holder.fadeIn(function(){(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(' ');imgPreloader="";skipInjection=false;switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=getParam('v',pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split('youtu.be/');movie_id=movie_id[1];if(movie_id.indexOf('?')>0) movie_id=movie_id.substr(0,movie_id.indexOf('?'));if(movie_id.indexOf('&')>0) movie_id=movie_id.substr(0,movie_id.indexOf('&'));} movie='http://www.youtube.com/embed/'+movie_id;(getParam('rel',pp_images[set_position]))?movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[3]+'?title=0&byline=0&portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'ajax':doresize=false;pp_dimensions=_fitToViewport(movie_width,movie_height);doresize=true;skipInjection=true;$.get(pp_images[set_position],function(responseHTML){toInject=settings.inline_markup.replace(/{content}/g,responseHTML);$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();});break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().append('
').css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader&&!skipInjection){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0)set_position=$(pp_images).size()-1;}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1)set_position=0;}else{set_position=direction;};rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');} _hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0;}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage;}else{currentGalleryPage=direction;};slide_speed=(direction=='next'||direction=='previous')?settings.animation_speed:0;slide_to=currentGalleryPage*(itemsPerPage*itemWidth);$pp_gallery.find('ul').animate({left:-slide_to},slide_speed);};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};} $.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;} $.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible');$(this).remove();$(window).unbind('scroll.prettyphoto');clearHashtag();settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':((windowWidth/2)-(pp_dimensions['containerWidth']/2)<0)?0:(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();} if(settings.allow_expand){if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand').hide();}} if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();pp_settings.ajaxcallback();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};if((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight)){_fitToViewport(pp_containerWidth,pp_containerHeight)};_getDimensions(imageWidth,imageHeight);};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+(settings.horizontal_padding*2),contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;} function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bajax=true\b/i)){return'ajax';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;if(contentHeight>windowHeight) return;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=(settings.theme=="facebook"||settings.theme=="pp_default")?50:30;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_gallery=$('.pp_pic_holder .pp_gallery'),$pp_gallery_li=$pp_gallery.find('li');$pp_gallery.find('.pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_gallery.find('.pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_gallery_li.each(function(i){$(this).find('a').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('Play') $pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});} $pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});if(settings.allow_expand){$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});} $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};if(!pp_alreadyInitialized&&getHashtag()){pp_alreadyInitialized=true;hashIndex=getHashtag();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf('/'));setTimeout(function(){$("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click');},50);} return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function getHashtag(){var url=location.href;hashtag=(url.indexOf('#prettyPhoto')!==-1)?decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false;if(hashtag){hashtag=hashtag.replace(/<|>/g,'');} return hashtag;};function setHashtag(){if(typeof theRel=='undefined')return;location.hash=theRel+'/'+rel_index+'/';};function clearHashtag(){if(location.href.indexOf('#prettyPhoto')!==-1)location.hash="prettyPhoto";} function getParam(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);var pp_alreadyInitialized=false;;;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'));}else{factory(jQuery);}})(function($){var _previousResizeWidth=-1,_updateTimeout=-1;var _parse=function(value){return parseFloat(value)||0;};var _rows=function(elements){var tolerance=1,$elements=$(elements),lastTop=null,rows=[];$elements.each(function(){var $that=$(this),top=$that.offset().top-_parse($that.css('margin-top')),lastRow=rows.length>0?rows[rows.length-1]:null;if(lastRow===null){rows.push($that);}else{if(Math.floor(Math.abs(lastTop-top))<=tolerance){rows[rows.length-1]=lastRow.add($that);}else{rows.push($that);}} lastTop=top;});return rows;};var _parseOptions=function(options){var opts={byRow:true,property:'height',target:null,remove:false};if(typeof options==='object'){return $.extend(opts,options);} if(typeof options==='boolean'){opts.byRow=options;}else if(options==='remove'){opts.remove=true;} return opts;};var matchHeight=$.fn.matchHeight=function(options){var opts=_parseOptions(options);if(opts.remove){var that=this;this.css(opts.property,'');$.each(matchHeight._groups,function(key,group){group.elements=group.elements.not(that);});return this;} if(this.length<=1&&!opts.target){return this;} matchHeight._groups.push({elements:this,options:opts});matchHeight._apply(this,opts);return this;};matchHeight.version='master';matchHeight._groups=[];matchHeight._throttle=80;matchHeight._maintainScroll=false;matchHeight._beforeUpdate=null;matchHeight._afterUpdate=null;matchHeight._rows=_rows;matchHeight._parse=_parse;matchHeight._parseOptions=_parseOptions;matchHeight._apply=function(elements,options){var opts=_parseOptions(options),$elements=$(elements),rows=[$elements];var scrollTop=$(window).scrollTop(),htmlHeight=$('html').outerHeight(true);var $hiddenParents=$elements.parents().filter(':hidden');$hiddenParents.each(function(){var $that=$(this);$that.data('style-cache',$that.attr('style'));});$hiddenParents.css('display','block');if(opts.byRow&&!opts.target){$elements.each(function(){var $that=$(this),display=$that.css('display');if(display!=='inline-block'&&display!=='flex'&&display!=='inline-flex'){display='block';} $that.data('style-cache',$that.attr('style'));$that.css({'display':display,'padding-top':'0','padding-bottom':'0','margin-top':'0','margin-bottom':'0','border-top-width':'0','border-bottom-width':'0','height':'100px','overflow':'hidden'});});rows=_rows($elements);$elements.each(function(){var $that=$(this);$that.attr('style',$that.data('style-cache')||'');});} $.each(rows,function(key,row){var $row=$(row),targetHeight=0;if(!opts.target){if(opts.byRow&&$row.length<=1){$row.css(opts.property,'');return;} $row.each(function(){var $that=$(this),style=$that.attr('style'),display=$that.css('display');if(display!=='inline-block'&&display!=='flex'&&display!=='inline-flex'){display='block';} var css={'display':display};css[opts.property]='';$that.css(css);if($that.outerHeight(false)>targetHeight){targetHeight=$that.outerHeight(false);} if(style){$that.attr('style',style);}else{$that.css('display','');}});}else{targetHeight=opts.target.outerHeight(false);} $row.each(function(){var $that=$(this),verticalPadding=0;if(opts.target&&$that.is(opts.target)){return;} if($that.css('box-sizing')!=='border-box'){verticalPadding+=_parse($that.css('border-top-width'))+_parse($that.css('border-bottom-width'));verticalPadding+=_parse($that.css('padding-top'))+_parse($that.css('padding-bottom'));} $that.css(opts.property,(targetHeight-verticalPadding)+'px');});});$hiddenParents.each(function(){var $that=$(this);$that.attr('style',$that.data('style-cache')||null);});if(matchHeight._maintainScroll){$(window).scrollTop((scrollTop/htmlHeight)*$('html').outerHeight(true));} return this;};matchHeight._applyDataApi=function(){var groups={};$('[data-match-height], [data-mh]').each(function(){var $this=$(this),groupId=$this.attr('data-mh')||$this.attr('data-match-height');if(groupId in groups){groups[groupId]=groups[groupId].add($this);}else{groups[groupId]=$this;}});$.each(groups,function(){this.matchHeight(true);});};var _update=function(event){if(matchHeight._beforeUpdate){matchHeight._beforeUpdate(event,matchHeight._groups);} $.each(matchHeight._groups,function(){matchHeight._apply(this.elements,this.options);});if(matchHeight._afterUpdate){matchHeight._afterUpdate(event,matchHeight._groups);}};matchHeight._update=function(throttle,event){if(event&&event.type==='resize'){var windowWidth=$(window).width();if(windowWidth===_previousResizeWidth){return;} _previousResizeWidth=windowWidth;} if(!throttle){_update(event);}else if(_updateTimeout===-1){_updateTimeout=setTimeout(function(){_update(event);_updateTimeout=-1;},matchHeight._throttle);}};$(matchHeight._applyDataApi);var on=$.fn.on?'on':'bind';$(window)[on]('load',function(event){matchHeight._update(false,event);});$(window)[on]('resize orientationchange',function(event){matchHeight._update(true,event);});});;(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module==='object'&&module.exports){module.exports=factory(require('jquery'));}else{factory(jQuery);}}(function($){var slice=Array.prototype.slice;var splice=Array.prototype.splice;var defaults={topSpacing:0,bottomSpacing:0,className:'is-sticky',wrapperClassName:'sticky-wrapper',center:false,getWidthFrom:'',widthFromWrapper:true,responsiveWidth:false,zIndex:'auto'},$window=$(window),$document=$(document),sticked=[],windowHeight=$window.height(),scroller=function(){var scrollTop=$window.scrollTop(),documentHeight=$document.height(),dwh=documentHeight-windowHeight,extra=(scrollTop>dwh)?dwh-scrollTop:0;for(var i=0,l=sticked.length;inewTop||s.currentTop===null&&newTop=stickyWrapperContainer.offset().top+stickyWrapperContainer.outerHeight())&&(s.stickyElement.offset().top<=s.topSpacing);if(unstick){s.stickyElement.css('position','absolute').css('top','').css('bottom',0).css('z-index','');}else{s.stickyElement.css('position','fixed').css('top',newTop).css('bottom','').css('z-index',s.zIndex);}}}},resizer=function(){windowHeight=$window.height();for(var i=0,l=sticked.length;i').attr('id',wrapperId).addClass(o.wrapperClassName);stickyElement.wrapAll(function(){if($(this).parent("#"+wrapperId).length==0){return wrapper;}});var stickyWrapper=stickyElement.parent();if(o.center){stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});} if(stickyElement.css("float")==="right"){stickyElement.css({"float":"none"}).parent().css({"float":"right"});} o.stickyElement=stickyElement;o.stickyWrapper=stickyWrapper;o.currentTop=null;sticked.push(o);methods.setWrapperHeight(this);methods.setupChangeListeners(this);});},setWrapperHeight:function(stickyElement){var element=$(stickyElement);var stickyWrapper=element.parent();if(stickyWrapper){stickyWrapper.css('height',element.outerHeight());}},setupChangeListeners:function(stickyElement){if(window.MutationObserver){var mutationObserver=new window.MutationObserver(function(mutations){if(mutations[0].addedNodes.length||mutations[0].removedNodes.length){methods.setWrapperHeight(stickyElement);}});mutationObserver.observe(stickyElement,{subtree:true,childList:true});}else{if(window.addEventListener){stickyElement.addEventListener('DOMNodeInserted',function(){methods.setWrapperHeight(stickyElement);},false);stickyElement.addEventListener('DOMNodeRemoved',function(){methods.setWrapperHeight(stickyElement);},false);}else if(window.attachEvent){stickyElement.attachEvent('onDOMNodeInserted',function(){methods.setWrapperHeight(stickyElement);});stickyElement.attachEvent('onDOMNodeRemoved',function(){methods.setWrapperHeight(stickyElement);});}}},update:scroller,unstick:function(options){return this.each(function(){var that=this;var unstickyElement=$(that);var removeIdx=-1;var i=sticked.length;while(i-->0){if(sticked[i].stickyElement.get(0)===that){splice.call(sticked,i,1);removeIdx=i;}} if(removeIdx!==-1){unstickyElement.unwrap();unstickyElement.css({'width':'','position':'','top':'','float':'','z-index':''});}});}};if(window.addEventListener){window.addEventListener('scroll',scroller,false);window.addEventListener('resize',resizer,false);}else if(window.attachEvent){window.attachEvent('onscroll',scroller);window.attachEvent('onresize',resizer);} $.fn.sticky=function(method){if(methods[method]){return methods[method].apply(this,slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.sticky');}};$.fn.unstick=function(method){if(methods[method]){return methods[method].apply(this,slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.unstick.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.sticky');}};$(function(){setTimeout(scroller,0);});})); ;/*! simpleWeather v3.1.0 - http://simpleweatherjs.com */ !function(t){"use strict";function e(t,e){return"f"===t?Math.round(5/9*(e-32)):Math.round(1.8*e+32)}t.extend({simpleWeather:function(i){i=t.extend({location:"",woeid:"",unit:"f",success:function(t){},error:function(t){}},i);var o=new Date,n="https://query.yahooapis.com/v1/public/yql?format=json&rnd="+o.getFullYear()+o.getMonth()+o.getDay()+o.getHours()+"&diagnostics=true&callback=?&q=";if(""!==i.location){var r="";r=/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/.test(i.location)?"("+i.location+")":i.location,n+='select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="'+r+'") and u="'+i.unit+'"'}else{if(""===i.woeid)return i.error("Could not retrieve weather due to an invalid location."),!1;n+="select * from weather.forecast where woeid="+i.woeid+' and u="'+i.unit+'"'}return t.getJSON(encodeURI(n),function(t){if(null!==t&&null!==t.query&&null!==t.query.results&&"Yahoo! Weather Error"!==t.query.results.channel.description){var o,n=t.query.results.channel,r={},s=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","N"],a="https://s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png";r.title=n.item.title,r.temp=n.item.condition.temp,r.code=n.item.condition.code,r.todayCode=n.item.forecast[0].code,r.currently=n.item.condition.text,r.high=n.item.forecast[0].high,r.low=n.item.forecast[0].low,r.text=n.item.forecast[0].text,r.humidity=n.atmosphere.humidity,r.pressure=n.atmosphere.pressure,r.rising=n.atmosphere.rising,r.visibility=n.atmosphere.visibility,r.sunrise=n.astronomy.sunrise,r.sunset=n.astronomy.sunset,r.description=n.item.description,r.city=n.location.city,r.country=n.location.country,r.region=n.location.region,r.updated=n.item.pubDate,r.link=n.item.link,r.units={temp:n.units.temperature,distance:n.units.distance,pressure:n.units.pressure,speed:n.units.speed},r.wind={chill:n.wind.chill,direction:s[Math.round(n.wind.direction/22.5)],speed:n.wind.speed},n.item.condition.temp<80&&n.atmosphere.humidity<40?r.heatindex=-42.379+2.04901523*n.item.condition.temp+10.14333127*n.atmosphere.humidity-.22475541*n.item.condition.temp*n.atmosphere.humidity-6.83783*Math.pow(10,-3)*Math.pow(n.item.condition.temp,2)-5.481717*Math.pow(10,-2)*Math.pow(n.atmosphere.humidity,2)+1.22874*Math.pow(10,-3)*Math.pow(n.item.condition.temp,2)*n.atmosphere.humidity+8.5282*Math.pow(10,-4)*n.item.condition.temp*Math.pow(n.atmosphere.humidity,2)-1.99*Math.pow(10,-6)*Math.pow(n.item.condition.temp,2)*Math.pow(n.atmosphere.humidity,2):r.heatindex=n.item.condition.temp,"3200"==n.item.condition.code?(r.thumbnail=a,r.image=a):(r.thumbnail="https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/"+n.item.condition.code+"ds.png",r.image="https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/"+n.item.condition.code+"d.png"),r.alt={temp:e(i.unit,n.item.condition.temp),high:e(i.unit,n.item.forecast[0].high),low:e(i.unit,n.item.forecast[0].low)},"f"===i.unit?r.alt.unit="c":r.alt.unit="f",r.forecast=[];for(var m=0;m",47:"?"}};e.fn.number=function(n,l,s,r){r="undefined"==typeof r?",":r,s="undefined"==typeof s?".":s,l="undefined"==typeof l?0:l;var u="\\u"+("0000"+s.charCodeAt(0).toString(16)).slice(-4),h=new RegExp("[^"+u+"0-9]","g"),o=new RegExp(u,"g");return n===!0?this.is("input:text")?this.on({"keydown.format":function(n){var u=e(this),h=u.data("numFormat"),o=n.keyCode?n.keyCode:n.which,c="",v=a.apply(this,["start"]),d=a.apply(this,["end"]),p="",f=!1;if(i.codes.hasOwnProperty(o)&&(o=i.codes[o]),!n.shiftKey&&o>=65&&90>=o?o+=32:!n.shiftKey&&o>=69&&105>=o?o-=48:n.shiftKey&&i.shifts.hasOwnProperty(o)&&(c=i.shifts[o]),""==c&&(c=String.fromCharCode(o)),8!=o&&45!=o&&127!=o&&c!=s&&!c.match(/[0-9]/)){var g=n.keyCode?n.keyCode:n.which;if(46==g||8==g||127==g||9==g||27==g||13==g||(65==g||82==g||80==g||83==g||70==g||72==g||66==g||74==g||84==g||90==g||61==g||173==g||48==g)&&(n.ctrlKey||n.metaKey)===!0||(86==g||67==g||88==g)&&(n.ctrlKey||n.metaKey)===!0||g>=35&&39>=g||g>=112&&123>=g)return;return n.preventDefault(),!1}if(0==v&&d==this.value.length?8==o?(v=d=1,this.value="",h.init=l>0?-1:0,h.c=l>0?-(l+1):0,t.apply(this,[0,0])):c==s?(v=d=1,this.value="0"+s+new Array(l+1).join("0"),h.init=l>0?1:0,h.c=l>0?-(l+1):0):45==o?(v=d=2,this.value="-0"+s+new Array(l+1).join("0"),h.init=l>0?1:0,h.c=l>0?-(l+1):0,t.apply(this,[2,2])):(h.init=l>0?-1:0,h.c=l>0?-l:0):h.c=d-this.value.length,h.isPartialSelection=v==d?!1:!0,l>0&&c==s&&v==this.value.length-l-1)h.c++,h.init=Math.max(0,h.init),n.preventDefault(),f=this.value.length+h.c;else if(45!=o||0==v&&0!=this.value.indexOf("-"))if(c==s)h.init=Math.max(0,h.init),n.preventDefault();else if(l>0&&127==o&&v==this.value.length-l-1)n.preventDefault();else if(l>0&&8==o&&v==this.value.length-l)n.preventDefault(),h.c--,f=this.value.length+h.c;else if(l>0&&127==o&&v>this.value.length-l-1){if(""===this.value)return;"0"!=this.value.slice(v,v+1)&&(p=this.value.slice(0,v)+"0"+this.value.slice(v+1),u.val(p)),n.preventDefault(),f=this.value.length+h.c}else if(l>0&&8==o&&v>this.value.length-l){if(""===this.value)return;"0"!=this.value.slice(v-1,v)&&(p=this.value.slice(0,v-1)+"0"+this.value.slice(v),u.val(p)),n.preventDefault(),h.c--,f=this.value.length+h.c}else 127==o&&this.value.slice(v,v+1)==r?n.preventDefault():8==o&&this.value.slice(v-1,v)==r?(n.preventDefault(),h.c--,f=this.value.length+h.c):l>0&&v==d&&this.value.length>l+1&&v>this.value.length-l-1&&isFinite(+c)&&!n.metaKey&&!n.ctrlKey&&!n.altKey&&1===c.length&&(p=d===this.value.length?this.value.slice(0,v-1):this.value.slice(0,v)+this.value.slice(v+1),this.value=p,f=v);else n.preventDefault();f!==!1&&t.apply(this,[f,f]),u.data("numFormat",h)},"keyup.format":function(i){var n,s=e(this),r=s.data("numFormat"),u=i.keyCode?i.keyCode:i.which,h=a.apply(this,["start"]),o=a.apply(this,["end"]);0!==h||0!==o||189!==u&&109!==u||(s.val("-"+s.val()),h=1,r.c=1-this.value.length,r.init=1,s.data("numFormat",r),n=this.value.length+r.c,t.apply(this,[n,n])),""===this.value||(48>u||u>57)&&(96>u||u>105)&&8!==u&&46!==u&&110!==u||(s.val(s.val()),l>0&&(r.init<1?(h=this.value.length-l-(r.init<0?1:0),r.c=h-this.value.length,r.init=1,s.data("numFormat",r)):h>this.value.length-l&&8!=u&&(r.c++,s.data("numFormat",r))),46!=u||r.isPartialSelection||(r.c++,s.data("numFormat",r)),n=this.value.length+r.c,t.apply(this,[n,n]))},"paste.format":function(t){var a=e(this),i=t.originalEvent,n=null;return window.clipboardData&&window.clipboardData.getData?n=window.clipboardData.getData("Text"):i.clipboardData&&i.clipboardData.getData&&(n=i.clipboardData.getData("text/plain")),a.val(n),t.preventDefault(),!1}}).each(function(){var t=e(this).data("numFormat",{c:-(l+1),decimals:l,thousands_sep:r,dec_point:s,regex_dec_num:h,regex_dec:o,init:this.value.indexOf(".")?!0:!1});""!==this.value&&t.val(t.val())}):this.each(function(){var t=e(this),a=+t.text().replace(h,"").replace(o,".");t.number(isFinite(a)?+a:0,l,s,r)}):this.text(e.number.apply(window,arguments))};var n=null,l=null;e.isPlainObject(e.valHooks.text)?(e.isFunction(e.valHooks.text.get)&&(n=e.valHooks.text.get),e.isFunction(e.valHooks.text.set)&&(l=e.valHooks.text.set)):e.valHooks.text={},e.valHooks.text.get=function(t){var a,i=e(t),l=i.data("numFormat");return l?""===t.value?"":(a=+t.value.replace(l.regex_dec_num,"").replace(l.regex_dec,"."),(0===t.value.indexOf("-")?"-":"")+(isFinite(a)?a:0)):e.isFunction(n)?n(t):void 0},e.valHooks.text.set=function(t,a){var i=e(t),n=i.data("numFormat");if(n){var s=e.number(a,n.decimals,n.dec_point,n.thousands_sep);return e.isFunction(l)?l(t,s):t.value=s}return e.isFunction(l)?l(t,a):void 0},e.number=function(e,t,a,i){i="undefined"==typeof i?"1000"!==new Number(1e3).toLocaleString()?new Number(1e3).toLocaleString().charAt(1):"":i,a="undefined"==typeof a?new Number(.1).toLocaleString().charAt(1):a,t=isFinite(+t)?Math.abs(t):0;var n="\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4),l="\\u"+("0000"+i.charCodeAt(0).toString(16)).slice(-4);e=(e+"").replace(".",a).replace(new RegExp(l,"g"),"").replace(new RegExp(n,"g"),".").replace(new RegExp("[^0-9+-Ee.]","g"),"");var s=isFinite(+e)?+e:0,r="",u=function(e,t){return""+ +(Math.round((""+e).indexOf("e")>0?e:e+"e+"+t)+"e-"+t)};return r=(t?u(s,t):""+Math.round(s)).split("."),r[0].length>3&&(r[0]=r[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(r[1]||"").length0)&&(this.$stage.children(".cloned").remove(),this._clones=[])}},{filter:["items","settings"],run:function(){var a,b,c=this._clones,d=this._items,e=this.settings.loop?c.length-Math.max(2*this.settings.items,4):0;for(a=0,b=Math.abs(e/2);b>a;a++)e>0?(this.$stage.children().eq(d.length+c.length-1).remove(),c.pop(),this.$stage.children().eq(0).remove(),c.pop()):(c.push(c.length/2),this.$stage.append(d[c[c.length-1]].clone().addClass("cloned")),c.push(d.length-1-(c.length-1)/2),this.$stage.prepend(d[c[c.length-1]].clone().addClass("cloned")))}},{filter:["width","items","settings"],run:function(){var a,b,c,d=this.settings.rtl?1:-1,e=(this.width()/this.settings.items).toFixed(3),f=0;for(this._coordinates=[],b=0,c=this._clones.length+this._items.length;c>b;b++)a=this._mergers[this.relative(b)],a=this.settings.mergeFit&&Math.min(a,this.settings.items)||a,f+=(this.settings.autoWidth?this._items[this.relative(b)].width()+this.settings.margin:e*a)*d,this._coordinates.push(f)}},{filter:["width","items","settings"],run:function(){var b,c,d=(this.width()/this.settings.items).toFixed(3),e={width:Math.abs(this._coordinates[this._coordinates.length-1])+2*this.settings.stagePadding,"padding-left":this.settings.stagePadding||"","padding-right":this.settings.stagePadding||""};if(this.$stage.css(e),e={width:this.settings.autoWidth?"auto":d-this.settings.margin},e[this.settings.rtl?"margin-left":"margin-right"]=this.settings.margin,!this.settings.autoWidth&&a.grep(this._mergers,function(a){return a>1}).length>0)for(b=0,c=this._coordinates.length;c>b;b++)e.width=Math.abs(this._coordinates[b])-Math.abs(this._coordinates[b-1]||0)-this.settings.margin,this.$stage.children().eq(b).css(e);else this.$stage.children().css(e)}},{filter:["width","items","settings"],run:function(a){a.current&&this.reset(this.$stage.children().index(a.current))}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;d>c;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children("."+this.settings.activeClass).removeClass(this.settings.activeClass),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass(this.settings.activeClass),this.settings.center&&(this.$stage.children("."+this.settings.centerClass).removeClass(this.settings.centerClass),this.$stage.children().eq(this.current()).addClass(this.settings.centerClass))}}],e.prototype.initialize=function(){if(this.trigger("initialize"),this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass("owl-rtl",this.settings.rtl),this.browserSupport(),this.settings.autoWidth&&this.state.imagesLoaded!==!0){var b,c,e;if(b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e)return this.preloadAutoWidthImages(b),!1}this.$element.addClass("owl-loading"),this.$stage=a("<"+this.settings.stageElement+' class="owl-stage"/>').wrap('
'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this._width=this.$element.width(),this.refresh(),this.$element.removeClass("owl-loading").addClass("owl-loaded"),this.eventsCall(),this.internalEvents(),this.addTriggerableEvents(),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr("class",function(a,b){return b.replace(/\b owl-responsive-\S+/g,"")}).addClass("owl-responsive-"+d)):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},e.prototype.optionsLogic=function(){this.$element.toggleClass("owl-center",this.settings.center),this.settings.loop&&this._items.length").addClass(this.settings.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={}},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){if(0===this._items.length)return!1;(new Date).getTime();this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$stage.addClass("owl-refresh"),this.update(),this.$stage.removeClass("owl-refresh"),this.state.orientation=b.orientation,this.watchVisibility(),this.trigger("refreshed")},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._onResize=a.proxy(function(a){this.onResize(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.trigger("resize").isDefaultPrevented()?!1:(this._width=this.$element.width(),this.invalidate("width"),this.refresh(),void this.trigger("resized")):!1},e.prototype.eventsRouter=function(a){var b=a.type;"mousedown"===b||"touchstart"===b?this.onDragStart(a):"mousemove"===b||"touchmove"===b?this.onDragMove(a):"mouseup"===b||"touchend"===b?this.onDragEnd(a):"touchcancel"===b&&this.onDragEnd(a)},e.prototype.internalEvents=function(){var c=(k(),l());this.settings.mouseDrag?(this.$stage.on("mousedown",a.proxy(function(a){this.eventsRouter(a)},this)),this.$stage.on("dragstart",function(){return!1}),this.$stage.get(0).onselectstart=function(){return!1}):this.$element.addClass("owl-text-select-on"),this.settings.touchDrag&&!c&&this.$stage.on("touchstart touchcancel",a.proxy(function(a){this.eventsRouter(a)},this)),this.transitionEndVendor&&this.on(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,"resize",a.proxy(this.onThrottledResize,this))},e.prototype.onDragStart=function(d){var e,g,h,i;if(e=d.originalEvent||d||b.event,3===e.which||this.state.isTouch)return!1;if("mousedown"===e.type&&this.$stage.addClass("owl-grab"),this.trigger("drag"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,g=f(e).x,h=f(e).y,this.drag.offsetX=this.$stage.position().left,this.drag.offsetY=this.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.$stage.position().left+this.$stage.width()-this.width()+this.settings.margin),this.state.inMotion&&this.support3d)i=this.getTransformProperty(),this.drag.offsetX=i,this.animate(i),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=g-this.drag.offsetX,this.drag.startY=h-this.drag.offsetY,this.drag.start=g-this.drag.startX,this.drag.targetEl=e.target||e.srcElement,this.drag.updatedX=this.drag.start,("IMG"===this.drag.targetEl.tagName||"A"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),a(c).on("mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents",a.proxy(function(a){this.eventsRouter(a)},this))},e.prototype.onDragMove=function(a){var c,e,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e=f(c).x,g=f(c).y,this.drag.currentX=e-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?"right":"left":this.drag.distance>0&&(this.state.direction=this.settings.rtl?"left":"right"),this.settings.loop?this.op(this.drag.currentX,">",this.coordinates(this.minimum()))&&"right"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length):this.op(this.drag.currentX,"<",this.coordinates(this.maximum()))&&"left"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(b){var d,e,f;if(this.state.isTouch){if("mouseup"===b.type&&this.$stage.removeClass("owl-grab"),this.trigger("dragged"),this.drag.targetEl.removeAttribute("draggable"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),d=this.drag.endTime-this.drag.startTime,e=Math.abs(this.drag.distance),(e>3||d>300)&&this.removeClick(this.drag.targetEl),f=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(f),this.invalidate("position"),this.update(),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(f)||this.transitionEnd(),this.drag.distance=0,a(c).off(".owl.dragEvents")}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on("click.preventClick",this.e._preventClick),b.setTimeout(function(){a(c).off("click.preventClick")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off("click.preventClick")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.$stage.get(0),null).getPropertyValue(this.vendorName+"transform"),a=a.replace(/matrix(3d)?\(|\)/g,"").split(","),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=-1,d=30,e=this.width(),f=this.coordinates();return this.settings.freeDrag||a.each(f,a.proxy(function(a,g){return b>g-d&&g+d>b?c=a:this.op(b,"<",g)&&this.op(b,">",f[a+1]||g-e)&&(c="left"===this.state.direction?a+1:a),-1===c},this)),this.settings.loop||(this.op(b,">",f[this.minimum()])?c=b=this.minimum():this.op(b,"<",f[this.maximum()])&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger("translate"),this.state.inMotion=this.speed()>0,this.support3d?this.$stage.css({transform:"translate3d("+b+"px,0px, 0px)",transition:this.speed()/1e3+"s"}):this.state.isTouch?this.$stage.css({left:b+"px"}):this.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(a){this._invalidated[a]=!0},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(b,c){var e=c?this._items.length:this._items.length+this._clones.length;return!a.isNumeric(b)||1>e?d:b=this._clones.length?(b%e+e)%e:Math.max(this.minimum(c),Math.min(this.maximum(c),b))},e.prototype.relative=function(a){return a=this.normalize(a),a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=0,f=this.settings;if(a)return this._items.length-1;if(!f.loop&&f.center)b=this._items.length-1;else if(f.loop||f.center)if(f.loop||f.center)b=this._items.length+f.items;else{if(!f.autoWidth&&!f.merge)throw"Can not detect maximum absolute position.";for(revert=f.rtl?1:-1,c=this.$stage.width()-this.$element.width();(d=this.coordinates(e))&&!(d*revert>=c);)b=++e}else b=this._items.length-f.items;return b},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.relative(this.current()),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1,j=this._clones.length+this._items.length;h=j-this.settings.items&&i===!0&&(f=g-this._items.length,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e),this.update()},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c),this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.transitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.state.inMotion=!1,void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(a,b){b=b===d?this._items.length:this.normalize(b,!0),this.trigger("add",{content:a,position:b}),0===this._items.length||b===this._items.length?(this.$stage.append(a),this._items.push(a),this._mergers.push(1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[b].before(a),this._items.splice(b,0,a),this._mergers.splice(b,0,1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this.invalidate("items"),this.trigger("added",{content:a,position:b})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.replace,add:this.add,remove:this.remove},a.proxy(function(a,c){this.$element.on(a+".owl.carousel",b(c,a+".owl.carousel"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.$element.get(0))&&(this.$element.removeClass("owl-hidden"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.$element.get(0))||(this.$element.addClass("owl-hidden"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr("src",f.src),e.css("opacity",1),c>=b.length&&(d.state.imagesLoaded=!0,d.initialize())},f.src=e.attr("src")||e.attr("data-src")||e.attr("data-src-retina")})},e.prototype.destroy=function(){this.$element.hasClass(this.settings.themeClass)&&this.$element.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&a(b).off("resize.owl.carousel"),this.transitionEndVendor&&this.off(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd);for(var d in this._plugins)this._plugins[d].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.$stage.off("mousedown touchstart touchcancel"),a(c).off(".owl.dragEvents"),this.$stage.get(0).onselectstart=function(){},this.$stage.off("dragstart",function(){return!1})),this.$element.off(".owl"),this.$stage.children(".cloned").remove(),this.e=null,this.$element.removeData("owlCarousel"),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.unwrap()},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d){var e={item:{count:this._items.length,index:this.current()}},f=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),g=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.$element.trigger(g),this.settings&&"function"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.browserSupport=function(){if(this.support3d=j(),this.support3d){this.transformVendor=i();var a=["transitionend","webkitTransitionEnd","transitionend","oTransitionEnd"];this.transitionEndVendor=a[h()],this.vendorName=this.transformVendor.replace(/Transform/i,""),this.vendorName=""!==this.vendorName?"-"+this.vendorName.toLowerCase()+"-":""}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data("owlCarousel")||a(this).data("owlCarousel",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){var c=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},c.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=c}(window.Zepto||window.jQuery,window,document),function(a){var b=function(c){this._core=c,this._handlers={"initialized.owl.carousel":a.proxy(function(){this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())&&this.update()},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this._core.$element.on(this._handlers)};b.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},b.prototype.update=function(){this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass)},b.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=b}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this._core=b,this._videos={},this._playing=null,this._fullscreen=!1,this._handlers={"resize.owl.carousel":a.proxy(function(a){this._core.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),"refresh.owl.carousel changed.owl.carousel":a.proxy(function(){this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))},this)},this._core.options=a.extend({},d.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};d.Defaults={video:!1,videoHeight:!1,videoWidth:!1},d.prototype.fetch=function(a,b){var c=a.attr("data-vimeo-id")?"vimeo":"youtube",d=a.attr("data-vimeo-id")||a.attr("data-youtube-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else{if(!(d[3].indexOf("vimeo")>-1))throw new Error("Video URL not supported.");c="vimeo"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},d.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='
',d=k.lazyLoad?'
':'
',b.after(d),b.after(e)};return b.wrap('
"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}))},d.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null},d.prototype.play=function(b){this._core.trigger("play",null,"video"),this._playing&&this.stop();var c,d,e=a(b.target||b.srcElement),f=e.closest("."+this._core.settings.itemClass),g=this._videos[f.attr("data-video")],h=g.width||"100%",i=g.height||this._core.$stage.height();"youtube"===g.type?c='':"vimeo"===g.type&&(c=''),f.addClass("owl-video-playing"),this._playing=f,d=a('
'+c+"
"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay() },this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value").addClass(d.dotClass).append(a("")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("
").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("
").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("
").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document); ;function initialiseListingMap() {var mapOptions={scrollwheel:false,draggable:false,zoom:15,center:new google.maps.LatLng($('.lttd').html(),$('.lngtd').html()),styles:[{"featureType":"all","elementType":"labels.text.fill","stylers":[{"color":"#666666"}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"saturation":"-100"},{"lightness":"-10"}]},{"featureType":"landscape.man_made","elementType":"geometry.fill","stylers":[{"color":"#e1e1e1"}]},{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"color":"#ebebeb"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry.fill","stylers":[{"color":"#dddddd"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#cccccc"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#aaaaaa"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#cccccc"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#cccccc"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#f5f5f5"}]},{"featureType":"transit.station","elementType":"geometry.fill","stylers":[{"color":"#cccccc"}]},{"featureType":"water","elementType":"all","stylers":[{"visibility":"simplified"},{"lightness":"50"}]}]};var mapElement=document.getElementById('mapListing');var map=new google.maps.Map(mapElement,mapOptions);var marker=new google.maps.Marker({position:new google.maps.LatLng($('.lttd').html(),$('.lngtd').html()),icon:'/thm/usr/'+$("meta[name='theme']").attr("content")+'/img/map-marker.png',map:map,title:$("h1:first").html()});} function getNearBy(sID) {sLng=$('meta[property="og:locale"]').attr("content").split("_")[0];sLocation=$("#nearByLocation").val();sType=$("#nearByType").val();nTime=$("#nearByTime").val();$.ajax ({async:false,beforeSubmit:function(){},error:function(jqXHR,textStatus,errorThrown){$(sID).html("");return false;},success:function(response){$(sID).html(response);return true;},type:"post",url:"/"+sLng+"/agnt/01/"+sLocation+"/"+sType+"/"+nTime+"/"});} $(document).ready (function() {if($("#listingSlider")) {var slider=new MasterSlider();slider.control('arrows');slider.control('lightbox');slider.control('thumblist',{autohide:false,dir:'h',align:'bottom',width:130,height:95,margin:1,space:1,hideUnder:400});slider.setup('listingSlider',{width:1240,height:700,layout:'boxed',space:0,loop:true,autoplay:true,view:'fade'});$("a[data-gal^='prettyPhoto']").prettyPhoto({deeplinking:false});} if($("#listingSlider-fill")) {var slider=new MasterSlider();slider.control('arrows');slider.control('lightbox');slider.control('thumblist',{autohide:false,dir:'h',align:'bottom',width:130,height:95,margin:1,space:1,hideUnder:400});slider.setup('listingSlider-fill',{width:800,height:500,view:'fade',space:1,layout:'autofill',loop:true,preload:0,autoplay:true});$("a[data-gal^='prettyPhoto']").prettyPhoto({deeplinking:false,social_tools:false,overlay_gallery:false});} if($("#mapListing").length>0) {if(typeof google!=='undefined') {google.maps.event.addDomListener(window,'load',initialiseListingMap);}} var o=$.parseJSON($(".searchData").html());if(o.country!='spain') {$(".energy").hide();} $('#back, #back1').on ('click',function(event) {event.preventDefault();window.history.go(-1);return false;}) $('.back').on ('click',function(event) {event.preventDefault();window.history.go(-1);return false;}) $('#print').on ('click',function(event) {if($("#language").length>0) {sLng=$('#language').val();} else {sLng=sLng=$('meta[property="og:locale"]').attr("content");} sType=$('.genus').html();sID=$('.oid').html();sURL='/'+sLng+'/print/'+sType+'/'+sID+'/';window.open(sURL,'_print');}) if($("#nearByTime").length>0&&$("#nearByType").length>0) {$("#nearByTime").on('change',function(){getNearBy("#nearByResult");}) $("#nearByTypeList li.nearByTypeItem").on('click',function(event){$("#nearByType").val($(this).attr("data-id"));$('.nearByTypeItem').removeClass('selected');$(this).addClass("selected");getNearBy("#nearByResult");});getNearBy("#nearByResult");} Date.prototype.addDay=function(nCount) {var date=new Date(this.valueOf()) date.setDate(date.getDate()+nCount);return date;} function durationOK(arrival,departure,aBookedDates,format) {var today=arrival.addDay(1);var departure=departure.addDay(-1);while(today<=departure) {today=today.addDay(1);sToday=$.datepicker.formatDate(format,today);if($.inArray(sToday,aBookedDates)>0) {return false;}} return true;} function calendarResize() {var width=$("#calendar").width();if(width==null||width<1) {width=$("#calendar").attr('offsetWidth');} width=width-2;if(width>0&&Math.abs(width-$("div ui-datepicker").width())>5) {if(width<166) {$("div.ui-datepicker").css({'font-size':'8px'});$(".ui-datepicker td .ui-state-default").css({'padding':'0px','font-size':'6px'});} else if(width>228) {$("div.ui-datepicker").css({'font-size':'13px'});$(".ui-datepicker td .ui-state-default").css({'padding':'5px','font-size':'100%'});} else {$("div.ui-datepicker").css({'font-size':(width-43)/16+'px'});}}} function getPrice() {$.ajax ({async:false,beforeSubmit:function(){},data:{reference:$(".oid").html(),arrival:$("#arrival").val(),departure:$("#departure").val(),guest:$("#guest").html()},error:function(jqXHR,textStatus,errorThrown) {console.log('Rental Price Failure: '+textStatus+' '+errorThrown);},success:function(response) {var o=$.parseJSON(response);console.log(o.value);$("#priceRental").val(o.value);$("#priceGuest").val(o.guest);return true;},type:'post',url:"/jx/lst.get.rental.value.php"})} function daydiff(first,second) {return Math.round((second-first)/(1000*60*60*24));} function nightUpdate() {var date1=$.datepicker.parseDate('dd-mm-yy',$("#arrival").val());var date2=$.datepicker.parseDate('dd-mm-yy',$("#departure").val());$('#nights').val(daydiff(date1,date2));} $.datepicker.setDefaults ({numberOfMonths:3,stepMonths:1,yearRange:"2016:2032",maxDate:"+10y",minDate:"0",dateFormat:'dd-mm-yy',firstDay:6}) $('#calendar').datepicker ({beforeShowDay:function(date) {var bookedArrival=$("#bookedArrival").html().replace("[","").replace("]","").split(',');var bookedDeparture=$("#bookedDeparture").html().replace("[","").replace("]","").split(',');var bookedDates=$("#bookedDate").html().replace("[","").replace("]","").split(',');var ownerArrival=$("#ownerArrival").html().replace("[","").replace("]","").split(',');;var ownerDeparture=$("#ownerDeparture").html().replace("[","").replace("]","").split(',');var ownerDates=$("#ownerDate").html().replace("[","").replace("]","").split(',');var maintenanceDates=$("#maintenanceDate").html().replace("[","").replace("]","").split(',');bState=true;sClass="available";sTip="Available";today=$.datepicker.formatDate($.datepicker._defaults.dateFormat,date);var day=date.getDay();var date1=$.datepicker.parseDate($.datepicker._defaults.dateFormat,$("#arrival").val());var date2=$.datepicker.parseDate($.datepicker._defaults.dateFormat,$("#departure").val());if($.inArray(today,bookedArrival)!=-1) {bState=true;sClass="availableArrival";sTip="Change Over";} else if($.inArray(today,bookedDeparture)!=-1) {bState=true;sClass="availableDeparture";sTip="Change Over";} else if($.inArray(today,bookedDates)!=-1) {bState=false;sClass="booked";sTip="Booked";} else if($.inArray(today,ownerArrival)!=-1) {bState=true;sClass="ownerArrival";sTip="Change Over";} else if($.inArray(today,ownerDeparture)!=-1) {bState=true;sClass="ownerDeparture";sTip="Change Over";} else if($.inArray(today,ownerDates)!=-1) {bState=false;sClass="owner";sTip="Owner";} else if($.inArray(today,maintenanceDates)!=-1) {bState=false;sClass="maintenance";sTip="Maintenance";} else if(date1&&((date.getTime()==date1.getTime())||(date2&&date>=date1&&date<=date2))) {bState=true;sClass="highlight";sTip="Selected";} else {bState=true;sClass="available";sTip="Available";} return[bState,sClass,sTip];},onSelect:function(date) {var date1=$.datepicker.parseDate($.datepicker._defaults.dateFormat,$("#arrival").val());var date2=$.datepicker.parseDate($.datepicker._defaults.dateFormat,$("#departure").val());var date3=$.datepicker.parseDate($.datepicker._defaults.dateFormat,date);var bookedDates=$("#bookedDate").html().replace("[","").replace("]","").split(',');var ownerDates=$("#ownerDate").html().replace("[","").replace("]","").split(',');var maintenanceDates=$("#maintenanceDate").html().replace("[","").replace("]","").split(',');var format=$.datepicker._defaults.dateFormat;if(!date1||date2) {$("#arrival").val(date);$("#departure").val("");$(this).datepicker("option","minDate",date);} else {unavailable=bookedDates.concat(ownerDates,maintenanceDates);if(durationOK(date1,$.datepicker.parseDate($.datepicker._defaults.dateFormat,date),unavailable,format)) {$("#departure").val(date);$(this).datepicker("option","minDate",null);getPrice();nightUpdate();} else {$("#arrival").val("");$("#departure").val("");}}}}) calendarResize();});;function resetNewDevelopment() {if($('input[name="newDevelopment"]:checked').length>0) {resetSearch();$('input[name="newDevelopment"]').prop('checked',true);} else {}} function reloadSearch() {var o=$.parseJSON($(".searchData").html());setCountry(o);setRegion(o);setArea(o);setLocation('',o);setListingType('',o);} function resetSearch() {$.ajax ({url:"/jx/lst.search.reset.php",data:{},dataType:"html",async:false,cache:false,beforeSend:function(jqXHR,settings){},success:function(data,status,xhr) {$(".searchData").html(data);var o=$.parseJSON(data);setCountry('spain',o);setRegion('',o);setArea('',o);setLocation('',o);setListingType('sale',o);changeListing(o,$("select[name='listing']").val());setPrice('','min',o);setPrice('','max',o);setCurrency(o);setPropertyType('',o);setBedroom('',o);setBathroom('',o);setSizeBuild('',o);setSizePlot('',o);setSizeTerrace('',o);setSort('',o);setRefNumber('');$('input:checkbox').removeAttr('checked');updataArea(o);getListingCount(o);resetStackSelect();},complete:function(jqXHR,textStatus){}})} function resetStackSelect() {$("li").on ('click',function() {var base=$(this).closest(".bootstrap-select");var select=base.find("select");if(base.length&&select.prop("multiple")) {var group=$(this).data("optgroup")-1;var group2=group+1;var select=$(this).closest(".bootstrap-select").find("select");if($(this).hasClass("dropdown-header")) {if(base.find("li[data-optgroup="+group2+"]:not(.selected)").length===1) {$(this).closest(".bootstrap-select").find("select > optgroup:eq("+group+") > option").prop("selected",false);} else {$(this).closest(".bootstrap-select").find("select > optgroup:eq("+group+") > option").prop("selected",true);} select.selectpicker('render');}}});} function getListingCount(o) {switch(o.key) {case"[cliente key]":var sCountry=$("#country").val();var sType=$("#listingType").val();var sRegion=$("#area").val();var sLocation=$("#location").map(function(){return $(this).val();}).get();var sProperty=$("#property").map(function(){return this.value}).get();var sPrice=$("#price").val();var nBed=($("#bed").length>0&&$("#bed").val().length>0)?$("#bed").val().replace(/\D/g,''):0;var nBath=($("#bath").length>0&&$("#bath").val().length>0)?$("#bath").val().replace(/\D/g,''):0;$.ajax ({url:"/jx/get.listing.count.php",data:{"country":sCountry,"type":sType,"region":sRegion,"location":sLocation.join(","),"property":sProperty.join(","),"price":sPrice,"bed":nBed,"bath":nBath},dataType:"json",async:true,cache:false,beforeSend:function(jqXHR,settings){},success:function(data,status,xhr) {$("#submit").html(data.text);},complete:function(jqXHR,textStatus){}});break;default:break;}} function convertCurrency(sSource,nAmount,oCurrency,sTargetCurrency,sOriginalCurrency) {if(isNaN(nAmount)||nAmount==0) {return nAmount;} else {if(sTargetCurrency.toLowerCase()==sOriginalCurrency.toLowerCase()) {n=nAmount;s1='.';s2=",";} else {switch(sSource) {case"eur":n=(nAmount*oCurrency.rate);s1=',';s2=".";break;default:n=(nAmount/oCurrency.rate);s1='.';s2=",";break;}} return oCurrency.symbol+$.number(parseInt(n),0,s1,s2);}} function getRate(sTarget) {$.ajax ({url:"/jx/get.currency.php",data:{"c":sTarget},dataType:"text",async:false,cache:false,beforeSend:function(jqXHR,settings){},success:function(data,status,xhr) {oCurrency=$.parseJSON(data);},complete:function(jqXHR,textStatus){}})} function changeCurrency(o,v) {var sSource="eur";var sTarget=v;var oCurrency=[];$("select[name='currencymenu']").val(v);$("select[name='currencymenu']").selectpicker('refresh');$.ajax ({url:"/jx/get.currency.php",data:{"c":sTarget},dataType:"text",async:false,cache:false,beforeSend:function(jqXHR,settings){},success:function(data,status,xhr) {oCurrency=$.parseJSON(data);},complete:function(jqXHR,textStatus){}}) $(".price,.priceChange").each (function(n) {s=$(this).html();sOriginal=$(this).data("currency");sPrice=$(this).data("price");switch($(this).data("genus")) {case"sale":if($(this).data("price")>0) {a=s.split(" ");a[0]=convertCurrency(sSource,$(this).data("price"),oCurrency,sTarget,sOriginal);$(this).html(a[0]);} break;case"short":a=s.split("/");p=$(this).data("price").split("-");c1=convertCurrency(sSource,p[0],oCurrency,sTarget,sOriginal);c2=convertCurrency(sSource,p[1],oCurrency,sTarget,sOriginal);a[0]=c1+" - "+c2;$(this).html(a.join("/"));break;case"long":a=s.split("/");p=$(this).data("price").split("-");a[0]=convertCurrency(sSource,p[0],oCurrency,sTarget,sOriginal);$(this).html(a.join("/"));break;}})} function changeFilter(id,sType,o) {elm="select[name='category']";if($(elm).length>0) {sData=$("#_filter"+sType).html();$(elm).html(sData);$(elm).selectpicker('refresh');}} function changeCurrencyMenu(o,v) {$("select[name='currency']").val(v);$("select[name='currency']").selectpicker('refresh');} function setRefNumber(vValue) {$("#reference").val(vValue);} function setPriceOption(id,sType,o) {sData="";if($("#price").length>0) {sData=$("#_srch"+sType).html();elm="select[name='price']";} else {switch(id) {case"#pricemin":sData=$("#_srch"+sType+"min").html();elm="select[name='pricemin']";break;case"#pricemax":sData=$("#_srch"+sType+"max").html();elm="select[name='pricemax']";break;default:break;}} $(elm).html(sData);$(elm).selectpicker('refresh');changeFilter(id,sType,o);} function changeSort(nSort) {$.post('/jx/chg.sort.php',{srt:nSort}).done(function(response){window.location.reload(true);});} function updataArea() {} function changeListing(o,sListing) {if(sListing==null) {sListing="sale";} switch(sListing) {case"sale":case"long":case"short":if(sListing!==o.listing) {o.price="0-999999999";} if($("#price").length>0) {setPriceOption("#price",sListing,o);if(o.price==0) {$("#price").val($('#price option:first-child').val());} else {$("#price").val(o.price);} $("#price").selectpicker('refresh');} else {setPriceOption("#pricemin",sListing,o);setPriceOption("#pricemax",sListing,o);if(o.price==0) {$("#pricemin").val($('#pricemin option:first-child').val());$("#pricemax").val($('#pricemax option:last-child').val());} else {aPrice=o.price.split("-");$("#pricemin").val(aPrice[0]);$("#pricemax").val(aPrice[1]);} $("#pricemin").selectpicker('refresh');$("#pricemax").selectpicker('refresh');} break;default:return;} switch(sListing) {case"long":case"short":$('input:checkbox').removeAttr('checked');break;}} function setPrice(s,sType,o) {if($("#price").length>0) {if(o.price==0) {$("#price, .price").val($('#price option:first-child').val());} else {$("#price, .price").val(o.price);} $("#price, .price").selectpicker('refresh');} else {if(sType=='min'&&$("select[name='pricemin']").length>0) {$("select[name='pricemin']").val(o.pricemin);} else {if(o.pricemax==0) {$("select[name='pricemax']").val($("select[name='pricemax'] option:last-child").val());} else {$("select[name='pricemax']").val(o.pricemax);}} $("select[name='pricemin']").selectpicker('refresh');$("select[name='pricemax']").selectpicker('refresh');}} function setPropertyType(s,o) {elm="select[name='property[]']";if($(elm).length>0) {$(elm).val(o.property);$(elm).selectpicker('refresh');}} function setListingType(s,o) {$("select[name='listing']").val(o.listing);$("select[name='listing']").selectpicker('refresh');} function setBedroom(s,o) {elm="select[name='bed']";if($(elm).length>0) {$(elm).val(o.bed);$(elm).selectpicker('refresh');}} function setBathroom(s,o) {elm="select[name='bath']";if($(elm).length>0) {$(elm).val(o.bath);$(elm).selectpicker('refresh');}} function setNewDevelopment(s,o) {elm="select[name='newDevelopment']";if($(elm).length>0) {$(elm).val(o.newDevelopment);$(elm).selectpicker('refresh');}} function setFeature(o) {$("#feature").val(o.feature);$("#feature").selectpicker('refresh');} function setPool(s,o) {elm="input[name='pool]'";if($(elm).length>0) {$(elm).val(o.pool);$(elm).selectpicker('refresh');}} function setText(o) {$("#text").val(o.text);} function setCurrency(o) {if(o.currency!==null) {$("select[name='currency']").val(o.currency.toLowerCase());$("select[name='currency']").selectpicker('refresh');$("select[name='currencymenu']").val(o.currency.toLowerCase());$("select[name='currencymenu']").selectpicker('refresh');}} function setCountry(o) {$("select[name='country']").val(o.country);$("select[name='country']").selectpicker('refresh');if(o.country=="barbados"||o.country=="st.lucia") {$("select[name='currency']").val("usd").selectpicker('refresh');changeCurrency(o,"usd");} else {$("select[name='currency']").val("eur").selectpicker('refresh');changeCurrency(o,"eur");}} function setRegion(o) {$("select[name='region']").val(o.region);$("select[name='region']").selectpicker('refresh');updateArea(o);} function setArea(o) {$("#area").val(o.area);$("#area").selectpicker('refresh');updateLocation(o);} function setLocation(s,o) {var elm=" select[name='location[]']" if($(elm).length>0) {$.each ($("select[name='location[]']"),function(sKey,sValue) {$(this).val(o.location);$(this).selectpicker('refresh');})}} function updateRegion(o) {if($("#region").length>0) {sRegion=$("#region :selected").attr("data-region");if(typeof sRegion==="undefined") {sRegion=$("#region").val();$("#area option").hide();$("#area").find("option[data-region='"+sRegion.toLowerCase()+"']").show();} else {$("#area option").hide();$("#area").find("option[data-region='"+sRegion+"']").show();} $("#area").selectpicker('deselectAll');$("#area").selectpicker('refresh');updateArea(o);}} function updateArea(o) {if($("#country").length>0) {sRegion=$("#region :selected").attr("data-region");if($("#region").length>0&&typeof sRegion!=="undefined") {if(typeof sCountry==="undefined") {sCountry=$("#region").val();$("#area option").hide();$("#area").find("option[data-region='"+sRegion.toLowerCase()+"']").show();} else {if($("#area").length==0) {$("#location option").hide();$("#location").find("option[data-region='"+sRegion+"']").show();$("#location").selectpicker('deselectAll');$("#location").selectpicker('refresh');} else {$("#area option").hide();$("#area").find("option[data-region='"+sRegion+"']").show();}}} else {sCountry=$("#country :selected").attr("data-country");if(typeof sCountry==="undefined") {sCountry=$("#country").val();$("#area option").hide();$("#area").find("option[data-country='"+sCountry.toLowerCase()+"']").show();} else {$("#area option").hide();$("#area").find("option[data-country='"+sCountry+"']").show();}} $("#area").selectpicker('deselectAll');$("#area").selectpicker('refresh');}} function updateLocation(o) {if($("#area").length>0&&$("#area").val()!=="any"&&typeof $("#area :selected").attr("data-area")!=="undefined") {$("#location option").hide();$("#area :selected").each(function(index) {$("#location").find("option[data-area='"+$(this).attr("data-area")+"']").show();});} else if($("#area").length==0||$("#area").val()==="any") {sCountry=$("#country").val().toLowerCase();sRegion=$("#region :selected").attr("data-region");if(typeof sRegion==="undefined") {sCountry=$("#country").val().toLowerCase();$("#location option").hide();$("#location").find("option[data-country='"+sCountry+"']").show();} else {$("#location option").hide();$("#location").find("option[data-region='"+sRegion+"']").show();}} else {sCountry=$("#country").val().toLowerCase();$.each ($("select[name='location[]']"),function(sKey,sValue) {$(this).find("option[data-country='"+sCountry+"']").show();})} $("#location").selectpicker('deselectAll');$("#location").selectpicker('refresh');} function setSort(s,o) {$("select[name='sort']").val(o.sortType);$("select[name='sort']").selectpicker('refresh');} function include(path) {var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",path);if(head=document.getElementsByTagName("head")[0]) {head.appendChild(script);}} function getDate(element,dateFormat) {var date;try {date=$.datepicker.parseDate(dateFormat,element.value);} catch(error) {date=null;} return date;} function setSizeBuild(s,o) {elm="input[name='build']";if($(elm).length>0) {if(o.build==0) {$(elm).val("");} else {$(elm).val(o.build);}}} function setSizePlot(s,o) {elm="input[name='plot']";if($(elm).length>0) {if(o.plot==0) {$(elm).val("");} else {$(elm).val(o.plot);}}} function setSizeTerrace(s,o) {elm="input[name='terrace']";if($(elm).length>0) {if(o.terrace==0) {$(elm).val("");} else {$(elm).val(o.terrace);}}} function setSelectBox(aForm,o,sSetting) {elm="select[id='"+sSetting+"']";if($(elm).length>0) {$(elm+" option[value='"+o[sSetting]+"']").attr("selected","selected");$(elm).selectpicker('refresh');}} function setCheckBox(s,o,sSetting) {if(o.sSetting=='nothing') {return false;} else {if($("input[name='"+sSetting+"[]']").length>0) {$.each (o[sSetting],function(sKey,sValue) {$("input:checkbox[value='"+sValue+"']").attr("checked",true);})} else {return false;}}} function setCheckBoxSolo(s,o,sSetting) {if(o.sSetting=='nothing') {return false;} else {if($("input[name='"+sSetting+"']").length>0) {$("input:checkbox[value='"+o[sSetting]+"']").attr("checked",true);} else {return false;}}} $(document).ready (function() {var o=$.parseJSON($(".searchData").html());var dateFormat="dd-mm-yy";var idForm="";var aForm=["#frmSearch","#frmSearchAdvanced","frmSearchModal"];switch(o.key) {case"br1-2326de66-f39c-42c2-a0b4-a3fa47a6cb6f5":$('.selectpicker').selectpicker({dropupAuto:true});$('.selectpicker').selectpicker({iconBase:'fa',tickIcon:'fa-check'});break;case"se2-e793dc19-9b82-41e6-b8ee-6251c37176d5":$('.selectpicker').selectpicker({dropupAuto:true});$('.selectpicker').selectpicker({iconBase:'fa',tickIcon:'fa-check-square-o'});break;default:$('.selectpicker').selectpicker({dropupAuto:true});$('.selectpicker').selectpicker({iconBase:'fa',tickIcon:'fa-check'});break;} include("/inc/vndr/selectMaster/js/i18n/defaults-"+o.lanaguage+".js");for(var nIndex=0,nLength=aForm.length;nIndex0&&$(".searchData").length>0) {$("select[name='country']").on ("change",function(e) {if($(this).val()=="barbados"||$(this).val()=="st.lucia") {$("select[name='currency']").val("usd").selectpicker('refresh');changeCurrency(o,"usd");} else {$("select[name='currency']").val("eur").selectpicker('refresh');changeCurrency(o,"eur");} updateArea(o);});$("select[name='region']").on("change",function(e){updateRegion(o);});$("#area").on("change",function(e){updateLocation(o);});$("select[name='listing']").on('change',function(){changeListing(o,$(this).val());});$("select[name='listingType']").on('change',function(){changeListing(o,$(this).val());});$("select[name='currency']").on('change',function(){changeCurrency(o,$(this).val());});$("select[name='currencymenu']").on('change',function(){changeCurrency(o,$(this).val());changeCurrencyMenu(o,$(this).val());});$("input:radio[name='listing']").on('change',function(){changeListing(o,$(this).val());});$("select[name='sort']").on('change',function(){changeSort($(this).val());});$('#reset').on('click',function(e){e.preventDefault();resetSearch();});$('#newDevelopment').on('change',function(e){e.preventDefault();resetNewDevelopment();});$("select[name='listing']").on('change',function(){getListingCount(o);});$("#area").on('changed.bs.select',function(e,clickedIndex,isSelected,previousValue){getListingCount(o)});$("#location").on('changed.bs.select',function(e,clickedIndex,isSelected,previousValue){getListingCount(o)});$("#property").on('changed.bs.select',function(e,clickedIndex,isSelected,previousValue){getListingCount(o)});$("select[name='bed']").on('change',function(){getListingCount(o);});$("select[name='bath']").on('change',function(){getListingCount(o);});$("select[name='price']").on('change',function(){getListingCount(o);});setCountry(o);setRegion(o);setArea(o);setLocation(aForm[nIndex],o);setListingType(aForm[nIndex],o);changeListing(o,o.listing);setCurrency(o);setPrice(aForm[nIndex],'min',o);setPrice(aForm[nIndex],'max',o);setPrice(aForm[nIndex],'bdgt',o);setPropertyType(aForm[nIndex],o);setBedroom(aForm[nIndex],o);setBathroom(aForm[nIndex],o);setSizeBuild(aForm[nIndex],o);setSizePlot(aForm[nIndex],o);setSizeTerrace(aForm[nIndex],o);setCheckBox(aForm[nIndex],o,'setting');setCheckBox(aForm[nIndex],o,'view');setCheckBox(aForm[nIndex],o,'orientation');setCheckBox(aForm[nIndex],o,'climate');setCheckBox(aForm[nIndex],o,'pool');setCheckBox(aForm[nIndex],o,'parking');setCheckBox(aForm[nIndex],o,'garden');setCheckBox(aForm[nIndex],o,'feature');setCheckBox(aForm[nIndex],o,'category');setCheckBox(aForm[nIndex],o,'security');setCheckBoxSolo(aForm[nIndex],o,'newDevelopment');setNewDevelopment(aForm[nIndex],o);switch(o.key) {case"bm1-2326de66-f39c-42c2-a0b4-a3fa47a6cb6f5":setSelectBox(aForm[nIndex],o,'setting');setSelectBox(aForm[nIndex],o,'view');setSelectBox(aForm[nIndex],o,'feature');setSelectBox(aForm[nIndex],o,'status');setSelectBox(aForm[nIndex],o,'category');break;case"br1-2326de66-f39c-42c2-a0b4-a3fa47a6cb6f5":case"pd1-4946d79a-89d2-404d-be71-b91a4b08af64":case"bfp-738ad846-255c-4dd2-97ef-1c478656b32e":case"cds-bd93da25-f134-4132-a326-cbd6945c4678":setSelectBox(aForm[nIndex],o,'category');break;default:break;} getListingCount(o);setSort(aForm[nIndex],o);if($("#checkin").length>0&&$("#checkout").length>0) {$("#checkin").val(o.checkin);$("#checkout").val(o.checkout);checkIn=$("#checkin").datepicker ({defaultDate:"+1w",changeMonth:false,numberOfMonths:1,dateFormat:dateFormat}).on ("change",function(){checkOut.datepicker("option","minDate",getDate(this,dateFormat));}),checkOut=$("#checkout").datepicker ({defaultDate:"+1w",changeMonth:false,numberOfMonths:1,dateFormat:dateFormat}).on ("change",function(){checkIn.datepicker("option","maxDate",getDate(this,dateFormat));});} if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {switch(o.key) {case"br1-2326de66-f39c-42c2-a0b4-a3fa47a6cb6f5":case"bs1-cc5bce5c-40c0-406a-b511-8a5c7c86f4ad":case"lhpc-9d5e0240-f7c8-4b86-a25e-4a6a908e72ec":case"sh4u-c3c289f6-7c9b-47ad-b730-ae1351b97fef":case"smr-292841ec-3c9a-47fe-939b-0df4fabd1c86":break;default:$('.selectpicker').selectpicker('mobile');break;}} $(aForm[nIndex]).show();} else {setCurrency(o);$("select[name='currencymenu']").on('change',function(e){changeCurrencyMenu(o,$(this).val());});}} resetStackSelect();$("#frmSearch").show();$("#frmSearchAdvance").show();});!function t(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.Raphael=r():e.Raphael=r()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var i,n;i=[r(1),r(3),r(4)],n=function(t){return t}.apply(e,i),!(void 0!==n&&(t.exports=n))},function(t,e,r){var i,n;i=[r(2)],n=function(t){function e(r){if(e.is(r,"function"))return w?r():t.on("raphael.DOMload",r);if(e.is(r,Q))return e._engine.create[z](e,r.splice(0,3+e.is(r[0],$))).add(r);var i=Array.prototype.slice.call(arguments,0);if(e.is(i[i.length-1],"function")){var n=i.pop();return w?n.call(e._engine.create[z](e,i)):t.on("raphael.DOMload",function(){n.call(e._engine.create[z](e,i))})}return e._engine.create[z](e,arguments)}function r(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var i in t)t[A](i)&&(e[i]=r(t[i]));return e}function i(t,e){for(var r=0,i=t.length;r=1e3&&delete o[l.shift()],l.push(s),o[s]=t[z](e,a),r?r(o[s]):o[s])}return n}function a(){return this.hex}function s(t,e){for(var r=[],i=0,n=t.length;n-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?n-4==i?a[3]={x:+t[0],y:+t[1]}:n-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[n-2],y:+t[n-1]}:n-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}function o(t,e,r,i,n){var a=-3*e+9*r-9*i+3*n,s=t*a+6*e-12*r+6*i;return t*s-3*e+3*r}function l(t,e,r,i,n,a,s,l,h){null==h&&(h=1),h=h>1?1:h<0?0:h;for(var u=h/2,c=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,g=0;gd;)c/=2,f+=(pW(n,s)||W(e,i)W(a,o))){var l=(t*i-e*r)*(n-s)-(t-r)*(n*o-a*s),h=(t*i-e*r)*(a-o)-(e-i)*(n*o-a*s),u=(t-r)*(a-o)-(e-i)*(n-s);if(u){var c=l/u,f=h/u,p=+c.toFixed(2),d=+f.toFixed(2);if(!(p<+G(t,r).toFixed(2)||p>+W(t,r).toFixed(2)||p<+G(n,s).toFixed(2)||p>+W(n,s).toFixed(2)||d<+G(e,i).toFixed(2)||d>+W(e,i).toFixed(2)||d<+G(a,o).toFixed(2)||d>+W(a,o).toFixed(2)))return{x:c,y:f}}}}function c(t,e){return p(t,e)}function f(t,e){return p(t,e,1)}function p(t,r,i){var n=e.bezierBBox(t),a=e.bezierBBox(r);if(!e.isBBoxIntersect(n,a))return i?0:[];for(var s=l.apply(0,t),o=l.apply(0,r),h=W(~~(s/5),1),c=W(~~(o/5),1),f=[],p=[],d={},g=i?0:[],v=0;v=0&&S<=1.001&&A>=0&&A<=1.001&&(i?g++:g.push({x:C.x,y:C.y,t1:G(S,1),t2:G(A,1)}))}}return g}function d(t,r,i){t=e._path2curve(t),r=e._path2curve(r);for(var n,a,s,o,l,h,u,c,f,d,g=i?0:[],v=0,x=t.length;vi)return i;for(;ra?r=n:i=n,n=(i-r)/2+r}return n}var h=3*e,u=3*(i-e)-h,c=1-h-u,f=3*r,p=3*(n-r)-f,d=1-f-p;return o(t,1/(200*a))}function m(t,e){var r=[],i={};if(this.ms=e,this.times=1,t){for(var n in t)t[A](n)&&(i[ht(n)]=t[n],r.push(ht(n)));r.sort(Bt)}this.anim=i,this.top=r[r.length-1],this.percents=r}function b(r,i,n,a,s,o){n=ht(n);var l,h,u,c=[],f,p,d,v=r.ms,x={},m={},b={};if(a)for(w=0,B=Ee.length;wa*r.top){n=r.percents[w],p=r.percents[w-1]||0,v=v/r.top*(n-p),f=r.percents[w+1],l=r.anim[n];break}a&&i.attr(r.anim[r.percents[w]])}if(l){if(h)h.initstatus=a,h.start=new Date-h.ms*a;else{for(var C in l)if(l[A](C)&&(pt[A](C)||i.paper.customAttributes[A](C)))switch(x[C]=i.attr(C),null==x[C]&&(x[C]=ft[C]),m[C]=l[C],pt[C]){case $:b[C]=(m[C]-x[C])/v;break;case"colour":x[C]=e.getRGB(x[C]);var S=e.getRGB(m[C]);b[C]={r:(S.r-x[C].r)/v,g:(S.g-x[C].g)/v,b:(S.b-x[C].b)/v};break;case"path":var T=Qt(x[C],m[C]),E=T[1];for(x[C]=T[0],b[C]=[],w=0,B=x[C].length;w',Lt=Nt.firstChild,Lt.style.behavior="url(#default#VML)",!Lt||"object"!=typeof Lt.adj)return e.type=R;Nt=null}e.svg=!(e.vml="VML"==e.type),e._Paper=M,e.fn=N=M.prototype=e.prototype,e._id=0,e.is=function(t,e){return e=O.call(e),"finite"==e?!at[A](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||tt.call(t).slice(8,-1).toLowerCase()==e},e.angle=function(t,r,i,n,a,s){if(null==a){var o=t-i,l=r-n;return o||l?(180+180*Y.atan2(-l,-o)/U+360)%360:0}return e.angle(t,r,a,s)-e.angle(i,n,a,s)},e.rad=function(t){return t%360*U/180},e.deg=function(t){return Math.round(180*t/U%360*1e3)/1e3},e.snapTo=function(t,r,i){if(i=e.is(i,"finite")?i:10,e.is(t,Q)){for(var n=t.length;n--;)if(H(t[n]-r)<=i)return t[n]}else{t=+t;var a=r%t;if(at-i)return r-a+t}return r};var zt=e.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=16*Y.random()|0,r="x"==t?e:3&e|8;return r.toString(16)});e.setWindow=function(r){t("raphael.setWindow",e,T.win,r),T.win=r,T.doc=T.win.document,e._engine.initWin&&e._engine.initWin(T.win)};var Pt=function(t){if(e.vml){var r=/^\s+|\s+$/g,i;try{var a=new ActiveXObject("htmlfile");a.write(""),a.close(),i=a.body}catch(s){i=createPopup().document.body}var o=i.createTextRange();Pt=n(function(t){try{i.style.color=I(t).replace(r,R);var e=o.queryCommandValue("ForeColor");return e=(255&e)<<16|65280&e|(16711680&e)>>>16,"#"+("000000"+e.toString(16)).slice(-6)}catch(n){return"none"}})}else{var l=T.doc.createElement("i");l.title="Raphaël Colour Picker",l.style.display="none",T.doc.body.appendChild(l),Pt=n(function(t){return l.style.color=t,T.doc.defaultView.getComputedStyle(l,R).getPropertyValue("color")})}return Pt(t)},Ft=function(){return"hsb("+[this.h,this.s,this.b]+")"},Rt=function(){return"hsl("+[this.h,this.s,this.l]+")"},jt=function(){return this.hex},It=function(t,r,i){if(null==r&&e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,r=t.g,t=t.r),null==r&&e.is(t,Z)){var n=e.getRGB(t);t=n.r,r=n.g,i=n.b}return(t>1||r>1||i>1)&&(t/=255,r/=255,i/=255),[t,r,i]},qt=function(t,r,i,n){t*=255,r*=255,i*=255;var a={r:t,g:r,b:i,hex:e.rgb(t,r,i),toString:jt};return e.is(n,"finite")&&(a.opacity=n),a};e.color=function(t){var r;return e.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(r=e.hsb2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):e.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(r=e.hsl2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):(e.is(t,"string")&&(t=e.getRGB(t)),e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(r=e.rgb2hsl(t),t.h=r.h,t.s=r.s,t.l=r.l,r=e.rgb2hsb(t),t.v=r.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1)),t.toString=jt,t},e.hsb2rgb=function(t,e,r,i){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(r=t.b,e=t.s,i=t.o,t=t.h),t*=360;var n,a,s,o,l;return t=t%360/60,l=r*e,o=l*(1-H(t%2-1)),n=a=s=r-l,t=~~t,n+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],qt(n,a,s,i)},e.hsl2rgb=function(t,e,r,i){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(r=t.l,e=t.s,t=t.h),(t>1||e>1||r>1)&&(t/=360,e/=100,r/=100),t*=360;var n,a,s,o,l;return t=t%360/60,l=2*e*(r<.5?r:1-r),o=l*(1-H(t%2-1)),n=a=s=r-l/2,t=~~t,n+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],qt(n,a,s,i)},e.rgb2hsb=function(t,e,r){r=It(t,e,r),t=r[0],e=r[1],r=r[2];var i,n,a,s;return a=W(t,e,r),s=a-G(t,e,r),i=0==s?null:a==t?(e-r)/s:a==e?(r-t)/s+2:(t-e)/s+4,i=(i+360)%6*60/360,n=0==s?0:s/a,{h:i,s:n,b:a,toString:Ft}},e.rgb2hsl=function(t,e,r){r=It(t,e,r),t=r[0],e=r[1],r=r[2];var i,n,a,s,o,l;return s=W(t,e,r),o=G(t,e,r),l=s-o,i=0==l?null:s==t?(e-r)/l:s==e?(r-t)/l+2:(t-e)/l+4,i=(i+360)%6*60/360,a=(s+o)/2,n=0==l?0:a<.5?l/(2*a):l/(2-2*a),{h:i,s:n,l:a,toString:Rt}},e._path2string=function(){return this.join(",").replace(xt,"$1")};var Dt=e._preload=function(t,e){var r=T.doc.createElement("img");r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){e.call(this),this.onload=null,T.doc.body.removeChild(this)},r.onerror=function(){T.doc.body.removeChild(this)},T.doc.body.appendChild(r),r.src=t};e.getRGB=n(function(t){if(!t||(t=I(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:a};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:a};!(vt[A](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=Pt(t));var r,i,n,s,o,l,h,u=t.match(nt);return u?(u[2]&&(s=ut(u[2].substring(5),16),n=ut(u[2].substring(3,5),16),i=ut(u[2].substring(1,3),16)),u[3]&&(s=ut((l=u[3].charAt(3))+l,16),n=ut((l=u[3].charAt(2))+l,16),i=ut((l=u[3].charAt(1))+l,16)),u[4]&&(h=u[4][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100)),u[5]?(h=u[5][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),("deg"==h[0].slice(-3)||"°"==h[0].slice(-1))&&(i/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100),e.hsb2rgb(i,n,s,o)):u[6]?(h=u[6][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),("deg"==h[0].slice(-3)||"°"==h[0].slice(-1))&&(i/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100),e.hsl2rgb(i,n,s,o)):(u={r:i,g:n,b:s,toString:a},u.hex="#"+(16777216|s|n<<8|i<<16).toString(16).slice(1),e.is(o,"finite")&&(u.opacity=o),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:a}},e),e.hsb=n(function(t,r,i){return e.hsb2rgb(t,r,i).hex}),e.hsl=n(function(t,r,i){return e.hsl2rgb(t,r,i).hex}),e.rgb=n(function(t,e,r){function i(t){return t+.5|0}return"#"+(16777216|i(r)|i(e)<<8|i(t)<<16).toString(16).slice(1)}),e.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},r=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),r.hex},e.getColor.reset=function(){delete this.start},e.parsePathString=function(t){if(!t)return null;var r=Vt(t);if(r.arr)return Yt(r.arr);var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},n=[];return e.is(t,Q)&&e.is(t[0],Q)&&(n=Yt(t)),n.length||I(t).replace(yt,function(t,e,r){var a=[],s=e.toLowerCase();if(r.replace(bt,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(n.push([e][P](a.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)n.push([e][P](a));else for(;a.length>=i[s]&&(n.push([e][P](a.splice(0,i[s]))),i[s]););}),n.toString=e._path2string,r.arr=Yt(n),n},e.parseTransformString=n(function(t){if(!t)return null;var r={r:3,s:4,t:2,m:6},i=[];return e.is(t,Q)&&e.is(t[0],Q)&&(i=Yt(t)),i.length||I(t).replace(mt,function(t,e,r){var n=[],a=O.call(e);r.replace(bt,function(t,e){e&&n.push(+e)}),i.push([e][P](n))}),i.toString=e._path2string,i});var Vt=function(t){var e=Vt.ps=Vt.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var r in e)e[A](r)&&r!=t&&(e[r].sleep--,!e[r].sleep&&delete e[r])}),e[t]};e.findDotsAtSegment=function(t,e,r,i,n,a,s,o,l){var h=1-l,u=X(h,3),c=X(h,2),f=l*l,p=f*l,d=u*t+3*c*l*r+3*h*l*l*n+p*s,g=u*e+3*c*l*i+3*h*l*l*a+p*o,v=t+2*l*(r-t)+f*(n-2*r+t),x=e+2*l*(i-e)+f*(a-2*i+e),y=r+2*l*(n-r)+f*(s-2*n+r),m=i+2*l*(a-i)+f*(o-2*a+i),b=h*t+l*r,_=h*e+l*i,w=h*n+l*s,k=h*a+l*o,B=90-180*Y.atan2(v-y,x-m)/U;return(v>y||x=t.x&&e<=t.x2&&r>=t.y&&r<=t.y2},e.isBBoxIntersect=function(t,r){var i=e.isPointInsideBBox;return i(r,t.x,t.y)||i(r,t.x2,t.y)||i(r,t.x,t.y2)||i(r,t.x2,t.y2)||i(t,r.x,r.y)||i(t,r.x2,r.y)||i(t,r.x,r.y2)||i(t,r.x2,r.y2)||(t.xr.x||r.xt.x)&&(t.yr.y||r.yt.y)},e.pathIntersection=function(t,e){return d(t,e)},e.pathIntersectionNumber=function(t,e){return d(t,e,1)},e.isPointInsidePath=function(t,r,i){var n=e.pathBBox(t);return e.isPointInsideBBox(n,r,i)&&d(t,[["M",r,i],["H",n.x2+10]],1)%2==1},e._removedFactory=function(e){return function(){t("raphael.log",null,"Raphaël: you are calling to method “"+e+"” of removed object",e)}};var Ot=e.pathBBox=function(t){var e=Vt(t);if(e.bbox)return r(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=Qt(t);for(var i=0,n=0,a=[],s=[],o,l=0,h=t.length;l1&&(b=Y.sqrt(b),r=b*r,i=b*i);var _=r*r,w=i*i,k=(s==o?-1:1)*Y.sqrt(H((_*w-_*m*m-w*y*y)/(_*m*m+w*y*y))),B=k*r*m/i+(t+l)/2,C=k*-i*y/r+(e+h)/2,S=Y.asin(((e-C)/i).toFixed(9)),A=Y.asin(((h-C)/i).toFixed(9));S=tA&&(S-=2*U),!o&&A>S&&(A-=2*U)}var T=A-S;if(H(T)>c){var E=A,M=l,N=h;A=S+c*(o&&A>S?1:-1),l=B+r*Y.cos(A),h=C+i*Y.sin(A),p=Ut(l,h,r,i,a,0,o,M,N,[A,E,B,C])}T=A-S;var L=Y.cos(S),z=Y.sin(S),F=Y.cos(A),R=Y.sin(A),j=Y.tan(T/4),I=4/3*r*j,D=4/3*i*j,V=[t,e],O=[t+I*z,e-D*L],W=[l+I*R,h-D*F],G=[l,h];if(O[0]=2*V[0]-O[0],O[1]=2*V[1]-O[1],u)return[O,W,G][P](p);p=[O,W,G][P](p).join()[q](",");for(var X=[],$=0,Z=p.length;$"1e12"&&(c=.5),H(f)>"1e12"&&(f=.5),c>0&&c<1&&(g=$t(t,e,r,i,n,a,s,o,c),d.push(g.x),p.push(g.y)),f>0&&f<1&&(g=$t(t,e,r,i,n,a,s,o,f),d.push(g.x),p.push(g.y)),l=a-2*i+e-(o-2*a+i),h=2*(i-e)-2*(a-i),u=e-i,c=(-h+Y.sqrt(h*h-4*l*u))/2/l,f=(-h-Y.sqrt(h*h-4*l*u))/2/l,H(c)>"1e12"&&(c=.5),H(f)>"1e12"&&(f=.5),c>0&&c<1&&(g=$t(t,e,r,i,n,a,s,o,c),d.push(g.x),p.push(g.y)),f>0&&f<1&&(g=$t(t,e,r,i,n,a,s,o,f),d.push(g.x),p.push(g.y)),{min:{x:G[z](0,d),y:G[z](0,p)},max:{x:W[z](0,d),y:W[z](0,p)}}}),Qt=e._path2curve=n(function(t,e){var r=!e&&Vt(t);if(!e&&r.curve)return Yt(r.curve);for(var i=Gt(t),n=e&&Gt(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=(function(t,e,r){var i,n,a={T:1,Q:1};if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in a)&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][P](Ut[z](0,[e.x,e.y][P](t.slice(1))));break;case"S":"C"==r||"S"==r?(i=2*e.x-e.bx,n=2*e.y-e.by):(i=e.x,n=e.y),t=["C",i,n][P](t.slice(1));break;case"T":"Q"==r||"T"==r?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][P](Xt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][P](Xt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][P](Ht(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][P](Ht(e.x,e.y,t[1],e.y));break;case"V":t=["C"][P](Ht(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][P](Ht(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var r=t[e];r.length;)u[e]="A",n&&(c[e]="A"),t.splice(e++,0,["C"][P](r.splice(0,6)));t.splice(e,1),g=W(i.length,n&&n.length||0)}},h=function(t,e,r,a,s){t&&e&&"M"==t[s][0]&&"M"!=e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[s][1],r.y=t[s][2],g=W(i.length,n&&n.length||0))},u=[],c=[],f="",p="",d=0,g=W(i.length,n&&n.length||0);dn){if(r&&!c.start){if(f=ke(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p),u+=["C"+f.start.x,f.start.y,f.m.x,f.m.y,f.x,f.y],a)return u;c.start=u,u=["M"+f.x,f.y+"C"+f.n.x,f.n.y,f.end.x,f.end.y,l[5],l[6]].join(),p+=h,s=+l[5],o=+l[6];continue}if(!t&&!r)return f=ke(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p),{x:f.x,y:f.y,alpha:f.alpha}}p+=h,s=+l[5],o=+l[6]}u+=l.shift()+l}return c.end=u,f=t?p:r?c:e.findDotsAtSegment(s,o,l[0],l[1],l[2],l[3],l[4],l[5],1),f.alpha&&(f={x:f.x,y:f.y,alpha:f.alpha}),f}},Ce=Be(1),Se=Be(),Ae=Be(0,1);e.getTotalLength=Ce,e.getPointAtLength=Se,e.getSubpath=function(t,e,r){if(this.getTotalLength(t)-r<1e-6)return Ae(t,e).end;var i=Ae(t,r,1);return e?Ae(i,e).end:i},ye.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():Ce(t)},ye.getPointAtLength=function(t){var e=this.getPath();if(e)return Se(e,t)},ye.getPath=function(){var t,r=e._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return r&&(t=r(this)),t},ye.getSubpath=function(t,r){var i=this.getPath();if(i)return e.getSubpath(i,t,r)};var Te=e.easing_formulas={linear:function(t){return t},"<":function(t){return X(t,1.7)},">":function(t){return X(t,.48)},"<>":function(t){var e=.48-t/1.04,r=Y.sqrt(.1734+e*e),i=r-e,n=X(H(i),1/3)*(i<0?-1:1),a=-r-e,s=X(H(a),1/3)*(a<0?-1:1),o=n+s+.5;return 3*(1-o)*o*o+o*o*o},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:X(2,-10*t)*Y.sin((t-.075)*(2*U)/.3)+1},bounce:function(t){var e=7.5625,r=2.75,i;return t<1/r?i=e*t*t:t<2/r?(t-=1.5/r,i=e*t*t+.75):t<2.5/r?(t-=2.25/r,i=e*t*t+.9375):(t-=2.625/r,i=e*t*t+.984375),i}};Te.easeIn=Te["ease-in"]=Te["<"],Te.easeOut=Te["ease-out"]=Te[">"],Te.easeInOut=Te["ease-in-out"]=Te["<>"],Te["back-in"]=Te.backIn,Te["back-out"]=Te.backOut;var Ee=[],Me=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},Ne=function(){for(var r=+new Date,i=0;i1&&!n.next){for(v in u)u[A](v)&&(g[v]=n.totalOrigin[v]);n.el.attr(g),b(n.anim,n.el,n.anim.percents[0],null,n.totalOrigin,n.repeat-1)}n.next&&!n.stop&&b(n.anim,n.el,n.next,null,n.totalOrigin,n.repeat)}}}Ee.length&&Me(Ne)},Le=function(t){return t>255?255:t<0?0:t};ye.animateWith=function(t,r,i,n,a,s){var o=this;if(o.removed)return s&&s.call(o),o;var l=i instanceof m?i:e.animation(i,n,a,s),h,u;b(l,o,l.percents[0],null,o.attr());for(var c=0,f=Ee.length;cl&&(l=u)}l+="%",!t[l].callback&&(t[l].callback=n)}return new m(t,r)},ye.animate=function(t,r,i,n){var a=this;if(a.removed)return n&&n.call(a),a;var s=t instanceof m?t:e.animation(t,r,i,n);return b(s,a,s.percents[0],null,a.attr()),a},ye.setTime=function(t,e){return t&&null!=e&&this.status(t,G(e,t.ms)/t.ms),this},ye.status=function(t,e){var r=[],i=0,n,a;if(null!=e)return b(t,this,-1,G(e,1)),this;for(n=Ee.length;i1)for(var i=0,n=r.length;i.5)-1;l(f-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(f-.5,2))*n+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*n)}return c}),n=n.split(/\s*\-\s*/),"linear"==h){var b=n.shift();if(b=-i(b),isNaN(b))return null;var _=[0,0,a.cos(t.rad(b)),a.sin(t.rad(b))],w=1/(s(o(_[2]),o(_[3]))||1);_[2]*=w,_[3]*=w,_[2]<0&&(_[0]=-_[2],_[2]=0),_[3]<0&&(_[1]=-_[3],_[3]=0)}var k=t._parseDots(n);if(!k)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&u!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){y=v(h+"Gradient",{id:u}),e.gradient=y,v(y,"radial"==h?{fx:f,fy:p}:{x1:_[0],y1:_[1],x2:_[2],y2:_[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(y);for(var B=0,C=k.length;B1?z.opacity/100:z.opacity});case"stroke":z=t.getRGB(g),l.setAttribute(d,z.hex),"stroke"==d&&z[e]("opacity")&&v(l,{"stroke-opacity":z.opacity>1?z.opacity/100:z.opacity}),"stroke"==d&&i._.arrows&&("startString"in i._.arrows&&_(i,i._.arrows.startString),"endString"in i._.arrows&&_(i,i._.arrows.endString,1));break;case"gradient":("circle"==i.type||"ellipse"==i.type||"r"!=r(g).charAt())&&x(i,g);break;case"opacity":u.gradient&&!u[e]("stroke-opacity")&&v(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){P=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c)),P&&(F=P.getElementsByTagName("stop"),v(F[F.length-1],{"stop-opacity":g}));break}default:"font-size"==d&&(g=n(g,10)+"px");var R=d.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[R]=g,i._.dirty=1,l.setAttribute(d,g)}}S(i,a),l.style.visibility=f},C=1.2,S=function(i,a){if("text"==i.type&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var s=i.attrs,o=i.node,l=o.firstChild?n(t._g.doc.defaultView.getComputedStyle(o.firstChild,c).getPropertyValue("font-size"),10):10;if(a[e]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var h=r(a.text).split("\n"),u=[],f,p=0,d=h.length;p"));var Z=X.getBoundingClientRect();m.W=f.w=(Z.right-Z.left)/U,m.H=f.h=(Z.bottom-Z.top)/U,m.X=f.x,m.Y=f.y+m.H/2,("x"in l||"y"in l)&&(m.path.v=t.format("m{0},{1}l{2},{1}",a(f.x*b),a(f.y*b),a(f.x*b)+1));for(var Q=["x","y","text","font","font-family","font-weight","font-style","font-size"],J=0,K=Q.length;J.25&&(r=n.sqrt(.25-l(e-.5,2))*(2*(r>.5)-1)+.5),f=e+p+r),d}),a=a.split(/\s*\-\s*/),"linear"==c){var g=a.shift();if(g=-i(g),isNaN(g))return null}var v=t._parseDots(a);if(!v)return null;if(e=e.shape||e.node,v.length){e.removeChild(s),s.on=!0,s.method="none",s.color=v[0].color,s.color2=v[v.length-1].color;for(var x=[],y=0,m=v.length;y')}}catch(r){N=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),r=e.container,i=e.height,n,a=e.width,s=e.x,o=e.y;if(!r)throw new Error("VML container not found.");var l=new t._Paper,h=l.canvas=t._g.doc.createElement("div"),u=h.style;return s=s||0,o=o||0,a=a||512,i=i||342,l.width=a,l.height=i,a==+a&&(a+="px"),i==+i&&(i+="px"),l.coordsize=1e3*b+p+1e3*b,l.coordorigin="0 0",l.span=t._g.doc.createElement("span"),l.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",h.appendChild(l.span),u.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",a,i),1==r?(t._g.doc.body.appendChild(h),u.left=s+"px",u.top=o+"px",u.position="absolute"):r.firstChild?r.insertBefore(h,r.firstChild):r.appendChild(h),l.renderfix=function(){},l},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=d,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var L=t.st;for(var z in M)M[e](z)&&!L[e](z)&&(L[z]=function(t){return function(){var e=arguments;return this.forEach(function(r){r[t].apply(r,e)})}}(z))}}.apply(e,i),!(void 0!==n&&(t.exports=n))}])});; /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.6 * * Requires: 1.2.2+ */ (function(d){var b=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks){for(var a=b.length;a;){d.event.fixHooks[b[--a]]=d.event.mouseHooks}}d.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var e=b.length;e;){this.addEventListener(b[--e],c,false)}}else{this.onmousewheel=c}},teardown:function(){if(this.removeEventListener){for(var e=b.length;e;){this.removeEventListener(b[--e],c,false)}}else{this.onmousewheel=null}}};d.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}});function c(j){var h=j||window.event,g=[].slice.call(arguments,1),k=0,i=true,f=0,e=0;j=d.event.fix(h);j.type="mousewheel";if(h.wheelDelta){k=h.wheelDelta/120}if(h.detail){k=-h.detail/3}e=k;if(h.axis!==undefined&&h.axis===h.HORIZONTAL_AXIS){e=0;f=-1*k}if(h.wheelDeltaY!==undefined){e=h.wheelDeltaY/120}if(h.wheelDeltaX!==undefined){f=-1*h.wheelDeltaX/120}g.unshift(j,k,f,e);return(d.event.dispatch||d.event.handle).apply(this,g)}})(jQuery);;(function($){var mapSVG={};function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n);} function ucfirst(string){return string.charAt(0).toUpperCase()+string.slice(1);} function parseBoolean(string){switch(String(string).toLowerCase()){case"on":case"true":case"1":case"yes":case"y":return true;case"off":case"false":case"0":case"no":case"n":return false;default:return undefined;}} function safeURL(url){if(url.indexOf('http://')==0||url.indexOf('https://')==0) url="//"+url.split("://").pop();return url;} function extend(sub,base){sub.prototype=Object.create(base.prototype);sub.prototype.constructor=sub;} function MapObject(){this.id="";} MapObject.prototype.getComputedStyle=function(prop,node){node=node||this.node[0];if(_p1=node.getAttribute(prop)){return _p1;}else if(_p2=node.getAttribute('style')){var s=_p2.split(';');var z=s.filter(function(e){var e=e.trim();var attr=e.split(':');if(attr[0]==prop) return true;});if(z.length){return z[0].split(':').pop().trim();}} var parent=$(node).parent();var nodeType=parent.length?parent[0].tagName:null;if(nodeType&&nodeType!='svg') return this.getComputedStyle(prop,parent[0]);else return undefined;};MapObject.prototype.getStyle=function(prop){if(_p1=this.attr(prop)){return _p1;}else if(_p2=this.attr('style')){var s=_p2.split(';');var z=s.filter(function(e){var e=e.trim();if(e.indexOf(prop)===0) return e;});return z.length?z[0].split(':').pop().trim():undefined;} return"";};MapObject.prototype.getCenter=function(){var x=this.node[0].getBoundingClientRect().left;var y=this.node[0].getBoundingClientRect().top;var w=this.node[0].getBoundingClientRect().width;var h=this.node[0].getBoundingClientRect().height;return[x+w/2,y+h/2];};MapObject.prototype.setTooltip=function(text){this.tooltip=text?text:undefined;};MapObject.prototype.setPopover=function(text){this.popover=text?text:undefined;};MapObject.prototype.setHref=function(url){if(this.href&&this.node.parent('a').length) this.node.unwrap();this.href=url?url:undefined;if(this.href){var xlinkNS="http://www.w3.org/1999/xlink",svgNS="http://www.w3.org/2000/svg";var a=document.createElementNS(svgNS,"a");a.setAttributeNS(xlinkNS,"href",this.href);if(this.target) a.setAttribute("target",this.target);this.node.wrap($(a));}};MapObject.prototype.setTarget=function(target){this.target=target?target:undefined;if(this.href) var a=this.node.parent('a')[0];else return;this.target?a.setAttribute("target",target):a.removeAttribute("target");};MapObject.prototype.setData=function(data){if(data){if(typeof data=='string'){if(data.substr(0,1)=='['||data.substr(0,1)=='{'){try{var tmp;eval('tmp = '+data);this.data=tmp;}catch(err){var error="MapSVG: Error in Data object for "+this.mapsvg_type+" '"+this.id+"'. Data object was set to empty object {}.";this.data={};return{_error:error};}}else{this.data=data;}}else{this.data=data;} return this.data;}else{this.data=undefined;}};MapObject.prototype.attr=function(v1,v2){var svgDom=this.node[0];if(typeof v1=="object"){$.each(v1,function(key,item){if(typeof item=="string"||typeof item=="number"){svgDom.setAttribute(key,item);}});} else if(typeof v1=="string"&&(typeof v2=="string"||typeof v2=="number")){svgDom.setAttribute(v1,v2);} else if(v2==undefined){return svgDom.getAttribute(v1);}};MapObject.prototype.setId=function(id){if(!id)return false;this.id=id;this.node[0].setAttribute('id',id);};function Region(jQueryObject,globalOptions,regionID,mapsvg){MapObject.call(this);this.node=jQueryObject;this.nodeType=jQueryObject[0].tagName;this.globalOptions=globalOptions;this.mapsvg=mapsvg;this.id=this.node.attr('id');if(!this.id){this.setId(this.nodeType+'_'+regionID.id++);this.autoID=true;} this.id_no_spaces=this.id.replace(' ','_');this.title=this.node.attr('title');this.node[0].setAttribute('class','mapsvg-region');this.svg_style={fill:this.getComputedStyle('fill')};this.svg_style.stroke=this.getComputedStyle('stroke');if(!_browser.ie) this.node.css({'vector-effect':'non-scaling-stroke'});else{var w=this.getComputedStyle('stroke-width');w=w?w.replace('px',''):'1';w=w=="1"?1.2:parseFloat(w);this.svg_style['stroke-width']=w;} var regionOptions=globalOptions.regions&&globalOptions.regions[this.id]?globalOptions.regions[this.id]:null;this.disabled=this.getDisabledState();this.disabled&&this.attr('class',this.attr('class')+' mapsvg-disabled');this.default_attr={};this.selected_attr={};this.hover_attr={};this.mapsvg_type='region';var selected=false;if(regionOptions&®ionOptions.selected){selected=true;delete regionOptions.selected;} regionOptions&&this.update(regionOptions);this.setFill();if(selected) this.setSelected(true);this.saveState();} extend(Region,MapObject);Region.prototype.saveState=function(){this.initialState=JSON.stringify(this.getOptions());};Region.prototype.changed=function(){return JSON.stringify(this.getOptions())!=this.initialState;};Region.prototype.getOptions=function(forTemplate){var globals=this.globalOptions.regions[this.id];var o={id:this.id,id_no_spaces:this.id_no_spaces,title:this.title,disabled:this.disabled===this.getDisabledState(true)?undefined:this.disabled,fill:this.globalOptions.regions[this.id]&&this.globalOptions.regions[this.id].fill,tooltip:this.tooltip,popover:this.popover,href:this.href,target:this.target,data:this.data,gaugeValue:this.gaugeValue};if(forTemplate) o.disabled=this.disabled;$.each(o,function(key,val){if(val==undefined){delete o[key];}});return o;};Region.prototype.update=function(options){for(var key in options){var setter='set'+ucfirst(key);if(setter in this) this[setter](options[key]);}};Region.prototype.setFill=function(fill){if(fill){regions={};regions[this.id]={fill:fill};$.extend(true,this.globalOptions,{regions:regions});}else if(fill==""&&this.globalOptions.regions&&this.globalOptions.regions[this.id]&&this.globalOptions.regions[this.id].fill){delete this.globalOptions.regions[this.id].fill;} if(this.globalOptions.gauge.on&&this.gaugeValue){var o=this.globalOptions.gauge;var w=(this.gaugeValue-o.min)/o.maxAdjusted;var rgb={r:Math.round(o.colors.diffRGB.r*w+o.colors.lowRGB.r),g:Math.round(o.colors.diffRGB.g*w+o.colors.lowRGB.g),b:Math.round(o.colors.diffRGB.b*w+o.colors.lowRGB.b),a:Math.round(o.colors.diffRGB.a*w+o.colors.lowRGB.a)};this.default_attr['fill']='rgba('+rgb.r+','+rgb.g+','+rgb.b+','+rgb.a+')';}else if(this.globalOptions.regions[this.id]&&this.globalOptions.regions[this.id].fill){this.default_attr['fill']=this.globalOptions.regions[this.id].fill;}else if(this.disabled&&this.globalOptions.colors.disabled){this.default_attr['fill']=this.globalOptions.colors.disabled;}else if(this.globalOptions.colors.base){this.default_attr['fill']=this.globalOptions.colors.base;}else if(this.svg_style.fill!='none'){this.default_attr['fill']=this.svg_style.fill?this.svg_style.fill:this.globalOptions.colors.baseDefault;}else{this.default_attr['fill']='none';} if(isNumber(this.globalOptions.colors.selected)) this.selected_attr['fill']=tinycolor(this.default_attr.fill).lighten(parseFloat(this.globalOptions.colors.selected)).toRgbString();else this.selected_attr['fill']=this.globalOptions.colors.selected;if(isNumber(this.globalOptions.colors.hover)) this.hover_attr['fill']=tinycolor(this.default_attr.fill).lighten(parseFloat(this.globalOptions.colors.hover)).toRgbString();else this.hover_attr['fill']=this.globalOptions.colors.hover;this.node.css('fill',this.default_attr['fill']);this.fill=this.default_attr['fill'];if(this.svg_style.stroke!='none'&&this.globalOptions.colors.stroke!=undefined) this.node.css('stroke',this.globalOptions.colors.stroke);else this.node.css('stroke',this.svg_style.stroke);if(this.selected) this.select();};Region.prototype.setDisabled=function(on){on=on!==undefined?parseBoolean(on):this.getDisabledState();this.disabled=on;on?this.attr('class',this.attr('class')+' mapsvg-disabled'):this.attr('class',this.attr('class').replace(' mapsvg-disabled',''));this.selected=false;this.setFill();};Region.prototype.setSelected=function(on){this.mapsvg.selectRegion(this);};Region.prototype.setGaugeValue=function(val){this.gaugeValue=$.isNumeric(val)?parseFloat(val):undefined;};Region.prototype.getDisabledState=function(asDefault){var opts=this.globalOptions.regions[this.id];if(!asDefault&&opts&&opts.disabled!==undefined){return opts.disabled;}else if(this.globalOptions.disableAll||this.svg_style.fill=='none'||this.id=='labels'||this.id=='Labels'){return true;}else{return false;}};Region.prototype.highlight=function(){this.node.css({'fill':this.hover_attr.fill});};Region.prototype.unhighlight=function(){this.node.css({'fill':this.default_attr.fill});};Region.prototype.select=function(){this.node.css({'fill':this.selected_attr.fill});this.selected=true;};Region.prototype.deselect=function(){this.node.css({'fill':this.default_attr.fill});this.selected=false;};function Marker(options,scale){if(!options.id||!options.src)return false;MapObject.call(this);var img=document.createElementNS('http://www.w3.org/2000/svg','image');img.setAttributeNS(null,'height',options.height);img.setAttributeNS(null,'width',options.width);img.setAttributeNS('http://www.w3.org/1999/xlink','href',options.src);img.setAttributeNS(null,'x',options.x);img.setAttributeNS(null,'y',options.y);img.setAttributeNS(null,'visibility','visible');img.setAttribute('class','mapsvg-marker');this.node=$(img);this.src=options.src;this.setId(options.id);this.mapsvg_type='marker';this.x=parseFloat(options.x);this.y=parseFloat(options.y);this.width=parseFloat(options.width);this.height=parseFloat(options.height);this.tooltip=options.tooltip;this.popover=options.popover;this.href=options.href;this.target=options.target;this.default={x:this.x,y:this.y,width:this.width,height:this.height};this.geoCoords=options.geoCoords;this.data=options.data;} extend(Marker,MapObject);Marker.prototype.getOptions=function(){var o={id:this.id,tooltip:this.tooltip,popover:this.popover,href:this.href,target:this.target,data:this.data,src:this.src,width:this.default.width,height:this.default.height,x:this.x,y:this.y,geoCoords:this.geoCoords};$.each(o,function(key,val){if(val==undefined){delete o[key];}});return o;};Marker.prototype.setXY=function(x,y){this.x=x;this.y=y;this.node[0].setAttribute('x',x);this.node[0].setAttribute('y',y);this.adjustPosition(this.mapScale);};Marker.prototype.update=function(data,mapScale){for(var key in data){var setter='set'+ucfirst(key);if(setter in this) this[setter](data[key],mapScale);}};Marker.prototype.setSrc=function(src,mapScale){if(!src) return false;src=safeURL(src);mapScale=mapScale||this.mapScale;var img=new Image();var marker=this;img.onload=function(){marker.default.width=this.width;marker.default.height=this.height;marker.x=marker.x-(this.width-marker.width)/2;marker.y=marker.y-(this.height-marker.height);marker.attr({x:marker.x,y:marker.y,width:this.width,height:this.height});marker.width=this.width;marker.height=this.height;marker.node[0].setAttributeNS('http://www.w3.org/1999/xlink','href',src);marker.adjustPosition(mapScale);marker.src=src;};img.src=src;};Marker.prototype.adjustPosition=function(mapScale){var w=this.default.width;var h=this.default.height;var dx=w/2-w/(2*mapScale);var dy=h-h/mapScale;this.attr('width',w/(mapScale));this.attr('height',h/(mapScale));this.attr('transform','translate('+dx+','+dy+')');this.mapScale=mapScale;};Marker.getDefaultCoords=function(markerX,markerY,markerWidth,markerHeight,mapScale){markerX=parseFloat(markerX);markerY=parseFloat(markerY);markerWidth=parseFloat(markerWidth);markerHeight=parseFloat(markerHeight);markerX=markerX+markerWidth/(2*mapScale)-markerWidth/2;markerY=markerY+markerHeight/mapScale-markerHeight;return[markerX,markerY];};Marker.prototype.drag=function(startCoords,scale,endCallback,clickCallback){_this=this;this.ox=this.x;this.oy=this.y;$('body').on('mousemove.drag.mapsvg',function(e){e.preventDefault();var mouseNew=mouseCoords(e);var dx=mouseNew.x-startCoords.x;var dy=mouseNew.y-startCoords.y;_this.x=_this.ox+dx/scale;_this.y=_this.oy+dy/scale;_this.attr({x:_this.x,y:_this.y});});$('body').on('mouseup.drag.mapsvg',function(e){e.preventDefault();_this.undrag();var mouseNew=mouseCoords(e);var dx=mouseNew.x-startCoords.x;var dy=mouseNew.y-startCoords.y;_this.x=_this.ox+dx/scale;_this.y=_this.oy+dy/scale;_this.attr({x:_this.x,y:_this.y});endCallback.call(_this);if(_this.ox==_this.x&&_this.oy==_this.y) clickCallback.call(_this);});};Marker.prototype.undrag=function(){$('body').off('.drag.mapsvg');};Marker.prototype.delete=function(){if(this.href) this.node.parent('a').empty().remove();this.node.empty().remove();};var instances={};var globalID=0;var userAgent=navigator.userAgent.toLowerCase();var scripts=document.getElementsByTagName('script');var myScript=scripts[scripts.length-1].src.split('/');myScript.pop();var pluginJSURL=myScript.join('/')+'/';myScript.pop();var pluginRootURL=myScript.join('/')+'/';var touchDevice=(userAgent.indexOf("ipad")>-1)||(userAgent.indexOf("iphone")>-1)||(userAgent.indexOf("ipod")>-1)||(userAgent.indexOf("android")>-1);var _browser={};_browser.ie=userAgent.indexOf("msie")>-1||userAgent.indexOf("trident")>-1||userAgent.indexOf("edge")>-1?{}:false;_browser.firefox=userAgent.indexOf("firefox")>-1;if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'');};} var mouseCoords=function(e){if(e.clientX){return{'x':e.clientX+$(document).scrollLeft(),'y':e.clientY+$(document).scrollTop()};}if(e.pageX){return{'x':e.pageX,'y':e.pageY};}else if(touchDevice){e=e.originalEvent;return e.touches&&e.touches[0]?{'x':e.touches[0].pageX,'y':e.touches[0].pageY}:{'x':e.changedTouches[0].pageX,'y':e.changedTouches[0].pageY};}};var defaults={markerLastID:0,regionLastID:0,disableAll:false,width:null,height:null,lockAspectRatio:true,loadingText:'Loading map...',colors:{baseDefault:"#000000",background:"#eeeeee",selected:40,hover:20},regions:{},markers:[],viewBox:[],cursor:'default',onClick:null,mouseOver:null,mouseOut:null,beforeLoad:null,afterLoad:null,zoom:{on:false,limit:[0,10],delta:1.2,buttons:{on:true,location:'right'},mousewheel:true},scroll:{on:false,limit:false,background:false},responsive:true,tooltips:{mode:'off',on:false,priority:'local',position:'bottom-right'},popovers:{mode:"off",on:false,priority:'local',position:'top'},multiSelect:false,gauge:{on:false,labels:{low:"low",high:"high"},colors:{lowRGB:null,highRGB:null,low:"#550000",high:"#ee0000"},min:0,max:0},menu:{on:false,containerId:"mapsvg-menu-regions",template:function(region){return'
  • '+(region.title||region.id)+'
  • '}},menuMarkers:{on:false,containerId:"mapsvg-menu-markers",template:function(marker){return'
  • '+marker.id+'
  • '}}};var markerOptions={'src':pluginRootURL+'markers/pin1_red.png'};mapSVG=function(elem,options){var _data;this.methods={mouseCoords:mouseCoords,functionFromString:function(string){var func;var error=false;var fn=string;if(fn.indexOf("{")==-1||fn.indexOf("function")==-1||fn.indexOf("(")==-1){return{error:"MapSVG user function error: no function body."};} var fnBody=fn.substring(fn.indexOf("{")+1,fn.lastIndexOf("}"));var params=fn.substring(fn.indexOf("(")+1,fn.indexOf(")"));try{func=new Function(params,fnBody);success=true;}catch(err){error=err;} if(!error) return func;else return{error:{line:error.line,text:"MapSVG user function error: (line "+error.line+"): "+error.message}};},getOptions:function(forTemplate,forWeb){var options=$.extend(true,{},_data.options);options.viewBox=_data._viewBox;delete options.markers;if(forTemplate){options.regions=[];_data.regions.forEach(function(r){options.regions.push(r.getOptions());});options.markers=_data.options.markers;}else{_data.regions.forEach(function(r){r.changed()&&(options.regions[r.id]=r.getOptions());});if(_data.markers.length>0) options.markers=[];_data.markers.forEach(function(m){options.markers.push(m.getOptions());});} if(forWeb) $.each(options,function(key,val){if(JSON.stringify(val)==JSON.stringify(defaults[key])) delete options[key];});return options;},update:function(options){for(var key in options){if(key=="regions"){$.each(options.regions,function(id,regionOptions){var region=_this.getRegion(id);region&®ion.update(regionOptions);if(regionOptions.gaugeValue!=undefined){_this.updateGaugeMinMax();_this.regionsRedrawColors();} if(regionOptions.disabled!=undefined){_this.deselectRegion(region);_data.options.regions[id]=_data.options.regions[id]||{};_data.options.regions[id].disabled=region.disabled;}});}else if(key=="markers"){$.each(options.markers,function(id,markerOptions){var marker=_this.getMarker(id);if(markerOptions.geoCoords){if(typeof markerOptions.geoCoords=="string"){markerOptions.geoCoords=markerOptions.geoCoords.trim().split(',');markerOptions.geoCoords=[parseFloat(markerOptions.geoCoords[0]),parseFloat(markerOptions.geoCoords[1])];} if(typeof markerOptions.geoCoords=='object'&&markerOptions.geoCoords.length==2){if($.isNumeric(markerOptions.geoCoords[0])&&$.isNumeric(markerOptions.geoCoords[1])){var xy=_this.convertGeoToPixel(markerOptions.geoCoords);xy[0]=xy[0]-marker.width/2+.3;xy[1]=(xy[1]-marker.height)+1.5;marker.setXY(xy[0],xy[1]);}}}else{marker&&marker.update(markerOptions);}});}else{var setter='set'+ucfirst(key);if(_this.hasOwnProperty(setter)) this[setter](options[key]);else console.log('MapSVG Error: no setter '+setter+'()');}}},setTitle:function(title){title&&(_data.options.title=title);},setDisableLinks:function(on){on=parseBoolean(on);if(on){_data.$map.on('click.a.mapsvg','a',function(e){e.preventDefault();});}else{_data.$map.off('click.a.mapsvg');} _data.disableLinks=on;},setLoadingText:function(val){_data.options.loadingText=val},setLockAspectRatio:function(val){_data.options.lockAspectRatio=parseBoolean(val);},setOnClick:function(h){_data.options.onClick=h||undefined;},setMouseOver:function(h){_data.options.mouseOver=h||undefined;},setMouseOut:function(h){_data.options.mouseOut=h||undefined;},setBeforeLoad:function(h){_data.options.beforeLoad=h||undefined;},setAfterLoad:function(h){_data.options.afterLoad=h||undefined;},setMarkerEditHandler:function(handler){_data.markerEditHandler=handler;},setRegionEditHandler:function(handler){_data.regionEditHandler=handler;},setDisableAll:function(on){on=parseBoolean(on);$.extend(true,_data.options,{disableAll:on});_data.regions.forEach(function(r){r.setDisabled();});},setColors:function(colors){$.extend(true,_data.options,{colors:colors});$.each(_data.options.colors,function(key,color){if(color===null||color=="") delete color[key];});if(colors.background) _data.$map.css({'background':_data.options.colors.background});if(colors.hover) _data.options.colors.hover=(colors.hover==""+parseInt(colors.hover))?parseInt(colors.hover):colors.hover;if(colors.selected) _data.options.colors.selected=(colors.selected==""+parseInt(colors.selected))?parseInt(colors.selected):colors.selected;_this.regionsRedrawColors();},setTooltips:function(options){if(typeof options.mode=="string"&&options.mode.indexOf("function")==0) options.mode=_this.functionFromString(options.mode);_data.options.tooltips.on=_data.options.tooltips.mode!='off';$.extend(true,_data.options,{tooltips:options});if(!_data.mapTip){_data.mapTip=$('
    ').addClass('mapsvg-tooltip');$("body").append(_data.mapTip);} var event='mousemove.tooltip.mapsvg-'+_data.$map.attr('id');$('body').off(event);var tip=_data.mapTip[0];switch(_data.options.tooltips.position){case'bottom-right':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=(e.clientX+$(window).scrollLeft())+'px';tip.style.top=(e.clientY+$(window).scrollTop()+25)+'px';});break;case'bottom-left':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=(e.clientX+$(window).scrollLeft()-tip.offsetWidth+10)+'px';tip.style.top=(e.clientY+$(window).scrollTop()+25)+'px';});break;case'bottom':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=e.clientX+$(window).scrollLeft()-tip.offsetWidth/2+'px';tip.style.top=e.clientY+$(window).scrollTop()+25+'px';});break;case'top':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=e.clientX+$(window).scrollLeft()-tip.offsetWidth/2+'px';tip.style.top=e.clientY+$(window).scrollTop()-tip.offsetHeight-10+'px';});break;case'top-right':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=e.clientX+$(window).scrollLeft()+'px';tip.style.top=e.clientY+$(window).scrollTop()-tip.offsetHeight-10+'px';});break;case'top-left':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=e.clientX+$(window).scrollLeft()-tip.offsetWidth+10+'px';tip.style.top=e.clientY+$(window).scrollTop()-tip.offsetHeight-10+'px';});break;case'left':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=e.clientX+$(window).scrollLeft()-tip.offsetWidth-10+'px';tip.style.top=e.clientY+$(window).scrollTop()-tip.offsetHeight/2+'px';});break;case'right':$('body').on(event,function(e){window.m=mouseCoords(e);tip.style.left=e.clientX+$(window).scrollLeft()+15+'px';tip.style.top=e.clientY+$(window).scrollTop()-tip.offsetHeight/2+'px';});break;}},setPopovers:function(options){if(typeof options.mode=="string"&&options.mode.indexOf("function")==0){options.mode=_this.functionFromString(options.mode);} $.extend(true,_data.options,{popovers:options});_data.options.popovers.on=_data.options.popovers.mode!='off';if(!_data.mapPopover){_data.mapPopover=$('
    ').addClass('mapsvg-popover');_data.mapPopover.closeButton=$('
    ');_data.mapPopover.contentDiv=$('
    ');_data.mapPopover.append(_data.mapPopover.contentDiv);_data.mapPopover.append(_data.mapPopover.closeButton);_data.mapPopover.css({width:_data.options.popovers.width+(_data.options.popovers.width=='auto'?'':'px'),height:_data.options.popovers.height+(_data.options.popovers.height=='auto'?'':'px')});_data.mapPopover.closeButton.on('click',_this.hidePopover);$("body").append(_data.mapPopover);} $('body').off('.popover.mapsvg',_this.popoverOffHandler);if(!touchDevice) $('body').on('mousedown.popover.mapsvg',_this.popoverOffHandler);},setInitialViewBox:function(v){if(typeof v=='string') v=v.trim().split(' ');_data._viewBox=[parseFloat(v[0]),parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])];_data.zoomLevel=0;},setViewBox:function(v,skipAdjustments){if(typeof v=='string'){v=v.trim().split(' ');} var d=(v&&v.length==4)?v:_data.svgDefault.viewBox;var isZooming=parseInt(d[2])!=_data.viewBox[2]||parseInt(d[3])!=_data.viewBox[3];_data.viewBox=[parseFloat(d[0]),parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])];if(!v){_data._viewBox=_data.viewBox;_data._scale=1;} _data.$svg[0].setAttribute('viewBox',_data.viewBox.join(' '));_this.setResponsive(_data.options.responsive,true);if(isZooming&&!skipAdjustments){_data.scale=_this.getScale();_this.markersAdjustPosition();if(_browser.ie){_this.mapAdjustStrokes();}} return true;},redraw:function(){_data.$map.css({width:_data.$map.width(),height:_data.$map.width()/_data.whRatio});if(!_browser.ie){_data.$map.css({width:'auto',height:'auto'});}else{_data.$map.css({width:'auto'});} _this.updateSize();},setSize:function(width,height,responsive){_data.options.width=parseFloat(width);_data.options.height=parseFloat(height);_data.options.responsive=responsive!=null?parseBoolean(responsive):_data.options.responsive;if((!_data.options.width&&!_data.options.height)){_data.options.width=_data.svgDefault.width;_data.options.height=_data.svgDefault.height;}else if(!_data.options.width&&_data.options.height){_data.options.width=parseInt(_data.options.height*_data.svgDefault.width/_data.svgDefault.height);}else if(_data.options.width&&!_data.options.height){_data.options.height=parseInt(_data.options.width*_data.svgDefault.height/_data.svgDefault.width);} _data.whRatio=_data.options.width/_data.options.height;_data.scale=_this.getScale();_this.setResponsive(responsive);if(_data.markers) _this.markersAdjustPosition();return[_data.options.width,_data.options.height];},setResponsive:function(on,force){on=on!=undefined?parseBoolean(on):_data.options.responsive;$(window).off('resize.mapsvg');if(on){$(window).on('resize.mapsvg',_this.updateSize);if(!_data.$map.hasClass('mapsvg-responsive')){_data.$map.addClass('mapsvg-responsive');_data.$map.css({'width':'auto','height':'auto'});} _data.$map.height(_data.$map.width()/_data.whRatio);$(window).on('resize.mapsvg',function(){_data.$map.height(_data.$map.width()/_data.whRatio);_this.updateSize();});}else{_data.$map.removeClass('mapsvg-responsive');_data.$map.css({'width':_data.options.width+'px','height':_data.options.height+'px'});} $.extend(true,_data.options,{responsive:on});_this.updateSize();},setScroll:function(options){options.on!=null&&(options.on=parseBoolean(options.on));options.limit!=null&&(options.limit=parseBoolean(options.limit));$.extend(true,_data.options,{scroll:options});_this.setEventHandlers();},setZoom:function(options){options=options||{};options.on!=undefined&&(options.on=parseBoolean(options.on));options.mousewheel!=undefined&&(options.mousewheel=parseBoolean(options.mousewheel));options.delta&&(options.delta=parseFloat(options.delta));if(options.limit){if(typeof options.limit=='string') options.limit=options.limit.split(';');options.limit=[parseInt(options.limit[0]),parseInt(options.limit[1])];} $.extend(true,_data.options,{zoom:options});_data.$map.off('mousewheel.mapsvg');if(_data.options.zoom.on&&_data.options.zoom.mousewheel){_data.$map.on('mousewheel.mapsvg',function(event,delta,deltaX,deltaY){var d=delta>0?1:-1;_this.zoom(d);return false;});} _this.setZoomButtons();},setZoomButtons:function(){var loc=_data.options.zoom.buttons.location||'hide';if(!_data.zoomButtons){var buttons=$('
    ').addClass('mapsvg-buttons');buttons.zoomIn=$('
    ').addClass('mapsvg-btn-zoom in');var event=touchDevice?'touchstart':'click';buttons.zoomIn.on(event,function(e){e.stopPropagation();_this.zoomIn();});buttons.zoomOut=$('
    ').addClass('mapsvg-btn-zoom out');buttons.zoomOut.on(event,function(e){e.stopPropagation();_this.zoomOut();});buttons.append(buttons.zoomIn).append(buttons.zoomOut);_data.zoomButtons=buttons;_data.$map.append(_data.zoomButtons);} _data.zoomButtons.removeClass('left');_data.zoomButtons.removeClass('right');loc=='right'&&_data.zoomButtons.addClass('right')||loc=='left'&&_data.zoomButtons.addClass('left');(_data.options.zoom.on&&loc!='hide')?_data.zoomButtons.show():_data.zoomButtons.hide();},setCursor:function(type){type=type=='pointer'?'pointer':'default';_data.options.cursor=type;if(type=='pointer') _data.$map.addClass('mapsvg-cursor-pointer');else _data.$map.removeClass('mapsvg-cursor-pointer');},setPreloaderText:function(text){_data.options.loadingText=text;},setMultiSelect:function(on){_data.options.multiSelect=parseBoolean(on);_this.deselectAllRegions();},setGauge:function(options){options=options||_data.options.gauge;options.on!=undefined&&(options.on=parseBoolean(options.on));$.extend(true,_data.options,{gauge:options});var needsRedraw=false;if(!_data.$gauge){_data.$gauge={};_data.$gauge.gradient=$(' ').addClass('mapsvg-gauge-gradient');_this.setGaugeGradientCSS();_data.$gauge.container=$('
    ').addClass('mapsvg-gauge').hide();_data.$gauge.table=$('');var tr=$('');_data.$gauge.labelLow=$('');_data.$gauge.labelHigh=$('');tr.append(_data.$gauge.labelLow);tr.append(_data.$gauge.gradient);tr.append(_data.$gauge.labelHigh);_data.$gauge.table.append(tr);_data.$gauge.container.append(_data.$gauge.table);_data.$map.append(_data.$gauge.container);} if(!_data.options.gauge.on&&_data.$gauge.container.is(":visible")){_data.$gauge.container.hide();needsRedraw=true;}else if(_data.options.gauge.on&&!_data.$gauge.container.is(":visible")){_data.$gauge.container.show();needsRedraw=true;} if(options.colors){_data.options.gauge.colors.lowRGB=tinycolor(_data.options.gauge.colors.low).toRgb();_data.options.gauge.colors.highRGB=tinycolor(_data.options.gauge.colors.high).toRgb();_data.options.gauge.colors.diffRGB={r:_data.options.gauge.colors.highRGB.r-_data.options.gauge.colors.lowRGB.r,g:_data.options.gauge.colors.highRGB.g-_data.options.gauge.colors.lowRGB.g,b:_data.options.gauge.colors.highRGB.b-_data.options.gauge.colors.lowRGB.b,a:_data.options.gauge.colors.highRGB.a-_data.options.gauge.colors.lowRGB.a};needsRedraw=true;_data.$gauge&&_this.setGaugeGradientCSS();} if(options.labels){_data.$gauge.labelLow.html(_data.options.gauge.labels.low);_data.$gauge.labelHigh.html(_data.options.gauge.labels.high);} needsRedraw&&_this.redrawGauge();},redrawGauge:function(){_this.updateGaugeMinMax();_this.regionsRedrawColors();},updateGaugeMinMax:function(){_data.options.gauge.min=0;_data.options.gauge.max=false;var values=[];_data.regions.forEach(function(r){if(r.gaugeValue!=null&&r.gaugeValue!=undefined)values.push(r.gaugeValue);});if(values.length>0){_data.options.gauge.min=values.length==1?0:Math.min.apply(null,values);_data.options.gauge.max=Math.max.apply(null,values);_data.options.gauge.maxAdjusted=_data.options.gauge.max-_data.options.gauge.min;}},setGaugeGradientCSS:function(){_data.$gauge.gradient.css({background:_data.options.gauge.colors.low,background:'-moz-linear-gradient(left, '+_data.options.gauge.colors.low+' 1%,'+_data.options.gauge.colors.high+' 100%)',background:'-webkit-gradient(linear, left top, right top, color-stop(1%,'+_data.options.gauge.colors.low+'), color-stop(100%,'+_data.options.gauge.colors.high+'))',background:'-webkit-linear-gradient(left, '+_data.options.gauge.colors.low+' 1%,'+_data.options.gauge.colors.high+' 100%)',background:'-o-linear-gradient(left, '+_data.options.gauge.colors.low+' 1%,'+_data.options.gauge.colors.high+' 100% 100%)',background:'-ms-linear-gradient(left, '+_data.options.gauge.colors.low+' 1%,'+_data.options.gauge.colors.high+' 100% 100%)',background:'linear-gradient(to right,'+_data.options.gauge.colors.low+' 1%,'+_data.options.gauge.colors.high+' 100%)','filter':'progid:DXImageTransform.Microsoft.gradient( startColorstr="'+_data.options.gauge.colors.low+'", endColorstr="'+_data.options.gauge.colors.high+'",GradientType=1 )'});},setMenu:function(options){options=options||_data.options.menu;options.on!=undefined&&(options.on=parseBoolean(options.on));$.extend(true,_data.options,{menu:options});_data.$menu&&_data.$menu.off('click.menu.mapsvg');if(_data.options.menu.on){var menuContainer=$('#'+_data.options.menu.containerId);if(menuContainer.length){if(!_data.$menu){if(!menuContainer.is('ul')){_data.$menu=$('
      ').appendTo(menuContainer);}else{_data.$menu=menuContainer;} if(!_data.$menu.hasClass('mapsvg-menu')) _data.$menu.addClass('mapsvg-menu');} if(_data.$menu.children().length===0) _data.regions.forEach(function(region,i){if(!region.disabled) _data.$menu.append(_data.options.menu.template(region));});_data.$menu.on('click.menu.mapsvg','a',function(e){e.preventDefault();var regionID=$(this).attr('href').replace('#','');var region=_this.getRegion(regionID);var center=region.getCenter();e.clientX=center[0];e.clientY=center[1];_this.regionClickHandler(e,region);}).on('mouseover.menu.mapsvg','a',function(e){var regionID=$(this).attr('href').replace('#','');var region=_this.getRegion(regionID);if(!region.selected) region.highlight();}).on('mouseout.menu.mapsvg','a',function(e){var regionID=$(this).attr('href').replace('#','');var region=_this.getRegion(regionID);if(!region.selected) region.unhighlight();});}}},setMenuMarkers:function(options){options=options||_data.options.menuMarkers;options.on!=undefined&&(options.on=parseBoolean(options.on));$.extend(true,_data.options,{menuMarkers:options});_data.$menuMarkers&&_data.$menuMarkers.off('click.menuMarkers.mapsvg');if(_data.options.menuMarkers.on){var menuContainer=$('#'+_data.options.menuMarkers.containerId);if(menuContainer.length){if(!_data.$menuMarkers){if(!menuContainer.is('ul')){_data.$menuMarkers=$('
        ').appendTo(menuContainer);}else{_data.$menuMarkers=menuContainer;} if(!_data.$menuMarkers.hasClass('mapsvg-menu-markers')) _data.$menuMarkers.addClass('mapsvg-menu-markers');} if(_data.$menuMarkers.children().length===0) _data.markers.forEach(function(marker,i){_data.$menuMarkers.append(_data.options.menuMarkers.template(marker));});_data.$menuMarkers.on('click.menuMarkers.mapsvg','a',function(e){e.preventDefault();var markerID=$(this).attr('href').replace('#','');var marker=_this.getMarker(markerID);var center=marker.getCenter();e={clientX:center[0],clientY:center[1]};_this.regionClickHandler(e,marker);});}}},getRegion:function(id){return _data.regions[_data.regionsDict[id]];},getMarker:function(id){return _data.markers[_data.markersDict[id]];},checkId:function(id){if(_this.getRegion(id)) return{error:"This ID is already being used by a Region"};else if(_this.getMarker(id)) return{error:"This ID is already being used by another Marker"};else return true;},regionsRedrawColors:function(){_data.regions.forEach(function(region){region.setFill();});},destroy:function(){delete instances[_data.$map.attr('id')];_data.$map.empty();return _this;},getData:function(){return _data;},getScale:function(){var ratio_def=_data.svgDefault.width/_data.svgDefault.height;var ratio_new=_data.options.width/_data.options.height;var scale1,scale2;var size=[_data.$map.width(),_data.$map.height()];scale2=size[0]/_data.viewBox[2];return scale2||1;},updateSize:function(){_data.scale=_this.getScale();_this.markersAdjustPosition();if(_browser.ie){_this.mapAdjustStrokes();}},getViewBox:function(){return _data.viewBox;},viewBoxSetBySize:function(width,height){_data._viewBox=_this.viewBoxGetBySize(width,height);_data.options.width=parseFloat(width);_data.options.height=parseFloat(height);_this.setViewBox(_data._viewBox,true);_data.whRatio=_data.viewBox[2]/_data.viewBox[3];if(!_data.options.responsive) _this.setResponsive();return _data.viewBox;},viewBoxGetBySize:function(width,height){var new_ratio=width/height;var old_ratio=_data.svgDefault.viewBox[2]/_data.svgDefault.viewBox[3];var vb=$.extend([],_data.svgDefault.viewBox);if(new_ratio!=old_ratio){if(new_ratio>old_ratio){vb[2]=_data.svgDefault.viewBox[3]*new_ratio;vb[0]=_data.svgDefault.viewBox[0]-((vb[2]-_data.svgDefault.viewBox[2])/2);}else{vb[3]=_data.svgDefault.viewBox[2]/new_ratio;vb[1]=_data.svgDefault.viewBox[1]-((vb[3]-_data.svgDefault.viewBox[3])/2);}} return vb;},viewBoxReset:function(toInitial){if(toInitial){var v=_data._viewBox||_data.svgDefault.viewBox;_data.zoomLevel=0;_data._scale=1;_this.setViewBox(v);}else{_this.setViewBox();}},getGeoViewBox:function(){var v=_data.viewBox;var leftLon=_this.convertPixelToGeo(v[0],v[1])[1];var rightLon=_this.convertPixelToGeo(v[0]+v[2],v[1])[1];var topLat=_this.convertPixelToGeo(v[0],v[1])[0];var bottomLat=_this.convertPixelToGeo(v[0],v[1]+v[3])[0];return[leftLon,topLat,rightLon,bottomLat];},mapAdjustStrokes:function(){_data.regions.forEach(function(region){if(region.svg_style['stroke-width']){region.node.css('stroke-width',region.svg_style['stroke-width']/_data.scale);}});},zoomIn:function(){_this.zoom(1);},zoomOut:function(){_this.zoom(-1);},touchZoomStart:function(touchScale){touchZoomStart=_data._scale;_data.scale=_data.scale*zoom_k;zoom=_data._scale;_data._scale=_data._scale*zoom_k;var vWidth=_data.viewBox[2];var vHeight=_data.viewBox[3];var newViewBox=[];newViewBox[2]=_data._viewBox[2]/_data._scale;newViewBox[3]=_data._viewBox[3]/_data._scale;newViewBox[0]=_data.viewBox[0]+(vWidth-newViewBox[2])/2;newViewBox[1]=viewBox[1]+(vHeight-newViewBox[3])/2;_this.setViewBox(newViewBox);},touchZoomMove:function(){},touchZoomEnd:function(){},zoom:function(delta,exact){var vWidth=_data.viewBox[2];var vHeight=_data.viewBox[3];var newViewBox=[];if(!exact){var d=delta>0?1:-1;_data._zoomLevel=_data.zoomLevel;_data._zoomLevel+=d;if(_data._zoomLevel>_data.options.zoom.limit[1]||_data._zoomLevel<_data.options.zoom.limit[0])return false;_data.zoomLevel=_data._zoomLevel;var zoom_k=d*_data.options.zoom.delta;if(zoom_k<1)zoom_k=-1/zoom_k;_data._scale=_data._scale*zoom_k;newViewBox[2]=_data._viewBox[2]/_data._scale;newViewBox[3]=_data._viewBox[3]/_data._scale;}else{_data._scale=exact;newViewBox[2]=_data.touchZoomStartViewBox[2]/_data._scale;newViewBox[3]=_data.touchZoomStartViewBox[3]/_data._scale;} newViewBox[0]=_data.viewBox[0]+(vWidth-newViewBox[2])/2;newViewBox[1]=_data.viewBox[1]+(vHeight-newViewBox[3])/2;if(_data.options.scroll.limit) {if(newViewBox[0]<_data.svgDefault.viewBox[0]) newViewBox[0]=_data.svgDefault.viewBox[0];else if(newViewBox[0]+newViewBox[2]>_data.svgDefault.viewBox[0]+_data.svgDefault.viewBox[2]) newViewBox[0]=_data.svgDefault.viewBox[0]+_data.svgDefault.viewBox[2]-newViewBox[2];if(newViewBox[1]<_data.svgDefault.viewBox[1]) newViewBox[1]=_data.svgDefault.viewBox[1];else if(newViewBox[1]+newViewBox[3]>_data.svgDefault.viewBox[1]+_data.svgDefault.viewBox[3]) newViewBox[1]=_data.svgDefault.viewBox[1]+_data.svgDefault.viewBox[3]-newViewBox[3];} _this.setViewBox(newViewBox);},markerDelete:function(marker){var id=marker.id;var test=_data.markers.splice(_data.markersDict[id],1);marker.delete();marker=null;_this.updateMarkersDict();if(_data.markers.length==0) _data.options.markerLastID=0;},markerAdd:function(opts,create){var options=$.extend(true,{},markerOptions,opts);if(!options.src) return false;options.src=safeURL(options.src);if(options.width&&options.height){return _this.markerAddFinalStep(options,create);}else{var img=new Image();img.onload=function(){options.width=this.width;options.height=this.height;return _this.markerAddFinalStep(options,create);};img.src=options.src;}},markerAddFinalStep:function(options,create){if(options.xy||(isNumber(options.x)&&isNumber(options.y))){xy=options.xy||[options.x,options.y];if(create){xy[0]+=_data.scale<1?1:2;xy[1]+=1;xy[0]=xy[0]/_data.scale-options.width/2+_data.viewBox[0];xy[1]=xy[1]/_data.scale-options.height+_data.viewBox[1];}}else if(options.geoCoords){xy=_this.convertGeoToPixel(options.geoCoords);xy[0]=xy[0]-options.width/2+.3;xy[1]=(xy[1]-options.height)+1.5;}else{return false;} options.x=xy[0];options.y=xy[1];options.id=options.id||'marker_'+(_data.options.markerLastID++);if(!options.geoCoords&&_data.mapIsGeo){options.geoCoords=_this.convertPixelToGeo(options.x+options.width/2,options.y+(options.height-1));} var marker=new Marker(options,_data.scale);_data.$svg.append(marker.node);marker.href&&marker.setHref(marker.href);marker.adjustPosition(_data.scale);_data.markers.push(marker);_data.markersDict[marker.id]=_data.markers.length-1;if(create&&_data.markerEditHandler) _data.markerEditHandler.call(marker);return marker;},markersAdjustPosition:function(){var dx,dy;_data.markers.forEach(function(marker){marker.adjustPosition(_data.scale);});},markerMoveStart:function(){this.data('ox',parseFloat(this.attr('x')));this.data('oy',parseFloat(this.attr('y')));},markerMove:function(dx,dy){dx=dx/_data.scale;dy=dy/_data.scale;this.attr({x:this.data('ox')+dx,y:this.data('oy')+dy});},markerMoveEnd:function(){if(this.data('ox')==this.attr('x')&&this.data('oy')==this.attr('y')){options.markerEditHandler.call(this);}},scrollStart:function(e,mapsvg){if($(e.target).hasClass('mapsvg-btn-zoom')||$(e.target).closest('.mapsvg-gauge').length) return false;if(_data.editMarkers.on&&$(e.target).attr('class')=='mapsvg-marker') return false;e.preventDefault();if(touchDevice){var ce=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0]?e.originalEvent.touches[0]:e;}else{var ce=e;} _data.scroll={};_data.scroll.vxi=_data.viewBox[0];_data.scroll.vyi=_data.viewBox[1];_data.scroll.x=ce.clientX;_data.scroll.y=ce.clientY;_data.scroll.dx=0;_data.scroll.dy=0;_data.scroll.vx=0;_data.scroll.vy=0;if(!touchDevice) $('body').on('mousemove.scroll.mapsvg',_this.scrollMove).on('mouseup.scroll.mapsvg',function(e){_this.scrollEnd(e,mapsvg);});},scrollMove:function(e){e.preventDefault();_data.isScrolling=true;$('body').css({'cursor':'move'});var ce=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0]?e.originalEvent.touches[0]:e;_data.scroll.dx=(_data.scroll.x-ce.clientX);_data.scroll.dy=(_data.scroll.y-ce.clientY);var vx=parseInt(_data.scroll.vxi+_data.scroll.dx/_data.scale);var vy=parseInt(_data.scroll.vyi+_data.scroll.dy/_data.scale);if(_data.options.scroll.limit){if(vx<_data.svgDefault.viewBox[0]) vx=_data.svgDefault.viewBox[0];else if(_data.viewBox[2]+vx>_data.svgDefault.viewBox[0]+_data.svgDefault.viewBox[2]) vx=(_data.svgDefault.viewBox[0]+_data.svgDefault.viewBox[2]-_data.viewBox[2]);if(vy<_data.svgDefault.viewBox[1]) vy=_data.svgDefault.viewBox[1];else if(_data.viewBox[3]+vy>_data.svgDefault.viewBox[1]+_data.svgDefault.viewBox[3]) vy=(_data.svgDefault.viewBox[1]+_data.svgDefault.viewBox[3]-_data.viewBox[3]);} _data.scroll.vx=vx;_data.scroll.vy=vy;_this.setViewBox([_data.scroll.vx,_data.scroll.vy,_data.viewBox[2],_data.viewBox[3]]);},scrollEnd:function(e,mapsvg){_data.isScrolling=false;if(Math.abs(_data.scroll.dx)<5&&Math.abs(_data.scroll.dy)<5){if(_data.editMarkers.on) _this.markerAddClickHandler(e);else if(_data.region_clicked) _this.regionClickHandler(e,_data.region_clicked);} $('body').css({'cursor':'default'});_data.viewBox[0]=_data.scroll.vx||_data.viewBox[0];_data.viewBox[1]=_data.scroll.vy||_data.viewBox[1];$('body').off('.scroll.mapsvg');},scrollRegionClickHandler:function(e,region){_data.region_clicked=region;},touchStart:function(_e,mapsvg){_e.preventDefault();var e=_e.originalEvent;if(_data.options.zoom&&e.touches&&e.touches.length==2){_data.touchZoomStartViewBox=_data.viewBox;_data.touchZoomStart=_data.scale;_data.touchZoomEnd=1;}else{_this.scrollStart(_e,mapsvg);_data.isScrolling=true;}},touchMove:function(_e){_e.preventDefault();var e=_e.originalEvent;if(_data.options.zoom&&e.touches&&e.touches.length>=2){_this.zoom(null,e.scale);_data.isScrolling=false;}else if(_data.isScrolling){_this.scrollMove(_e);}},touchEnd:function(_e){_e.preventDefault();var e=_e.originalEvent;if(_data.touchZoomStart){_data.touchZoomStart=false;_data.touchZoomEnd=false;}else if(_data.isScrolling){_this.scrollEnd(_e);}},markersGroupHide:function(group){for(var i in _data.markers[group]){_data.markers[group][i].hide();}},markersGroupShow:function(group){for(var i in _data.markers[group]){_data.markers[group][i].show();}},regionsGroupSelect:function(group){for(var i in _data.markers[group]){_data.markers[group][i].hide();}},regionsGroupUnselect:function(group){for(var i in _data.markers[group]){_data.markers[group][i].show();}},markersGet:function(){return _data.markers;},getSelected:function(){return _data.selected_id;},selectRegion:function(id){if(typeof id=="string"){var region=_this.getRegion(id);}else{var region=id;} if(!region||region.disabled)return false;if(_data.options.multiSelect&&!_data.editRegions.on){if(region.selected){_this.deselectRegion(region);return;}}else if(_data.selected_id.length>0){_this.deselectRegion();} _data.selected_id.push(region.id);region.select();},deselectAllRegions:function(){$.each(_data.selected_id,function(index,id){_this.deselectRegion(_this.getRegion(id));});},deselectRegion:function(region){if(!region) region=_this.getRegion(_data.selected_id[0]);region.deselect();var i=$.inArray(region.id,_data.selected_id);_data.selected_id.splice(i,1);if(_browser.ie) _this.mapAdjustStrokes();},selectRegionsGroup:function(group_id){for(var r in _data.regionGroups[group_id]){var region_id=_data.regionGroups[group_id][r].id;_this.selectRegion(region_id);}},highlightRegionsGroup:function(group_id){for(var r in _data.regionGroups[group_id]){var region_id=_data.regionGroups[group_id][r].id;_this.highlightRegion(region_id);}},unhighlightRegionsGroup:function(group_id){for(var r in _data.regionGroups[group_id]){var region_id=_data.regionGroups[group_id][r].id;_this.unhighlightRegion(region_id);}},narrowToRegionsGroup:function(group_id){_data.regions.forEach(function(r){if(r.group!=group_id&&!r.disabled){r.disabled=true;r.disabledTemp=true;$(r.node).addClass('mapsvg-disabled');}else{if(r.disabledTemp){r.disabledTemp=false;r.disabled=false;$(r.node).removeClass('mapsvg-disabled');}}});},disableRegionsGroup:function(group_id){},enableAllRegionsGroups:function(){_data.regions.forEach(function(r){if(r.disabledTemp){r.disabledTemp=false;r.disabled=false;$(r.node).removeClass('mapsvg-disabled');}});},convertGeoToPixel:function(coords){var lat=parseFloat(coords[0]);var lon=parseFloat(coords[1]);var x=(lon-_data.geoViewBox.leftLon)*(_data.svgDefault.width/_data.mapLonDelta);var lat=lat*3.14159/180;var worldMapWidth=((_data.svgDefault.width/_data.mapLonDelta)*360)/(2*3.14159);var mapOffsetY=(worldMapWidth/2*Math.log((1+Math.sin(_data.mapLatBottomDegree))/(1-Math.sin(_data.mapLatBottomDegree))));var y=_data.svgDefault.height-((worldMapWidth/2*Math.log((1+Math.sin(lat))/(1-Math.sin(lat))))-mapOffsetY);x+=_data.svgDefault.viewBox[0];y+=_data.svgDefault.viewBox[1];return[x,y];},convertPixelToGeo:function(tx,ty){tx-=_data.svgDefault.viewBox[0];ty-=_data.svgDefault.viewBox[1];var worldMapRadius=_data.svgDefault.width/_data.mapLonDelta*360/(2*Math.PI);var mapOffsetY=(worldMapRadius/2*Math.log((1+Math.sin(_data.mapLatBottomDegree))/(1-Math.sin(_data.mapLatBottomDegree))));var equatorY=_data.svgDefault.height+mapOffsetY;var a=(equatorY-ty)/worldMapRadius;var lat=180/Math.PI*(2*Math.atan(Math.exp(a))-Math.PI/2);var long=_data.geoViewBox.leftLon+tx/_data.svgDefault.width*_data.mapLonDelta;return[lat,long];},pickGaugeColor:function(gaugeValue){var w=(gaugeValue-_data.options.gauge.min)/_data.options.gauge.maxAdjusted;var rgb=[Math.round(_data.options.gauge.colors.diffRGB.r*w+_data.options.gauge.colors.lowRGB.r),Math.round(_data.options.gauge.colors.diffRGB.g*w+_data.options.gauge.colors.lowRGB.g),Math.round(_data.options.gauge.colors.diffRGB.b*w+_data.options.gauge.colors.lowRGB.b),Math.round(_data.options.gauge.colors.diffRGB.a*w+_data.options.gauge.colors.lowRGB.a)];return rgb;},isRegionDisabled:function(id,svgfill){if(_data.options.regions[id]&&(_data.options.regions[id].disabled||svgfill=='none')){return true;}else if((_data.options.regions[id]==undefined||parseBoolean(_data.options.regions[id].disabled))&&(_data.options.disableAll||svgfill=='none'||id=='labels'||id=='Labels')){return true;}else{return false;}},regionClickHandler:function(e,region){if(!region||region.disabled)return false;_data.region_clicked=null;if(region.mapsvg_type=='region') _this.selectRegion(region.id);if(_data.editRegions.on){_data.regionEditHandler.call(region);return;} _this.hidePopover();var popover=_this.getPopoverBody(region);popover&&_this.showPopover(e,popover);if(_data.options.onClick) _data.options.onClick.call(region,e,_this);if(touchDevice&®ion.href&&!_data.disableLinks) window.location.href=region.href;},fileExists:function(url){if(url.substr(0,4)=="data") return true;var http=new XMLHttpRequest();http.open('HEAD',url,false);http.send();return http.status!=404;},getStyle:function(elem,prop){if(elem.currentStyle){var res=elem.currentStyle.margin;}else if(window.getComputedStyle){if(window.getComputedStyle.getPropertyValue){var res=window.getComputedStyle(elem,null).getPropertyValue(prop)} else{var res=window.getComputedStyle(elem)[prop]};} return res;},search:function(str){results=[];str=str.toLowerCase();_data.regions.forEach(function(r){if(r.id.toLowerCase().indexOf(str)===0||(r.title&&r.title.toLowerCase().indexOf(str)===0)) results.push(r.id);});return results;},searchMarkers:function(str){results=[];str=str.toLowerCase();_data.markers.forEach(function(m){if(m.id.toLowerCase().indexOf(str)===0) results.push(m.id);});return results;},markerAddClickHandler:function(e){if($(e.target).is('image'))return false;var mc=mouseCoords(e);var x=mc.x-_data.$map.offset().left;var y=mc.y-_data.$map.offset().top;if(!$.isNumeric(x)||!$.isNumeric(y)) return false;_this.markerAdd({xy:[x,y],group:_data.editMarkers.group},true);},setMarkersEditMode:function(on){_data.editMarkers.on=parseBoolean(on);_this.deselectAllRegions();_this.setEventHandlers();},setRegionsEditMode:function(on){_data.editRegions.on=parseBoolean(on);_this.deselectAllRegions();_this.setEventHandlers();},setMarkers:function(markers){$.each(markers,function(i,marker){_this.markerAdd(marker);});},setEventHandler:function(){},textBr:function(text){var htmls=[];var lines=text.split(/\n/);var tmpDiv=jQuery(document.createElement('div'));for(var i=0;i");},runUserFunction:function(func){try{func();}catch(error){console.log("MapSVG user-defined function error: (line "+error.line+"): "+error.message);}},showTooltip:function(region){if(region.disabled) return false;var tip;if(_data.options.tooltips.priority=="global"){tip=(typeof _data.options.tooltips.mode=="function")&&_data.options.tooltips.mode.call(region,_data.mapTip,region,_this)||_data.options.tooltips.mode!='off'&®ion[_data.options.tooltips.mode]||region.tooltip}else{tip=region.tooltip||(typeof _data.options.tooltips.mode=="function")&&_data.options.tooltips.mode.call(region,_data.mapTip,region,_this)||_data.options.tooltips.mode!='off'&®ion[_data.options.tooltips.mode];} if(tip){_data.mapTip.html(tip);_data.mapTip.addClass('mapsvg-tooltip-visible');}},getPopoverBody:function(region){var popover;if(_data.options.popovers.priority=='global'){popover=typeof _data.options.popovers.mode=='function'?_data.options.popovers.mode.call(region,_data.mapPopover,region,_this):region.popover;}else{popover=region.popover||(typeof _data.options.popovers.mode=='function'?_data.options.popovers.mode.call(region,_data.mapPopover,region,_this):null);} return popover;},showPopover:function(e,content,pos){if(!pos||pos.length!=2){var m=mouseCoords(e);var pos=[m.x,m.y];}else{var scale=_this.getScale();pos[0]=_data.$map.offset().left+pos[0]*scale;pos[1]=_data.$map.offset().top+pos[1]*scale;} if(content){_data.mapPopover.contentDiv.html(content);var nx=pos[0]-_data.mapPopover.outerWidth(false)/2;var ny=pos[1]-_data.mapPopover.outerHeight(false)-14;if(nx<0)nx=0;if(ny<0)ny=0;_data.mapPopover.css('left',nx).css('top',ny);_data.mapPopover.addClass('mapsvg-popover-visible');}else{_data.mapPopover.removeClass('mapsvg-popover-visible');}},hidePopover:function(){_data.mapPopover.contentDiv.empty();_data.mapPopover.removeClass('mapsvg-popover-visible');$('body').off('mousedown.popover.mapsvg',_this.popoverOffHandler);if(_data.options.onPopoverClose) _data.options.onPopoverClose.call(_this);},hideTip:function(){_data.mapTip.removeClass('mapsvg-tooltip-visible');},popoverOffHandler:function(e){if($(e.target).closest('.mapsvg-popover').length) return false;_this.hidePopover();},mouseOverHandler:function(e){if(this instanceof Region){if(!this.selected) this.highlight();} _this.showTooltip(this);return _data.options.mouseOver&&_data.options.mouseOver.call(this,e,_this);},mouseOutHandler:function(e){if(this instanceof Region){if(!this.selected) this.unhighlight();} _this.hideTip();return _data.options.mouseOut&&_data.options.mouseOut.call(this,e,_this);},updateOptions:function(options){$.extend(true,_data.options,options);},updateMarkersDict:function(){_data.markersDict={};_data.markers.forEach(function(marker,i){_data.markersDict[marker.id]=i;});},setEventHandlers:function(){_data.$map.off('.common.mapsvg');if(_data.editMarkers.on){var event2=touchDevice?'touchstart.common.mapsvg':'mousedown.common.mapsvg';_data.$map.on(event2,'.mapsvg-marker',function(e){e.originalEvent.preventDefault();var marker=_this.getMarker($(this).attr('id'));var startCoords=mouseCoords(e);marker.drag(startCoords,_data.scale,function(){if(_data.mapIsGeo){this.geoCoords=_this.convertPixelToGeo(this.x+this.width/2,this.y+(this.height-1));} _data.markerEditHandler.call(this,true);},function(){_data.markerEditHandler.call(this);});});} if(!touchDevice){if(!_data.editMarkers.on){_data.$map.on('mouseover.common.mapsvg','.mapsvg-region',function(e){var id=$(this).attr('id');_this.mouseOverHandler.call(_this.getRegion(id),e,_this,options);}).on('mouseleave.common.mapsvg','.mapsvg-region',function(e){var id=$(this).attr('id');_this.mouseOutHandler.call(_this.getRegion(id),e,_this,options);});} if(!_data.editRegions.on){_data.$map.on('mouseover.common.mapsvg','.mapsvg-marker',function(e){var id=$(this).attr('id');_this.mouseOverHandler.call(_this.getMarker(id),e,_this,options);}).on('mouseleave.common.mapsvg','.mapsvg-marker',function(e){var id=$(this).attr('id');_this.mouseOutHandler.call(_this.getMarker(id),e,_this,options);});}} if(!_data.options.scroll.on){var event=touchDevice?'touchstart.common.mapsvg':'click.common.mapsvg';if(!_data.editMarkers.on){_data.$map.on(event,'.mapsvg-region',function(e){_this.regionClickHandler.call(_this,e,_this.getRegion($(this).attr('id')));});_data.$map.on(event,'.mapsvg-marker',function(e){_this.regionClickHandler.call(_this,e,_this.getMarker($(this).attr('id')));});}else{_data.$map.on(event,function(e){_this.markerAddClickHandler(e);});}}else{var event=touchDevice?'touchstart.common.mapsvg':'mousedown.common.mapsvg';_data.$map.on(event,'.mapsvg-region',function(e){e.preventDefault();var obj=_this.getRegion($(this).attr('id'));_this.scrollRegionClickHandler.call(_this,e,obj);});_data.$map.on(event,'.mapsvg-marker',function(e){e.preventDefault();var obj=_this.getMarker($(this).attr('id'));_this.scrollRegionClickHandler.call(_this,e,obj);});if(!touchDevice){_data.$map.on('mousedown.common.mapsvg',function(e){_this.scrollStart(e,_this);});}else{_data.$map.on('touchstart.common.mapsvg',function(e){_this.touchStart(e,_this);}).on('touchmove.common.mapsvg',_this.touchMove).on('touchend.common.mapsvg',_this.touchEnd);}}},init:function(opts,elem){if(!opts.source){throw new Error('MapSVG: please provide SVG file source.');return false;} if(opts.beforeLoad) try{opts.beforeLoad.call(_this);}catch(err){} if(opts.source.indexOf('//')===0) opts.source=opts.source.replace(/^\/\/[^\/]+/,'').replace('//','/');else opts.source=opts.source.replace(/^.*:\/\/[^\/]+/,'').replace('//','/');_data={};_data.options=$.extend(true,{},defaults,opts);_data.editRegions={on:false};_data.editMarkers={on:false};_data.map=elem;_data.$map=$(elem);_data.whRatio=0;_data.isScrolling=false;_data.markerOptions={};_data.svgDefault={};_data.refLength=0;_data.scale=1;_data._scale=1;_data.selected_id=[];_data.mapData={};_data.regions=[];_data.regionsDict={};_data.regionID={id:0};_data.markers=[];_data.markersDict={};_data._viewBox=[];_data.viewBox=[];_data.viewBoxZoom=[];_data.viewBoxFind=undefined;_data.zoomLevel=0;_data.scroll={};_data.geoCoordinates=false,_data.geoViewBox={leftLon:0,topLat:0,rightLon:0,bottomLat:0},_data.$map.addClass('mapsvg').css('background',_data.options.colors.background);var loading=$('
        '+_data.options.loadingText+'
        ').addClass('mapsvg-loading');_data.$map.append(loading);loading.css({'margin-left':function(){return-($(this).outerWidth(false)/2)+'px';},'margin-top':function(){return-($(this).outerHeight(false)/2)+'px';}});$.ajax({url:_data.options.source,success:function(xmlData){$data=$(xmlData);var svgTag=$data.find('svg');_data.$svg=svgTag;_data.svgDefault.width=svgTag.attr('width');_data.svgDefault.height=svgTag.attr('height');_data.svgDefault.viewBox=svgTag.attr('viewBox');if(_data.svgDefault.width&&_data.svgDefault.height){_data.svgDefault.width=parseFloat(_data.svgDefault.width.replace(/px/g,''));_data.svgDefault.height=parseFloat(_data.svgDefault.height.replace(/px/g,''));_data.svgDefault.viewBox=_data.svgDefault.viewBox?_data.svgDefault.viewBox.split(' '):[0,0,_data.svgDefault.width,_data.svgDefault.height];}else if(_data.svgDefault.viewBox){_data.svgDefault.viewBox=_data.svgDefault.viewBox.split(' ');_data.svgDefault.width=parseFloat(_data.svgDefault.viewBox[2]);_data.svgDefault.height=parseFloat(_data.svgDefault.viewBox[3]);}else{alert('MapSVG needs width/height or viewBox parameter to be present in SVG file.') return false;} var geo=svgTag.attr("mapsvg:geoViewBox");if(geo){geo=geo.split(" ");if(geo.length==4){_data.mapIsGeo=true;_data.geoCoordinates=true;var v=svgTag.attr("mapsvg:calibratedViewBox");_data.geoViewBox={leftLon:parseFloat(geo[0]),topLat:parseFloat(geo[1]),rightLon:parseFloat(geo[2]),bottomLat:parseFloat(geo[3])};_data.mapLonDelta=_data.geoViewBox.rightLon-_data.geoViewBox.leftLon;_data.mapLatBottomDegree=_data.geoViewBox.bottomLat*3.14159/180;}} $.each(_data.svgDefault.viewBox,function(i,v){_data.svgDefault.viewBox[i]=parseInt(v);});_data._viewBox=(_data.options.viewBox.length==4&&_data.options.viewBox)||_data.svgDefault.viewBox;$.each(_data._viewBox,function(i,v){_data._viewBox[i]=parseFloat(v);});svgTag.attr('preserveAspectRatio','xMidYMid meet');svgTag.attr('width','100%');svgTag.attr('height','100%');_data.$svg.find('path, polygon, circle, ellipse, rect').each(function(index){var region=new Region($(this),_data.options,_data.regionID,_this);_data.regions.push(region);_data.regionsDict[region.id]=index;if(region.autoID){_data.presentAutoID=true;}});_this.setSize(_data.options.width,_data.options.height,_data.options.responsive);_data.$map.append(svgTag);var v=_data._viewBox;_this.setViewBox(v);_this.setGauge();var markers=_data.options.markers||_data.options.marks||[];_this.setMarkers(markers);_this.setScroll(_data.options.scroll);_this.setZoom(_data.options.zoom);if(_data.options.tooltipsMode) _data.options.tooltips.mode=_data.options.tooltipsMode;_this.setTooltips(_data.options.tooltips);if(_data.options.popover) _data.options.popovers=_data.options.popover;_this.setPopovers(_data.options.popovers);if(_data.options.cursor) _this.setCursor(_data.options.cursor);if(_browser.ie) _this.mapAdjustStrokes();$(document).ready(function(){_this.setMenu();_this.setMenuMarkers();});_this.setEventHandlers();$('#'+_data.$map.attr('id')+' [title]').each(function(){this.removeAttribute('title')});$('#'+_data.$map.attr('id')+' title').remove();loading.hide();if(_data.options.afterLoad) _data.options.afterLoad.call(_this);_this.updateSize();}});return _this;}};var _this=this.methods;};$.fn.mapSvg=function(opts){var id=$(this).attr('id');if(typeof opts=='object'&&instances[id]===undefined){instances[id]=new mapSVG(this,opts);return instances[id].methods.init(opts,this);}else if(instances[id]){return instances[id].methods;}else{return instances;}};})(jQuery);(function(Math){var trimLeft=/^\s+/,trimRight=/\s+$/,tinyCounter=0,mathRound=Math.round,mathMin=Math.min,mathMax=Math.max,mathRandom=Math.random;function tinycolor(color,opts){color=(color)?color:'';opts=opts||{};if(color instanceof tinycolor){return color;} if(!(this instanceof tinycolor)){return new tinycolor(color,opts);} var rgb=inputToRGB(color);this._originalInput=color,this._r=rgb.r,this._g=rgb.g,this._b=rgb.b,this._a=rgb.a,this._roundA=mathRound(100*this._a)/100,this._format=opts.format||rgb.format;this._gradientType=opts.gradientType;if(this._r<1){this._r=mathRound(this._r);} if(this._g<1){this._g=mathRound(this._g);} if(this._b<1){this._b=mathRound(this._b);} this._ok=rgb.ok;this._tc_id=tinyCounter++;} tinycolor.prototype={isDark:function(){return this.getBrightness()<128;},isLight:function(){return!this.isDark();},isValid:function(){return this._ok;},getOriginalInput:function(){return this._originalInput;},getFormat:function(){return this._format;},getAlpha:function(){return this._a;},getBrightness:function(){var rgb=this.toRgb();return(rgb.r*299+rgb.g*587+rgb.b*114)/1000;},getLuminance:function(){var rgb=this.toRgb();var RsRGB,GsRGB,BsRGB,R,G,B;RsRGB=rgb.r/255;GsRGB=rgb.g/255;BsRGB=rgb.b/255;if(RsRGB<=0.03928){R=RsRGB/12.92;}else{R=Math.pow(((RsRGB+0.055)/1.055),2.4);} if(GsRGB<=0.03928){G=GsRGB/12.92;}else{G=Math.pow(((GsRGB+0.055)/1.055),2.4);} if(BsRGB<=0.03928){B=BsRGB/12.92;}else{B=Math.pow(((BsRGB+0.055)/1.055),2.4);} return(0.2126*R)+(0.7152*G)+(0.0722*B);},setAlpha:function(value){this._a=boundAlpha(value);this._roundA=mathRound(100*this._a)/100;return this;},toHsv:function(){var hsv=rgbToHsv(this._r,this._g,this._b);return{h:hsv.h*360,s:hsv.s,v:hsv.v,a:this._a};},toHsvString:function(){var hsv=rgbToHsv(this._r,this._g,this._b);var h=mathRound(hsv.h*360),s=mathRound(hsv.s*100),v=mathRound(hsv.v*100);return(this._a==1)?"hsv("+h+", "+s+"%, "+v+"%)":"hsva("+h+", "+s+"%, "+v+"%, "+this._roundA+")";},toHsl:function(){var hsl=rgbToHsl(this._r,this._g,this._b);return{h:hsl.h*360,s:hsl.s,l:hsl.l,a:this._a};},toHslString:function(){var hsl=rgbToHsl(this._r,this._g,this._b);var h=mathRound(hsl.h*360),s=mathRound(hsl.s*100),l=mathRound(hsl.l*100);return(this._a==1)?"hsl("+h+", "+s+"%, "+l+"%)":"hsla("+h+", "+s+"%, "+l+"%, "+this._roundA+")";},toHex:function(allow3Char){return rgbToHex(this._r,this._g,this._b,allow3Char);},toHexString:function(allow3Char){return'#'+this.toHex(allow3Char);},toHex8:function(){return rgbaToHex(this._r,this._g,this._b,this._a);},toHex8String:function(){return'#'+this.toHex8();},toRgb:function(){return{r:mathRound(this._r),g:mathRound(this._g),b:mathRound(this._b),a:this._a};},toRgbString:function(){return(this._a==1)?"rgb("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+")":"rgba("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+", "+this._roundA+")";},toPercentageRgb:function(){return{r:mathRound(bound01(this._r,255)*100)+"%",g:mathRound(bound01(this._g,255)*100)+"%",b:mathRound(bound01(this._b,255)*100)+"%",a:this._a};},toPercentageRgbString:function(){return(this._a==1)?"rgb("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%)":"rgba("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%, "+this._roundA+")";},toName:function(){if(this._a===0){return"transparent";} if(this._a<1){return false;} return hexNames[rgbToHex(this._r,this._g,this._b,true)]||false;},toFilter:function(secondColor){var hex8String='#'+rgbaToHex(this._r,this._g,this._b,this._a);var secondHex8String=hex8String;var gradientType=this._gradientType?"GradientType = 1, ":"";if(secondColor){var s=tinycolor(secondColor);secondHex8String=s.toHex8String();} return"progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";},toString:function(format){var formatSet=!!format;format=format||this._format;var formattedString=false;var hasAlpha=this._a<1&&this._a>=0;var needsAlphaFormat=!formatSet&&hasAlpha&&(format==="hex"||format==="hex6"||format==="hex3"||format==="name");if(needsAlphaFormat){if(format==="name"&&this._a===0){return this.toName();} return this.toRgbString();} if(format==="rgb"){formattedString=this.toRgbString();} if(format==="prgb"){formattedString=this.toPercentageRgbString();} if(format==="hex"||format==="hex6"){formattedString=this.toHexString();} if(format==="hex3"){formattedString=this.toHexString(true);} if(format==="hex8"){formattedString=this.toHex8String();} if(format==="name"){formattedString=this.toName();} if(format==="hsl"){formattedString=this.toHslString();} if(format==="hsv"){formattedString=this.toHsvString();} return formattedString||this.toHexString();},clone:function(){return tinycolor(this.toString());},_applyModification:function(fn,args){var color=fn.apply(null,[this].concat([].slice.call(args)));this._r=color._r;this._g=color._g;this._b=color._b;this.setAlpha(color._a);return this;},lighten:function(){return this._applyModification(lighten,arguments);},brighten:function(){return this._applyModification(brighten,arguments);},darken:function(){return this._applyModification(darken,arguments);},desaturate:function(){return this._applyModification(desaturate,arguments);},saturate:function(){return this._applyModification(saturate,arguments);},greyscale:function(){return this._applyModification(greyscale,arguments);},spin:function(){return this._applyModification(spin,arguments);},_applyCombination:function(fn,args){return fn.apply(null,[this].concat([].slice.call(args)));},analogous:function(){return this._applyCombination(analogous,arguments);},complement:function(){return this._applyCombination(complement,arguments);},monochromatic:function(){return this._applyCombination(monochromatic,arguments);},splitcomplement:function(){return this._applyCombination(splitcomplement,arguments);},triad:function(){return this._applyCombination(triad,arguments);},tetrad:function(){return this._applyCombination(tetrad,arguments);}};tinycolor.fromRatio=function(color,opts){if(typeof color=="object"){var newColor={};for(var i in color){if(color.hasOwnProperty(i)){if(i==="a"){newColor[i]=color[i];} else{newColor[i]=convertToPercentage(color[i]);}}} color=newColor;} return tinycolor(color,opts);};function inputToRGB(color){var rgb={r:0,g:0,b:0};var a=1;var ok=false;var format=false;if(typeof color=="string"){color=stringInputToObject(color);} if(typeof color=="object"){if(isValidCSSUnit(color.r)&&isValidCSSUnit(color.g)&&isValidCSSUnit(color.b)){rgb=rgbToRgb(color.r,color.g,color.b);ok=true;format=String(color.r).substr(-1)==="%"?"prgb":"rgb";} else if(isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.v)){color.s=convertToPercentage(color.s);color.v=convertToPercentage(color.v);rgb=hsvToRgb(color.h,color.s,color.v);ok=true;format="hsv";} else if(isValidCSSUnit(color.h)&&isValidCSSUnit(color.s)&&isValidCSSUnit(color.l)){color.s=convertToPercentage(color.s);color.l=convertToPercentage(color.l);rgb=hslToRgb(color.h,color.s,color.l);ok=true;format="hsl";} if(color.hasOwnProperty("a")){a=color.a;}} a=boundAlpha(a);return{ok:ok,format:color.format||format,r:mathMin(255,mathMax(rgb.r,0)),g:mathMin(255,mathMax(rgb.g,0)),b:mathMin(255,mathMax(rgb.b,0)),a:a};} function rgbToRgb(r,g,b){return{r:bound01(r,255)*255,g:bound01(g,255)*255,b:bound01(b,255)*255};} function rgbToHsl(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,l=(max+min)/2;if(max==min){h=s=0;} else{var d=max-min;s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*(2/3-t)*6;return p;} if(s===0){r=g=b=l;} else{var q=l<0.5?l*(1+s):l+s-l*s;var p=2*l-q;r=hue2rgb(p,q,h+1/3);g=hue2rgb(p,q,h);b=hue2rgb(p,q,h-1/3);} return{r:r*255,g:g*255,b:b*255};} function rgbToHsv(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,v=max;var d=max-min;s=max===0?0:d/max;if(max==min){h=0;} else{switch(max){case r:h=(g-b)/d+(g>1))+720)%360;--results;){hsl.h=(hsl.h+part)%360;ret.push(tinycolor(hsl));} return ret;} function monochromatic(color,results){results=results||6;var hsv=tinycolor(color).toHsv();var h=hsv.h,s=hsv.s,v=hsv.v;var ret=[];var modification=1/results;while(results--){ret.push(tinycolor({h:h,s:s,v:v}));v=(v+modification)%1;} return ret;} tinycolor.mix=function(color1,color2,amount){amount=(amount===0)?0:(amount||50);var rgb1=tinycolor(color1).toRgb();var rgb2=tinycolor(color2).toRgb();var p=amount/100;var w=p*2-1;var a=rgb2.a-rgb1.a;var w1;if(w*a==-1){w1=w;}else{w1=(w+a)/(1+w*a);} w1=(w1+1)/2;var w2=1-w1;var rgba={r:rgb2.r*w1+rgb1.r*w2,g:rgb2.g*w1+rgb1.g*w2,b:rgb2.b*w1+rgb1.b*w2,a:rgb2.a*p+rgb1.a*(1-p)};return tinycolor(rgba);};tinycolor.readability=function(color1,color2){var c1=tinycolor(color1);var c2=tinycolor(color2);return(Math.max(c1.getLuminance(),c2.getLuminance())+0.05)/(Math.min(c1.getLuminance(),c2.getLuminance())+0.05);};tinycolor.isReadable=function(color1,color2,wcag2){var readability=tinycolor.readability(color1,color2);var wcag2Parms,out;out=false;wcag2Parms=validateWCAG2Parms(wcag2);switch(wcag2Parms.level+wcag2Parms.size){case"AAsmall":case"AAAlarge":out=readability>=4.5;break;case"AAlarge":out=readability>=3;break;case"AAAsmall":out=readability>=7;break;} return out;};tinycolor.mostReadable=function(baseColor,colorList,args){var bestColor=null;var bestScore=0;var readability;var includeFallbackColors,level,size;args=args||{};includeFallbackColors=args.includeFallbackColors;level=args.level;size=args.size;for(var i=0;ibestScore){bestScore=readability;bestColor=tinycolor(colorList[i]);}} if(tinycolor.isReadable(baseColor,bestColor,{"level":level,"size":size})||!includeFallbackColors){return bestColor;} else{args.includeFallbackColors=false;return tinycolor.mostReadable(baseColor,["#fff","#000"],args);}};var names=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var hexNames=tinycolor.hexNames=flip(names);function flip(o){var flipped={};for(var i in o){if(o.hasOwnProperty(i)){flipped[o[i]]=i;}} return flipped;} function boundAlpha(a){a=parseFloat(a);if(isNaN(a)||a<0||a>1){a=1;} return a;} function bound01(n,max){if(isOnePointZero(n)){n="100%";} var processPercent=isPercentage(n);n=mathMin(max,mathMax(0,parseFloat(n)));if(processPercent){n=parseInt(n*max,10)/100;} if((Math.abs(n-max)<0.000001)){return 1;} return(n%max)/parseFloat(max);} function clamp01(val){return mathMin(1,mathMax(0,val));} function parseIntFromHex(val){return parseInt(val,16);} function isOnePointZero(n){return typeof n=="string"&&n.indexOf('.')!=-1&&parseFloat(n)===1;} function isPercentage(n){return typeof n==="string"&&n.indexOf('%')!=-1;} function pad2(c){return c.length==1?'0'+c:''+c;} function convertToPercentage(n){if(n<=1){n=(n*100)+"%";} return n;} function convertDecimalToHex(d){return Math.round(parseFloat(d)*255).toString(16);} function convertHexToDecimal(h){return(parseIntFromHex(h)/255);} var matchers=(function(){var CSS_INTEGER="[-\\+]?\\d+%?";var CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?";var CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")";var PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";var PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";return{CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};})();function isValidCSSUnit(color){return!!matchers.CSS_UNIT.exec(color);} function stringInputToObject(color){color=color.replace(trimLeft,'').replace(trimRight,'').toLowerCase();var named=false;if(names[color]){color=names[color];named=true;} else if(color=='transparent'){return{r:0,g:0,b:0,a:0,format:"name"};} var match;if((match=matchers.rgb.exec(color))){return{r:match[1],g:match[2],b:match[3]};} if((match=matchers.rgba.exec(color))){return{r:match[1],g:match[2],b:match[3],a:match[4]};} if((match=matchers.hsl.exec(color))){return{h:match[1],s:match[2],l:match[3]};} if((match=matchers.hsla.exec(color))){return{h:match[1],s:match[2],l:match[3],a:match[4]};} if((match=matchers.hsv.exec(color))){return{h:match[1],s:match[2],v:match[3]};} if((match=matchers.hsva.exec(color))){return{h:match[1],s:match[2],v:match[3],a:match[4]};} if((match=matchers.hex8.exec(color))){return{a:convertHexToDecimal(match[1]),r:parseIntFromHex(match[2]),g:parseIntFromHex(match[3]),b:parseIntFromHex(match[4]),format:named?"name":"hex8"};} if((match=matchers.hex6.exec(color))){return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"};} if((match=matchers.hex3.exec(color))){return{r:parseIntFromHex(match[1]+''+match[1]),g:parseIntFromHex(match[2]+''+match[2]),b:parseIntFromHex(match[3]+''+match[3]),format:named?"name":"hex"};} return false;} function validateWCAG2Parms(parms){var level,size;parms=parms||{"level":"AA","size":"small"};level=(parms.level||"AA").toUpperCase();size=(parms.size||"small").toLowerCase();if(level!=="AA"&&level!=="AAA"){level="AA";} if(size!=="small"&&size!=="large"){size="small";} return{"level":level,"size":size};} if(typeof module!=="undefined"&&module.exports){module.exports=tinycolor;} else if(typeof define==='function'&&define.amd){define(function(){return tinycolor;});} else{window.tinycolor=tinycolor;}})(Math);;function initialiseMap() {var dLatitude=$(".geoLocation span[itemprop='latitude']").length>0?$(".geoLocation span[itemprop='latitude']").html():$(".cntctlttd").html();var dLongitude=$(".geoLocation span[itemprop='longitude']").length>0?$(".geoLocation span[itemprop='longitude']").html():$(".cntctlngtd").html();var mapOptions={scrollwheel:false,draggable:false,zoom:12,center:new google.maps.LatLng(dLatitude,dLongitude),styles:[{"featureType":"all","elementType":"labels.text.fill","stylers":[{"color":"#666666"}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"saturation":"-100"},{"lightness":"-10"}]},{"featureType":"landscape.man_made","elementType":"geometry.fill","stylers":[{"color":"#e1e1e1"}]},{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"color":"#ebebeb"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry.fill","stylers":[{"color":"#dddddd"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#cccccc"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#aaaaaa"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#cccccc"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#cccccc"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#f5f5f5"}]},{"featureType":"transit.station","elementType":"geometry.fill","stylers":[{"color":"#cccccc"}]},{"featureType":"water","elementType":"all","stylers":[{"visibility":"simplified"},{"lightness":"50"}]}]};var mapElement=document.getElementById('map');var map=new google.maps.Map(mapElement,mapOptions);var marker=new google.maps.Marker({position:new google.maps.LatLng(dLatitude,dLongitude),icon:'/thm/usr/'+$("meta[name='theme']").attr("content")+'/img/map-logo.png',map:map,title:$("meta[name='website']").attr("content")});} function equalizeClass(className) {var equaliserHeight=0;var height=0;var i=0;$('.'+className).each (function() {$(this).imagesLoaded (function() {i++;height=$(this).height();if(height>equaliserHeight) {equaliserHeight=height;}});});$('.'+className).css("height",equaliserHeight);} function addCommas(nStr,s) {nStr+='';x=nStr.split('.');x1=x[0];x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)) {x1=x1.replace(rgx,'$1'+s+'$2');} return x1+x2;} function calculateMonthlyPayment() {var fAmount=$("#amount").val();if(fAmount==0) {fAmount=$(".prc").html();} fAmount=fAmount.split('.').join("");var fLoanAmount=parseFloat(fAmount);var fInterestRate=parseFloat($('#interest').val())/100;var fInterestRateMonthly=fInterestRate/12;var nMortgageLength=parseInt($('#term-years').val())*12;var fTmpA=fInterestRateMonthly*Math.pow((1+fInterestRateMonthly),nMortgageLength);var fTmpB=Math.pow((1+fInterestRateMonthly),(nMortgageLength))-1;var fMortgage=parseFloat(fLoanAmount*(fTmpA/fTmpB)).toFixed(2);$('#total').val(addCommas(parseInt(fMortgage),"."));} function translate(sLanguage,sText) {sResult="";$.ajax ({async:false,type:'POST',dataType:"text",url:'/jx/trn.word.php',data:{"l":sLanguage,"w":sText},beforeSend:function(){},success:function(data) {sResult=data;},error:function(jqXHR,textStatus,errorThrown) {sResult="Error"},cache:false});return sResult;} function getImage(sImage) {var tmp=null;$.ajax ({'async':false,'type':"GET",'global':false,'dataType':'text','url':location.protocol+"//"+location.host+"/jx/get.image.ro.php",'data':{url:encodeURIComponent(sImage)},'success':function(data){tmp=data;}});return tmp;} function properCase(s) {return s.replace(/(?:^|\s)\w/g,function(match){return match.toUpperCase();});} function setCookie(cname,cvalue,exdays) {var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/";} function getCookie(cname) {var name=cname+"=";var ca=document.cookie.split(';');for(var i=0;i0) {$('.showcase').matchHeight();} console.log("here");if($('.mh-1').length>0) {console.log("here1");$('.mh-1').matchHeight();} if($('.mh-2').length>0) {console.log("here2");$('.mh-2').matchHeight();} $(".callback").on ({"click":function(event) {if($(event.target).closest('.dropdown-toggle').length) {$(this).data('closable',true);} else {$(this).data('closable',false);}},"hide.bs.dropdown":function(event) {hide=$(this).data('closable');$(this).data('closable',true);return hide;}});if($("#showcase-carousel").length>0) {$("#showcase-carousel").owlCarousel ({navigation:true,afterInit:function(elem){var that=this;that.owlControls.prependTo(elem)},slideSpeed:300,pagination:false,paginationSpeed:400,singleItem:true});} if($("#mapCanvas").length>0) {initializeMapSearch();} if($(".favouritehdr").length>0) {$.ajax ({async:false,beforeSubmit:function(){},error:function(jqXHR,textStatus,errorThrown) {console.log('Portfolio: '+textStatus+' '+errorThrown);},success:function(response) {var o=$.parseJSON($(".searchData").html());var p=$.parseJSON(response);switch(o.key) {case"eam-2326de66-f39c-42c2-a0b4-a3fa47a6cb6f5":sText=(p["count"]>0)?" "+p["count"]:" 0 ";break;case"cds-bd93da25-f134-4132-a326-cbd6945c4678":case"ips-3d5300a9-6ec8-4ad4-92a0-9b42cad40a85":sText=(p["count"]>0)?" "+p["count"]:" ";break;default:sText=(p["count"]>0)?" "+translate(o.lanaguage,"general.portfolio"):" "+translate(o.lanaguage,"general.portfolio");break;} $(".favouritehdr").html(sText);return true;},type:'post',url:"/jx/prtfl.update.php?act=count"});} function updateCount(data) {var o=$.parseJSON($(".searchData").html());var p=$.parseJSON(data);switch(o.key) {case"eam-2326de66-f39c-42c2-a0b4-a3fa47a6cb6f5":sText=(p["count"]>0)?" "+p["count"]:" 0 ";break;case"cds-bd93da25-f134-4132-a326-cbd6945c4678":case"ips-3d5300a9-6ec8-4ad4-92a0-9b42cad40a85":sText=(p["count"]>0)?" "+p["count"]:" ";break;default:sText=(p["count"]>0)?" "+translate(o.lanaguage,"general.portfolio"):" "+translate(o.lanaguage,"general.portfolio");break;} $(".favouritehdr").html(sText);} if($(".portfolio").length>0) {$(".portfolio").on ('click',function() {sID=$(this).data('q23prprty');vParent=$(this).parent();vChild=vParent.find(".favourited");nCount=parseInt(vChild.text(),10);nNew=nCount+1;$.ajax ({async:false,beforeSubmit:function(){},error:function(jqXHR,textStatus,errorThrown) {console.log('Portfolio: '+textStatus+' '+errorThrown);},success:function(response) {var o=$.parseJSON($(".searchData").html());var p=$.parseJSON(response);if(p["text"]!=="add") {sText=o.portfolioShowTitle==='true'?o.portfolioOffTitle:"";$("."+sID).attr("title",o.portfolioOffTitle).html(' '+sText);if($(".q23Sort").length>0) {$(".q23Sort").find('.parent'+sID).remove();}} else {sText=o.portfolioShowTitle==='true'?o.portfolioOnTitle:"";$("."+sID).attr("title",o.portfolioOnTitle).html(' '+sText);vChild.text(nNew);} updateCount(response);return true;},type:'post',url:"/jx/prtfl.update.php?"+$(this).attr('data-q23')});})} if($("#masterslider").length>0) {var slider=new MasterSlider();slider.control('arrows');slider.setup('masterslider',{width:1800,height:600,view:'fade',space:1,layout:'fullwidth',fullscreenMargin:0,overPause:false,speed:20,loop:true,preload:0,autoplay:true});} if($("#masterslider-850").length>0) {var slider=new MasterSlider();slider.control('arrows');slider.setup('masterslider-850',{width:1800,height:850,view:'fade',space:1,layout:'fullwidth',fullscreenMargin:0,overPause:false,speed:20,loop:true,preload:0,autoplay:true});} if($("#masterslider-350").length>0) {var slider=new MasterSlider();slider.control('arrows');slider.setup('masterslider-350',{width:1800,height:350,view:'fade',space:1,layout:'fullwidth',fullscreenMargin:0,overPause:false,speed:20,loop:true,preload:0,autoplay:true});} if($("#masterslider-boxed").length>0) {console.log("here");var slider=new MasterSlider();slider.control('arrows');slider.setup('masterslider-boxed',{width:1140,height:550,view:'fade',space:1,layout:'boxed',fullscreenMargin:0,overPause:false,speed:20,loop:true,preload:0,autoplay:true});} if($("#masterslider-boxed-400").length>0) {console.log("here");var slider=new MasterSlider();slider.control('arrows');slider.setup('masterslider-boxed-400',{width:1140,height:400,view:'fade',space:1,layout:'boxed',fullscreenMargin:0,overPause:false,speed:20,loop:true,preload:0,autoplay:true});} if($("#masterslider-fill").length>0) {console.log("here");var slider=new MasterSlider();slider.control('arrows');slider.setup('masterslider-fill',{width:800,height:500,view:'fade',space:1,layout:'autofill',loop:true,preload:0,autoplay:true});} if($("#masterslider-fullscreen").length>0) {console.log("here");var slider=new MasterSlider();slider.control('arrows');slider.setup('masterslider-fullscreen',{width:1800,height:980,view:'fade',space:5,layout:'fullscreen',fullscreenMargin:0,overPause:false,speed:20,loop:true,preload:0,autoplay:true});} $(window).scroll (function() {"use strict";var scroll=$(window).scrollTop();if(scroll>60) {$(".navbar").addClass("scroll-fixed-navbar");} else {$(".navbar").removeClass("scroll-fixed-navbar");}});$('ul.dropdown-menu [data-toggle=dropdown]').on('click',function(event){event.preventDefault();event.stopPropagation();$(this).parent().siblings().removeClass('open');$(this).parent().toggleClass('open');});jQuery(function($){if($(window).width()>769){$('.navbar .dropdown').hover(function(){$(this).find('.dropdown-menu').first().stop(true,true).delay(250).slideDown();$(this).addClass('open');},function(){$(this).find('.dropdown-menu').first().stop(true,true).delay(100).slideUp();$(this).removeClass('open');});$('.navbar .dropdown > a').click(function(){location.href=this.href;});}});$(".sticky").sticky({topSpacing:0});$(window).scroll (function() {if($(this).scrollTop()>0) {$('#scroller').fadeIn();} else {$('#scroller').fadeOut();}});$('.btt').click (function() {$('body,html').animate({scrollTop:0},600);return false;});function centerModals() {$('.modal').each (function(i) {var $clone=$(this).clone().css('display','block').appendTo('body');var top=($clone.height()-$clone.find('.modal-content').height())/2;top=top>0?top:0;$clone.remove();$(this).find('.modal-content').css("margin-top",top);});} $('.modal').on('show.bs.modal',centerModals);$(window).on('resize',centerModals);if($(".owl-carousel").length>0) {$('.owl-carousel').owlCarousel ({loop:true,margin:30,nav:true,autoplay:true,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:1000,navContainer:'#customNav',navText:["","",],responsive:{0:{items:1},600:{items:2},1000:{items:3}}});$(".next").click(function(){owl.trigger('next.owl.carousel');});$(".prev").click(function(){owl.trigger('prev.owl.carousel');});} if($(".owl-carousel-no-gutter").length>0) {$('.owl-carousel-no-gutter').owlCarousel ({loop:true,margin:0,nav:true,autoplay:true,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:1000,navContainer:'#customNav',navText:["","",],responsive:{0:{items:1},600:{items:2},1000:{items:3}}});$(".next").click(function(){owl.trigger('next.owl.carousel');});$(".prev").click(function(){owl.trigger('prev.owl.carousel');});} if($(".owl-carousel-4").length>0) {$('.owl-carousel-4').owlCarousel ({loop:true,margin:30,nav:true,autoplay:true,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:1000,navContainer:'#customNav',navText:["","",],responsive:{0:{items:1},600:{items:2},1000:{items:4}}});$(".next").click(function(){owl.trigger('next.owl.carousel');});$(".prev").click(function(){owl.trigger('prev.owl.carousel');});} if($(".owl-carousel-6").length>0) {$('.owl-carousel-6').owlCarousel ({loop:true,margin:30,nav:true,autoplay:true,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:1000,navContainer:'#customNav',navText:["","",],responsive:{0:{items:2},600:{items:4},1000:{items:6}}});$(".next").click(function(){owl.trigger('next.owl.carousel');});$(".prev").click(function(){owl.trigger('prev.owl.carousel');});} if($(".owl-carousel-partners").length>0) {$('.owl-carousel-partners').owlCarousel ({loop:true,margin:0,nav:false,autoplay:true,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:1000,responsive:{0:{items:2},600:{items:4},1000:{items:7}}});} $('.currency').on ({"click":function(event) {if($(event.target).closest('.dropdown-toggle').length) {$(this).data('closable',true);} else {$(this).data('closable',false);}},"hide.bs.dropdown":function(event) {hide=$(this).data('closable');$(this).data('closable',true);return hide;}});$(function(){$('[data-toggle="tooltip"]').tooltip()}) $('.request-callback .toggler').on ('click',function(event) {event.preventDefault();$(this).closest('.request-callback').toggleClass('opened');});if($("#map").length>0) {if(typeof google!=='undefined') {google.maps.event.addDomListener(window,'load',initialiseMap);}} switch(oSearch.key) {case"im1-1bbcab82-c8a4-4566-aff9-679b5fa048cc":case"mltr-c0f65d53-7dc6-45ee-bd84-e6ab548cec67":case"mp1-71de-684e-43bf-8346-2dac":case"vmn-a4177c01-a6e9-4766-ac6b-0fd517468062":case"se2-e793dc19-9b82-41e6-b8ee-6251c37176d5":break;default:$.cookiesDirective ({privacyPolicyUri:'/'+sLng+'/privacy-policy/',explicitConsent:false,position:'bottom',cookieScripts:'Google Analytics',backgroundColor:'#2D2D2D',backgroundOpacity:'80',fontColor:'#000000',linkColor:'#ffffff'});break;} if($('#carousel-testimonial').length>0) {$('#carousel-testimonial').carousel({interval:10000})} if($("#frmCallBack").length>0) {$('#frmCallBack').ajaxForm ({url:'/'+sLng+'/lead/callback/',type:'post',beforeSubmit:function() {$('#frmCallBack').validate ({rules:{email:{required:true,email:true}},messages:{email:''},errorElement:"div"});console.log($('#frmCallBack').valid());if($('#frmCallBack').valid()) {return true;} return false;},success:function(response) {if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmCallBack').html(response);}}});} if($("#frmNewsletterSignup").length>0) {$('#frmNewsletterSignup').ajaxForm ({url:'/'+sLng+'/lead/newsletter/',type:'post',beforeSubmit:function() {$('#frmNewsletterSignup').validate ({rules:{email:{required:true,email:true}},messages:{email:''},errorElement:"div"});console.log($('#frmNewsletterSignup').valid());if($('#frmNewsletterSignup').valid()) {$('#frmNewsletterSignupWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmNewsletterSignupWrapper').html(response);}}});} if($("#frmCallbackListing").length>0) {var sText=$('#subjectCBL').val();$('#subjectCBL').val(sText.replace('{ourID}',$('.oid').html()));$('#pidCBL').val($('.lid').html());$('#prfCBL').val($('.oid').html());console.log($('#subjectCBL').val());$('#frmCallbackListing').ajaxForm ({url:'/'+sLng+'/lead/callbacklisting/',type:'post',beforeSubmit:function() {$('#frmCallbackListing').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmCallbackListing').valid());if($('#frmCallbackListing').valid()) {$('#frmCallbackListingWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('frmCallbackListingWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmCallbackListingWrapper').html(response);}}});} if($("#frmContactMain").length>0) {$('#frmContactMain').ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSubmit:function() {$('#frmContactMain').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmContactMain').valid());if($('#frmContactMain').valid()) {$('#frmContactMainWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmContactMainWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmContactMainWrapper').html(response);}}});} if($("#frmContactQuick").length>0) {$('#frmContactQuick').ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSubmit:function() {$('#frmContactQuick').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmContactQuick').valid());if($('#frmContactQuick').valid()) {$('#frmContactQuickWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmContactQuickWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmContactQuickWrapper').html(response);}}});} if($("#frmContactLong").length>0) {$('#frmContactLong').ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSubmit:function() {$('#frmContactLong').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmContactLong').valid());if($('#frmContactLong').valid()) {$('#frmContactLongWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmContactLongWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmContactLongWrapper').html(response);}}});} if($("#frmPropertyAlert").length>0) {$('#frmPropertyAlert').ajaxForm ({url:'/'+sLng+'/lead/alert/',type:'post',beforeSubmit:function() {$('#frmPropertyAlert').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmPropertyAlert').valid());if($('#frmPropertyAlert').valid()) {return true;} return false;},success:function(response) {if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmPropertyAlertWrapper').html(response);}}});} if($('#frmRecommend').length>0) {$('#frmRecommend').ajaxForm ({url:'/'+sLng+'/lead/recommend/',type:'post',beforeSubmit:function() {$('#frmRecommend').validate ({rules:{name:{required:true},email:{required:true,email:true},nameFriend:{required:true},emailFriend:{required:true,email:true}},messages:{name:'',email:'',nameFriend:'',emailFriend:''},errorElement:"div"});if($('#frmRecommend').valid()) {$('#frmRecommendWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmRecommendWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmRecommendWrapper').html(response);}}});} if($('#frmPropertyFinder').length>0) {$('#frmPropertyFinder').ajaxForm ({url:'/'+sLng+'/lead/finder/',type:'post',beforeSubmit:function() {$('#frmPropertyFinder').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmPropertyFinder').valid());if($('#frmPropertyFinder').valid()) {return true;} return false;},success:function(response) {if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmPropertyFinderWrapper').html(response);}}});} if($('#frmPropertyFinderExtended').length>0) {$('#frmPropertyFinderExtended').ajaxForm ({url:'/'+sLng+'/lead/finder/',type:'post',beforeSubmit:function() {$('#frmPropertyFinderExtended').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmPropertyFinderExtended').valid());if($('#frmPropertyFinderExtended').valid()) {return true;} return false;},success:function(response) {if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmPropertyFinderExtendedWrapper').html(response);}}});} if($('#frmPropertyFinderQuick0').length>0) {$('#frmPropertyFinderQuick0').ajaxForm ({url:'/'+sLng+'/lead/finder/',type:'post',beforeSubmit:function() {$('#frmPropertyFinderQuick0').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmPropertyFinderQuick0').valid());if($('#frmPropertyFinderQuick0').valid()) {return true;} return false;},success:function(response) {if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmPropertyFinderQuick0Wrapper').html(response);}}});} if($('#frmPropertyFinderQuick1').length>0) {$('#frmPropertyFinderQuick1').ajaxForm ({url:'/'+sLng+'/lead/finder/',type:'post',beforeSubmit:function() {$('#frmPropertyFinderQuick1').validate ({rules:{name:{required:true},email:{required:true,email:true}},messages:{name:'',email:''},errorElement:"div"});console.log($('#frmPropertyFinderQuick1').valid());if($('#frmPropertyFinderQuick1').valid()) {return true;} return false;},success:function(response) {if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmPropertyFinderQuick1Wrapper').html(response);}}});} if($('#frmEnquiry').length>0) {$('#frmEnquiry').ajaxForm ({url:'/en/lead/enquiry/',type:'post',beforeSubmit:function() {$('#frmEnquiry').validate ({rules:{name:{required:true},email:{required:true,email:true},accept:{required:true}},messages:{name:'',email:'',accept:''},errorElement:"div"});console.log($('#frmEnquiry').valid());if($('#frmEnquiry').valid()) {$('#frmEnquiryWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmEnquiryWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmEnquiryWrapper').html(response);}}});} if($('#frmValuation').length>0) {$('#frmValuation').ajaxForm ({url:'/en/lead/valuation/',type:'post',beforeSubmit:function() {$('#frmValuation').validate ({rules:{name:{required:true},email:{required:true,email:true},accept:{required:true}},messages:{name:'',email:'',accept:''},errorElement:"div"});console.log($('#frmValuation').valid());if($('#frmValuation').valid()) {$('#frmValuationWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmValuationWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmValuationWrapper').html(response);}}});} if($('#frmListProperty').length>0) {$('#frmListProperty').ajaxForm ({url:'/en/lead/property/',type:'post',beforeSubmit:function() {$('#frmListProperty').validate ({rules:{name:{required:true},email:{required:true,email:true},accept:{required:true}},messages:{name:'',email:'',accept:''},errorElement:"div"});console.log($('#frmListProperty').valid());if($('#frmListProperty').valid()) {$('#frmListPropertyWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmListPropertyWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmListPropertyWrapper').html(response);}}});} if($('#frmHotProperty').length>0) {$('#frmHotProperty').ajaxForm ({url:'/en/lead/property/',type:'post',beforeSubmit:function() {$('#frmHotProperty').validate ({rules:{name:{required:true},email:{required:true,email:true},accept:{required:true}},messages:{name:'',email:'',accept:''},errorElement:"div"});console.log($('#frmHotProperty').valid());if($('#frmHotProperty').valid()) {$('#frmHotPropertyWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmHotPropertyWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmHotPropertyWrapper').html(response);}}});} if($('#frmLanding').length>0) {$('#frmLanding').ajaxForm ({url:'/en/lead/landing/',type:'post',beforeSubmit:function() {$('#frmLanding').validate ({rules:{name:{required:true},email:{required:true,email:true},accept:{required:true}},messages:{name:'',email:'',accept:''},errorElement:"div"});if($('#frmLanding').valid()) {$('#frmLandingWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmLandingWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location=window.location.href+"/"+response+"/";} else {$('#frmLandingWrapper').html(response);}}});} if($('#frmSellProperty').length>0) {$('#frmSellProperty').ajaxForm ({url:'/en/lead/hotproperty/',type:'post',beforeSubmit:function() {$('#frmSellProperty').validate ({rules:{name:{required:true},email:{required:true,email:true},accept:{required:true}},messages:{name:'',email:'',accept:''},errorElement:"div"});console.log($('#frmSellProperty').valid());if($('#frmSellProperty').valid()) {$('#frmSellPropertyWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmSellPropertyWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmSellPropertyWrapper').html(response);}}});} if($('#frmAgent').length>0) {$('#frmAgent').ajaxForm ({url:'/en/lead/agent/',type:'post',beforeSubmit:function() {$('#frmAgent').validate ({rules:{name:{required:true},email:{required:true,email:true},accept:{required:true}},messages:{name:'',email:'',accept:''},errorElement:"div"});console.log($('#frmAgent').valid());if($('#frmAgent').valid()) {$('frmAgentWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('frmAgentWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmAgentWrapper').html(response);}}});} if($('#frmBooking').length>0) {$('#frmBooking').ajaxForm ({url:'/jx/booking/request/',type:'post',beforeSubmit:function() {$('#frmBooking').validate ({rules:{name:{required:true},email:{required:true,email:true},telephone:{required:true},},messages:{name:'',email:'',telephone:''},errorElement:"div"});console.log($('#frmBooking').valid());if($('#frmBooking').valid()) {$('#frmBookingWrapper').block ({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',height:'100%',width:'100%',backgroundColor:'#fefefe',opacity:0.5},message:'',});return true;} return false;},success:function(response) {$('#frmBookingWrapper').unblock();if(oSearch.thankYouPage=='y') {window.location="/"+sLng+"/"+response+"/";} else {$('#frmBookingWrapper').html(response);}}});} if($('#weather').length>0) {$("#weather").load("/jx/weather.load.php");} $('a.back').click (function() {parent.history.back();return false;});if($('#frmMortgage').length>0) {$("#amount").val(addCommas($(".prc").html(),"."));$('#start-date, #amount, #interest, #term-years, #term-months').keyup(calculateMonthlyPayment);calculateMonthlyPayment();} if($("#gallerySlider").length>0) {var slider=new MasterSlider();slider.control('arrows');slider.control('lightbox');slider.control('thumblist',{autohide:false,dir:'h',align:'bottom',width:130,height:95,margin:1,space:1,hideUnder:400});slider.setup('gallerySlider',{width:1240,height:700,layout:'boxed',space:0,loop:true,autoplay:true,view:'fade'});$("a[data-gal^='prettyPhoto']").prettyPhoto({deeplinking:false,social_tools:false,overlay_gallery:false});} if($("#gallerySliderCMS").length>0) {var slider=new MasterSlider();slider.control('arrows');slider.control('lightbox');slider.control('thumblist',{autohide:false,dir:'h',align:'bottom',width:130,height:95,margin:1,space:1,hideUnder:400});slider.setup('gallerySliderCMS',{width:1240,height:700,layout:'boxed',space:0,loop:true,autoplay:true,view:'fade'});$("a[data-gal^='prettyPhoto']").prettyPhoto({deeplinking:false,social_tools:false,overlay_gallery:false});} if($("#currencyConverter").length>0) {function calculate() {n=$("#amountCC").val().replace(/\D/g,'')/$("#convertFromCC").children(":selected").attr("data-q23");n=n*$("#convertToCC").children(":selected").attr("data-q23");n=numeral(n).format('0,0');$("#resultCC").val(n);} $("#refreshCC").on("click",function(){calculate()});$("#amountCC").on("change",function(){calculate()});$("#convertFromCC").on("change",function(){calculate()});$("#convertToCC").on("change",function(){calculate()});$("#amountCC").val(numeral($(".prc").html().replace(/\D/g,'')).format('0,0'));$("#convertToCC").val("GBP");$("#convertToCC").selectpicker('refresh');calculate();} if($(".func").length>0) {$('.func').each (function(index) {$(this).load ('/jx/function.php?'+$(this).attr('data-q23'));})} function togglePanelIcon(e) {$(e.target).prev(".panel-heading").find(".accordion_icon").toggleClass("fa-plus fa-minus");} $('.panel-group').on('hidden.bs.collapse',togglePanelIcon);$('.panel-group').on('shown.bs.collapse',togglePanelIcon);});;function hilite(element) {if($(element).is(':checkbox')) {$(element).parent().css("border-bottom","1px solid red");} else {$(element).css("border","1px solid red");} return;} function unhilite(element) {if($(element).is(':checkbox')) {$(element).parent().css("border-bottom","1px none");} else {$(element).css("border","none");}} $(document).ready (function() {oSearch=$.parseJSON($(".searchData").html());sLng=$('meta[property="og:locale"]').attr("content").split("_")[0];if(sLng=="") {sLng=$('html').attr("lang");} function telInputBlur(bIsTeleInput,sID) {if(bIsTeleInput) {$(sID).intlTelInput("setNumber",$(sID).intlTelInput("getNumber",intlTelInputUtils.numberFormat.E164));}} function telInputBefore(bIsTeleInput,sID) {if(bIsTeleInput) {$(sID).intlTelInput("setNumber",$(sID).intlTelInput("getNumber",intlTelInputUtils.numberFormat.E164));}} if(typeof jTheme!=='undefined') {bTelInput=false;oTheme=JSON.parse(jTheme);if(oTheme.telinput) {bTelInput=oTheme.telinput;$("#telephoneCBL, #telephoneCBS, #telephoneCntct, #telephoneCntctAlt, #telephoneCI, #telephoneLG, telephoneDevEnq, #telephoneEnq, telephonePRPRTY, #telephonePRTFL, #telephonePRE, #telephonePR, #telephoneV").intlTelInput ({preferredCountries:oTheme.telcountry,nationalMode:false,initialCountry:"auto",geoIpLookup:function(callback){$.get('https://ipinfo.io',function(){},"jsonp").always(function(resp){var countryCode=(resp&&resp.country)?resp.country:"";callback(countryCode);});},utilsScript:"/inc/vndr/fone/js/utils.js"});}} else {bTelInput=false;} if($("#frmPdfDownloadGDPR").length>0) {$("#frmPdfDownloadGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function(){},beforeSubmit:function() {$("#frmPdfDownloadGDPR").validate ({rules:{nameDL:{required:true},emailDL:{required:true,email:true},acceptDL:{required:true},consentDL:{required:true}},messages:{nameDL:'',emailDL:'',acceptDL:'',consentDL:''},highlight:function(element,errorClass,validClass){hilite(element);},unhighlight:function(element,errorClass,validClass){unhilite(element);},errorElement:"div"});if($("#frmPdfDownloadGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmCallBackGDPR").length>0) {$("#telephoneCBS").blur(function(){telInputBlur(bTelInput,"#telephoneCBS")});$("#frmCallBackGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneCBS")},beforeSubmit:function() {$("#frmCallBackGDPR").validate ({rules:{nameCBS:{required:true},emailCBS:{required:true,email:true},telephoneCBS:{required:true},acceptCBS:{required:true},consentCBS:{required:true}},messages:{nameCBS:'',emailCBS:'',telephoneCBS:'',acceptCBS:'',consentCBS:''},errorElement:"div"});if($("#frmCallBackGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}})} if($("#frmCallbackListingGDPR").length>0) {$("#subject").val(translate(sLng,"listing.reference")+": "+$(".oid").html());$("#telephoneCBL").blur(function(){telInputBlur(bTelInput,"#telephoneCBL")});$("#frmCallbackListingGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneCBL")},beforeSubmit:function() {$("#frmCallbackListingGDPR").validate ({rules:{nameCBL:{required:true},emailCBL:{required:true,email:true},telephoneCBL:{required:true},acceptCBL:{required:true},consentCBL:{required:true}},messages:{nameCBL:'',emailCBL:'',telephoneCBL:'',acceptCBL:'',consentCBL:''},errorElement:"div"});if($("#frmCallbackListingGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}})} if($("#frmContactMainGDPR").length>0) {$("#telephoneCntct").blur(function(){telInputBlur(bTelInput,"#telephoneCntct")});$("#frmContactMainGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneCntct")},beforeSubmit:function() {$("#frmContactMainGDPR").validate ({rules:{nameCntct:{required:true},emailCntct:{required:true,email:true},acceptCntct:{required:true},consentCntct:{required:true}},messages:{nameCntct:'',emailCntct:'',acceptCntct:'',consentCntct:''},highlight:function(element,errorClass,validClass){hilite(element);},unhighlight:function(element,errorClass,validClass){unhilite(element);},errorElement:"div"});if($("#frmContactMainGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmContactAltGDPR").length>0) {$("#telephoneCntctAlt").blur(function(){telInputBlur(bTelInput,"#telephoneCntctAlt")});$("#frmContactAltGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneCntctAlt")},beforeSubmit:function() {$("#frmContactAltGDPR").validate ({rules:{nameCntctAlt:{required:true},emailCntctAlt:{required:true,email:true},acceptCntctAlt:{required:true},consentCntctAlt:{required:true}},messages:{nameCntctAlt:'',emailCntctAlt:'',acceptCntctAlt:'',consentCntctAlt:''},errorElement:"div"});if($("#frmContactAltGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmContactInterestGDPR").length>0) {$("#telephoneCI").blur(function(){telInputBlur(bTelInput,"#telephoneCI")});$("#frmContactInterestGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneCI")},beforeSubmit:function() {$("#frmContactInterestGDPR").validate ({rules:{nameCI:{required:true},emailCI:{required:true,email:true},acceptCI:{required:true},consentCI:{required:true}},messages:{nameCI:'',emailCI:'',acceptCI:'',consentCI:''},errorElement:"div"});if($("#frmContactInterestGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmContactLongGDPR").length>0) {$("#telephoneLG").blur(function(){telInputBlur(bTelInput,"#telephoneLG")});$("#frmContactLongGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneLG")},beforeSubmit:function() {$("#frmContactLongGDPR").validate ({rules:{nameLG:{required:true},surnameLG:{required:true},emailLG:{required:true,email:true},acceptLG:{required:true},consentLG:{required:true}},messages:{nameLG:'',surnameLG:'',emailLG:'',acceptLG:'',consentLG:''},errorElement:"div"});if($("#frmContactLongGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmContactQuickGDPR").length>0) {$("#frmContactQuickGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSubmit:function() {$("#frmContactQuickGDPR").validate ({rules:{nameQK:{required:true},emailQK:{required:true,email:true},acceptQK:{required:true},consentQK:{required:true}},messages:{nameQK:'',emailQK:'',acceptQK:'',consentQK:''},errorElement:"div"});if($("#frmContactQuickGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmDownloadGDPR").length>0) {$("#telephoneCntct").blur(function(){telInputBlur(bTelInput,"#telephoneCntct")});$("#frmDownloadGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneCntct")},beforeSubmit:function() {$("#frmDownloadGDPR").validate ({rules:{nameDwnld:{required:true},emailDwnld:{required:true,email:true},acceptDwnld:{required:true},consentDwnld:{required:true}},messages:{nameDwnld:'',emailDwnld:'',acceptDwnld:'',consentDwnld:''},errorElement:"div"});if($("#frmDownloadGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmDevelopmentEnquiryGDPR").length>0) {$("#subjectDevEnq").val(translate(sLng,"listing.reference")+": "+$(".oid").html());$("#telephoneDevEnq").blur(function(){telInputBlur(bTelInput,"#telephoneDevEnq")});$("#frmDevelopmentEnquiryGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneDevEnq")},beforeSerialize:function() {},beforeSubmit:function() {$("#frmDevelopmentEnquiryGDPR").validate ({rules:{nameDevEnq:{required:true},emailDevEnq:{required:true,email:true},acceptDevEnq:{required:true},consentDevEnq:{required:true}},messages:{nameDevEnq:'',emailDevEnq:'',acceptDevEnq:'',consentDevEnq:''},errorElement:"div"});if($("#frmDevelopmentEnquiryGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmListPropertyGDPR").length>0) {$("#telephonePRPRTY").blur(function(){telInputBlur(bTelInput,"#telephonePRPRTY")});$("#frmListPropertyGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephonePRPRTY")},beforeSubmit:function() {$("#frmListPropertyGDPR").validate ({rules:{namePRPRTY:{required:true},emailPRPRTY:{required:true,email:true},acceptPRPRTY:{required:true},consentPRPRTY:{required:true}},messages:{namePRPRTY:'',emailPRPRTY:'',acceptPRPRTY:'',consentPRPRTY:''},errorElement:"div"});if($("#frmListPropertyGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmEnquiryGDPR").length>0) {$("#pidEnq").val($(".lid").html());$("#prfEnq").val($(".oid").html());$("#subjectEnq").val(translate(sLng,"listing.reference")+": "+$(".oid").html());$("#telephoneEnq").blur(function(){telInputBlur(bTelInput,"#telephoneEnq")});$("#frmEnquiryGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneEnq")},beforeSubmit:function() {$("#frmEnquiryGDPR").validate ({rules:{nameEnq:{required:true},emailEnq:{required:true,email:true},acceptEnq:{required:true},consentEnq:{required:true}},messages:{nameEnq:'',emailEnq:'',acceptEnq:'',consentEnq:''},highlight:function(element,errorClass,validClass){hilite(element);},unhighlight:function(element,errorClass,validClass){unhilite(element);},errorElement:"div"});if($("#frmEnquiryGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmKnowYourClientGDPR").length>0) {$("#frmKnowYourClientGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSubmit:function() {$("#frmKnowYourClientGDPR").validate ({rules:{nameKYC:{required:true},surnameKYC:{required:true},passportKYC:{required:true},nationalityKYC:{required:true},countryKYC:{required:true},emailKYC:{required:true,email:true},telephoneKYC:{required:true},acceptKYC:{required:true},consentKYC:{required:true}},messages:{nameKYC:'',surnameKYC:'',passportKYC:'',nationalityKYC:'',countryKYC:'',emailKYC:'',telephoneKYC:'',acceptKYC:'',consentKYC:''},errorElement:"div"});if($("#frmKnowYourClientGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmNewsletterSignupGDPR").length>0) {$("#frmNewsletterSignupGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSubmit:function() {$("#frmNewsletterSignupGDPR").validate ({rules:{nameNLS:{required:true},emailNLS:{required:true,email:true},acceptNLS:{required:true},consentNLS:{required:true}},messages:{nameNLS:'',emailNLS:'',acceptNLS:'',consentNLS:''},errorElement:"div"});if($("#frmNewsletterSignupGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmPortfolioMainGDPR").length>0) {var sLng=$("#language").val();var sData=getIndentifier();$("#telephonePRTFL").blur(function(){telInputBlur(bTelInput,"#telephonePRTFL")});$("#frmPortfolioMainGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephonePRTFL")},beforeSubmit:function(arr,$form,options) {arr.push({name:'id',value:getIndentifier()});console.log(arr);$("#frmPortfolioMainGDPR").validate ({rules:{namePRTFL:{required:true},emailPRTFL:{required:true,email:true},acceptPRTFL:{required:true},consentPRTFL:{required:true}},messages:{namePRTFL:'',emailPRTFL:'',acceptPRTFL:'',consentPRTFL:''},highlight:function(element,errorClass,validClass){hilite(element);},unhighlight:function(element,errorClass,validClass){unhilite(element);},errorElement:"div"});if($("#frmPortfolioMainGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmPropertyFinderGDPR").length>0) {$("#telephonePR").blur(function(){telInputBlur(bTelInput,"#telephonePR")});$("#frmPropertyFinderGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephonePR")},beforeSubmit:function() {$("#frmPropertyFinderGDPR").validate ({rules:{namePR:{required:true},emailPR:{required:true,email:true},acceptPR:{required:true},consentPR:{required:true}},messages:{namePR:'',emailPR:'',acceptPR:'',consentPR:''},errorElement:"div"});if($("#frmPropertyFinderGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmPropertyFinderExtendedGDPR").length>0) {$("#telephonePRE").blur(function(){telInputBlur(bTelInput,"#telephonePRE")});$("#frmPropertyFinderExtendedGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephonePRE")},beforeSubmit:function() {$("#frmPropertyFinderExtendedGDPR").validate ({rules:{namePRE:{required:true},emailPRE:{required:true,email:true},acceptPRE:{required:true},consentPRE:{required:true}},messages:{namePRE:'',emailPRE:'',acceptPRE:'',consentPRE:''},errorElement:"div"});if($("#frmPropertyFinderExtendedGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmValuationGDPR").length>0) {$("#telephoneV").blur(function(){telInputBlur(bTelInput,"#telephoneV")});$("#frmValuationGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneV")},beforeSubmit:function() {$("#frmValuationGDPR").validate ({rules:{nameV:{required:true},emailV:{required:true,email:true},telephoneV:{required:true},acceptV:{required:true},consentV:{required:true}},messages:{nameV:'',emailV:'',telephoneV:'',acceptV:'',consentV:''},errorElement:"div"});if($("#frmValuationGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmServiceGDPR").length>0) {var sURL=window.location.href.replace(/\/$/,'');var sTmp=sURL.substr(sURL.lastIndexOf('/')+1);var sTmp=properCase(sTmp.replace("-"," "));var sMeta=$('meta[name=title]').attr("content");$("#subjectSRV").val(sMeta);$("#telephoneSRV").blur(function(){telInputBlur(bTelInput,"#telephoneSRV")});$("#frmServiceGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneSRV")},beforeSubmit:function() {$("#frmServiceGDPR").validate ({rules:{countrySRV:{required:true},nameSRV:{required:true},emailSRV:{required:true,email:true},acceptSRV:{required:true},consentSRV:{required:true}},messages:{countrySRV:'',nameSRV:'',emailSRV:'',acceptSRV:'',consentSRV:''},errorElement:"div"});if($("#frmServiceGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmHotPropertyGDPR").length>0) {$("#telephoneHTPRPRTY").blur(function(){telInputBlur(bTelInput,"#telephoneHTPRPRTY")});$("#frmHotPropertyGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneHTPRPRTY")},beforeSubmit:function() {$("#frmHotPropertyGDPR").validate ({rules:{nameHTPRPRTY:{required:true},emailHTPRPRTY:{required:true,email:true},telephoneHTPRPRTY:{required:true},acceptHTPRPRTY:{required:true},consentHTPRPRTY:{required:true}},messages:{nameHTPRPRTY:'',emailHTPRPRTY:'',telephoneHTPRPRTY:'',acceptHTPRPRTY:'',consentHTPRPRTY:''},errorElement:"div"});if($("#frmHotPropertyGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmSellPropertyGDPR").length>0) {$("#telephoneSYPPRPRTY").blur(function(){telInputBlur(bTelInput,"#telephoneSYPPRPRTY")});$("#frmSellPropertyGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneSYPPRPRTY")},beforeSubmit:function() {$("#frmSellPropertyGDPR").validate ({rules:{nameSYPPRPRTY:{required:true},emailSYPPRPRTY:{required:true,email:true},telephoneSYPPRPRTY:{required:true},acceptSYPPRPRTY:{required:true},consentSYPPRPRTY:{required:true}},messages:{nameSYPPRPRTY:'',emailSYPPRPRTY:'',telephoneSYPPRPRTY:'',acceptSYPPRPRTY:'',consentSYPPRPRTY:''},errorElement:"div"});if($("#frmSellPropertyGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmAgentGDPR").length>0) {$("#telephoneASU").blur(function(){telInputBlur(bTelInput,"#telephoneASU")});$("#frmAgentGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneASU")},beforeSubmit:function() {$("#frmAgentGDPR").validate ({rules:{companyASU:{required:true},nameASU:{required:true},emailASU:{required:true,email:true},telephoneASU:{required:true},acceptASU:{required:true},consentASU:{required:true}},messages:{companyASU:'',nameASU:'',emailASU:'',telephoneASU:'',acceptASU:'',consentASU:''},errorElement:"div"});if($("#frmAgentGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location="/"+sLng+"/"+response+"/";}});} if($("#frmLandingGDPR").length>0) {$("#telephoneLPC").blur(function(){telInputBlur(bTelInput,"#telephoneLPC")});$("#frmLandingGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneLPC")},beforeSubmit:function() {$("#frmLandingGDPR").validate ({rules:{nameLPC:{required:true},emailLPC:{required:true,email:true},telephoneLPC:{required:true},countryLPC:{required:true},acceptLPC:{required:true},consentLPC:{required:true}},messages:{nameLPC:'',emailLPC:'',telephoneLPC:'',countryLPC:'',acceptLPC:'',consentLPC:''},errorElement:"div"});if($("#frmLandingGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location=$('#frmLandingGDPR').find('input[name="next"]').val();}});} if($("#frmLandingLstGDPR").length>0) {$("#telephoneLPM").blur(function(){telInputBlur(bTelInput,"#telephoneLPM")});$("#frmLandingLstGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneLPM")},beforeSubmit:function() {$("#frmLandingLstGDPR").validate ({rules:{nameLPM:{required:true},emailLPM:{required:true,email:true},telephoneLPM:{required:true},countryLPM:{required:true},acceptLPM:{required:true},consentLPM:{required:true}},messages:{nameLPM:'',emailLPM:'',telephoneLPM:'',countryLPM:'',acceptLPM:'',consentLPM:''},errorElement:"div"});if($("#frmLandingLstGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location=$('#frmLandingGDPR').find('input[name="next"]').val();}});} if($("#frmLandingFooterGDPR").length>0) {console.log("lft");$("#telephoneLPF").blur(function(){telInputBlur(bTelInput,"#telephoneLPF")});$("#frmLandingFooterGDPR").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {telInputBefore(bTelInput,"#telephoneLPF")},beforeSubmit:function() {$("#frmLandingFooterGDPR").validate ({rules:{nameLPF:{required:true},emailLPF:{required:true,email:true},telephoneLPF:{required:true},countryLPF:{required:true},acceptLPF:{required:true},consentLPF:{required:true}},messages:{nameLPF:'',emailLPF:'',telephoneLPF:'',countryLPF:'',acceptLPF:'',consentLPF:''},errorElement:"div"});if($("#frmLandingFooterGDPR").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location=$('#frmLandingGDPR').find('input[name="next"]').val();}});} if($("#modalRepoForm").length>0) {$('#modalRepoForm').on ('show.bs.modal',function(event) {var button=$(event.relatedTarget);var ref=button.data('ref');var modal=$(this) modal.find('.modal-title').text('Enquiry '+ref);modal.find('.modal-body #subjectRP').val(ref) modal.find('.modal-body #prfRP').val(ref)}) $("#frmRepossession").ajaxForm ({url:'/'+sLng+'/lead/contact/',type:'post',beforeSerialize:function() {},beforeSubmit:function() {$("#frmRepossession").validate ({rules:{nameRP:{required:true},emailRP:{required:true,email:true},telephoneRP:{required:true},countryRP:{required:true},acceptRP:{required:true},consentRP:{required:true}},messages:{nameRP:'',emailRP:'',telephoneRP:'',countryRP:'',acceptRP:'',consentRP:''},errorElement:"div"});if($("#frmRepossession").valid()) {$.blockUI({overlayCSS:{backgroundColor:'#fefefe'},css:{border:'none',backgroundColor:'none'},message:''});return true;} return false;},success:function(response) {window.location=$('#frmLandingGDPR').find('input[name="next"]').val();}});}})
    '+_data.options.gauge.labels.low+''+_data.options.gauge.labels.high+'