﻿/*
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(d,c){function R(){if(!a.isReady){try{b.documentElement.doScroll("left")}catch(c){setTimeout(R,1);return}a.ready()}}function Cb(c,b){b.src?a.ajax({url:b.src,async:false,dataType:"script"}):a.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function D(d,e,f,h,g,j){var i=d.length;if(typeof e==="object"){for(var b in e)D(d,b,e[b],h,g,f);return d}if(f!==c){h=!j&&h&&a.isFunction(f);for(b=0;b<i;b++)g(d[b],e,h?f.call(d[b],b,g(d[b],e)):f,j);return d}return i?g(d[0],e):c}function g(){return(new Date).getTime()}function E(){return false}function F(){return true}function T(c,d,b){b[0].type=c;return a.event.handle.apply(d,b)}function V(c){var m,j=[],g=[],n=arguments,d,b,l,e,f,i;b=a.data(this,"events");if(!(c.liveFired===this||!b||!b.live||c.button&&c.type==="click")){c.liveFired=this;var h=b.live.slice(0);for(e=0;e<h.length;e++){b=h[e];b.origType.replace(k,"")===c.type?g.push(b.selector):h.splice(e--,1)}d=a(c.target).closest(g,c.currentTarget);f=0;for(i=d.length;f<i;f++)for(e=0;e<h.length;e++){b=h[e];if(d[f].selector===b.selector){l=d[f].elem;g=null;if(b.preType==="mouseenter"||b.preType==="mouseleave")g=a(c.relatedTarget).closest(b.selector)[0];(!g||g!==l)&&j.push({elem:l,handleObj:b})}}f=0;for(i=j.length;f<i;f++){d=j[f];c.currentTarget=d.elem;c.data=d.handleObj.data;c.handleObj=d.handleObj;if(d.handleObj.origHandler.apply(d.elem,n)===false){m=false;break}}return m}}function Y(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&")}function Z(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ab(b,d){var c=0;d.each(function(){if(this.nodeName===(b[c]&&b[c].nodeName)){var d=a.data(b[c++]),f=a.data(this,d);if(d=d&&d.events){delete f.handle;f.events={};for(var e in d)for(var g in d[e])a.event.add(this,e,d[e][g],d[e][g].data)}}})}function bb(c,d,h){var e,g,f;d=d&&d[0]?d[0].ownerDocument||d[0]:b;if(c.length===1&&typeof c[0]==="string"&&c[0].length<512&&d===b&&!cb.test(c[0])&&(a.support.checkClone||!db.test(c[0]))){g=true;if(f=a.fragments[c[0]])if(f!==1)e=f}if(!e){e=d.createDocumentFragment();a.clean(c,d,e,h)}if(g)a.fragments[c[0]]=f?e:1;return{fragment:e,cacheable:g}}function h(c,d){var b={};a.each(eb.concat.apply([],eb.slice(0,d)),function(){b[this]=c});return b}function fb(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var a=function(b,c){return new a.fn.init(b,c)},Eb=d.jQuery,Gb=d.$,b=d.document,o,Ib=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Kb=/^.[^:#\[\.,]*$/,Mb=/\S/,Ob=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Qb=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,l=navigator.userAgent,gb=false,m=[],i,C=Object.prototype.toString,r=Object.prototype.hasOwnProperty,s=Array.prototype.push,n=Array.prototype.slice,hb=Array.prototype.indexOf;a.fn=a.prototype={init:function(d,e){var f,g;if(!d)return this;if(d.nodeType){this.context=this[0]=d;this.length=1;return this}if(d==="body"&&!e){this.context=b;this[0]=b.body;this.selector="body";this.length=1;return this}if(typeof d==="string")if((f=Ib.exec(d))&&(f[1]||!e))if(f[1]){g=e?e.ownerDocument||e:b;if(d=Qb.exec(d))if(a.isPlainObject(e)){d=[b.createElement(d[1])];a.fn.attr.call(d,e,true)}else d=[g.createElement(d[1])];else{d=bb([f[1]],[g]);d=(d.cacheable?d.fragment.cloneNode(true):d.fragment).childNodes}return a.merge(this,d)}else{if(e=b.getElementById(f[2])){if(e.id!==f[2])return o.find(d);this.length=1;this[0]=e}this.context=b;this.selector=d;return this}else if(!e&&/^\w+$/.test(d)){this.selector=d;this.context=b;d=b.getElementsByTagName(d);return a.merge(this,d)}else return!e||e.jquery?(e||o).find(d):a(e).find(d);else if(a.isFunction(d))return o.ready(d);if(d.selector!==c){this.selector=d.selector;this.context=d.context}return a.makeArray(d,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return n.call(this,0)},"get":function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(c,d,e){var b=a();a.isArray(c)?s.apply(b,c):a.merge(b,c);b.prevObject=this;b.context=this.context;if(d==="find")b.selector=this.selector+(this.selector?" ":"")+e;else if(d)b.selector=this.selector+"."+d+"("+e+")";return b},each:function(b,c){return a.each(this,b,c)},ready:function(c){a.bindReady();if(a.isReady)c.call(b,a);else m&&m.push(c);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(n.apply(this,arguments),"slice",n.call(arguments).join(","))},map:function(b){return this.pushStack(a.map(this,function(a,c){return b.call(a,c,a)}))},end:function(){return this.prevObject||a(null)},push:s,sort:[].sort,splice:[].splice};a.fn.init.prototype=a.fn;a.extend=a.fn.extend=function(){var b=arguments[0]||{},f=1,j=arguments.length,i=false,h,g,e,d;if(typeof b==="boolean"){i=b;b=arguments[1]||{};f=2}if(typeof b!=="object"&&!a.isFunction(b))b={};if(j===f){b=this;--f}for(;f<j;f++)if((h=arguments[f])!=null)for(g in h){e=b[g];d=h[g];if(b!==d)if(i&&d&&(a.isPlainObject(d)||a.isArray(d))){e=e&&(a.isPlainObject(e)||a.isArray(e))?e:a.isArray(d)?[]:{};b[g]=a.extend(i,e,d)}else if(d!==c)b[g]=d}return b};a.extend({noConflict:function(b){d.$=Gb;if(b)d.jQuery=Eb;return a},isReady:false,ready:function(){if(!a.isReady){if(!b.body)return setTimeout(a.ready,13);a.isReady=true;if(m){for(var c,d=0;c=m[d++];)c.call(b,a);m=null}a.fn.triggerHandler&&a(b).triggerHandler("ready")}},bindReady:function(){if(!gb){gb=true;if(b.readyState==="complete")return a.ready();if(b.addEventListener){b.addEventListener("DOMContentLoaded",i,false);d.addEventListener("load",a.ready,false)}else if(b.attachEvent){b.attachEvent("onreadystatechange",i);d.attachEvent("onload",a.ready);var c=false;try{c=d.frameElement==null}catch(e){}b.documentElement.doScroll&&c&&R()}}},isFunction:function(a){return C.call(a)==="[object Function]"},isArray:function(a){return C.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||C.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!r.call(a,"constructor")&&!r.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===c||r.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=a.trim(b);if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d.JSON&&d.JSON.parse?d.JSON.parse(b):new Function("return "+b)();else a.error("Invalid JSON: "+b)},noop:function(){},globalEval:function(d){if(d&&Mb.test(d)){var e=b.getElementsByTagName("head")[0]||b.documentElement,c=b.createElement("script");c.type="text/javascript";if(a.support.scriptEval)c.appendChild(b.createTextNode(d));else c.text=d;e.insertBefore(c,e.firstChild);e.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(b,g,d){var e,f=0,h=b.length,i=h===c||a.isFunction(b);if(d){if(i){for(e in b)if(g.apply(b[e],d)===false)break}else for(;f<h;)if(g.apply(b[f++],d)===false)break}else if(i){for(e in b)if(g.call(b[e],e,b[e])===false)break}else for(d=b[0];f<h&&g.call(d,f,d)!==false;d=b[++f]);return b},trim:function(a){return(a||"").replace(Ob,"")},makeArray:function(b,c){c=c||[];if(b!=null)b.length==null||typeof b==="string"||a.isFunction(b)||typeof b!=="function"&&b.setInterval?s.call(c,b):a.merge(c,b);return c},inArray:function(c,a){if(a.indexOf)return a.indexOf(c);for(var b=0,d=a.length;b<d;b++)if(a[b]===c)return b;return-1},merge:function(a,b){var e=a.length,d=0;if(typeof b.length==="number")for(var f=b.length;d<f;d++)a[e++]=b[d];else for(;b[d]!==c;)a[e++]=b[d++];a.length=e;return a},grep:function(b,d,e){for(var c=[],a=0,f=b.length;a<f;a++)!e!==!d(b[a],a)&&c.push(b[a]);return c},map:function(d,e,f){for(var a=[],c,b=0,g=d.length;b<g;b++){c=e(d[b],b,f);if(c!=null)a[a.length]=c}return a.concat.apply([],a)},guid:1,proxy:function(d,b,e){if(arguments.length===2)if(typeof b==="string"){e=d;d=e[b];b=c}else if(b&&!a.isFunction(b)){e=b;b=c}if(!b&&d)b=function(){return d.apply(e||this,arguments)};if(d)b.guid=d.guid=d.guid||b.guid||a.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});l=a.uaMatch(l);if(l.browser){a.browser[l.browser]=true;a.browser.version=l.version}if(a.browser.webkit)a.browser.safari=true;if(hb)a.inArray=function(a,b){return hb.call(b,a)};o=a(b);if(b.addEventListener)i=function(){b.removeEventListener("DOMContentLoaded",i,false);a.ready()};else if(b.attachEvent)i=function(){if(b.readyState==="complete"){b.detachEvent("onreadystatechange",i);a.ready()}};(function(){a.support={};var e=b.documentElement,f=b.createElement("script"),c=b.createElement("div"),j="script"+g();c.style.display="none";c.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var i=c.getElementsByTagName("*"),h=c.getElementsByTagName("a")[0];if(!(!i||!i.length||!h)){a.support={leadingWhitespace:c.firstChild.nodeType===3,tbody:!c.getElementsByTagName("tbody").length,htmlSerialize:!!c.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:c.getElementsByTagName("input")[0].value==="on",optSelected:b.createElement("select").appendChild(b.createElement("option")).selected,parentNode:c.removeChild(c.appendChild(b.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};f.type="text/javascript";try{f.appendChild(b.createTextNode("window."+j+"=1;"))}catch(l){}e.insertBefore(f,e.firstChild);if(d[j]){a.support.scriptEval=true;delete d[j]}try{delete f.test}catch(m){a.support.deleteExpando=false}e.removeChild(f);if(c.attachEvent&&c.fireEvent){c.attachEvent("onclick",function k(){a.support.noCloneEvent=false;c.detachEvent("onclick",k)});c.cloneNode(true).fireEvent("onclick")}c=b.createElement("div");c.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";e=b.createDocumentFragment();e.appendChild(c.firstChild);a.support.checkClone=e.cloneNode(true).cloneNode(true).lastChild.checked;a(function(){var c=b.createElement("div");c.style.width=c.style.paddingLeft="1px";b.body.appendChild(c);a.boxModel=a.support.boxModel=c.offsetWidth===2;b.body.removeChild(c).style.display="none"});e=function(a){var c=b.createElement("div");a="on"+a;var d=a in c;if(!d){c.setAttribute(a,"return;");d=typeof c[a]==="function"}return d};a.support.submitBubbles=e("submit");a.support.changeBubbles=e("change");e=f=c=i=h=null}})();a.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var f="jQuery"+g(),Sb=0,ib={};a.extend({cache:{},expando:f,noData:{embed:true,object:true,applet:true},data:function(b,g,i){if(!(b.nodeName&&a.noData[b.nodeName.toLowerCase()])){b=b==d?ib:b;var e=b[f],h=a.cache;if(!e&&typeof g==="string"&&i===c)return null;e||(e=++Sb);if(typeof g==="object"){b[f]=e;h[e]=a.extend(true,{},g)}else if(!h[e]){b[f]=e;h[e]={}}b=h[e];if(i!==c)b[g]=i;return typeof g==="string"?b[g]:b}},removeData:function(b,e){if(!(b.nodeName&&a.noData[b.nodeName.toLowerCase()])){b=b==d?ib:b;var g=b[f],h=a.cache,c=h[g];if(e){if(c){delete c[e];a.isEmptyObject(c)&&a.removeData(b)}}else{if(a.support.deleteExpando)delete b[a.expando];else b.removeAttribute&&b.removeAttribute(a.expando);delete h[g]}}}});a.fn.extend({data:function(d,f){if(typeof d==="undefined"&&this.length)return a.data(this[0]);else if(typeof d==="object")return this.each(function(){a.data(this,d)});var b=d.split(".");b[1]=b[1]?"."+b[1]:"";if(f===c){var e=this.triggerHandler("getData"+b[1]+"!",[b[0]]);if(e===c&&this.length)e=a.data(this[0],d);return e===c&&b[1]?this.data(b[0]):e}else return this.trigger("setData"+b[1]+"!",[b[0],f]).each(function(){a.data(this,d,f)})},removeData:function(b){return this.each(function(){a.removeData(this,b)})}});a.extend({queue:function(e,c,d){if(e){c=(c||"fx")+"queue";var b=a.data(e,c);if(!d)return b||[];if(!b||a.isArray(d))b=a.data(e,c,a.makeArray(d));else b.push(d);return b}},dequeue:function(d,b){b=b||"fx";var e=a.queue(d,b),c=e.shift();if(c==="inprogress")c=e.shift();if(c){b==="fx"&&e.unshift("inprogress");c.call(d,function(){a.dequeue(d,b)})}}});a.fn.extend({queue:function(b,d){if(typeof b!=="string"){d=b;b="fx"}return d===c?a.queue(this[0],b):this.each(function(){var c=a.queue(this,b,d);b==="fx"&&c[0]!=="inprogress"&&a.dequeue(this,b)})},dequeue:function(b){return this.each(function(){a.dequeue(this,b)})},delay:function(b,c){b=a.fx?a.fx.speeds[b]||b:b;c=c||"fx";return this.queue(c,function(){var d=this;setTimeout(function(){a.dequeue(d,c)},b)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var G=/[\n\t]/g,t=/\s+/,Ub=/\r/g,jb=/href|src|style/,lb=/(button|input)/i,nb=/(button|input|object|select|textarea)/i,ob=/^(a|area)$/i,H=/radio|checkbox/;a.fn.extend({attr:function(b,c){return D(this,b,c,true,a.attr)},removeAttr:function(b){return this.each(function(){a.attr(this,b,"");this.nodeType===1&&this.removeAttribute(b)})},addClass:function(b){if(a.isFunction(b))return this.each(function(d){var c=a(this);c.addClass(b.call(this,d,c.attr("class")))});if(b&&typeof b==="string")for(var e=(b||"").split(t),f=0,h=this.length;f<h;f++){var c=this[f];if(c.nodeType===1)if(c.className){for(var i=" "+c.className+" ",g=c.className,d=0,j=e.length;d<j;d++)if(i.indexOf(" "+e[d]+" ")<0)g+=" "+e[d];c.className=a.trim(g)}else c.className=b}return this},removeClass:function(b){if(a.isFunction(b))return this.each(function(d){var c=a(this);c.removeClass(b.call(this,d,c.attr("class")))});if(b&&typeof b==="string"||b===c)for(var h=(b||"").split(t),e=0,i=this.length;e<i;e++){var d=this[e];if(d.nodeType===1&&d.className)if(b){for(var g=(" "+d.className+" ").replace(G," "),f=0,j=h.length;f<j;f++)g=g.replace(" "+h[f]+" "," ");d.className=a.trim(g)}else d.className=""}return this},toggleClass:function(b,c){var d=typeof b,e=typeof c==="boolean";return a.isFunction(b)?this.each(function(e){var d=a(this);d.toggleClass(b.call(this,e,d.attr("class"),c),c)}):this.each(function(){if(d==="string")for(var f,i=0,h=a(this),g=c,j=b.split(t);f=j[i++];){g=e?g:!h.hasClass(f);h[g?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&a.data(this,"__className__",this.className);this.className=this.className||b===false?"":a.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,c=this.length;b<c;b++)if((" "+this[b].className+" ").replace(G," ").indexOf(a)>-1)return true;return false},val:function(d){if(d===c){var b=this[0];if(b){if(a.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(a.nodeName(b,"select")){var e=b.selectedIndex,h=[],g=b.options;b=b.type==="select-one";if(e<0)return null;var f=b?e:0;for(e=b?e+1:g.length;f<e;f++){var i=g[f];if(i.selected){d=a(i).val();if(b)return d;h.push(d)}}return h}return H.test(b.type)&&!a.support.checkOn?b.getAttribute("value")===null?"on":b.value:(b.value||"").replace(Ub,"")}return c}var j=a.isFunction(d);return this.each(function(f){var c=a(this),b=d;if(this.nodeType===1){if(j)b=d.call(this,f,c.val());if(typeof b==="number")b+="";if(a.isArray(b)&&H.test(this.type))this.checked=a.inArray(c.val(),b)>=0;else if(a.nodeName(this,"select")){var e=a.makeArray(b);a("option",this).each(function(){this.selected=a.inArray(a(this).val(),e)>=0});if(!e.length)this.selectedIndex=-1}else this.value=b}})}});a.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(b,d,e,f){if(!b||b.nodeType===3||b.nodeType===8)return c;if(f&&d in a.attrFn)return a(b)[d](e);f=b.nodeType!==1||!a.isXMLDoc(b);var g=e!==c;d=f&&a.props[d]||d;if(b.nodeType===1){var h=jb.test(d);if(d in b&&f&&!h){if(g){d==="type"&&lb.test(b.nodeName)&&b.parentNode&&a.error("type property can't be changed");b[d]=e}return a.nodeName(b,"form")&&b.getAttributeNode(d)?b.getAttributeNode(d).nodeValue:d==="tabIndex"?(d=b.getAttributeNode("tabIndex"))&&d.specified?d.value:nb.test(b.nodeName)||ob.test(b.nodeName)&&b.href?0:c:b[d]}if(!a.support.style&&f&&d==="style"){if(g)b.style.cssText=""+e;return b.style.cssText}g&&b.setAttribute(d,""+e);b=!a.support.hrefNormalized&&f&&h?b.getAttribute(d,2):b.getAttribute(d);return b===null?c:b}return a.style(b,d,e)}});var k=/\.(.*)$/,pb=function(a){return a.replace(/[^\w\s\.\|`]/g,function(a){return"\\"+a})};a.event={add:function(b,l,g,n){if(!(b.nodeType===3||b.nodeType===8)){if(b.setInterval&&b!==d&&!b.frameElement)b=d;var j,e;if(g.handler){j=g;g=j.handler}if(!g.guid)g.guid=a.guid++;if(e=a.data(b)){var o=e.events=e.events||{},h=e.handle;if(!h)e.handle=h=function(){return typeof a!=="undefined"&&!a.event.triggered?a.event.handle.apply(h.elem,arguments):c};h.elem=b;l=l.split(" ");for(var f,p=0,i;f=l[p++];){e=j?a.extend({},j):{handler:g,data:n};if(f.indexOf(".")>-1){i=f.split(".");f=i.shift();e.namespace=i.slice(0).sort().join(".")}else{i=[];e.namespace=""}e.type=f;e.guid=g.guid;var m=o[f],k=a.event.special[f]||{};if(!m){m=o[f]=[];if(!k.setup||k.setup.call(b,n,i,h)===false)if(b.addEventListener)b.addEventListener(f,h,false);else b.attachEvent&&b.attachEvent("on"+f,h)}if(k.add){k.add.call(b,e);if(!e.handler.guid)e.handler.guid=g.guid}m.push(e);a.event.global[f]=true}b=null}}},global:{},remove:function(e,b,n,l){if(!(e.nodeType===3||e.nodeType===8)){var c,p=0,m,k,o,h,f,i,g=a.data(e),j=g&&g.events;if(g&&j){if(b&&b.type){n=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(c in j)a.event.remove(e,c+b)}else{for(b=b.split(" ");c=b[p++];){h=c;m=c.indexOf(".")<0;k=[];if(!m){k=c.split(".");c=k.shift();o=new RegExp("(^|\\.)"+a.map(k.slice(0).sort(),pb).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(f=j[c])if(n){h=a.event.special[c]||{};for(d=l||0;d<f.length;d++){i=f[d];if(n.guid===i.guid){if(m||o.test(i.namespace)){l==null&&f.splice(d--,1);h.remove&&h.remove.call(e,i)}if(l!=null)break}}if(f.length===0||l!=null&&f.length===1){(!h.teardown||h.teardown.call(e,k)===false)&&I(e,c,g.handle);delete j[c]}}else for(var d=0;d<f.length;d++){i=f[d];if(m||o.test(i.namespace)){a.event.remove(e,h,i.handler,d);f.splice(d--,1)}}}if(a.isEmptyObject(j)){if(b=g.handle)b.elem=null;delete g.events;delete g.handle;a.isEmptyObject(g)&&a.removeData(e)}}}}},trigger:function(b,h,d,g){var e=b.type||b;if(!g){b=typeof b==="object"?b[f]?b:a.extend(a.Event(e),b):a.Event(e);if(e.indexOf("!")>=0){b.type=e=e.slice(0,-1);b.exclusive=true}if(!d){b.stopPropagation();a.event.global[e]&&a.each(a.cache,function(){this.events&&this.events[e]&&a.event.trigger(b,h,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return c;b.result=c;b.target=d;h=a.makeArray(h);h.unshift(b)}b.currentTarget=d;(g=a.data(d,"handle"))&&g.apply(d,h);g=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&a.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,h)===false)b.result=false}catch(l){}if(!b.isPropagationStopped()&&g)a.event.trigger(b,h,g,true);else if(!b.isDefaultPrevented()){g=b.target;var i,k=a.nodeName(g,"a")&&e==="click",j=a.event.special[e]||{};if((!j._default||j._default.call(d,b)===false)&&!k&&!(g&&g.nodeName&&a.noData[g.nodeName.toLowerCase()])){try{if(g[e]){if(i=g["on"+e])g["on"+e]=null;a.event.triggered=true;g[e]()}}catch(m){}if(i)g["on"+e]=i;a.event.triggered=false}}},handle:function(b){var h,e,i,g;b=arguments[0]=a.event.fix(b||d.event);b.currentTarget=this;h=b.type.indexOf(".")<0&&!b.exclusive;if(!h){e=b.type.split(".");b.type=e.shift();i=new RegExp("(^|\\.)"+e.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}g=a.data(this,"events");e=g[b.type];if(g&&e){e=e.slice(0);g=0;for(var j=e.length;g<j;g++){var f=e[g];if(h||i.test(f.namespace)){b.handler=f.handler;b.data=f.data;b.handleObj=f;f=f.handler.apply(this,arguments);if(f!==c){b.result=f;if(f===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped())break}}}return b.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(d){if(d[f])return d;var e=d;d=a.Event(e);for(var g=this.props.length,h;g;){h=this.props[--g];d[h]=e[h]}if(!d.target)d.target=d.srcElement||b;if(d.target.nodeType===3)d.target=d.target.parentNode;if(!d.relatedTarget&&d.fromElement)d.relatedTarget=d.fromElement===d.target?d.toElement:d.fromElement;if(d.pageX==null&&d.clientX!=null){e=b.documentElement;g=b.body;d.pageX=d.clientX+(e&&e.scrollLeft||g&&g.scrollLeft||0)-(e&&e.clientLeft||g&&g.clientLeft||0);d.pageY=d.clientY+(e&&e.scrollTop||g&&g.scrollTop||0)-(e&&e.clientTop||g&&g.clientTop||0)}if(!d.which&&(d.charCode||d.charCode===0?d.charCode:d.keyCode))d.which=d.charCode||d.keyCode;if(!d.metaKey&&d.ctrlKey)d.metaKey=d.ctrlKey;if(!d.which&&d.button!==c)d.which=d.button&1?1:d.button&2?3:d.button&4?2:0;return d},guid:1e8,proxy:a.proxy,special:{ready:{setup:a.bindReady,teardown:a.noop},live:{add:function(b){a.event.add(this,b.origType,a.extend({},b,{handler:V}))},remove:function(b){var c=true,d=b.origType.replace(k,"");a.each(a.data(this,"events").live||[],function(){if(d===this.origType.replace(k,""))return c=false});c&&a.event.remove(this,b.origType,V)}},beforeunload:{setup:function(b,c,a){if(this.setInterval)this.onbeforeunload=a;return false},teardown:function(b,a){if(this.onbeforeunload===a)this.onbeforeunload=null}}}};var I=b.removeEventListener?function(a,b,c){a.removeEventListener(b,c,false)}:function(a,b,c){a.detachEvent("on"+b,c)};a.Event=function(b){if(!this.preventDefault)return new a.Event(b);if(b&&b.type){this.originalEvent=b;this.type=b.type}else this.type=b;this.timeStamp=g();this[f]=true};a.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=F;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F;this.stopPropagation()},isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E};var J=function(c){var b=c.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){c.type=c.data;a.event.handle.apply(this,arguments)}}catch(d){}},K=function(b){b.type=b.data;a.event.handle.apply(this,arguments)};a.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(b,c){a.event.special[b]={setup:function(d){a.event.add(this,c,d&&d.selector?K:J,b)},teardown:function(b){a.event.remove(this,c,b&&b.selector?K:J)}}});if(!a.support.submitBubbles)a.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){a.event.add(this,"click.specialSubmit",function(d){var b=d.target,c=b.type;if((c==="submit"||c==="image")&&a(b).closest("form").length)return T("submit",this,arguments)});a.event.add(this,"keypress.specialSubmit",function(b){var c=b.target,d=c.type;if((d==="text"||d==="password")&&a(c).closest("form").length&&b.keyCode===13)return T("submit",this,arguments)})}else return false},teardown:function(){a.event.remove(this,".specialSubmit")}};if(!a.support.changeBubbles){var u=/textarea|input|select/i,v,L=function(b){var d=b.type,c=b.value;if(d==="radio"||d==="checkbox")c=b.checked;else if(d==="select-multiple")c=b.selectedIndex>-1?a.map(b.options,function(a){return a.selected}).join("-"):"";else if(b.nodeName.toLowerCase()==="select")c=b.selectedIndex;return c},w=function(d,g){var b=d.target,f,e;if(!(!u.test(b.nodeName)||b.readOnly)){f=a.data(b,"_change_data");e=L(b);(d.type!=="focusout"||b.type!=="radio")&&a.data(b,"_change_data",e);if(!(f===c||e===f))if(f!=null||e){d.type="change";return a.event.trigger(d,g,b)}}};a.event.special.change={filters:{focusout:w,click:function(a){var b=a.target,c=b.type;if(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")return w.call(this,a)},keydown:function(a){var c=a.target,b=c.type;if(a.keyCode===13&&c.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(b==="checkbox"||b==="radio")||b==="select-multiple")return w.call(this,a)},beforeactivate:function(b){b=b.target;a.data(b,"_change_data",L(b))}},setup:function(){if(this.type==="file")return false;for(var b in v)a.event.add(this,b+".specialChange",v[b]);return u.test(this.nodeName)},teardown:function(){a.event.remove(this,".specialChange");return u.test(this.nodeName)}};v=a.event.special.change.filters}b.addEventListener&&a.each({focus:"focusin",blur:"focusout"},function(b,c){function d(b){b=a.event.fix(b);b.type=c;return a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(b,d,true)},teardown:function(){this.removeEventListener(b,d,true)}}});a.each(["bind","one"],function(d,b){a.fn[b]=function(d,f,e){if(typeof d==="object"){for(var g in d)this[b](g,f,d[g],e);return this}if(a.isFunction(f)){e=f;f=c}var h=b==="one"?a.proxy(e,function(b){a(this).unbind(b,h);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{g=0;for(var i=this.length;g<i;g++)a.event.add(this[g],d,h,f)}return this}});a.fn.extend({unbind:function(c,d){if(typeof c==="object"&&!c.preventDefault)for(var b in c)this.unbind(b,c[b]);else{b=0;for(var e=this.length;b<e;b++)a.event.remove(this[b],c,d)}return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(b,c){return this.each(function(){a.event.trigger(b,c,this)})},triggerHandler:function(b,c){if(this[0]){b=a.Event(b);b.preventDefault();b.stopPropagation();a.event.trigger(b,c,this[0]);return b.result}},toggle:function(b){for(var c=arguments,d=1;d<c.length;)a.proxy(b,c[d++]);return this.click(a.proxy(b,function(f){var e=(a.data(this,"lastToggle"+b.guid)||0)%d;a.data(this,"lastToggle"+b.guid,e+1);f.preventDefault();return c[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var M={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};a.each(["live","die"],function(d,b){a.fn[b]=function(f,i,h,g){var d,n=0,e,l,j=g||this.selector,m=g?this:a(this.context);if(a.isFunction(i)){h=i;i=c}for(f=(f||"").split(" ");(d=f[n++])!=null;){g=k.exec(d);e="";if(g){e=g[0];d=d.replace(k,"")}if(d==="hover")f.push("mouseenter"+e,"mouseleave"+e);else{l=d;if(d==="focus"||d==="blur"){f.push(M[d]+e);d+=e}else d=(M[d]||d)+e;b==="live"?m.each(function(){a.event.add(this,Y(d,j),{data:i,selector:j,handler:h,origType:d,origHandler:h,preType:l})}):m.unbind(Y(d,j),h)}}return this}});a.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(c,b){a.fn[b]=function(a){return a?this.bind(b,a):this.trigger(b)};if(a.attrFn)a.attrFn[b]=true});d.attachEvent&&!d.addEventListener&&d.attachEvent("onunload",function(){for(var b in a.cache)if(a.cache[b].handle)try{a.event.remove(a.cache[b].handle.elem)}catch(c){}});(function(){function k(d){for(var b="",a,c=0;d[c];c++){a=d[c];if(a.nodeType===3||a.nodeType===4)b+=a.nodeValue;else if(a.nodeType!==8)b+=k(a.childNodes)}return b}function o(e,g,f,c,b,h){b=0;for(var i=c.length;b<i;b++){var a=c[b];if(a){a=a[e];for(var d=false;a;){if(a.sizcache===f){d=c[a.sizset];break}if(a.nodeType===1&&!h){a.sizcache=f;a.sizset=b}if(a.nodeName.toLowerCase()===g){d=a;break}a=a[e]}c[b]=d}}}function p(g,f,h,c,b,i){b=0;for(var j=c.length;b<j;b++){var a=c[b];if(a){a=a[g];for(var d=false;a;){if(a.sizcache===h){d=c[a.sizset];break}if(a.nodeType===1){if(!i){a.sizcache=h;a.sizset=b}if(typeof f!=="string"){if(a===f){d=true;break}}else if(e.filter(f,[a]).length>0){d=a;break}}a=a[g]}c[b]=d}}}var m=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,l=0,r=Object.prototype.toString,f=false,s=true;[0,0].sort(function(){s=false;return 0});var e=function(c,g,k,s){k=k||[];var x=g=g||b;if(g.nodeType!==1&&g.nodeType!==9)return[];if(!c||typeof c!=="string")return k;for(var a=[],f,l,i,u,v=true,p=j(g),w=c;(m.exec(""),f=m.exec(w))!==null;){w=f[3];a.push(f[1]);if(f[2]){u=f[3];break}}if(a.length>1&&t.exec(c))if(a.length===2&&d.relative[a[0]])l=n(a[0]+a[1],g);else for(l=d.relative[a[0]]?[g]:e(a.shift(),g);a.length;){c=a.shift();if(d.relative[c])c+=a.shift();l=n(c,l)}else{if(!s&&a.length>1&&g.nodeType===9&&!p&&d.match.ID.test(a[0])&&!d.match.ID.test(a[a.length-1])){f=e.find(a.shift(),g,p);g=f.expr?e.filter(f.expr,f.set)[0]:f.set[0]}if(g){f=s?{expr:a.pop(),"set":h(s)}:e.find(a.pop(),a.length===1&&(a[0]==="~"||a[0]==="+")&&g.parentNode?g.parentNode:g,p);l=f.expr?e.filter(f.expr,f.set):f.set;if(a.length>0)i=h(l);else v=false;for(;a.length;){var o=a.pop();f=o;if(d.relative[o])f=a.pop();else o="";if(f==null)f=g;d.relative[o](i,f,p)}}else i=[]}i||(i=l);i||e.error(o||c);if(r.call(i)==="[object Array]")if(v)if(g&&g.nodeType===1)for(c=0;i[c]!=null;c++)i[c]&&(i[c]===true||i[c].nodeType===1&&q(g,i[c]))&&k.push(l[c]);else for(c=0;i[c]!=null;c++)i[c]&&i[c].nodeType===1&&k.push(l[c]);else k.push.apply(k,i);else h(i,k);if(u){e(u,x,k,s);e.uniqueSort(k)}return k};e.uniqueSort=function(a){if(g){f=s;a.sort(g);if(f)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a};e.matches=function(a,b){return e(a,null,null,b)};e.find=function(b,g,i){var c,a;if(!b)return[];for(var e=0,j=d.order.length;e<j;e++){var f=d.order[e];if(a=d.leftMatch[f].exec(b)){var h=a[1];a.splice(1,1);if(h.substr(h.length-1)!=="\\"){a[1]=(a[1]||"").replace(/\\/g,"");c=d.find[f](a,g,i);if(c!=null){b=b.replace(d.match[f],"");break}}}}c||(c=g.getElementsByTagName("*"));return{"set":c,expr:b}};e.filter=function(b,i,o,q){for(var r=b,m=[],g=i,a,h,t=i&&i[0]&&j(i[0]);b&&i.length;){for(var k in d.filter)if((a=d.leftMatch[k].exec(b))!=null&&a[2]){var s=d.filter[k],l,f;f=a[1];h=false;a.splice(1,1);if(f.substr(f.length-1)!=="\\"){if(g===m)m=[];if(d.preFilter[k])if(a=d.preFilter[k](a,g,o,m,q,t)){if(a===true)continue}else h=l=true;if(a)for(var n=0;(f=g[n])!=null;n++)if(f){l=s(f,a,n,g);var p=q^!!l;if(o&&l!=null)if(p)h=true;else g[n]=false;else if(p){m.push(f);h=true}}if(l!==c){o||(g=m);b=b.replace(d.match[k],"");if(!h)return[];break}}}if(b===r)if(h==null)e.error(b);else break;r=b}return g};e.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var d=e.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(f,b){var d=typeof b==="string",c=d&&!/\W/.test(b);d=d&&!c;if(c)b=b.toLowerCase();c=0;for(var g=f.length,a;c<g;c++)if(a=f[c]){for(;(a=a.previousSibling)&&a.nodeType!==1;);f[c]=d||a&&a.nodeName.toLowerCase()===b?a||false:a===b}d&&e.filter(b,f,true)},">":function(b,c){var d=typeof c==="string";if(d&&!/\W/.test(c)){c=c.toLowerCase();for(var a=0,g=b.length;a<g;a++){var f=b[a];if(f){d=f.parentNode;b[a]=d.nodeName.toLowerCase()===c?d:false}}}else{a=0;for(g=b.length;a<g;a++)if(f=b[a])b[a]=d?f.parentNode:f.parentNode===c;d&&e.filter(c,b,true)}},"":function(c,a,d){var e=l++,b=p;if(typeof a==="string"&&!/\W/.test(a)){var f=a=a.toLowerCase();b=o}b("parentNode",a,e,c,f,d)},"~":function(c,a,d){var e=l++,b=p;if(typeof a==="string"&&!/\W/.test(a)){var f=a=a.toLowerCase();b=o}b("previousSibling",a,e,c,f,d)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c)return(a=b.getElementById(a[1]))?[a]:[]},NAME:function(d,a){if(typeof a.getElementsByName!=="undefined"){var c=[];a=a.getElementsByName(d[1]);for(var b=0,e=a.length;b<e;b++)a[b].getAttribute("name")===d[1]&&c.push(a[b]);return c.length===0?null:c}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(c,d,e,f,g,a){c=" "+c[1].replace(/\\/g,"")+" ";if(a)return c;a=0;for(var b;(b=d[a])!=null;a++)if(b)if(g^(b.className&&(" "+b.className+" ").replace(/[\t\n]/g," ").indexOf(c)>=0))e||f.push(b);else if(e)d[a]=false;return false},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}a[0]=l++;return a},ATTR:function(a,b,e,f,g,c){b=a[1].replace(/\\/g,"");if(!c&&d.attrMap[b])a[1]=d.attrMap[b];if(a[2]==="~=")a[4]=" "+a[4]+" ";return a},PSEUDO:function(a,b,c,f,g){if(a[1]==="not")if((m.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=e(a[3],null,null,b);else{a=e.filter(a[3],b,c,true^g);c||f.push.apply(f,a);return false}else if(d.match.POS.test(a[0])||d.match.CHILD.test(a[0]))return true;return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===true},checked:function(a){return a.checked===true},selected:function(a){return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,c,b){return!!e(b[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(b,a){return a===0},last:function(c,a,d,b){return a===b.length-1},even:function(b,a){return a%2===0},odd:function(b,a){return a%2===1},lt:function(c,a,b){return a<b[3]-0},gt:function(c,a,b){return a>b[3]-0},nth:function(c,a,b){return b[3]-0===a},eq:function(c,a,b){return b[3]-0===a}},filter:{PSEUDO:function(b,a,c,g){var f=a[1],h=d.filters[f];if(h)return h(b,c,a,g);else if(f==="contains")return(b.textContent||b.innerText||k([b])||"").indexOf(a[3])>=0;else if(f==="not"){a=a[3];c=0;for(g=a.length;c<g;c++)if(a[c]===b)return false;return true}else e.error("Syntax error, unrecognized expression: "+f)},CHILD:function(b,c){var d=c[1],a=b;switch(d){case"only":case"first":for(;a=a.previousSibling;)if(a.nodeType===1)return false;if(d==="first")return true;a=b;case"last":for(;a=a.nextSibling;)if(a.nodeType===1)return false;return true;case"nth":d=c[2];var f=c[3];if(d===1&&f===0)return true;c=c[0];var e=b.parentNode;if(e&&(e.sizcache!==c||!b.nodeIndex)){var g=0;for(a=e.firstChild;a;a=a.nextSibling)if(a.nodeType===1)a.nodeIndex=++g;e.sizcache=c}b=b.nodeIndex-f;return d===0?b===0:b%d===0&&b/d>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(c,b){var a=b[1];c=d.attrHandle[a]?d.attrHandle[a](c):c[a]!=null?c[a]:c.getAttribute(a);a=c+"";var e=b[2];b=b[4];return c==null?e==="!=":e==="="?a===b:e==="*="?a.indexOf(b)>=0:e==="~="?(" "+a+" ").indexOf(b)>=0:!b?a&&c!==false:e==="!="?a!==b:e==="^="?a.indexOf(b)===0:e==="$="?a.substr(a.length-b.length)===b:e==="|="?a===b||a.substr(0,b.length+1)===b+"-":false},POS:function(c,a,e,f){var b=d.setFilters[a[2]];if(b)return b(c,e,a,f)}}},t=d.match.POS;for(var i in d.match){d.match[i]=new RegExp(d.match[i].source+/(?![^\[]*\])(?![^\(]*\))/.source);d.leftMatch[i]=new RegExp(/(^(?:.|\r|\n)*?)/.source+d.match[i].source.replace(/\\(\d+)/g,function(b,a){return"\\"+(a-0+1)}))}var h=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(b.documentElement.childNodes,0)}catch(u){h=function(a,c){c=c||[];if(r.call(a)==="[object Array]")Array.prototype.push.apply(c,a);else if(typeof a.length==="number")for(var b=0,d=a.length;b<d;b++)c.push(a[b]);else for(b=0;a[b];b++)c.push(a[b]);return c}}var g;if(b.documentElement.compareDocumentPosition)g=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b)f=true;return a.compareDocumentPosition?-1:1}a=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(a===0)f=true;return a};else if("sourceIndex"in b.documentElement)g=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b)f=true;return a.sourceIndex?-1:1}a=a.sourceIndex-b.sourceIndex;if(a===0)f=true;return a};else if(b.createRange)g=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b)f=true;return a.ownerDocument?-1:1}var c=a.ownerDocument.createRange(),d=b.ownerDocument.createRange();c.setStart(a,0);c.setEnd(a,0);d.setStart(b,0);d.setEnd(b,0);a=c.compareBoundaryPoints(Range.START_TO_END,d);if(a===0)f=true;return a};(function(){var a=b.createElement("div"),f="script"+(new Date).getTime();a.innerHTML="<a name='"+f+"'/>";var e=b.documentElement;e.insertBefore(a,e.firstChild);if(b.getElementById(f)){d.find.ID=function(b,a,d){if(typeof a.getElementById!=="undefined"&&!d)return(a=a.getElementById(b[1]))?a.id===b[1]||typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id").nodeValue===b[1]?[a]:c:[]};d.filter.ID=function(a,c){var b=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&b&&b.nodeValue===c}}e.removeChild(a);e=a=null})();(function(){var a=b.createElement("div");a.appendChild(b.createComment(""));if(a.getElementsByTagName("*").length>0)d.find.TAG=function(b,a){a=a.getElementsByTagName(b[1]);if(b[1]==="*"){b=[];for(var c=0;a[c];c++)a[c].nodeType===1&&b.push(a[c]);a=b}return a};a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#")d.attrHandle.href=function(a){return a.getAttribute("href",2)};a=null})();b.querySelectorAll&&function(){var c=e,a=b.createElement("div");a.innerHTML="<p class='TEST'></p>";if(!(a.querySelectorAll&&a.querySelectorAll(".TEST").length===0)){e=function(d,a,e,f){a=a||b;if(!f&&a.nodeType===9&&!j(a))try{return h(a.querySelectorAll(d),e)}catch(g){}return c(d,a,e,f)};for(var d in c)e[d]=c[d];a=null}}();(function(){var a=b.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!a.getElementsByClassName||a.getElementsByClassName("e").length===0)){a.lastChild.className="e";if(a.getElementsByClassName("e").length!==1){d.order.splice(1,0,"CLASS");d.find.CLASS=function(b,a,c){if(typeof a.getElementsByClassName!=="undefined"&&!c)return a.getElementsByClassName(b[1])};a=null}}})();var q=b.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)},j=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":false},n=function(a,b){var f=[],g="",c;for(b=b.nodeType?[b]:b;c=d.match.PSEUDO.exec(a);){g+=c[0];a=a.replace(d.match.PSEUDO,"")}a=d.relative[a]?a+"*":a;c=0;for(var h=b.length;c<h;c++)e(a,b[c],f);return e.filter(g,f)};a.find=e;a.expr=e.selectors;a.expr[":"]=a.expr.filters;a.unique=e.uniqueSort;a.text=k;a.isXMLDoc=j;a.contains=q})();var qb=/Until$/,rb=/^(?:parents|prevUntil|prevAll)/,sb=/,/;n=Array.prototype.slice;var N=function(c,b,d){if(a.isFunction(b))return a.grep(c,function(a,c){return!!b.call(a,c,a)===d});else if(b.nodeType)return a.grep(c,function(a){return a===b===d});else if(typeof b==="string"){var e=a.grep(c,function(a){return a.nodeType===1});if(Kb.test(b))return a.filter(b,e,!d);else b=a.filter(b,e)}return a.grep(c,function(c){return a.inArray(c,b)>=0===d})};a.fn.extend({find:function(g){for(var b=this.pushStack("","find",g),e=0,c=0,h=this.length;c<h;c++){e=b.length;a.find(g,this[c],b);if(c>0)for(var d=e;d<b.length;d++)for(var f=0;f<e;f++)if(b[f]===b[d]){b.splice(d--,1);break}}return b},has:function(c){var b=a(c);return this.filter(function(){for(var c=0,d=b.length;c<d;c++)if(a.contains(this,b[c]))return true})},not:function(a){return this.pushStack(N(this,a,false),"not",a)},filter:function(a){return this.pushStack(N(this,a,true),"filter",a)},is:function(b){return!!b&&a.filter(b,this).length>0},closest:function(e,g){if(a.isArray(e)){var h=[],c=this[0],d,f={},b;if(c&&e.length){d=0;for(var j=e.length;d<j;d++){b=e[d];f[b]||(f[b]=a.expr.match.POS.test(b)?a(b,g||this.context):b)}for(;c&&c.ownerDocument&&c!==g;){for(b in f){d=f[b];if(d.jquery?d.index(c)>-1:a(c).is(d)){h.push({selector:b,elem:c});delete f[b]}}c=c.parentNode}}return h}var i=a.expr.match.POS.test(e)?a(e,g||this.context):null;return this.map(function(c,b){for(;b&&b.ownerDocument&&b!==g;){if(i?i.index(b)>-1:a(b).is(e))return b;b=b.parentNode}return null})},index:function(b){return!b||typeof b==="string"?a.inArray(this[0],b?a(b):this.parent().children()):a.inArray(b.jquery?b[0]:b,this)},add:function(b,c){b=typeof b==="string"?a(b,c||this.context):a.makeArray(b);c=a.merge(this.get(),b);return this.pushStack(Z(b[0])||Z(c[0])?c:a.unique(c))},andSelf:function(){return this.add(this.prevObject)}});a.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(b){return a.dir(b,"parentNode")},parentsUntil:function(b,d,c){return a.dir(b,"parentNode",c)},next:function(b){return a.nth(b,2,"nextSibling")},prev:function(b){return a.nth(b,2,"previousSibling")},nextAll:function(b){return a.dir(b,"nextSibling")},prevAll:function(b){return a.dir(b,"previousSibling")},nextUntil:function(b,d,c){return a.dir(b,"nextSibling",c)},prevUntil:function(b,d,c){return a.dir(b,"previousSibling",c)},siblings:function(b){return a.sibling(b.parentNode.firstChild,b)},children:function(b){return a.sibling(b.firstChild)},contents:function(b){return a.nodeName(b,"iframe")?b.contentDocument||b.contentWindow.document:a.makeArray(b.childNodes)}},function(b,c){a.fn[b]=function(f,e){var d=a.map(this,c,f);qb.test(b)||(e=f);if(e&&typeof e==="string")d=a.filter(e,d);d=this.length>1?a.unique(d):d;if((this.length>1||sb.test(e))&&rb.test(b))d=d.reverse();return this.pushStack(d,b,n.call(arguments).join(","))}});a.extend({filter:function(b,c,d){if(d)b=":not("+b+")";return a.find.matches(b,c)},dir:function(b,d,e){var f=[];for(b=b[d];b&&b.nodeType!==9&&(e===c||b.nodeType!==1||!a(b).is(e));){b.nodeType===1&&f.push(b);b=b[d]}return f},nth:function(a,b,c){b=b||1;for(var d=0;a;a=a[c])if(a.nodeType===1&&++d===b)break;return a},sibling:function(a,c){for(var b=[];a;a=a.nextSibling)a.nodeType===1&&a!==c&&b.push(a);return b}});var O=/ jQuery\d+="(?:\d+|null)"/g,p=/^\s+/,P=/(<([\w:]+)[^>]*?)\/>/g,tb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Q=/<([\w:]+)/,ub=/<tbody/i,vb=/<|&#?\w+;/,cb=/<script|<object|<embed|<option|<style/i,db=/checked\s*(?:[^=]|=\s*.checked.)/i,S=function(b,c,a){return tb.test(a)?b:c+"></"+a+">"},e={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};e.optgroup=e.option;e.tbody=e.tfoot=e.colgroup=e.caption=e.thead;e.th=e.td;if(!a.support.htmlSerialize)e._default=[1,"div<div>","</div>"];a.fn.extend({text:function(d){return a.isFunction(d)?this.each(function(c){var b=a(this);b.text(d.call(this,c,b.text()))}):typeof d!=="object"&&d!==c?this.empty().append((this[0]&&this[0].ownerDocument||b).createTextNode(d)):a.text(this)},wrapAll:function(b){if(a.isFunction(b))return this.each(function(c){a(this).wrapAll(b.call(this,c))});if(this[0]){var c=a(b,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&c.insertBefore(this[0]);c.map(function(){for(var a=this;a.firstChild&&a.firstChild.nodeType===1;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(b){return a.isFunction(b)?this.each(function(c){a(this).wrapInner(b.call(this,c))}):this.each(function(){var c=a(this),d=c.contents();d.length?d.wrapAll(b):c.append(b)})},wrap:function(b){return this.each(function(){a(this).wrapAll(b)})},unwrap:function(){return this.parent().each(function(){a.nodeName(this,"body")||a(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)});else if(arguments.length){var b=a(arguments[0]);b.push.apply(b,this.toArray());return this.pushStack(b,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)});else if(arguments.length){var b=this.pushStack(this,"after",arguments);b.push.apply(b,a(arguments[0]).toArray());return b}},remove:function(c,e){for(var d=0,b;(b=this[d])!=null;d++)if(!c||a.filter(c,[b]).length){if(!e&&b.nodeType===1){a.cleanData(b.getElementsByTagName("*"));a.cleanData([b])}b.parentNode&&b.parentNode.removeChild(b)}return this},empty:function(){for(var c=0,b;(b=this[c])!=null;c++)for(b.nodeType===1&&a.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(c){var b=this.map(function(){if(!a.support.noCloneEvent&&!a.isXMLDoc(this)){var b=this.outerHTML,c=this.ownerDocument;if(!b){b=c.createElement("div");b.appendChild(this.cloneNode(true));b=b.innerHTML}return a.clean([b.replace(O,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(p,"")],c)[0]}else return this.cloneNode(true)});if(c===true){ab(this,b);ab(this.find("*"),b.find("*"))}return b},html:function(b){if(b===c)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(O,""):null;else if(typeof b==="string"&&!cb.test(b)&&(a.support.leadingWhitespace||!p.test(b))&&!e[(Q.exec(b)||["",""])[1].toLowerCase()]){b=b.replace(P,S);try{for(var d=0,f=this.length;d<f;d++)if(this[d].nodeType===1){a.cleanData(this[d].getElementsByTagName("*"));this[d].innerHTML=b}}catch(g){this.empty().append(b)}}else a.isFunction(b)?this.each(function(d){var c=a(this),e=c.html();c.empty().append(function(){return b.call(this,d,e)})}):this.empty().append(b);return this},replaceWith:function(b){if(this[0]&&this[0].parentNode){if(a.isFunction(b))return this.each(function(d){var c=a(this),e=c.html();c.replaceWith(b.call(this,d,e))});if(typeof b!=="string")b=a(b).detach();return this.each(function(){var c=this.nextSibling,d=this.parentNode;a(this).remove();c?a(c).before(b):a(d).append(b)})}else return this.pushStack(a(a.isFunction(b)?b():b),"replaceWith",b)},detach:function(a){return this.remove(a,true)},domManip:function(g,e,i){function l(b){return a.nodeName(b,"table")?b.getElementsByTagName("tbody")[0]||b.appendChild(b.ownerDocument.createElement("tbody")):b}var b,j,f=g[0],k=[],d;if(!a.support.checkClone&&arguments.length===3&&typeof f==="string"&&db.test(f))return this.each(function(){a(this).domManip(g,e,i,true)});if(a.isFunction(f))return this.each(function(d){var b=a(this);g[0]=f.call(this,d,e?b.html():c);b.domManip(g,e,i)});if(this[0]){b=f&&f.parentNode;b=a.support.parentNode&&b&&b.nodeType===11&&b.childNodes.length===this.length?{fragment:b}:bb(g,this,k);d=b.fragment;if(j=d.childNodes.length===1?d=d.firstChild:d.firstChild){e=e&&a.nodeName(j,"tr");for(var h=0,m=this.length;h<m;h++)i.call(e?l(this[h],j):this[h],h>0||b.cacheable||this.length>1?d.cloneNode(true):d)}k.length&&a.each(k,Cb)}return this}});a.fragments={};a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,c){a.fn[b]=function(e){var f=[];e=a(e);var d=this.length===1&&this[0].parentNode;if(d&&d.nodeType===11&&d.childNodes.length===1&&e.length===1){e[c](this[0]);return this}else{d=0;for(var h=e.length;d<h;d++){var g=(d>0?this.clone(true):this).get();a.fn[c].apply(a(e[d]),g);f=f.concat(g)}return this.pushStack(f,b,e.selector)}}});a.extend({clean:function(n,h,l,m){h=h||b;if(typeof h.createElement==="undefined")h=h.ownerDocument||h[0]&&h[0].ownerDocument||b;for(var d=[],f=0,c;(c=n[f])!=null;f++){if(typeof c==="number")c+="";if(c){if(typeof c==="string"&&!vb.test(c))c=h.createTextNode(c);else if(typeof c==="string"){c=c.replace(P,S);var j=(Q.exec(c)||["",""])[1].toLowerCase(),g=e[j]||e._default,k=g[0],i=h.createElement("div");for(i.innerHTML=g[1]+c+g[2];k--;)i=i.lastChild;if(!a.support.tbody){k=ub.test(c);j=j==="table"&&!k?i.firstChild&&i.firstChild.childNodes:g[1]==="<table>"&&!k?i.childNodes:[];for(g=j.length-1;g>=0;--g)a.nodeName(j[g],"tbody")&&!j[g].childNodes.length&&j[g].parentNode.removeChild(j[g])}!a.support.leadingWhitespace&&p.test(c)&&i.insertBefore(h.createTextNode(p.exec(c)[0]),i.firstChild);c=i.childNodes}if(c.nodeType)d.push(c);else d=a.merge(d,c)}}if(l)for(f=0;d[f];f++)if(m&&a.nodeName(d[f],"script")&&(!d[f].type||d[f].type.toLowerCase()==="text/javascript"))m.push(d[f].parentNode?d[f].parentNode.removeChild(d[f]):d[f]);else{d[f].nodeType===1&&d.splice.apply(d,[f+1,0].concat(a.makeArray(d[f].getElementsByTagName("script"))));l.appendChild(d[f])}return d},cleanData:function(h){for(var c,d,f=a.cache,i=a.event.special,j=a.support.deleteExpando,g=0,b;(b=h[g])!=null;g++)if(d=b[a.expando]){c=f[d];if(c.events)for(var e in c.events)i[e]?a.event.remove(b,e):I(b,e,c.handle);if(j)delete b[a.expando];else b.removeAttribute&&b.removeAttribute(a.expando);delete f[d]}}});var wb=/z-?index|font-?weight|opacity|zoom|line-?height/i,U=/alpha\([^)]*\)/,W=/opacity=([^)]*)/,x=/float/i,y=/-([a-z])/ig,xb=/([A-Z])/g,yb=/^-?\d+(?:px)?$/i,zb=/^-?\d/,Ab={position:"absolute",visibility:"hidden",display:"block"},Bb=["Left","Right"],Db=["Top","Bottom"],Fb=b.defaultView&&b.defaultView.getComputedStyle,X=a.support.cssFloat?"cssFloat":"styleFloat",z=function(b,a){return a.toUpperCase()};a.fn.css=function(b,d){return D(this,b,d,true,function(e,d,b){if(b===c)return a.curCSS(e,d);if(typeof b==="number"&&!wb.test(d))b+="px";a.style(e,d,b)})};a.extend({style:function(d,b,f){if(!d||d.nodeType===3||d.nodeType===8)return c;if((b==="width"||b==="height")&&parseFloat(f)<0)f=c;var e=d.style||d,g=f!==c;if(!a.support.opacity&&b==="opacity"){if(g){e.zoom=1;b=parseInt(f,10)+""==="NaN"?"":"alpha(opacity="+f*100+")";d=e.filter||a.curCSS(d,"filter")||"";e.filter=U.test(d)?d.replace(U,b):b}return e.filter&&e.filter.indexOf("opacity=")>=0?parseFloat(W.exec(e.filter)[1])/100+"":""}if(x.test(b))b=X;b=b.replace(y,z);if(g)e[b]=f;return e[b]},css:function(b,c,g,e){if(c==="width"||c==="height"){var d,h=c==="width"?Bb:Db;function f(){d=c==="width"?b.offsetWidth:b.offsetHeight;e!=="border"&&a.each(h,function(){e||(d-=parseFloat(a.curCSS(b,"padding"+this,true))||0);if(e==="margin")d+=parseFloat(a.curCSS(b,"margin"+this,true))||0;else d-=parseFloat(a.curCSS(b,"border"+this+"Width",true))||0})}b.offsetWidth!==0?f():a.swap(b,Ab,f);return Math.max(0,Math.round(d))}return a.curCSS(b,c,g)},curCSS:function(c,b,f){var d,e=c.style;if(!a.support.opacity&&b==="opacity"&&c.currentStyle){d=W.test(c.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return d===""?"1":d}if(x.test(b))b=X;if(!f&&e&&e[b])d=e[b];else if(Fb){if(x.test(b))b="float";b=b.replace(xb,"-$1").toLowerCase();e=c.ownerDocument.defaultView;if(!e)return null;if(c=e.getComputedStyle(c,null))d=c.getPropertyValue(b);if(b==="opacity"&&d==="")d="1"}else if(c.currentStyle){f=b.replace(y,z);d=c.currentStyle[b]||c.currentStyle[f];if(!yb.test(d)&&zb.test(d)){b=e.left;var g=c.runtimeStyle.left;c.runtimeStyle.left=c.currentStyle.left;e.left=f==="fontSize"?"1em":d||0;d=e.pixelLeft+"px";e.left=b;c.runtimeStyle.left=g}}return d},swap:function(b,c,e){var d={};for(var a in c){d[a]=b.style[a];b.style[a]=c[a]}e.call(b);for(a in c)b.style[a]=d[a]}});if(a.expr&&a.expr.filters){a.expr.filters.hidden=function(b){var c=b.offsetWidth,d=b.offsetHeight,e=b.nodeName.toLowerCase()==="tr";return c===0&&d===0&&!e?true:c>0&&d>0&&!e?false:a.curCSS(b,"display")==="none"};a.expr.filters.visible=function(b){return!a.expr.filters.hidden(b)}}var Hb=g(),Jb=/<script(.|\s)*?\/script>/gi,Lb=/select|textarea/i,Nb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,j=/=\?(&|$)/,A=/\?/,Pb=/(\?|&)_=.*?(&|$)/,Rb=/^(\w+:)?\/\/([^\/?#]+)/,Tb=/%20/g,Vb=a.fn.load;a.fn.extend({load:function(b,c,e){if(typeof b!=="string")return Vb.call(this,b);else if(!this.length)return this;var d=b.indexOf(" ");if(d>=0){var f=b.slice(d,b.length);b=b.slice(0,d)}d="GET";if(c)if(a.isFunction(c)){e=c;c=null}else if(typeof c==="object"){c=a.param(c,a.ajaxSettings.traditional);d="POST"}var g=this;a.ajax({url:b,type:d,dataType:"html",data:c,complete:function(b,c){(c==="success"||c==="notmodified")&&g.html(f?a("<div />").append(b.responseText.replace(Jb,"")).find(f):b.responseText);e&&g.each(e,[b.responseText,c,b])}});return this},serialize:function(){return a.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?a.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Lb.test(this.nodeName)||Nb.test(this.type))}).map(function(b,c){b=a(this).val();return b==null?null:a.isArray(b)?a.map(b,function(a){return{name:c.name,value:a}}):{name:c.name,value:b}}).get()}});a.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(c,b){a.fn[b]=function(a){return this.bind(b,a)}});a.extend({"get":function(e,b,c,d){if(a.isFunction(b)){d=d||c;c=b;b=null}return a.ajax({type:"GET",url:e,data:b,success:c,dataType:d})},getScript:function(b,c){return a.get(b,null,c,"script")},getJSON:function(b,c,d){return a.get(b,c,d,"json")},post:function(e,b,c,d){if(a.isFunction(b)){d=d||c;c=b;b={}}return a.ajax({type:"POST",url:e,data:b,success:c,dataType:d})},ajaxSetup:function(b){a.extend(a.ajaxSettings,b)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:d.XMLHttpRequest&&(d.location.protocol!=="file:"||!d.ActiveXObject)?function(){return new d.XMLHttpRequest}:function(){try{return new d.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(o){function r(){e.success&&e.success.call(u,v,m,f);e.global&&s("ajaxSuccess",[f,e])}function p(){e.complete&&e.complete.call(u,f,m);e.global&&s("ajaxComplete",[f,e]);e.global&&!--a.active&&a.event.trigger("ajaxStop")}function s(c,b){(e.context?a(e.context):a.event).trigger(c,b)}var e=a.extend(true,{},a.ajaxSettings,o),i,m,v,u=o&&o.context||e,k=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=a.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(k==="GET")j.test(e.url)||(e.url+=(A.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!j.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&j.test(e.data)||j.test(e.url))){i=e.jsonpCallback||"jsonp"+Hb++;if(e.data)e.data=(e.data+"").replace(j,"="+i+"$1");e.url=e.url.replace(j,"="+i+"$1");e.dataType="script";d[i]=d[i]||function(a){v=a;r();p();d[i]=c;try{delete d[i]}catch(b){}n&&n.removeChild(h)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&k==="GET"){var l=g(),x=e.url.replace(Pb,"$1_="+l+"$2");e.url=x+(x===e.url?(A.test(e.url)?"&":"?")+"_="+l:"")}if(e.data&&k==="GET")e.url+=(A.test(e.url)?"&":"?")+e.data;e.global&&!a.active++&&a.event.trigger("ajaxStart");l=(l=Rb.exec(e.url))&&(l[1]&&l[1]!==location.protocol||l[2]!==location.host);if(e.dataType==="script"&&k==="GET"&&l){var n=b.getElementsByTagName("head")[0]||b.documentElement,h=b.createElement("script");h.src=e.url;if(e.scriptCharset)h.charset=e.scriptCharset;if(!i){var w=false;h.onload=h.onreadystatechange=function(){if(!w&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){w=true;r();p();h.onload=h.onreadystatechange=null;n&&h.parentNode&&n.removeChild(h)}}}n.insertBefore(h,n.firstChild);return c}var q=false,f=e.xhr();if(f){e.username?f.open(k,e.url,e.async,e.username,e.password):f.open(k,e.url,e.async);try{(e.data||o&&o.contentType)&&f.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){a.lastModified[e.url]&&f.setRequestHeader("If-Modified-Since",a.lastModified[e.url]);a.etag[e.url]&&f.setRequestHeader("If-None-Match",a.etag[e.url])}l||f.setRequestHeader("X-Requested-With","XMLHttpRequest");f.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(z){}if(e.beforeSend&&e.beforeSend.call(u,f,e)===false){e.global&&!--a.active&&a.event.trigger("ajaxStop");f.abort();return false}e.global&&s("ajaxSend",[f,e]);var t=f.onreadystatechange=function(b){if(!f||f.readyState===0||b==="abort"){q||p();q=true;if(f)f.onreadystatechange=a.noop}else if(!q&&f&&(f.readyState===4||b==="timeout")){q=true;f.onreadystatechange=a.noop;m=b==="timeout"?"timeout":!a.httpSuccess(f)?"error":e.ifModified&&a.httpNotModified(f,e.url)?"notmodified":"success";var c;if(m==="success")try{v=a.httpData(f,e.dataType,e)}catch(d){m="parsererror";c=d}if(m==="success"||m==="notmodified")i||r();else a.handleError(e,f,m,c);p();b==="timeout"&&f.abort();if(e.async)f=null}};try{var y=f.abort;f.abort=function(){f&&y.call(f);t("abort")}}catch(B){}e.async&&e.timeout>0&&setTimeout(function(){f&&!q&&t("timeout")},e.timeout);try{f.send(k==="POST"||k==="PUT"||k==="DELETE"?e.data:null)}catch(C){a.handleError(e,f,null,C);p()}e.async||t();return f}},handleError:function(b,c,e,d){b.error&&b.error.call(b.context||b,c,e,d);b.global&&(b.context?a(b.context):a.event).trigger("ajaxError",[c,b,d])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(b,c){var d=b.getResponseHeader("Last-Modified"),e=b.getResponseHeader("Etag");if(d)a.lastModified[c]=d;if(e)a.etag[c]=e;return b.status===304||b.status===0},httpData:function(b,c,d){var e=b.getResponseHeader("content-type")||"",f=c==="xml"||!c&&e.indexOf("xml")>=0;b=f?b.responseXML:b.responseText;f&&b.documentElement.nodeName==="parsererror"&&a.error("parsererror");if(d&&d.dataFilter)b=d.dataFilter(b,c);if(typeof b==="string")if(c==="json"||!c&&e.indexOf("json")>=0)b=a.parseJSON(b);else(c==="script"||!c&&e.indexOf("javascript")>=0)&&a.globalEval(b);return b},param:function(b,d){function e(c,b){if(a.isArray(b))a.each(b,function(f,b){d||/\[\]$/.test(c)?g(c,b):e(c+"["+(typeof b==="object"||a.isArray(b)?f:"")+"]",b)});else!d&&b!=null&&typeof b==="object"?a.each(b,function(a,b){e(c+"["+a+"]",b)}):g(c,b)}function g(c,b){b=a.isFunction(b)?b():b;f[f.length]=encodeURIComponent(c)+"="+encodeURIComponent(b)}var f=[];if(d===c)d=a.ajaxSettings.traditional;if(a.isArray(b)||b.jquery)a.each(b,function(){g(this.name,this.value)});else for(var h in b)e(h,b[h]);return f.join("&").replace(Tb,"+")}});var B={},kb=/toggle|show|hide/,mb=/^([+-]=)?([\d+-.]+)(.*)$/,q,eb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];a.fn.extend({show:function(b,e){if(b||b===0)return this.animate(h("show",3),b,e);else{b=0;for(e=this.length;b<e;b++){var c=a.data(this[b],"olddisplay");this[b].style.display=c||"";if(a.css(this[b],"display")==="none"){c=this[b].nodeName;var d;if(B[c])d=B[c];else{var f=a("<"+c+" />").appendTo("body");d=f.css("display");if(d==="none")d="block";f.remove();B[c]=d}a.data(this[b],"olddisplay",d)}}b=0;for(e=this.length;b<e;b++)this[b].style.display=a.data(this[b],"olddisplay")||"";return this}},hide:function(b,c){if(b||b===0)return this.animate(h("hide",3),b,c);else{b=0;for(c=this.length;b<c;b++){var d=a.data(this[b],"olddisplay");!d&&d!=="none"&&a.data(this[b],"olddisplay",a.css(this[b],"display"))}b=0;for(c=this.length;b<c;b++)this[b].style.display="none";return this}},_toggle:a.fn.toggle,toggle:function(b,c){var d=typeof b==="boolean";if(a.isFunction(b)&&a.isFunction(c))this._toggle.apply(this,arguments);else b==null||d?this.each(function(){var c=d?b:a(this).is(":hidden");a(this)[c?"show":"hide"]()}):this.animate(h("toggle",3),b,c);return this},fadeTo:function(a,b,c){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c)},animate:function(b,d,e,f){var c=a.speed(d,e,f);return a.isEmptyObject(b)?this.each(c.complete):this[c.queue===false?"each":"queue"](function(){var e=a.extend({},c),d,h=this.nodeType===1&&a(this).is(":hidden"),f=this;for(d in b){var g=d.replace(y,z);if(d!==g){b[g]=b[d];delete b[d];d=g}if(b[d]==="hide"&&h||b[d]==="show"&&!h)return e.complete.call(this);if((d==="height"||d==="width")&&this.style){e.display=a.css(this,"display");e.overflow=this.style.overflow}if(a.isArray(b[d])){(e.specialEasing=e.specialEasing||{})[d]=b[d][1];b[d]=b[d][0]}}if(e.overflow!=null)this.style.overflow="hidden";e.curAnim=a.extend({},b);a.each(b,function(k,c){var i=new a.fx(f,e,k);if(kb.test(c))i[c==="toggle"?h?"show":"hide":c](b);else{var g=mb.exec(c),d=i.cur(true)||0;if(g){c=parseFloat(g[2]);var j=g[3]||"px";if(j!=="px"){f.style[k]=(c||1)+j;d=(c||1)/i.cur(true)*d;f.style[k]=d+j}if(g[1])c=(g[1]==="-="?-1:1)*c+d;i.custom(d,c,j)}else i.custom(d,c,"")}});return true})},stop:function(d,c){var b=a.timers;d&&this.queue([]);this.each(function(){for(var a=b.length-1;a>=0;a--)if(b[a].elem===this){c&&b[a](true);b.splice(a,1)}});c||this.dequeue();return this}});a.each({slideDown:h("show",1),slideUp:h("hide",1),slideToggle:h("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,c){a.fn[b]=function(a,b){return this.animate(c,a,b)}});a.extend({speed:function(c,d,e){var b=c&&typeof c==="object"?c:{complete:e||!e&&d||a.isFunction(c)&&c,duration:c,easing:e&&d||d&&!a.isFunction(d)&&d};b.duration=a.fx.off?0:typeof b.duration==="number"?b.duration:a.fx.speeds[b.duration]||a.fx.speeds._default;b.old=b.complete;b.complete=function(){b.queue!==false&&a(this).dequeue();a.isFunction(b.old)&&b.old.call(this)};return b},easing:{linear:function(a,d,b,c){return b+c*a},swing:function(a,d,b,c){return(-Math.cos(a*Math.PI)/2+.5)*c+b}},timers:[],fx:function(b,a,c){this.options=a;this.elem=b;this.prop=c;if(!a.orig)a.orig={}}});a.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(a.fx.step[this.prop]||a.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(b){return this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)?this.elem[this.prop]:(b=parseFloat(a.css(this.elem,this.prop,b)))&&b>-1e4?b:parseFloat(a.curCSS(this.elem,this.prop))||0},custom:function(c,d,e){function b(a){return f.step(a)}this.startTime=g();this.start=c;this.end=d;this.unit=e||this.unit||"px";this.now=this.start;this.pos=this.state=0;var f=this;b.elem=this.elem;if(b()&&a.timers.push(b)&&!q)q=setInterval(a.fx.tick,13)},show:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());a(this.elem).show()},hide:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(b){var d=g(),e=true;if(b||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)e=false;if(e){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;b=a.data(this.elem,"olddisplay");this.elem.style.display=b?b:this.options.display;if(a.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&a(this.elem).hide();if(this.options.hide||this.options.show)for(var c in this.options.curAnim)a.style(this.elem,c,this.options.orig[c]);this.options.complete.call(this.elem)}return false}else{c=d-this.startTime;this.state=c/this.options.duration;b=this.options.easing||(a.easing.swing?"swing":"linear");this.pos=a.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,c,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};a.extend(a.fx,{tick:function(){for(var b=a.timers,c=0;c<b.length;c++)b[c]()||b.splice(c--,1);b.length||a.fx.stop()},stop:function(){clearInterval(q);q=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(b){a.style(b.elem,"opacity",b.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(a.expr&&a.expr.filters)a.expr.filters.animated=function(b){return a.grep(a.timers,function(a){return b===a.elem}).length};a.fn.offset="getBoundingClientRect"in b.documentElement?function(d){var b=this[0];if(d)return this.each(function(b){a.offset.setOffset(this,d,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return a.offset.bodyOffset(b);var e=b.getBoundingClientRect(),c=b.ownerDocument;b=c.body;c=c.documentElement;return{top:e.top+(self.pageYOffset||a.support.boxModel&&c.scrollTop||b.scrollTop)-(c.clientTop||b.clientTop||0),left:e.left+(self.pageXOffset||a.support.boxModel&&c.scrollLeft||b.scrollLeft)-(c.clientLeft||b.clientLeft||0)}}:function(k){var b=this[0];if(k)return this.each(function(b){a.offset.setOffset(this,k,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return a.offset.bodyOffset(b);a.offset.initialize();var i=b.offsetParent,d=b,c=b.ownerDocument,e,j=c.documentElement,h=c.body;d=(c=c.defaultView)?c.getComputedStyle(b,null):b.currentStyle;for(var f=b.offsetTop,g=b.offsetLeft;(b=b.parentNode)&&b!==h&&b!==j;){if(a.offset.supportsFixedPosition&&d.position==="fixed")break;e=c?c.getComputedStyle(b,null):b.currentStyle;f-=b.scrollTop;g-=b.scrollLeft;if(b===i){f+=b.offsetTop;g+=b.offsetLeft;if(a.offset.doesNotAddBorder&&!(a.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){f+=parseFloat(e.borderTopWidth)||0;g+=parseFloat(e.borderLeftWidth)||0}d=i;i=b.offsetParent}if(a.offset.subtractsBorderForOverflowNotVisible&&e.overflow!=="visible"){f+=parseFloat(e.borderTopWidth)||0;g+=parseFloat(e.borderLeftWidth)||0}d=e}if(d.position==="relative"||d.position==="static"){f+=h.offsetTop;g+=h.offsetLeft}if(a.offset.supportsFixedPosition&&d.position==="fixed"){f+=Math.max(j.scrollTop,h.scrollTop);g+=Math.max(j.scrollLeft,h.scrollLeft)}return{top:f,left:g}};a.offset={initialize:function(){var d=b.body,e=b.createElement("div"),f,c,g,h=parseFloat(a.curCSS(d,"marginTop",true))||0;a.extend(e.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});e.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.insertBefore(e,d.firstChild);f=e.firstChild;c=f.firstChild;g=f.nextSibling.firstChild.firstChild;this.doesNotAddBorder=c.offsetTop!==5;this.doesAddBorderForTableAndCells=g.offsetTop===5;c.style.position="fixed";c.style.top="20px";this.supportsFixedPosition=c.offsetTop===20||c.offsetTop===15;c.style.position=c.style.top="";f.style.overflow="hidden";f.style.position="relative";this.subtractsBorderForOverflowNotVisible=c.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=d.offsetTop!==h;d.removeChild(e);a.offset.initialize=a.noop},bodyOffset:function(b){var c=b.offsetTop,d=b.offsetLeft;a.offset.initialize();if(a.offset.doesNotIncludeMarginInBodyOffset){c+=parseFloat(a.curCSS(b,"marginTop",true))||0;d+=parseFloat(a.curCSS(b,"marginLeft",true))||0}return{top:c,left:d}},setOffset:function(b,c,d){if(/static/.test(a.curCSS(b,"position")))b.style.position="relative";var f=a(b),e=f.offset(),h=parseInt(a.curCSS(b,"top",true),10)||0,g=parseInt(a.curCSS(b,"left",true),10)||0;if(a.isFunction(c))c=c.call(b,d,e);d={top:c.top-e.top+h,left:c.left-e.left+g};"using"in c?c.using.call(b,d):f.css(d)}};a.fn.extend({position:function(){if(!this[0])return null;var e=this[0],b=this.offsetParent(),c=this.offset(),d=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(a.curCSS(e,"marginTop",true))||0;c.left-=parseFloat(a.curCSS(e,"marginLeft",true))||0;d.top+=parseFloat(a.curCSS(b[0],"borderTopWidth",true))||0;d.left+=parseFloat(a.curCSS(b[0],"borderLeftWidth",true))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||b.body;c&&!/^body|html$/i.test(c.nodeName)&&a.css(c,"position")==="static";)c=c.offsetParent;return c})}});a.each(["Left","Top"],function(d,e){var b="scroll"+e;a.fn[b]=function(f){var g=this[0],e;return!g?null:f!==c?this.each(function(){if(e=fb(this))e.scrollTo(!d?f:a(e).scrollLeft(),d?f:a(e).scrollTop());else this[b]=f}):(e=fb(g))?"pageXOffset"in e?e[d?"pageYOffset":"pageXOffset"]:a.support.boxModel&&e.document.documentElement[b]||e.document.body[b]:g[b]}});a.each(["Height","Width"],function(e,b){var d=b.toLowerCase();a.fn["inner"+b]=function(){return this[0]?a.css(this[0],d,false,"padding"):null};a.fn["outer"+b]=function(b){return this[0]?a.css(this[0],d,false,b?"margin":"border"):null};a.fn[d]=function(f){var e=this[0];return!e?f==null?null:this:a.isFunction(f)?this.each(function(c){var b=a(this);b[d](f.call(this,c,b[d]()))}):"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===c?a.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});d.jQuery=d.$=a})(window);jQuery.noConflict();(function(a){a.fn.hasEvent=function(b){var a=this.data("events");return a&&a[b]}})(jQuery);(function(a,h,g){var b="hashchange",d=document,f,i=a.event.special,j=d.documentMode,e="on"+b in h&&(j===g||j>7);function c(a){a=a||location.href;return"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}a.fn[b]=function(a){return a?this.bind(b,a):this.trigger(b)};a.fn[b].delay=50;i[b]=a.extend(i[b],{setup:function(){if(e)return false;a(f.start)},teardown:function(){if(e)return false;a(f.stop)}});f=function(){var f={},i,j=c(),k=function(a){return a},l=k,n=k;f.start=function(){i||m()};f.stop=function(){i&&clearTimeout(i);i=g};function m(){var e=c(),d=n(j);if(e!==j){l(j=e,d);a(h).trigger(b)}else if(d!==j)location.href=location.href.replace(/#.*/,"")+d;i=setTimeout(m,a.fn[b].delay)}a.browser.msie&&!e&&function(){var e,g;f.start=function(){if(!e){g=a.fn[b].src;g=g&&g+c();e=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){g||l(c());m()}).attr("src",g||"javascript:0").insertAfter("body")[0].contentWindow;d.onpropertychange=function(){try{if(event.propertyName==="title")e.document.title=d.title}catch(a){}}}};f.stop=k;n=function(){return c(e.location.href)};l=function(g,h){var c=e.document,f=a.fn[b].domain;if(g!==h){c.title=d.title;c.open();f&&c.write('<script>document.domain="'+f+'"<\/script>');c.close();e.location.hash=g}}}();return f}()})(jQuery,this);(function(b,a,c){function d(g){for(var f=0,h=a.length,e=g.target,d;f<h;f++){d=a[f];d!==e&&!(d.contains?d.contains(e):d.compareDocumentPosition?d.compareDocumentPosition(e)&16:1)&&b.event.trigger(c,g,d)}}b.event.special[c]={setup:function(){var c=a.length;!c&&b.event.add(document,"click",d);if(b.inArray(this,a)<0)a[c]=this},teardown:function(){var c=b.inArray(this,a);if(c>=0){a.splice(c,1);!a.length&&b.event.remove(document,"click",d)}}};b.fn[c]=function(a){return a?this.bind(c,a):this.trigger(c)}})(jQuery,[],"outerClick");jQuery.fn.highlight=function(b){function a(b,f){var g=0;if(b.nodeType==3){var h=b.data.toUpperCase().indexOf(f);if(h>=0){var e=document.createElement("span");e.className="highlight";var c=b.splitText(h),j=c.splitText(f.length),i=c.cloneNode(true);e.appendChild(i);c.parentNode.replaceChild(e,c);g=1}}else if(b.nodeType==1&&b.childNodes&&!/(script|style)/i.test(b.tagName))for(var d=0;d<b.childNodes.length;++d)d+=a(b.childNodes[d],f);return g}return this.each(function(){a(this,b.toUpperCase())})};jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;with(this.parentNode){replaceChild(this.firstChild,this);normalize()}}).end()};String.prototype.score=function(a,f){f=f||0;if(a.length==0)return.9;if(a.length>this.length)return 0;for(var e=a.length;e==a.length;e--){var j=a.substring(0,e),b=this.indexOf(j);if(b<0)continue;if(b+a.length>this.length+f)continue;var i=this.substring(b+j.length),h=null;if(e>=a.length)h="";else h=a.substring(e);var k=i.score(h,f+b);if(k>0){var c=this.length-i.length;if(b!=0){var g=0,d=this.charCodeAt(b-1);if(d==32||d==9)for(g=b-2;g>=0;g--){d=this.charCodeAt(g);c-=d==32||d==9?1:.15}else c-=b}c+=k*i.length;c/=this.length;return c}}return 0};jQuery.fn.liveUpdate=function(g){g=jQuery(g);var t=jQuery(this);if(g.length){for(var m=true,f=g.children(".FAQCategory"),a=f.children("dl").children("dt"),d=f.children("dl").children("dd"),b=a.map(function(){return false}),e=a.map(function(){return false}),u=0,c=[],k=0;k<f.size();k++){var h=jQuery(f[k]),j=h.children("dl").children("dt");h.data("FAQs",j.size());h.data("TotalFAQs",j.size());for(var o=0;o<j.size();o++)c[u++]=h}cache=a.map(function(a){return jQuery(this).text().toLowerCase()+" "+jQuery(d[a]).text().toLowerCase()});this.keyup(s).keyup().parents("form").submit(function(){return false})}return this;function q(){return jQuery.trim(t.val().toLowerCase())}function s(c){var a=q();if(c.which!==13&&(a.length!=0&&a.length<=3||a.length>17&&a.length%3!==0))return;(c.which==8||c.which==13)&&n();if(a==null||a.length==0)n();else{var d=[];cache.each(function(c){if(!b[c]){var e=this.score(a);if(e>0){d.push([e,c]);m&&p(c,a)}else r(c)}})}}function l(b,d){var a=" treff",c=jQuery(".faqHits",b);c.text(d+a)}function i(a,b){if(a==undefined)f.each(function(){var a=jQuery(this);a.data("FAQs",a.data("TotalFAQs"));a.show();l(a,a.data("TotalFAQs"))});else{var e=c[a].data("FAQs"),d=e+b;c[a].data("FAQs",d);l(c[a],d)}if(b<0&&c[a].data("FAQs")==0)c[a].hide();else b>0&&c[a].show()}function r(c){if(c==undefined){rp=a;dp=d;b=b.map(function(){return true});e=e.map(function(){return true})}else{if(c<0||c>=a.length)return;rp=a[c];dp=d[c];b[c]=true;e[c]=true;i(c,-1)}jQuery(rp).hide();jQuery(dp).hide()}function n(c){if(c==undefined){rp=a;dp=d;b=b.map(function(){return false});e=e.map(function(){return false});if(m){jQuery(rp).removeHighlight();jQuery(dp).removeHighlight()}i()}else{if(c<0||c>=a.length)return;rp=a[c];dp=d[c];b[c]=false;e[c]=false;i(c,1)}jQuery(rp).show();jQuery(dp).show()}function p(b,f){var e=f.split(" ");if(e.length==0)return;var c=e[e.length-1];if(c.length<=3)return;jQuery(a[b]).removeHighlight();jQuery(d[b]).removeHighlight();jQuery(a[b]).highlight(c);jQuery(d[b]).highlight(c)}};(function(a){var b=a.scrollTo=function(b,d,c){a(window).scrollTo(b,d,c)};b.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1};b.window=function(){return a(window)._scrollable()};a.fn._scrollable=function(){return this.map(function(){var b=this,d=!b.nodeName||a.inArray(b.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d)return b;var c=(b.contentWindow||b).document||b.ownerDocument||b;return a.browser.safari||c.compatMode=="BackCompat"?c.body:c.documentElement})};a.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function")d={onAfter:d};if(f=="max")f=9e9;d=a.extend({},b.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue)e/=2;d.offset=c(d.offset);d.over=c(d.over);return this._scrollable().each(function(){var i=this,j=a(i),g=f,k,h={},m=j.is("html,body");switch(typeof g){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(g)){g=c(g);break}g=a(g,this);case"object":if(g.is||g.style)k=(g=a(g)).offset()}a.each(d.axis.split(""),function(q,n){var e=n=="x"?"Left":"Top",c=e.toLowerCase(),a="scroll"+e,o=i[a],p=b.max(i,n);if(k){h[a]=k[c]+(m?0:o-j.offset()[c]);if(d.margin){h[a]-=parseInt(g.css("margin"+e))||0;h[a]-=parseInt(g.css("border"+e+"Width"))||0}h[a]+=d.offset[c]||0;if(d.over[c])h[a]+=g[n=="x"?"width":"height"]()*d.over[c]}else{var f=g[c];h[a]=f.slice&&f.slice(-1)=="%"?parseFloat(f)/100*p:f}if(/^\d+$/.test(h[a]))h[a]=h[a]<=0?0:Math.min(h[a],p);if(!q&&d.queue){o!=h[a]&&l(d.onAfterFirst);delete h[a]}});l(d.onAfter);function l(a){j.animate(h,e,d.easing,a&&function(){a.call(this,f,d)})}}).end()};b.max=function(b,h){var c=h=="x"?"Width":"Height",d="scroll"+c;if(!a(b).is("html,body"))return b[d]-a(b)[c.toLowerCase()]();var e="client"+c,f=b.ownerDocument.documentElement,g=b.ownerDocument.body;return Math.max(f[d],g[d])-Math.min(f[e],g[e])};function c(a){return typeof a=="object"?a:{top:a,left:a}}})(jQuery);(function(a){var d=window.orientation!=undefined,b=a.browser.opera||a.browser.mozilla&&parseFloat(a.browser.version.substr(0,3))<1.9?"input":"paste";a.event.special.paste={setup:function(){if(this.addEventListener)this.addEventListener(b,c,false);else this.attachEvent&&this.attachEvent(b,c)},teardown:function(){if(this.removeEventListener)this.removeEventListener(b,c,false);else this.detachEvent&&this.detachEvent(b,c)}};function c(b){var c=this;b=a.event.fix(b||window.e);b.type="paste";setTimeout(function(){a.event.handle.call(c,b)},1)}a.extend({mask:{rules:{z:/[a-z]/,Z:/[A-Z]/,a:/[a-zA-Z]/,"*":/[0-9a-zA-Z]/,"@":/[0-9a-zA-ZçÇáàãâéèêíìóòôõúùü]/},keyRepresentation:{8:"backspace",9:"tab",13:"enter",16:"shift",17:"control",18:"alt",27:"esc",33:"page up",34:"page down",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete",116:"f5",123:"f12",224:"command"},iphoneKeyRepresentation:{10:"go",127:"delete"},signals:{"+":"","-":"-"},options:{attr:"alt",mask:null,type:"fixed",maxLength:-1,defaultValue:"",signal:false,textAlign:true,selectCharsOnFocus:true,autoTab:true,setSize:false,fixedChars:"[(),.:/ -]",onInvalid:function(){},onValid:function(){},onOverflow:function(){}},masks:{phone:{mask:"(99) 9999-9999"},"phone-us":{mask:"(999) 999-9999"},cpf:{mask:"999.999.999-99"},cnpj:{mask:"99.999.999/9999-99"},date:{mask:"39/19/9999"},"date-us":{mask:"19/39/9999"},cep:{mask:"99999-999"},time:{mask:"29:59"},cc:{mask:"9999 9999 9999 9999"},integer:{mask:"999.999.999.999",type:"reverse"},decimal:{mask:"99,999.999.999.999",type:"reverse",defaultValue:"000"},"decimal-us":{mask:"99.999,999,999,999",type:"reverse",defaultValue:"000"},"signed-decimal":{mask:"99,999.999.999.999",type:"reverse",defaultValue:"+000"},"signed-decimal-us":{mask:"99,999.999.999.999",type:"reverse",defaultValue:"+000"}},init:function(){if(!this.hasInit){var e=this,b,c=d?this.iphoneKeyRepresentation:this.keyRepresentation;this.ignore=false;for(b=0;b<=9;b++)this.rules[b]=new RegExp("[0-"+b+"]");this.keyRep=c;this.ignoreKeys=[];a.each(c,function(a){e.ignoreKeys.push(parseInt(a))});this.hasInit=true}},"set":function(f,c){var b=this,e=a(f),d="maxLength";c=c||{};this.init();return e.each(function(){if(c.attr)b.options.attr=c.attr;var f=a(this),e=a.extend({},b.options),k=f.attr(e.attr),g="";g=typeof c=="string"?c:k!=""?k:null;if(g)e.mask=g;if(b.masks[g])e=a.extend(e,b.masks[g]);if(typeof c=="object"&&c.constructor!=Array)e=a.extend(e,c);if(a.metadata)e=a.extend(e,f.metadata());if(e.mask!=null){f.data("mask")&&b.unset(f);var h=e.defaultValue,i=e.type=="reverse",j=new RegExp(e.fixedChars,"g");if(e.maxLength==-1)e.maxLength=f.attr(d);e=a.extend({},e,{fixedCharsReg:new RegExp(e.fixedChars),fixedCharsRegG:j,maskArray:e.mask.split(""),maskNonFixedCharsArray:e.mask.replace(j,"").split("")});(e.type=="fixed"||i)&&e.setSize&&!f.attr("size")&&f.attr("size",e.mask.length);i&&e.textAlign&&f.css("text-align","right");if(this.value!=""||h!=""){var l=b.string(this.value!=""?this.value:h,e);this.defaultValue=l;f.val(l)}if(e.type=="infinite")e.type="repeat";f.data("mask",e);f.removeAttr(d);f.bind("keydown.mask",{func:b._onKeyDown,thisObj:b},b._onMask).bind("keypress.mask",{func:b._onKeyPress,thisObj:b},b._onMask).bind("keyup.mask",{func:b._onKeyUp,thisObj:b},b._onMask).bind("paste.mask",{func:b._onPaste,thisObj:b},b._onMask).bind("focus.mask",b._onFocus).bind("blur.mask",b._onBlur).bind("change.mask",b._onChange)}})},unset:function(c){var b=a(c);return b.each(function(){var b=a(this);if(b.data("mask")){var c=b.data("mask").maxLength;c!=-1&&b.attr("maxLength",c);b.unbind(".mask").removeData("mask")}})},string:function(d,c){this.init();var b={};if(typeof d!="string")d=String(d);switch(typeof c){case"string":if(this.masks[c])b=a.extend(b,this.masks[c]);else b.mask=c;break;case"object":b=c}if(!b.fixedChars)b.fixedChars=this.options.fixedChars;var f=new RegExp(b.fixedChars),g=new RegExp(b.fixedChars,"g");if(b.type=="reverse"&&b.defaultValue)if(typeof this.signals[b.defaultValue.charAt(0)]!="undefined"){var e=d.charAt(0);b.signal=typeof this.signals[e]!="undefined"?this.signals[e]:this.signals[b.defaultValue.charAt(0)];b.defaultValue=b.defaultValue.substring(1)}return this.__maskArray(d.split(""),b.mask.replace(g,"").split(""),b.mask.split(""),b.type,b.maxLength,b.defaultValue,f,b.signal)},_onFocus:function(){var c=a(this),b=c.data("mask");b.inputFocusValue=c.val();b.changed=false;b.selectCharsOnFocus&&c.select()},_onBlur:function(){var b=a(this),c=b.data("mask");c.inputFocusValue!=b.val()&&!c.changed&&b.trigger("change")},_onChange:function(){a(this).data("mask").changed=true},_onMask:function(c){var d=c.data.thisObj,b={};b._this=c.target;b.$this=a(b._this);if(b.$this.attr("readonly"))return true;b.data=b.$this.data("mask");b[b.data.type]=true;b.value=b.$this.val();b.nKey=d.__getKeyNumber(c);b.range=d.__getRange(b._this);b.valueArray=b.value.split("");return c.data.func.call(d,c,b)},_onKeyDown:function(c,b){this.ignore=a.inArray(b.nKey,this.ignoreKeys)>-1||c.ctrlKey||c.metaKey||c.altKey;if(this.ignore){var e=this.keyRep[b.nKey];b.data.onValid.call(b._this,e?e:"",b.nKey)}return d?this._keyPress(c,b):true},_onKeyUp:function(b,a){if(a.nKey==9||a.nKey==16)return true;if(a.data.type=="repeat"){this.__autoTab(a);return true}return this._onPaste(b,a)},_onPaste:function(d,b){b.reverse&&this.__changeSignal(d.type,b);var c=this.__maskArray(b.valueArray,b.data.maskNonFixedCharsArray,b.data.maskArray,b.data.type,b.data.maxLength,b.data.defaultValue,b.data.fixedCharsReg,b.data.signal);b.$this.val(c);!b.reverse&&b.data.defaultValue.length&&b.range.start==b.range.end&&this.__setRange(b._this,b.range.start,b.range.end);(a.browser.msie||a.browser.safari)&&!b.reverse&&this.__setRange(b._this,b.range.start,b.range.end);if(this.ignore)return true;this.__autoTab(b);return true},_onKeyPress:function(f,a){if(this.ignore)return true;a.reverse&&this.__changeSignal(f.type,a);var c=String.fromCharCode(a.nKey),d=a.range.start,b=a.value,e=a.data.maskArray;if(a.reverse){var i=b.substr(0,d),k=b.substr(a.range.end,b.length);b=i+c+k;if(a.data.signal&&d-a.data.signal.length>0)d-=a.data.signal.length}var h=b.replace(a.data.fixedCharsRegG,"").split(""),g=this.__extraPositionsTill(d,e,a.data.fixedCharsReg);a.rsEp=d+g;if(a.repeat)a.rsEp=0;if(!this.rules[e[a.rsEp]]||a.data.maxLength!=-1&&h.length>=a.data.maxLength&&a.repeat){a.data.onOverflow.call(a._this,c,a.nKey);return false}else if(!this.rules[e[a.rsEp]].test(c)){a.data.onInvalid.call(a._this,c,a.nKey);return false}else a.data.onValid.call(a._this,c,a.nKey);var j=this.__maskArray(h,a.data.maskNonFixedCharsArray,e,a.data.type,a.data.maxLength,a.data.defaultValue,a.data.fixedCharsReg,a.data.signal,g);a.$this.val(j);return a.reverse?this._keyPressReverse(f,a):a.fixed?this._keyPressFixed(f,a):true},_keyPressFixed:function(b,a){if(a.range.start==a.range.end)(a.rsEp==0&&a.value.length==0||a.rsEp<a.value.length)&&this.__setRange(a._this,a.rsEp,a.rsEp+1);else this.__setRange(a._this,a.range.start,a.range.end);return true},_keyPressReverse:function(c,b){a.browser.msie&&(b.range.start==0&&b.range.end==0||b.range.start!=b.range.end)&&this.__setRange(b._this,b.value.length);return false},__autoTab:function(a){if(a.data.autoTab&&(a.$this.val().length>=a.data.maskArray.length&&!a.repeat||a.data.maxLength!=-1&&a.valueArray.length>=a.data.maxLength&&a.repeat)){var b=this.__getNextInput(a._this,a.data.autoTab);if(b){a.$this.trigger("blur");b.focus().select()}}},__changeSignal:function(c,a){if(a.data.signal!==false){var b=c=="paste"?a.value.charAt(0):String.fromCharCode(a.nKey);if(this.signals&&typeof this.signals[b]!="undefined")a.data.signal=this.signals[b]}},__getKeyNumber:function(a){return a.charCode||a.keyCode||a.which},__maskArray:function(a,h,d,b,c,f,j,i,g){b=="reverse"&&a.reverse();a=this.__removeInvalidChars(a,h,b=="repeat"||b=="infinite");if(f)a=this.__applyDefaultValue.call(a,f);a=this.__applyMask(a,d,g,j);switch(b){case"reverse":a.reverse();return(i||"")+a.join("").substring(a.length-d.length);case"infinite":case"repeat":var e=a.join("");return c!=-1&&a.length>=c?e.substring(0,c):e;default:return a.join("").substring(0,d.length)}return""},__applyDefaultValue:function(b){for(var c=b.length,d=this.length,a=d-1;a>=0;a--)if(this[a]==b.charAt(0))this.pop();else break;for(a=0;a<c;a++)if(!this[a])this[a]=b.charAt(a);return this},__removeInvalidChars:function(c,d,e){for(var a=0,b=0;a<c.length;a++){if(d[b]&&this.rules[d[b]]&&!this.rules[d[b]].test(c[a])){c.splice(a,1);if(!e)b--;a--}if(!e)b++}return c},__applyMask:function(c,b,d,e){if(typeof d=="undefined")d=0;for(var a=0;a<c.length+d;a++)b[a]&&e.test(b[a])&&c.splice(a,0,b[a]);return c},__extraPositionsTill:function(d,c,b){var a=0;while(b.test(c[d++]))a++;return a},__getNextInput:function(h,i){for(var e=h.form.elements,k=a.inArray(h,e)+1,c=null,b=k;b<e.length;b++){c=a(e[b]);if(this.__isNextInput(c,i))return c}for(var d=document.forms,j=a.inArray(h.form,d)+1,f=null,g=j;g<d.length;g++){f=d[g].elements;for(b=0;b<f.length;b++){c=a(f[b]);if(this.__isNextInput(c,i))return c}}return null},__isNextInput:function(c,b){var a=c.get(0);return a&&(a.offsetWidth>0||a.offsetHeight>0)&&a.nodeName!="FIELDSET"&&(b===true||typeof b=="string"&&c.is(b))},__setRange:function(d,c,a){if(typeof a=="undefined")a=c;if(d.setSelectionRange)d.setSelectionRange(c,a);else{var b=d.createTextRange();b.collapse();b.moveStart("character",c);b.moveEnd("character",a-c);b.select()}},__getRange:function(d){if(!a.browser.msie)return{start:d.selectionStart,end:d.selectionEnd};var b={start:0,end:0},c=document.selection.createRange();b.start=0-c.duplicate().moveStart("character",-1e5);b.end=b.start+c.text.length;return b},unmaskedVal:function(b){return a(b).val().replace(a.mask.fixedCharsRegG,"")}}});a.fn.extend({setMask:function(b){return a.mask.set(this,b)},unsetMask:function(){return a.mask.unset(this)},unmaskedVal:function(){return a.mask.unmaskedVal(this[0])}})})(jQuery);jQuery.fn.extend({getPath:function(a){if(typeof a=="undefined")a="";if(this.is("html"))return"html"+a;var c=this.get(0).nodeName.toLowerCase(),d=this.attr("id"),b=this.attr("class");if(typeof d!="undefined"&&d!=="")c+="#"+d;if(typeof b!="undefined"&&b!="")c+="."+b.split(/[\s\n]+/).join(".");return this.parent().getPath(" > "+c+a)}});if(!this.JSON)this.JSON={};(function(){function c(a){return a<10?"0"+a:a}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+c(this.getUTCMonth()+1)+"-"+c(this.getUTCDate())+"T"+c(this.getUTCHours())+":"+c(this.getUTCMinutes())+":"+c(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var h=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a,d,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},b;function g(a){f.lastIndex=0;return f.test(a)?'"'+a.replace(f,function(a){var b=i[a];return typeof b==="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function e(m,n){var i,j,h,k,l=a,f,c=n[m];if(c&&typeof c==="object"&&typeof c.toJSON==="function")c=c.toJSON(m);if(typeof b==="function")c=b.call(n,m,c);switch(typeof c){case"string":return g(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";a+=d;f=[];if(Object.prototype.toString.apply(c)==="[object Array]"){k=c.length;for(i=0;i<k;i+=1)f[i]=e(i,c)||"null";h=f.length===0?"[]":a?"[\n"+a+f.join(",\n"+a)+"\n"+l+"]":"["+f.join(",")+"]";a=l;return h}if(b&&typeof b==="object"){k=b.length;for(i=0;i<k;i+=1){j=b[i];if(typeof j==="string"){h=e(j,c);h&&f.push(g(j)+(a?": ":":")+h)}}}else for(j in c)if(Object.hasOwnProperty.call(c,j)){h=e(j,c);h&&f.push(g(j)+(a?": ":":")+h)}h=f.length===0?"{}":a?"{\n"+a+f.join(",\n"+a)+"\n"+l+"}":"{"+f.join(",")+"}";a=l;return h}}if(typeof JSON.stringify!=="function")JSON.stringify=function(h,c,f){var g;a="";d="";if(typeof f==="number")for(g=0;g<f;g+=1)d+=" ";else if(typeof f==="string")d=f;b=c;if(c&&typeof c!=="function"&&(typeof c!=="object"||typeof c.length!=="number"))throw new Error("JSON.stringify");return e("",{"":h})};if(typeof JSON.parse!=="function")JSON.parse=function(a,c){var b;function d(f,g){var b,e,a=f[g];if(a&&typeof a==="object")for(b in a)if(Object.hasOwnProperty.call(a,b)){e=d(a,b);if(e!==undefined)a[b]=e;else delete a[b]}return c.call(f,g,a)}a=String(a);h.lastIndex=0;if(h.test(a))a=a.replace(h,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){b=eval("("+a+")");return typeof c==="function"?d({"":b},""):b}throw new SyntaxError("JSON.parse");}})();var EidsivaServices=function(e,a,d,c){var f="/Services/Eidsiva/EidsivaServices.asmx/";if(a==undefined||a==null||a.length==0)a="{}";else a=JSON.stringify(a);var b=function(e,d){var b=true,a="{}";try{a=jQuery.parseJSON(e)}catch(f){b=false}if(b)d(a);else c(a)};jQuery.ajax({type:"POST",url:f+e,data:a,contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){b(a.d,d)},error:function(a){b(a.responseText,c)}})};jQuery.fn.EidsivaBanner=function(j,k,l,f,a){var e=1200,g=jQuery(this),i=jQuery(k,g),j=jQuery(j,g),h=jQuery(l,j),f=jQuery(f,g),a=parseInt(a);a=a>3e3?a:3e3;var m=jQuery(".next",f),n=jQuery(".prev",f),c=0,b=setInterval(function(){d(1)},a),o=null;m.click(function(f){f.preventDefault();d(1);clearTimeout(c);clearInterval(b);var c=setTimeout(function(){clearInterval(b);b=setInterval(function(){d(1)},a)},e)});n.click(function(f){f.preventDefault();d(-1);clearTimeout(c);clearInterval(b);var c=setTimeout(function(){clearInterval(b);b=setInterval(function(){d(1)},a)},e)});function d(a){c=(c+a)%h.size();if(c<0)c=h.size()+c;i.stop(true,false);i.scrollTo(h[c],e,{offset:-10})}};jQuery.fn.EidsivaMaskNumber=function(){var a=jQuery(this);a.setMask({mask:"999.999.999.999.999.999",type:"reverse",autoTab:false,selectCharsOnFocus:false})};jQuery.fn.EidsivaMaskPhonenumber=function(b,a){var c=jQuery(this),b=b==null||b==undefined?function(){}:b,a=a==null||a==undefined?function(){}:a;c.keyup(function(e){var d=c.GetSanitizedValue();if(d.length>=8){var j=e.keyCode?e.keyCode:e.which;if(j==13){var g=jQuery(".entry.phonenumber .info.lookupsuccess").is(":visible");if(g)jQuery(".entry.phonenumber .fancybutton.brown.lookupsuccessbutton").trigger("click");else jQuery(this).parent().siblings(".info.lookupstart").children(".fancybutton.lookupbutton").trigger("click");var i=jQuery(".entry.phonenumber"),h=jQuery("#Person_Telefonnummer").val(),f=jQuery.parseJSON(jQuery(".entry.phonenumber input:hidden.validatecontrol").val()),k=jQuery("#Person_Telefonnummer");k._Validate(1,h,i,f)}}if(d.length===1&&(d==="4"||d==="9"))c.setMask({mask:"999 99 999",autoTab:false,selectCharsOnFocus:false});else if(d.length===1)c.setMask({mask:"99 99 99 99",autoTab:false,selectCharsOnFocus:false});else if(d.length>=8&&"2345679".indexOf(d.substring(0,1)))b();else a()})};jQuery.fn.EidsivaMaskOrgnumber=function(b,a){var c=jQuery(this),b=b==null||b==undefined?function(){}:b,a=a==null||a==undefined?function(){}:a;c.setMask({mask:"999 999 999",autoTab:false,selectCharsOnFocus:false});c.keyup(function(){var d=c.GetSanitizedValue();if(d.length===9)b();else a()})};jQuery.fn.EidsivaMaskMeasuringPoint=function(){var a=jQuery(this);a.setMask({mask:"9999 9999",autoTab:false,selectCharsOnFocus:false})};jQuery.fn._ShowHideError=function(d,f,g){var a=jQuery(this),b=jQuery(".status",a),e=jQuery(".errormessage-"+d,a);if(f){e.slideDown();if(!a.hasClass("containserrors")){a.addClass("containserrors");b.addClass("invalid");b.removeClass("ok")}}else{e.slideUp();var c=false;jQuery(".errormessage",a).each(function(){var a=jQuery(this);if(a.is(":visible")&&!a.hasClass("errormessage-"+d))c=true});if(!c){a.removeClass("containserrors");b.removeClass("invalid");!(g.length===0&&!b.hasClass("required"))&&b.addClass("ok")}}};jQuery.fn._ShowHideWorking=function(b){var c=jQuery(this),a=jQuery(".status",c);if(b)a.addClass("working");else a.removeClass("working")};jQuery.fn._ShowLookup=function(b){var a=jQuery(this),c="start";if(a.data("currentlyShowing")==null)a.data("currentlyShowing",c);else c=a.data("currentlyShowing");if(b===null||b===undefined){jQuery(".lookupstart, .lookupfailure, .lookupsuccess",a).stop().slideUp();a.data("currentlyShowing","nothing")}else if(c===b)return;else{jQuery(".lookup"+c,a).stop().slideUp();jQuery(".lookup"+b,a).stop().slideDown();a.data("currentlyShowing",b)}};jQuery.fn._FillPlaceholders=function(b){var d=jQuery(this);for(var a in b)if(a!=undefined&&b.hasOwnProperty(a)){if(jQuery.isArray(b[a])){for(var c=0;c<b[a].length;c++)jQuery("var.placeholder[title="+a+"["+c+"]]",d).text(b[a][c]);if(b[a].length>0){var e=jQuery("var.placeholder[title="+a+"]",d);e.text(b[a].join(" "))}}var e=jQuery("var.placeholder[title="+a+"]",d);e.text(b[a])}};var _ExtractEmailInfo=function(a){var d={};for(var b in a)if(b!=undefined&&a.hasOwnProperty(b))if(jQuery.isArray(a[b])){d.key=[];for(var c=0;c<a[b].length;c++)d.key[c]=a[b][c]}return d};jQuery.fn._FillForm=function(d,c){var e=jQuery(this);for(var b in c)if(c.hasOwnProperty(b)&&d.hasOwnProperty(b)){var a=jQuery("input[name="+d[b]+"]",e);a.val(c[b]);a.val()!=undefined&&a.val().trim().length!=0&&a.trigger("focus").trigger("keydown").trigger("keyup").trigger("keypress").trigger("blur")}};SanitizeValue=function(a){return a.replace(/[^0-9]/g,"")};SanitizePhoneValue=function(a){return a.replace(/[^0-9+]/g,"")};jQuery.fn.GetSanitizedValue=function(){var a=jQuery(this),b=a.val();return a.hasClass("phonenumber")?SanitizePhoneValue(b):a.hasClass("orgnumber")||a.hasClass("measuringpoint")||a.hasClass("number")?SanitizeValue(b):b};jQuery.fn.EidsivaLookupLocalField=function(f,e){var b=jQuery(this),g=jQuery("input, select, textarea, button",b),d=e.LookupField,a=jQuery("label[for="+d+"]",f);while(a.size()>0&&!a.hasClass("entry"))a=a.parent();var c=jQuery("#Person_Adresse");c.blur(function(){var a=b._GetEntryValues();jQuery("#Person_Postnummer").focus()})};jQuery.fn.EidsivaLookupPostalCode=function(b){var a=jQuery(this),c=a.next("input.placename");a.size()>0&&c.size()>0&&a.keyup(function(){var a=jQuery(this);a.val().length===4&&jQuery.getJSON("http://fraktguide.bring.no/fraktguide/postalCode.json?pnr="+a.val()+"&callback=?",function(c){if(c.valid){jQuery("input.placename",a.parent()).trigger("focus").trigger("keydown").val(c.result).trigger("keyup").trigger("keypress").trigger("blur");if(!b.parent("div").hasClass("section")){jQuery("#Anlegg_Postnummer").val(a.val());jQuery("#Anlegg_Postnummer").next("input").val(c.result);var f=jQuery(".section .entry.postalcode").first(),e=jQuery("#Person_Postnummer").siblings("input").val(),d=jQuery.parseJSON(jQuery("input:hidden.validatecontrol",b).val()),g=jQuery("#Anlegg_Postnummer").siblings(".placename");g._Validate(1,e,f,d);jQuery("#Person_Postnummer").siblings("input").focus()}}else jQuery("input.placename",a.parent()).trigger("focus").trigger("keydown").val("").trigger("keyup").trigger("keypress").trigger("blur")})})};jQuery.fn.EidsivaLookupContactInfo=function(h,a,f,b){var d=jQuery(this),e=jQuery(".lookupsuccessbutton",a),g=function(b){a._FillPlaceholders(b);if(b.FirstName==null||b.FirstName==""||b.LastName==null||b.LastName=="")c(b);else{a._ShowLookup("success");e.unbind().click(function(c){c.preventDefault();h._FillForm(f,b);a._ShowLookup("start")})}a._ShowHideWorking(false)},c=function(){a._ShowLookup("failure");b.children().text("Slå opp!");a._ShowHideWorking(false)};b.click(function(f){b.children().text("Søker...");f.preventDefault();var e=d.GetSanitizedValue();a._ShowHideWorking(true);EidsivaServices("SearchPhoneNumberPrivate",{number:e},g,c);b.children().text("Slå opp!")});d.keyup(function(){a._ShowLookup("start")})};jQuery.fn.EidsivaLookupCompanyInfo=function(h,a,e,g){var c=jQuery(this),d=jQuery(".lookupsuccessbutton",a),f=function(c){a._FillPlaceholders(c);if(c.CompanyName==null||c.CompanyName=="")b(c);else{a._ShowLookup("success");d.click(function(b){b.preventDefault();h._FillForm(e,c);a._ShowLookup()})}a._ShowHideWorking(false)},b=function(){a._ShowLookup("failure");a._ShowHideWorking(false)};g.click(function(e){e.preventDefault();var d=c.GetSanitizedValue();a._ShowHideWorking(true);EidsivaServices("SearchOrgNumberBusiness",{orgno:d},f,b)});c.keyup(function(){a._ShowLookup("start")})};jQuery.fn.EidsivaLookupMeasuringPoint=function(d,c){var a=jQuery(this),l=jQuery("input[name=SendLaterEmail]"),k=jQuery("input[name=SendLaterSMS]"),m=jQuery("input:submit[name=Section_Målepunkt_Add]",d),g="start";function e(b){var d=jQuery(".info."+b,a),c=jQuery(".info."+g,a);if(b!=g){d.slideDown(500);setTimeout(function(){c.slideUp(500);g=b},100)}}function f(a){return a.substring(10).replace(/([0-9]{4})/g,"$1 ").trim()}jQuery(".gobutton",a).click(function(c){c.preventDefault();var a=jQuery(this),b=a.attr("href").substring(1);e(b)});var h=function(e,o,b,j,l,f){var a=null,h=jQuery.fn.BillingSelectionAddressList();jQuery(".entry.measuringpoint",d).each(function(){var c=jQuery(this),d=jQuery("#address",c),g=jQuery("input.measuringpoint",c);if((d.val().toLowerCase()===b.toLowerCase()||d.val().toLowerCase()===f.toLowerCase())&&(g.val().length<9||g.val()===e)){a=c.closest(".section");return true}});if(a==null){var c=jQuery(".entry.measuringpoint",d).closest(".section").parent(),m=jQuery(".section",c).first(),k=jQuery(".section",c).last();a=jQuery.fn.EidsivaAddSection(m,null,k,null,true,true);var g=null;jQuery(h).each(function(){if(this[0].toLowerCase()===b.toLowerCase())g=this})}var i=[b,j,l];jQuery.fn.PopulateMeasuringPoint(a.find(".AdresseNavn"),i,true);var n=jQuery("input.measuringpoint",a);n.val(e).trigger("blur")},j=function(){var h=[];h[0]=c;var a={};for(var j in c)if(c.hasOwnProperty(j)){var i=c[j],s=jQuery("label[for="+i+"]",d),r=s.parent(".entry"),b=r;while(b.size()>0&&!b.hasClass("section"))b=b.parent();if(b.size()>0){var f=b.getPath();if(!a.hasOwnProperty(f))a[f]={};if(b.data("sufficiescontrol")!=undefined)for(var p=b.data("sufficiescontrol")._ParseSufficies(),e=0;e<p.length;e++){if(a[f][e]==undefined)a[f][e]=[];var q=i;for(var k in c)if(c.hasOwnProperty(k)&&c[k]===i){q=k;break}a[f][e].push([q,i+"_"+p[e]])}}}for(var j in a)if(a.hasOwnProperty(j)){var g=a[j];for(var l in g)if(g.hasOwnProperty(l)){for(var n=jQuery.extend(true,{},h[0]),m=0;m<g[l].length;m++){var o=g[l][m];n[o[0]]=o[1]}h.push(n)}}return h},b=[],i=function(){if(jQuery(".orderform.bestillingsskjema").length>0)for(var a=0;a<b.length;a++){var g=f(b[a].MeteringPointId);h(g,SanitizeValue(g),b[a].Address,b[a].PostalCode,b[a].Location,b[a].OriginalAddress)}else if(jQuery(".orderform.flytteskjema").length>0){var j=f(b[0].MeteringPointId),i=b[0].Address,d=b[0].PostalCode,e=b[0].Location;jQuery("input.AdresseNavn").val(i+", "+d+" "+e);var c=jQuery(".entry.measuringpoint");jQuery("#Measuringpoint",c).val(j).blur();jQuery("#address",c).val(i);jQuery("#postalCode",c).val(d);jQuery("#postalPlace",c).val(e)}};jQuery(".lookupsuccessbutton",a).bind("click",function(a){a.preventDefault();i()});jQuery(".lookupbutton",a).click(function(u){u.preventDefault();var i=jQuery(this);jQuery(".lookupsuccessbutton",a).css("margin-left",0);i.css("width","auto");i.css("text-align","center");a.addClass("working");i.data("orgtext",i.children().text());i.children().text("Søker...");var m="Domestic";if(c.hasOwnProperty("CompanyName"))m="Commercial";for(var s=function(c){if(c==null||c.size()==0){o(c);return}b=c;if(c.size()==1){e("single");var m=c[0].MeteringPointId,p=f(m),B=c[0].Address,y=c[0].PostalCode,A=c[0].Location,w=c[0].OriginalAddress;a._FillPlaceholders({MeasuringPointID:p,MeasuringPointAddress:B,MeasuringPointPostalCode:y,MeasuringPointPostalLocation:A,MeasuringPointOriginalAddress:w})}else{if(jQuery(".orderform.bestillingsskjema").length<=0)jQuery(".orderform.flytteskjema").length>0;var u=function(){var a=jQuery(this),b=a.data("checkbox"),g=b.val(),f=jQuery("var[title=MeasuringPointAddress]",a).text().trim(),d=jQuery("var[title=MeasuringPointPostalCode]",a).text().trim(),e=jQuery("var[title=MeasuringPointPostalLocation]",a).text().trim(),c=jQuery("var[title=MeasuringPointOriginalAddress]",a).text().trim();h(g,b.GetSanitizedValue(),f,d,e,c);b.attr("checked",true)},t=function(){var a=jQuery(this),f=a.data("checkbox"),g=f.val(),e=jQuery("var[title=MeasuringPointAddress]",a).text().trim(),c=jQuery("var[title=MeasuringPointPostalCode]",a).text().trim(),d=jQuery("var[title=MeasuringPointPostalLocation]",a).text().trim(),h=jQuery("var[title=MeasuringPointOriginalAddress]",a).text().trim();jQuery("input.AdresseNavn").val(e+", "+c+" "+d);var b=jQuery(".entry.measuringpoint");jQuery("#Measuringpoint",b).val(g).blur();jQuery("#address",b).val(e);jQuery("#postalCode",b).val(c);jQuery("#postalPlace",b).val(d)},v=function(e){var b=jQuery(this),a=jQuery("input:checkbox",b),c=a.GetSanitizedValue();jQuery(".entry.measuringpoint",d).each(function(){var a=jQuery(this),f=a.parent(),d=jQuery("input.measuringpoint",a);if(d.GetSanitizedValue()===c){var b=a.parent().children(".sectionremovebutton");if(b.is(":visible"))b.trigger("click",e);else{d.trigger("focus").trigger("keydown").val("").trigger("keyup").trigger("keypress").trigger("blur");f._FillPlaceholders({MeasuringPointAddress:""})}}});a.attr("checked",false)};jQuery("li:not(.resulttemplate)",a).remove();for(var n=jQuery(jQuery(".resulttemplate",a).get(0)),j=0;j<c.length;j++){var g=n.clone(),m=c[j].MeteringPointId,p=f(m),r=jQuery("#MeasuringPointId_"+m,a);if(r.length>0){oldTemplate=r.parent();var q=Math.min(c[j].OriginalAddress.length,c[j].Address.length),x=c[j].OriginalAddress.substr(0,q).toLowerCase().trim(),z=c[j].Address.substr(0,q).toLowerCase().trim();if(x===z)g=oldTemplate;else continue}g._FillPlaceholders({MeasuringPointID:p,MeasuringPointAddress:c[j].Address,MeasuringPointPostalCode:c[j].PostalCode,MeasuringPointPostalLocation:c[j].Location,MeasuringPointOriginalAddress:c[j].OriginalAddress});var s="MeasuringPointId_"+m,k=jQuery("input:checkbox",g),l=jQuery("label",g);g.data("checkbox",k);k.data("result",g);l.data("result",g);l.data("checkbox",k);k.data("label",l);k.attr("id",s).val(p);l.attr("for",s);g.show();g.removeClass("resulttemplate");n.after(g);g.data("toggleCounter",0);g.unbind();g.bind("addMeasuringPoint",u);g.bind("addFlytteskjemaMeasuringPoint",t);g.bind("removeMeasuringPoint",v);if(jQuery(".orderform.bestillingsskjema").length>0)l.unbind().toggle(function(){jQuery(this).data("result").trigger("addMeasuringPoint")},function(){jQuery(this).data("result").trigger("removeMeasuringPoint")});else jQuery(".orderform.flytteskjema").length>0&&l.unbind().click(function(){jQuery(this).data("result").trigger("addFlytteskjemaMeasuringPoint")});k.unbind("click").bind("click",function(){jQuery(this).data("label").trigger("click")})}n.hide();e("multi")}i.children().text(i.data("orgtext"));a.removeClass("working")},o=function(){e("lookupfailure");a.removeClass("working");jQuery(".info.newlookup a").children("span").html("Finn mine målepunkter")},l=j(),q=l.length,r=[],p=function(b){q--;if(b!=null)for(var a=0;a<b.length;a++)r.push(b[a]);q<=0&&s(jQuery(r))},v=function(a){o(a)},n=0;n<l.length;n++){var k=d._GetValues(l[n]),g={},t=jQuery.fn.GetBirthDate(jQuery(".entry.birthday select"));if(m==="Domestic"){if(jQuery(".orderform.bestillingsskjema").length>0)g.BirthDate=t;else g.BirthDate="none";g.LastName=k.LastName.substr(0,4)+"*";g.PostalCode=k.PostalCode;g.OriginalAddress=k.Address}else{g.CompanyName=k.CompanyName;g.OrgNumber=k.OrgNumber;g.Address=k.Address;g.PostalCode=k.PostalCode}e("start");EidsivaServices("GetMeasuringPointIdFor"+m+"Customer",g,p,p)}})};jQuery.fn.GetBirthDate=function(c){var d=jQuery(c[2]).children("option:selected").val(),a=jQuery(c[1]).children("option:selected").val();if(a<10)a="0"+a;var b=jQuery(c[0]).children("option:selected").val();if(b<10)b="0"+b;return d+"-"+a+"-"+b};jQuery.fn._GetValues=function(a){var d=jQuery(this),c={};for(var b in a)if(a.hasOwnProperty(b))c[b]=jQuery("*[name="+a[b]+"]",d).GetSanitizedValue();return c};jQuery.fn._GetEntryValues=function(){for(var e=jQuery(this),d=[],c=jQuery("input, select, textarea, button",e),f=0,b=0;b<c.length;b++){var a=jQuery(c[b]);if(!a.hasClass("validatecontrol")&&!a.hasClass("lookupcontrol"))d[f++]=a.GetSanitizedValue()}return d};jQuery.fn._SetEntryValues=function(c){var d=jQuery(this),b=jQuery("input, select, textarea, button",d);for(var a in c)b[a]!=null&&jQuery(b[a]).trigger("focus").trigger("keydown").val(c[a]).trigger("keyup").trigger("keypress").trigger("blur")};jQuery.fn._Validate=function(h,b,a,d){var e=false,c=jQuery(this);if(c.GetSanitizedValue()!==""&&c.GetSanitizedValue()!==b)return;if(d.Required)if(b.length===0){a._ShowHideError("required",true,b);a._ShowHideError("invalid",false,b);c.trigger("validateerror","required");a.data("isvalid",false);e=false}else{a._ShowHideError("required",false,b);c.trigger("validateok");a.data("isvalid",true);e=true}else if(!d.Required&&b.length===0){a._ShowHideError("invalid",false,b);c.trigger("validateok");a.data("isvalid",true);e=true}if(d.Validate&&b.length>0)if(d.ValidateMethod==="Regex"&&d.hasOwnProperty("ValidateRegex")&&d.ValidateRegex.length>h){a._ShowHideWorking(true);var i=new RegExp(d.ValidateRegex[h],"g");if(b.match(i)){a._ShowHideError("invalid",false,b);c.trigger("validateok");a.data("isvalid",true);e=true}else{a._ShowHideError("invalid",true,b);c.trigger("validateerror","invalid");a.data("isvalid",false);e=false}a._ShowHideWorking(false);return}else if(d.ValidateMethod==="Services"){var g=[],f=a.data("formElements");f!=undefined&&f.length>0&&a.data("formElements").each(function(a){var b=jQuery(this);g[a]=b.GetSanitizedValue()});a._ShowHideWorking(true);e=false;EidsivaServices("ValidateField",{Name:c.attr("name"),Type:d.Type,Values:g},function(d){if(d.hasOwnProperty("IsValid")&&d.IsValid){a._ShowHideError("invalid",false,b);c.trigger("validateok");a.data("isvalid",true);d=true}else{a._ShowHideError("invalid",true,b);c.trigger("validateerror","required");a.data("isvalid",false);d=false}a._ShowHideWorking(false)},function(d){a._ShowHideError("invalid",false,b);c.trigger("validateok");a.data("isvalid",true);d=true;a._ShowHideWorking(false)})}return e};jQuery.fn.EidsivaValidate=function(){var b=jQuery(this),a=null,d=true;try{a=jQuery.parseJSON(jQuery("input:hidden.validatecontrol",b).val())}catch(f){d=false;return}if(d&&a!=null&&a.hasOwnProperty("Type")&&a.hasOwnProperty("Required")&&a.hasOwnProperty("Validate")&&a.hasOwnProperty("ValidateMethod")){var c=jQuery(".input input, .input select, .input textarea, .input button",b);b.data("formElements",c);var e=function(f){var e=jQuery(f.data.input),d=f.data.valueLastKeyUp,c=e.GetSanitizedValue();if(c!==d||c===null||c===""){setTimeout(function(){e._Validate(index,c,b,a)},1e3);d=c===""?null:c}};c.each(function(a){jQuery.fn._SetupValidation(jQuery(this),b,a)})}};jQuery.fn._ClearValidation=function(b){b.unbind();var a=b.closest(".entry");a.data("isvalid",true);jQuery(".errormessage-invalid",a).hide()};jQuery.fn._SwitchPostalValidation=function(a,c,e){var d='{"Type":"PostalCode","Required":true,"Validate":true,"ValidateMethod":"Regex","ValidateRegex":["^[0-9 ]{4,}$", "^.{2,}$"]}',b=jQuery("input:hidden.validatecontrol",a);a.data("validateControl")==undefined&&a.data("validateControl",b.val());if(c&&b.val()==d){jQuery(".postalcode",a).attr("maxlength",4).val("");jQuery(".placename",a).attr("disabled","disabled").val("");jQuery("input.postalcode",a).EidsivaLookupPostalCode(a);b.val(a.data("validateControl"))}else if(!c&&b.val()==a.data("validateControl")){jQuery(".postalcode",a).removeAttr("maxlength").unbind("keyup");jQuery(".placename",a).removeAttr("disabled");b.val(d)}jQuery(".country",a).val(e)};jQuery.fn._SetupValidation=function(a,b,e){var c=null;try{c=jQuery.parseJSON(jQuery("input:hidden.validatecontrol",b).val())}catch(f){return}var d=a.GetSanitizedValue();a.bind("validate",function(g,f){if(f===undefined||f===null)f=1e3;var c=a.GetSanitizedValue();if(f<=0)a._Validate(e,c,b,jQuery.parseJSON(jQuery("input:hidden.validatecontrol",b).val()));else if(c!==d||c===null||c===""){setTimeout(function(){a._Validate(e,c,b,jQuery.parseJSON(jQuery("input:hidden.validatecontrol",b).val()))},f);d=c===""?null:c}});a.blur(function(){a.trigger("validate")});if(a.get(0).tagName.toLowerCase()==="select")a.change(function(){a.trigger("validate")});else a.attr("type").toLowerCase()==="radio"&&a.change(function(){a.trigger("validate",0)});a.submit(function(){a.trigger("validate")});if(c.Required){a.trigger("validatenotdone");b.data("isvalid",false)}else b.data("isvalid",true);a.data("entry",b)};jQuery.fn._ParseSufficies=function(){var c=jQuery(this),b=[];if(c.val().trim().length>0)for(var e=c.val().split(","),a=0;a<e.length;a++){var d=parseInt(e[a]);d!=NaN&&b.push(d)}return b};jQuery.fn.EidsivaSection=function(){var a=jQuery(this),b=function(a){a.preventDefault();jQuery.fn.EidsivaRemoveSection(a.data.section,true)};a.click(function(e,d){e.preventDefault();var c=jQuery(".section",a.parent()).first(),b=jQuery(".section",a.parent()).last();jQuery.fn.EidsivaAddSection(c,d,b,null,true,true)})};jQuery.fn.EidsivaRemoveSection=function(a,e){var h=jQuery(a).parent(),c=jQuery("input[type=hidden].sectionsufficies",h),b=c._ParseSufficies(),f=function(a){b=jQuery.grep(b,function(b){return b!=a});c.val(b.join(","))},d=function(){jQuery(a).remove()},g=jQuery(a).data("suffix");f(g);if(e!=undefined&&e==true){jQuery(a).slideUp(500);setTimeout(function(){d()},550)}else d()};jQuery.fn.EidsivaAddSection=function(b,e,k,l,g,i){var a=b.clone(),m=b;jQuery.fn.ResetValidation(a);var c=jQuery("input[type=hidden].sectionsufficies",m.parent()),f=c._ParseSufficies();m.data("sufficiescontrol",c);function n(){var a=2;while(jQuery.inArray(a,f)>=0)a++;f.push(a);c.val(f.join(","));return a}var o=function(a){a.preventDefault();jQuery.fn.EidsivaRemoveSection(a.data.section,g)},d=n();a.data("suffix",d);a.data("sufficiescontrol",c);l!=undefined&&a.data("indexNr",l);jQuery("*[name]",a).each(function(){var a=jQuery(this);a.attr("name",a.attr("name")+"_"+d);a.val("")});jQuery("label[for]",a).each(function(){var c=jQuery(this),b=jQuery("*[id="+c.attr("for")+"]",a);b.attr("id",b.attr("id")+"_"+d);c.attr("for",b.attr("id"));b.val("")});if(i!=undefined&&i==true){var j=a.children(".sectionremovebutton");j.css("display","block");j.bind("click",{section:a},o)}if(g!=undefined&&g==true){a.hide();k.after(a);a.slideDown(500)}else k.after(a);a.EidsivaConvenience();if(e!==undefined)for(var h in e)e.hasOwnProperty(h)&&jQuery("[name="+h+"_"+d+"]",a).trigger("focus").trigger("keydown").val(e[h]).trigger("keyup").trigger("keypress").trigger("blur");jQuery("select.dateday",a).val(jQuery("select.dateday",b).val());jQuery("select.datemonth",a).val(jQuery("select.datemonth",b).val());jQuery("select.dateyear",a).val(jQuery("select.dateyear",b).val());return a};jQuery.fn.EidsivaConvenience=function(){var a=jQuery(this);jQuery("input:hidden.lookupcontrol.lookuplocalfield",a).each(function(){var b=jQuery(this).parent(".entry");b.EidsivaLookupLocalField(a,jQuery.parseJSON(jQuery(this).val()))});jQuery("input:hidden.lookupcontrol.lookuppostalcode",a).each(function(){var a=jQuery(this).parent(".entry");jQuery("input.postalcode",a).EidsivaLookupPostalCode(a)});jQuery(".lookupcontrol.lookupcontactinfo",a).each(function(){var c=jQuery(this).parent(".entry"),b=jQuery(".lookupbutton",c),d=jQuery("input.phonenumber",c);d.EidsivaLookupContactInfo(a,c,jQuery.parseJSON(jQuery(this).val()),b);d.EidsivaMaskPhonenumber(function(){b.addClass("brown").removeClass("gray")},function(){b.addClass("gray").removeClass("brown")})});jQuery("input.orgnumber",a).EidsivaMaskOrgnumber();jQuery("input:hidden.lookupcontrol.lookupcompanyinfo",a).each(function(){var c=jQuery(this).parent(".entry"),b=jQuery(".lookupbutton",c),d=jQuery("input.orgnumber",c);d.EidsivaLookupCompanyInfo(a,c,jQuery.parseJSON(jQuery(this).val()),b);d.EidsivaMaskOrgnumber(function(){b.addClass("brown").removeClass("gray")},function(){b.addClass("gray").removeClass("brown")})});jQuery("input.measuringpoint",a).EidsivaMaskMeasuringPoint();jQuery("input:hidden.lookupcontrol.lookupmeasuringpoint",a).each(function(){var b=jQuery(this).parent(".messagebox");b.EidsivaLookupMeasuringPoint(a,jQuery.parseJSON(jQuery(this).val()))});jQuery("input.number",a).EidsivaMaskNumber();jQuery(".entry",a).each(function(){jQuery(this).EidsivaValidate()});jQuery("input[type=submit].sectionaddbutton",a).each(function(){jQuery(this).EidsivaSection()})};jQuery.fn._StepHide=function(b){var a=jQuery(this);a.data("orgheight",a.height());a.css("max-height",a.height());a.css("overflow","hidden");a.animate({maxHeight:200},b)};jQuery.fn._StepShow=function(b){var a=jQuery(this),c=a.data("orgheight");a.animate({maxHeight:c},b,function(){a.css("overflow","auto");a.css("max-height","")})};jQuery.fn.EidsivaStepify=function(f){f=jQuery(f);var c=jQuery(this),h=c.next(".ordercontrols"),a=[];jQuery(".step",c).each(function(b){a[b]=jQuery(this);a[b]._StepHide(1)});var b=-1,d=jQuery(".nextbutton",h);d.data("orgtext",d.children().text());var p=jQuery(".prevbutton",h),o=jQuery(".ordersubmitbutton",h),n="Bestill";d.data("submittext",o.val());var i=false,g=false,e=function(e,u){if(e==b||!jQuery.inArray(e,a))return;var f={fromStep:b,toStep:e,allSteps:a},s=new jQuery.Event("stepchange");c.trigger(s,f);if(s.isDefaultPrevented())return;if(window.location.search&&i==false){var r=window.location.search,t=r.substring(r.indexOf("=")+1),n=jQuery("#ProductID_"+t);if(n.size()>0){n.attr("checked","checked");window.location.hash="#step-2";e=1;var q=jQuery(".stepsindicator li");jQuery(q).removeClass("marked");jQuery(q[1]).addClass("marked");i=true}}else{g=true;window.location.hash="#step-"+(e+1)}if(e+1>=a.length)d.children().text("Bestill");else d.children().text(d.data("orgtext"));if(u)if(a[e].data("orgheight")>a[b].data("orgheight")){a[e]._StepShow(750);setTimeout(function(){c.scrollTo(a[e],750);setTimeout(function(){a[b]._StepHide(1);b=e;c.trigger("afterstepchange",f)},750)},750)}else{a[e]._StepShow(1);c.scrollTo(a[e],750);setTimeout(function(){a[b]._StepHide(750);b=e;c.trigger("afterstepchange",f)},750)}else{a[e]._StepShow(1);c.scrollTo(a[e]);b>=0&&b<a.length&&a[b]._StepHide(1);b=e;c.trigger("afterstepchange",f)}m(b,e);if(jQuery(".orderform.bestillingsskjema").length>0){if(e===2){jQuery.fn.PopulateBillingSelection();jQuery.fn.PopulateMeasuringPoints();var p=setTimeout(function(){jQuery(".measuringpointlookup .start .lookupbutton").trigger("click");clearTimeout(p)},500)}}else if(jQuery(".orderform.flytteskjema").length>0)if(e===1){var j=jQuery("#Anlegg_Adresse").val(),l=jQuery("#Anlegg_Postnummer").val(),h=jQuery("#Anlegg_Postnummer").next("input").val();jQuery("input.AdresseNavn").val(j+", "+l+" "+h);var k=jQuery(".entry.measuringpoint");jQuery("#address",k).val(j);jQuery("#postalCode",k).val(l);jQuery("#postalPlace",k).val(h);var o=[];o.push([j,l,h,jQuery("#Anlegg_Adresse").attr("id")]);jQuery.fn.PopulateBillingSelection2(o)}else if(e===2)var p=setTimeout(function(){jQuery(".measuringpointlookup .start .lookupbutton").trigger("click");clearTimeout(p)},500)},m=function(c,b){var a="Ukjent";if(jQuery(".orderform.bestillingsskjema").length>0&&c<=b){switch(b){case 0:a="1 - Produkt";break;case 1:a="2 - Personinformasjon";break;case 2:a="3 - Målepunkt";break;case 3:a="4 - Oppsummering"}_gaq.push(["_trackEvent","Skjema","Bestillingsskjema",a])}else if(jQuery(".orderform.flytteskjema").length>0&&c<=b){switch(b){case 0:a="1 - Personinformasjon";break;case 1:a="2 - Overtar etter";break;case 2:a="3 - Målepunkt";break;case 3:a="4 - Produkt";break;case 4:a="5 - Oppsummering"}_gaq.push(["_trackEvent","Skjema","Flytteskjema",a])}};d.click(function(G){if(d.children().text()==n){var D={fromStep:b,toStep:b+1,allSteps:a},w=new jQuery.Event("stepchange");c.trigger(w,D);if(w.isDefaultPrevented()){G.preventDefault();return}var A=jQuery(".inputCheck[name=TermsAgreement]:checked");if(A.size()>0){for(var l=jQuery.parseJSON(jQuery("input:hidden.summarycontrol",c).val()),f={},u=jQuery(".entry",c),r={},g=0;g<u.length;g++){var h=u[g],F=jQuery("label",h);r[F.attr("for")]=jQuery(h)}for(var g=0;g<l.FieldNames.length;g++){var i=l.FieldNames[g];if(r[i]!=undefined)f[i]=r[i]._GetEntryValues()}var z=jQuery(".inputCheck[name=GreenEnergy]:checked");z.size()>0?f.GreenEnergy="Yes":f.GreenEnergy="No";f.TermsAgreement="Yes";var t=jQuery(".radiobuttonwrapper input:checked").next().html(),B=jQuery(".radiobuttonwrapper input:checked").parent().hasClass("subproducts");if(B)f.Produkt_Navn=jQuery(".radiobuttonwrapper input:checked").parent().siblings("label").html()+" - "+t;else f.Produkt_Navn=t;f.Produkt_ID=jQuery(".radiobuttonwrapper input:checked").val().split("_")[1];var p=[],m=0;for(var i in l.Sections)if(l.Sections.hasOwnProperty(i)){var s=l.Sections[i],o=jQuery("input:hidden.sectionsufficies[name="+i+"]",c),q=[];if(o.length>0&&o.val().trim().length>0)for(var x=o.val().split(","),g=0;g<x.length;g++){var v=parseInt(x[g]);v!=NaN&&q.push(v)}for(var g in q){var H=null,I={};for(var y in s){p[m]=s[y];m++;var E=s[y]+"_"+q[g],h=jQuery("label[for="+E+"]",c);if(h.length>0){while(!h.hasClass("entry"))h=h.parent();var C=h._GetEntryValues();p[m]=C.toString();m++}}}}f.Sections=p;jQuery.fancybox(jQuery("#BestillerFrame").html(),{overlayShow:true,hideOnOverlayClick:false,width:400,height:200,transitionOut:"none",autoDimensions:false,showCloseButton:false});if(jQuery(".orderform.bestillingsskjema").length>0)EidsivaServices("SendConfirmationEmail",f,k,j);else jQuery(".orderform.flytteskjema").length>0&&EidsivaServices("SendFlytteskjemaConfirmationEmail",f,k,j)}else alert("For å kunne bestille energi må du godta vilkår og betingelser")}else e(b+1,true);return false});var k=function(a){if(jQuery(".orderform.bestillingsskjema").length>0)_gaq.push(["_trackEvent","Skjema","Bestillingsskjema","5 - Bestilling"]);else jQuery(".orderform.flytteskjema").length>0&&_gaq.push(["_trackEvent","Skjema","Flytteskjema","6 - Bestilling"]);jQuery.fancybox(jQuery("#BestillerFrameSuccess").html(),{overlayShow:true,hideOnOverlayClick:false,width:400,height:200,transitionIn:"none",autoDimensions:false,showCloseButton:false});setTimeout(function(){jQuery.fancybox.close();location.href="#";jQuery(".ordercontrols").remove();jQuery(".stepsindicator a").unbind("click");jQuery("#ErrorMessageField").hide();jQuery(".oppsummering input, .checkBoxesWrapper input, select.languageList").attr("disabled","disabled");jQuery("#BillingSelection_Chooser span").unbind("click");jQuery("#oppsummeringForste .oppsummeringHeader").html("Kvittering");jQuery("#oppsummeringForste .forsteContent").html("Din bestilling er utført. Dersom du skrev inn epost mottar du snart en kvittering der.");jQuery("#oppsummeringForste").addClass("oppsummeringKvittering");jQuery('input[value="Målepunkt"]').each(function(c){var b=jQuery(this).parent();b.append('<div class="placeholderLabel">Referansenummer:</div><var class="placeholder">'+a[c].ConfirmationOrderID+"</var><br>")})},1500)},j=function(a){jQuery.fancybox(jQuery("#BestillerFrameFailure").html(),{overlayShow:true,hideOnOverlayClick:false,width:400,height:200,transitionIn:"none",autoDimensions:false,showCloseButton:false});setTimeout(function(){jQuery.fancybox.close();jQuery("#ErrorMessageField").slideDown();jQuery("#ErrorMessageField .forstecontent").html(a.d+" Vennligst prøv igjen senere. ")},1500)};p.click(function(a){a.preventDefault();e(b-1,true)});c.bind("afterstepchange",function(c,b){if(g==true){var a=jQuery("li",f);jQuery(a).removeClass("marked");jQuery(a[b.toStep]).addClass("marked")}g=true});c.bind("stepchange",function(b,a){!jQuery.fn.EidsivaValidateStepChange(a)&&b.preventDefault()});var l=function(d,c){if(c===undefined)c=false;var b=parseInt(d.substring("#step-".length));b==NaN&&e(0,c);b--;if(b>=0&&b<a.length)e(b,c);else e(0,c)};l(window.location.hash);jQuery("li a",f).each(function(a){var b=jQuery(this);b.click(function(b){b.preventDefault();e(a,true)})})};jQuery.fn.EidsivaValidateStepChange=function(a){var b=true;if(a.toStep>a.fromStep)for(var c=0;c<a.toStep;c++)jQuery(".entry",a.allSteps[c]).each(function(){var a=jQuery(this);validateControl=null;try{validateControl=jQuery.parseJSON(jQuery("input:hidden.validatecontrol",a).val())}catch(d){}if(a.data("isvalid")===false){a.data("formElements").each(function(e){var c=jQuery(this),d=c.GetSanitizedValue();if(validateControl!=null)if(!c._Validate(e,d,a,validateControl))b=false});if(a.data("isvalid")===false)b=false}});return b};jQuery.fn.EidsivaSummary=function(){var a=jQuery(this),b=jQuery.parseJSON(jQuery("input:hidden.summarycontrol",a).val());a.bind("stepchange",function(z,h){var v=h.allSteps[h.allSteps.length-1];if(h.toStep==h.allSteps.length-1){for(var g={},o=jQuery(".entry",a),l={},c=0;c<o.length;c++){var d=o[c],x=jQuery("label",d);l[x.attr("for")]=jQuery(d)}for(var c=0;c<b.FieldNames.length;c++){var e=b.FieldNames[c];if(l[e]!=undefined)g[e]=l[e]._GetEntryValues()}var n=jQuery(".radiobuttonwrapper input:checked").next().html(),u=jQuery(".radiobuttonwrapper input:checked").parent().hasClass("subproducts");if(u)g.Produkt_Navn=jQuery(".radiobuttonwrapper input:checked").parent().siblings("label").html()+" - "+n;else g.Produkt_Navn=n;v._FillPlaceholders(g);jQuery(".placeholdertemplate",a).siblings().remove();var y={};for(var e in b.Sections)if(b.Sections.hasOwnProperty(e)){var m=b.Sections[e],i=jQuery("input:hidden.sectionsufficies[name="+e+"]",a),k=[];if(i.length>0&&i.val().trim().length>0)for(var r=i.val().split(","),c=0;c<r.length;c++){var q=parseInt(r[c]);q!=NaN&&k.push(q)}for(var c in k){var f=null,p={};for(var s in m){var w=m[s]+"_"+k[c],d=jQuery("label[for="+w+"]",a);if(d.length>0){while(!d.hasClass("entry"))d=d.parent();p[m[s]]=d._GetEntryValues();if(f==null){var t=jQuery(".placeholdertemplate input:hidden.placeholderforsection",a);t.each(function(){if("Section_"+jQuery(this).attr("value")==e)f=jQuery(this).parent()})}}}if(f!=null){var j=f.clone();j._FillPlaceholders(p);j.removeClass("placeholdertemplate");f.parent().append(j)}}}}})};jQuery.fn.EidsivaProductChooser=function(a){a=jQuery(a);var d=jQuery(this),c=jQuery(".productlist",d),b=function(b){jQuery("input.productname",c).val(b);jQuery(".chosenproduct",c).html("Produkt: <strong>"+b+"</strong>");a._FillPlaceholders({ChosenProduct:b})};jQuery(".radiobuttonwrapper",d).each(function(f,a){a=jQuery(a);var c=jQuery(a.children("input")),e=jQuery(a.children("label")),d=jQuery(a.children(".subproducts"));d.length>0&&jQuery(d.children("input")).each(function(f,a){var a=jQuery(a),c=jQuery(d.children("label[for="+a.val()+"]"));a.change(function(){b(e.text()+" - "+c.text())});a.attr("checked")&&a.trigger("change",jQuery.Event("click"))});c.change(function(){b(e.text())});c.attr("checked")&&c.trigger("change",jQuery.Event("click"))})};jQuery.fn.EidsivaOrderForm=function(){var a=jQuery(this);jQuery(".input ul li:last a").live("keydown",function(a){if(a.keyCode==9)return false});jQuery(".placename:last").live("keydown",function(a){if(a.keyCode==9)return false});jQuery(".sectionaddbutton").live("keydown",function(a){if(a.keyCode==9)return false});a.EidsivaConvenience();a.EidsivaStepify(jQuery(".stepsindicator"));a.EidsivaSummary();a.EidsivaProductChooser(jQuery(".stepsindicator"))};jQuery.fn.BillingSelectionAddressList=function(){var a=[],b=jQuery("#Anlegg_Adresse").closest(".section").parent();jQuery(".section",b).each(function(){var d=jQuery("input.address",this).val(),c=jQuery("input.postalcode",this).val(),b=jQuery("input.placename",this).val();a.push([d,c,b,jQuery("input.address",this).attr("id")])});return a};jQuery.fn.PopulateBillingSelection=function(){var a=jQuery.fn.BillingSelectionAddressList();jQuery.fn.PopulateBillingSelection2(a)};jQuery.fn.PopulateBillingSelection2=function(b){var a=jQuery("#BillingSelection_Chooser");a.find("li").remove();jQuery.each(b,function(){var b=this[0]+", "+this[1]+" "+this[2],c=this,d=jQuery("<li>").append(jQuery("<input type='radio' name='addressChooser'>").attr("value",b).click(function(){jQuery("span",a).css("font-weight","");jQuery("span",jQuery(this).parent()).css("font-weight","bold");jQuery("#BillingSelection_DefaultTemplate").slideUp("swing",function(){jQuery.fn.PopulateBillingAddress(c)})})).append(jQuery("<span>").text(b).click(function(){jQuery("input",jQuery(this).parent()).trigger("click")}));a.append(d)});var c=jQuery("<li>").append(jQuery("<input type='radio' name='addressChooser'>").click(function(){jQuery("span",a).css("font-weight","");jQuery("span",jQuery(this).parent()).css("font-weight","bold");jQuery.fn.ResetInputValidation(jQuery("#Person_Adresse"));jQuery.fn.ResetInputValidation(jQuery("#Person_Postnummer"));jQuery("#Person_Postnummer").next().val("");jQuery("#BillingSelection_DefaultTemplate").slideDown()})).append(jQuery("<span>").text("Annen").click(function(){jQuery("input",jQuery(this).parent()).trigger("click")}));a.append(c);jQuery.fn.PopulateBillingAddress(b[0]);jQuery('input[type="radio"]',a).first().trigger("click")};jQuery.fn.PopulateMeasuringPoint=function(b,a,e){if(jQuery(b).data("locked")!=undefined)return;e&&jQuery(b).data("locked",true);var d=a[0]+", "+a[1]+" "+a[2];b.val(d);var c=b.closest(".section");jQuery("#address",c).val(a[0]);jQuery("#postalCode",c).val(a[1]);jQuery("#postalPlace",c).val(a[2])};jQuery.fn.PopulateMeasuringPoints=function(){var e=jQuery.fn.GetBirthDate(jQuery(".entry.birthday select")),a=jQuery.fn.BillingSelectionAddressList(),c=jQuery(".entry.adressevalg .input .AdresseNavn").closest(".section"),d=jQuery(".entry.adressevalg .input .AdresseNavn").closest(".section").first();jQuery(c).each(function(){var g=jQuery(".entry.adressevalg .input .AdresseNavn",this),c=false,b=0;jQuery("#birthdate",this).val(e);if(jQuery(this).data("indexNr")!=undefined){var d=jQuery(this).data("indexNr");jQuery(a).each(function(e){if(a[e][3]===d){c=true;b++}});(!c||b>a.length)&&jQuery.fn.EidsivaRemoveSection(this)}});c=jQuery(".entry.adressevalg .input .AdresseNavn").closest(".section");for(var b=1;a.length>b;b++)if(c.length>b&&jQuery(c[b]).data("indexNr")==undefined)jQuery.fn.EidsivaAddSection(d,null,jQuery(c[b-1]),a[b][3]);else if(c.length<=b){var f=jQuery(".entry.adressevalg .input .AdresseNavn").closest(".section").last();jQuery.fn.EidsivaAddSection(d,null,f,a[b][3])}jQuery(".entry.adressevalg .input .AdresseNavn").each(function(b){a.length>b&&jQuery.fn.PopulateMeasuringPoint(jQuery(this),a[b],false)})};jQuery.fn.ResetInputValidation=function(b){b.val("");var a=b.parent().parent();a.data("isvalid",false);a.find(".status").removeClass("ok").removeClass("invalid");a.find(".errormessage").hide()};jQuery.fn.ResetValidation=function(b){var a=jQuery(".entry",b);a.data("isvalid",false);a.find(".status").removeClass("ok").removeClass("invalid");a.find(".errormessage").hide()};jQuery.fn.PopulateBillingAddress=function(a){jQuery("#Person_Adresse").val(a[0]).trigger("blur");jQuery("#Person_Postnummer").val(a[1]).trigger("blur");jQuery("#Person_Postnummer").next().val(a[2])};jQuery.fn.GetCurrentStepIndex=function(){var b=jQuery(".steps .step"),a=-1;jQuery.each(b,function(b){if(jQuery(this).css("overflow")=="auto")a=b});return a};jQuery(function(){jQuery.mask.rules=jQuery.extend(jQuery.mask.rules,{"+":/[0-9+]/});if(jQuery(".orderform.bestillingsskjema").length>0){jQuery.fn.BindHelperBox("#Person_Telefonnummer","Telefonnummeret til personen som står som eier av det elektriske anlegget.");jQuery.fn.BindHelperBox("#Person_Epost","Eposten til personen som står som eier av det elektriske anlegget. Adressen blir kun brukt for å oppfylle og ivareta kundeforholdet.");jQuery.fn.BindHelperBox("#Person_Fornavn","Fornavnet til personen som står som eier av det elektriske anlegget.");jQuery.fn.BindHelperBox("#Person_Etternavn","Etternavnet til personen som står som eier av det elektriske anlegget.");jQuery.fn.BindHelperBox(".entry.birthday select","Fødselsdatoen til personen som står som eier av det elektriske anlegget.");jQuery.fn.BindHelperBox('[id^="Anlegg_Adresse"]',"Gateadresse der det elektriske anlegget er installert.");jQuery.fn.BindHelperBox('[id^="Anlegg_Postnummer"]',"Postnummer der det elektriske anlegget er installert.");jQuery.fn.BindHelperBox(".measuringpoint",'MålepunktID er en unik identifisering av det elektriske anlegget og består av 18 siffer.<br>MålepunktID finner du på din faktura. Vær oppmerksom på at dette ikke er det samme som målernummer.<br><br>MålepunktID valideres opp mot din fødselsdato og postnummer.<br><br><img src="/public/images/faktura.jpg" alt="Faktura">');jQuery.fn.BindHelperBox('[id^="Avlesning"]',"Målerstand på strømmåleren i det elektriske anlegget.");jQuery.fn.BindHelperBox(".entry.meterreading select","Dato for avlesning av målerstand.");jQuery.fn.BindHelperBox("#Person_Adresse","Adressen du ønsker å motta fakturaen til.");jQuery.fn.BindHelperBox("#Person_Postnummer","Postnummeret til adressen du ønsker å motta fakturaen til.")}else if(jQuery(".orderform.flytteskjema").length>0){jQuery.fn.BindHelperBox("#Person_Telefonnummer","Telefonnummeret ditt");jQuery.fn.BindHelperBox("#Person_Epost","Eposten din. Adressen blir kun brukt for å oppfylle og ivareta kundeforholdet.");jQuery.fn.BindHelperBox("#Person_Fornavn","Fornavnet ditt.");jQuery.fn.BindHelperBox("#Person_Etternavn","Etternavnet ditt.");jQuery.fn.BindHelperBox(".entry.birthday select","Fødselsdatoen din.");jQuery.fn.BindHelperBox(".entry.takeover select","Datoen du tar over anlegget på.");jQuery.fn.BindHelperBox("#GammelPerson_Telefonnummer","Telefonnummeret til personen som står som eier av det elektriske anlegget.");jQuery.fn.BindHelperBox("#GammelPerson_Fornavn","Fornavnet til personen som står som eier av det elektriske anlegget.");jQuery.fn.BindHelperBox("#GammelPerson_Etternavn","Etternavnet til personen som står som eier av det elektriske anlegget.");jQuery.fn.BindHelperBox('[id^="Anlegg_Adresse"]',"Gateadresse der det elektriske anlegget er installert.");jQuery.fn.BindHelperBox('[id^="Anlegg_Postnummer"]',"Postnummer der det elektriske anlegget er installert.");jQuery.fn.BindHelperBox(".measuringpoint",'MålepunktID er en unik identifisering av det elektriske anlegget og består av 18 siffer.<br>MålepunktID finner du på din faktura. Vær oppmerksom på at dette ikke er det samme som målernummer.<br><br>MålepunktID valideres opp mot din fødselsdato og postnummer.<br><br><img src="/public/images/faktura.jpg" alt="Faktura">');jQuery.fn.BindHelperBox('[id^="Avlesning"]',"Målerstand på strømmåleren i det elektriske anlegget.");jQuery.fn.BindHelperBox(".entry.meterreading select","Dato for avlesning av målerstand.");jQuery.fn.BindHelperBox("#Person_Adresse","Adressen du ønsker å motta fakturaen til.");jQuery.fn.BindHelperBox("#Person_Postnummer","Postnummeret til adressen du ønsker å motta fakturaen til.")}jQuery.fn.BindMeasurePointValidation();jQuery("select.languageList").change(function(){if(jQuery(this).val()!="NO")jQuery.fn._SwitchPostalValidation(jQuery(this).closest(".content").find(".entry.postalcode"),false,jQuery(this).val());else jQuery.fn._SwitchPostalValidation(jQuery(this).closest(".content").find(".entry.postalcode"),true,jQuery(this).val())})});jQuery.fn.BindMeasurePointValidation=function(){var a=jQuery('[id^="Measuringpoint"]').closest(".entry");if(jQuery(".helperboxMarker",a).length===0){var b=jQuery('<div class="helperboxMarker _nubixVerifikasjon">');a.append(b)}jQuery('[id^="Measuringpoint"]').live("blur",function(){var b=jQuery(this),c=b.val();if((b.data("oldMeasurePoint")==null||b.data("oldMeasurePoint")!=c)&&c.length===9){b.data("oldMeasurePoint",c);var a=b.closest(".entry"),e=jQuery(".measuringbase",a).val()+SanitizeValue(c),f=jQuery("#postalCode",a).val(),d=null;jQuery(".helperboxMarker",a).css("background-image",'url("/public/images/nubix_loader.gif")').attr("title","Utfører verifikasjon av målepunktID");var h=function(b){if(b)jQuery(".helperboxMarker",a).css("background-image",'url("/public/images/nubix_valid.png")').attr("title","MålepunktID er verifisert");else jQuery(".helperboxMarker",a).css("background-image",'url("/public/images/nubix_warning.png")').attr("title","MålepunktID er ikke gyldig")},g=function(){jQuery(".helperboxMarker",a).css("background-image",'url("/public/images/nubix_warning.png")').attr("title","Klarte ikke verifisere målepunktID")};if(jQuery(".orderform.bestillingsskjema").length>0){var i=jQuery("#birthdate",a).val();d={birthDate:i,postalCode:f,mesuringPointId:e};EidsivaServices("ValidateMeasuringPointIdForDomesticCustomer",d,h,g)}else if(jQuery(".orderform.flytteskjema").length>0){var j=jQuery("#GammelPerson_Etternavn").val().substr(0,4)+"*",k=jQuery("#address",a).val();d={lastName:j,address:k,postalCode:f,mesuringPointId:e};EidsivaServices("ValidateFlytteskjemaMeasuringPointIdForDomesticCustomer",d,h,g)}}else c.length<9&&jQuery(".helperboxMarker",a).css("background-image","")})};jQuery.fn.BindHelperBox=function(a,b){var c=jQuery(a).first().closest(".entry");jQuery(a).live("focus",function(){var a=jQuery(this).closest(".entry");jQuery.fn.ShowHelperBox(a,"beskrivelse1",b)}).live("blur",function(){jQuery.fn.HideHelperBox("beskrivelse1")})};jQuery.fn.ShowHelperBox=function(c,d,e){var a=jQuery(".helperBox._"+d);if(a.length==0){var a=jQuery('<div class="helperBox _'+d+'" style="position:absolute; z-index:1000; top:0px; display:none;">');a.append(jQuery('<div class="helperBoxContent">')).append(jQuery('<div class="helperBoxArrow">'));jQuery("body").append(a)}var b=c.offset();if(b==null)return;a.css("marginLeft",b.left+c.outerWidth(true)+4);a.css("marginTop",b.top);jQuery(".helperBoxContent",a).html(e);a.show()};jQuery.fn.HideHelperBox=function(a){jQuery(".helperBox._"+a).hide()};jQuery(document).ready(function(){reverseDefaultZIndexStackingOrder();jQuery.browser.msie&&jQuery("div#veil").fadeOut("fast");String.prototype.trim=function(){return jQuery.trim(this)};eventCalendarAnimate();eventCalendarEventsAnimate();removeValidationSummary();fixFormCheckbox();makeErrorMessageIntoBubbles();setEventContainerHeight();fixPixelRounding();window.setInterval(function(){fixPixelRounding();hideExcessEvents();eventCalendarMapviewPopup()},500);FAQFilter();FAQCategoryToggle();TopLevelDropDownInit();EidsivaBanner();EidsivaLoginbox();EidsivaOrderForm();EidsivaProductPresentation();initTogglers("#customernumber","#username");initTogglers("#username","#customernumber")});var initTogglers=function(a,c){var e=jQuery(a),h=jQuery(a+" .toggler > a"),d=jQuery(a+" .toggler"),b=jQuery(a+" .togglee"),f=jQuery(c+" .toggler"),g=jQuery(c+" .togglee");if(e.hasClass("failed-authentication")){d.hide();b.show();jQuery("input.felt",b).first().focus();e.removeClass("failed-authentication")}h.click(function(a){a.preventDefault();g.hide();f.show();d.hide();b.slideDown(function(){jQuery("input.felt",b).first().focus()})})};function reverseDefaultZIndexStackingOrder(){var a=1e3;jQuery("div.form div").each(function(){jQuery(this).css("zIndex",a);a-=10})}function disableFormBtn(a){Page_ClientValidate()==true&&setTimeout("doDisableFormBtn('"+a+"')",50)}function doDisableFormBtn(c){var b=jQuery("#"+c);b.attr("disabled","disabled");var a=b.parents().filter(".btnWrap:not(.disabled)");a&&a.addClass("disabled")}if(!(new String).startsWith)String.prototype.startsWith=function(b,a){a=a?"i":"";var c=new RegExp("^"+b,a);return this.normalize().match(c)?true:false};function removeValidationSummary(){jQuery(".xFormsValidationSummary").each(function(){jQuery(this).css({overflow:"hidden",padding:"0px",margin:"0px",border:"none",height:"0px",visibility:"hidden"})})}function makeErrorMessageIntoBubbles(){jQuery("span.xformvalidator").each(function(){if(jQuery(this).text().length>70)jQuery(this).addClass("largeBubble");else jQuery(this).addClass("smallBubble")})}function fixFormCheckbox(){jQuery(".form .row .cell fieldset").each(function(){var a=jQuery(this).children('input[type="checkbox"]'),b=jQuery(this).children("legend:first-child");if(a!=null&&a.length>0){jQuery(b).hide();jQuery(this).parent().addClass("cb_input")}})}function eventCalendarAnimate(){jQuery("#EventCalendar").mouseover(function(){jQuery("#EventCalendar").addClass("mouseIsOverCalendar")});jQuery("#EventCalendar").mouseleave(function(){jQuery("#EventCalendar").removeClass("mouseIsOverCalendar");jQuery("#EventCalendar").removeClass("YearBtnPressed")});if(jQuery("#EventCalendar").length>0){if(jQuery("#EventCalendar").hasClass("showOnLoad")){showEventCalendar();setTimeout(function(){hideEventCalendar()},4e3)}jQuery("#EventCalendar").hover(showEventCalendar,hideEventCalendar)}}function hideEventCalendar(){if(window.location.hash!="#dev")if(!jQuery("#EventCalendar").hasClass("mouseIsOverCalendar"))jQuery("#EventCalendar").stop().animate({height:"40px"},1e3);else jQuery("#EventCalendar").stop()}function showEventCalendar(){var a=0;if(jQuery("#EventCalendar").hasClass("MapView"))a=525;else{a=450;if(jQuery("#EventCalendar").hasClass("YearView")&&!jQuery("#EventCalendar").hasClass("YearBtnPressed")){a=240;jQuery("#EventCalendar").removeClass("YearBtnPressed")}}jQuery("#EventCalendar").stop().animate({height:a+"px"},700)}function eventCalendarMapviewPopup(){if(jQuery("#EventCalendar").hasClass("MapView")){var a=12,b=jQuery("#EventCalendar.MapView .mapViewPopupWrapper");jQuery("#EventCalendar.MapView .mapBubble").each(function(){var d=jQuery("#EventCalendar .bottomSection .map").height()-a*2,e=jQuery("#EventCalendar .bottomSection").width()-a*2;if(!jQuery(this).hasEvent("click")){var c=jQuery(this).next();jQuery(this).click(function(p){p.preventDefault();b.each(function(){jQuery(this).css("display","none")});c.css("display","block");c.css("z-index",1e4);var n=parseInt(c.css("left")),o=parseInt(c.css("top")),f=n-a,g=o-a,m=g-c.height()/2,i=g+c.height()/2,l=f-c.width()/2,q=f+c.width()/2,e=0-c.height()/2,j=0-c.width()/2,k=false,h=false;if(m<0){e=0-g;k=true}else if(i>d){e=e-i+d;h=true}if(k&&h){c.css("height",d);c.css("overflow-y","auto")}if(l<0)j=0-f;c.css("margin-left",j);c.css("margin-top",e);c.find(".mapViewPopupClose").click(function(a){a.preventDefault();c.css("display","none")})})}if(!jQuery(this).hasEvent("mouseover")){jQuery(this).mouseover(function(){var a=jQuery(this).next(),b=0;while(!a.hasClass("districtMap")&&b<10)a=a.next();a.css("display","block")});jQuery(this).mouseout(function(){var a=jQuery(this).next(),b=0;while(!a.hasClass("districtMap")&&b<10)a=a.next();a.css("display","none")})}})}}function eventCalendarEventsAnimate(){jQuery.fn.hasEvent&&setInterval(function(){if(!jQuery("#EventCalendar .events .event").hasEvent()){jQuery("#EventCalendar .events .event").hover(eventShowMoreInfo,eventHideMoreInfo);jQuery("#EventCalendar .events .event .date").each(function(){jQuery(this).css("display")!="block"&&jQuery(this).css({width:jQuery(this).width()+5+"px",display:"block","float":"left","max-width":"0px",overflow:"hidden"})})}},750)}function eventShowMoreInfo(){var e=jQuery(this).find(".title .date"),c=parseInt(e.css("width"));e.stop().animate({maxWidth:c+"px"},500);var a=jQuery(this).find(".title .name").width()+c+50;if(a>jQuery(this).width()){jQuery(this).attr("rev","animating");var d=parseInt(jQuery(this).css("left")),b=jQuery(".bottomSection").width(),g=160;if(jQuery("#EventCalendar").hasClass("MonthView")||jQuery("#EventCalendar").hasClass("WeekView"))b=b-g;if(a+d>b){var f=a+d-b;jQuery(this).stop().css("z-index",99).animate({width:a+"px",marginLeft:0-f+"px"},500)}else jQuery(this).stop().css("z-index",99).animate({width:a+"px"},500)}}function eventHideMoreInfo(){jQuery(this).find(".title .date").stop().animate({maxWidth:"0px"},500);jQuery(this).stop().animate({marginLeft:"0px",width:jQuery(this).css("min-width")},500).css("z-index",0).attr("rev","")}function collapseEventCategory(a,b){a.next().html("+ Flere aktiviteter");a.animate({maxHeight:b},500)}function expandEventCategory(a,b){a.next().html("&ndash; F&aelig;rre aktiviteter");a.animate({maxHeight:b},500)}function hideExcessEvents(){if(jQuery("#EventCalendar").length>0&&jQuery("#EventCalendar .events .event").length>0){var a=63;jQuery("#EventCalendar .category").each(function(){if(parseInt(jQuery(this).css("height"))-a>10){if(!jQuery(this).next().hasEvent("click")){jQuery(this).css("max-height",a);var b=jQuery(this).next();b.click(function(){var c=jQuery(this).prev();if(parseInt(c.height())>a)collapseEventCategory(jQuery(this).prev(),a);else expandEventCategory(jQuery(this).prev(),parseInt(jQuery(this).prev().css("height")));b.attr("rel","justclicked");jQuery("#EventCalendar .toggleMore").each(function(){jQuery(this).css("display")!="none"&&jQuery(this).attr("rel")!="justclicked"&&collapseEventCategory(jQuery(this).prev(),a)});b.attr("rel","")})}}else jQuery(this).next().hide()})}}function setEventContainerHeight(){if(jQuery("#EventCalendar").length>0&&jQuery("#EventCalendar .events .event").length>0){var a=jQuery(jQuery("#EventCalendar .events .event")[0]).height()+2;jQuery("#EventCalendar .events").each(function(){var b=parseInt(jQuery(this).attr("rel"));jQuery(this).parent().css("height",b*a+5)})}}function fixPixelRounding(){if(jQuery("#EventCalendar").length>0&&jQuery("#EventCalendar .events").length>0){var b=jQuery("#EventCalendar .periodLabels .label"),a=jQuery(jQuery("#EventCalendar .events")[0]).width()/b.length;setEventContainerHeight();jQuery(b).each(function(){jQuery(this).width(Math.ceil(a))});jQuery("#EventCalendar .calendar .category .events .event").each(function(){if(jQuery(this).attr("rev")!="animating"){var e=jQuery(this).attr("rel").split("|"),b=parseInt(e[0]),d=parseInt(e[1]),c=Math.ceil(a*b-b*1)-1,f=Math.ceil(a*d-d*1)-1;jQuery(this).width(c);jQuery(this).css("min-width",c);jQuery(this).css("left",f)}})}}function calendarPeriodModeSwitch(a){switch(a){case"year":jQuery("#EventCalendar").addClass("YearView");jQuery("#EventCalendar").addClass("YearBtnPressed");jQuery("#EventCalendar").removeClass("MonthView");jQuery("#EventCalendar").removeClass("WeekView");break;case"month":jQuery("#EventCalendar").removeClass("YearView");jQuery("#EventCalendar").addClass("MonthView");jQuery("#EventCalendar").removeClass("WeekView");break;case"week":jQuery("#EventCalendar").removeClass("YearView");jQuery("#EventCalendar").removeClass("MonthView");jQuery("#EventCalendar").addClass("WeekView")}if(!jQuery("#EventCalendar").hasClass("MapView"))if(a=="year")setTimeout(jQuery("#EventCalendar").animate({height:"240px"},1e3),5e3);else jQuery("#EventCalendar").animate({height:"450px"},1e3)}function calendarModeSwitch(b){if(b=="map")jQuery("#EventCalendar").animate({height:"525px"},1e3).removeClass("CalendarView").addClass("MapView");else{var a=jQuery("#EventCalendar").hasClass("YearView")?"240px":"450px";jQuery("#EventCalendar").animate({height:a},1e3).removeClass("MapView").addClass("CalendarView")}}var FAQFilter=function(){if(!jQuery.fn.liveUpdate)return;jQuery("input#FAQFilter").liveUpdate("#FAQData").focus();function b(){jQuery(".FAQFilterHelpMessage").css("text-indent","-9999px")}function c(){jQuery(".FAQFilterHelpMessage").css("text-indent","0px")}jQuery("input#FAQFilter").keydown(function(){b();if(jQuery(this).val().length===0)jQuery(".FAQFilterReset").hide();else jQuery(".FAQFilterReset").show()});jQuery(".FAQFilterReset").hide().click(function(b){b.preventDefault();var a=jQuery.Event("keypress");a.which=13;jQuery("#FAQFilter").val("").focus().trigger("keyup",a)});var a=false;if(jQuery.browser.msie)a=true;jQuery("input#FAQFilter").focus(function(){!a&&b();a=false});jQuery("input#FAQFilter").blur(function(){jQuery(this).val().length===0&&c()});jQuery(".FAQFilterHelpMessage").click(function(){jQuery("input#FAQFilter").focus()});jQuery("input#FAQFilter").click(function(){jQuery("input#FAQFilter").focus()})},FAQCategoryToggle=function(){jQuery(".FAQCategory").each(function(f,a){a=jQuery(a);var c=jQuery(a.children("h3")),d=jQuery(c.children(".FAQCategoryShowHide")),b=jQuery(a.children("dl")),e=b.height();d.click(function(c){c.preventDefault();a.toggleClass("hidden");b.slideToggle("slow")})});jQuery("input#FAQFilter").keyup(function(){if(jQuery("input#FAQFilter").val().trim().length>3)jQuery(".FAQCategory .faqHits").css("visibility","visible");else jQuery(".FAQCategory .faqHits").css("visibility","hidden")})},TopLevelDropDownInit=function(){var m=400,l=650,e=200,h=200,i=false,g=jQuery(".submenu.selected");g=g.size()?g:null;var d=jQuery("#header .nav li.selected");d=d.size()?d:null;var a=d,n=null,j=jQuery("#header .nav li"),b=false;jQuery("#header").hover(function(){b=true},function(){a=null;c(l);b=false});var k=function(){a=null;c(0,null,true,true)};jQuery(".menu .topnav, .menu .search, #header_content .logo").hover(k);jQuery("#header").outerClick(function(){c(100)});function c(g,c,e,d){if(e!==true)e=false;if(d!==true)d=false;if(g!==undefined&&g>0){if(c!==null||c!==undefined)a=c;setTimeout(function(){if(e||!b)if(c!==null||c!==undefined)a==c&&f(c,d);else f(c,d)},g)}else f(c,d)}function f(b,f){if(!f&&(b===undefined||b===null))b=d;j.each(function(){var a=jQuery(this),c=a.data("submenu");if(b===null||a.attr("class")!==b.attr("class")){if(a.is(":visible"))if(i)c.fadeOut(h);else c.slideUp(h*.7);jQuery("a.hoverTextImage",a).removeClass("menuItemSelected")}});if(b!=null&&b.size()>0){jQuery("a.hoverTextImage",b).addClass("menuItemSelected");var c=b.data("submenu");if(!c.is(":visible"))if(i)setTimeout(function(){if(a!=null&&a.attr("class")===b.attr("class"))c.fadeIn(e);else jQuery("a.hoverTextImage",b).removeClass("menuItemSelected")},e*.9);else setTimeout(function(){if(a!=null&&a.attr("class")===b.attr("class"))c.slideDown(e*.7);else jQuery("a.hoverTextImage",b).removeClass("menuItemSelected")},e*.7)}a=b}j.each(function(h){var e=jQuery(this),g="menu-"+h,d=jQuery(".submenu."+g);d=d.size()?d:null;e.data("submenu",d);d.hover(function(){b=true},function(a){b=false;e.trigger("mouseout",a)});d.click(function(){b=true});e.click(function(){b=true});e.hover(f);function f(){if(a==null)c(m,e,true);else if(a!=null&&a!=e)c(0,e,true);else d==null&&currentSubmenu!=null&&c(0,null,true)}})},EidsivaBanner=function(){jQuery(".bannerwrapper").size()>0&&jQuery(".bannerwrapper").EidsivaBanner(".pane",".banner",".bannerslide",".bannercontrols",jQuery(".bannerwrapper .autoSlideDuration").text())},EidsivaLoginbox=function(){if(jQuery(".loginBox").size()>0){var a=jQuery(".loginBox"),b=jQuery(".loginFrame",a);jQuery("a",a).click(function(b){b.preventDefault();a.css("min-height",a.height());a.animate({minHeight:250},750);a.addClass("showingFrame")});jQuery("a",a).outerClick(function(){a.animate({minHeight:1},750);a.removeClass("showingFrame")})}},EidsivaOrderForm=function(){jQuery(".orderform").size()>0&&jQuery(".orderform").EidsivaOrderForm()},EidsivaProductPresentation=function(){jQuery(".productwrapper").each(function(k,a){a=jQuery(a);var h=jQuery(a.children(".longdescription")),b=h.children(".column"),c=b.height(),g=jQuery(a.children(".productbuttons")),d=jQuery(g.children(".lesmer")),e=jQuery(g.children(".lukk")),f=jQuery(".orderbutton",a);b.css("height","0");h.css("height","auto");d.click(function(d){d.preventDefault();var a=c*4;b.animate({height:c},a,i)});e.click(function(d){d.preventDefault();var a=c*4;b.animate({height:0},a,j)});var i=function(){d.hide();e.show()},j=function(){d.show();e.hide()};f.click(function(e){e.preventDefault();var b=f.attr("href"),d=jQuery("input:radio:checked",a),c;if(d.val()!=null)c=d.val();else c=jQuery(".productPageId",a).val();b=b+"?productPageId="+c;window.location=b})});expandProductFromQueryString()};function expandProductFromQueryString(){var a=getParameterByName("productId");if(a!=null){var b=".produktid_"+a,c=jQuery(b);c.click()}}function getParameterByName(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c="[\\?&]"+a+"=([^&#]*)",d=new RegExp(c),b=d.exec(window.location.href);return b==null?"":decodeURIComponent(b[1].replace(/\+/g," "))}(function(a){var d="Lite-1.0";a.fn.cycle=function(d){return this.each(function(){d=d||{};this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=0;this.cyclePause=0;var g=a(this),h=d.slideExpr?a(d.slideExpr,this):g.children(),f=h.get();if(f.length<2){window.console&&window.console.log&&window.console.log("terminating; too few slides: "+f.length);return}var e=a.extend({},a.fn.cycle.defaults,d||{},a.metadata?g.metadata():a.meta?g.data():{});e.before=e.before?[e.before]:[];e.after=e.after?[e.after]:[];e.after.unshift(function(){e.busy=0});var k=this.className;e.width=parseInt((k.match(/w:(\d+)/)||[])[1])||e.width;e.height=parseInt((k.match(/h:(\d+)/)||[])[1])||e.height;e.timeout=parseInt((k.match(/t:(\d+)/)||[])[1])||e.timeout;g.css("position")=="static"&&g.css("position","relative");e.width&&g.width(e.width);e.height&&e.height!="auto"&&g.height(e.height);var i=0;h.css({position:"absolute",top:0,left:0}).hide().each(function(b){a(this).css("z-index",f.length-b)});a(f[i]).css("opacity",1).show();a.browser.msie&&f[i].style.removeAttribute("filter");e.fit&&e.width&&h.width(e.width);e.fit&&e.height&&e.height!="auto"&&h.height(e.height);e.pause&&g.hover(function(){this.cyclePause=1},function(){this.cyclePause=0});a.fn.cycle.transitions.fade(g,h,e);h.each(function(){var b=a(this);this.cycleH=e.fit&&e.height?e.height:b.height();this.cycleW=e.fit&&e.width?e.width:b.width()});h.not(":eq("+i+")").css({opacity:0});e.cssFirst&&a(h[i]).css(e.cssFirst);if(e.timeout){if(e.speed.constructor==String)e.speed=({slow:600,fast:200})[e.speed]||400;if(!e.sync)e.speed=e.speed/2;while(e.timeout-e.speed<250)e.timeout+=e.speed}e.speedIn=e.speed;e.speedOut=e.speed;e.slideCount=f.length;e.currSlide=i;e.nextSlide=1;var j=h[i];e.before.length&&e.before[0].apply(j,[j,j,e,true]);e.after.length>1&&e.after[1].apply(j,[j,j,e,true]);if(e.click&&!e.next)e.next=e.click;e.next&&a(e.next).bind("click",function(){return c(f,e,e.rev?-1:1)});e.prev&&a(e.prev).bind("click",function(){return c(f,e,e.rev?1:-1)});if(e.timeout)this.cycleTimeout=setTimeout(function(){b(f,e,0,!e.rev)},e.timeout+(e.delay||0))})};function b(d,c,i,j){if(c.busy)return;var f=d[0].parentNode,g=d[c.currSlide],e=d[c.nextSlide];if(f.cycleTimeout===0&&!i)return;if(i||!f.cyclePause){c.before.length&&a.each(c.before,function(b,a){a.apply(e,[g,e,c,j])});var k=function(){a.browser.msie&&this.style.removeAttribute("filter");a.each(c.after,function(b,a){a.apply(e,[g,e,c,j])})};if(c.nextSlide!=c.currSlide){c.busy=1;a.fn.cycle.custom(g,e,c,k)}var h=c.nextSlide+1==d.length;c.nextSlide=h?0:c.nextSlide+1;c.currSlide=h?d.length-1:c.nextSlide-1}if(c.timeout)f.cycleTimeout=setTimeout(function(){b(d,c,0,!c.rev)},c.timeout)}function c(c,a,f){var e=c[0].parentNode,d=e.cycleTimeout;if(d){clearTimeout(d);e.cycleTimeout=0}a.nextSlide=a.currSlide+f;if(a.nextSlide<0)a.nextSlide=c.length-1;else if(a.nextSlide>=c.length)a.nextSlide=0;b(c,a,1,f>=0);return false}a.fn.cycle.custom=function(h,g,b,f){var e=a(h),d=a(g);d.css({opacity:0});var c=function(){d.animate({opacity:1},b.speedIn,b.easeIn,f)};e.animate({opacity:0},b.speedOut,b.easeOut,function(){e.css({display:"none"});!b.sync&&c()});b.sync&&c()};a.fn.cycle.transitions={fade:function(d,c,b){c.not(":eq(0)").css("opacity",0);b.before.push(function(){a(this).show()})}};a.fn.cycle.ver=function(){return d};a.fn.cycle.defaults={timeout:4e3,speed:1e3,next:"#next",prev:"#prev",before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);var hs={lang:{cssDirection:"ltr",loadingText:"Loading...",loadingTitle:"Click to cancel",focusTitle:"Click to bring to front",fullExpandTitle:"Expand to actual size (f)",creditsText:"Powered by <i>Highslide JS</i>",creditsTitle:"Go to the Highslide JS homepage",previousText:"Previous",nextText:"Next",moveText:"Move",closeText:"Close",closeTitle:"Close (esc)",resizeTitle:"Resize",playText:"Play",playTitle:"Play slideshow (spacebar)",pauseText:"Pause",pauseTitle:"Pause slideshow (spacebar)",previousTitle:"Previous (arrow left)",nextTitle:"Next (arrow right)",moveTitle:"Move",fullExpandText:"1:1",number:"Image %1 of %2",restoreTitle:"Click to close image, click and drag to move. Use arrow keys for next and previous."},graphicsDir:"public/highslidegfx/",expandCursor:"zoomin.cur",restoreCursor:"zoomout.cur",expandDuration:250,restoreDuration:250,marginLeft:15,marginRight:15,marginTop:15,marginBottom:15,zIndexCounter:1001,loadingOpacity:.75,allowMultipleInstances:true,numberOfImagesToPreload:5,outlineWhileAnimating:2,outlineStartOffset:3,padToMinWidth:false,fullExpandPosition:"bottom right",fullExpandOpacity:1,showCredits:true,creditsHref:"http://highslide.com/",creditsTarget:"_self",enableKeyListener:true,openerTagNames:["a","area"],transitions:[],transitionDuration:250,dimmingOpacity:0,dimmingDuration:50,allowWidthReduction:false,allowHeightReduction:true,preserveContent:true,objectLoadTime:"before",cacheAjax:true,anchor:"auto",align:"auto",targetX:null,targetY:null,dragByHeading:true,minWidth:200,minHeight:200,allowSizeReduction:true,outlineType:"drop-shadow",skin:{controls:'<div class="highslide-controls"><ul><li class="highslide-previous"><a href="#" title="{hs.lang.previousTitle}"><span>{hs.lang.previousText}</span></a></li><li class="highslide-play"><a href="#" title="{hs.lang.playTitle}"><span>{hs.lang.playText}</span></a></li><li class="highslide-pause"><a href="#" title="{hs.lang.pauseTitle}"><span>{hs.lang.pauseText}</span></a></li><li class="highslide-next"><a href="#" title="{hs.lang.nextTitle}"><span>{hs.lang.nextText}</span></a></li><li class="highslide-move"><a href="#" title="{hs.lang.moveTitle}"><span>{hs.lang.moveText}</span></a></li><li class="highslide-full-expand"><a href="#" title="{hs.lang.fullExpandTitle}"><span>{hs.lang.fullExpandText}</span></a></li><li class="highslide-close"><a href="#" title="{hs.lang.closeTitle}" ><span>{hs.lang.closeText}</span></a></li></ul></div>',contentWrapper:'<div class="highslide-header"><ul><li class="highslide-previous"><a href="#" title="{hs.lang.previousTitle}" onclick="return hs.previous(this)"><span>{hs.lang.previousText}</span></a></li><li class="highslide-next"><a href="#" title="{hs.lang.nextTitle}" onclick="return hs.next(this)"><span>{hs.lang.nextText}</span></a></li><li class="highslide-move"><a href="#" title="{hs.lang.moveTitle}" onclick="return false"><span>{hs.lang.moveText}</span></a></li><li class="highslide-close"><a href="#" title="{hs.lang.closeTitle}" onclick="return hs.close(this)"><span>{hs.lang.closeText}</span></a></li></ul></div><div class="highslide-body"></div><div class="highslide-footer"><div><span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span></div></div>'},preloadTheseImages:[],continuePreloading:true,expanders:[],overrides:["allowSizeReduction","useBox","anchor","align","targetX","targetY","outlineType","outlineWhileAnimating","captionId","captionText","captionEval","captionOverlay","headingId","headingText","headingEval","headingOverlay","creditsPosition","dragByHeading","autoplay","numberPosition","transitions","dimmingOpacity","width","height","contentId","allowWidthReduction","allowHeightReduction","preserveContent","maincontentId","maincontentText","maincontentEval","objectType","cacheAjax","objectWidth","objectHeight","objectLoadTime","swfOptions","wrapperClassName","minWidth","minHeight","maxWidth","maxHeight","slideshowGroup","easing","easingClose","fadeInOut","src"],overlays:[],idCounter:0,oPos:{x:["leftpanel","left","center","right","rightpanel"],y:["above","top","middle","bottom","below"]},mouse:{},headingOverlay:{},captionOverlay:{},swfOptions:{flashvars:{},params:{},attributes:{}},timers:[],slideshows:[],pendingOutlines:{},sleeping:[],preloadTheseAjax:[],cacheBindings:[],cachedGets:{},clones:{},onReady:[],uaVersion:parseFloat((navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]),ie:document.all&&!window.opera,safari:/Safari/.test(navigator.userAgent),geckoMac:/Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),$:function(a){if(a)return document.getElementById(a)},push:function(a,b){a[a.length]=b},createElement:function(f,b,d,c,e){var a=document.createElement(f);b&&hs.extend(a,b);e&&hs.setStyles(a,{padding:0,border:"none",margin:0});d&&hs.setStyles(a,d);c&&c.appendChild(a);return a},extend:function(b,a){for(var c in a)b[c]=a[c];return b},setStyles:function(c,b){for(var a in b)if(hs.ie&&a=="opacity")if(b[a]>.99)c.style.removeAttribute("filter");else c.style.filter="alpha(opacity="+b[a]*100+")";else c.style[a]=b[a]},animate:function(h,d,a){var e,g,f;if(typeof a!="object"||a===null){var c=arguments;a={duration:c[2],easing:c[3],complete:c[4]}}if(typeof a.duration!="number")a.duration=250;a.easing=Math[a.easing]||Math.easeInQuad;a.curAnim=hs.extend({},d);for(var b in d){var i=new hs.fx(h,a,b);e=parseFloat(hs.css(h,b))||0;g=parseFloat(d[b]);f=b!="opacity"?"px":"";i.custom(e,g,f)}},css:function(c,a){if(document.defaultView)return document.defaultView.getComputedStyle(c,null).getPropertyValue(a);else{if(a=="opacity")a="filter";var b=c.currentStyle[a.replace(/\-(\w)/g,function(b,a){return a.toUpperCase()})];if(a=="filter")b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(b,a){return a/100});return b===""?1:b}},getPageSize:function(){var a=document,c=window,b=a.compatMode&&a.compatMode!="BackCompat"?a.documentElement:a.body,d=a.body,g=c.innerWidth&&c.scrollMaxX?c.innerWidth+c.scrollMaxX:Math.max(d.scrollWidth,d.offsetWidth),h=c.innerHeight&&window.scrollMaxY?c.innerHeight+c.scrollMaxY:Math.max(d.scrollHeight,d.offsetHeight),f=hs.ie?b.scrollWidth:a.documentElement.clientWidth||self.innerWidth,e=hs.ie?Math.max(b.scrollHeight,b.clientHeight):a.documentElement.clientHeight||self.innerHeight,j=hs.ie?b.clientWidth:a.documentElement.clientWidth||self.innerWidth,i=hs.ie?b.clientHeight:self.innerHeight;hs.page={pageWidth:Math.max(f,g),pageHeight:Math.max(e,h),width:j,height:i,scrollLeft:hs.ie?b.scrollLeft:pageXOffset,scrollTop:hs.ie?b.scrollTop:pageYOffset}},getPosition:function(a){if(/area/i.test(a.tagName))for(var d=document.getElementsByTagName("img"),c=0;c<d.length;c++){var e=d[c].useMap;if(e&&e.replace(/^.*?#/,"")==a.parentNode.name){a=d[c];break}}var b={x:a.offsetLeft,y:a.offsetTop};while(a.offsetParent){a=a.offsetParent;b.x+=a.offsetLeft;b.y+=a.offsetTop;if(a!=document.body&&a!=document.documentElement){b.x-=a.scrollLeft;b.y-=a.scrollTop}}return b},expand:function(b,c,e,d){if(!b)b=hs.createElement("a",null,{display:"none"},hs.container);if(typeof b.getParams=="function")return c;if(d=="html"){for(var a=0;a<hs.sleeping.length;a++)if(hs.sleeping[a]&&hs.sleeping[a].a==b){hs.sleeping[a].awake();hs.sleeping[a]=null;return false}hs.hasHtmlExpanders=true}try{new hs.Expander(b,c,e,d);return false}catch(f){return true}},htmlExpand:function(c,b,a){return hs.expand(c,b,a,"html")},getSelfRendered:function(){return hs.createElement("div",{className:"highslide-html-content",innerHTML:hs.replaceLang(hs.skin.contentWrapper)})},getElementByClass:function(e,d,c){for(var b=e.getElementsByTagName(d),a=0;a<b.length;a++)if(new RegExp(c).test(b[a].className))return b[a];return null},replaceLang:function(a){a=a.replace(/\s/g," ");var e=/{hs\.lang\.([^}]+)\}/g,b=a.match(e),d;if(b)for(var c=0;c<b.length;c++){d=b[c].replace(e,"$1");if(typeof hs.lang[d]!="undefined")a=a.replace(b[c],hs.lang[d])}return a},setClickEvents:function(){for(var b=document.getElementsByTagName("a"),a=0;a<b.length;a++){var c=hs.isUnobtrusiveAnchor(b[a]);if(c&&!b[a].hsHasSetClick){(function(){var d=c;if(hs.fireEvent(hs,"onSetClickEvent",{element:b[a],type:d}))b[a].onclick=c=="image"?function(){return hs.expand(this)}:function(){return hs.htmlExpand(this,{objectType:d})}})();b[a].hsHasSetClick=true}}hs.getAnchors()},isUnobtrusiveAnchor:function(a){return a.rel=="highslide"?"image":a.rel=="highslide-ajax"?"ajax":a.rel=="highslide-iframe"?"iframe":a.rel=="highslide-swf"?"swf":void 0},getCacheBinding:function(c){for(var a=0;a<hs.cacheBindings.length;a++)if(hs.cacheBindings[a][0]==c){var b=hs.cacheBindings[a][1];hs.cacheBindings[a][1]=b.cloneNode(1);return b}return null},preloadAjax:function(){for(var c=hs.getAnchors(),b=0;b<c.htmls.length;b++){var a=c.htmls[b];hs.getParam(a,"objectType")=="ajax"&&hs.getParam(a,"cacheAjax")&&hs.push(hs.preloadTheseAjax,a)}hs.preloadAjaxElement(0)},preloadAjaxElement:function(d){if(!hs.preloadTheseAjax[d])return;var c=hs.preloadTheseAjax[d],a=hs.getNode(hs.getParam(c,"contentId"));if(!a)a=hs.getSelfRendered();var b=new hs.Ajax(c,a,1);b.onError=function(){};b.onLoad=function(){hs.push(hs.cacheBindings,[c,a]);hs.preloadAjaxElement(d+1)};b.run()},focusTopmost:function(){for(var f=0,c=-1,d=hs.expanders,e,a,b=0;b<d.length;b++){e=d[b];if(e){a=e.wrapper.style.zIndex;if(a&&a>f){f=a;c=b}}}if(c==-1)hs.focusKey=-1;else d[c].focus()},getParam:function(a,b){a.getParams=a.onclick;var c=a.getParams?a.getParams():null;a.getParams=null;return c&&typeof c[b]!="undefined"?c[b]:typeof hs[b]!="undefined"?hs[b]:null},getSrc:function(b){var a=hs.getParam(b,"src");return a?a:b.href},getNode:function(c){var b=hs.$(c),a=hs.clones[c],d={};if(!b&&!a)return null;if(!a){a=b.cloneNode(true);a.id="";hs.clones[c]=a;return b}else return a.cloneNode(true)},discardElement:function(a){a&&hs.garbageBin.appendChild(a);hs.garbageBin.innerHTML=""},dim:function(a){if(!hs.dimmer){hs.dimmer=hs.createElement("div",{className:"highslide-dimming",owner:"",onclick:function(){hs.fireEvent(hs,"onDimmerClick")&&hs.close()}},{position:"absolute",visibility:"visible",left:0,opacity:0},hs.container,true);hs.addEventListener(window,"resize",hs.setDimmerSize)}hs.dimmer.style.display="";hs.setDimmerSize();hs.dimmer.owner+="|"+a.key;if(hs.geckoMac&&hs.dimmingGeckoFix)hs.setStyles(hs.dimmer,{background:"url("+hs.graphicsDir+"geckodimmer.png)",opacity:1});else hs.animate(hs.dimmer,{opacity:a.dimmingOpacity},hs.dimmingDuration)},undim:function(a){if(!hs.dimmer)return;if(typeof a!="undefined")hs.dimmer.owner=hs.dimmer.owner.replace("|"+a,"");if(typeof a!="undefined"&&hs.dimmer.owner!=""||hs.upcoming&&hs.getParam(hs.upcoming,"dimmingOpacity"))return;if(hs.geckoMac&&hs.dimmingGeckoFix)hs.setStyles(hs.dimmer,{background:"none",width:0,height:0});else hs.animate(hs.dimmer,{opacity:0},hs.dimmingDuration,null,function(){hs.setStyles(hs.dimmer,{display:"none",width:0,height:0})})},setDimmerSize:function(a){hs.getPageSize();if(!hs.dimmer)return;var b=hs.ie&&a&&a.wrapper?parseInt(a.wrapper.style.top)+parseInt(a.wrapper.style.height)+(a.outline?a.outline.offset:0):0;hs.setStyles(hs.dimmer,{width:hs.page.pageWidth+"px",height:Math.max(hs.page.pageHeight,b)+"px"})},transit:function(b,a){var c=a=a||hs.getExpander();if(hs.upcoming)return false;else hs.last=c;try{hs.upcoming=b;b.onclick()}catch(d){hs.last=hs.upcoming=null}try{(!b||a.transitions[1]!="crossfade")&&a.close()}catch(d){}return false},previousOrNext:function(b,c){var a=hs.getExpander(b);if(a){adj=a.getAdjacentAnchor(c);return hs.transit(adj,a)}else return false},previous:function(a){return hs.previousOrNext(a,-1)},next:function(a){return hs.previousOrNext(a,1)},keyHandler:function(a){if(!a)a=window.event;if(!a.target)a.target=a.srcElement;if(typeof a.target.form!="undefined")return true;if(!hs.fireEvent(hs,"onKeyDown",a))return true;var b=hs.getExpander(),c=null;switch(a.keyCode){case 70:b&&b.doFullExpand();return true;case 32:c=2;break;case 34:case 39:case 40:c=1;break;case 8:case 33:case 37:case 38:c=-1;break;case 27:case 13:c=0}if(c!==null){c!=2&&hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);if(!hs.enableKeyListener)return true;if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b){if(c==0)b.close();else if(c==2)b.slideshow&&b.slideshow.hitSpace();else{b.slideshow&&b.slideshow.pause();hs.previousOrNext(b.key,c)}return false}}return true},registerOverlay:function(a){hs.push(hs.overlays,hs.extend(a,{hsId:"hsId"+hs.idCounter++}))},addSlideshow:function(a){var b=a.slideshowGroup;if(typeof b=="object")for(var c=0;c<b.length;c++){var d={};for(var e in a)d[e]=a[e];d.slideshowGroup=b[c];hs.push(hs.slideshows,d)}else hs.push(hs.slideshows,a)},getWrapperKey:function(c,f){var a,e=/^highslide-wrapper-([0-9]+)$/;a=c;while(a.parentNode){if(a.hsKey!==undefined)return a.hsKey;if(a.id&&e.test(a.id))return a.id.replace(e,"$1");a=a.parentNode}if(!f){a=c;while(a.parentNode){if(a.tagName&&hs.isHsAnchor(a))for(var b=0;b<hs.expanders.length;b++){var d=hs.expanders[b];if(d&&d.a==a)return b}a=a.parentNode}}return null},getExpander:function(a,b){if(typeof a=="undefined")return hs.expanders[hs.focusKey]||null;if(typeof a=="number")return hs.expanders[a]||null;if(typeof a=="string")a=hs.$(a);return hs.expanders[hs.getWrapperKey(a,b)]||null},isHsAnchor:function(a){return a.onclick&&a.onclick.toString().replace(/\s/g," ").match(/hs.(htmlE|e)xpand/)},reOrder:function(){for(var a=0;a<hs.expanders.length;a++)hs.expanders[a]&&hs.expanders[a].isExpanded&&hs.focusTopmost()},fireEvent:function(a,b,c){return a&&a[b]?a[b](a,c)!==false:true},mouseClickHandler:function(b){if(!b)b=window.event;if(b.button>1)return true;if(!b.target)b.target=b.srcElement;var c=b.target;while(c.parentNode&&!/highslide-(image|move|html|resize)/.test(c.className))c=c.parentNode;var a=hs.getExpander(c);if(a&&(a.isClosing||!a.isExpanded))return true;if(a&&b.type=="mousedown"){if(b.target.form)return true;var e=c.className.match(/highslide-(image|move|resize)/);if(e){hs.dragArgs={exp:a,type:e[1],left:a.x.pos,width:a.x.size,top:a.y.pos,height:a.y.size,clickX:b.clientX,clickY:b.clientY};hs.addEventListener(document,"mousemove",hs.dragHandler);b.preventDefault&&b.preventDefault();if(/highslide-(image|html)-blur/.test(a.content.className)){a.focus();hs.hasFocused=true}return false}else if(/highslide-html/.test(c.className)&&hs.focusKey!=a.key){a.focus();a.doShowHide("hidden")}}else if(b.type=="mouseup"){hs.removeEventListener(document,"mousemove",hs.dragHandler);if(hs.dragArgs){if(hs.styleRestoreCursor&&hs.dragArgs.type=="image")hs.dragArgs.exp.content.style.cursor=hs.styleRestoreCursor;var d=hs.dragArgs.hasDragged;if(!d&&!hs.hasFocused&&!/(move|resize)/.test(hs.dragArgs.type))hs.fireEvent(a,"onImageClick")&&a.close();else(d||!d&&hs.hasHtmlExpanders)&&hs.dragArgs.exp.doShowHide("hidden");if(hs.dragArgs.exp.releaseMask)hs.dragArgs.exp.releaseMask.style.display="none";d&&hs.fireEvent(hs.dragArgs.exp,"onDrop",hs.dragArgs);d&&hs.setDimmerSize(a);hs.hasFocused=false;hs.dragArgs=null}else if(/highslide-image-blur/.test(c.className))c.style.cursor=hs.styleRestoreCursor}return false},dragHandler:function(c){if(!hs.dragArgs)return true;if(!c)c=window.event;var a=hs.dragArgs,b=a.exp;if(b.iframe){if(!b.releaseMask)b.releaseMask=hs.createElement("div",null,{position:"absolute",width:b.x.size+"px",height:b.y.size+"px",left:b.x.cb+"px",top:b.y.cb+"px",zIndex:4,background:hs.ie?"white":"none",opacity:.01},b.wrapper,true);if(b.releaseMask.style.display=="none")b.releaseMask.style.display=""}a.dX=c.clientX-a.clickX;a.dY=c.clientY-a.clickY;var d=Math.sqrt(Math.pow(a.dX,2)+Math.pow(a.dY,2));if(!a.hasDragged)a.hasDragged=a.type!="image"&&d>0||d>(hs.dragSensitivity||5);if(a.hasDragged&&c.clientX>5&&c.clientY>5){if(!hs.fireEvent(b,"onDrag",a))return false;if(a.type=="resize")b.resize(a);else{b.moveTo(a.left+a.dX,a.top+a.dY);if(a.type=="image")b.content.style.cursor="move"}}return false},wrapperMouseHandler:function(a){try{if(!a)a=window.event;var c=/mouseover/i.test(a.type);if(!a.target)a.target=a.srcElement;if(hs.ie)a.relatedTarget=c?a.fromElement:a.toElement;var b=hs.getExpander(a.target);if(!b.isExpanded)return;if(!b||!a.relatedTarget||hs.getExpander(a.relatedTarget,true)==b||hs.dragArgs)return;hs.fireEvent(b,c?"onMouseOver":"onMouseOut",a);for(var d=0;d<b.overlays.length;d++)(function(){var a=hs.$("hsId"+b.overlays[d]);if(a&&a.hideOnMouseOut){c&&hs.setStyles(a,{visibility:"visible",display:""});hs.animate(a,{opacity:c?a.opacity:0},a.dur)}})()}catch(a){}},addEventListener:function(c,a,b){c==document&&a=="ready"&&hs.push(hs.onReady,b);try{c.addEventListener(a,b,false)}catch(d){try{c.detachEvent("on"+a,b);c.attachEvent("on"+a,b)}catch(d){c["on"+a]=b}}},removeEventListener:function(b,a,c){try{b.removeEventListener(a,c,false)}catch(d){try{b.detachEvent("on"+a,c)}catch(d){b["on"+a]=null}}},preloadFullImage:function(a){if(hs.continuePreloading&&hs.preloadTheseImages[a]&&hs.preloadTheseImages[a]!="undefined"){var b=document.createElement("img");b.onload=function(){b=null;hs.preloadFullImage(a+1)};b.src=hs.preloadTheseImages[a]}},preloadImages:function(b){if(b&&typeof b!="object")hs.numberOfImagesToPreload=b;for(var c=hs.getAnchors(),a=0;a<c.images.length&&a<hs.numberOfImagesToPreload;a++)hs.push(hs.preloadTheseImages,hs.getSrc(c.images[a]));if(hs.outlineType)new hs.Outline(hs.outlineType,function(){hs.preloadFullImage(0)});else hs.preloadFullImage(0);if(hs.restoreCursor)var d=hs.createElement("img",{src:hs.graphicsDir+hs.restoreCursor})},init:function(){if(!hs.container){hs.getPageSize();hs.ieLt7=hs.ie&&hs.uaVersion<7;hs.ie6SSL=hs.ieLt7&&location.protocol=="https:";for(var a in hs.langDefaults)if(typeof hs[a]!="undefined")hs.lang[a]=hs[a];else if(typeof hs.lang[a]=="undefined"&&typeof hs.langDefaults[a]!="undefined")hs.lang[a]=hs.langDefaults[a];hs.container=hs.createElement("div",{className:"highslide-container"},{position:"absolute",left:0,top:0,width:"100%",zIndex:hs.zIndexCounter,direction:"ltr"},document.body,true);hs.loading=hs.createElement("a",{className:"highslide-loading",title:hs.lang.loadingTitle,innerHTML:hs.lang.loadingText,href:"javascript:;"},{position:"absolute",top:"-9999px",opacity:hs.loadingOpacity,zIndex:1},hs.container);hs.garbageBin=hs.createElement("div",null,{display:"none"},hs.container);hs.viewport=hs.createElement("div",{className:"highslide-viewport"},{visibility:hs.safari&&hs.uaVersion<525?"visible":"hidden"},hs.container,1);hs.clearing=hs.createElement("div",null,{clear:"both",paddingTop:"1px"},null,true);Math.linearTween=function(d,a,b,c){return b*d/c+a};Math.easeInQuad=function(a,b,c,d){return c*(a/=d)*a+b};Math.easeOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};hs.hideSelects=hs.ieLt7;hs.hideIframes=window.opera&&hs.uaVersion<9||navigator.vendor=="KDE"||hs.ie&&hs.uaVersion<5.5;hs.fireEvent(this,"onActivate")}},ready:function(){if(hs.isReady)return;hs.isReady=true;for(var a=0;a<hs.onReady.length;a++)hs.onReady[a]()},updateAnchors:function(){for(var a,d,j=[],h=[],i=[],b={},c,f=0;f<hs.openerTagNames.length;f++){d=document.getElementsByTagName(hs.openerTagNames[f]);for(var g=0;g<d.length;g++){a=d[g];c=hs.isHsAnchor(a);if(c){hs.push(j,a);if(c[0]=="hs.expand")hs.push(h,a);else c[0]=="hs.htmlExpand"&&hs.push(i,a);var e=hs.getParam(a,"slideshowGroup")||"none";if(!b[e])b[e]=[];hs.push(b[e],a)}}}hs.anchors={all:j,groups:b,images:h,htmls:i};return hs.anchors},getAnchors:function(){return hs.anchors||hs.updateAnchors()},close:function(b){var a=hs.getExpander(b);a&&a.close();return false}};hs.fx=function(b,a,c){this.options=a;this.elem=b;this.prop=c;if(!a.orig)a.orig={}};hs.fx.prototype={update:function(){(hs.fx.step[this.prop]||hs.fx.step._default)(this);this.options.step&&this.options.step.call(this.elem,this.now,this)},custom:function(b,e,d){this.startTime=(new Date).getTime();this.start=b;this.end=e;this.unit=d;this.now=this.start;this.pos=this.state=0;var c=this;function a(a){return c.step(a)}a.elem=this.elem;if(a()&&hs.timers.push(a)==1)hs.timerId=setInterval(function(){for(var a=hs.timers,b=0;b<a.length;b++)!a[b]()&&a.splice(b--,1);!a.length&&clearInterval(hs.timerId)},13)},step:function(d){var c=(new Date).getTime();if(d||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var a=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)a=false;if(a)this.options.complete&&this.options.complete.call(this.elem);return false}else{var b=c-this.startTime;this.state=b/this.options.duration;this.pos=this.options.easing(b,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};hs.extend(hs.fx,{step:{opacity:function(a){hs.setStyles(a.elem,{opacity:a.now})},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=a.now+a.unit;else a.elem[a.prop]=a.now}}});hs.Outline=function(b,c){this.onLoad=c;this.outlineType=b;var e=hs.uaVersion,d;this.hasAlphaImageLoader=hs.ie&&e>=5.5&&e<7;if(!b){c&&c();return}hs.init();this.table=hs.createElement("table",{cellSpacing:0},{visibility:"hidden",position:"absolute",borderCollapse:"collapse",width:0},hs.container,true);var g=hs.createElement("tbody",null,null,this.table,1);this.td=[];for(var a=0;a<=8;a++){if(a%3==0)d=hs.createElement("tr",null,{height:"auto"},g,true);this.td[a]=hs.createElement("td",null,null,d,true);var f=a!=4?{lineHeight:0,fontSize:0}:{position:"relative"};hs.setStyles(this.td[a],f)}this.td[4].className=b+" highslide-outline";this.preloadGraphic()};hs.Outline.prototype={preloadGraphic:function(){var c=hs.graphicsDir+(hs.outlinesDir||"outlines/")+this.outlineType+".png",a=hs.safari?hs.container:null;this.graphic=hs.createElement("img",null,{position:"absolute",top:"-9999px"},a,true);var b=this;this.graphic.onload=function(){b.onGraphicLoad()};this.graphic.src=c},onGraphicLoad:function(){for(var b=this.offset=this.graphic.width/4,c=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],d={height:2*b+"px",width:2*b+"px"},a=0;a<=8;a++)if(c[a]){if(this.hasAlphaImageLoader){var f=a==1||a==7?"100%":this.graphic.width+"px",e=hs.createElement("div",null,{width:"100%",height:"100%",position:"relative",overflow:"hidden"},this.td[a],true);hs.createElement("div",null,{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+this.graphic.src+"')",position:"absolute",width:f,height:this.graphic.height+"px",left:c[a][0]*b+"px",top:c[a][1]*b+"px"},e,true)}else hs.setStyles(this.td[a],{background:"url("+this.graphic.src+") "+c[a][0]*b+"px "+c[a][1]*b+"px"});window.opera&&(a==3||a==5)&&hs.createElement("div",null,d,this.td[a],true);hs.setStyles(this.td[a],d)}this.graphic=null;hs.pendingOutlines[this.outlineType]&&hs.pendingOutlines[this.outlineType].destroy();hs.pendingOutlines[this.outlineType]=this;this.onLoad&&this.onLoad()},setPosition:function(a,b,d){var c=this.exp,g=c.wrapper.style,b=b||0,a=a||{x:c.x.pos+b,y:c.y.pos+b,w:c.x.get("wsize")-2*b,h:c.y.get("wsize")-2*b};if(d)this.table.style.visibility=a.h>=4*this.offset?"visible":"hidden";hs.setStyles(this.table,{left:a.x-this.offset+"px",top:a.y-this.offset+"px",width:a.w+2*this.offset+"px"});a.w-=2*this.offset;a.h-=2*this.offset;hs.setStyles(this.td[4],{width:a.w>=0?a.w+"px":0,height:a.h>=0?a.h+"px":0});if(this.hasAlphaImageLoader)this.td[3].style.height=this.td[5].style.height=this.td[4].style.height},destroy:function(a){if(a)this.table.style.visibility="hidden";else hs.discardElement(this.table)}};hs.Dimension=function(b,a){this.exp=b;this.dim=a;this.ucwh=a=="x"?"Width":"Height";this.wh=this.ucwh.toLowerCase();this.uclt=a=="x"?"Left":"Top";this.lt=this.uclt.toLowerCase();this.ucrb=a=="x"?"Right":"Bottom";this.rb=this.ucrb.toLowerCase();this.p1=this.p2=0};hs.Dimension.prototype={"get":function(a){switch(a){case"loadingPos":return this.tpos+this.tb+(this.t-hs.loading["offset"+this.ucwh])/2;case"loadingPosXfade":return this.pos+this.cb+this.p1+(this.size-hs.loading["offset"+this.ucwh])/2;case"wsize":return this.size+2*this.cb+this.p1+this.p2;case"fitsize":return this.clientSize-this.marginMin-this.marginMax;case"maxsize":return this.get("fitsize")-2*this.cb-this.p1-this.p2;case"opos":return this.pos-(this.exp.outline?this.exp.outline.offset:0);case"osize":return this.get("wsize")+(this.exp.outline?2*this.exp.outline.offset:0);case"imgPad":return this.imgSize?Math.round((this.size-this.imgSize)/2):0}},calcBorders:function(){this.cb=(this.exp.content["offset"+this.ucwh]-this.t)/2;this.marginMax=hs["margin"+this.ucrb]},calcThumb:function(){this.t=this.exp.el[this.wh]?parseInt(this.exp.el[this.wh]):this.exp.el["offset"+this.ucwh];this.tpos=this.exp.tpos[this.dim];this.tb=(this.exp.el["offset"+this.ucwh]-this.t)/2;if(this.tpos<1)this.tpos=hs.page[this.wh]/2+hs.page["scroll"+this.uclt]},calcExpanded:function(){var a=this.exp;this.justify="auto";if(a.align=="center")this.justify="center";else if(new RegExp(this.lt).test(a.anchor))this.justify=null;else if(new RegExp(this.rb).test(a.anchor))this.justify="max";this.pos=this.tpos-this.cb+this.tb;this.size=Math.min(this.full,a["max"+this.ucwh]||this.full);this.minSize=a.allowSizeReduction?Math.min(a["min"+this.ucwh],this.full):this.full;if(a.isImage&&a.useBox){this.size=a[this.wh];this.imgSize=this.full}if(this.dim=="x"&&hs.padToMinWidth)this.minSize=a.minWidth;this.target=a["target"+this.dim.toUpperCase()];this.marginMin=hs["margin"+this.uclt];this.scroll=hs.page["scroll"+this.uclt];this.clientSize=hs.page[this.wh]},setSize:function(b){var a=this.exp;if(a.isImage&&(a.useBox||hs.padToMinWidth)){this.imgSize=b;this.size=Math.max(this.size,this.imgSize);a.content.style[this.lt]=this.get("imgPad")+"px"}else this.size=b;a.content.style[this.wh]=b+"px";a.wrapper.style[this.wh]=this.get("wsize")+"px";a.outline&&a.outline.setPosition();if(a.releaseMask)a.releaseMask.style[this.wh]=b+"px";if(a.isHtml){var c=a.scrollerDiv;if(this.sizeDiff===undefined)this.sizeDiff=a.innerContent["offset"+this.ucwh]-c["offset"+this.ucwh];c.style[this.wh]=this.size-this.sizeDiff+"px";if(this.dim=="x")a.mediumContent.style.width="auto";if(a.body)a.body.style[this.wh]="auto"}this.dim=="x"&&a.overlayBox&&a.sizeOverlayBox(true);if(this.dim=="x"&&a.slideshow&&a.isImage)if(b==this.full)a.slideshow.disable("full-expand");else a.slideshow.enable("full-expand")},setPos:function(a){this.pos=a;this.exp.wrapper.style[this.lt]=a+"px";this.exp.outline&&this.exp.outline.setPosition()}};hs.Expander=function(d,c,i,f){if(document.readyState&&hs.ie&&!hs.isReady){hs.addEventListener(document,"ready",function(){new hs.Expander(d,c,i,f)});return}this.a=d;this.custom=i;this.contentType=f||"image";this.isHtml=f=="html";this.isImage=!this.isHtml;hs.continuePreloading=false;this.overlays=[];this.last=hs.last;hs.last=null;hs.init();for(var h=this.key=hs.expanders.length,a=0;a<hs.overrides.length;a++){var e=hs.overrides[a];this[e]=c&&typeof c[e]!="undefined"?c[e]:hs[e]}if(!this.src)this.src=d.href;var b=c&&c.thumbnailId?hs.$(c.thumbnailId):d;b=this.thumb=b.getElementsByTagName("img")[0]||b;this.thumbsUserSetId=b.id||d.id;if(!hs.fireEvent(this,"onInit"))return true;for(var a=0;a<hs.expanders.length;a++)if(hs.expanders[a]&&hs.expanders[a].a==d&&!(this.last&&this.transitions[1]=="crossfade")){hs.expanders[a].focus();return false}if(!hs.allowSimultaneousLoading)for(var a=0;a<hs.expanders.length;a++)hs.expanders[a]&&hs.expanders[a].thumb!=b&&!hs.expanders[a].onLoadStarted&&hs.expanders[a].cancelLoading();hs.expanders[h]=this;if(!hs.allowMultipleInstances&&!hs.upcoming){hs.expanders[h-1]&&hs.expanders[h-1].close();typeof hs.focusKey!="undefined"&&hs.expanders[hs.focusKey]&&hs.expanders[hs.focusKey].close()}this.el=b;this.tpos=hs.getPosition(b);hs.getPageSize();var j=this.x=new hs.Dimension(this,"x");j.calcThumb();var k=this.y=new hs.Dimension(this,"y");k.calcThumb();/area/i.test(b.tagName)&&this.getImageMapAreaCorrection(b);this.wrapper=hs.createElement("div",{id:"highslide-wrapper-"+this.key,className:"highslide-wrapper "+this.wrapperClassName},{visibility:"hidden",position:"absolute",zIndex:hs.zIndexCounter+=2},null,true);this.wrapper.onmouseover=this.wrapper.onmouseout=hs.wrapperMouseHandler;if(this.contentType=="image"&&this.outlineWhileAnimating==2)this.outlineWhileAnimating=0;if(!this.outlineType||this.last&&this.isImage&&this.transitions[1]=="crossfade")this[this.contentType+"Create"]();else if(hs.pendingOutlines[this.outlineType]){this.connectOutline();this[this.contentType+"Create"]()}else{this.showLoading();var g=this;new hs.Outline(this.outlineType,function(){g.connectOutline();g[g.contentType+"Create"]()})}return true};hs.Expander.prototype={error:function(){window.location.href=this.src},connectOutline:function(){var a=this.outline=hs.pendingOutlines[this.outlineType];a.exp=this;a.table.style.zIndex=this.wrapper.style.zIndex-1;hs.pendingOutlines[this.outlineType]=null},showLoading:function(){if(this.onLoadStarted||this.loading)return;this.loading=hs.loading;var b=this;this.loading.onclick=function(){b.cancelLoading()};if(!hs.fireEvent(this,"onShowLoading"))return;var b=this,c=this.x.get("loadingPos")+"px",d=this.y.get("loadingPos")+"px";if(!a&&this.last&&this.transitions[1]=="crossfade")var a=this.last;if(a){c=a.x.get("loadingPosXfade")+"px";d=a.y.get("loadingPosXfade")+"px";this.loading.style.zIndex=hs.zIndexCounter++}setTimeout(function(){b.loading&&hs.setStyles(b.loading,{left:c,top:d,zIndex:hs.zIndexCounter++})},100)},imageCreate:function(){var b=this,a=document.createElement("img");this.content=a;a.onload=function(){hs.expanders[b.key]&&b.contentLoaded()};if(hs.blockRightClick)a.oncontextmenu=function(){return false};a.className="highslide-image";hs.setStyles(a,{visibility:"hidden",display:"block",position:"absolute",maxWidth:"9999px",zIndex:3});a.title=hs.lang.restoreTitle;hs.safari&&hs.container.appendChild(a);if(hs.ie&&hs.flushImgSize)a.src=null;a.src=this.src;this.showLoading()},htmlCreate:function(){if(!hs.fireEvent(this,"onBeforeGetContent"))return;this.content=hs.getCacheBinding(this.a);if(!this.content)this.content=hs.getNode(this.contentId);if(!this.content)this.content=hs.getSelfRendered();this.getInline(["maincontent"]);if(this.maincontent){var d=hs.getElementByClass(this.content,"div","highslide-body");d&&d.appendChild(this.maincontent);this.maincontent.style.display="block"}hs.fireEvent(this,"onAfterGetContent");var a=this.innerContent=this.content;/(swf|iframe)/.test(this.objectType)&&this.setObjContainerSize(a);hs.container.appendChild(this.wrapper);hs.setStyles(this.wrapper,{position:"static",padding:"0 "+hs.marginRight+"px 0 "+hs.marginLeft+"px"});this.content=hs.createElement("div",{className:"highslide-html"},{position:"relative",zIndex:3,overflow:"hidden"},this.wrapper);this.mediumContent=hs.createElement("div",null,null,this.content,1);this.mediumContent.appendChild(a);hs.setStyles(a,{position:"relative",display:"block",direction:hs.lang.cssDirection||""});if(this.width)a.style.width=this.width+"px";this.height&&hs.setStyles(a,{height:this.height+"px",overflow:"hidden"});if(a.offsetWidth<this.minWidth)a.style.width=this.minWidth+"px";if(this.objectType=="ajax"&&!hs.getCacheBinding(this.a)){this.showLoading();var b=new hs.Ajax(this.a,a),c=this;b.onLoad=function(){hs.expanders[c.key]&&c.contentLoaded()};b.onError=function(){location.href=c.src};b.run()}else if(this.objectType=="iframe"&&this.objectLoadTime=="before")this.writeExtendedContent();else this.contentLoaded()},contentLoaded:function(){try{if(!this.content)return;this.content.onload=null;if(this.onLoadStarted)return;else this.onLoadStarted=true;var b=this.x,c=this.y;if(this.loading){hs.setStyles(this.loading,{top:"-9999px"});this.loading=null;hs.fireEvent(this,"onHideLoading")}if(this.isImage){b.full=this.content.width;c.full=this.content.height;hs.setStyles(this.content,{width:b.t+"px",height:c.t+"px"});this.wrapper.appendChild(this.content);hs.container.appendChild(this.wrapper)}else this.htmlGetSize&&this.htmlGetSize();b.calcBorders();c.calcBorders();hs.setStyles(this.wrapper,{left:b.tpos+b.tb-b.cb+"px",top:c.tpos+b.tb-c.cb+"px"});this.initSlideshow();this.getOverlays();var g=b.full/c.full;b.calcExpanded();this.justify(b);c.calcExpanded();this.justify(c);this.isHtml&&this.htmlSizeOperations();this.overlayBox&&this.sizeOverlayBox(0,1);if(this.allowSizeReduction){if(this.isImage)this.correctRatio(g);else this.fitOverlayBox();var e=this.slideshow;if(e&&this.last&&e.controls&&e.fixedControls){var h=e.overlayOptions.position||"",a;for(var d in hs.oPos)for(var f=0;f<5;f++){a=this[d];if(h.match(hs.oPos[d][f])){a.pos=this.last[d].pos+(this.last[d].p1-a.p1)+(this.last[d].size-a.size)*([0,0,.5,1,1])[f];if(e.fixedControls=="fit"){if(a.pos+a.size+a.p1+a.p2>a.scroll+a.clientSize-a.marginMax)a.pos=a.scroll+a.clientSize-a.size-a.marginMin-a.marginMax-a.p1-a.p2;if(a.pos<a.scroll+a.marginMin)a.pos=a.scroll+a.marginMin}}}}if(this.isImage&&this.x.full>(this.x.imgSize||this.x.size)){this.createFullExpand();this.overlays.length==1&&this.sizeOverlayBox()}}this.show()}catch(i){this.error(i)}},setObjContainerSize:function(b){var a=hs.getElementByClass(b,"DIV","highslide-body");if(/(iframe|swf)/.test(this.objectType)){if(this.objectWidth)a.style.width=this.objectWidth+"px";if(this.objectHeight)a.style.height=this.objectHeight+"px"}},writeExtendedContent:function(){if(this.hasExtendedContent)return;var f=this;this.body=hs.getElementByClass(this.innerContent,"DIV","highslide-body");if(this.objectType=="iframe"){this.showLoading();var b=hs.clearing.cloneNode(1);this.body.appendChild(b);this.newWidth=this.innerContent.offsetWidth;if(!this.objectWidth)this.objectWidth=b.offsetWidth;var d=this.innerContent.offsetHeight-this.body.offsetHeight,e=this.objectHeight||hs.page.height-d-hs.marginTop-hs.marginBottom,c=this.objectLoadTime=="before"?' onload="if (hs.expanders['+this.key+"]) hs.expanders["+this.key+'].contentLoaded()" ':"";this.body.innerHTML+='<iframe name="hs'+(new Date).getTime()+'" frameborder="0" key="'+this.key+'"  allowtransparency="true" style="width:'+this.objectWidth+"px; height:"+e+'px" '+c+' src="'+this.src+'"></iframe>';this.ruler=this.body.getElementsByTagName("div")[0];this.iframe=this.body.getElementsByTagName("iframe")[0];this.objectLoadTime=="after"&&this.correctIframeSize()}if(this.objectType=="swf"){this.body.id=this.body.id||"hs-flash-id-"+this.key;var a=this.swfOptions;if(!a.params)a.params={};if(typeof a.params.wmode=="undefined")a.params.wmode="transparent";swfobject&&swfobject.embedSWF(this.src,this.body.id,this.objectWidth,this.objectHeight,a.version||"7",a.expressInstallSwfurl,a.flashvars,a.params,a.attributes)}this.hasExtendedContent=true},htmlGetSize:function(){if(this.iframe&&!this.objectHeight)this.iframe.style.height=this.body.style.height=this.getIframePageHeight()+"px";this.innerContent.appendChild(hs.clearing);if(!this.x.full)this.x.full=this.innerContent.offsetWidth;this.y.full=this.innerContent.offsetHeight;this.innerContent.removeChild(hs.clearing);if(hs.ie&&this.newHeight>parseInt(this.innerContent.currentStyle.height))this.newHeight=parseInt(this.innerContent.currentStyle.height);hs.setStyles(this.wrapper,{position:"absolute",padding:"0"});hs.setStyles(this.content,{width:this.x.t+"px",height:this.y.t+"px"})},getIframePageHeight:function(){var b;try{var a=this.iframe.contentDocument||this.iframe.contentWindow.document,c=a.createElement("div");c.style.clear="both";a.body.appendChild(c);b=c.offsetTop;if(hs.ie)b+=parseInt(a.body.currentStyle.marginTop)+parseInt(a.body.currentStyle.marginBottom)-1}catch(d){b=300}return b},correctIframeSize:function(){var a=this.innerContent.offsetWidth-this.ruler.offsetWidth;hs.discardElement(this.ruler);if(a<0)a=0;var b=this.innerContent.offsetHeight-this.iframe.offsetHeight;hs.setStyles(this.iframe,{width:Math.abs(this.x.size-a)+"px",height:Math.abs(this.y.size-b)+"px"});hs.setStyles(this.body,{width:this.iframe.style.width,height:this.iframe.style.height});this.scrollingContent=this.iframe;this.scrollerDiv=this.scrollingContent},htmlSizeOperations:function(){this.setObjContainerSize(this.innerContent);this.objectType=="swf"&&this.objectLoadTime=="before"&&this.writeExtendedContent();if(this.x.size<this.x.full&&!this.allowWidthReduction)this.x.size=this.x.full;if(this.y.size<this.y.full&&!this.allowHeightReduction)this.y.size=this.y.full;this.scrollerDiv=this.innerContent;hs.setStyles(this.mediumContent,{position:"relative",width:this.x.size+"px"});hs.setStyles(this.innerContent,{border:"none",width:"auto",height:"auto"});var a=hs.getElementByClass(this.innerContent,"DIV","highslide-body");if(a&&!/(iframe|swf)/.test(this.objectType)){var b=a;a=hs.createElement(b.nodeName,null,{overflow:"hidden"},null,true);b.parentNode.insertBefore(a,b);a.appendChild(hs.clearing);a.appendChild(b);var e=this.innerContent.offsetWidth-a.offsetWidth,d=this.innerContent.offsetHeight-a.offsetHeight;a.removeChild(hs.clearing);var c=hs.safari||navigator.vendor=="KDE"?1:0;hs.setStyles(a,{width:this.x.size-e-c+"px",height:this.y.size-d+"px",overflow:"auto",position:"relative"});if(c&&b.offsetHeight>a.offsetHeight)a.style.width=parseInt(a.style.width)+c+"px";this.scrollingContent=a;this.scrollerDiv=this.scrollingContent}this.iframe&&this.objectLoadTime=="before"&&this.correctIframeSize();if(!this.scrollingContent&&this.y.size<this.mediumContent.offsetHeight)this.scrollerDiv=this.content;if(this.scrollerDiv==this.content&&!this.allowWidthReduction&&!/(iframe|swf)/.test(this.objectType))this.x.size+=17;this.scrollerDiv&&this.scrollerDiv.offsetHeight>this.scrollerDiv.parentNode.offsetHeight&&setTimeout("try { hs.expanders["+this.key+"].scrollerDiv.style.overflow = 'auto'; } catch(e) {}",hs.expandDuration)},getImageMapAreaCorrection:function(g){for(var a=g.coords.split(","),b=0;b<a.length;b++)a[b]=parseInt(a[b]);if(g.shape.toLowerCase()=="circle"){this.x.tpos+=a[0]-a[2];this.y.tpos+=a[1]-a[2];this.x.t=this.y.t=2*a[2]}else{for(var c,d,e=c=a[0],f=d=a[1],b=0;b<a.length;b++)if(b%2==0){e=Math.min(e,a[b]);c=Math.max(c,a[b])}else{f=Math.min(f,a[b]);d=Math.max(d,a[b])}this.x.tpos+=e;this.x.t=c-e;this.y.tpos+=f;this.y.t=d-f}},justify:function(a,e){var c,b=a.target,f=a==this.x?"x":"y";if(b&&b.match(/ /)){c=b.split(" ");b=c[0]}if(b&&hs.$(b)){a.pos=hs.getPosition(hs.$(b))[f];if(c&&c[1]&&c[1].match(/^[-]?[0-9]+px$/))a.pos+=parseInt(c[1]);if(a.size<a.minSize)a.size=a.minSize}else if(a.justify=="auto"||a.justify=="center"){var g=false,d=a.exp.allowSizeReduction;if(a.justify=="center")a.pos=Math.round(a.scroll+(a.clientSize+a.marginMin-a.marginMax-a.get("wsize"))/2);else a.pos=Math.round(a.pos-(a.get("wsize")-a.t)/2);if(a.pos<a.scroll+a.marginMin){a.pos=a.scroll+a.marginMin;g=true}if(!e&&a.size<a.minSize){a.size=a.minSize;d=false}if(a.pos+a.get("wsize")>a.scroll+a.clientSize-a.marginMax)if(!e&&g&&d)a.size=a.get(f=="y"?"fitsize":"maxsize");else if(a.get("wsize")<a.get("fitsize"))a.pos=a.scroll+a.clientSize-a.marginMax-a.get("wsize");else{a.pos=a.scroll+a.marginMin;if(!e&&d)a.size=a.get(f=="y"?"fitsize":"maxsize")}if(!e&&a.size<a.minSize){a.size=a.minSize;d=false}}else if(a.justify=="max")a.pos=Math.floor(a.pos-a.size+a.t);if(a.pos<a.marginMin){var h=a.pos;a.pos=a.marginMin;if(d&&!e)a.size=a.size-(a.pos-h)}},correctRatio:function(d){var b=this.x,a=this.y,f=false,c=Math.min(b.full,b.size),e=Math.min(a.full,a.size),g=this.useBox||hs.padToMinWidth;if(c/e>d){c=e*d;if(c<b.minSize){c=b.minSize;e=c/d}f=true}else if(c/e<d){e=c/d;f=true}if(hs.padToMinWidth&&b.full<b.minSize){b.imgSize=b.full;a.size=a.imgSize=a.full}else if(this.useBox){b.imgSize=c;a.imgSize=e}else{b.size=c;a.size=e}this.fitOverlayBox(g?null:d);if(g&&a.size<a.imgSize){a.imgSize=a.size;b.imgSize=a.size*d}if(f||g){b.pos=b.tpos-b.cb+b.tb;b.minSize=b.size;this.justify(b,true);a.pos=a.tpos-a.cb+a.tb;a.minSize=a.size;this.justify(a,true);this.overlayBox&&this.sizeOverlayBox()}},fitOverlayBox:function(b){var c=this.x,a=this.y;if(this.overlayBox)while(a.size>this.minHeight&&c.size>this.minWidth&&a.get("wsize")>a.get("fitsize")){a.size-=10;if(b)c.size=a.size*b;this.sizeOverlayBox(0,1)}},reflow:function(){if(this.scrollerDiv){var a=/iframe/i.test(this.scrollerDiv.tagName)?this.getIframePageHeight()+1+"px":"auto";if(this.body)this.body.style.height=a;this.scrollerDiv.style.height=a;this.y.setSize(this.innerContent.offsetHeight);hs.setDimmerSize(this)}},show:function(){var a=this.x,b=this.y;this.doShowHide("hidden");hs.fireEvent(this,"onBeforeExpand");this.slideshow&&this.slideshow.thumbstrip&&this.slideshow.thumbstrip.selectThumb();this.changeSize(1,{wrapper:{width:a.get("wsize"),height:b.get("wsize"),left:a.pos,top:b.pos},content:{left:a.p1+a.get("imgPad"),top:b.p1+b.get("imgPad"),width:a.imgSize||a.size,height:b.imgSize||b.size}},hs.expandDuration)},changeSize:function(b,g,j){var f=this.transitions,i=b?this.last?this.last.a:null:hs.upcoming,h=f[1]&&i&&hs.getParam(i,"transitions")[1]==f[1]?f[1]:f[0];if(this[h]&&h!="expand"){this[h](b,g);return}if(this.outline&&!this.outlineWhileAnimating)if(b)this.outline.setPosition();else this.outline.destroy(this.isHtml&&this.preserveContent);!b&&this.destroyOverlays();var a=this,c=a.x,d=a.y,e=this.easing;if(!b)e=this.easingClose||e;var k=b?function(){if(a.outline)a.outline.table.style.visibility="visible";setTimeout(function(){a.afterExpand()},50)}:function(){a.afterClose()};b&&hs.setStyles(this.wrapper,{width:c.t+"px",height:d.t+"px"});b&&this.isHtml&&hs.setStyles(this.wrapper,{left:c.tpos-c.cb+c.tb+"px",top:d.tpos-d.cb+d.tb+"px"});if(this.fadeInOut){hs.setStyles(this.wrapper,{opacity:b?0:1});hs.extend(g.wrapper,{opacity:b})}hs.animate(this.wrapper,g.wrapper,{duration:j,easing:e,step:function(g,e){if(a.outline&&a.outlineWhileAnimating&&e.prop=="top"){var f=b?e.pos:1-e.pos,h={w:c.t+(c.get("wsize")-c.t)*f,h:d.t+(d.get("wsize")-d.t)*f,x:c.tpos+(c.pos-c.tpos)*f,y:d.tpos+(d.pos-d.tpos)*f};a.outline.setPosition(h,0,1)}if(a.isHtml){if(e.prop=="left")a.mediumContent.style.left=c.pos-g+"px";if(e.prop=="top")a.mediumContent.style.top=d.pos-g+"px"}}});hs.animate(this.content,g.content,j,e,k);if(b){this.wrapper.style.visibility="visible";this.content.style.visibility="visible";if(this.isHtml)this.innerContent.style.visibility="visible";this.a.className+=" highslide-active-anchor"}},fade:function(b,i){this.outlineWhileAnimating=false;var a=this,d=b?hs.expandDuration:0;if(b){hs.animate(this.wrapper,i.wrapper,0);hs.setStyles(this.wrapper,{opacity:0,visibility:"visible"});hs.animate(this.content,i.content,0);this.content.style.visibility="visible";hs.animate(this.wrapper,{opacity:1},d,null,function(){a.afterExpand()})}if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex;for(var e=b||-1,h=this.outline.offset,f=b?3:h,g=b?h:3,c=f;e*c<=e*g;c+=e,d+=25)(function(){var e=b?g-c:f-c;setTimeout(function(){a.outline.setPosition(0,e,1)},d)})()}!b&&setTimeout(function(){a.outline&&a.outline.destroy(a.preserveContent);a.destroyOverlays();hs.animate(a.wrapper,{opacity:0},hs.restoreDuration,null,function(){a.afterClose()})},d)},crossfade:function(t,s){if(!t)return;var e=this,j=hs.transitionDuration,f=e.last,a=e.x,b=e.y,c=f.x,d=f.y,g=e.overlayBox,i=this.wrapper,l=this.content;hs.removeEventListener(document,"mousemove",hs.dragHandler);this.outline=f.outline;if(this.outline)this.outline.exp=e;f.outline=null;f.wrapper.style.overflow="hidden";hs.setStyles(i,{left:c.pos+"px",top:d.pos+"px",width:c.get("wsize")+"px",height:d.get("wsize")+"px"});hs.setStyles(l,{display:"none",width:(a.imgSize||a.size)+"px",height:(b.imgSize||b.size)+"px",left:a.p1+a.get("imgPad")+"px",top:b.p1+b.get("imgPad")+"px"});var h=hs.createElement("div",{className:"highslide-image"},{position:"absolute",zIndex:4,overflow:"hidden",display:"none",left:c.p1+c.get("imgPad")+"px",top:d.p1+d.get("imgPad")+"px",width:(c.imgSize||c.size)+"px",height:(d.imgSize||d.size)+"px"});this.isHtml&&hs.setStyles(this.mediumContent,{left:0,top:0});for(var m=0;m<this.overlays.length;m++){var p=hs.$("hsId"+this.overlays[m]);if(p.style.visibility=="hidden")p.style.display="none"}g&&hs.setStyles(g,{overflow:"visible",left:c.p1+c.cb+"px",top:d.p1+d.cb+"px",width:c.size+"px",height:d.size+"px"});var o={oldImg:f,newImg:this};for(var k in o){this[k]=o[k].content.cloneNode(1);hs.setStyles(this[k],{position:"absolute",border:0,visibility:"visible"});h.appendChild(this[k])}hs.setStyles(this.oldImg,{left:0,top:0});hs.setStyles(this.newImg,{display:"block",opacity:0,left:a.pos-c.pos+a.p1-c.p1+a.get("imgPad")-c.get("imgPad")+"px",top:b.pos-d.pos+b.p1-d.p1+b.get("imgPad")-d.get("imgPad")+"px"});i.appendChild(h);if(g){g.className="";i.appendChild(g)}h.style.display="";f.content.style.display="none";if(hs.safari){var n=navigator.userAgent.match(/Safari\/([0-9]{3})/);if(n&&parseInt(n[1])<525)i.style.visibility="visible"}function r(){i.style.visibility=l.style.visibility="visible";l.style.display="block";h.style.display="none";e.a.className+=" highslide-active-anchor";e.afterExpand();f.afterClose();e.last=null}hs.animate(f.wrapper,{left:a.pos,top:b.pos,width:a.get("wsize"),height:b.get("wsize")},j);hs.animate(h,{width:a.imgSize||a.size,height:b.imgSize||b.size,left:a.p1+a.get("imgPad"),top:b.p1+b.get("imgPad")},j);hs.animate(this.oldImg,{left:c.pos-a.pos+c.p1-a.p1+c.get("imgPad")-a.get("imgPad"),top:d.pos-b.pos+d.p1-b.p1+d.get("imgPad")-b.get("imgPad")},j);hs.animate(this.newImg,{opacity:1,left:0,top:0},j);g&&hs.animate(g,{left:a.p1+a.cb,top:b.p1+b.cb,width:a.size,height:b.size},j);if(this.outline)var q=function(d,b){if(b.prop=="top"){var a=e.wrapper.style,c={w:parseInt(a.width),h:parseInt(a.height),x:parseInt(a.left),y:parseInt(a.top)};e.outline.setPosition(c)}};hs.animate(i,s.wrapper,{duration:j,complete:r,step:q});h.style.visibility="visible"},reuseOverlay:function(c){if(!this.last)return false;for(var a=0;a<this.last.overlays.length;a++){var b=hs.$("hsId"+this.last.overlays[a]);if(b&&b.hsId==c.hsId){this.genOverlayBox();b.reuse=this.key;hs.push(this.overlays,this.last.overlays[a]);return true}}return false},afterExpand:function(){this.isExpanded=true;this.focus();this.isHtml&&this.objectLoadTime=="after"&&this.writeExtendedContent();if(this.iframe){try{var a=this,e=this.iframe.contentDocument||this.iframe.contentWindow.document;hs.addEventListener(e,"mousedown",function(){hs.focusKey!=a.key&&a.focus()})}catch(f){}if(hs.ie&&typeof this.isClosing!="boolean")this.iframe.style.width=this.objectWidth-1+"px"}this.dimmingOpacity&&hs.dim(this);if(hs.upcoming&&hs.upcoming==this.a)hs.upcoming=null;this.prepareNextOutline();var d=hs.page,b=hs.mouse.x+d.scrollLeft,c=hs.mouse.y+d.scrollTop;this.mouseIsOver=this.x.pos<b&&b<this.x.pos+this.x.get("wsize")&&this.y.pos<c&&c<this.y.pos+this.y.get("wsize");this.overlayBox&&this.showOverlays();hs.fireEvent(this,"onAfterExpand")},prepareNextOutline:function(){var b=this.key,a=this.outlineType;new hs.Outline(a,function(){try{hs.expanders[b].preloadNext()}catch(a){}})},preloadNext:function(){var a=this.getAdjacentAnchor(1);if(a&&a.onclick.toString().match(/hs\.expand/))var b=hs.createElement("img",{src:hs.getSrc(a)})},getAdjacentAnchor:function(b){var c=this.getAnchorIndex(),a=hs.anchors.groups[this.slideshowGroup||"none"];if(!a[c+b]&&this.slideshow&&this.slideshow.repeat)if(b==1)return a[0];else if(b==-1)return a[a.length-1];return a[c+b]||null},getAnchorIndex:function(){var b=hs.getAnchors().groups[this.slideshowGroup||"none"];if(b)for(var a=0;a<b.length;a++)if(b[a]==this.a)return a;return null},getNumber:function(){if(this[this.numberPosition]){var a=hs.anchors.groups[this.slideshowGroup||"none"];if(a){var b=hs.lang.number.replace("%1",this.getAnchorIndex()+1).replace("%2",a.length);this[this.numberPosition].innerHTML='<div class="highslide-number">'+b+"</div>"+this[this.numberPosition].innerHTML}}},initSlideshow:function(){if(!this.last)for(var c=0;c<hs.slideshows.length;c++){var a=hs.slideshows[c],b=a.slideshowGroup;if(typeof b=="undefined"||b===null||b===this.slideshowGroup)this.slideshow=new hs.Slideshow(this.key,a)}else this.slideshow=this.last.slideshow;var a=this.slideshow;if(!a)return;var e=a.expKey=this.key;a.checkFirstAndLast();a.disable("full-expand");if(a.controls){var d=a.overlayOptions||{};d.overlayId=a.controls;d.hsId="controls";this.createOverlay(d)}a.thumbstrip&&a.thumbstrip.add(this);!this.last&&this.autoplay&&a.play(true);if(a.autoplay)a.autoplay=setTimeout(function(){hs.next(e)},a.interval||500)},cancelLoading:function(){hs.discardElement(this.wrapper);hs.expanders[this.key]=null;if(hs.upcoming==this.a)hs.upcoming=null;hs.undim(this.key);if(this.loading)hs.loading.style.left="-9999px";hs.fireEvent(this,"onHideLoading")},writeCredits:function(){if(this.credits)return;this.credits=hs.createElement("a",{href:hs.creditsHref,target:hs.creditsTarget,className:"highslide-credits",innerHTML:hs.lang.creditsText,title:hs.lang.creditsTitle});this.createOverlay({overlayId:this.credits,position:this.creditsPosition||"top left",hsId:"credits"})},getInline:function(f,h){for(var d=0;d<f.length;d++){var a=f[d],b=null;if(a=="caption"&&!hs.fireEvent(this,"onBeforeGetCaption"))return;else if(a=="heading"&&!hs.fireEvent(this,"onBeforeGetHeading"))return;if(!this[a+"Id"]&&this.thumbsUserSetId)this[a+"Id"]=a+"-for-"+this.thumbsUserSetId;if(this[a+"Id"])this[a]=hs.getNode(this[a+"Id"]);if(!this[a]&&!this[a+"Text"]&&this[a+"Eval"])try{b=eval(this[a+"Eval"])}catch(i){}if(!this[a]&&this[a+"Text"])b=this[a+"Text"];if(!this[a]&&!b){var c=this.a.nextSibling;while(c&&!hs.isHsAnchor(c)){if(new RegExp("highslide-"+a).test(c.className||null)){this[a]=c.cloneNode(1);break}c=c.nextSibling}}if(!this[a]&&!b&&this.numberPosition==a)b="\n";if(!this[a]&&b)this[a]=hs.createElement("div",{className:"highslide-"+a,innerHTML:b});if(h&&this[a]){var e={position:a=="heading"?"above":"below"};for(var g in this[a+"Overlay"])e[g]=this[a+"Overlay"][g];e.overlayId=this[a];this.createOverlay(e)}}},doShowHide:function(a){hs.hideSelects&&this.showHideElements("SELECT",a);hs.hideIframes&&this.showHideElements("IFRAME",a);hs.geckoMac&&this.showHideElements("*",a)},showHideElements:function(h,g){for(var b=document.getElementsByTagName(h),e=h=="*"?"overflow":"visibility",a=0;a<b.length;a++)if(e=="visibility"||document.defaultView.getComputedStyle(b[a],"").getPropertyValue("overflow")=="auto"||b[a].getAttribute("hidden-by")!=null){var c=b[a].getAttribute("hidden-by");if(g=="visible"&&c){c=c.replace("["+this.key+"]","");b[a].setAttribute("hidden-by",c);if(!c)b[a].style[e]=b[a].origProp}else if(g=="hidden"){var d=hs.getPosition(b[a]);d.w=b[a].offsetWidth;d.h=b[a].offsetHeight;if(!this.dimmingOpacity)var i=d.x+d.w<this.x.get("opos")||d.x>this.x.get("opos")+this.x.get("osize"),j=d.y+d.h<this.y.get("opos")||d.y>this.y.get("opos")+this.y.get("osize");var f=hs.getWrapperKey(b[a]);if(!i&&!j&&f!=this.key)if(!c){b[a].setAttribute("hidden-by","["+this.key+"]");b[a].origProp=b[a].style[e];b[a].style[e]="hidden"}else c.indexOf("["+this.key+"]")==-1&&b[a].setAttribute("hidden-by",c+"["+this.key+"]");else if((c=="["+this.key+"]"||hs.focusKey==f)&&f!=this.key){b[a].setAttribute("hidden-by","");b[a].style[e]=b[a].origProp||""}else c&&c.indexOf("["+this.key+"]")>-1&&b[a].setAttribute("hidden-by",c.replace("["+this.key+"]",""))}}},focus:function(){this.wrapper.style.zIndex=hs.zIndexCounter+=2;for(var b=0;b<hs.expanders.length;b++)if(hs.expanders[b]&&b==hs.focusKey){var a=hs.expanders[b];a.content.className+=" highslide-"+a.contentType+"-blur";if(a.isImage){a.content.style.cursor=hs.ie?"hand":"pointer";a.content.title=hs.lang.focusTitle}hs.fireEvent(a,"onBlur")}if(this.outline)this.outline.table.style.zIndex=this.wrapper.style.zIndex-1;this.content.className="highslide-"+this.contentType;if(this.isImage){this.content.title=hs.lang.restoreTitle;if(hs.restoreCursor){hs.styleRestoreCursor=window.opera?"pointer":"url("+hs.graphicsDir+hs.restoreCursor+"), pointer";if(hs.ie&&hs.uaVersion<6)hs.styleRestoreCursor="hand";this.content.style.cursor=hs.styleRestoreCursor}}hs.focusKey=this.key;hs.addEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);hs.fireEvent(this,"onFocus")},moveTo:function(a,b){this.x.setPos(a);this.y.setPos(b)},resize:function(a){var b,c,d=a.width/a.height;b=Math.max(a.width+a.dX,Math.min(this.minWidth,this.x.full));if(this.isImage&&Math.abs(b-this.x.full)<12)b=this.x.full;c=this.isHtml?a.height+a.dY:b/d;if(c<Math.min(this.minHeight,this.y.full)){c=Math.min(this.minHeight,this.y.full);if(this.isImage)b=c*d}this.resizeTo(b,c)},resizeTo:function(b,a){this.y.setSize(a);this.x.setSize(b)},close:function(){if(this.isClosing||!this.isExpanded)return;if(this.transitions[1]=="crossfade"&&hs.upcoming){hs.getExpander(hs.upcoming).cancelLoading();hs.upcoming=null}if(!hs.fireEvent(this,"onBeforeClose"))return;this.isClosing=true;this.slideshow&&!hs.upcoming&&this.slideshow.pause();hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{this.isHtml&&this.htmlPrepareClose();this.content.style.cursor="default";this.changeSize(0,{wrapper:{width:this.x.t,height:this.y.t,left:this.x.tpos-this.x.cb+this.x.tb,top:this.y.tpos-this.y.cb+this.y.tb},content:{left:0,top:0,width:this.x.t,height:this.y.t}},hs.restoreDuration)}catch(a){this.afterClose()}},htmlPrepareClose:function(){if(hs.geckoMac){if(!hs.mask)hs.mask=hs.createElement("div",null,{position:"absolute"},hs.container);hs.setStyles(hs.mask,{width:this.x.size+"px",height:this.y.size+"px",left:this.x.pos+"px",top:this.y.pos+"px",display:"block"})}if(this.objectType=="swf")try{hs.$(this.body.id).StopPlay()}catch(a){}this.objectLoadTime=="after"&&!this.preserveContent&&this.destroyObject();if(this.scrollerDiv&&this.scrollerDiv!=this.scrollingContent)this.scrollerDiv.style.overflow="hidden"},destroyObject:function(){if(hs.ie&&this.iframe)try{this.iframe.contentWindow.document.body.innerHTML=""}catch(a){}this.objectType=="swf"&&swfobject.removeSWF(this.body.id);this.body.innerHTML=""},sleep:function(){if(this.outline)this.outline.table.style.display="none";this.releaseMask=null;this.wrapper.style.display="none";hs.push(hs.sleeping,this)},awake:function(){try{hs.expanders[this.key]=this;if(!hs.allowMultipleInstances&&hs.focusKey!=this.key)try{hs.expanders[hs.focusKey].close()}catch(d){}var c=hs.zIndexCounter++,a={display:"",zIndex:c};hs.setStyles(this.wrapper,a);this.isClosing=false;var b=this.outline||0;if(b){if(!this.outlineWhileAnimating)a.visibility="hidden";hs.setStyles(b.table,a)}this.slideshow&&this.initSlideshow();this.show()}catch(d){}},createOverlay:function(a){var b=a.overlayId,d=a.relativeTo=="viewport"&&!/panel$/.test(a.position);if(typeof b=="string")b=hs.getNode(b);if(a.html)b=hs.createElement("div",{innerHTML:a.html});if(!b||typeof b=="string")return;if(!hs.fireEvent(this,"onCreateOverlay",{overlay:b}))return;b.style.display="block";a.hsId=a.hsId||a.overlayId;if(this.transitions[1]=="crossfade"&&this.reuseOverlay(a,b))return;this.genOverlayBox();var e=a.width&&/^[0-9]+(px|%)$/.test(a.width)?a.width:"auto";if(/^(left|right)panel$/.test(a.position)&&!/^[0-9]+px$/.test(a.width))e="200px";var c=hs.createElement("div",{id:"hsId"+hs.idCounter++,hsId:a.hsId},{position:"absolute",visibility:"hidden",width:e,direction:hs.lang.cssDirection||"",opacity:0},d?hs.viewport:this.overlayBox,true);if(d)c.hsKey=this.key;c.appendChild(b);hs.extend(c,{opacity:1,offsetX:0,offsetY:0,dur:a.fade===0||a.fade===false||a.fade==2&&hs.ie?0:250});hs.extend(c,a);if(this.gotOverlays){this.positionOverlay(c);(!c.hideOnMouseOut||this.mouseIsOver)&&hs.animate(c,{opacity:c.opacity},c.dur)}hs.push(this.overlays,hs.idCounter-1)},positionOverlay:function(a){var b=a.position||"middle center",e=a.relativeTo=="viewport",c=a.offsetX,d=a.offsetY;if(e){hs.viewport.style.display="block";a.hsKey=this.key;if(a.offsetWidth>a.parentNode.offsetWidth)a.style.width="100%"}else a.parentNode!=this.overlayBox&&this.overlayBox.appendChild(a);if(/left$/.test(b))a.style.left=c+"px";/center$/.test(b)&&hs.setStyles(a,{left:"50%",marginLeft:c-Math.round(a.offsetWidth/2)+"px"});if(/right$/.test(b))a.style.right=-c+"px";if(/^leftpanel$/.test(b)){hs.setStyles(a,{right:"100%",marginRight:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p1=a.offsetWidth}else if(/^rightpanel$/.test(b)){hs.setStyles(a,{left:"100%",marginLeft:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"});this.x.p2=a.offsetWidth}var f=a.parentNode.offsetHeight;a.style.height="auto";if(e&&a.offsetHeight>f)a.style.height=hs.ieLt7?f+"px":"100%";if(/^top/.test(b))a.style.top=d+"px";/^middle/.test(b)&&hs.setStyles(a,{top:"50%",marginTop:d-Math.round(a.offsetHeight/2)+"px"});if(/^bottom/.test(b))a.style.bottom=-d+"px";if(/^above$/.test(b)){hs.setStyles(a,{left:-this.x.p1-this.x.cb+"px",right:-this.x.p2-this.x.cb+"px",bottom:"100%",marginBottom:this.y.cb+"px",width:"auto"});this.y.p1=a.offsetHeight}else if(/^below$/.test(b)){hs.setStyles(a,{position:"relative",left:-this.x.p1-this.x.cb+"px",right:-this.x.p2-this.x.cb+"px",top:"100%",marginTop:this.y.cb+"px",width:"auto"});this.y.p2=a.offsetHeight;a.style.position="absolute"}},getOverlays:function(){this.getInline(["heading","caption"],true);this.getNumber();this.caption&&hs.fireEvent(this,"onAfterGetCaption");this.heading&&hs.fireEvent(this,"onAfterGetHeading");if(this.heading&&this.dragByHeading)this.heading.className+=" highslide-move";hs.showCredits&&this.writeCredits();for(var a=0;a<hs.overlays.length;a++){var b=hs.overlays[a],c=b.thumbnailId,e=b.slideshowGroup;if(!c&&!e||c&&c==this.thumbsUserSetId||e&&e===this.slideshowGroup)(this.isImage||this.isHtml&&b.useOnHtml)&&this.createOverlay(b)}for(var d=[],a=0;a<this.overlays.length;a++){var b=hs.$("hsId"+this.overlays[a]);if(/panel$/.test(b.position))this.positionOverlay(b);else hs.push(d,b)}for(var a=0;a<d.length;a++)this.positionOverlay(d[a]);this.gotOverlays=true},genOverlayBox:function(){if(!this.overlayBox)this.overlayBox=hs.createElement("div",{className:this.wrapperClassName},{position:"absolute",width:(this.x.size||(this.useBox?this.width:null)||this.x.full)+"px",height:(this.y.size||this.y.full)+"px",visibility:"hidden",overflow:"hidden",zIndex:hs.ie?4:null},hs.container,true)},sizeOverlayBox:function(f,h){var c=this.overlayBox,d=this.x,b=this.y;hs.setStyles(c,{width:d.size+"px",height:b.size+"px"});if(f||h)for(var e=0;e<this.overlays.length;e++){var a=hs.$("hsId"+this.overlays[e]),g=hs.ieLt7||document.compatMode=="BackCompat";if(a&&/^(above|below)$/.test(a.position)){if(g)a.style.width=c.offsetWidth+2*d.cb+d.p1+d.p2+"px";b[a.position=="above"?"p1":"p2"]=a.offsetHeight}if(a&&g&&/^(left|right)panel$/.test(a.position))a.style.height=c.offsetHeight+2*b.cb+"px"}if(f){hs.setStyles(this.content,{top:b.p1+"px"});hs.setStyles(c,{top:b.p1+b.cb+"px"})}},showOverlays:function(){var b=this.overlayBox;b.className="";hs.setStyles(b,{top:this.y.p1+this.y.cb+"px",left:this.x.p1+this.x.cb+"px",overflow:"visible"});if(hs.safari)b.style.visibility="visible";this.wrapper.appendChild(b);for(var c=0;c<this.overlays.length;c++){var a=hs.$("hsId"+this.overlays[c]);a.style.zIndex=a.hsId=="controls"?5:4;if(!a.hideOnMouseOut||this.mouseIsOver){a.style.visibility="visible";hs.setStyles(a,{visibility:"visible",display:""});hs.animate(a,{opacity:a.opacity},a.dur)}}},destroyOverlays:function(){if(!this.overlays.length)return;for(var b=0;b<this.overlays.length;b++){var c=hs.$("hsId"+this.overlays[b]);c.parentNode==hs.viewport&&hs.discardElement(c)}if(this.slideshow){var a=this.slideshow.controls;a&&hs.getExpander(a)==this&&a.parentNode.removeChild(a)}if(this.isHtml&&this.preserveContent){this.overlayBox.style.top="-9999px";hs.container.appendChild(this.overlayBox)}else hs.discardElement(this.overlayBox)},createFullExpand:function(){if(this.slideshow&&this.slideshow.controls){this.slideshow.enable("full-expand");return}this.fullExpandLabel=hs.createElement("a",{href:"javascript:hs.expanders["+this.key+"].doFullExpand();",title:hs.lang.fullExpandTitle,className:"highslide-full-expand"});if(!hs.fireEvent(this,"onCreateFullExpand"))return;this.createOverlay({overlayId:this.fullExpandLabel,position:hs.fullExpandPosition,hideOnMouseOut:true,opacity:hs.fullExpandOpacity})},doFullExpand:function(){try{if(!hs.fireEvent(this,"onDoFullExpand"))return;this.fullExpandLabel&&hs.discardElement(this.fullExpandLabel);this.focus();var b=this.x.size;this.resizeTo(this.x.full,this.y.full);var a=this.x.pos-(this.x.size-b)/2;if(a<hs.marginLeft)a=hs.marginLeft;this.moveTo(a,this.y.pos);this.doShowHide("hidden");hs.setDimmerSize(this)}catch(c){this.error(c)}},afterClose:function(){this.a.className=this.a.className.replace("highslide-active-anchor","");this.doShowHide("visible");if(this.isHtml&&this.preserveContent&&this.transitions[1]!="crossfade")this.sleep();else{this.outline&&this.outlineWhileAnimating&&this.outline.destroy();hs.discardElement(this.wrapper)}if(hs.mask)hs.mask.style.display="none";if(!hs.viewport.childNodes.length)hs.viewport.style.display="none";this.dimmingOpacity&&hs.undim(this.key);hs.fireEvent(this,"onAfterClose");hs.expanders[this.key]=null;hs.reOrder()}};hs.Ajax=function(c,a,b){this.a=c;this.content=a;this.pre=b};hs.Ajax.prototype={run:function(){if(!this.src)this.src=hs.getSrc(this.a);if(this.src.match("#")){var c=this.src.split("#");this.src=c[0];this.id=c[1]}if(hs.cachedGets[this.src]){this.cachedGet=hs.cachedGets[this.src];if(this.id)this.getElementContent();else this.loadHTML();return}try{this.xmlHttp=new XMLHttpRequest}catch(d){try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){this.onError()}}}var a=this;this.xmlHttp.onreadystatechange=function(){if(a.xmlHttp.readyState==4)if(a.id)a.getElementContent();else a.loadHTML()};var b=this.src;if(hs.forceAjaxReload)b=b.replace(/$/,(/\?/.test(b)?"&":"?")+"dummy="+(new Date).getTime());this.xmlHttp.open("GET",b,true);this.xmlHttp.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.xmlHttp.send(null)},getElementContent:function(){hs.init();var a=window.opera||hs.ie6SSL?{src:"about:blank"}:null;this.iframe=hs.createElement("iframe",a,{position:"absolute",top:"-9999px"},hs.container);this.loadHTML()},loadHTML:function(){var a=this.cachedGet||this.xmlHttp.responseText;if(this.pre)hs.cachedGets[this.src]=a;if(!hs.ie||hs.uaVersion>=5.5){a=a.replace(/\s/g," ").replace(new RegExp("<link[^>]*>","gi"),"").replace(new RegExp("<script[^>]*>.*?<\/script>","gi"),"");if(this.iframe){var b=this.iframe.contentDocument;if(!b&&this.iframe.contentWindow)b=this.iframe.contentWindow.document;if(!b){var c=this;setTimeout(function(){c.loadHTML()},25);return}b.open();b.write(a);b.close();try{a=b.getElementById(this.id).innerHTML}catch(e){try{a=this.iframe.document.getElementById(this.id).innerHTML}catch(e){}}hs.discardElement(this.iframe)}else a=a.replace(new RegExp("^.*?<body[^>]*>(.*?)</body>.*?$","i"),"$1")}hs.getElementByClass(this.content,"DIV","highslide-body").innerHTML=a;this.onLoad();for(var d in this)this[d]=null}};hs.Slideshow=function(c,a){hs.dynamicallyUpdateAnchors!==false&&hs.updateAnchors();this.expKey=c;for(var b in a)this[b]=a[b];this.useControls&&this.getControls();if(this.thumbstrip)this.thumbstrip=hs.Thumbstrip(this)};hs.Slideshow.prototype={getControls:function(){this.controls=hs.createElement("div",{innerHTML:hs.replaceLang(hs.skin.controls)},null,hs.container);var b=["play","pause","previous","next","move","full-expand","close"];this.btn={};for(var c=this,a=0;a<b.length;a++){this.btn[b[a]]=hs.getElementByClass(this.controls,"li","highslide-"+b[a]);this.enable(b[a])}this.btn.pause.style.display="none"},checkFirstAndLast:function(){if(this.repeat||!this.controls)return;var b=hs.expanders[this.expKey],a=b.getAnchorIndex(),c=/disabled$/;if(a==0)this.disable("previous");else c.test(this.btn.previous.getElementsByTagName("a")[0].className)&&this.enable("previous");if(a+1==hs.anchors.groups[b.slideshowGroup||"none"].length){this.disable("next");this.disable("play")}else if(c.test(this.btn.next.getElementsByTagName("a")[0].className)){this.enable("next");this.enable("play")}},enable:function(b){if(!this.btn)return;var d=this,a=this.btn[b].getElementsByTagName("a")[0],c=/disabled$/;a.onclick=function(){d[b]();return false};if(c.test(a.className))a.className=a.className.replace(c,"")},disable:function(b){if(!this.btn)return;var a=this.btn[b].getElementsByTagName("a")[0];a.onclick=function(){return false};if(!/disabled$/.test(a.className))a.className+=" disabled"},hitSpace:function(){if(this.autoplay)this.pause();else this.play()},play:function(a){if(this.btn){this.btn.play.style.display="none";this.btn.pause.style.display=""}this.autoplay=true;!a&&hs.next(this.expKey)},pause:function(){if(this.btn){this.btn.pause.style.display="none";this.btn.play.style.display=""}clearTimeout(this.autoplay);this.autoplay=null},previous:function(){this.pause();hs.previous(this.btn.previous)},next:function(){this.pause();hs.next(this.btn.next)},move:function(){},"full-expand":function(){hs.getExpander().doFullExpand()},close:function(){hs.close(this.btn.close)}};hs.Thumbstrip=function(h){function t(a){hs.extend(e||{},{overlayId:c,hsId:"thumbstrip"});if(hs.ieLt7)e.fade=0;a.createOverlay(e);hs.setStyles(c.parentNode,{overflow:"hidden"})}function i(b){l(undefined,Math.round(b*c[a?"offsetWidth":"offsetHeight"]*.7))}function l(d,w){if(d===undefined)for(var e=0;e<g.length;e++)if(g[e]==hs.expanders[h.expKey].a){d=e;break}if(d===undefined)return;var i=c.getElementsByTagName("a"),x=i[d],k=x.parentNode,z=a?"Left":"Top",B=a?"Right":"Bottom",y=a?"Width":"Height",l="offset"+z,f="offset"+y,q=r.parentNode.parentNode[f],s=q-j[f],n=parseInt(j.style[a?"left":"top"])||0,b=n,A=20;if(w!==undefined){b=n-w;if(b>0)b=0;if(b<s)b=s}else{for(var e=0;e<i.length;e++)i[e].className="";x.className="highslide-active-anchor";var u=d>0?i[d-1].parentNode[l]:k[l],t=k[l]+k[f]+(i[d+1]?i[d+1].parentNode[f]:0);if(t>q-n)b=q-t;else if(u<-n)b=-u}var v=k[l]+(k[f]-p[f])/2+b;hs.animate(j,a?{left:b}:{top:b},null,"easeOutQuad");hs.animate(p,a?{left:v}:{top:v},null,"easeOutQuad");o.style.display=b<0?"block":"none";m.style.display=b>s?"block":"none"}for(var g=hs.anchors.groups[hs.expanders[h.expKey].slideshowGroup||"none"],e=h.thumbstrip,k=e.mode||"horizontal",n=k=="float",b=n?["div","ul","li","span"]:["table","tbody","tr","td"],a=k=="horizontal",c=hs.createElement("div",{className:"highslide-thumbstrip highslide-thumbstrip-"+k,innerHTML:'<div class="highslide-thumbstrip-inner"><'+b[0]+"><"+b[1]+"></"+b[1]+"></"+b[0]+'></div><div class="highslide-scroll-up"><div></div></div><div class="highslide-scroll-down"><div></div></div><div class="highslide-marker"><div></div></div>'},{display:"none"},hs.container),f=c.childNodes,r=f[0],o=f[1],m=f[2],p=f[3],j=r.firstChild,q=c.getElementsByTagName(b[1])[0],s,d=0;d<g.length;d++){if(d==0||!a)s=hs.createElement(b[2],null,null,q);(function(){var a=g[d],c=hs.createElement(b[3],null,null,s),e=d;hs.createElement("a",{href:a.href,onclick:function(){hs.getExpander(this).focus();return hs.transit(a)},innerHTML:hs.stripItemFormatter?hs.stripItemFormatter(a):a.innerHTML},null,c)})()}if(!n){o.onclick=function(){i(-1)};m.onclick=function(){i(1)};hs.addEventListener(q,document.onmousewheel!==undefined?"mousewheel":"DOMMouseScroll",function(a){var b=0;a=a||window.event;if(a.wheelDelta){b=a.wheelDelta/120;if(hs.opera)b=-b}else if(a.detail)b=-a.detail/3;b&&i(-b*.2);a.preventDefault&&a.preventDefault();a.returnValue=false})}return{add:t,selectThumb:l}};hs.ie&&(function(){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,50);return}hs.ready()})();hs.addEventListener(document,"DOMContentLoaded",hs.ready);hs.addEventListener(window,"load",hs.ready);hs.langDefaults=hs.lang;var HsExpander=hs.Expander;hs.addEventListener(window,"load",function(){if(hs.expandCursor){var c=".highslide img",b="cursor: url("+hs.graphicsDir+hs.expandCursor+"), pointer !important;",d=hs.createElement("style",{type:"text/css"},null,document.getElementsByTagName("HEAD")[0]);if(!hs.ie)d.appendChild(document.createTextNode(c+" {"+b+"}"));else{var a=document.styleSheets[document.styleSheets.length-1];typeof a.addRule=="object"&&a.addRule(c,b)}}});hs.addEventListener(window,"resize",function(){hs.getPageSize();if(hs.viewport)for(var b=0;b<hs.viewport.childNodes.length;b++){var a=hs.viewport.childNodes[b],c=hs.getExpander(a);c.positionOverlay(a);a.hsId=="thumbstrip"&&c.slideshow.thumbstrip.selectThumb()}});hs.addEventListener(document,"mousemove",function(a){hs.mouse={x:a.clientX,y:a.clientY}});hs.addEventListener(document,"mousedown",hs.mouseClickHandler);hs.addEventListener(document,"mouseup",hs.mouseClickHandler);hs.addEventListener(document,"ready",hs.setClickEvents);hs.addEventListener(window,"load",hs.preloadImages);hs.addEventListener(window,"load",hs.preloadAjax);(function(a){var i,p,q,d,w,g,x,j,v,t,m=0,c={},k=[],l=0,b={},h=[],z=null,r=new Image,B=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,M=/[^\.]\.(swf)\s*$/i,C,D=1,s=0,o="",n,f,e=false,u=a.extend(a("<div/>")[0],{prop:0}),E=a.browser.msie&&a.browser.version<7&&!window.XMLHttpRequest,F=function(){p.hide();r.onerror=r.onload=null;z&&z.abort();i.empty()},G=function(){if(false===c.onError(k,m,c)){p.hide();e=false}else{c.titleShow=false;c.width="auto";c.height="auto";i.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');y()}},A=function(){var b=k[m],d,h,l,j,n,f;F();c=a.extend({},a.fn.fancybox.defaults,typeof a(b).data("fancybox")=="undefined"?c:a(b).data("fancybox"));f=c.onStart(k,m,c);if(f===false)e=false;else{if(typeof f=="object")c=a.extend(c,f);l=c.title||(b.nodeName?a(b).attr("title"):b.title)||"";if(b.nodeName&&!c.orig)c.orig=a(b).children("img:first").length?a(b).children("img:first"):a(b);if(l===""&&c.orig&&c.titleFromAlt)l=c.orig.attr("alt");d=c.href||(b.nodeName?a(b).attr("href"):b.href)||null;if(/^(?:javascript)/i.test(d)||d=="#")d=null;if(c.type){h=c.type;if(!d)d=c.content}else if(c.content)h="html";else if(d)h=d.match(B)?"image":d.match(M)?"swf":a(b).hasClass("iframe")?"iframe":d.indexOf("#")===0?"inline":"ajax";if(h){if(h=="inline"){b=d.substr(d.indexOf("#"));h=a(b).length>0?"inline":"ajax"}c.type=h;c.href=d;c.title=l;if(c.autoDimensions&&c.type!=="iframe"&&c.type!=="swf"){c.width="auto";c.height="auto"}if(c.modal){c.overlayShow=true;c.hideOnOverlayClick=false;c.hideOnContentClick=false;c.enableEscapeButton=false;c.showCloseButton=false}c.padding=parseInt(c.padding,10);c.margin=parseInt(c.margin,10);i.css("padding",c.padding+c.margin);a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(g.children())});switch(h){case"html":i.html(c.content);y();break;case"inline":if(a(b).parent().is("#fancybox-content")===true){e=false;break}a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(b)).bind("fancybox-cleanup",function(){a(this).replaceWith(g.children())}).bind("fancybox-cancel",function(){a(this).replaceWith(i.children())});a(b).appendTo(i);y();break;case"image":e=false;a.fancybox.showActivity();r=new Image;r.onerror=function(){G()};r.onload=function(){e=true;r.onerror=r.onload=null;c.width=r.width;c.height=r.height;a("<img />").attr({id:"fancybox-img",src:r.src,alt:c.title}).appendTo(i);H()};r.src=d;break;case"swf":c.scrolling="no";c.autoDimensions=false;j='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+c.width+'" height="'+c.height+'"><param name="movie" value="'+d+'"></param>';n="";a.each(c.swf,function(b,a){j+='<param name="'+b+'" value="'+a+'"></param>';n+=" "+b+'="'+a+'"'});j+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+c.width+'" height="'+c.height+'"'+n+"></embed></object>";i.html(j);y();break;case"ajax":e=false;a.fancybox.showActivity();c.ajax.win=c.ajax.success;z=a.ajax(a.extend({},c.ajax,{url:d,data:c.ajax.data||{},error:function(a){a.status>0&&G()},success:function(b,e,a){if((typeof a=="object"?a:z).status==200){if(typeof c.ajax.win=="function"){f=c.ajax.win(d,b,e,a);if(f===false){p.hide();return}else if(typeof f=="string"||typeof f=="object")b=f}i.html(b);y()}}}));break;case"iframe":c.autoDimensions=false;H()}}else G()}},y=function(){i.wrapInner('<div style="width:'+(c.width=="auto"?"auto":c.width+"px")+";height:"+(c.height=="auto"?"auto":c.height+"px")+";overflow: "+(c.scrolling=="auto"?"auto":c.scrolling=="yes"?"scroll":"hidden")+'"></div>');c.width=i.width();c.height=i.height();H()},H=function(){var r,y;p.hide();if(d.is(":visible")&&false===b.onCleanup(h,l,b)){a.event.trigger("fancybox-cancel");e=false}else{e=true;a(g.add(q)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");d.is(":visible")&&b.titlePosition!=="outside"&&d.css("height",d.height());h=k;l=m;b=c;if(b.overlayShow){q.css({"background-color":b.overlayColor,opacity:b.overlayOpacity,cursor:b.hideOnOverlayClick?"pointer":"auto",height:a(document).height()});if(!q.is(":visible")){E&&a("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});q.show()}}else q.hide();f=N();o=b.title||"";s=0;j.empty().removeAttr("style").removeClass();if(b.titleShow!==false){if(a.isFunction(b.titleFormat))r=b.titleFormat(o,h,l,b);else r=o&&o.length?b.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+o+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+b.titlePosition+'">'+o+"</div>":false;o=r;if(!(!o||o==="")){j.addClass("fancybox-title-"+b.titlePosition).html(o).appendTo("body").show();switch(b.titlePosition){case"inside":j.css({width:f.width-b.padding*2,marginLeft:b.padding,marginRight:b.padding});s=j.outerHeight(true);j.appendTo(w);f.height+=s;break;case"over":j.css({marginLeft:b.padding,width:f.width-b.padding*2,bottom:b.padding}).appendTo(w);break;case"float":j.css("left",parseInt((j.width()-f.width-40)/2,10)*-1).appendTo(d);break;default:j.css({width:f.width-b.padding*2,paddingLeft:b.padding,paddingRight:b.padding}).appendTo(d)}}}j.hide();if(d.is(":visible")){a(x.add(v).add(t)).hide();r=d.position();n={top:r.top,left:r.left,width:d.width(),height:d.height()};y=n.width==f.width&&n.height==f.height;g.fadeTo(b.changeFade,.3,function(){var d=function(){g.html(i.contents()).fadeTo(b.changeFade,1,I)};a.event.trigger("fancybox-change");g.empty().removeAttr("filter").css({"border-width":b.padding,width:f.width-b.padding*2,height:c.autoDimensions?"auto":f.height-s-b.padding*2});if(y)d();else{u.prop=0;a(u).animate({prop:1},{duration:b.changeSpeed,easing:b.easingChange,step:J,complete:d})}})}else{d.removeAttr("style");g.css("border-width",b.padding);if(b.transitionIn=="elastic"){n=L();g.html(i.contents());d.show();if(b.opacity)f.opacity=0;u.prop=0;a(u).animate({prop:1},{duration:b.speedIn,easing:b.easingIn,step:J,complete:I})}else{b.titlePosition=="inside"&&s>0&&j.show();g.css({width:f.width-b.padding*2,height:c.autoDimensions?"auto":f.height-s-b.padding*2}).html(i.contents());d.css(f).fadeIn(b.transitionIn=="none"?0:b.speedIn,I)}}}},O=function(){(b.enableEscapeButton||b.enableKeyboardNav)&&a(document).bind("keydown.fb",function(c){if(c.keyCode==27&&b.enableEscapeButton){c.preventDefault();a.fancybox.close()}else if((c.keyCode==37||c.keyCode==39)&&b.enableKeyboardNav&&c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.target.tagName!=="SELECT"){c.preventDefault();a.fancybox[c.keyCode==37?"prev":"next"]()}});if(b.showNavArrows){(b.cyclic&&h.length>1||l!==0)&&v.show();(b.cyclic&&h.length>1||l!=h.length-1)&&t.show()}else{v.hide();t.hide()}},I=function(){if(!a.support.opacity){g.get(0).style.removeAttribute("filter");d.get(0).style.removeAttribute("filter")}if(c.autoDimensions){d.css("height","auto");g.css("height","auto")}o&&o.length&&j.show();b.showCloseButton&&x.show();O();b.hideOnContentClick&&g.bind("click",a.fancybox.close);b.hideOnOverlayClick&&q.bind("click",a.fancybox.close);a(window).bind("resize.fb",a.fancybox.resize);b.centerOnScroll&&a(window).bind("scroll.fb",a.fancybox.center);b.type=="iframe"&&a('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(a.browser.msie?'allowtransparency="true""':"")+' scrolling="'+c.scrolling+'" src="'+b.href+'"></iframe>').appendTo(g);d.show();e=false;a.fancybox.center();b.onComplete(h,l,b);var f,i;if(h.length-1>l){f=h[l+1].href;if(typeof f!=="undefined"&&f.match(B)){i=new Image;i.src=f}}if(l>0){f=h[l-1].href;if(typeof f!=="undefined"&&f.match(B)){i=new Image;i.src=f}}},J=function(a){var c={width:parseInt(n.width+(f.width-n.width)*a,10),height:parseInt(n.height+(f.height-n.height)*a,10),top:parseInt(n.top+(f.top-n.top)*a,10),left:parseInt(n.left+(f.left-n.left)*a,10)};if(typeof f.opacity!=="undefined")c.opacity=a<.5?.5:a;d.css(c);g.css({width:c.width-b.padding*2,height:c.height-s*a-b.padding*2})},K=function(){return[a(window).width()-b.margin*2,a(window).height()-b.margin*2,a(document).scrollLeft()+b.margin,a(document).scrollTop()+b.margin]},N=function(){var d=K(),a={},f=b.autoScale,e=b.padding*2;a.width=b.width.toString().indexOf("%")>-1?parseInt(d[0]*parseFloat(b.width)/100,10):b.width+e;a.height=b.height.toString().indexOf("%")>-1?parseInt(d[1]*parseFloat(b.height)/100,10):b.height+e;if(f&&(a.width>d[0]||a.height>d[1]))if(c.type=="image"||c.type=="swf"){f=b.width/b.height;if(a.width>d[0]){a.width=d[0];a.height=parseInt((a.width-e)/f+e,10)}if(a.height>d[1]){a.height=d[1];a.width=parseInt((a.height-e)*f+e,10)}}else{a.width=Math.min(a.width,d[0]);a.height=Math.min(a.height,d[1])}a.top=parseInt(Math.max(d[3]-20,d[3]+(d[1]-a.height-40)*.5),10);a.left=parseInt(Math.max(d[2]-20,d[2]+(d[0]-a.width-40)*.5),10);return a},L=function(){var d=c.orig?a(c.orig):false,e={};if(d&&d.length){e=d.offset();e.top+=parseInt(d.css("paddingTop"),10)||0;e.left+=parseInt(d.css("paddingLeft"),10)||0;e.top+=parseInt(d.css("border-top-width"),10)||0;e.left+=parseInt(d.css("border-left-width"),10)||0;e.width=d.width();e.height=d.height();e={width:e.width+b.padding*2,height:e.height+b.padding*2,top:e.top-b.padding-20,left:e.left-b.padding-20}}else{d=K();e={width:b.padding*2,height:b.padding*2,top:parseInt(d[3]+d[1]*.5,10),left:parseInt(d[2]+d[0]*.5,10)}}return e},P=function(){if(p.is(":visible")){a("div",p).css("top",D*-40+"px");D=(D+1)%12}else clearInterval(C)};a.fn.fancybox=function(b){if(!a(this).length)return this;a(this).data("fancybox",a.extend({},b,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(b){b.preventDefault();if(!e){e=true;a(this).blur();k=[];m=0;b=a(this).attr("rel")||"";if(!b||b==""||b==="nofollow")k.push(this);else{k=a("a[rel="+b+"], area[rel="+b+"]");m=k.index(this)}A()}});return this};a.fancybox=function(b,f){var d;if(!e){e=true;d=typeof f!=="undefined"?f:{};k=[];m=parseInt(d.index,10)||0;if(a.isArray(b)){for(var c=0,g=b.length;c<g;c++)if(typeof b[c]=="object")a(b[c]).data("fancybox",a.extend({},d,b[c]));else b[c]=a({}).data("fancybox",a.extend({content:b[c]},d));k=jQuery.merge(k,b)}else{if(typeof b=="object")a(b).data("fancybox",a.extend({},d,b));else b=a({}).data("fancybox",a.extend({content:b},d));k.push(b)}if(m>k.length||m<0)m=0;A()}};a.fancybox.showActivity=function(){clearInterval(C);p.show();C=setInterval(P,66)};a.fancybox.hideActivity=function(){p.hide()};a.fancybox.next=function(){return a.fancybox.pos(l+1)};a.fancybox.prev=function(){return a.fancybox.pos(l-1)};a.fancybox.pos=function(a){if(!e){a=parseInt(a);k=h;if(a>-1&&a<h.length){m=a;A()}else if(b.cyclic&&h.length>1){m=a>=h.length?0:h.length-1;A()}}};a.fancybox.cancel=function(){if(!e){e=true;a.event.trigger("fancybox-cancel");F();c.onCancel(k,m,c);e=false}};a.fancybox.close=function(){function i(){q.fadeOut("fast");j.empty().hide();d.hide();a.event.trigger("fancybox-cleanup");g.empty();b.onClosed(h,l,b);h=c=[];l=m=0;b=c={};e=false}if(!(e||d.is(":hidden"))){e=true;if(b&&false===b.onCleanup(h,l,b))e=false;else{F();a(x.add(v).add(t)).hide();a(g.add(q)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");g.find("iframe").attr("src",E&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");b.titlePosition!=="inside"&&j.empty();d.stop();if(b.transitionOut=="elastic"){n=L();var k=d.position();f={top:k.top,left:k.left,width:d.width(),height:d.height()};if(b.opacity)f.opacity=1;j.empty().hide();u.prop=1;a(u).animate({prop:0},{duration:b.speedOut,easing:b.easingOut,step:J,complete:i})}else d.fadeOut(b.transitionOut=="none"?0:b.speedOut,i)}}};a.fancybox.resize=function(){q.is(":visible")&&q.css("height",a(document).height());a.fancybox.center(true)};a.fancybox.center=function(c){var a,f;if(!e){f=c===true?1:0;a=K();!f&&(d.width()>a[0]||d.height()>a[1])||d.stop().animate({top:parseInt(Math.max(a[3]-20,a[3]+(a[1]-g.height()-40)*.5-b.padding)),left:parseInt(Math.max(a[2]-20,a[2]+(a[0]-g.width()-40)*.5-b.padding))},typeof c=="number"?c:200)}};a.fancybox.init=function(){if(!a("#fancybox-wrap").length){a("body").append(i=a('<div id="fancybox-tmp"></div>'),p=a('<div id="fancybox-loading"><div></div></div>'),q=a('<div id="fancybox-overlay"></div>'),d=a('<div id="fancybox-wrap"></div>'));w=a('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(d);w.append(g=a('<div id="fancybox-content"></div>'),x=a('<a id="fancybox-close"></a>'),j=a('<div id="fancybox-title"></div>'),v=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),t=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));x.click(a.fancybox.close);p.click(a.fancybox.cancel);v.click(function(b){b.preventDefault();a.fancybox.prev()});t.click(function(b){b.preventDefault();a.fancybox.next()});a.fn.mousewheel&&d.bind("mousewheel.fb",function(c,d){(e||b.type=="image")&&c.preventDefault();a.fancybox[d>0?"prev":"next"]()});a.support.opacity||d.addClass("fancybox-ie");if(E){p.addClass("fancybox-ie6");d.addClass("fancybox-ie6");a('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(w)}}};a.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};a(document).ready(function(){a.fancybox.init()})})(jQuery);(function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},h=0,c=0,l=[];function g(e,d,g,i){var c={data:i||(d?d.data:{}),_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};e&&a.extend(c,e,{nodes:[],parent:d});if(g){c.tmpl=g;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++h;(l.length?f:b)[h]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h<m;h++){c=h;k=(h>0?this.clone(true):this).get();a.fn[d].apply(a(i[h]),k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,k,j){if(d[0]&&d[0].nodeType){var f=a.makeArray(arguments),g=d.length,i=0,h;while(i<g&&!(h=a.data(d[i++],"tmplItem")));if(g>1)f[0]=[a.makeArray(d)];if(h&&c)f[2]=function(b){a.tmpl.afterManip(this,b,j)};r.apply(this,f)}else r.apply(this,arguments);c=0;!e&&a.tmpl.complete(b);return this}});a.extend({tmpl:function(d,h,e,c){var j,k=!c;if(k){c=p;d=a.template[d]||a.template(null,d);f={}}else if(!d){d=c.tmpl;b[c.key]=c;c.nodes=[];c.wrapped&&n(c,c.wrapped);return a(i(c,null,c.tmpl(a,c)))}if(!d)return[];if(typeof h==="function")h=h.call(c||{});e&&e.wrapped&&n(e,e.wrapped);j=a.isArray(h)?a.map(h,function(a){return a?g(e,c,d,a):null}):[g(e,c,d,h)];return k?a(i(c,null,j)):j},tmplItem:function(b){var c;if(b instanceof a)b=b[0];while(b&&b.nodeType===1&&!(c=a.data(b,"tmplItem"))&&(b=b.parentNode));return c||p},template:function(c,b){if(b){if(typeof b==="string")b=o(b);else if(b instanceof a)b=b[0]||{};if(b.nodeType)b=a.data(b,"tmpl")||a.data(b,"tmpl",o(b.innerHTML));return typeof c==="string"?a.template[c]=b:b}return c?typeof c!=="string"?a.template(null,c):a.template[c]||a.template(null,q.test(c)?c:a(c)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function i(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:i(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=j(c).concat(b);if(d)b=b.concat(j(d))});return b?b:j(c)}function j(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;with($data){_.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,j,d,b,c,e){var i=a.tmpl.tag[j],h,f,g;if(!i)throw"Template command not found: "+j;h=i._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=k(b);e=e?","+k(e)+")":c?")":"";f=c?b.indexOf(".")>-1?b+c:"("+b+").call($item"+e:b;g=c?f:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else g=f=h.$1||"null";d=k(d);return"');"+i[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined' && ("+b+")!=null":"true").split("$1a").join(g).split("$1").join(f).split("$2").join(d?d.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,function(d,c,b,a){a=a?","+a+")":b?")":"";return a?"("+c+").call($item"+a:d}):h.$2||"")+"_.push('"})+"');}return _;")}function n(c,b){c._wrap=i(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function k(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,i;for(e=0,p=o.length;e<p;e++){if((k=o[e]).nodeType!==1)continue;j=k.getElementsByTagName("*");for(i=j.length-1;i>=0;i--)m(j[i]);m(k)}function m(j){var p,i=j,k,e,m;if(m=j.getAttribute(d)){while(i.parentNode&&(i=i.parentNode).nodeType===1&&!(p=i.getAttribute(d)));if(p!==m){i=i.parentNode?i.nodeType===11?0:i.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[i]||f[i],null,true);e.key=++h;b[h]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;i=a.data(j.parentNode,"tmplItem");i=i?i.key:0}if(e){k=e;while(k&&k.key!=i){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent,null,true)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery);var EidsivaKontaktOssServiceUri="/Services/Eidsiva/KontaktOssService.asmx/";jQuery(function(){jQuery("#KontaktOss_kategori").change(function(){GetKontaktOssForms(jQuery(this).val())});jQuery("#KontaktOss_skjema").change(function(){GetKontaktOssForm(jQuery(this).val())});jQuery("#KontaktOss_form .Submit").click(function(){SendKontaktOssForm();return false});jQuery("#KontaktOss_ShowFieldsButton").click(function(){jQuery("#KontaktOss_formButton").hide();jQuery("#KontaktOss_form").show();return false});jQuery("#KontaktOss_kategori").length>0&&jQuery.ajax({type:"POST",url:EidsivaKontaktOssServiceUri+"Categories",contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){var b=jQuery.parseJSON(a.d);jQuery("#KontaktOss_kategori").append(jQuery("<option>Velg kategori</option>").val(-1));jQuery(b).each(function(b,a){jQuery("#KontaktOss_kategori").append(jQuery("<option></option>").val(a.PageId).html(a.Name))})},error:function(){}});var a=function(b){var a=RegExp(b+"=(.+?)(&|$)").exec(location.search);return a!=null?decodeURI(a[1]):null},b=a("category"),c=a("form");if(b!=null&&c!=null){GetKontaktOssForms(b);GetKontaktOssForm(c)}});function GetKontaktOssForms(a){if(a!=-1){var b={categoryId:a};jQuery("#KontaktOss_kategoriLoader").show();jQuery.ajax({type:"POST",url:EidsivaKontaktOssServiceUri+"Forms",data:JSON.stringify(b),contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){var c=jQuery.parseJSON(b.d);jQuery("#KontaktOss_skjema").html("");jQuery("#KontaktOss_skjema").append(jQuery("<option>Velg underkategori</option>").val(-1));jQuery(c).each(function(b,a){jQuery("#KontaktOss_skjema").append(jQuery("<option></option>").val(a.Id).html(a.Name))});jQuery("#KontaktOss_skjema").attr("disabled","");jQuery("#KontaktOss_kategori").val(a);jQuery("#KontaktOss_kategoriLoader").hide()},error:function(){jQuery("#KontaktOss_kategoriLoader").hide()}})}}function GetKontaktOssForm(a){if(a!=-1){var b={formId:a};jQuery("#KontaktOss_skjemaLoader").show();jQuery.ajax({type:"POST",url:EidsivaKontaktOssServiceUri+"Form",data:JSON.stringify(b),contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){var c=jQuery.parseJSON(b.d);PopulateKontaktOssForm(c);jQuery("#KontaktOss_skjemaLoader").hide();jQuery("#KontaktOss_skjema").val(a)},error:function(){jQuery("#KontaktOss_skjemaLoader").hide()}})}}function PopulateKontaktOssForm(a){jQuery("#KontaktOss_Name").html(a.Name);jQuery("#KontaktOss_FormId").val(a.Id);var c=jQuery(a.Description),b=jQuery(".kontaktOssForm_skjemaKnapp",c);if(b.length>0){var d=jQuery('<div class="outerButton"><div class="Submit"></div>');jQuery(".Submit",d).text(b.text());b.replaceWith(d)}jQuery("#KontaktOss_Description").html(c);if(a.Fields.length>0){if(a.ShowFieldsButton){jQuery("#KontaktOss_form").hide();jQuery("#KontaktOss_formButton").show()}else{jQuery("#KontaktOss_form").show();jQuery("#KontaktOss_formButton").hide()}jQuery(".submit .outerButton input").attr("disabled","");jQuery("#KontaktOss_ErrorMessage").hide();jQuery("#KontaktOss_form .formElements").html("");jQuery(a.Fields).each(function(b,a){if(a.Type=="text")jQuery("#KontaktOssTemplate_Text").tmpl(a).appendTo("#KontaktOss_form .formElements");else if(a.Type=="textarea")jQuery("#KontaktOssTemplate_TextArea").tmpl(a).appendTo("#KontaktOss_form .formElements");else a.Type=="email"&&jQuery("#KontaktOssTemplate_Email").tmpl(a).appendTo("#KontaktOss_form .formElements")})}else jQuery("#KontaktOss_form").hide()}function SendKontaktOssForm(){var a=true;jQuery(".formElements .entry").each(function(i,b){var d=true,c=jQuery(".KontaktOssElement",b).val(),e=jQuery(".KontaktOssElement",b).attr("data-orginalvalue"),f=jQuery(".info.validate-required",b).length>0;if(f&&(c.trim()===""||c===e)){jQuery(".info.validate-required",b).slideDown();a=false;d=false}else jQuery(".info.validate-required",b).slideUp();var h=jQuery(".info.validate-regex",b).length>0;if(h&&d==true){var g=new RegExp(jQuery(".info.validate-regex",b).attr("data-regex"));if(!g.test(c)){jQuery(".info.validate-regex",b).slideDown();a=false}else jQuery(".info.validate-regex",b).slideUp()}});if(!a){jQuery("#KontaktOss_ErrorMessage").show().text("Skjemaet inneholder feil");return}jQuery.fancybox(jQuery("#KontaktOssFrame").html(),{overlayShow:true,hideOnOverlayClick:false,width:400,height:200,transitionOut:"none",autoDimensions:false,showCloseButton:false,speedIn:0});var c=jQuery("#KontaktOss_FormId").val(),b={Id:c,Fields:[]};jQuery(".KontaktOssElement").each(function(d,a){var c={Name:jQuery(a).attr("name"),Value:jQuery(a).val()};b.Fields.push(c)});jQuery.ajax({type:"POST",url:EidsivaKontaktOssServiceUri+"SendForm",data:JSON.stringify({form:b}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(){jQuery.fancybox(jQuery("#KontaktOssFrameSuccess").html(),{overlayShow:true,hideOnOverlayClick:false,width:400,height:200,transitionIn:"none",autoDimensions:false,showCloseButton:false});jQuery(".submit .outerButton").addClass("disabled");jQuery("#KontaktOss_form .submit").hide();jQuery("#KontaktOss_form input, #KontaktOss_form textarea").attr("disabled","disabled");jQuery("#KontaktOss_ErrorMessage").hide();jQuery("#KontaktOss_CompleteMessage").show();setTimeout(function(){jQuery.fancybox.close()},1500)},error:function(){jQuery.fancybox(jQuery("#KontaktOssFrameFailure").html(),{overlayShow:true,hideOnOverlayClick:false,width:400,height:200,transitionIn:"none",autoDimensions:false,showCloseButton:false});setTimeout(function(){jQuery.fancybox.close();jQuery("#KontaktOss_ErrorMessage").show().text("Ukjent feil")},1500)}})}
