").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
/* JQUERY EASING */ jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } });
/* JQUERY COLOR */(function(d){function i(){var b=d("script:first"),a=b.css("color"),c=false;if(/^rgba/.test(a))c=true;else try{c=a!=b.css("color","rgba(0, 0, 0, 0.5)").css("color");b.css("color",a)}catch(e){}return c}function g(b,a,c){var e="rgb"+(d.support.rgba?"a":"")+"("+parseInt(b[0]+c*(a[0]-b[0]),10)+","+parseInt(b[1]+c*(a[1]-b[1]),10)+","+parseInt(b[2]+c*(a[2]-b[2]),10);if(d.support.rgba)e+=","+(b&&a?parseFloat(b[3]+c*(a[3]-b[3])):1);e+=")";return e}function f(b){var a,c;if(a=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(b))c=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1];else if(a=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(b))c=[parseInt(a[1],16)*17,parseInt(a[2],16)*17,parseInt(a[3],16)*17,1];else if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))c=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),1];else if(a=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(b))c=[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];return c}d.extend(true,d,{support:{rgba:i()}});var h=["color","backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","outlineColor"];d.each(h,function(b,a){d.fx.step[a]=function(c){if(!c.init){c.a=f(d(c.elem).css(a));c.end=f(c.end);c.init=true}c.elem.style[a]=g(c.a,c.end,c.pos)}});d.fx.step.borderColor=function(b){if(!b.init)b.end=f(b.end);var a=h.slice(2,6);d.each(a,function(c,e){b.init||(b[e]={a:f(d(b.elem).css(e))});b.elem.style[e]=g(b[e].a,b.end,b.pos)});b.init=true}})(jQuery);
/* JQUERY BACKSTRETCH */ (function(e,t,n){"use strict";e.fn.backstretch=function(r,s){return(r===n||r.length===0)&&e.error("No images were supplied for Backstretch"),e(t).scrollTop()===0&&t.scrollTo(0,0),this.each(function(){var t=e(this),n=t.data("backstretch");n&&(s=e.extend(n.options,s),n.destroy(!0)),n=new i(this,r,s),t.data("backstretch",n)})},e.backstretch=function(t,n){return e("body").backstretch(t,n).data("backstretch")},e.expr[":"].backstretch=function(t){return e(t).data("backstretch")!==n},e.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5e3,fade:0};var r={wrap:{left:0,top:'-20%',overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},img:{position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxWidth:"none",zIndex:-999999}},i=function(n,i,o){this.options=e.extend({},e.fn.backstretch.defaults,o||{}),this.images=e.isArray(i)?i:[i],e.each(this.images,function(){e("
![]()
")[0].src=this}),this.isBody=n===document.body,this.$container=e(n),this.$wrap=e('
').css(r.wrap).appendTo(this.$container),this.$root=this.isBody?s?e(t):e(document):this.$container;if(!this.isBody){var u=this.$container.css("position"),a=this.$container.css("zIndex");this.$container.css({position:u==="static"?"relative":u,zIndex:a==="auto"?0:a,background:"none"}),this.$wrap.css({zIndex:-999998})}this.$wrap.css({position:this.isBody&&s?"fixed":"absolute"}),this.index=0,this.show(this.index),e(t).on("resize.backstretch",e.proxy(this.resize,this)).on("orientationchange.backstretch",e.proxy(function(){this.isBody&&t.pageYOffset===0&&(t.scrollTo(0,1),this.resize())},this))};i.prototype={resize:function(){try{var e={left:0,top:0},n=this.isBody?this.$root.width():this.$root.innerWidth(),r=n,i=this.isBody?t.innerHeight?t.innerHeight:this.$root.height():this.$root.innerHeight(),s=r/this.$img.data("ratio"),o;s>=i?(o=(s-i)/2,this.options.centeredY&&(e.top="-"+o+"px")):(s=i,r=s*this.$img.data("ratio"),o=(r-n)/2,this.options.centeredX&&(e.left="-"+o+"px")),this.$wrap.css({width:n,height:i}).find("img:not(.deleteable)").css({width:r,height:s}).css(e)}catch(u){}return this},show:function(t){if(Math.abs(t)>this.images.length-1)return;this.index=t;var n=this,i=n.$wrap.find("img").addClass("deleteable"),s=e.Event("backstretch.show",{relatedTarget:n.$container[0]});return clearInterval(n.interval),n.$img=e("
![]()
").css(r.img).bind("load",function(t){var r=this.width||e(t.target).width(),o=this.height||e(t.target).height();e(this).data("ratio",r/o),e(this).fadeIn(n.options.speed||n.options.fade,function(){i.remove(),n.paused||n.cycle(),n.$container.trigger(s,n)}),n.resize()}).appendTo(n.$wrap),n.$img.attr("src",n.images[t]),n},next:function(){return this.show(this.index
1&&(clearInterval(this.interval),this.interval=setInterval(e.proxy(function(){this.paused||this.next()},this),this.options.duration)),this},destroy:function(n){e(t).off("resize.backstretch orientationchange.backstretch"),clearInterval(this.interval),n||this.$wrap.remove(),this.$container.removeData("backstretch")}};var s=function(){var e=navigator.userAgent,n=navigator.platform,r=e.match(/AppleWebKit\/([0-9]+)/),i=!!r&&r[1],s=e.match(/Fennec\/([0-9]+)/),o=!!s&&s[1],u=e.match(/Opera Mobi\/([0-9]+)/),a=!!u&&u[1],f=e.match(/MSIE ([0-9]+)/),l=!!f&&f[1];return!((n.indexOf("iPhone")>-1||n.indexOf("iPad")>-1||n.indexOf("iPod")>-1)&&i&&i<534||t.operamini&&{}.toString.call(t.operamini)==="[object OperaMini]"||u&&a<7458||e.indexOf("Android")>-1&&i&&i<533||o&&o<6||"palmGetResource"in t&&i&&i<534||e.indexOf("MeeGo")>-1&&e.indexOf("NokiaBrowser/8.5.0")>-1||l&&l<=6)}()})(jQuery,window);
/* JQUERY MOUSEWHEEL */ (function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){module.exports=factory}else{factory(jQuery)}}(function($){var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'];var toBind='onwheel'in document||document.documentMode>=9?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'];var lowestDelta,lowestDeltaXY;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks}}$.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var i=toBind.length;i;){this.addEventListener(toBind[--i],handler,false)}}else{this.onmousewheel=handler}},teardown:function(){if(this.removeEventListener){for(var i=toBind.length;i;){this.removeEventListener(toBind[--i],handler,false)}}else{this.onmousewheel=null}}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}});function handler(event){var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0,absDeltaXY=0,fn;event=$.event.fix(orgEvent);event.type="mousewheel";if(orgEvent.wheelDelta){delta=orgEvent.wheelDelta}if(orgEvent.detail){delta=orgEvent.detail*-1}if(orgEvent.deltaY){deltaY=orgEvent.deltaY*-1;delta=deltaY}if(orgEvent.deltaX){deltaX=orgEvent.deltaX;delta=deltaX*-1}if(orgEvent.wheelDeltaY!==undefined){deltaY=orgEvent.wheelDeltaY}if(orgEvent.wheelDeltaX!==undefined){deltaX=orgEvent.wheelDeltaX*-1}absDelta=Math.abs(delta);if(!lowestDelta||absDelta0?'floor':'ceil';delta=Math[fn](delta/lowestDelta);deltaX=Math[fn](deltaX/lowestDeltaXY);deltaY=Math[fn](deltaY/lowestDeltaXY);args.unshift(event,delta,deltaX,deltaY);return($.event.dispatch||$.event.handle).apply(this,args)}}));
/* JQUERY TINYSCROLL */ (function(a){a.tiny=a.tiny||{};a.tiny.scrollbar={options:{axis:"y",wheel:40,scroll:true,lockscroll:true,size:"auto",sizethumb:"auto",invertscroll:false}};a.fn.tinyscrollbar=function(d){var c=a.extend({},a.tiny.scrollbar.options,d);this.each(function(){a(this).data("tsb",new b(a(this),c))});return this};a.fn.tinyscrollbar_update=function(c){return a(this).data("tsb").update(c)};function b(q,g){var k=this,t=q,j={obj:a(".viewport",q)},h={obj:a(".overview",q)},d={obj:a(".scrollbar",q)},m={obj:a(".track",d.obj)},p={obj:a(".thumb",d.obj)},l=g.axis==="x",n=l?"left":"top",v=l?"Width":"Height",r=0,y={start:0,now:0},o={},e="ontouchstart" in document.documentElement;function c(){k.update();s();return k}this.update=function(z){j[g.axis]=j.obj[0]["offset"+v];h[g.axis]=h.obj[0]["scroll"+v];h.ratio=j[g.axis]/h[g.axis];d.obj.toggleClass("disable",h.ratio>=1);m[g.axis]=g.size==="auto"?j[g.axis]:g.size;p[g.axis]=Math.min(m[g.axis],Math.max(0,(g.sizethumb==="auto"?(m[g.axis]*h.ratio):g.sizethumb)));d.ratio=g.sizethumb==="auto"?(h[g.axis]/m[g.axis]):(h[g.axis]-j[g.axis])/(m[g.axis]-p[g.axis]);r=(z==="relative"&&h.ratio<=1)?Math.min((h[g.axis]-j[g.axis]),Math.max(0,r)):0;r=(z==="bottom"&&h.ratio<=1)?(h[g.axis]-j[g.axis]):isNaN(parseInt(z,10))?r:parseInt(z,10);w()};function w(){var z=v.toLowerCase();p.obj.css(n,r/d.ratio);h.obj.css(n,-r);o.start=p.obj.offset()[n];d.obj.css(z,m[g.axis]);m.obj.css(z,m[g.axis]);p.obj.css(z,p[g.axis])}function s(){if(!e){p.obj.bind("mousedown",i);m.obj.bind("mouseup",u)}else{j.obj[0].ontouchstart=function(z){if(1===z.touches.length){i(z.touches[0]);z.stopPropagation()}}}if(g.scroll&&window.addEventListener){t[0].addEventListener("DOMMouseScroll",x,false);t[0].addEventListener("mousewheel",x,false);t[0].addEventListener("MozMousePixelScroll",function(z){z.preventDefault()},false)}else{if(g.scroll){t[0].onmousewheel=x}}}function i(A){a("body").addClass("noSelect");var z=parseInt(p.obj.css(n),10);o.start=l?A.pageX:A.pageY;y.start=z=="auto"?0:z;if(!e){a(document).bind("mousemove",u);a(document).bind("mouseup",f);p.obj.bind("mouseup",f)}else{document.ontouchmove=function(B){B.preventDefault();u(B.touches[0])};document.ontouchend=f}}function x(B){if(h.ratio<1){var A=B||window.event,z=A.wheelDelta?A.wheelDelta/120:-A.detail/3;r-=z*g.wheel;r=Math.min((h[g.axis]-j[g.axis]),Math.max(0,r));p.obj.css(n,r/d.ratio);h.obj.css(n,-r);if(g.lockscroll||(r!==(h[g.axis]-j[g.axis])&&r!==0)){A=a.event.fix(A);A.preventDefault()}}}function u(z){if(h.ratio<1){if(g.invertscroll&&e){y.now=Math.min((m[g.axis]-p[g.axis]),Math.max(0,(y.start+(o.start-(l?z.pageX:z.pageY)))))}else{y.now=Math.min((m[g.axis]-p[g.axis]),Math.max(0,(y.start+((l?z.pageX:z.pageY)-o.start))))}r=y.now*d.ratio;h.obj.css(n,-r);p.obj.css(n,y.now)}}function f(){a("body").removeClass("noSelect");a(document).unbind("mousemove",u);a(document).unbind("mouseup",f);p.obj.unbind("mouseup",f);document.ontouchmove=document.ontouchend=null}return c()}}(jQuery));
/* JQUERY HISTORY */ if (ieversion != 7){ (function(a,b){"use strict";var c=a.History=a.History||{},d=a.jQuery;if(typeof c.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");c.Adapter={bind:function(a,b,c){d(a).bind(b,c)},trigger:function(a,b,c){d(a).trigger(b,c)},extractEventData:function(a,c,d){var e=c&&c.originalEvent&&c.originalEvent[a]||d&&d[a]||b;return e},onDomLoad:function(a){d(a)}},typeof c.init!="undefined"&&c.init()})(window),function(a,b){"use strict";var c=a.console||b,d=a.document,e=a.navigator,f=a.sessionStorage||!1,g=a.setTimeout,h=a.clearTimeout,i=a.setInterval,j=a.clearInterval,k=a.JSON,l=a.alert,m=a.History=a.History||{},n=a.history;k.stringify=k.stringify||k.encode,k.parse=k.parse||k.decode;if(typeof m.init!="undefined")throw new Error("History.js Core has already been loaded...");m.init=function(){return typeof m.Adapter=="undefined"?!1:(typeof m.initCore!="undefined"&&m.initCore(),typeof m.initHtml4!="undefined"&&m.initHtml4(),!0)},m.initCore=function(){if(typeof m.initCore.initialized!="undefined")return!1;m.initCore.initialized=!0,m.options=m.options||{},m.options.hashChangeInterval=m.options.hashChangeInterval||100,m.options.safariPollInterval=m.options.safariPollInterval||500,m.options.doubleCheckInterval=m.options.doubleCheckInterval||500,m.options.storeInterval=m.options.storeInterval||1e3,m.options.busyDelay=m.options.busyDelay||250,m.options.debug=m.options.debug||!1,m.options.initialTitle=m.options.initialTitle||d.title,m.intervalList=[],m.clearAllIntervals=function(){var a,b=m.intervalList;if(typeof b!="undefined"&&b!==null){for(a=0;a")&&c[0]);return a>4?a:!1}();return a},m.isInternetExplorer=function(){var a=m.isInternetExplorer.cached=typeof m.isInternetExplorer.cached!="undefined"?m.isInternetExplorer.cached:Boolean(m.getInternetExplorerMajorVersion());return a},m.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8)},m.enabled=!m.emulated.pushState,m.bugs={setHash:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<7)},m.isEmptyObject=function(a){for(var b in a)return!1;return!0},m.cloneObject=function(a){var b,c;return a?(b=k.stringify(a),c=k.parse(b)):c={},c},m.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;return a+="/",a},m.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";return a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/"),c},m.getBaseUrl=function(){var a=m.getBaseHref()||m.getBasePageUrl()||m.getRootUrl();return a},m.getPageUrl=function(){var a=m.getState(!1,!1),b=(a||{}).url||d.location.href,c;return c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"}),c},m.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},m.getFullUrl=function(a,b){var c=a,d=a.substring(0,1);return b=typeof b=="undefined"?!0:b,/[a-z]+\:\/\//.test(a)||(d==="/"?c=m.getRootUrl()+a.replace(/^\/+/,""):d==="#"?c=m.getPageUrl().replace(/#.*/,"")+a:d==="?"?c=m.getPageUrl().replace(/[\?#].*/,"")+a:b?c=m.getBaseUrl()+a.replace(/^(\.\/)+/,""):c=m.getBasePageUrl()+a.replace(/^(\.\/)+/,"")),c.replace(/\#$/,"")},m.getShortUrl=function(a){var b=a,c=m.getBaseUrl(),d=m.getRootUrl();return m.emulated.pushState&&(b=b.replace(c,"")),b=b.replace(d,"/"),m.isTraditionalAnchor(b)&&(b="./"+b),b=b.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),b},m.store={},m.idToState=m.idToState||{},m.stateToId=m.stateToId||{},m.urlToId=m.urlToId||{},m.storedStates=m.storedStates||[],m.savedStates=m.savedStates||[],m.normalizeStore=function(){m.store.idToState=m.store.idToState||{},m.store.urlToId=m.store.urlToId||{},m.store.stateToId=m.store.stateToId||{}},m.getState=function(a,b){typeof a=="undefined"&&(a=!0),typeof b=="undefined"&&(b=!0);var c=m.getLastSavedState();return!c&&b&&(c=m.createStateObject()),a&&(c=m.cloneObject(c),c.url=c.cleanUrl||c.url),c},m.getIdByState=function(a){var b=m.extractId(a.url),c;if(!b){c=m.getStateString(a);if(typeof m.stateToId[c]!="undefined")b=m.stateToId[c];else if(typeof m.store.stateToId[c]!="undefined")b=m.store.stateToId[c];else{for(;;){b=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof m.idToState[b]=="undefined"&&typeof m.store.idToState[b]=="undefined")break}m.stateToId[c]=b,m.idToState[b]=a}}return b},m.normalizeState=function(a){var b,c;if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};b={},b.normalized=!0,b.title=a.title||"",b.url=m.getFullUrl(m.unescapeString(a.url||d.location.href)),b.hash=m.getShortUrl(b.url),b.data=m.cloneObject(a.data),b.id=m.getIdByState(b),b.cleanUrl=b.url.replace(/\??\&_suid.*/,""),b.url=b.cleanUrl,c=!m.isEmptyObject(b.data);if(b.title||c)b.hash=m.getShortUrl(b.url).replace(/\??\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;return b.hashedUrl=m.getFullUrl(b.hash),(m.emulated.pushState||m.bugs.safariPoll)&&m.hasUrlDuplicate(b)&&(b.url=b.hashedUrl),b},m.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};return d=m.normalizeState(d),d},m.getStateById=function(a){a=String(a);var c=m.idToState[a]||m.store.idToState[a]||b;return c},m.getStateString=function(a){var b,c,d;return b=m.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=k.stringify(c),d},m.getStateId=function(a){var b,c;return b=m.normalizeState(a),c=b.id,c},m.getHashByState=function(a){var b,c;return b=m.normalizeState(a),c=b.hash,c},m.extractId=function(a){var b,c,d;return c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"",b||!1},m.isTraditionalAnchor=function(a){var b=!/[\/\?\.]/.test(a);return b},m.extractState=function(a,b){var c=null,d,e;return b=b||!1,d=m.extractId(a),d&&(c=m.getStateById(d)),c||(e=m.getFullUrl(a),d=m.getIdByUrl(e)||!1,d&&(c=m.getStateById(d)),!c&&b&&!m.isTraditionalAnchor(a)&&(c=m.createStateObject(null,null,e))),c},m.getIdByUrl=function(a){var c=m.urlToId[a]||m.store.urlToId[a]||b;return c},m.getLastSavedState=function(){return m.savedStates[m.savedStates.length-1]||b},m.getLastStoredState=function(){return m.storedStates[m.storedStates.length-1]||b},m.hasUrlDuplicate=function(a){var b=!1,c;return c=m.extractState(a.url),b=c&&c.id!==a.id,b},m.storeState=function(a){return m.urlToId[a.url]=a.id,m.storedStates.push(m.cloneObject(a)),a},m.isLastSavedState=function(a){var b=!1,c,d,e;return m.savedStates.length&&(c=a.id,d=m.getLastSavedState(),e=d.id,b=c===e),b},m.saveState=function(a){return m.isLastSavedState(a)?!1:(m.savedStates.push(m.cloneObject(a)),!0)},m.getStateByIndex=function(a){var b=null;return typeof a=="undefined"?b=m.savedStates[m.savedStates.length-1]:a<0?b=m.savedStates[m.savedStates.length+a]:b=m.savedStates[a],b},m.getHash=function(){var a=m.unescapeHash(d.location.hash);return a},m.unescapeString=function(b){var c=b,d;for(;;){d=a.unescape(c);if(d===c)break;c=d}return c},m.unescapeHash=function(a){var b=m.normalizeHash(a);return b=m.unescapeString(b),b},m.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},m.setHash=function(a,b){var c,e,f;return b!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.setHash,args:arguments,queue:b}),!1):(c=m.escapeHash(a),m.busy(!0),e=m.extractState(a,!0),e&&!m.emulated.pushState?m.pushState(e.data,e.title,e.url,!1):d.location.hash!==c&&(m.bugs.setHash?(f=m.getPageUrl(),m.pushState(null,null,f+"#"+c,!1)):d.location.hash=c),m)},m.escapeHash=function(b){var c=m.normalizeHash(b);return c=a.escape(c),m.bugs.hashEscape||(c=c.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),c},m.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=m.unescapeHash(b),b},m.setTitle=function(a){var b=a.title,c;b||(c=m.getStateByIndex(0),c&&c.url===a.url&&(b=c.title||m.options.initialTitle));try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","<").replace(">",">").replace(" & "," & ")}catch(e){}return d.title=b,m},m.queues=[],m.busy=function(a){typeof a!="undefined"?m.busy.flag=a:typeof m.busy.flag=="undefined"&&(m.busy.flag=!1);if(!m.busy.flag){h(m.busy.timeout);var b=function(){var a,c,d;if(m.busy.flag)return;for(a=m.queues.length-1;a>=0;--a){c=m.queues[a];if(c.length===0)continue;d=c.shift(),m.fireQueueItem(d),m.busy.timeout=g(b,m.options.busyDelay)}};m.busy.timeout=g(b,m.options.busyDelay)}return m.busy.flag},m.busy.flag=!1,m.fireQueueItem=function(a){return a.callback.apply(a.scope||m,a.args||[])},m.pushQueue=function(a){return m.queues[a.queue||0]=m.queues[a.queue||0]||[],m.queues[a.queue||0].push(a),m},m.queue=function(a,b){return typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),m.busy()?m.pushQueue(a):m.fireQueueItem(a),m},m.clearQueue=function(){return m.busy.flag=!1,m.queues=[],m},m.stateChanged=!1,m.doubleChecker=!1,m.doubleCheckComplete=function(){return m.stateChanged=!0,m.doubleCheckClear(),m},m.doubleCheckClear=function(){return m.doubleChecker&&(h(m.doubleChecker),m.doubleChecker=!1),m},m.doubleCheck=function(a){return m.stateChanged=!1,m.doubleCheckClear(),m.bugs.ieDoubleCheck&&(m.doubleChecker=g(function(){return m.doubleCheckClear(),m.stateChanged||a(),!0},m.options.doubleCheckInterval)),m},m.safariStatePoll=function(){var b=m.extractState(d.location.href),c;if(!m.isLastSavedState(b))c=b;else return;return c||(c=m.createStateObject()),m.Adapter.trigger(a,"popstate"),m},m.back=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.back,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.back(!1)}),n.go(-1),!0)},m.forward=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.forward,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.forward(!1)}),n.go(1),!0)},m.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)m.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)m.back(b)}return m};if(m.emulated.pushState){var o=function(){};m.pushState=m.pushState||o,m.replaceState=m.replaceState||o}else m.onPopState=function(b,c){var e=!1,f=!1,g,h;return m.doubleCheckComplete(),g=m.getHash(),g?(h=m.extractState(g||d.location.href,!0),h?m.replaceState(h.data,h.title,h.url,!1):(m.Adapter.trigger(a,"anchorchange"),m.busy(!1)),m.expectedStateId=!1,!1):(e=m.Adapter.extractEventData("state",b,c)||!1,e?f=m.getStateById(e):m.expectedStateId?f=m.getStateById(m.expectedStateId):f=m.extractState(d.location.href),f||(f=m.createStateObject(null,null,d.location.href)),m.expectedStateId=!1,m.isLastSavedState(f)?(m.busy(!1),!1):(m.storeState(f),m.saveState(f),m.setTitle(f),m.Adapter.trigger(a,"statechange"),m.busy(!1),!0))},m.Adapter.bind(a,"popstate",m.onPopState),m.pushState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.pushState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.pushState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0},m.replaceState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.replaceState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.replaceState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0};if(f){try{m.store=k.parse(f.getItem("History.store"))||{}}catch(p){m.store={}}m.normalizeStore()}else m.store={},m.normalizeStore();m.Adapter.bind(a,"beforeunload",m.clearAllIntervals),m.Adapter.bind(a,"unload",m.clearAllIntervals),m.saveState(m.storeState(m.extractState(d.location.href,!0))),f&&(m.onUnload=function(){var a,b;try{a=k.parse(f.getItem("History.store"))||{}}catch(c){a={}}a.idToState=a.idToState||{},a.urlToId=a.urlToId||{},a.stateToId=a.stateToId||{};for(b in m.idToState){if(!m.idToState.hasOwnProperty(b))continue;a.idToState[b]=m.idToState[b]}for(b in m.urlToId){if(!m.urlToId.hasOwnProperty(b))continue;a.urlToId[b]=m.urlToId[b]}for(b in m.stateToId){if(!m.stateToId.hasOwnProperty(b))continue;a.stateToId[b]=m.stateToId[b]}m.store=a,m.normalizeStore(),f.setItem("History.store",k.stringify(a))},m.intervalList.push(i(m.onUnload,m.options.storeInterval)),m.Adapter.bind(a,"beforeunload",m.onUnload),m.Adapter.bind(a,"unload",m.onUnload));if(!m.emulated.pushState){m.bugs.safariPoll&&m.intervalList.push(i(m.safariStatePoll,m.options.safariPollInterval));if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")m.Adapter.bind(a,"hashchange",function(){m.Adapter.trigger(a,"popstate")}),m.getHash()&&m.Adapter.onDomLoad(function(){m.Adapter.trigger(a,"hashchange")})}},m.init()}(window) }
/* JQUERY WAITFORIMAGES */ ;(function($) {var eventNamespace = 'waitForImages';$.waitForImages = {hasImageProperties: ['backgroundImage','listStyleImage','borderImage','borderCornerImage']};$.expr[':'].uncached = function(obj) {if ( ! $(obj).is('img[src!=""]')) {return false;}var img = document.createElement('img');img.src = obj.src;return ! img.complete;};$.fn.waitForImages = function(finishedCallback, eachCallback, waitForAll) {if ($.isPlainObject(arguments[0])) {eachCallback = finishedCallback.each;waitForAll = finishedCallback.waitForAll;finishedCallback = finishedCallback.finished;}finishedCallback = finishedCallback || $.noop;eachCallback = eachCallback || $.noop;waitForAll = !! waitForAll;if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) {throw new TypeError('An invalid callback was supplied.');};return this.each(function() {var obj = $(this),allImgs = [];if (waitForAll) {var hasImgProperties = $.waitForImages.hasImageProperties || [],matchUrl = /url\((['"]?)(.*?)\1\)/g;obj.find('*').each(function() {var element = $(this);if (element.is('img:uncached')) {allImgs.push({src: element.attr('src'),element: element[0]});}$.each(hasImgProperties, function(i, property) {var propertyValue = element.css(property);if ( ! propertyValue) {return true;}var match;while (match = matchUrl.exec(propertyValue)) {allImgs.push({src: match[2],element: element[0]});};});});} else {obj.find('img:uncached').each(function() {allImgs.push({src: this.src,element: this});});};var allImgsLength = allImgs.length,allImgsLoaded = 0;if (allImgsLength == 0) {finishedCallback.call(obj[0]);};$.each(allImgs, function(i, img) {var image = new Image;$(image).bind('load.' + eventNamespace + ' error.' + eventNamespace, function(event) {allImgsLoaded++;eachCallback.call(img.element, allImgsLoaded, allImgsLength, event.type == 'load');if (allImgsLoaded == allImgsLength) {finishedCallback.call(obj[0]);return false;};});image.src = img.src;});});};})(jQuery);
/* JQUERY DEBOUNCE */(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
/* JQUERY BACKGROUNDSIZE */ (function($,window,document,Math,undefined){var div=$("")[0],rsrc=/url\(["']?(.*?)["']?\)/,watched=[],positions={top:0,left:0,bottom:1,right:1,center:0.5};if("backgroundSize"in div.style&&!$.debugBGS)return;$.cssHooks.backgroundSize={set:function(elem,value){var firstTime=!$.data(elem,"bgsImg"),pos,$wrapper,$img;$.data(elem,"bgsValue",value);if(firstTime){watched.push(elem);$.refreshBackgroundDimensions(elem,true);$wrapper=$("
").css({position:"absolute",zIndex:-1,top:0,right:0,left:0,bottom:0,overflow:"hidden"});$img=$("
![]()
").css({position:"absolute"}).appendTo($wrapper),$wrapper.prependTo(elem);$.data(elem,"bgsImg",$img[0]);pos=($.css(elem,"backgroundPosition")||$.css(elem,"backgroundPositionX")+" "+$.css(elem,"backgroundPositionY")).split(" ");$.data(elem,"bgsPos",[positions[pos[0]]||parseFloat(pos[0])/100,positions[pos[1]]||parseFloat(pos[1])/100]);$.css(elem,"zIndex")=="auto"&&(elem.style.zIndex=0);$.css(elem,"position")=="static"&&(elem.style.position="relative");$.refreshBackgroundImage(elem)}else $.refreshBackground(elem)},get:function(elem){return $.data(elem,"bgsValue")||""}};$.cssHooks.backgroundImage={set:function(elem,value){return $.data(elem,"bgsImg")?$.refreshBackgroundImage(elem,value):value}};$.refreshBackgroundDimensions=function(elem,noBgRefresh){var $elem=$(elem),currDim={width:$elem.innerWidth(),height:$elem.innerHeight()},prevDim=$.data(elem,"bgsDim"),changed=!prevDim||currDim.width!=prevDim.width||currDim.height!=prevDim.height;$.data(elem,"bgsDim",currDim);if(changed&&!noBgRefresh)$.refreshBackground(elem)};$.refreshBackgroundImage=function(elem,value){var img=$.data(elem,"bgsImg"),currSrc=(rsrc.exec(value||$.css(elem,"backgroundImage"))||[])[1],prevSrc=img&&img.src,changed=currSrc!=prevSrc,imgWidth,imgHeight;if(changed){img.style.height=img.style.width="auto";img.onload=function(){var dim={width:img.width,height:img.height};if(dim.width==1&&dim.height==1)return;$.data(elem,"bgsImgDim",dim);$.data(elem,"bgsConstrain",false);$.refreshBackground(elem);img.style.visibility="visible";img.onload=null};img.style.visibility="hidden";img.src=currSrc;if(img.readyState||img.complete){img.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";img.src=currSrc}elem.style.backgroundImage="none"}};$.refreshBackground=function(elem){var value=$.data(elem,"bgsValue"),elemDim=$.data(elem,"bgsDim"),imgDim=$.data(elem,"bgsImgDim"),$img=$($.data(elem,"bgsImg")),pos=$.data(elem,"bgsPos"),prevConstrain=$.data(elem,"bgsConstrain"),currConstrain,elemRatio=elemDim.width/elemDim.height,imgRatio=imgDim.width/imgDim.height,delta;if(value=="contain")if(imgRatio>elemRatio){$.data(elem,"bgsConstrain",currConstrain="width");delta=Math.floor((elemDim.height-elemDim.width/imgRatio)*pos[1]);$img.css({top:delta});if(currConstrain!=prevConstrain)$img.css({width:"100%",height:"auto",left:0})}else{$.data(elem,"bgsConstrain",currConstrain="height");delta=Math.floor((elemDim.width-elemDim.height*imgRatio)*pos[0]);$img.css({left:delta});if(currConstrain!=prevConstrain)$img.css({height:"100%",width:"auto",top:0})}else if(value=="cover")if(imgRatio>elemRatio){$.data(elem,"bgsConstrain",currConstrain="height");delta=Math.floor((elemDim.height*imgRatio-elemDim.width)*pos[0]);$img.css({left:-delta});if(currConstrain!=prevConstrain)$img.css({height:"100%",width:"auto",top:0})}else{$.data(elem,"bgsConstrain",currConstrain="width");delta=Math.floor((elemDim.width/imgRatio-elemDim.height)*pos[1]);$img.css({top:-delta});if(currConstrain!=prevConstrain)$img.css({width:"100%",height:"auto",left:0})}};var $event=$.event,$special,dummy={_:0},frame=0,wasResized,animRunning;$special=$event.special.throttledresize={setup:function(){$(this).on("resize",$special.handler)},teardown:function(){$(this).off("resize",$special.handler)},handler:function(event,execAsap){var context=this,args=arguments;wasResized=true;if(!animRunning){$(dummy).animate(dummy,{duration:Infinity,step:function(){frame++;if(frame>$special.threshold&&wasResized||execAsap){event.type="throttledresize";$event.dispatch.apply(context,args);wasResized=false;frame=0}if(frame>9){$(dummy).stop();animRunning=false;frame=0}}});animRunning=true}},threshold:1};$(window).on("throttledresize",function(){$(watched).each(function(){$.refreshBackgroundDimensions(this)})})})(jQuery,window,document,Math);
/* JQUERY MAILCRYPT */ (function($){$.fn.mailcrypt = function( options ) {return this.each(function() {at = '@';$(':first-child',this).replaceWith(at);email = $(this).html();$(this).attr('href', 'mailto:'+email);});};})( jQuery );
/* SWIPEVIEW */ if (ieversion != 7){ var SwipeView=function(e,t){function b(e){if(r==="")return e;e=e.charAt(0).toUpperCase()+e.substr(1);return r+e}var n=t.createElement("div").style,r=function(){var e="t,webkitT,MozT,msT,OT".split(","),t,r=0,i=e.length;for(;r
this.options.numberOfPages-1?this.options.numberOfPages-1:e;this.page=e;this.pageIndex=e;this.slider.style[o]="0s";this.__pos(-e*this.pageWidth);this.currentMasterPage=this.page+1-Math.floor((this.page+1)/3)*3;this.masterPages[this.currentMasterPage].className=this.masterPages[this.currentMasterPage].className+" swipeview-active";if(this.currentMasterPage===0){this.masterPages[2].style.left=this.page*100-100+"%";this.masterPages[0].style.left=this.page*100+"%";this.masterPages[1].style.left=this.page*100+100+"%";this.masterPages[2].dataset.upcomingPageIndex=this.page===0?this.options.numberOfPages-1:this.page-1;this.masterPages[0].dataset.upcomingPageIndex=this.page;this.masterPages[1].dataset.upcomingPageIndex=this.page==this.options.numberOfPages-1?0:this.page+1}else if(this.currentMasterPage==1){this.masterPages[0].style.left=this.page*100-100+"%";this.masterPages[1].style.left=this.page*100+"%";this.masterPages[2].style.left=this.page*100+100+"%";this.masterPages[0].dataset.upcomingPageIndex=this.page===0?this.options.numberOfPages-1:this.page-1;this.masterPages[1].dataset.upcomingPageIndex=this.page;this.masterPages[2].dataset.upcomingPageIndex=this.page==this.options.numberOfPages-1?0:this.page+1}else{this.masterPages[1].style.left=this.page*100-100+"%";this.masterPages[2].style.left=this.page*100+"%";this.masterPages[0].style.left=this.page*100+100+"%";this.masterPages[1].dataset.upcomingPageIndex=this.page===0?this.options.numberOfPages-1:this.page-1;this.masterPages[2].dataset.upcomingPageIndex=this.page;this.masterPages[0].dataset.upcomingPageIndex=this.page==this.options.numberOfPages-1?0:this.page+1}this.__flip()},next:function(){if(!this.options.loop&&this.x==this.maxX)return;this.directionX=-1;this.x-=1;this.__checkPosition()},prev:function(){if(!this.options.loop&&this.x===0)return;this.directionX=1;this.x+=1;this.__checkPosition()},handleEvent:function(e){switch(e.type){case p:this.__start(e);break;case d:this.__move(e);break;case m:case v:this.__end(e);break;case h:this.__resize();break;case g:case"otransitionend":if(e.target==this.slider&&!this.options.hastyPageFlip)this.__flip();break}},__pos:function(e){this.x=e;this.slider.style[s]="translate("+e+"px,0)"+c},__resize:function(){this.refreshSize();this.slider.style[o]="0s";this.__pos(-this.page*this.pageWidth)},__start:function(e){if(this.initiated)return;var t=a?e.touches[0]:e;this.initiated=true;this.moved=false;this.thresholdExceeded=false;this.startX=t.pageX;this.startY=t.pageY;this.pointX=t.pageX;this.pointY=t.pageY;this.stepsX=0;this.stepsY=0;this.directionX=0;this.directionLocked=false;this.slider.style[o]="0s";this.__event("touchstart")},__move:function(e){if(!this.initiated)return;var t=a?e.touches[0]:e,n=t.pageX-this.pointX,r=t.pageY-this.pointY,i=this.x+n,s=Math.abs(t.pageX-this.startX);this.moved=true;this.pointX=t.pageX;this.pointY=t.pageY;this.directionX=n>0?1:n<0?-1:0;this.stepsX+=Math.abs(n);this.stepsY+=Math.abs(r);if(this.stepsX<10&&this.stepsY<10){return}if(!this.directionLocked&&this.stepsY>this.stepsX){this.initiated=false;return}e.preventDefault();this.directionLocked=true;if(!this.options.loop&&(i>0||i=this.snapThreshold){this.thresholdExceeded=true;this.__event("moveout")}else if(this.thresholdExceeded&&s0||this.x0){this.page=-Math.ceil(this.x/this.pageWidth);this.currentMasterPage=this.page+1-Math.floor((this.page+1)/3)*3;this.pageIndex=this.pageIndex===0?this.options.numberOfPages-1:this.pageIndex-1;e=this.currentMasterPage-1;e=e<0?2:e;this.masterPages[e].style.left=this.page*100-100+"%";t=this.page-1}else{this.page=-Math.floor(this.x/this.pageWidth);this.currentMasterPage=this.page+1-Math.floor((this.page+1)/3)*3;this.pageIndex=this.pageIndex==this.options.numberOfPages-1?0:this.pageIndex+1;e=this.currentMasterPage+1;e=e>2?0:e;this.masterPages[e].style.left=this.page*100+100+"%";t=this.page+1}n=this.masterPages[this.currentMasterPage].className;/(^|\s)swipeview-active(\s|$)/.test(n)||(this.masterPages[this.currentMasterPage].className=!n?"swipeview-active":n+" swipeview-active");n=this.masterPages[e].className;/(^|\s)swipeview-loading(\s|$)/.test(n)||(this.masterPages[e].className=!n?"swipeview-loading":n+" swipeview-loading");t=t-Math.floor(t/this.options.numberOfPages)*this.options.numberOfPages;this.masterPages[e].dataset.upcomingPageIndex=t;newX=-this.page*this.pageWidth;this.slider.style[o]=Math.floor(500*Math.abs(this.x-newX)/this.pageWidth)+"ms";if(!this.options.loop){this.masterPages[e].style.visibility=newX===0||newX==this.maxX?"hidden":""}if(this.x==newX){this.__flip()}else{this.__pos(newX);if(this.options.hastyPageFlip)this.__flip()}},__flip:function(){this.__event("flip");for(var e=0;e<3;e++){this.masterPages[e].className=this.masterPages[e].className.replace(/(^|\s)swipeview-loading(\s|$)/,"");this.masterPages[e].dataset.pageIndex=this.masterPages[e].dataset.upcomingPageIndex}},__event:function(e){var n=t.createEvent("Event");n.initEvent("swipeview-"+e,true,true);this.wrapper.dispatchEvent(n)}};return y}(window,document) }
/* LOOP PRELOADER */ (function($){$.loopPreloader=function(element,options){var opts=$.extend({},$.fn.loopPreloader.defaults,options);var $this=$(element);var $badges=$(".badges li",$this);var totalBadges=$badges.length;var currentIndex=0;var cycleInterval=-1;var init=function(){$badges.hide();$($badges[0]).show();startCycling()};var startCycling=function(){triggerBadge(currentIndex+1);var cycleInterval=setInterval(function(){triggerBadge(currentIndex+1)},opts.cycleDuration)};var rotateX=function($target,rotation){$target.css("-moz-transform","rotateX("+rotation+"deg)");$target.css("-webkit-transform","rotateX("+rotation+"deg)");$target.css("-o-transform","rotateX("+rotation+"deg)");$target.css("transform","rotateX("+rotation+"deg)")};var triggerBadge=function(targetIndex){if(targetIndex>=totalBadges)targetIndex=0;$targetBadge=$($badges[targetIndex]);$currentBadge=$($badges[currentIndex]);rotateX($targetBadge,180);$targetBadge.show().css({textIndent:180}).animate({textIndent:"0"},{step:function(go){rotateX($(this),go)},duration:opts.animationDuration,easing:"easeInOutQuart"});$currentBadge.animate({textIndent:"-180"},{step:function(go){rotateX($(this),go)},duration:opts.animationDuration,easing:"easeInOutQuart",complete:function(){$(this).hide()}});currentIndex=targetIndex};init()};$.fn.loopPreloader=function(options){return this.each(function(){if(undefined===$(this).data("loopPreloader")){var plugin=new $.loopPreloader(this,options);$(this).data("loopPreloader",plugin)}})};$.fn.loopPreloader.defaults={animationDuration:600,cycleDuration:1400}})(jQuery);
// global vars
var headerheight = parseInt($('.header').height());
var windowheight = getViewport('height');
var windowwidth = parseInt($(window).width());
var resizeintro = false;
var actbg = 1;
var lastbg = 1;
var footerheight = parseInt($('.footer').height());
var contentspacer = parseInt($('.content_spacer').height());
var showfixedfooter = 0;
var stopparallax = 0;
var lovPos = 0;
$(document).ready(function(){
init();
initPage();
});
function init(num){
// last article margin and footer spacer
if (isDesktop()){
footerSpacer();
}
// show footer on subpages
if ($('.navigation .active').size() == 0){
showFooter(0);
}
// parallax on subpages
parallaxSubPages();
// filter window
filterWindow();
// resize column
resizeFourcol();
resizeFivecol_v2();
// window resize functions
$(window).resize(function(){
//$('.header').html(windowwidth);
// reset global vars
windowheight = getViewport('height');
windowwidth = parseInt($(window).width());
footerheight = parseInt($('.footer').height());
// dynamic font size
dynamicFontSize();
// last article margin and footer spacer
if (isDesktop()){
footerSpacer();
}
// resize column
resizeFourcol();
resizeFivecol_v2();
// filter window
filterWindow();
// resize mobile nav content
mobileNavItems();
});
// scroll functions
$(window).scroll(function(ee){
// headerimage parallax
if (isDesktop()){
var windowscrolltop = $(window).scrollTop();
var windowscrolltopdiff;
$('.article').each(function(index){
if ($(this).attr('data-bg') == actbg){
windowscrolltopdiff = $(this).position().top;
}
});
windowscrolltop = windowscrolltop-windowscrolltopdiff;
var e = ((windowscrolltop/2)*0.8)*-1;
$('.backstretch:eq('+(actbg-1)+')').css({
marginTop:e+'px'
});
// parallax on subpages
parallaxSubPages();
}
// change background-image (desktop version)
getBgPos($(document).scrollTop());
// show/hide footer
if (isDesktop()){
showFooter(0);
}
});
// change background-image (no desktop version)
if (!isDesktop() || ieversion == 7){
backgroundNoDesktop();
}
// backstretch
if (num != 1){
$('.bg1').backstretch('assets/web/img/loop/vbg1.jpg');
$('.bg2').backstretch('assets/web/img/loop/vbg2.jpg');
changeBg(0);
}
// project item
prodItemEvents();
// mobile nav
$('.open_nav_mobile').unbind().on('click', function(){
openCloseMobileNav();
});
// show/hide filter
$('.filter_prod').unbind().on({
'click':function(){
openFilter($(this));
return false;
}
});
$('.filter_close, #btn_filter_projects, .filter_work a').unbind().on({
'click':function(){
$('.filter_close, #btn_filter_projects').removeClass('filter_close_fixed');
if ($('.logo').outerHeight() == 44){
spacerheight = 44;
} else {
spacerheight = 60;
}
if ($('.navigation .active').size() == 0){
spacerheight = 0;
}
$('.content_spacer').animate({
height:spacerheight
}, 1000, 'easeInOutExpo', function(){
});
$('.filter_projects').animate({
top:'-100%',
height:'100%'
}, 1000, 'easeInOutExpo', function(){
filterScroll(1);
$('.filter_projects').removeClass('filter_projects_left');
$('.filter_projects').empty();
});
// pause videos
$('video').each(function(){ this.pause() });
// remove external video content
$('.video_extern').remove();
return false;
}
});
// scrollbar filter
filterScroll(0);
$(window).resize(function(){
filterScroll(1);
});
// checkbox
$('.icon_check0').unbind().on({
'click':function(){
var thisitemcheck = $(this);
thisitemcheck.toggleClass('icon_check1');
}
});
// reset input value
$('.input_val').on({
focus:function(){
var inputelement = $(this);
var inputval = inputelement.attr('data-value');
if (inputelement.val() == inputval){
inputelement.val('');
}
inputelement.addClass('focus');
inputelement.removeClass('email_error');
},
blur:function(){
var inputelement = $(this);
var inputval = inputelement.attr('data-value');
if (inputelement.val() == ''){
inputelement.val(inputval);
inputelement.removeClass('focus');
}
}
});
// mailcrypt
$('a.mailcrypt').mailcrypt();
}
function intro(){
setTimeout(function(){
// hide footer on start page
if (isDesktop()){
showFooter('hide');
}
// hide header
if (isMobileDevice()){
$('.header').css('top', '-44px');
} else {
$('.header').css('top', '-60px');
}
$('.content_spacer').height('0px');
var firstabsarticle = (getViewport('height'));
var ua = navigator.userAgent, iphone = ~ua.indexOf('iPhone') || ~ua.indexOf('iPod');
if (iphone){
firstabsarticle = firstabsarticle+60;
}
dynamicFontSize();
$(document).scrollTop(0);
$('.backstretch').delay(300).animate({
top:0
}, 1000, 'easeInOutExpo', function(){
//
});
$('.bg_mask').delay(300).animate({
top:firstabsarticle
}, 1000, 'easeInOutExpo', function(){
$(this).remove();
});
setTimeout(function(){
$('.header').animate({
top:0
}, 700, 'easeOutQuart', function(){
//
});
}, 500);
var article_intro_inner_h = $('.article_intro_inner').height();
$('.article_intro_inner').css('margin-top', (article_intro_inner_h/2)*-1)
setTimeout(function(){
var article_intro_h = windowheight;
if (!isDesktop()){
$('.article_intro').css({'height':firstabsarticle,'margin-top':'-'+firstabsarticle+'px'});
$('.article_intro').animate({
marginTop:0
}, 1000, 'easeInOutExpo', function(){
resizeintro = true;
$('.article_abs').removeClass('article_abs');
homeSize();
});
} else {
$('.article_intro').animate({
height:firstabsarticle
}, 1000, 'easeInOutExpo', function(){
resizeintro = true;
$('.article_abs').removeClass('article_abs');
homeSize();
});
}
}, 300);
}, 500);
}
function dynamicFontSize(){
// h1 home
var newfontsize = Math.ceil((windowwidth/100)*(5));
if (newfontsize < 30){
newfontsize = 30;
}
var newlineheight = (newfontsize+5)+'px';
$('.article_intro h1').css({'font-size':newfontsize, 'line-height':newlineheight});
var article_intro_inner_h = $('.article_intro_inner').height();
$('.article_intro_inner').css('margin-top', (article_intro_inner_h/2)*-1)
}
function homeSize() {
if (isDesktop()){
$('.article_intro').height((getViewport('height')));
}
}
function isMobileDevice() {
return navigator.userAgent.toLowerCase().indexOf('iphone') > -1 || navigator.userAgent.toLowerCase().indexOf('ipod') > -1 || navigator.userAgent.toLowerCase().indexOf('android') > -1 || navigator.userAgent.toLowerCase().indexOf('webos') > -1 || navigator.userAgent.toLowerCase().indexOf('blackberry') > -1
}
function isDesktop(){
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)){
return false;
} else {
return true;
}
}
function changeBg(showid){
//$('.backstretch').css('marginTop', '0px');
$('.backstretch').not($('.backstretch:eq('+showid+')')).css('visibility', 'hidden');
$('.backstretch:eq('+showid+')').css('visibility', 'visible');
}
function getBgPos(dpos){
var lastbg = actbg;
$('.article').each(function(index){
var element = $(this);
var htmlpostop = dpos+windowheight;
var elementpostop = Math.ceil(element.position().top);
if (element.attr('data-bg') !== undefined && htmlpostop >= elementpostop){
actbg = $('.article:eq('+index+')').attr('data-bg');
}
});
if (actbg != lastbg){
lastbg = actbg;
if (dpos == 0){
changeBg(0);
} else {
changeBg(actbg-1);
}
}
}
function showFooter(show){
if (show == 'hide'){
$('.footer').hide();
} else {
if (show == 1 || showfixedfooter == 1){
$('.footer').show();
} else {
var lastpostop = Math.ceil($('.article_last').position().top);
var lastheight = parseInt($('.article_last').height());
if ((($(document).scrollTop()+windowheight)-footerheight) >= lastpostop && $(document).scrollTop() >= 60){
$('.footer').show();
} else {
$('.footer').hide();
}
}
}
}
function footerSpacer(){
$('.footer').css('max-height', $(window).height()-60);
$('.footer_spacer').height(footerheight);
}
function resizeFourcol(){
$('.project_item, .q_item').each(function(){
var element = $(this);
var fourcolmarginbottom = element.css('margin-right');
if (parseInt(fourcolmarginbottom) == 0){
fourcolmarginbottom = element.prev().css('margin-right');
}
element.css('margin-bottom', fourcolmarginbottom);
});
}
function resizeFivecol_v2(){
$('.service_item').each(function(){
var element = $(this);
var fivecolwidth = element.width();
var fivecolheight = $('.service_item:first').width();
var fivecolmarginbottom = element.css('margin-right');
element.height((fivecolheight/2)+45);
element.css('padding-top', (fivecolheight/2)-45);
if (parseInt(fivecolmarginbottom) == 0){
fivecolmarginbottom = element.prev().css('margin-right');
}
element.css('margin-bottom', fivecolmarginbottom);
});
}
function openCloseMobileNav(){
var openbutton = $('.open_nav_mobile');
if (openbutton.hasClass('close_nav_mobile')){
closeMobileNav(700);
} else {
openMobileNav();
}
}
function openMobileNav(){
var openbutton = $('.open_nav_mobile');
var mobileNav = $('.mobile_nav');
var mobileNavInner = $('.mobile_nav_inner');
var newbrowserheight = getViewport('height');
$('.content_spacer').animate({
height:newbrowserheight
}, 700, 'easeInOutExpo', function(){
openbutton.addClass('close_nav_mobile');
});
mobileNav.addClass('mobile_nav_r');
mobileNav.css({
top:'-'+getViewport('height')+'px',
height:getViewport('height'),
left:'0%'
});
mobileNavInner.css({
height:getViewport('height')-44
});
mobileNavItems();
mobileNav.animate({
top:0
}, 700, 'easeInOutExpo', function(){
mobileNav.height('100%');
});
}
function closeMobileNav(time){
var openbutton = $('.open_nav_mobile');
var mobileNav = $('.mobile_nav');
var mobileNavInner = $('.mobile_nav_inner');
if (time > 0){
$('.content_spacer').animate({
height:44
}, time, 'easeInOutExpo', function(){
openbutton.removeClass('close_nav_mobile');
});
} else {
openbutton.removeClass('close_nav_mobile');
}
mobileNav.animate({
top:'-'+getViewport('height')+'px'
}, time, 'easeInOutExpo', function(){
mobileNav.addClass('mobile_nav_r');
mobileNav.height(getViewport('height'));
mobileNav.css('left','-100%');
mobileNavInner.height(getViewport('height')-44);
});
}
function mobileNavItems(){
var mobileNavInner = $('.mobile_nav_inner');
mobileNavInner.css({
height:getViewport('height')-84, // Normal -44 / jetzt -84 da oben und unten jeweils 20px padding
paddingTop:'20px'
});
var mNI = $('.mobile_nav ul li');
mNI.height(mobileNavInner.height()/mNI.size());
mNI.find('a').height(mobileNavInner.height()/mNI.size());
mNI.find('a').css('line-height',mobileNavInner.height()/mNI.size()+'px');
}
function backgroundNoDesktop(){
$('.bg_item').remove();
$('.article_bg1').css('background', 'url(assets/web/img/loop/vbg1.jpg) no-repeat center center');
$('.article_bg2').css('background', 'url(assets/web/img/loop/vbg2.jpg) no-repeat center center');
$('.article_bg1, .article_bg2').addClass('background_no_desktop');
$('.footer').css({position:'relative',display:'block'});
$('.footer_spacer').hide();
}
function getViewport(type) {
var viewPortWidth;
var viewPortHeight;
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined') {
viewPortWidth = window.innerWidth,
viewPortHeight = window.innerHeight
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
viewPortWidth = document.documentElement.clientWidth,
viewPortHeight = document.documentElement.clientHeight
}
// older versions of IE
else {
viewPortWidth = document.getElementsByTagName('body')[0].clientWidth,
viewPortHeight = document.getElementsByTagName('body')[0].clientHeight
}
// return
if (type == 'width'){
return viewPortWidth;
} else {
return viewPortHeight;
}
}
function filterScroll(update){
var filterheight = $('.filter_projects').height()-145;
$('.filter_projects_inner, .viewport').height(filterheight);
if (update == 1){
$('.filter_projects_inner').each(function(){
$(this).tinyscrollbar_update();
});
} else {
$('.filter_projects_inner').each(function(){
$(this).tinyscrollbar();
});
}
}
function tinyscrollItem(itemClass, update){
if (update == 1){
$('.'+itemClass).each(function(){
var item = $(this);
var itemheight = item.height();
item.height(itemheight);
item.find('.viewport').height(itemheight);
item.tinyscrollbar_update();
});
} else {
$('.'+itemClass).each(function(){
var item = $(this);
var itemheight = item.height();
item.height(itemheight);
item.find('.viewport').height(itemheight);
item.tinyscrollbar();
});
}
}
function filterWindow(){
var filterwindowspacer = 60;
if (isMobileDevice()){
filterwindowspacer = 44;
}
$('.filter_projects_window').css({
'width':windowwidth,
'height':(getViewport('height')-filterwindowspacer),
'top':filterwindowspacer,
'position':'absolute'
});
}
function prodItemEvents(){
$('.colblock_v1').unbind().on({
'mouseover':function(){
if (isDesktop()){
$(this).find('img').stop(true,false).animate({
marginTop:'0%'
}, 400, 'easeOutQuart', function(){
//
});
$(this).find('.prod_item_ovl').stop(true,false).animate({
top:'-80%'
}, 400, 'easeOutQuart', function(){
//
});
$(this).find('.prod_item_info').stop(true,false).animate({
top:'-20%'
}, 400, 'easeOutQuart', function(){
//
});
$(this).find('.prod_item_link').stop(true,false).animate({
top:'80%'
}, 400, 'easeOutQuart', function(){
//
});
}
}, 'mouseleave':function(){
if (isDesktop()){
$(this).find('.prod_item_img_ov img.p_ov_img').stop(true,false).animate({
marginTop:'-7%'
}, 400, 'easeOutQuart', function(){
//
});
$(this).find('.prod_item_ovl').stop(true,false).animate({
top:0
}, 400, 'easeOutQuart', function(){
//
});
$(this).find('.prod_item_info').stop(true,false).animate({
top:0
}, 400, 'easeOutQuart', function(){
//
});
$(this).find('.prod_item_link').stop(true,false).animate({
top:'100%'
}, 400, 'easeOutQuart', function(){
//
});
}
}, 'click':function(){
// do something
}
});
}
function showNewItems(){
var delay = 30;
$('.new_item').each(function(){
var nitem = $(this);
nitem.css({'opacity':0,'visibility':'visible'});
nitem.delay(delay).animate({
opacity:1
}, 400, function(){
nitem.removeClass('new_item');
});
delay = delay+100; /* ACHTUNG: Wenn dieser Wert geändert wird muss auch das setTimeout bei Projects geändert werden */
});
}
function parallaxSubPages(){
var windowscrolltop = $(window).scrollTop();
var windowscrolltopdiff;
var blockheight;
$('.content_block_headerimg').each(function(){
windowscrolltopdiff = $(this).position().top;
blockheight = $(this).height();
});
windowscrolltop = (windowscrolltop-windowscrolltopdiff)+(blockheight-660)/2;
var e = (windowscrolltop/2)*0.8;
if (stopparallax == 0){
$('.content_block_headerimg').css({
'background-position':'50% '+e+'px'
});
}
}
function openFilter(element){
var spacer = element.attr('data-spacer'); if (spacer == 'window') { spacer = windowheight; }
var ovl = element.attr('data-ovl');
if (typeof element.attr('data-function') != 'undefined') {
$(element.attr('data-container')).html('');
}
if (isMobileDevice()){
spacer = windowheight;
ovl = '100%';
}
$('.filter_projects').addClass('filter_projects_left');
$('.content_spacer').animate({
height:spacer
}, 1000, 'easeInOutExpo', function(){
$('.filter_close').addClass('filter_close_fixed');
});
$('.filter_projects').animate({
top:0,
height:ovl
}, 1000, 'easeInOutExpo', function(){
// load content
if (typeof element.attr('data-function') != 'undefined') {
$.ajax({
type: 'GET',
url: 'special/functions/'+element.attr('data-function'),
data: element.attr('data-params'),
success: function(data){
$(element.attr('data-container')).waitForImages(function(){
$(element.attr('data-container')).html(data);
$('.filter_close').addClass('filter_close_fixed');
init(1);
initPage(1);
setTimeout(function(){
filterScroll(1);
}, 500);
});
// Ajaxify
ajaxy();
}
});
} else {
filterScroll(1);
}
});
}
function wantedList(id, firstname, lastname, email){
$.ajax({
type: 'POST',
url: 'sys/post/29',
data: 'wlp_fbid='+id+'&wlp_firstname='+firstname+'&wlp_lastname='+lastname+'&wlp_email='+email,
success: function(data){
//
}
});
}
function validateEmail(email){
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
// Ajaxify
function ajaxy(){
$('a:internal:not(.no-ajaxy)').click(function(event){
// Prepare
var
$this = $(this),
url = $this.attr('href'),
title = $this.attr('title')||null;
// Continue as normal for cmd clicks etc
if ( event.which == 2 || event.metaKey ) { return true; }
// Ajaxify this link
History.pushState(null,title,url);
event.preventDefault();
return false;
});
}
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
if (ieversion == 7){
return false;
}
if ( !History.enabled ) {
return false;
}
// Wait for Document
$(function(){
// Prepare Variables
var
/* Application Specific Variables */
contentSelector = '.content_inner',
$content = $(contentSelector).filter(':first'),
contentNode = $content.get(0),
$menu = $('#nav').filter(':first'),
activeClass = 'active',
activeSelector = '.active',
menuChildrenSelector = 'li,a',
completedEventName = 'statechangecomplete',
/* Application Generic Variables */
$window = $(window),
$body = $(document.body),
rootUrl = History.getRootUrl(),
scrollOptions = {
duration: 800,
easing:'swing'
};
// Ensure Content
if ( $content.length === 0 ) {
$content = $body;
}
// Internal Helper
$.expr[':'].internal = function(obj, index, meta, stack){
// Prepare
var
$this = $(obj),
url = $this.attr('href')||'',
isInternalLink;
// Check link
isInternalLink = url.substring(0,rootUrl.length) === rootUrl || url.indexOf(':') === -1;
// Ignore or Keep
return isInternalLink;
};
// HTML Helper
var documentHtml = function(html){
// Prepare
var result = String(html)
.replace(/<\!DOCTYPE[^>]*>/i, '')
.replace(/<(html|head|body|title|meta|script)([\s\>])/gi,'/gi,'
')
;
// Return
return result;
};
// Ajaxify Helper
$.fn.ajaxify = function(){
// Prepare
var $this = $(this);
// Ajaxify
$this.find('a:internal:not(.no-ajaxy)').click(function(event){
// Prepare
var
$this = $(this),
url = $this.attr('href'),
title = $this.attr('title')||null;
lovPos = $(window).scrollTop()
// Continue as normal for cmd clicks etc
if ( event.which == 2 || event.metaKey ) { return true; }
// Ajaxify this link
History.pushState(null,title,url);
event.preventDefault();
return false;
});
// Chain
return $this;
};
// Ajaxify our Internal Links
$body.ajaxify();
// Hook into State Changes
$window.bind('statechange',function(){
// Prepare Variables
var
State = History.getState(),
url = State.url,
relativeUrl = url.replace(rootUrl,'');
// Set Loading
$body.addClass('loading');
// Set animation options
var pagefadeout = true;
var pagespacerheight = windowheight;
$('a').each(function(){
var linkelement = $(this);
if (linkelement.attr('href') == url){
if (linkelement.attr('data-animation') == 'labs'){
// labs animation
pagefadeout = false;
pagespacerheight = $('.content_spacer').height()
}
}
});
// Start Fade Out
// Animating to opacity to 0 still keeps the element's height intact
// Which prevents that annoying pop bang issue when loading in new content
if (relativeUrl == '/en/' || relativeUrl == '/en' || relativeUrl == '.com/' || relativeUrl == '.com' || relativeUrl == 'en/' || relativeUrl == 'en' || relativeUrl == '/' || relativeUrl == ''){
$('.header').animate({
top:'-60px'
}, 1000, 'easeInOutExpo', function(){
//
});
}
if (pagefadeout == true){
$('html').prepend('');
$('.ovl_new_page').animate({
height:getViewport('height')
}, 1000, 'easeInOutExpo', function(){
//
});
$('.bg_item, .layer_fixed, .page_ovl, .page_ovl_c').animate({
top:getViewport('height')
}, 1000, 'easeInOutExpo', function(){
//
});
} else {
$('.content_inner').animate({
opacity:0.5
}, 400, function(){
//
});
}
$('.mobile_nav').animate({
top:getViewport('height')
}, 1000, 'easeInOutExpo', function(){
//
});
$('.content_spacer').animate({
height:pagespacerheight
}, 1000, 'easeInOutExpo', function(){
// Scroll top
if (pagefadeout == true){
$(document).scrollTop(0);
}
// loading
if (pagefadeout == true){
$('body').prepend('');
$('.preloader').loopPreloader({
cycleDuration:1000
});
} else {
$('body').prepend('');
}
// Ajax Request the Traditional Page
$.ajax({
url: url,
success: function(data, textStatus, jqXHR){
// Prepare
var
$data = $('' + documentHtml(data)),
$dataBody = $data.find('.document-body:first'),
$dataContent = $dataBody.find(contentSelector).filter(':first'),
$menuChildren, contentHtml, $scripts;
// Fetch the scripts
$scripts = $dataContent.find('.document-script');
if ( $scripts.length ) {
$scripts.detach();
}
// Fetch the content
contentHtml = $dataContent.html()||$data.html();
if ( !contentHtml ) {
document.location.href = url;
return false;
}
// Update the menu
$menuChildren = $menu.find(menuChildrenSelector);
$menuChildren.filter(activeSelector).removeClass(activeClass);
$menuChildren = $menuChildren.has('a[href^="'+relativeUrl+'"],a[href^="/'+relativeUrl+'"],a[href^="'+url+'"]');
$menu.find('a').each(function(){
if (url.indexOf($(this).attr('href')) >= 0){
$(this).addClass(activeClass);
$(this).parent().addClass(activeClass);
}
});
//if ( $menuChildren.length === 1 ) { $menuChildren.addClass(activeClass);$menuChildren.find('a').addClass(activeClass); }
// Update the content
$content.stop(true,true);
//$content.html(''+contentHtml).ajaxify().css('opacity',100).show(); /* you could fade in here if you'd like */
/* loading */ //$('body').prepend('');
$('.ovl_new_page').remove();
$(window).scrollTop(0);
$content.html(contentHtml).ajaxify().waitForImages(function() {
$('div.loading_content').remove();
if (pagefadeout == true){
$('#content').css('margin-top', '-'+windowheight+'px');
$('#content').animate({
marginTop:0
}, 1000, 'easeInOutExpo', function(){
//
});
} else {
//$(window).scrollTop(lovPos);
$('.content_inner').animate({
opacity:1
}, 400, function(){
//
});
}
$('.content_spacer_loading').animate({
top:windowheight
}, 1000, 'easeInOutExpo', function(){
$(this).remove();
});
// close mobile nav
closeMobileNav(0);
// Update the title
document.title = $data.find('.document-title:first').text();
try {
document.getElementsByTagName('title')[0].innerHTML = document.title.replace('<','<').replace('>','>').replace(' & ',' & ');
}
catch ( Exception ) { }
// Add the scripts
$scripts.each(function(){
var $script = $(this), scriptText = $script.html().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'), scriptNode = document.createElement('script');
scriptNode.appendChild(document.createTextNode(scriptText));
contentNode.appendChild(scriptNode);
});
// Complete the change
if ( $body.ScrollTo||false ) { $body.ScrollTo(scrollOptions); } /* http://balupton.com/projects/jquery-scrollto */
$body.removeClass('loading');
$window.trigger(completedEventName);
// Inform Google Analytics of the change
if ( typeof window._gaq !== 'undefined' ) {
window._gaq.push(['_trackPageview', relativeUrl]);
}
// Inform ReInvigorate of a state change
if ( typeof window.reinvigorate !== 'undefined' && typeof window.reinvigorate.ajax_track !== 'undefined' ) {
reinvigorate.ajax_track(url);
// ^ we use the full url here as that is what reinvigorate supports
}
// Init funtion
init();
initPage();
});
},
error: function(jqXHR, textStatus, errorThrown){
document.location.href = url;
return false;
}
}); // end ajax
});
}); // end onStateChange
}); // end onDomLoad
})(window); // end closure
// Facebook
function postToWall(title, message, image, link) {
FB.ui({
method: "feed",
message: "",
picture: image,
link: link,
caption: message,
name: title,
description: "",
display: "popup"/*,
to: friendId,
from: userId*/
});
}
function getUserData() {
FB.api('/me', {fields: "id, first_name, last_name, email"}, function(response) {
var userId = response.id;
var userFirstName = response.first_name;
var userLastName = response.last_name;
var userEmail = response.email;
var wantedBtn = $('.btn_connect_fb');
wantedBtn.attr('data-params', 'userid='+userId+'&firstname='+userFirstName+'&lastname='+userLastName+'&email='+userEmail);
openFilter(wantedBtn);
wantedList(userId, userFirstName, userLastName, userEmail);
});
}
function getPerms() {
FB.login(function(response) {
if (response.authResponse) {
getUserData();
}
}, {scope:"email"});
}
function getStatus() {
FB.getLoginStatus(function(response) {
if (response.status === "connected") {
getUserData();
} else {
getPerms();
}
});
}
window.fbAsyncInit = function() {
FB.init({
appId: "183412871811609",
status: true,
cookie: true,
xfbml: true,
oauth: true
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
// Twitter
function tweet(text){
var newwindow = window.open('https://twitter.com/intent/tweet?source=webclient&text='+text,'','width=500,height=500');if (window.focus) {newwindow.focus()}
return false;
}
// Google+
function shareGoogle(url){
var newwindow = window.open('https://plus.google.com/share?url='+url,'','width=500,height=500');if (window.focus) {newwindow.focus()}
return false;
}