﻿//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjax.js
Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c<e;c++)d[c]=arguments[c];d[e]=a;return b.apply(this,d)}return b.call(this,a)}};Function.createDelegate=function(a,b){return function(){return b.apply(a,arguments)}};Function.emptyFunction=Function.emptyMethod=function(){};Function._validateParams=function(e,c){var a;a=Function._validateParameterCount(e,c);if(a){a.popStackFrame();return a}for(var b=0;b<e.length;b++){var d=c[Math.min(b,c.length-1)],f=d.name;if(d.parameterArray)f+="["+(b-c.length+1)+"]";a=Function._validateParameter(e[b],d,f);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(e,a){var c=a.length,d=0;for(var b=0;b<a.length;b++)if(a[b].parameterArray)c=Number.MAX_VALUE;else if(!a[b].optional)d++;if(e.length<d||e.length>c){var f=Error.parameterCount();f.popStackFrame();return f}return null};Function._validateParameter=function(c,a,h){var b,g=a.type,l=!!a.integer,k=!!a.domElement,m=!!a.mayBeNull;b=Function._validateParameterType(c,g,l,k,m,h);if(b){b.popStackFrame();return b}var e=a.elementType,f=!!a.elementMayBeNull;if(g===Array&&typeof c!=="undefined"&&c!==null&&(e||!f)){var j=!!a.elementInteger,i=!!a.elementDomElement;for(var d=0;d<c.length;d++){var n=c[d];b=Function._validateParameterType(n,e,j,i,f,h+"["+d+"]");if(b){b.popStackFrame();return b}}}return null};Function._validateParameterType=function(a,c,n,m,k,d){var b;if(typeof a==="undefined")if(k)return null;else{b=Error.argumentUndefined(d);b.popStackFrame();return b}if(a===null)if(k)return null;else{b=Error.argumentNull(d);b.popStackFrame();return b}if(c&&c.__enum){if(typeof a!=="number"){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(a%1===0){var e=c.prototype;if(!c.__flags||a===0){for(var i in e)if(e[i]===a)return null}else{var l=a;for(var i in e){var f=e[i];if(f===0)continue;if((f&a)===f)l-=f;if(l===0)return null}}}b=Error.argumentOutOfRange(d,a,String.format(Sys.Res.enumInvalidValue,a,c.getName()));b.popStackFrame();return b}if(m){var h;if(typeof a.nodeType!=="number"){var g=a.ownerDocument||a.document||a;if(g!=a){var j=g.defaultView||g.parentWindow;h=j!=a&&!(j.document&&a.document&&j.document===a.document)}else h=typeof g.body==="undefined"}else h=a.nodeType===3;if(h){b=Error.argument(d,Sys.Res.argumentDomElement);b.popStackFrame();return b}}if(c&&!c.isInstanceOfType(a)){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(c===Number&&n)if(a%1!==0){b=Error.argumentOutOfRange(d,a,Sys.Res.argumentInteger);b.popStackFrame();return b}return null};Error.__typeName="Error";Error.__class=true;Error.create=function(d,b){var a=new Error(d);a.message=d;if(b)for(var c in b)a[c]=b[c];a.popStackFrame();return a};Error.argument=function(a,c){var b="Sys.ArgumentException: "+(c?c:Sys.Res.argument);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentException",paramName:a});d.popStackFrame();return d};Error.argumentNull=function(a,c){var b="Sys.ArgumentNullException: "+(c?c:Sys.Res.argumentNull);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentNullException",paramName:a});d.popStackFrame();return d};Error.argumentOutOfRange=function(c,a,d){var b="Sys.ArgumentOutOfRangeException: "+(d?d:Sys.Res.argumentOutOfRange);if(c)b+="\n"+String.format(Sys.Res.paramName,c);if(typeof a!=="undefined"&&a!==null)b+="\n"+String.format(Sys.Res.actualValue,a);var e=Error.create(b,{name:"Sys.ArgumentOutOfRangeException",paramName:c,actualValue:a});e.popStackFrame();return e};Error.argumentType=function(d,c,b,e){var a="Sys.ArgumentTypeException: ";if(e)a+=e;else if(c&&b)a+=String.format(Sys.Res.argumentTypeWithTypes,c.getName(),b.getName());else a+=Sys.Res.argumentType;if(d)a+="\n"+String.format(Sys.Res.paramName,d);var f=Error.create(a,{name:"Sys.ArgumentTypeException",paramName:d,actualType:c,expectedType:b});f.popStackFrame();return f};Error.argumentUndefined=function(a,c){var b="Sys.ArgumentUndefinedException: "+(c?c:Sys.Res.argumentUndefined);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentUndefinedException",paramName:a});d.popStackFrame();return d};Error.format=function(a){var c="Sys.FormatException: "+(a?a:Sys.Res.format),b=Error.create(c,{name:"Sys.FormatException"});b.popStackFrame();return b};Error.invalidOperation=function(a){var c="Sys.InvalidOperationException: "+(a?a:Sys.Res.invalidOperation),b=Error.create(c,{name:"Sys.InvalidOperationException"});b.popStackFrame();return b};Error.notImplemented=function(a){var c="Sys.NotImplementedException: "+(a?a:Sys.Res.notImplemented),b=Error.create(c,{name:"Sys.NotImplementedException"});b.popStackFrame();return b};Error.parameterCount=function(a){var c="Sys.ParameterCountException: "+(a?a:Sys.Res.parameterCount),b=Error.create(c,{name:"Sys.ParameterCountException"});b.popStackFrame();return b};Error.prototype.popStackFrame=function(){if(typeof this.stack==="undefined"||this.stack===null||typeof this.fileName==="undefined"||this.fileName===null||typeof this.lineNumber==="undefined"||this.lineNumber===null)return;var a=this.stack.split("\n"),c=a[0],e=this.fileName+":"+this.lineNumber;while(typeof c!=="undefined"&&c!==null&&c.indexOf(e)===-1){a.shift();c=a[0]}var d=a[1];if(typeof d==="undefined"||d===null)return;var b=d.match(/@(.*):(\d+)$/);if(typeof b==="undefined"||b===null)return;this.fileName=b[1];this.lineNumber=parseInt(b[2]);a.shift();this.stack=a.join("\n")};Object.__typeName="Object";Object.__class=true;Object.getType=function(b){var a=b.constructor;if(!a||typeof a!=="function"||!a.__typeName||a.__typeName==="Object")return Object;return a};Object.getTypeName=function(a){return Object.getType(a).getName()};String.__typeName="String";String.__class=true;String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a};String.prototype.startsWith=function(a){return this.substr(0,a.length)===a};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.trimEnd=function(){return this.replace(/\s+$/,"")};String.prototype.trimStart=function(){return this.replace(/^\s+/,"")};String.format=function(){return String._toFormattedString(false,arguments)};String.localeFormat=function(){return String._toFormattedString(true,arguments)};String._toFormattedString=function(l,j){var c="",e=j[0];for(var a=0;true;){var f=e.indexOf("{",a),d=e.indexOf("}",a);if(f<0&&d<0){c+=e.slice(a);break}if(d>0&&(d<f||f<0)){c+=e.slice(a,d+1);a=d+2;continue}c+=e.slice(a,f);a=f+1;if(e.charAt(a)==="{"){c+="{";a++;continue}if(d<0)break;var h=e.substring(a,d),g=h.indexOf(":"),k=parseInt(g<0?h:h.substring(0,g),10)+1,i=g<0?"":h.substring(g+1),b=j[k];if(typeof b==="undefined"||b===null)b="";if(b.toFormattedString)c+=b.toFormattedString(i);else if(l&&b.localeFormat)c+=b.localeFormat(i);else if(b.format)c+=b.format(i);else c+=b.toString();a=d+1}return c};Boolean.__typeName="Boolean";Boolean.__class=true;Boolean.parse=function(b){var a=b.trim().toLowerCase();if(a==="false")return false;if(a==="true")return true};Date.__typeName="Date";Date.__class=true;Date._appendPreOrPostMatch=function(e,b){var d=0,a=false;for(var c=0,g=e.length;c<g;c++){var f=e.charAt(c);switch(f){case "'":if(a)b.append("'");else d++;a=false;break;case "\\":if(a)b.append("\\");a=!a;break;default:b.append(f);a=false}}return d};Date._expandFormat=function(a,b){if(!b)b="F";if(b.length===1)switch(b){case "d":return a.ShortDatePattern;case "D":return a.LongDatePattern;case "t":return a.ShortTimePattern;case "T":return a.LongTimePattern;case "F":return a.FullDateTimePattern;case "M":case "m":return a.MonthDayPattern;case "s":return a.SortableDateTimePattern;case "Y":case "y":return a.YearMonthPattern;default:throw Error.format(Sys.Res.formatInvalidString)}return b};Date._expandYear=function(c,a){if(a<100){var b=(new Date).getFullYear();a+=b-b%100;if(a>c.Calendar.TwoDigitYearMax)return a-100}return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(g,c,h){var e=false;for(var a=1,i=h.length;a<i;a++){var f=h[a];if(f){e=true;var b=Date._parseExact(g,f,c);if(b)return b}}if(!e){var d=c._getDateTimeFormats();for(var a=0,i=d.length;a<i;a++){var b=Date._parseExact(g,d[a],c);if(b)return b}}return null};Date._parseExact=function(s,y,j){s=s.trim();var m=j.dateTimeFormat,v=Date._getParseRegExp(m,y),x=(new RegExp(v.regExp)).exec(s);if(x===null)return null;var w=v.groups,f=null,c=null,h=null,g=null,d=0,n=0,o=0,e=0,k=null,r=false;for(var p=0,z=w.length;p<z;p++){var a=x[p+1];if(a)switch(w[p]){case "dd":case "d":h=parseInt(a,10);if(h<1||h>31)return null;break;case "MMMM":c=j._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=j._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":var c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":f=Date._expandYear(m,parseInt(a,10));if(f<0||f>9999)return null;break;case "yyyy":f=parseInt(a,10);if(f<0||f>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":n=parseInt(a,10);if(n<0||n>59)return null;break;case "s":case "ss":o=parseInt(a,10);if(o<0||o>59)return null;break;case "tt":case "t":var u=a.toUpperCase();r=u===m.PMDesignator.toUpperCase();if(!r&&u!==m.AMDesignator.toUpperCase())return null;break;case "f":e=parseInt(a,10)*100;if(e<0||e>999)return null;break;case "ff":e=parseInt(a,10)*10;if(e<0||e>999)return null;break;case "fff":e=parseInt(a,10);if(e<0||e>999)return null;break;case "dddd":g=j._getDayIndex(a);if(g<0||g>6)return null;break;case "ddd":g=j._getAbbrDayIndex(a);if(g<0||g>6)return null;break;case "zzz":var q=a.split(/:/);if(q.length!==2)return null;var i=parseInt(q[0],10);if(i<-12||i>13)return null;var l=parseInt(q[1],10);if(l<0||l>59)return null;k=i*60+(a.startsWith("-")?-l:l);break;case "z":case "zz":var i=parseInt(a,10);if(i<-12||i>13)return null;k=i*60}}var b=new Date;if(f===null)f=b.getFullYear();if(c===null)c=b.getMonth();if(h===null)h=b.getDate();b.setFullYear(f,c,h);if(b.getDate()!==h)return null;if(g!==null&&b.getDay()!==g)return null;if(r&&d<12)d+=12;b.setHours(d,n,o,e);if(k!==null){var t=b.getMinutes()-(k+b.getTimezoneOffset());b.setHours(b.getHours()+parseInt(t/60,10),t%60)}return b};Date.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Date.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Date.prototype._toFormattedString=function(e,h){if(!e||e.length===0||e==="i")if(h&&h.name.length>0)return this.toLocaleString();else return this.toString();var d=h.dateTimeFormat;e=Date._expandFormat(d,e);var a=new Sys.StringBuilder,b;function c(a){if(a<10)return "0"+a;return a.toString()}function g(a){if(a<10)return "00"+a;if(a<100)return "0"+a;return a.toString()}var j=0,i=Date._getTokenRegExp();for(;true;){var l=i.lastIndex,f=i.exec(e),k=e.slice(l,f?f.index:e.length);j+=Date._appendPreOrPostMatch(k,a);if(!f)break;if(j%2===1){a.append(f[0]);continue}switch(f[0]){case "dddd":a.append(d.DayNames[this.getDay()]);break;case "ddd":a.append(d.AbbreviatedDayNames[this.getDay()]);break;case "dd":a.append(c(this.getDate()));break;case "d":a.append(this.getDate());break;case "MMMM":a.append(d.MonthNames[this.getMonth()]);break;case "MMM":a.append(d.AbbreviatedMonthNames[this.getMonth()]);break;case "MM":a.append(c(this.getMonth()+1));break;case "M":a.append(this.getMonth()+1);break;case "yyyy":a.append(this.getFullYear());break;case "yy":a.append(c(this.getFullYear()%100));break;case "y":a.append(this.getFullYear()%100);break;case "hh":b=this.getHours()%12;if(b===0)b=12;a.append(c(b));break;case "h":b=this.getHours()%12;if(b===0)b=12;a.append(b);break;case "HH":a.append(c(this.getHours()));break;case "H":a.append(this.getHours());break;case "mm":a.append(c(this.getMinutes()));break;case "m":a.append(this.getMinutes());break;case "ss":a.append(c(this.getSeconds()));break;case "s":a.append(this.getSeconds());break;case "tt":a.append(this.getHours()<12?d.AMDesignator:d.PMDesignator);break;case "t":a.append((this.getHours()<12?d.AMDesignator:d.PMDesignator).charAt(0));break;case "f":a.append(g(this.getMilliseconds()).charAt(0));break;case "ff":a.append(g(this.getMilliseconds()).substr(0,2));break;case "fff":a.append(g(this.getMilliseconds()));break;case "z":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+Math.floor(Math.abs(b)));break;case "zz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b))));break;case "zzz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b)))+d.TimeSeparator+c(Math.abs(this.getTimezoneOffset()%60)))}}return a.toString()};Number.__typeName="Number";Number.__class=true;Number.parseLocale=function(a){return Number._parse(a,Sys.CultureInfo.CurrentCulture)};Number.parseInvariant=function(a){return Number._parse(a,Sys.CultureInfo.InvariantCulture)};Number._parse=function(b,o){b=b.trim();if(b.match(/^[+-]?infinity$/i))return parseFloat(b);if(b.match(/^0x[a-f0-9]+$/i))return parseInt(b);var a=o.numberFormat,g=Number._parseNumberNegativePattern(b,a,a.NumberNegativePattern),h=g[0],e=g[1];if(h===""&&a.NumberNegativePattern!==1){g=Number._parseNumberNegativePattern(b,a,1);h=g[0];e=g[1]}if(h==="")h="+";var j,d,f=e.indexOf("e");if(f<0)f=e.indexOf("E");if(f<0){d=e;j=null}else{d=e.substr(0,f);j=e.substr(f+1)}var c,k,m=d.indexOf(a.NumberDecimalSeparator);if(m<0){c=d;k=null}else{c=d.substr(0,m);k=d.substr(m+a.NumberDecimalSeparator.length)}c=c.split(a.NumberGroupSeparator).join("");var n=a.NumberGroupSeparator.replace(/\u00A0/g," ");if(a.NumberGroupSeparator!==n)c=c.split(n).join("");var l=h+c;if(k!==null)l+="."+k;if(j!==null){var i=Number._parseNumberNegativePattern(j,a,1);if(i[0]==="")i[0]="+";l+="e"+i[0]+i[1]}if(l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))return parseFloat(l);return Number.NaN};Number._parseNumberNegativePattern=function(a,d,e){var b=d.NegativeSign,c=d.PositiveSign;switch(e){case 4:b=" "+b;c=" "+c;case 3:if(a.endsWith(b))return ["-",a.substr(0,a.length-b.length)];else if(a.endsWith(c))return ["+",a.substr(0,a.length-c.length)];break;case 2:b+=" ";c+=" ";case 1:if(a.startsWith(b))return ["-",a.substr(b.length)];else if(a.startsWith(c))return ["+",a.substr(c.length)];break;case 0:if(a.startsWith("(")&&a.endsWith(")"))return ["-",a.substr(1,a.length-2)]}return ["",a]};Number.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Number.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Number.prototype._toFormattedString=function(d,j){if(!d||d.length===0||d==="i")if(j&&j.name.length>0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b<c;b++)a=d?"0"+a:a+"0";return a}function i(j,i,l,n,p){var h=l[0],k=1,o=Math.pow(10,i),m=Math.round(j*o)/o;if(!isFinite(m))m=j;j=m;var b=j.toString(),a="",c,e=b.split(/e/i);b=e[0];c=e.length>1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k<l.length){h=l[k];k++}}return b.slice(0,d+1)+n+f+a}var a=j.numberFormat,e=Math.abs(this);if(!d)d="D";var b=-1;if(d.length>1)b=parseInt(d.slice(1),10);var c;switch(d.charAt(0)){case "d":case "D":c="n";if(b!==-1)e=g(""+e,b,true);if(this<0)e=-e;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;e=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;e=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;e=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=e;break;case "$":f+=a.CurrencySymbol;break;case "-":f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};RegExp.__typeName="RegExp";RegExp.__class=true;Array.__typeName="Array";Array.__class=true;Array.add=Array.enqueue=function(a,b){a[a.length]=b};Array.addRange=function(a,b){a.push.apply(a,b)};Array.clear=function(a){a.length=0};Array.clone=function(a){if(a.length===1)return [a[0]];else return Array.apply(null,a)};Array.contains=function(a,b){return Array.indexOf(a,b)>=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a<f;a++){var c=b[a];if(typeof c!=="undefined")e.call(d,c,a,b)}};Array.indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b<c;b++)if(typeof d[b]!=="undefined"&&d[b]===e)return b}return -1};Array.insert=function(a,b,c){a.splice(b,0,c)};Array.parse=function(value){if(!value)return [];return eval(value)};Array.remove=function(b,c){var a=Array.indexOf(b,c);if(a>=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};if(!window)this.window=this;window.Type=Function;Type.prototype.callBaseMethod=function(a,d,b){var c=this.getBaseMethod(a,d);if(!b)return c.apply(a);else return c.apply(a,b)};Type.prototype.getBaseMethod=function(d,c){var b=this.getBaseType();if(b){var a=b.prototype[c];return a instanceof Function?a:null}return null};Type.prototype.getBaseType=function(){return typeof this.__baseType==="undefined"?null:this.__baseType};Type.prototype.getInterfaces=function(){var a=[],b=this;while(b){var c=b.__interfaces;if(c)for(var d=0,f=c.length;d<f;d++){var e=c[d];if(!Array.contains(a,e))a[a.length]=e}b=b.__baseType}return a};Type.prototype.getName=function(){return typeof this.__typeName==="undefined"?"":this.__typeName};Type.prototype.implementsInterface=function(d){this.resolveInheritance();var c=d.getName(),a=this.__interfaceCache;if(a){var e=a[c];if(typeof e!=="undefined")return e}else a=this.__interfaceCache={};var b=this;while(b){var f=b.__interfaces;if(f)if(Array.indexOf(f,d)!==-1)return a[c]=true;b=b.__baseType}return a[c]=false};Type.prototype.inheritsFrom=function(b){this.resolveInheritance();var a=this.__baseType;while(a){if(a===b)return true;a=a.__baseType}return false};Type.prototype.initializeBase=function(a,b){this.resolveInheritance();if(this.__baseType)if(!b)this.__baseType.apply(a);else this.__baseType.apply(a,b);return a};Type.prototype.isImplementedBy=function(a){if(typeof a==="undefined"||a===null)return false;var b=Object.getType(a);return !!(b.implementsInterface&&b.implementsInterface(this))};Type.prototype.isInstanceOfType=function(b){if(typeof b==="undefined"||b===null)return false;if(b instanceof this)return true;var a=Object.getType(b);return !!(a===this)||a.inheritsFrom&&a.inheritsFrom(this)||a.implementsInterface&&a.implementsInterface(this)};Type.prototype.registerClass=function(c,b,d){this.prototype.constructor=this;this.__typeName=c;this.__class=true;if(b){this.__baseType=b;this.__basePrototypePending=true}Sys.__upperCaseTypes[c.toUpperCase()]=this;if(d){this.__interfaces=[];for(var a=2,f=arguments.length;a<f;a++){var e=arguments[a];this.__interfaces.push(e)}}return this};Type.prototype.registerInterface=function(a){Sys.__upperCaseTypes[a.toUpperCase()]=this;this.prototype.constructor=this;this.__typeName=a;this.__interface=true;return this};Type.prototype.resolveInheritance=function(){if(this.__basePrototypePending){var b=this.__baseType;b.resolveInheritance();for(var a in b.prototype){var c=b.prototype[a];if(!this.prototype[a])this.prototype[a]=c}delete this.__basePrototypePending}};Type.getRootNamespaces=function(){return Array.clone(Sys.__rootNamespaces)};Type.isClass=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__class};Type.isInterface=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__interface};Type.isNamespace=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__namespace};Type.parse=function(typeName,ns){var fn;if(ns){fn=Sys.__upperCaseTypes[ns.getName().toUpperCase()+"."+typeName.toUpperCase()];return fn||null}if(!typeName)return null;if(!Type.__htClasses)Type.__htClasses={};fn=Type.__htClasses[typeName];if(!fn){fn=eval(typeName);Type.__htClasses[typeName]=fn}return fn};Type.registerNamespace=function(f){var d=window,c=f.split(".");for(var b=0;b<c.length;b++){var e=c[b],a=d[e];if(!a){a=d[e]={__namespace:true,__typeName:c.slice(0,b+1).join(".")};if(b===0)Sys.__rootNamespaces[Sys.__rootNamespaces.length]=a;a.getName=function(){return this.__typeName}}d=a}};window.Sys={__namespace:true,__typeName:"Sys",getName:function(){return "Sys"},__upperCaseTypes:{}};Sys.__rootNamespaces=[Sys];Sys.IDisposable=function(){};Sys.IDisposable.prototype={};Sys.IDisposable.registerInterface("Sys.IDisposable");Sys.StringBuilder=function(a){this._parts=typeof a!=="undefined"&&a!==null&&a!==""?[a.toString()]:[];this._value={};this._len=0};Sys.StringBuilder.prototype={append:function(a){this._parts[this._parts.length]=a},appendLine:function(a){this._parts[this._parts.length]=typeof a==="undefined"||a===null||a===""?"\r\n":a+"\r\n"},clear:function(){this._parts=[];this._value={};this._len=0},isEmpty:function(){if(this._parts.length===0)return true;return this.toString()===""},toString:function(a){a=a||"";var b=this._parts;if(this._len!==b.length){this._value={};this._len=b.length}var d=this._value;if(typeof d[a]==="undefined"){if(a!=="")for(var c=0;c<b.length;)if(typeof b[c]==="undefined"||b[c]===""||b[c]===null)b.splice(c,1);else c++;d[a]=this._parts.join(a)}return d[a]}};Sys.StringBuilder.registerClass("Sys.StringBuilder");if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a<c;a++)try{return new ActiveXObject(b[a])}catch(d){}return null};Sys.Browser={};Sys.Browser.InternetExplorer={};Sys.Browser.Firefox={};Sys.Browser.Safari={};Sys.Browser.Opera={};Sys.Browser.agent=null;Sys.Browser.hasDebuggerStatement=false;Sys.Browser.name=navigator.appName;Sys.Browser.version=parseFloat(navigator.appVersion);Sys.Browser.documentMode=0;if(navigator.userAgent.indexOf(" MSIE ")>-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+="    ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e<j;e++)this._traceDump(a[e],"["+e+"]",f,b,d)}else for(g in a){h=a[g];if(!Function.isInstanceOfType(h))this._traceDump(h,g,f,b,d)}}}Array.remove(d,a)}}};Sys._Debug.registerClass("Sys._Debug");Sys.Debug=new Sys._Debug;Sys.Debug.isDebug=false;function Sys$Enum$parse(c,e){var a,b,i;if(e){a=this.__lowerCaseValues;if(!a){this.__lowerCaseValues=a={};var g=this.prototype;for(var f in g)a[f.toLowerCase()]=g[f]}}else a=this.prototype;if(!this.__flags){i=e?c.toLowerCase():c;b=a[i.trim()];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c,this.__typeName));return b}else{var h=(e?c.toLowerCase():c).split(","),j=0;for(var d=h.length-1;d>=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.EventHandlerList=function(){this._list={}};Sys.EventHandlerList.prototype={addHandler:function(b,a){Array.add(this._getEvent(b,true),a)},removeHandler:function(c,b){var a=this._getEvent(c);if(!a)return;Array.remove(a,b)},getHandler:function(b){var a=this._getEvent(b);if(!a||a.length===0)return null;a=Array.clone(a);return function(c,d){for(var b=0,e=a.length;b<e;b++)a[b](c,d)}},_getEvent:function(a,b){if(!this._list[a]){if(!b)return null;this._list[a]=[]}return this._list[a]}};Sys.EventHandlerList.registerClass("Sys.EventHandlerList");Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Sys.INotifyPropertyChange=function(){};Sys.INotifyPropertyChange.prototype={};Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");Sys.PropertyChangedEventArgs=function(a){Sys.PropertyChangedEventArgs.initializeBase(this);this._propertyName=a};Sys.PropertyChangedEventArgs.prototype={get_propertyName:function(){return this._propertyName}};Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs",Sys.EventArgs);Sys.INotifyDisposing=function(){};Sys.INotifyDisposing.prototype={};Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");Sys.Component=function(){if(Sys.Application)Sys.Application.registerDisposableObject(this)};Sys.Component.prototype={_id:null,_initialized:false,_updating:false,get_events:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_id:function(){return this._id},set_id:function(a){this._id=a},get_isInitialized:function(){return this._initialized},get_isUpdating:function(){return this._updating},add_disposing:function(a){this.get_events().addHandler("disposing",a)},remove_disposing:function(a){this.get_events().removeHandler("disposing",a)},add_propertyChanged:function(a){this.get_events().addHandler("propertyChanged",a)},remove_propertyChanged:function(a){this.get_events().removeHandler("propertyChanged",a)},beginUpdate:function(){this._updating=true},dispose:function(){if(this._events){var a=this._events.getHandler("disposing");if(a)a(this,Sys.EventArgs.Empty)}delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},endUpdate:function(){this._updating=false;if(!this._initialized)this.initialize();this.updated()},initialize:function(){this._initialized=true},raisePropertyChanged:function(b){if(!this._events)return;var a=this._events.getHandler("propertyChanged");if(a)a(this,new Sys.PropertyChangedEventArgs(b))},updated:function(){}};Sys.Component.registerClass("Sys.Component",null,Sys.IDisposable,Sys.INotifyPropertyChange,Sys.INotifyDisposing);function Sys$Component$_setProperties(a,i){var d,j=Object.getType(a),e=j===Object||j===Sys.UI.DomElement,h=Sys.Component.isInstanceOfType(a)&&!a.get_isUpdating();if(h)a.beginUpdate();for(var c in i){var b=i[c],f=e?null:a["get_"+c];if(e||typeof f!=="function"){var k=a[c];if(!b||typeof b!=="object"||e&&!k)a[c]=b;else Sys$Component$_setProperties(k,b)}else{var l=a["set_"+c];if(typeof l==="function")l.apply(a,[b]);else if(b instanceof Array){d=f.apply(a);for(var g=0,m=d.length,n=b.length;g<n;g++,m++)d[m]=b[g]}else if(typeof b==="object"&&Object.getType(b)===Object){d=f.apply(a);Sys$Component$_setProperties(d,b)}}}if(h)a.endUpdate()}function Sys$Component$_setReferences(c,b){for(var a in b){var e=c["set_"+a],d=$find(b[a]);e.apply(c,[d])}}var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,b=Sys.Application,i=b.get_isCreatingComponents();a.beginUpdate();if(f)Sys$Component$_setProperties(a,f);if(d)for(var e in d)a["add_"+e](d[e]);if(a.get_id())b.addComponent(a);if(i){b._createdComponents[b._createdComponents.length]=a;if(c)b._addComponentToSecondPass(a,c);else a.endUpdate()}else{if(c)Sys$Component$_setReferences(a,c);a.endUpdate()}return a};Sys.UI.MouseButton=function(){throw Error.notImplemented()};Sys.UI.MouseButton.prototype={leftButton:0,middleButton:1,rightButton:2};Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");Sys.UI.Key=function(){throw Error.notImplemented()};Sys.UI.Key.prototype={backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127};Sys.UI.Key.registerEnum("Sys.UI.Key");Sys.UI.Point=function(a,b){this.x=a;this.y=b};Sys.UI.Point.registerClass("Sys.UI.Point");Sys.UI.Bounds=function(c,d,b,a){this.x=c;this.y=d;this.height=a;this.width=b};Sys.UI.Bounds.registerClass("Sys.UI.Bounds");Sys.UI.DomEvent=function(e){var a=e,b=this.type=a.type.toLowerCase();this.rawEvent=a;this.altKey=a.altKey;if(typeof a.button!=="undefined")this.button=typeof a.which!=="undefined"?a.button:a.button===4?Sys.UI.MouseButton.middleButton:a.button===2?Sys.UI.MouseButton.rightButton:Sys.UI.MouseButton.leftButton;if(b==="keypress")this.charCode=a.charCode||a.keyCode;else if(a.keyCode&&a.keyCode===46)this.keyCode=127;else this.keyCode=a.keyCode;this.clientX=a.clientX;this.clientY=a.clientY;this.ctrlKey=a.ctrlKey;this.target=a.target?a.target:a.srcElement;if(!b.startsWith("key"))if(typeof a.offsetX!=="undefined"&&typeof a.offsetY!=="undefined"){this.offsetX=a.offsetX;this.offsetY=a.offsetY}else if(this.target&&this.target.nodeType!==3&&typeof a.clientX==="number"){var c=Sys.UI.DomElement.getLocation(this.target),d=Sys.UI.DomElement._getWindow(this.target);this.offsetX=(d.pageXOffset||0)+a.clientX-c.x;this.offsetY=(d.pageYOffset||0)+a.clientY-c.y}this.screenX=a.screenX;this.screenY=a.screenY;this.shiftKey=a.shiftKey};Sys.UI.DomEvent.prototype={preventDefault:function(){if(this.rawEvent.preventDefault)this.rawEvent.preventDefault();else if(window.event)this.rawEvent.returnValue=false},stopPropagation:function(){if(this.rawEvent.stopPropagation)this.rawEvent.stopPropagation();else if(window.event)this.rawEvent.cancelBubble=true}};Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");var $addHandler=Sys.UI.DomEvent.addHandler=function(a,d,e){if(!a._events)a._events={};var c=a._events[d];if(!c)a._events[d]=c=[];var b;if(a.addEventListener){b=function(b){return e.call(a,new Sys.UI.DomEvent(b))};a.addEventListener(d,b,false)}else if(a.attachEvent){b=function(){var b={};try{b=Sys.UI.DomElement._getWindow(a).event}catch(c){}return e.call(a,new Sys.UI.DomEvent(b))};a.attachEvent("on"+d,b)}c[c.length]={handler:e,browserHandler:b}},$addHandlers=Sys.UI.DomEvent.addHandlers=function(e,d,c){for(var b in d){var a=d[b];if(c)a=Function.createDelegate(c,a);$addHandler(e,b,a)}},$clearHandlers=Sys.UI.DomEvent.clearHandlers=function(a){if(a._events){var e=a._events;for(var b in e){var d=e[b];for(var c=d.length-1;c>=0;c--)$removeHandler(a,b,d[c].handler)}a._events=null}},$removeHandler=Sys.UI.DomEvent.removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);else if(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)};Sys.UI.DomElement=function(){};Sys.UI.DomElement.registerClass("Sys.UI.DomElement");Sys.UI.DomElement.addCssClass=function(a,b){if(!Sys.UI.DomElement.containsCssClass(a,b))if(a.className==="")a.className=b;else a.className+=" "+b};Sys.UI.DomElement.containsCssClass=function(b,a){return Array.contains(b.className.split(" "),a)};Sys.UI.DomElement.getBounds=function(a){var b=Sys.UI.DomElement.getLocation(a);return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0)};var $get=Sys.UI.DomElement.getElementById=function(f,e){if(!e)return document.getElementById(f);if(e.getElementById)return e.getElementById(f);var c=[],d=e.childNodes;for(var b=0;b<d.length;b++){var a=d[b];if(a.nodeType==1)c[c.length]=a}while(c.length){a=c.shift();if(a.id==f)return a;d=a.childNodes;for(b=0;b<d.length;b++){a=d[b];if(a.nodeType==1)c[c.length]=a}}return null};switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:Sys.UI.DomElement.getLocation=function(a){if(a.self||a.nodeType===9)return new Sys.UI.Point(0,0);var b=a.getBoundingClientRect();if(!b)return new Sys.UI.Point(0,0);var d=a.ownerDocument.documentElement,e=b.left-2+d.scrollLeft,f=b.top-2+d.scrollTop;try{var c=a.ownerDocument.parentWindow.frameElement||null;if(c){var g=c.frameBorder==="0"||c.frameBorder==="no"?2:0;e+=g;f+=g}}catch(h){}return new Sys.UI.Point(e,f)};break;case Sys.Browser.Safari:Sys.UI.DomElement.getLocation=function(c){if(c.window&&c.window===c||c.nodeType===9)return new Sys.UI.Point(0,0);var f=0,g=0,j=null,e=null,b;for(var a=c;a;j=a,(e=b,a=a.offsetParent)){b=Sys.UI.DomElement._getCurrentStyle(a);var d=a.tagName?a.tagName.toUpperCase():null;if((a.offsetLeft||a.offsetTop)&&(d!=="BODY"||(!e||e.position!=="absolute"))){f+=a.offsetLeft;g+=a.offsetTop}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=c.parentNode;a;a=a.parentNode){d=a.tagName?a.tagName.toUpperCase():null;if(d!=="BODY"&&d!=="HTML"&&(a.scrollLeft||a.scrollTop)){f-=a.scrollLeft||0;g-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(f,g)};break;case Sys.Browser.Opera:Sys.UI.DomElement.getLocation=function(b){if(b.window&&b.window===b||b.nodeType===9)return new Sys.UI.Point(0,0);var d=0,e=0,i=null;for(var a=b;a;i=a,a=a.offsetParent){var f=a.tagName;d+=a.offsetLeft||0;e+=a.offsetTop||0}var g=b.style.position,c=g&&g!=="static";for(var a=b.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)&&(c&&(a.style.overflow==="scroll"||a.style.overflow==="auto"))){d-=a.scrollLeft||0;e-=a.scrollTop||0}var h=a&&a.style?a.style.position:null;c=c||h&&h!=="static"}return new Sys.UI.Point(d,e)};break;default:Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,i=null,g=null,b=null;for(var a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)}}Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._sessions=[];this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopSession();this._loading=false;if(this._events)delete this._events;this._sessions=null;this._currentSession=null;this._scriptLoadedDelegate=null},loadScripts:function(d,b,c,a){var e={allScriptsLoadedCallback:b,scriptLoadFailedCallback:c,scriptLoadTimeoutCallback:a,scriptsToLoad:this._scriptsToLoad,scriptTimeout:d};this._scriptsToLoad=null;this._sessions[this._sessions.length]=e;if(!this._loading)this._nextSession()},notifyScriptLoaded:function(){if(!this._loading)return;this._currentTask._notified++;if(Sys.Browser.agent===Sys.Browser.Safari)if(this._currentTask._notified===1)window.setTimeout(Function.createDelegate(this,function(){this._scriptLoadedHandler(this._currentTask.get_scriptElement(),true)}),0)},queueCustomScriptTag:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,a)},queueScriptBlock:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{text:a})},queueScriptReference:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{src:a})},_createScriptElement:function(c){var a=document.createElement("script");a.type="text/javascript";for(var b in c)a[b]=c[b];return a},_loadScriptsInternal:function(){var b=this._currentSession;if(b.scriptsToLoad&&b.scriptsToLoad.length>0){var c=Array.dequeue(b.scriptsToLoad),a=this._createScriptElement(c);if(a.text&&Sys.Browser.agent===Sys.Browser.Safari){a.innerHTML=a.text;delete a.text}if(typeof c.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(a,this._scriptLoadedDelegate);this._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(a);Sys._ScriptLoader._clearScript(a);this._loadScriptsInternal()}}else{this._stopSession();var d=b.allScriptsLoadedCallback;if(d)d(this);this._nextSession()}},_nextSession:function(){if(this._sessions.length===0){this._loading=false;this._currentSession=null;return}this._loading=true;var a=Array.dequeue(this._sessions);this._currentSession=a;if(a.scriptTimeout>0)this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),a.scriptTimeout*1000);this._loadScriptsInternal()},_raiseError:function(a){var c=this._currentSession.scriptLoadFailedCallback,b=this._currentTask.get_scriptElement();this._stopSession();if(c){c(this,b,a);this._nextSession()}else{this._loading=false;throw Sys._ScriptLoader._errorScriptLoadFailed(b.src,a)}},_scriptLoadedHandler:function(a,b){if(b&&this._currentTask._notified)if(this._currentTask._notified>1)this._raiseError(true);else{Array.add(Sys._ScriptLoader._getLoadedScripts(),a.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}else this._raiseError(false)},_scriptLoadTimeoutHandler:function(){var a=this._currentSession.scriptLoadTimeoutCallback;this._stopSession();if(a)a(this);this._nextSession()},_stopSession:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};Sys._ScriptLoader.isScriptLoaded=function(b){var a=document.createElement("script");a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var b=Sys._ScriptLoader._referencedScripts=[],c=document.getElementsByTagName("script");for(i=c.length-1;i>=0;i--){var d=c[i],a=d.src;if(a.length)if(!Array.contains(b,a))Array.add(b,a)}}};Sys._ScriptLoader._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Sys._ScriptLoader._errorScriptLoadFailed=function(b,d){var a;if(d)a=Sys.Res.scriptLoadMultipleCallbacks;else a=Sys.Res.scriptLoadFailed;var e="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(e,{name:"Sys.ScriptLoadFailedException","scriptUrl":b});c.popStackFrame();return c};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a;this._notified=0};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoader._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;var b=this;window.setTimeout(function(){b._completedCallback(a,true)},0)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys.HistoryEventArgs=function(a){Sys.HistoryEventArgs.initializeBase(this);this._state=a};Sys.HistoryEventArgs.prototype={get_state:function(){return this._state}};Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._appLoadHandler=null;this._beginRequestHandler=null;this._clientId=null;this._currentEntry="";this._endRequestHandler=null;this._history=null;this._enableHistory=false;this._historyFrame=null;this._historyInitialized=false;this._historyInitialLength=0;this._historyLength=0;this._historyPointIsNew=false;this._ignoreTimer=false;this._initialState=null;this._state={};this._timerCookie=0;this._timerHandler=null;this._uniqueId=null;this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);this._loadHandlerDelegate=Function.createDelegate(this,this._loadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);Sys.UI.DomEvent.addHandler(window,"load",this._loadHandlerDelegate)};Sys._Application.prototype={_creatingComponents:false,_disposing:false,get_isCreatingComponents:function(){return this._creatingComponents},get_stateString:function(){var a=window.location.hash;if(this._isSafari2()){var b=this._getHistory();if(b)a=b[window.history.length-this._historyInitialLength]}if(a.length>0&&a.charAt(0)==="#")a=a.substring(1);if(Sys.Browser.agent===Sys.Browser.Firefox)a=this._serializeState(this._deserializeState(a,true));return a},get_enableHistory:function(){return this._enableHistory},set_enableHistory:function(a){this._enableHistory=a},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_navigate:function(a){this.get_events().addHandler("navigate",a)},remove_navigate:function(a){this.get_events().removeHandler("navigate",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},addHistoryPoint:function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,e=b.length;a<e;a++)b[a].dispose();Array.clear(this._disposableObjects);Sys.UI.DomEvent.removeHandler(window,"unload",this._unloadHandlerDelegate);if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}var d=Sys._ScriptLoader.getInstance();if(d)d.dispose();Sys._Application.callBaseMethod(this,"dispose")}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a<d;a++){var c=b[a].component;Sys$Component$_setReferences(c,b[a].references);c.endUpdate()}this._secondPassComponents=[];this._creatingComponents=false},findComponent:function(b,a){return a?Sys.IContainer.isInstanceOfType(a)?a.findComponent(b):a[b]||null:Sys.Application._components[b]||null},getComponents:function(){var a=[],b=this._components;for(var c in b)a[a.length]=b[c];return a},initialize:function(){if(!this._initialized&&!this._initializing){this._initializing=true;window.setTimeout(Function.createDelegate(this,this._doInitialize),0)}},notifyScriptLoaded:function(){var a=Sys._ScriptLoader.getInstance();if(a)a.notifyScriptLoaded()},registerDisposableObject:function(a){if(!this._disposing)this._disposableObjects[this._disposableObjects.length]=a},raiseLoad:function(){var b=this.get_events().getHandler("load"),a=new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!this._initializing);if(b)b(this,a);if(window.pageLoad)window.pageLoad(this,a);this._createdComponents=[]},removeComponent:function(b){var a=b.get_id();if(a)delete this._components[a]},setServerId:function(a,b){this._clientId=a;this._uniqueId=b},setServerState:function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)},unregisterDisposableObject:function(a){if(!this._disposing)Array.remove(this._disposableObjects,a)},_addComponentToSecondPass:function(b,a){this._secondPassComponents[this._secondPassComponents.length]={component:b,references:a}},_deserializeState:function(a,i){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2<a.length){e.__s=a.substr(b+2);a=a.substr(0,b)}var g=a.split("&");for(var f=0,k=g.length;f<k;f++){var d=g[f],c=d.indexOf("=");if(c!==-1&&c+1<d.length){var j=d.substr(0,c),h=d.substr(c+1);e[j]=i?h:decodeURIComponent(h)}}return e},_doInitialize:function(){Sys._Application.callBaseMethod(this,"initialize");var b=this.get_events().getHandler("init");if(b){this.beginCreateComponents();b(this,Sys.EventArgs.Empty);this.endCreateComponents()}if(Sys.WebForms){this._beginRequestHandler=Function.createDelegate(this,this._onPageRequestManagerBeginRequest);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);this._endRequestHandler=Function.createDelegate(this,this._onPageRequestManagerEndRequest);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)}var a=this.get_stateString();if(a!==this._currentEntry)this._navigate(a);this.raiseLoad();this._initializing=false},_enableHistoryInScriptManager:function(){this._enableHistory=true},_ensureHistory:function(){if(!this._historyInitialized&&this._enableHistory){if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.documentMode<8){this._historyFrame=document.getElementById("__historyFrame");this._ignoreIFrame=true}if(this._isSafari2()){var a=document.getElementById("__history");this._setHistory([window.location.hash]);this._historyInitialLength=window.history.length}this._timerHandler=Function.createDelegate(this,this._onIdle);this._timerCookie=window.setTimeout(this._timerHandler,100);try{this._initialState=this._deserializeState(this.get_stateString())}catch(b){}this._historyInitialized=true}},_getHistory:function(){var a=document.getElementById("__history");if(!a)return "";var b=a.value;return b?Sys.Serialization.JavaScriptSerializer.deserialize(b,true):""},_isSafari2:function(){return Sys.Browser.agent===Sys.Browser.Safari&&Sys.Browser.version<=419.3},_loadHandler:function(){if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}this.initialize()},_navigate:function(c){this._ensureHistory();var b=this._deserializeState(c);if(this._uniqueId){var d=this._state.__s||"",a=b.__s||"";if(a!==d){this._updateHiddenField(a);__doPostBack(this._uniqueId,a);this._state=b;return}}this._setState(c);this._state=b;this._raiseNavigate()},_onIdle:function(){delete this._timerCookie;var a=this.get_stateString();if(a!==this._currentEntry){if(!this._ignoreTimer){this._historyPointIsNew=false;this._navigate(a);this._historyLength=window.history.length}}else this._ignoreTimer=false;this._timerCookie=window.setTimeout(this._timerHandler,100)},_onIFrameLoad:function(a){this._ensureHistory();if(!this._ignoreIFrame){this._historyPointIsNew=false;this._navigate(a)}this._ignoreIFrame=false},_onPageRequestManagerBeginRequest:function(){this._ignoreTimer=true},_onPageRequestManagerEndRequest:function(e,d){var b=d.get_dataItems()[this._clientId],a=document.getElementById("__EVENTTARGET");if(a&&a.value===this._uniqueId)a.value="";if(typeof b!=="undefined"){this.setServerState(b);this._historyPointIsNew=true}else this._ignoreTimer=false;var c=this._serializeState(this._state);if(c!==this._currentEntry){this._ignoreTimer=true;this._setState(c);this._raiseNavigate()}},_raiseNavigate:function(){var c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var d=new Sys.HistoryEventArgs(b);if(c)c(this,d)},_serializeState:function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")},_setHistory:function(b){var a=document.getElementById("__history");if(a)a.value=Sys.Serialization.JavaScriptSerializer.serialize(b)},_setState:function(a,c){a=a||"";if(a!==this._currentEntry){if(window.theForm){var e=window.theForm.action,f=e.indexOf("#");window.theForm.action=(f!==-1?e.substring(0,f):e)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){this._ignoreIFrame=true;this._historyPointIsNew=false;var d=this._historyFrame.contentWindow.document;d.open("javascript:'<html></html>'");d.write("<html><head><title>"+(c||document.title)+"</title><scri"+'pt type="text/javascript">parent.Sys.Application._onIFrameLoad(\''+a+"');</scri"+"pt></head><body></body></html>");d.close()}this._ignoreTimer=false;var h=this.get_stateString();this._currentEntry=a;if(a!==h){if(this._isSafari2()){var g=this._getHistory();g[window.history.length-this._historyInitialLength+1]=a;this._setHistory(g);this._historyLength=window.history.length+1;var b=document.createElement("form");b.method="get";b.action="#"+a;document.appendChild(b);b.submit();document.removeChild(b)}else window.location.hash=a;if(typeof c!=="undefined"&&c!==null)document.title=c}}},_unloadHandler:function(){this.dispose()},_updateHiddenField:function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Type.registerNamespace("Sys.Net");Sys.Net.WebRequestExecutor=function(){this._webRequest=null;this._resultObject=null};Sys.Net.WebRequestExecutor.prototype={get_webRequest:function(){return this._webRequest},_set_webRequest:function(a){this._webRequest=a},get_started:function(){throw Error.notImplemented()},get_responseAvailable:function(){throw Error.notImplemented()},get_timedOut:function(){throw Error.notImplemented()},get_aborted:function(){throw Error.notImplemented()},get_responseData:function(){throw Error.notImplemented()},get_statusCode:function(){throw Error.notImplemented()},get_statusText:function(){throw Error.notImplemented()},get_xml:function(){throw Error.notImplemented()},get_object:function(){if(!this._resultObject)this._resultObject=Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());return this._resultObject},executeRequest:function(){throw Error.notImplemented()},abort:function(){throw Error.notImplemented()},getResponseHeader:function(){throw Error.notImplemented()},getAllResponseHeaders:function(){throw Error.notImplemented()}};Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");Sys.Net.XMLDOM=function(d){if(!window.DOMParser){var c=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"];for(var b=0,f=c.length;b<f;b++)try{var a=new ActiveXObject(c[b]);a.async=false;a.loadXML(d);a.setProperty("SelectionLanguage","XPath");return a}catch(g){}}else try{var e=new window.DOMParser;return e.parseFromString(d,"text/xml")}catch(g){}return null};Sys.Net.XMLHttpExecutor=function(){Sys.Net.XMLHttpExecutor.initializeBase(this);var a=this;this._xmlHttpRequest=null;this._webRequest=null;this._responseAvailable=false;this._timedOut=false;this._timer=null;this._aborted=false;this._started=false;this._onReadyStateChange=function(){if(a._xmlHttpRequest.readyState===4){try{if(typeof a._xmlHttpRequest.status==="undefined")return}catch(b){return}a._clearTimer();a._responseAvailable=true;try{a._webRequest.completed(Sys.EventArgs.Empty)}finally{if(a._xmlHttpRequest!=null){a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest=null}}}};this._clearTimer=function(){if(a._timer!=null){window.clearTimeout(a._timer);a._timer=null}};this._onTimeout=function(){if(!a._responseAvailable){a._clearTimer();a._timedOut=true;a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest.abort();a._webRequest.completed(Sys.EventArgs.Empty);a._xmlHttpRequest=null}}};Sys.Net.XMLHttpExecutor.prototype={get_timedOut:function(){return this._timedOut},get_started:function(){return this._started},get_responseAvailable:function(){return this._responseAvailable},get_aborted:function(){return this._aborted},executeRequest:function(){this._webRequest=this.get_webRequest();var c=this._webRequest.get_body(),a=this._webRequest.get_headers();this._xmlHttpRequest=new XMLHttpRequest;this._xmlHttpRequest.onreadystatechange=this._onReadyStateChange;var e=this._webRequest.get_httpVerb();this._xmlHttpRequest.open(e,this._webRequest.getResolvedUrl(),true);if(a)for(var b in a){var f=a[b];if(typeof f!=="function")this._xmlHttpRequest.setRequestHeader(b,f)}if(e.toLowerCase()==="post"){if(a===null||!a["Content-Type"])this._xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");if(!c)c=""}var d=this._webRequest.get_timeout();if(d>0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(d,b){if(!b)b=encodeURIComponent;var a=new Sys.StringBuilder,f=0;for(var c in d){var e=d[c];if(typeof e==="function")continue;var g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(f!==0)a.append("&");a.append(c);a.append("=");a.append(b(g));f++}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b){if(!b)return a;var d=Sys.Net.WebRequest._createQueryString(b);if(d.length>0){var c="?";if(a&&a.indexOf("?")!==-1)c="&";return a+c+d}else return a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed},set_defaultFailedCallback:function(a){this._failed=a},get_path:function(){return this._path},set_path:function(a){this._path=a},_invoke:function(d,e,g,f,c,b,a){if(c===null||typeof c==="undefined")c=this.get_defaultSucceededCallback();if(b===null||typeof b==="undefined")b=this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(k,a,j,d,i,c,f,h){var b=new Sys.Net.WebRequest;b.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!d)d={};var g=d;if(!j||!g)g={};b.set_url(Sys.Net.WebRequest._createUrl(k+"/"+encodeURIComponent(a),g));var e=null;if(!j){e=Sys.Serialization.JavaScriptSerializer.serialize(d);if(e==="{}")e=""}b.set_body(e);b.add_completed(l);if(h&&h>0)b.set_timeout(h);b.invoke();function l(d){if(d.get_responseAvailable()){var g=d.get_statusCode(),b=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))b=d.get_object();else if(e.startsWith("text/xml"))b=d.get_xml();else b=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(b)b=new Sys.Net.WebServiceError(false,b.Message,b.StackTrace,b.ExceptionType)}else if(e.startsWith("application/json"))b=b.d;if(g<200||g>=300||h){if(c){if(!b||!h)b=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a),"","");b._statusCode=g;c(b,f,a)}}else if(i)i(b,f,a)}else{var j;if(d.get_timedOut())j=String.format(Sys.Res.webServiceTimedOut,a);else j=String.format(Sys.Res.webServiceFailedNoMsg,a);if(c)c(new Sys.Net.WebServiceError(d.get_timedOut(),j,"",""),f,a)}}return b};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys.Net.WebServiceError=function(c,d,b,a){this._timedOut=c;this._message=d;this._stackTrace=b;this._exceptionType=a;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace},get_exceptionType:function(){return this._exceptionType}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");Sys.Services._ProfileService=function(){Sys.Services._ProfileService.initializeBase(this);this.properties={}};Sys.Services._ProfileService.DefaultWebServicePath="";Sys.Services._ProfileService.prototype={_defaultLoadCompletedCallback:null,_defaultSaveCompletedCallback:null,_path:"",_timeout:0,get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_defaultSaveCompletedCallback:function(){return this._defaultSaveCompletedCallback},set_defaultSaveCompletedCallback:function(a){this._defaultSaveCompletedCallback=a},get_path:function(){return this._path||""},load:function(c,d,e,f){var b,a;if(!c){a="GetAllPropertiesForCurrentUser";b={authenticatedUserOnly:false}}else{a="GetPropertiesForCurrentUser";b={properties:this._clonePropertyNames(c),authenticatedUserOnly:false}}this._invoke(this._get_path(),a,false,b,Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[d,e,f])},save:function(d,b,c,e){var a=this._flattenProperties(d,this.properties);this._invoke(this._get_path(),"SetPropertiesForCurrentUser",false,{values:a.value,authenticatedUserOnly:false},Function.createDelegate(this,this._onSaveComplete),Function.createDelegate(this,this._onSaveFailed),[b,c,e,a.count])},_clonePropertyNames:function(e){var c=[],d={};for(var b=0;b<e.length;b++){var a=e[b];if(!d[a]){Array.add(c,a);d[a]=true}}return c},_flattenProperties:function(a,i,j){var b={},e,d,g=0;if(a&&a.length===0)return {value:b,count:0};for(var c in i){e=i[c];d=j?j+"."+c:c;if(Sys.Services.ProfileGroup.isInstanceOfType(e)){var k=this._flattenProperties(a,e,d),h=k.value;g+=k.count;for(var f in h){var l=h[f];b[f]=l}}else if(!a||Array.indexOf(a,d)!==-1){b[d]=e;g++}}return {value:b,count:g}},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._ProfileService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoadComplete:function(a,e,g){if(typeof a!=="object")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,g,"Object"));var c=this._unflattenProperties(a);for(var b in c)this.properties[b]=c[b];var d=e[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(d){var f=e[2]||this.get_defaultUserContext();d(a.length,f,"Sys.Services.ProfileService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.load")}},_onSaveComplete:function(a,b,f){var c=b[3];if(a!==null)if(a instanceof Array)c-=a.length;else if(typeof a==="number")c=a;else throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));var d=b[0]||this.get_defaultSaveCompletedCallback()||this.get_defaultSucceededCallback();if(d){var e=b[2]||this.get_defaultUserContext();d(c,e,"Sys.Services.ProfileService.save")}},_onSaveFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.save")}},_unflattenProperties:function(e){var c={},d,f,h=0;for(var a in e){h++;f=e[a];d=a.indexOf(".");if(d!==-1){var g=a.substr(0,d);a=a.substr(d+1);var b=c[g];if(!b||!Sys.Services.ProfileGroup.isInstanceOfType(b)){b=new Sys.Services.ProfileGroup;c[g]=b}b[a]=f}else c[a]=f}e.length=h;return c}};Sys.Services._ProfileService.registerClass("Sys.Services._ProfileService",Sys.Net.WebServiceProxy);Sys.Services.ProfileService=new Sys.Services._ProfileService;Sys.Services.ProfileGroup=function(a){if(a)for(var b in a)this[b]=a[b]};Sys.Services.ProfileGroup.registerClass("Sys.Services.ProfileGroup");Sys.Services._AuthenticationService=function(){Sys.Services._AuthenticationService.initializeBase(this)};Sys.Services._AuthenticationService.DefaultWebServicePath="";Sys.Services._AuthenticationService.prototype={_defaultLoginCompletedCallback:null,_defaultLogoutCompletedCallback:null,_path:"",_timeout:0,_authenticated:false,get_defaultLoginCompletedCallback:function(){return this._defaultLoginCompletedCallback},set_defaultLoginCompletedCallback:function(a){this._defaultLoginCompletedCallback=a},get_defaultLogoutCompletedCallback:function(){return this._defaultLogoutCompletedCallback},set_defaultLogoutCompletedCallback:function(a){this._defaultLogoutCompletedCallback=a},get_isLoggedIn:function(){return this._authenticated},get_path:function(){return this._path||""},login:function(c,b,a,h,f,d,e,g){this._invoke(this._get_path(),"Login",false,{userName:c,password:b,createPersistentCookie:a},Function.createDelegate(this,this._onLoginComplete),Function.createDelegate(this,this._onLoginFailed),[c,b,a,h,f,d,e,g])},logout:function(c,a,b,d){this._invoke(this._get_path(),"Logout",false,{},Function.createDelegate(this,this._onLogoutComplete),Function.createDelegate(this,this._onLogoutFailed),[c,a,b,d])},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._AuthenticationService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoginComplete:function(e,c,f){if(typeof e!=="boolean")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Boolean"));var b=c[4],d=c[7]||this.get_defaultUserContext(),a=c[5]||this.get_defaultLoginCompletedCallback()||this.get_defaultSucceededCallback();if(e){this._authenticated=true;if(a)a(true,d,"Sys.Services.AuthenticationService.login");if(typeof b!=="undefined"&&b!==null)window.location.href=b}else if(a)a(false,d,"Sys.Services.AuthenticationService.login")},_onLoginFailed:function(d,b){var a=b[6]||this.get_defaultFailedCallback();if(a){var c=b[7]||this.get_defaultUserContext();a(d,c,"Sys.Services.AuthenticationService.login")}},_onLogoutComplete:function(f,a,e){if(f!==null)throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,e,"null"));var b=a[0],d=a[3]||this.get_defaultUserContext(),c=a[1]||this.get_defaultLogoutCompletedCallback()||this.get_defaultSucceededCallback();this._authenticated=false;if(c)c(null,d,"Sys.Services.AuthenticationService.logout");if(!b)window.location.reload();else window.location.href=b},_onLogoutFailed:function(c,b){var a=b[2]||this.get_defaultFailedCallback();if(a)a(c,b[3],"Sys.Services.AuthenticationService.logout")},_setAuthenticated:function(a){this._authenticated=a}};Sys.Services._AuthenticationService.registerClass("Sys.Services._AuthenticationService",Sys.Net.WebServiceProxy);Sys.Services.AuthenticationService=new Sys.Services._AuthenticationService;Sys.Services._RoleService=function(){Sys.Services._RoleService.initializeBase(this);this._roles=[]};Sys.Services._RoleService.DefaultWebServicePath="";Sys.Services._RoleService.prototype={_defaultLoadCompletedCallback:null,_rolesIndex:null,_timeout:0,_path:"",get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_path:function(){return this._path||""},get_roles:function(){return Array.clone(this._roles)},isUserInRole:function(a){var b=this._get_rolesIndex()[a.trim().toLowerCase()];return !!b},load:function(a,b,c){Sys.Net.WebServiceProxy.invoke(this._get_path(),"GetRolesForCurrentUser",false,{},Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[a,b,c],this.get_timeout())},_get_path:function(){var a=this.get_path();if(!a||!a.length)a=Sys.Services._RoleService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_get_rolesIndex:function(){if(!this._rolesIndex){var b={};for(var a=0;a<this._roles.length;a++)b[this._roles[a].toLowerCase()]=true;this._rolesIndex=b}return this._rolesIndex},_onLoadComplete:function(a,c,f){if(a&&!(a instanceof Array))throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));this._roles=a;this._rolesIndex=null;var b=c[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(b){var e=c[2]||this.get_defaultUserContext(),d=Array.clone(a);b(d,e,"Sys.Services.RoleService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.RoleService.load")}}};Sys.Services._RoleService.registerClass("Sys.Services._RoleService",Sys.Net.WebServiceProxy);Sys.Services.RoleService=new Sys.Services._RoleService;Type.registerNamespace("Sys.Serialization");Sys.Serialization.JavaScriptSerializer=function(){};Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs=[];Sys.Serialization.JavaScriptSerializer._charsToEscape=[];Sys.Serialization.JavaScriptSerializer._dateRegEx=new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars={};Sys.Serialization.JavaScriptSerializer._escapeRegEx=new RegExp('["\\\\\\x00-\\x1F]',"i");Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal=new RegExp('["\\\\\\x00-\\x1F]',"g");Sys.Serialization.JavaScriptSerializer._jsonRegEx=new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]","g");Sys.Serialization.JavaScriptSerializer._jsonStringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"',"g");Sys.Serialization.JavaScriptSerializer._serverTypeFieldName="__type";Sys.Serialization.JavaScriptSerializer._init=function(){var c=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f"];Sys.Serialization.JavaScriptSerializer._charsToEscape[0]="\\";Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"]=new RegExp("\\\\","g");Sys.Serialization.JavaScriptSerializer._escapeChars["\\"]="\\\\";Sys.Serialization.JavaScriptSerializer._charsToEscape[1]='"';Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"']=new RegExp('"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars['"']='\\"';for(var a=0;a<32;a++){var b=String.fromCharCode(a);Sys.Serialization.JavaScriptSerializer._charsToEscape[a+2]=b;Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b]=new RegExp(b,"g");Sys.Serialization.JavaScriptSerializer._escapeChars[b]=c[a]}};Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder=function(b,a){a.append(b.toString())};Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder=function(a,b){if(isFinite(a))b.append(String(a));else throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)};Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder=function(a,c){c.append('"');if(Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)){if(Sys.Serialization.JavaScriptSerializer._charsToEscape.length===0)Sys.Serialization.JavaScriptSerializer._init();if(a.length<128)a=a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal,function(a){return Sys.Serialization.JavaScriptSerializer._escapeChars[a]});else for(var d=0;d<34;d++){var b=Sys.Serialization.JavaScriptSerializer._charsToEscape[d];if(a.indexOf(b)!==-1)if(Sys.Browser.agent===Sys.Browser.Opera||Sys.Browser.agent===Sys.Browser.FireFox)a=a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]);else a=a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b],Sys.Serialization.JavaScriptSerializer._escapeChars[b])}}c.append(a);c.append('"')};Sys.Serialization.JavaScriptSerializer._serializeWithBuilder=function(b,a,i,g){var c;switch(typeof b){case "object":if(b)if(Number.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);else if(Boolean.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);else if(String.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);else if(Array.isInstanceOfType(b)){a.append("[");for(c=0;c<b.length;++c){if(c>0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c<f;c++){var h=b[d[c]];if(typeof h!=="undefined"&&typeof h!=="function"){if(j)a.append(",");else j=true;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c],a,i,g);a.append(":");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h,a,i,g)}}a.append("}")}else a.append("null");break;case "number":Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);break;case "string":Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);break;case "boolean":Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);break;default:a.append("null")}};Sys.Serialization.JavaScriptSerializer.serialize=function(b){var a=new Sys.StringBuilder;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b,a,false);return a.toString()};Sys.Serialization.JavaScriptSerializer.deserialize=function(data,secure){if(data.length===0)throw Error.argument("data",Sys.Res.cannotDeserializeEmptyString);try{var exp=data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx,"$1new Date($2)");if(secure&&Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx,"")))throw null;return eval("("+exp+")")}catch(a){throw Error.argument("data",Sys.Res.cannotDeserializeInvalidJson)}};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getMonthIndex:function(a){if(!this._upperMonths)this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);return Array.indexOf(this._upperMonths,this._toUpper(a))},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths)this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(this._upperAbbrMonths,this._toUpper(a))},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a<d;a++)b[a]=this._toUpper(c[a]);return b},_toUpper:function(a){return a.split("\u00a0").join(" ").toUpperCase()}};Sys.CultureInfo._parse=function(b){var a=Sys.Serialization.JavaScriptSerializer.deserialize(b);return new Sys.CultureInfo(a.name,a.numberFormat,a.dateTimeFormat)};Sys.CultureInfo.registerClass("Sys.CultureInfo");Sys.CultureInfo.InvariantCulture=Sys.CultureInfo._parse('{"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00a4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}');if(typeof __cultureInfo==="undefined")var __cultureInfo='{"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}';Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse(__cultureInfo);delete __cultureInfo;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!=-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");if(this._element){var a=this.get_name();if(a)this._element[a]=null;Array.remove(this._element._behaviors,this);delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b<f;b++)if(e.isInstanceOfType(a[b]))c[c.length]=a[b];return c};Sys.UI.VisibilityMode=function(){throw Error.notImplemented()};Sys.UI.VisibilityMode.prototype={hide:0,collapse:1};Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");Sys.UI.Control=function(a){Sys.UI.Control.initializeBase(this);this._element=a;a.control=this};Sys.UI.Control.prototype={_parent:null,_visibilityMode:Sys.UI.VisibilityMode.hide,get_element:function(){return this._element},get_id:function(){if(!this._element)return "";return this._element.id},set_id:function(){throw Error.invalidOperation(Sys.Res.cantSetId)},get_parent:function(){if(this._parent)return this._parent;if(!this._element)return null;var a=this._element.parentNode;while(a){if(a.control)return a.control;a=a.parentNode}return null},set_parent:function(a){this._parent=a},get_visibilityMode:function(){return Sys.UI.DomElement.getVisibilityMode(this._element)},set_visibilityMode:function(a){Sys.UI.DomElement.setVisibilityMode(this._element,a)},get_visible:function(){return Sys.UI.DomElement.getVisible(this._element)},set_visible:function(a){Sys.UI.DomElement.setVisible(this._element,a)},addCssClass:function(a){Sys.UI.DomElement.addCssClass(this._element,a)},dispose:function(){Sys.UI.Control.callBaseMethod(this,"dispose");if(this._element){this._element.control=undefined;delete this._element}if(this._parent)delete this._parent},onBubbleEvent:function(){return false},raiseBubbleEvent:function(b,c){var a=this.get_parent();while(a){if(a.onBubbleEvent(b,c))return;a=a.get_parent()}},removeCssClass:function(a){Sys.UI.DomElement.removeCssClass(this._element,a)},toggleCssClass:function(a){Sys.UI.DomElement.toggleCssClass(this._element,a)}};Sys.UI.Control.registerClass("Sys.UI.Control",Sys.Component);
Type.registerNamespace('Sys');Sys.Res={"argumentInteger":"Value must be an integer.","scriptLoadMultipleCallbacks":"The script \u0027{0}\u0027 contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.","invokeCalledTwice":"Cannot call invoke more than once.","webServiceFailed":"The server method \u0027{0}\u0027 failed with the following error: {1}","webServiceInvalidJsonWrapper":"The server method \u0027{0}\u0027 returned invalid data. The \u0027d\u0027 property is missing from the JSON wrapper.","argumentType":"Object cannot be converted to the required type.","argumentNull":"Value cannot be null.","controlCantSetId":"The id property can\u0027t be set on a control.","formatBadFormatSpecifier":"Format specifier was invalid.","webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.","argumentDomElement":"Value must be a DOM element.","invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.","cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.","actualValue":"Actual value was {0}.","enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.","scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.","parameterCount":"Parameter count mismatch.","cannotDeserializeEmptyString":"Cannot deserialize empty string.","formatInvalidString":"Input string was not in a correct format.","invalidTimeout":"Value must be greater than or equal to zero.","cannotAbortBeforeStart":"Cannot abort when executor has not started.","argument":"Value does not fall within the expected range.","cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.","invalidHttpVerb":"httpVerb cannot be set to an empty or null string.","nullWebRequest":"Cannot call executeRequest with a null webRequest.","eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler method.","cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.","argumentUndefined":"Value cannot be undefined.","webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}","servicePathNotSet":"The path to the web service has not been set.","argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.","cannotCallOnceStarted":"Cannot call {0} once started.","badBaseUrl1":"Base URL does not contain ://.","badBaseUrl2":"Base URL does not contain another /.","badBaseUrl3":"Cannot find last / in base URL.","setExecutorAfterActive":"Cannot set executor after it has become active.","paramName":"Parameter name: {0}","cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.","cannotSerializeObjectWithCycle":"Cannot serialize object with cyclic reference within child properties.","format":"One of the identified items was in an invalid format.","assertFailedCaller":"Assertion Failed: {0}\r\nat {1}","argumentOutOfRange":"Specified argument was out of the range of valid values.","webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.","notImplemented":"The method or operation is not implemented.","assertFailed":"Assertion Failed: {0}","invalidOperation":"Operation is not valid due to the current state of the object.","breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?"};
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjaxWebForms.js
Type.registerNamespace("Sys.WebForms");Sys.WebForms.BeginRequestEventArgs=function(b,a){Sys.WebForms.BeginRequestEventArgs.initializeBase(this);this._request=b;this._postBackElement=a};Sys.WebForms.BeginRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request}};Sys.WebForms.BeginRequestEventArgs.registerClass("Sys.WebForms.BeginRequestEventArgs",Sys.EventArgs);Sys.WebForms.EndRequestEventArgs=function(c,a,b){Sys.WebForms.EndRequestEventArgs.initializeBase(this);this._errorHandled=false;this._error=c;this._dataItems=a||{};this._response=b};Sys.WebForms.EndRequestEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_error:function(){return this._error},get_errorHandled:function(){return this._errorHandled},set_errorHandled:function(a){this._errorHandled=a},get_response:function(){return this._response}};Sys.WebForms.EndRequestEventArgs.registerClass("Sys.WebForms.EndRequestEventArgs",Sys.EventArgs);Sys.WebForms.InitializeRequestEventArgs=function(b,a){Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);this._request=b;this._postBackElement=a};Sys.WebForms.InitializeRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request}};Sys.WebForms.InitializeRequestEventArgs.registerClass("Sys.WebForms.InitializeRequestEventArgs",Sys.CancelEventArgs);Sys.WebForms.PageLoadedEventArgs=function(b,a,c){Sys.WebForms.PageLoadedEventArgs.initializeBase(this);this._panelsUpdated=b;this._panelsCreated=a;this._dataItems=c||{}};Sys.WebForms.PageLoadedEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsCreated:function(){return this._panelsCreated},get_panelsUpdated:function(){return this._panelsUpdated}};Sys.WebForms.PageLoadedEventArgs.registerClass("Sys.WebForms.PageLoadedEventArgs",Sys.EventArgs);Sys.WebForms.PageLoadingEventArgs=function(b,a,c){Sys.WebForms.PageLoadingEventArgs.initializeBase(this);this._panelsUpdating=b;this._panelsDeleting=a;this._dataItems=c||{}};Sys.WebForms.PageLoadingEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsDeleting:function(){return this._panelsDeleting},get_panelsUpdating:function(){return this._panelsUpdating}};Sys.WebForms.PageLoadingEventArgs.registerClass("Sys.WebForms.PageLoadingEventArgs",Sys.EventArgs);Sys.WebForms.PageRequestManager=function(){this._form=null;this._activeDefaultButton=null;this._activeDefaultButtonClicked=false;this._updatePanelIDs=null;this._updatePanelClientIDs=null;this._updatePanelHasChildrenAsTriggers=null;this._asyncPostBackControlIDs=null;this._asyncPostBackControlClientIDs=null;this._postBackControlIDs=null;this._postBackControlClientIDs=null;this._scriptManagerID=null;this._pageLoadedHandler=null;this._additionalInput=null;this._onsubmit=null;this._onSubmitStatements=[];this._originalDoPostBack=null;this._originalDoPostBackWithOptions=null;this._originalFireDefaultButton=null;this._originalDoCallback=null;this._isCrossPost=false;this._postBackSettings=null;this._request=null;this._onFormSubmitHandler=null;this._onFormElementClickHandler=null;this._onWindowUnloadHandler=null;this._asyncPostBackTimeout=null;this._controlIDToFocus=null;this._scrollPosition=null;this._processingRequest=false;this._scriptDisposes={};this._transientFields=["__VIEWSTATEENCRYPTED","__VIEWSTATEFIELDCOUNT"]};Sys.WebForms.PageRequestManager.prototype={_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_isInAsyncPostBack:function(){return this._request!==null},add_beginRequest:function(a){this._get_eventHandlerList().addHandler("beginRequest",a)},remove_beginRequest:function(a){this._get_eventHandlerList().removeHandler("beginRequest",a)},add_endRequest:function(a){this._get_eventHandlerList().addHandler("endRequest",a)},remove_endRequest:function(a){this._get_eventHandlerList().removeHandler("endRequest",a)},add_initializeRequest:function(a){this._get_eventHandlerList().addHandler("initializeRequest",a)},remove_initializeRequest:function(a){this._get_eventHandlerList().removeHandler("initializeRequest",a)},add_pageLoaded:function(a){this._get_eventHandlerList().addHandler("pageLoaded",a)},remove_pageLoaded:function(a){this._get_eventHandlerList().removeHandler("pageLoaded",a)},add_pageLoading:function(a){this._get_eventHandlerList().addHandler("pageLoading",a)},remove_pageLoading:function(a){this._get_eventHandlerList().removeHandler("pageLoading",a)},abortPostBack:function(){if(!this._processingRequest&&this._request){this._request.get_executor().abort();this._request=null}},_cancelPendingCallbacks:function(){for(var a=0,e=window.__pendingCallbacks.length;a<e;a++){var c=window.__pendingCallbacks[a];if(c){if(!c.async)window.__synchronousCallBackIndex=-1;window.__pendingCallbacks[a]=null;var d="__CALLBACKFRAME"+a,b=document.getElementById(d);if(b)b.parentNode.removeChild(b)}}},_commitControls:function(a,b){if(a){this._updatePanelIDs=a.updatePanelIDs;this._updatePanelClientIDs=a.updatePanelClientIDs;this._updatePanelHasChildrenAsTriggers=a.updatePanelHasChildrenAsTriggers;this._asyncPostBackControlIDs=a.asyncPostBackControlIDs;this._asyncPostBackControlClientIDs=a.asyncPostBackControlClientIDs;this._postBackControlIDs=a.postBackControlIDs;this._postBackControlClientIDs=a.postBackControlClientIDs}if(typeof b!=="undefined"&&b!==null)this._asyncPostBackTimeout=b*1000},_createHiddenField:function(c,d){var b,a=document.getElementById(c);if(a)if(!a._isContained)a.parentNode.removeChild(a);else b=a.parentNode;if(!b){b=document.createElement("span");b.style.cssText="display:none !important";this._form.appendChild(b)}b.innerHTML="<input type='hidden' />";a=b.childNodes[0];a._isContained=true;a.id=a.name=c;a.value=d},_createPageRequestManagerTimeoutError:function(){var b="Sys.WebForms.PageRequestManagerTimeoutException: "+Sys.WebForms.Res.PRM_TimeoutError,a=Error.create(b,{name:"Sys.WebForms.PageRequestManagerTimeoutException"});a.popStackFrame();return a},_createPageRequestManagerServerError:function(a,d){var c="Sys.WebForms.PageRequestManagerServerErrorException: "+(d||String.format(Sys.WebForms.Res.PRM_ServerError,a)),b=Error.create(c,{name:"Sys.WebForms.PageRequestManagerServerErrorException",httpStatusCode:a});b.popStackFrame();return b},_createPageRequestManagerParserError:function(b){var c="Sys.WebForms.PageRequestManagerParserErrorException: "+String.format(Sys.WebForms.Res.PRM_ParserError,b),a=Error.create(c,{name:"Sys.WebForms.PageRequestManagerParserErrorException"});a.popStackFrame();return a},_createPostBackSettings:function(c,b,a){return {async:c,panelID:b,sourceElement:a}},_convertToClientIDs:function(a,d,c){if(a)for(var b=0,e=a.length;b<e;b++){Array.add(d,a[b]);Array.add(c,this._uniqueIDToClientID(a[b]))}},_destroyTree:function(f){if(f.nodeType===1){var d=f.childNodes;for(var b=d.length-1;b>=0;b--){var a=d[b];if(a.nodeType===1){if(a.dispose&&typeof a.dispose==="function")a.dispose();else if(a.control&&typeof a.control.dispose==="function")a.control.dispose();var e=Sys.UI.Behavior.getBehaviors(a);for(var c=e.length-1;c>=0;c--)e[c].dispose();this._destroyTree(a)}}}},dispose:function(){if(this._form){Sys.UI.DomEvent.removeHandler(this._form,"submit",this._onFormSubmitHandler);Sys.UI.DomEvent.removeHandler(this._form,"click",this._onFormElementClickHandler);Sys.UI.DomEvent.removeHandler(window,"unload",this._onWindowUnloadHandler);Sys.UI.DomEvent.removeHandler(window,"load",this._pageLoadedHandler)}if(this._originalDoPostBack){window.__doPostBack=this._originalDoPostBack;this._originalDoPostBack=null}if(this._originalDoPostBackWithOptions){window.WebForm_DoPostBackWithOptions=this._originalDoPostBackWithOptions;this._originalDoPostBackWithOptions=null}if(this._originalFireDefaultButton){window.WebForm_FireDefaultButton=this._originalFireDefaultButton;this._originalFireDefaultButton=null}if(this._originalDoCallback){window.WebForm_DoCallback=this._originalDoCallback;this._originalDoCallback=null}this._form=null;this._updatePanelIDs=null;this._updatePanelClientIDs=null;this._asyncPostBackControlIDs=null;this._asyncPostBackControlClientIDs=null;this._postBackControlIDs=null;this._postBackControlClientIDs=null;this._asyncPostBackTimeout=null;this._scrollPosition=null},_doCallback:function(d,b,c,f,a,e){if(!this.get_isInAsyncPostBack())this._originalDoCallback(d,b,c,f,a,e)},_doPostBack:function(a,e){this._additionalInput=null;var b=this._form;if(a===null||typeof a==="undefined"||this._isCrossPost){this._postBackSettings=this._createPostBackSettings(false,null,null);this._isCrossPost=false}else{var f=this._uniqueIDToClientID(a),d=document.getElementById(f);if(!d)if(Array.contains(this._asyncPostBackControlIDs,a))this._postBackSettings=this._createPostBackSettings(true,this._scriptManagerID+"|"+a,null);else if(Array.contains(this._postBackControlIDs,a))this._postBackSettings=this._createPostBackSettings(false,null,null);else{var c=this._findNearestElement(a);if(c)this._postBackSettings=this._getPostBackSettings(c,a);else this._postBackSettings=this._createPostBackSettings(false,null,null)}else this._postBackSettings=this._getPostBackSettings(d,a)}if(!this._postBackSettings.async){b.onsubmit=this._onsubmit;this._originalDoPostBack(a,e);b.onsubmit=null;return}b.__EVENTTARGET.value=a;b.__EVENTARGUMENT.value=e;this._onFormSubmit()},_doPostBackWithOptions:function(a){this._isCrossPost=a&&a.actionUrl;this._originalDoPostBackWithOptions(a)},_elementContains:function(b,a){while(a){if(a===b)return true;a=a.parentNode}return false},_endPostBack:function(a,d,f){if(this._request===d.get_webRequest()){this._processingRequest=false;this._additionalInput=null;this._request=null}var e=this._get_eventHandlerList().getHandler("endRequest"),b=false;if(e){var c=new Sys.WebForms.EndRequestEventArgs(a,f?f.dataItems:{},d);e(this,c);b=c.get_errorHandled()}if(a&&!b)throw a},_findNearestElement:function(a){while(a.length>0){var d=this._uniqueIDToClientID(a),c=document.getElementById(d);if(c)return c;var b=a.lastIndexOf("$");if(b===-1)return null;a=a.substring(0,b)}return null},_findText:function(b,a){var c=Math.max(0,a-20),d=Math.min(b.length,a+20);return b.substring(c,d)},_fireDefaultButton:function(a,d){if(a.keyCode===13){var c=a.srcElement||a.target;if(!c||c.tagName.toLowerCase()!=="textarea"){var b=document.getElementById(d);if(b&&typeof b.click!=="undefined"){this._activeDefaultButton=b;this._activeDefaultButtonClicked=false;try{b.click()}finally{this._activeDefaultButton=null}a.cancelBubble=true;if(typeof a.stopPropagation==="function")a.stopPropagation();return false}}}return true},_getPageLoadedEventArgs:function(j,e){var i=[],h=[],d=e?e.updatePanelData:null,c,g,b;if(!d){c=this._updatePanelIDs;g=null;b=null}else{c=d.updatePanelIDs;g=d.childUpdatePanelIDs;b=d.panelsToRefreshIDs}var a,f;if(b)for(a=0,f=b.length;a<f;a++)Array.add(i,document.getElementById(this._uniqueIDToClientID(b[a])));for(a=0,f=c.length;a<f;a++)if(j||Array.indexOf(g,c[a])!==-1)Array.add(h,document.getElementById(this._uniqueIDToClientID(c[a])));return new Sys.WebForms.PageLoadedEventArgs(i,h,e?e.dataItems:{})},_getPageLoadingEventArgs:function(h){var g=[],f=[],c=h.updatePanelData,b=c.oldUpdatePanelIDs,j=c.updatePanelIDs,i=c.childUpdatePanelIDs,e=c.panelsToRefreshIDs,a,d;for(a=0,d=e.length;a<d;a++)Array.add(g,document.getElementById(this._uniqueIDToClientID(e[a])));for(a=0,d=b.length;a<d;a++)if(Array.indexOf(e,b[a])===-1&&(Array.indexOf(j,b[a])===-1||Array.indexOf(i,b[a])>-1))Array.add(f,document.getElementById(this._uniqueIDToClientID(b[a])));return new Sys.WebForms.PageLoadingEventArgs(g,f,h.dataItems)},_getPostBackSettings:function(a,c){var d=a,b=null;while(a){if(a.id){if(!b&&Array.contains(this._asyncPostBackControlClientIDs,a.id))b=this._createPostBackSettings(true,this._scriptManagerID+"|"+c,d);else if(!b&&Array.contains(this._postBackControlClientIDs,a.id))return this._createPostBackSettings(false,null,null);else{var e=Array.indexOf(this._updatePanelClientIDs,a.id);if(e!==-1)if(this._updatePanelHasChildrenAsTriggers[e])return this._createPostBackSettings(true,this._updatePanelIDs[e]+"|"+c,d);else return this._createPostBackSettings(true,this._scriptManagerID+"|"+c,d)}if(!b&&this._matchesParentIDInList(a.id,this._asyncPostBackControlClientIDs))b=this._createPostBackSettings(true,this._scriptManagerID+"|"+c,d);else if(!b&&this._matchesParentIDInList(a.id,this._postBackControlClientIDs))return this._createPostBackSettings(false,null,null)}a=a.parentNode}if(!b)return this._createPostBackSettings(false,null,null);else return b},_getScrollPosition:function(){var a=document.documentElement;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else{a=document.body;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else if(this._validPosition(window.pageXOffset)||this._validPosition(window.pageYOffset))return {x:window.pageXOffset,y:window.pageYOffset};else return {x:0,y:0}}},_initializeInternal:function(a,b){if(this._prmInitialized)throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);this._prmInitialized=true;this._scriptManagerID=a;this._form=b;this._onsubmit=this._form.onsubmit;this._form.onsubmit=null;this._onFormSubmitHandler=Function.createDelegate(this,this._onFormSubmit);this._onFormElementClickHandler=Function.createDelegate(this,this._onFormElementClick);this._onWindowUnloadHandler=Function.createDelegate(this,this._onWindowUnload);Sys.UI.DomEvent.addHandler(this._form,"submit",this._onFormSubmitHandler);Sys.UI.DomEvent.addHandler(this._form,"click",this._onFormElementClickHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._onWindowUnloadHandler);this._originalDoPostBack=window.__doPostBack;if(this._originalDoPostBack)window.__doPostBack=Function.createDelegate(this,this._doPostBack);this._originalDoPostBackWithOptions=window.WebForm_DoPostBackWithOptions;if(this._originalDoPostBackWithOptions)window.WebForm_DoPostBackWithOptions=Function.createDelegate(this,this._doPostBackWithOptions);this._originalFireDefaultButton=window.WebForm_FireDefaultButton;if(this._originalFireDefaultButton)window.WebForm_FireDefaultButton=Function.createDelegate(this,this._fireDefaultButton);this._originalDoCallback=window.WebForm_DoCallback;if(this._originalDoCallback)window.WebForm_DoCallback=Function.createDelegate(this,this._doCallback);this._pageLoadedHandler=Function.createDelegate(this,this._pageLoadedInitialLoad);Sys.UI.DomEvent.addHandler(window,"load",this._pageLoadedHandler)},_matchesParentIDInList:function(c,b){for(var a=0,d=b.length;a<d;a++)if(c.startsWith(b[a]+"_"))return true;return false},_onFormElementActive:function(a,d,e){if(a.disabled)return;this._postBackSettings=this._getPostBackSettings(a,a.name);if(a.name){var b=a.tagName.toUpperCase();if(b==="INPUT"){var c=a.type;if(c==="submit")this._additionalInput=encodeURIComponent(a.name)+"="+encodeURIComponent(a.value);else if(c==="image")this._additionalInput=encodeURIComponent(a.name)+".x="+d+"&"+encodeURIComponent(a.name)+".y="+e}else if(b==="BUTTON"&&a.name.length!==0&&a.type==="submit")this._additionalInput=encodeURIComponent(a.name)+"="+encodeURIComponent(a.value)}},_onFormElementClick:function(a){this._activeDefaultButtonClicked=a.target===this._activeDefaultButton;this._onFormElementActive(a.target,a.offsetX,a.offsetY)},_onFormSubmit:function(h){var g=true,t=this._isCrossPost;this._isCrossPost=false;var e,s;if(this._onsubmit)g=this._onsubmit();if(g)for(e=0,s=this._onSubmitStatements.length;e<s;e++)if(!this._onSubmitStatements[e]()){g=false;break}if(!g){if(h)h.preventDefault();return}var n=this._form;if(t)return;if(this._activeDefaultButton&&!this._activeDefaultButtonClicked)this._onFormElementActive(this._activeDefaultButton,0,0);if(!this._postBackSettings.async)return;var a=new Sys.StringBuilder;a.append(encodeURIComponent(this._scriptManagerID)+"="+encodeURIComponent(this._postBackSettings.panelID)+"&");var v=n.elements.length;for(e=0;e<v;e++){var d=n.elements[e],f=d.name;if(typeof f==="undefined"||f===null||f.length===0||f===this._scriptManagerID)continue;var m=d.tagName.toUpperCase();if(m==="INPUT"){var k=d.type;if(k==="text"||k==="password"||k==="hidden"||(k==="checkbox"||k==="radio")&&d.checked){a.append(encodeURIComponent(f));a.append("=");a.append(encodeURIComponent(d.value));a.append("&")}}else if(m==="SELECT"){var u=d.options.length;for(var o=0;o<u;o++){var q=d.options[o];if(q.selected){a.append(encodeURIComponent(f));a.append("=");a.append(encodeURIComponent(q.value));a.append("&")}}}else if(m==="TEXTAREA"){a.append(encodeURIComponent(f));a.append("=");a.append(encodeURIComponent(d.value));a.append("&")}}a.append("__ASYNCPOST=true&");if(this._additionalInput){a.append(this._additionalInput);this._additionalInput=null}var c=new Sys.Net.WebRequest,b=n.action;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var p=b.indexOf("#");if(p!==-1)b=b.substr(0,p);var l=b.indexOf("?");if(l!==-1){var r=b.substr(0,l);if(r.indexOf("%")===-1)b=encodeURI(r)+b.substr(l)}else if(b.indexOf("%")===-1)b=encodeURI(b)}c.set_url(b);c.get_headers()["X-MicrosoftAjax"]="Delta=true";c.get_headers()["Cache-Control"]="no-cache";c.set_timeout(this._asyncPostBackTimeout);c.add_completed(Function.createDelegate(this,this._onFormSubmitCompleted));c.set_body(a.toString());var i,j=this._get_eventHandlerList().getHandler("initializeRequest");if(j){i=new Sys.WebForms.InitializeRequestEventArgs(c,this._postBackSettings.sourceElement);j(this,i);g=!i.get_cancel()}if(!g){if(h)h.preventDefault();return}this._scrollPosition=this._getScrollPosition();this.abortPostBack();j=this._get_eventHandlerList().getHandler("beginRequest");if(j){i=new Sys.WebForms.BeginRequestEventArgs(c,this._postBackSettings.sourceElement);j(this,i)}if(this._originalDoCallback)this._cancelPendingCallbacks();this._request=c;this._processingRequest=false;c.invoke();if(h)h.preventDefault()},_onFormSubmitCompleted:function(c){this._processingRequest=true;if(c.get_timedOut()){this._endPostBack(this._createPageRequestManagerTimeoutError(),c,null);return}if(c.get_aborted()){this._endPostBack(null,c,null);return}if(!this._request||c.get_webRequest()!==this._request)return;if(c.get_statusCode()!==200){this._endPostBack(this._createPageRequestManagerServerError(c.get_statusCode()),c,null);return}var a=this._parseDelta(c);if(!a)return;var b,e;if(a.asyncPostBackControlIDsNode&&a.postBackControlIDsNode&&a.updatePanelIDsNode&&a.panelsToRefreshNode&&a.childUpdatePanelIDsNode){var p=this._updatePanelIDs,h=a.childUpdatePanelIDsNode.content,n=h.length?h.split(","):[],l=this._splitNodeIntoArray(a.asyncPostBackControlIDsNode),m=this._splitNodeIntoArray(a.postBackControlIDsNode),o=this._splitNodeIntoArray(a.updatePanelIDsNode),g=this._splitNodeIntoArray(a.panelsToRefreshNode);for(b=0,e=g.length;b<e;b++){var i=this._uniqueIDToClientID(g[b]);if(!document.getElementById(i)){this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel,i)),c,a);return}}var f=this._processUpdatePanelArrays(o,l,m);f.oldUpdatePanelIDs=p;f.childUpdatePanelIDs=n;f.panelsToRefreshIDs=g;a.updatePanelData=f}a.dataItems={};var d;for(b=0,e=a.dataItemNodes.length;b<e;b++){d=a.dataItemNodes[b];a.dataItems[d.id]=d.content}for(b=0,e=a.dataItemJsonNodes.length;b<e;b++){d=a.dataItemJsonNodes[b];a.dataItems[d.id]=Sys.Serialization.JavaScriptSerializer.deserialize(d.content)}var k=this._get_eventHandlerList().getHandler("pageLoading");if(k)k(this,this._getPageLoadingEventArgs(a));Sys._ScriptLoader.readLoadedScripts();Sys.Application.beginCreateComponents();var j=Sys._ScriptLoader.getInstance();this._queueScripts(j,a.scriptBlockNodes,true,false);this._processingRequest=true;j.loadScripts(0,Function.createDelegate(this,Function.createCallback(this._scriptIncludesLoadComplete,a)),Function.createDelegate(this,Function.createCallback(this._scriptIncludesLoadFailed,a)),null)},_onWindowUnload:function(){this.dispose()},_pageLoaded:function(a,c){var b=this._get_eventHandlerList().getHandler("pageLoaded");if(b)b(this,this._getPageLoadedEventArgs(a,c));if(!a)Sys.Application.raiseLoad()},_pageLoadedInitialLoad:function(){this._pageLoaded(true,null)},_parseDelta:function(g){var c=g.get_responseData(),d,h,D,E,C,b=0,e=null,i=[];while(b<c.length){d=c.indexOf("|",b);if(d===-1){e=this._findText(c,b);break}h=parseInt(c.substring(b,d),10);if(h%1!==0){e=this._findText(c,b);break}b=d+1;d=c.indexOf("|",b);if(d===-1){e=this._findText(c,b);break}D=c.substring(b,d);b=d+1;d=c.indexOf("|",b);if(d===-1){e=this._findText(c,b);break}E=c.substring(b,d);b=d+1;if(b+h>=c.length){e=this._findText(c,c.length);break}C=c.substr(b,h);b+=h;if(c.charAt(b)!=="|"){e=this._findText(c,b);break}b++;Array.add(i,{type:D,id:E,content:C})}if(e){this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails,e)),g,null);return null}var w=[],u=[],o=[],v=[],r=[],B=[],z=[],y=[],t=[],q=[],k,n,s,l,m,p,x;for(var j=0,F=i.length;j<F;j++){var a=i[j];switch(a.type){case "updatePanel":Array.add(w,a);break;case "hiddenField":Array.add(u,a);break;case "arrayDeclaration":Array.add(o,a);break;case "scriptBlock":Array.add(v,a);break;case "scriptStartupBlock":Array.add(r,a);break;case "expando":Array.add(B,a);break;case "onSubmit":Array.add(z,a);break;case "asyncPostBackControlIDs":k=a;break;case "postBackControlIDs":n=a;break;case "updatePanelIDs":s=a;break;case "asyncPostBackTimeout":l=a;break;case "childUpdatePanelIDs":m=a;break;case "panelsToRefreshIDs":p=a;break;case "formAction":x=a;break;case "dataItem":Array.add(y,a);break;case "dataItemJson":Array.add(t,a);break;case "scriptDispose":Array.add(q,a);break;case "pageRedirect":if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var f=document.createElement("a");f.style.display="none";f.attachEvent("onclick",A);f.href=a.content;document.body.appendChild(f);f.click();f.detachEvent("onclick",A);document.body.removeChild(f);function A(a){a.cancelBubble=true}}else window.location.href=a.content;return;case "error":this._endPostBack(this._createPageRequestManagerServerError(Number.parseInvariant(a.id),a.content),g,null);return null;case "pageTitle":document.title=a.content;break;case "focus":this._controlIDToFocus=a.content;break;default:this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken,a.type)),g,null);return null}}return {executor:g,updatePanelNodes:w,hiddenFieldNodes:u,arrayDeclarationNodes:o,scriptBlockNodes:v,scriptStartupNodes:r,expandoNodes:B,onSubmitNodes:z,dataItemNodes:y,dataItemJsonNodes:t,scriptDisposeNodes:q,asyncPostBackControlIDsNode:k,postBackControlIDsNode:n,updatePanelIDsNode:s,asyncPostBackTimeoutNode:l,childUpdatePanelIDsNode:m,panelsToRefreshNode:p,formActionNode:x}},_processUpdatePanelArrays:function(e,l,n){var d,c,b;if(e){var f=e.length;d=new Array(f);c=new Array(f);b=new Array(f);for(var a=0;a<f;a++){var k=e[a].substr(1),m=e[a].charAt(0)==="t";b[a]=m;d[a]=k;c[a]=this._uniqueIDToClientID(k)}}else{d=[];c=[];b=[]}var i=[],g=[];this._convertToClientIDs(l,i,g);var j=[],h=[];this._convertToClientIDs(n,j,h);return {updatePanelIDs:d,updatePanelClientIDs:c,updatePanelHasChildrenAsTriggers:b,asyncPostBackControlIDs:i,asyncPostBackControlClientIDs:g,postBackControlIDs:j,postBackControlClientIDs:h}},_queueScripts:function(scriptLoader,scriptBlockNodes,queueIncludes,queueBlocks){for(var i=0,l=scriptBlockNodes.length;i<l;i++){var scriptBlockType=scriptBlockNodes[i].id;switch(scriptBlockType){case "ScriptContentNoTags":if(!queueBlocks)continue;scriptLoader.queueScriptBlock(scriptBlockNodes[i].content);break;case "ScriptContentWithTags":var scriptTagAttributes;eval("scriptTagAttributes = "+scriptBlockNodes[i].content);if(scriptTagAttributes.src){if(!queueIncludes||Sys._ScriptLoader.isScriptLoaded(scriptTagAttributes.src))continue}else if(!queueBlocks)continue;scriptLoader.queueCustomScriptTag(scriptTagAttributes);break;case "ScriptPath":if(!queueIncludes||Sys._ScriptLoader.isScriptLoaded(scriptBlockNodes[i].content))continue;scriptLoader.queueScriptReference(scriptBlockNodes[i].content)}}},_registerDisposeScript:function(a,b){if(!this._scriptDisposes[a])this._scriptDisposes[a]=[b];else Array.add(this._scriptDisposes[a],b)},_scriptIncludesLoadComplete:function(e,b){if(b.executor.get_webRequest()!==this._request)return;this._commitControls(b.updatePanelData,b.asyncPostBackTimeoutNode?b.asyncPostBackTimeoutNode.content:null);if(b.formActionNode)this._form.action=b.formActionNode.content;var a,d,c;for(a=0,d=b.updatePanelNodes.length;a<d;a++){c=b.updatePanelNodes[a];var j=document.getElementById(c.id);if(!j){this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel,c.id)),b.executor,b);return}this._updatePanel(j,c.content)}for(a=0,d=b.scriptDisposeNodes.length;a<d;a++){c=b.scriptDisposeNodes[a];this._registerDisposeScript(c.id,c.content)}for(a=0,d=this._transientFields.length;a<d;a++){var g=document.getElementById(this._transientFields[a]);if(g){var k=g._isContained?g.parentNode:g;k.parentNode.removeChild(k)}}for(a=0,d=b.hiddenFieldNodes.length;a<d;a++){c=b.hiddenFieldNodes[a];this._createHiddenField(c.id,c.content)}if(b.scriptsFailed)throw Sys._ScriptLoader._errorScriptLoadFailed(b.scriptsFailed.src,b.scriptsFailed.multipleCallbacks);this._queueScripts(e,b.scriptBlockNodes,false,true);var i="";for(a=0,d=b.arrayDeclarationNodes.length;a<d;a++){c=b.arrayDeclarationNodes[a];i+="Sys.WebForms.PageRequestManager._addArrayElement('"+c.id+"', "+c.content+");\r\n"}var h="";for(a=0,d=b.expandoNodes.length;a<d;a++){c=b.expandoNodes[a];h+=c.id+" = "+c.content+"\r\n"}if(i.length)e.queueScriptBlock(i);if(h.length)e.queueScriptBlock(h);this._queueScripts(e,b.scriptStartupNodes,true,true);var f="";for(a=0,d=b.onSubmitNodes.length;a<d;a++){if(a===0)f="Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, function() {\r\n";f+=b.onSubmitNodes[a].content+"\r\n"}if(f.length){f+="\r\nreturn true;\r\n});\r\n";e.queueScriptBlock(f)}e.loadScripts(0,Function.createDelegate(this,Function.createCallback(this._scriptsLoadComplete,b)),null,null)},_scriptIncludesLoadFailed:function(d,c,b,a){a.scriptsFailed={src:c.src,multipleCallbacks:b};this._scriptIncludesLoadComplete(d,a)},_scriptsLoadComplete:function(f,c){var e=c.executor;if(window.__theFormPostData)window.__theFormPostData="";if(window.__theFormPostCollection)window.__theFormPostCollection=[];if(window.WebForm_InitCallback)window.WebForm_InitCallback();if(this._scrollPosition){if(window.scrollTo)window.scrollTo(this._scrollPosition.x,this._scrollPosition.y);this._scrollPosition=null}Sys.Application.endCreateComponents();this._pageLoaded(false,c);this._endPostBack(null,e,c);if(this._controlIDToFocus){var a,d;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var b=$get(this._controlIDToFocus);a=b;if(b&&!WebForm_CanFocus(b))a=WebForm_FindFirstFocusableChild(b);if(a&&typeof a.contentEditable!=="undefined"){d=a.contentEditable;a.contentEditable=false}else a=null}WebForm_AutoFocus(this._controlIDToFocus);if(a)a.contentEditable=d;this._controlIDToFocus=null}},_splitNodeIntoArray:function(b){var a=b.content,c=a.length?a.split(","):[];return c},_uniqueIDToClientID:function(a){return a.replace(/\$/g,"_")},_updateControls:function(d,a,c,b){this._commitControls(this._processUpdatePanelArrays(d,a,c),b)},_updatePanel:function(updatePanelElement,rendering){for(var updatePanelID in this._scriptDisposes)if(this._elementContains(updatePanelElement,document.getElementById(updatePanelID))){var disposeScripts=this._scriptDisposes[updatePanelID];for(var i=0,l=disposeScripts.length;i<l;i++)eval(disposeScripts[i]);delete this._scriptDisposes[updatePanelID]}this._destroyTree(updatePanelElement);updatePanelElement.innerHTML=rendering},_validPosition:function(a){return typeof a!=="undefined"&&a!==null&&a!==0}};Sys.WebForms.PageRequestManager.getInstance=function(){var a=Sys.WebForms.PageRequestManager._instance;if(!a)a=Sys.WebForms.PageRequestManager._instance=new Sys.WebForms.PageRequestManager;return a};Sys.WebForms.PageRequestManager._addArrayElement=function(a){if(!window[a])window[a]=[];for(var b=1,c=arguments.length;b<c;b++)Array.add(window[a],arguments[b])};Sys.WebForms.PageRequestManager._initialize=function(a,b){Sys.WebForms.PageRequestManager.getInstance()._initializeInternal(a,b)};Sys.WebForms.PageRequestManager.registerClass("Sys.WebForms.PageRequestManager");Sys.UI._UpdateProgress=function(a){Sys.UI._UpdateProgress.initializeBase(this,[a]);this._displayAfter=500;this._dynamicLayout=true;this._associatedUpdatePanelId=null;this._beginRequestHandlerDelegate=null;this._startDelegate=null;this._endRequestHandlerDelegate=null;this._pageRequestManager=null;this._timerCookie=null};Sys.UI._UpdateProgress.prototype={get_displayAfter:function(){return this._displayAfter},set_displayAfter:function(a){this._displayAfter=a},get_dynamicLayout:function(){return this._dynamicLayout},set_dynamicLayout:function(a){this._dynamicLayout=a},get_associatedUpdatePanelId:function(){return this._associatedUpdatePanelId},set_associatedUpdatePanelId:function(a){this._associatedUpdatePanelId=a},_clearTimeout:function(){if(this._timerCookie){window.clearTimeout(this._timerCookie);this._timerCookie=null}},_handleBeginRequest:function(d,c){var a=c.get_postBackElement(),b=!this._associatedUpdatePanelId;while(!b&&a){if(a.id&&this._associatedUpdatePanelId===a.id)b=true;a=a.parentNode}if(b)this._timerCookie=window.setTimeout(this._startDelegate,this._displayAfter)},_startRequest:function(){if(this._pageRequestManager.get_isInAsyncPostBack())if(this._dynamicLayout)this.get_element().style.display="block";else this.get_element().style.visibility="visible";this._timerCookie=null},_handleEndRequest:function(){if(this._dynamicLayout)this.get_element().style.display="none";else this.get_element().style.visibility="hidden";this._clearTimeout()},dispose:function(){if(this._beginRequestHandlerDelegate!==null){this._pageRequestManager.remove_beginRequest(this._beginRequestHandlerDelegate);this._pageRequestManager.remove_endRequest(this._endRequestHandlerDelegate);this._beginRequestHandlerDelegate=null;this._endRequestHandlerDelegate=null}this._clearTimeout();Sys.UI._UpdateProgress.callBaseMethod(this,"dispose")},initialize:function(){Sys.UI._UpdateProgress.callBaseMethod(this,"initialize");this._beginRequestHandlerDelegate=Function.createDelegate(this,this._handleBeginRequest);this._endRequestHandlerDelegate=Function.createDelegate(this,this._handleEndRequest);this._startDelegate=Function.createDelegate(this,this._startRequest);if(Sys.WebForms&&Sys.WebForms.PageRequestManager)this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();if(this._pageRequestManager!==null){this._pageRequestManager.add_beginRequest(this._beginRequestHandlerDelegate);this._pageRequestManager.add_endRequest(this._endRequestHandlerDelegate)}}};Sys.UI._UpdateProgress.registerClass("Sys.UI._UpdateProgress",Sys.UI.Control);
Type.registerNamespace('Sys.WebForms');Sys.WebForms.Res={"PRM_UnknownToken":"Unknown token: \u0027{0}\u0027.","PRM_MissingPanel":"Could not find UpdatePanel with ID \u0027{0}\u0027. If it is being updated dynamically then it must be inside another UpdatePanel.","PRM_ServerError":"An unknown error occurred while processing the request on the server. The status code returned from the server was: {0}","PRM_ParserError":"The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.\r\nDetails: {0}","PRM_TimeoutError":"The server request timed out.","PRM_ParserErrorDetails":"Error parsing near \u0027{0}\u0027.","PRM_CannotRegisterTwice":"The PageRequestManager cannot be initialized more than once."};
/*!
 * jQuery JavaScript Library v1.4
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://docs.jquery.com/License
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Jan 13 15:23:05 2010 -0500
 */
(function(A,w){function oa(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(oa,1);return}c.ready()}}function La(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function $(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var o in b)$(a,o,b[o],f,e,d);return a}if(d!==w){f=!i&&f&&c.isFunction(d);for(o=0;o<j;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,i);return a}return j?
e(a[0],b):null}function K(){return(new Date).getTime()}function aa(){return false}function ba(){return true}function pa(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function qa(a){var b=true,d=[],f=[],e=arguments,i,j,o,p,n,t=c.extend({},c.data(this,"events").live);for(p in t){j=t[p];if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete t[p]}i=c(a.target).closest(f,a.currentTarget);
n=0;for(l=i.length;n<l;n++)for(p in t){j=t[p];o=i[n].elem;f=null;if(i[n].selector===j.selector){if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];if(!f||f!==o)d.push({elem:o,fn:j})}}n=0;for(l=d.length;n<l;n++){i=d[n];a.currentTarget=i.elem;a.data=i.fn.data;if(i.fn.apply(i.elem,e)===false){b=false;break}}return b}function ra(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"&")].join(".")}function sa(a){return!a||!a.parentNode||a.parentNode.nodeType===
11}function ta(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)}}})}function ua(a,b,d){var f,e,i;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0){e=true;if(i=c.fragments[a[0]])if(i!==1)f=i}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:s;f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=
i?f:1;return{fragment:f,cacheable:e}}function T(a){for(var b=0,d,f;(d=a[b])!=null;b++)if(!c.noData[d.nodeName.toLowerCase()]&&(f=d[H]))delete c.cache[f]}function L(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ma=A.jQuery,Na=A.$,s=A.document,U,Oa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Pa=/^.[^:#\[\.,]*$/,Qa=/\S/,
Ra=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Sa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],M,ca=Object.prototype.toString,da=Object.prototype.hasOwnProperty,ea=Array.prototype.push,R=Array.prototype.slice,V=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Oa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Sa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];
c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ua([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return U.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a)}else return!b||b.jquery?(b||U).find(a):c(b).find(a);else if(c.isFunction(a))return U.ready(a);if(a.selector!==w){this.selector=a.selector;
this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a,this)},selector:"",jquery:"1.4",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=
0;ea.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);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(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||
c(null)},push:ea,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(i in e){j=a[i];o=e[i];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(o)?[]:{};a[i]=c.extend(f,j,o)}else if(o!==w)a[i]=
o}return a};c.extend({noConflict:function(a){A.$=Na;if(a)A.jQuery=Ma;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",M,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",
M);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&oa()}}},isFunction:function(a){return ca.call(a)==="[object Function]"},isArray:function(a){return ca.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||ca.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!da.call(a,"constructor")&&!da.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===w||da.call(a,b)},
isEmptyObject:function(a){for(var b in a)return false;return true},noop:function(){},globalEval:function(a){if(a&&Qa.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,i=a.length,j=i===w||c.isFunction(a);
if(d)if(j)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<i;){if(b.apply(a[e++],d)===false)break}else if(j)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Ra,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ea.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=
0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,i=0,j=a.length;i<j;i++){e=b(a[i],i,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b===
"string"){d=a;a=d[b];b=w}else if(b&&!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){var b={browser:""};a=a.toLowerCase();if(/webkit/.test(a))b={browser:"webkit",version:/webkit[\/ ]([\w.]+)/};else if(/opera/.test(a))b={browser:"opera",version:/version/.test(a)?/version[\/ ]([\w.]+)/:/opera[\/ ]([\w.]+)/};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&&
!/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/};b.version=(b.version&&b.version.exec(a)||[0,"0"])[1];return b},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=true;if(V)c.inArray=function(a,b){return V.call(b,a)};U=c(s);if(s.addEventListener)M=function(){s.removeEventListener("DOMContentLoaded",M,false);c.ready()};else if(s.attachEvent)M=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",
M);c.ready()}};if(V)c.inArray=function(a,b){return V.call(b,a)};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+K();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,
htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,
a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function o(){c.support.noCloneEvent=false;d.detachEvent("onclick",o)});d.cloneNode(true).fireEvent("onclick")}c(function(){var o=s.createElement("div");o.style.width=o.style.paddingLeft="1px";s.body.appendChild(o);c.boxModel=c.support.boxModel=o.offsetWidth===2;s.body.removeChild(o).style.display="none"});a=function(o){var p=s.createElement("div");o="on"+o;var n=o in
p;if(!n){p.setAttribute(o,"return;");n=typeof p[o]==="function"}return n};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var H="jQuery"+K(),Ta=0,ya={},Ua={};c.extend({cache:{},expando:H,noData:{embed:true,object:true,applet:true},data:function(a,
b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var f=a[H],e=c.cache;if(!b&&!f)return null;f||(f=++Ta);if(typeof b==="object"){a[H]=f;e=e[f]=c.extend(true,{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Ua:(e[f]={});if(d!==w){a[H]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var d=a[H],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[H]}catch(i){a.removeAttribute&&
a.removeAttribute(H)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,
a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,
a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var za=/[\n\t]/g,fa=/\s+/,Va=/\r/g,Wa=/href|src|style/,Xa=/(button|input)/i,Ya=/(button|input|object|select|textarea)/i,Za=/^(a|area)$/i,Aa=/radio|checkbox/;c.fn.extend({attr:function(a,
b){return $(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.addClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,o=b.length;j<o;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+=
" "+b[j]}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.removeClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var i=(" "+e.className+" ").replace(za," "),j=0,o=b.length;j<o;j++)i=i.replace(" "+b[j]+" "," ");e.className=i.substring(1,i.length-1)}else e.className=""}return this},toggleClass:function(a,
b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),o=b,p=a.split(fa);e=p[i++];){o=f?o:!j.hasClass(e);j[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=
" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(za," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(Aa.test(b.type)&&
!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Va,"")}return w}var o=c.isFunction(a);return this.each(function(p){var n=c(this),t=a;if(this.nodeType===1){if(o)t=a.call(this,p,n.val());if(typeof t==="number")t+="";if(c.isArray(t)&&Aa.test(this.type))this.checked=c.inArray(n.val(),t)>=0;else if(c.nodeName(this,"select")){var z=c.makeArray(t);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),z)>=0});if(!z.length)this.selectedIndex=
-1}else this.value=t}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Wa.test(b);if(b in a&&f&&!i){if(e){if(b==="type"&&Xa.test(a.nodeName)&&a.parentNode)throw"type property can't be changed";a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;
if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Ya.test(a.nodeName)||Za.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var $a=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===
3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;if(!d.guid)d.guid=c.guid++;if(f!==w){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):w};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var o,p=0;o=b[p++];){var n=o.split(".");o=n.shift();d.type=n.slice(0).sort().join(".");var t=e[o],z=this.special[o]||{};if(!t){t=e[o]={};
if(!z.setup||z.setup.call(a,f,n,d)===false)if(a.addEventListener)a.addEventListener(o,i,false);else a.attachEvent&&a.attachEvent("on"+o,i)}if(z.add)if((n=z.add.call(a,d,f,n,t))&&c.isFunction(n)){n.guid=n.guid||d.guid;d=n}t[d.guid]=d;this.global[o]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===w||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);
for(var o=0;i=b[o++];){var p=i.split(".");i=p.shift();var n=!p.length,t=c.map(p.slice(0).sort(),$a);t=new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.)?")+"(\\.|$)");var z=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var B in f[i])if(n||t.test(f[i][B].type))delete f[i][B];z.remove&&z.remove.call(a,p,j);for(e in f[i])break;if(!e){if(!z.teardown||z.teardown.call(a,p)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+
i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(B=c.data(a,"handle"))B.elem=null;c.removeData(a,"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[H]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;var i=c.data(d,"handle");i&&i.apply(d,b);var j,o;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){j=d[e];o=d["on"+e]}}catch(p){}i=c.nodeName(d,"a")&&e==="click";if(!f&&j&&!a.isDefaultPrevented()&&!i){this.triggered=true;try{d[e]()}catch(n){}}else if(o&&d["on"+e].apply(d,b)===false)a.result=false;this.triggered=false;if(!a.isPropagationStopped())(d=d.parentNode||d.ownerDocument)&&c.event.trigger(a,b,d,true)},
handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.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(a){if(a[H])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||
s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&
a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;c.event.add(this,b.live,qa,b)},remove:function(a){if(a.length){var b=0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],qa)}},special:{}},beforeunload:{setup:function(a,
b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=K();this[H]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ba;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=
ba;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ba;this.stopPropagation()},isDefaultPrevented:aa,isPropagationStopped:aa,isImmediatePropagationStopped:aa};var Ba=function(a){for(var b=a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ca=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",
mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+
d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>
-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ha(a,b){var d=a.target,f,e;if(!(!ga.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Da(d);if(e!==f){if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",e);if(d.type!=="select"&&(f!=null||e)){a.type="change";return c.event.trigger(a,b,this)}}}}c.event.special.change={filters:{focusout:ha,click:function(a){var b=a.target,d=b.type;if(d===
"radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ha.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ha.call(this,a)},beforeactivate:function(a){a=a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Da(a))}},setup:function(a,b,d){for(var f in W)c.event.add(this,f+".specialChange."+d.guid,W[f]);return ga.test(this.nodeName)},
remove:function(a,b){for(var d in W)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),W[d]);return ga.test(this.nodeName)}};var W=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,
f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){thisObject=e;e=f;f=w}var j=b==="one"?c.proxy(e,function(o){c(this).unbind(o,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e,thisObject):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,
b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||
a)},live:function(a,b,d){if(c.isFunction(b)){d=b;b=w}c(this.context).bind(ra(a,this.selector),{data:b,selector:this.selector,live:a},d);return this},die:function(a,b){c(this.context).unbind(ra(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});c.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(a,b){c.fn[b]=function(d){return d?
this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",k,m=0;g[m];m++){k=g[m];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===
k){y=m[u.sizset];break}if(u.nodeType===1&&!q){u.sizcache=k;u.sizset=r}if(u.nodeName.toLowerCase()===h){y=u;break}u=u[g]}m[r]=y}}}function d(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===k){y=m[u.sizset];break}if(u.nodeType===1){if(!q){u.sizcache=k;u.sizset=r}if(typeof h!=="string"){if(u===h){y=true;break}}else if(p.filter(h,[u]).length>0){y=u;break}}u=u[g]}m[r]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,i=Object.prototype.toString,j=false,o=true;[0,0].sort(function(){o=false;return 0});var p=function(g,h,k,m){k=k||[];var r=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return k;for(var q=[],v,u,y,S,I=true,N=x(h),J=g;(f.exec(""),v=f.exec(J))!==null;){J=v[3];q.push(v[1]);if(v[2]){S=v[3];break}}if(q.length>1&&t.exec(g))if(q.length===2&&n.relative[q[0]])u=ia(q[0]+q[1],h);else for(u=n.relative[q[0]]?[h]:p(q.shift(),h);q.length;){g=q.shift();if(n.relative[g])g+=q.shift();
u=ia(g,u)}else{if(!m&&q.length>1&&h.nodeType===9&&!N&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){v=p.find(q.shift(),h,N);h=v.expr?p.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:q.pop(),set:B(m)}:p.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&h.parentNode?h.parentNode:h,N);u=v.expr?p.filter(v.expr,v.set):v.set;if(q.length>0)y=B(u);else I=false;for(;q.length;){var E=q.pop();v=E;if(n.relative[E])v=q.pop();else E="";if(v==null)v=h;n.relative[E](y,v,N)}}else y=[]}y||(y=u);if(!y)throw"Syntax error, unrecognized expression: "+
(E||g);if(i.call(y)==="[object Array]")if(I)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&F(h,y[g])))k.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&k.push(u[g]);else k.push.apply(k,y);else B(y,k);if(S){p(S,r,k,m);p.uniqueSort(k)}return k};p.uniqueSort=function(g){if(D){j=o;g.sort(D);if(j)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};p.matches=function(g,h){return p(g,null,null,h)};p.find=function(g,h,k){var m,r;if(!g)return[];
for(var q=0,v=n.order.length;q<v;q++){var u=n.order[q];if(r=n.leftMatch[u].exec(g)){var y=r[1];r.splice(1,1);if(y.substr(y.length-1)!=="\\"){r[1]=(r[1]||"").replace(/\\/g,"");m=n.find[u](r,h,k);if(m!=null){g=g.replace(n.match[u],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};p.filter=function(g,h,k,m){for(var r=g,q=[],v=h,u,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var I in n.filter)if((u=n.leftMatch[I].exec(g))!=null&&u[2]){var N=n.filter[I],J,E;E=u[1];y=false;u.splice(1,1);if(E.substr(E.length-
1)!=="\\"){if(v===q)q=[];if(n.preFilter[I])if(u=n.preFilter[I](u,v,k,q,m,S)){if(u===true)continue}else y=J=true;if(u)for(var X=0;(E=v[X])!=null;X++)if(E){J=N(E,u,X,v);var Ea=m^!!J;if(k&&J!=null)if(Ea)y=true;else v[X]=false;else if(Ea){q.push(E);y=true}}if(J!==w){k||(v=q);g=g.replace(n.match[I],"");if(!y)return[];break}}}if(g===r)if(y==null)throw"Syntax error, unrecognized expression: "+g;else break;r=g}return v};var n=p.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(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var k=typeof h==="string",m=k&&!/\W/.test(h);k=k&&!m;if(m)h=h.toLowerCase();m=0;for(var r=g.length,q;m<r;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=k||q&&q.nodeName.toLowerCase()===h?q||false:q===h}k&&p.filter(h,g,true)},">":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,r=g.length;m<r;m++){var q=g[m];if(q){k=q.parentNode;g[m]=k.nodeName.toLowerCase()===h?k:false}}}else{m=0;for(r=g.length;m<r;m++)if(q=g[m])g[m]=
k?q.parentNode:q.parentNode===h;k&&p.filter(h,g,true)}},"":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("parentNode",h,m,g,q,k)},"~":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("previousSibling",h,m,g,q,k)}},find:{ID:function(g,h,k){if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var k=[];
h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,m,r,q){h=g[1].replace(/\\/g,"");if(!q&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,m,r){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=p(g[3],null,null,h);else{g=p.filter(g[3],h,k,true^r);k||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!p(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,k,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return h<k[3]-0},gt:function(g,h,k){return h>k[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,m){var r=h[1],q=n.filters[r];if(q)return q(g,k,h,m);else if(r==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(r==="not"){h=
h[3];k=0;for(m=h.length;k<m;k++)if(h[k]===g)return false;return true}else throw"Syntax error, unrecognized expression: "+r;},CHILD:function(g,h){var k=h[1],m=g;switch(k){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(k==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":k=h[2];var r=h[3];if(k===1&&r===0)return true;h=h[0];var q=g.parentNode;if(q&&(q.sizcache!==h||!g.nodeIndex)){var v=0;for(m=q.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;q.sizcache=h}g=g.nodeIndex-r;return k===0?g===0:g%k===0&&g/k>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=n.attrHandle[k]?n.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?k===h:m==="*="?k.indexOf(h)>=0:m==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:m==="!="?k!==h:m==="^="?k.indexOf(h)===0:m==="$="?k.substr(k.length-h.length)===h:m==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,m){var r=n.setFilters[h[2]];if(r)return r(g,k,h,m)}}},t=n.match.POS;for(var z in n.match){n.match[z]=new RegExp(n.match[z].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[z]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[z].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var B=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){B=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,m=g.length;k<m;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);return h}}var D;if(s.documentElement.compareDocumentPosition)D=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)j=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)j=true;return g};else if("sourceIndex"in s.documentElement)D=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)j=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)j=true;return g};else if(s.createRange)D=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)j=true;return g.ownerDocument?-1:1}var k=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();k.setStart(g,0);k.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=k.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)j=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var k=s.documentElement;k.insertBefore(g,k.firstChild);if(s.getElementById(h)){n.find.ID=function(m,r,q){if(typeof r.getElementById!=="undefined"&&!q)return(r=r.getElementById(m[1]))?r.id===m[1]||typeof r.getAttributeNode!=="undefined"&&
r.getAttributeNode("id").nodeValue===m[1]?[r]:w:[]};n.filter.ID=function(m,r){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===r}}k.removeChild(g);k=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;k[m];m++)k[m].nodeType===1&&h.push(k[m]);k=h}return k};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=p,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){p=function(m,r,q,v){r=r||s;if(!v&&r.nodeType===9&&!x(r))try{return B(r.querySelectorAll(m),q)}catch(u){}return g(m,r,q,v)};for(var k in g)p[k]=g[k];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,k,m){if(typeof k.getElementsByClassName!=="undefined"&&!m)return k.getElementsByClassName(h[1])};g=null}}})();var F=s.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,
h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ia=function(g,h){var k=[],m="",r;for(h=h.nodeType?[h]:h;r=n.match.PSEUDO.exec(g);){m+=r[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;r=0;for(var q=h.length;r<q;r++)p(g,h[r],k);return p.filter(m,k)};c.find=p;c.expr=p.selectors;c.expr[":"]=c.expr.filters;c.unique=p.uniqueSort;c.getText=a;c.isXMLDoc=x;c.contains=F})();var ab=/Until$/,bb=/^(?:parents|prevUntil|prevAll)/,
cb=/,/;R=Array.prototype.slice;var Fa=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,i){return!!b.call(e,i,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Pa.test(b))return c.filter(b,f,!d);else b=c.filter(b,a)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Fa(this,a,false),"not",a)},filter:function(a){return this.pushStack(Fa(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i=
{},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(sa(a[0])||sa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);ab.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||cb.test(f))&&bb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ga=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,db=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,hb=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},G={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,"",""]};G.optgroup=G.option;G.tbody=G.tfoot=G.colgroup=G.caption=G.thead;G.th=G.td;if(!c.support.htmlSerialize)G._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);
return d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.getText(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(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(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,
"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===
1?this[0].innerHTML.replace(Ga,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!Y.test(a))&&!G[(Ha.exec(a)||["",""])[1].toLowerCase()])try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){T(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){c.isFunction(a)||(a=c(a).detach());return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(t){return c.nodeName(t,"table")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}var e,i,j=a[0],o=[];if(c.isFunction(j))return this.each(function(t){var z=
c(this);a[0]=j.call(this,t,b?z.html():w);return z.domManip(a,b,d)});if(this[0]){e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{fragment:a[0].parentNode}:ua(a,this,o);if(i=e.fragment.firstChild){b=b&&c.nodeName(i,"tr");for(var p=0,n=this.length;p<n;p++)d.call(b?f(this[p],i):this[p],e.cacheable||this.length>1||p>0?e.fragment.cloneNode(true):e.fragment)}o&&c.each(o,La)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},
function(a,b){c.fn[a]=function(d){var f=[];d=c(d);for(var e=0,i=d.length;e<i;e++){var j=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),j);f=f.concat(j)}return this.pushStack(f,a,d.selector)}});c.each({remove:function(a,b){if(!a||c.filter(a,[this]).length){if(!b&&this.nodeType===1){T(this.getElementsByTagName("*"));T([this])}this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(this.nodeType===1&&T(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)}},
function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j==="string"){j=j.replace(db,hb);var o=(Ha.exec(j)||["",""])[1].toLowerCase(),p=G[o]||G._default,n=p[0];i=b.createElement("div");for(i.innerHTML=p[1]+j+p[2];n--;)i=i.lastChild;
if(!c.support.tbody){n=fb.test(j);o=o==="table"&&!n?i.firstChild&&i.firstChild.childNodes:p[1]==="<table>"&&!n?i.childNodes:[];for(p=o.length-1;p>=0;--p)c.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!c.support.leadingWhitespace&&Y.test(j)&&i.insertBefore(b.createTextNode(Y.exec(j)[0]),i.firstChild);j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()===
"text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e}});var ib=/z-?index|font-?weight|opacity|zoom|line-?height/i,Ia=/alpha\([^)]*\)/,Ja=/opacity=([^)]*)/,ja=/float/i,ka=/-([a-z])/ig,jb=/([A-Z])/g,kb=/^-?\d+(?:px)?$/i,lb=/^-?\d/,mb={position:"absolute",visibility:"hidden",display:"block"},nb=["Left","Right"],ob=["Top","Bottom"],pb=s.defaultView&&
s.defaultView.getComputedStyle,Ka=c.support.cssFloat?"cssFloat":"styleFloat",la=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return $(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!ib.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""===
"NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Ia.test(a)?a.replace(Ia,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ja.exec(f.filter)[1])/100+"":""}if(ja.test(b))b=Ka;b=b.replace(ka,la);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,i=b==="width"?nb:ob;function j(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=
parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,mb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Ja.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ja.test(b))b=Ka;if(!d&&e&&e[b])f=e[b];else if(pb){if(ja.test(b))b="float";b=b.replace(jb,"-$1").toLowerCase();e=
a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ka,la);f=a.currentStyle[b]||a.currentStyle[d];if(!kb.test(f)&&lb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=
f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var qb=K(),rb=/<script(.|\s)*?\/script>/gi,sb=/select|textarea/i,tb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,O=/=\?(&|$)/,ma=/\?/,ub=/(\?|&)_=.*?(&|$)/,vb=/^(\w+:)?\/\/([^\/?#]+)/,
wb=/%20/g;c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!=="string")return this._load(a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}c.ajax({url:a,type:f,dataType:"html",data:b,context:this,complete:function(i,j){if(j==="success"||j==="notmodified")this.html(e?c("<div />").append(i.responseText.replace(rb,
"")).find(e):i.responseText);d&&this.each(d,[i.responseText,j,i])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||sb.test(this.nodeName)||tb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});
c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},
ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.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(a){function b(){e.success&&e.success.call(p,o,j,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(p,x,j);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(r,q){(e.context?c(e.context):c.event).trigger(r,q)}var e=c.extend(true,{},c.ajaxSettings,a),i,j,o,p=e.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,
e.traditional);if(e.dataType==="jsonp"){if(n==="GET")O.test(e.url)||(e.url+=(ma.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!O.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&O.test(e.data)||O.test(e.url))){i=e.jsonpCallback||"jsonp"+qb++;if(e.data)e.data=(e.data+"").replace(O,"="+i+"$1");e.url=e.url.replace(O,"="+i+"$1");e.dataType="script";A[i]=A[i]||function(r){o=r;b();d();A[i]=w;try{delete A[i]}catch(q){}B&&
B.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&n==="GET"){var t=K(),z=e.url.replace(ub,"$1_="+t+"$2");e.url=z+(z===e.url?(ma.test(e.url)?"&":"?")+"_="+t:"")}if(e.data&&n==="GET")e.url+=(ma.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");t=(t=vb.exec(e.url))&&(t[1]&&t[1]!==location.protocol||t[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&t){var B=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");
C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!i){var D=false;C.onload=C.onreadystatechange=function(){if(!D&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){D=true;b();d();C.onload=C.onreadystatechange=null;B&&C.parentNode&&B.removeChild(C)}}}B.insertBefore(C,B.firstChild);return w}var F=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",
e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}t||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ia){}if(e.beforeSend&&e.beforeSend.call(p,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",
[x,e]);var g=x.onreadystatechange=function(r){if(!x||x.readyState===0){F||d();F=true;if(x)x.onreadystatechange=c.noop}else if(!F&&x&&(x.readyState===4||r==="timeout")){F=true;x.onreadystatechange=c.noop;j=r==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";if(j==="success")try{o=c.httpData(x,e.dataType,e)}catch(q){j="parsererror"}if(j==="success"||j==="notmodified")i||b();else c.handleError(e,x,j);d();r==="timeout"&&x.abort();if(e.async)x=
null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},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(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&&
d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)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,"")))a=A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+a))();else throw"Invalid JSON: "+a;else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(e,i){i=
c.isFunction(i)?i():i;f[f.length]=encodeURIComponent(e)+"="+encodeURIComponent(i)}var f=[];if(b===w)b=c.ajaxSettings.traditional;c.isArray(a)||a.jquery?c.each(a,function(){d(this.name,this.value)}):c.each(a,function e(i,j){if(c.isArray(j))c.each(j,function(o,p){b?d(i,p):e(i+"["+(typeof p==="object"||c.isArray(p)?o:"")+"]",p)});else!b&&j!=null&&typeof j==="object"?c.each(j,function(o,p){e(i+"["+o+"]",p)}):d(i,j)});return f.join("&").replace(wb,"+")}});var na={},xb=/toggle|show|hide/,yb=/^([+-]=)?([\d+-.]+)(.*)$/,
Z,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a!=null)return this.animate(L("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(na[d])f=na[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();
na[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a!=null)return this.animate(L("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&
c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(L("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var i=c.extend({},e),j,o=this.nodeType===1&&c(this).is(":hidden"),
p=this;for(j in a){var n=j.replace(ka,la);if(j!==n){a[n]=a[j];delete a[j];j=n}if(a[j]==="hide"&&o||a[j]==="show"&&!o)return i.complete.call(this);if((j==="height"||j==="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}if(c.isArray(a[j])){(i.specialEasing=i.specialEasing||{})[j]=a[j][1];a[j]=a[j][0]}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(t,z){var B=new c.fx(p,i,t);if(xb.test(z))B[z==="toggle"?o?"show":"hide":z](a);
else{var C=yb.exec(z),D=B.cur(true)||0;if(C){z=parseFloat(C[2]);var F=C[3]||"px";if(F!=="px"){p.style[t]=(z||1)+F;D=(z||1)/B.cur(true)*D;p.style[t]=D+F}if(C[1])z=(C[1]==="-="?-1:1)*z+D;B.custom(D,z,F)}else B.custom(D,z,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:L("show",1),slideUp:L("hide",1),slideToggle:L("toggle",
1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,
b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
"width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=K(),d=true;if(a||b>=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)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=
this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=
c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(Z);Z=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.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(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),
f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(t){c.offset.setOffset(this,a,t)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=
b,e=b.ownerDocument,i,j=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var p=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==j;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;i=e?e.getComputedStyle(b,null):b.currentStyle;p-=b.scrollTop;n-=b.scrollLeft;if(b===d){p+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){p+=parseFloat(i.borderTopWidth)||
0;n+=parseFloat(i.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){p+=parseFloat(i.borderTopWidth)||0;n+=parseFloat(i.borderLeftWidth)||0}f=i}if(f.position==="relative"||f.position==="static"){p+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){p+=Math.max(j.scrollTop,o.scrollTop);n+=Math.max(j.scrollLeft,o.scrollLeft)}return{top:p,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),
d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.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>";a.insertBefore(b,a.firstChild);
d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;a.removeChild(b);c.offset.initialize=c.noop},
bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+i,left:b.left-
e.left+j};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=
this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],i;if(!e)return null;if(f!==w)return this.each(function(){if(i=wa(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f});else return(i=wa(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]}});
c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;return"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===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);

jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.1",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.1",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;
;(function(h){var m=h.scrollTo=function(b,c,g){h(window).scrollTo(b,c,g)};m.defaults={axis:'y',duration:1};m.window=function(b){return h(window).scrollable()};h.fn.scrollable=function(){return this.map(function(){var b=this.parentWindow||this.defaultView,c=this.nodeName=='#document'?b.frameElement||b:this,g=c.contentDocument||(c.contentWindow||c).document,i=c.setInterval;return c.nodeName=='IFRAME'||i&&h.browser.safari?g.body:i?g.documentElement:this})};h.fn.scrollTo=function(r,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};a=h.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=h(k),d=r,l,e={},p=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(d)){d=n(d);break}d=h(d,this);case'object':if(d.is||d.style)l=(d=h(d)).offset()}h.each(a.axis.split(''),function(b,c){var g=c=='x'?'Left':'Top',i=g.toLowerCase(),f='scroll'+g,s=k[f],t=c=='x'?'Width':'Height',v=t.toLowerCase();if(l){e[f]=l[i]+(p?0:s-o.offset()[i]);if(a.margin){e[f]-=parseInt(d.css('margin'+g))||0;e[f]-=parseInt(d.css('border'+g+'Width'))||0}e[f]+=a.offset[i]||0;if(a.over[i])e[f]+=d[v]()*a.over[i]}else e[f]=d[i];if(/^\d+$/.test(e[f]))e[f]=e[f]<=0?0:Math.min(e[f],u(t));if(!b&&a.queue){if(s!=e[f])q(a.onAfterFirst);delete e[f]}});q(a.onAfter);function q(b){o.animate(e,j,a.easing,b&&function(){b.call(this,r,a)})};function u(b){var c='scroll'+b,g=k.ownerDocument;return p?Math.max(g.documentElement[c],g.body[c]):k[c]}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires='; expires='+date.toUTCString()}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('')}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};
var JSON = {}; 
JSON.parse = function(s) {
    try {
        return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
                                   s.replace(/"(\\.|[^"\\])*"/g, ''))) &&
            eval('(' + s + ')');
    }
    catch (e) {
        return false;
    }
};
(function () {
    var m = {
            '\b': '\\b', '\t': '\\t',  '\n': '\\n', '\f': '\\f',
            '\r': '\\r', '"' : '\\"',  '\\': '\\\\'
        },
        s = {
            'boolean': function (x) { return String(x); },
            'null': function (x) { return "null"; },
            number: function (x) { return isFinite(x) ? String(x) : 'null'; },
            string: function (x) {
                if (/["\\\x00-\x1f]/.test(x)) {
                    x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
                        var c = m[b];
                        if (c) {
                            return c;
                        }
                        c = b.charCodeAt();
                        return '\\u00' +
                            Math.floor(c / 16).toString(16) +
                            (c % 16).toString(16);
                    });
                }
                return '"' + x + '"';
            },
            array: function (x) {
                var a = ['['], b, f, i, l = x.length, v;
                for (i = 0; i < l; i += 1) {
                    v = x[i];
                    f = s[typeof v];
                    if (f) {
                        v = f(v);
                        if (typeof v == 'string') {
                            if (b) {
                                a[a.length] = ',';
                            }
                            a[a.length] = v;
                            b = true;
                        }
                    }
                }
                a[a.length] = ']';
                return a.join('');
            },
            object: function (x) {
                if (x) {
                    if (x instanceof Array) {
                        return s.array(x);
                    }
                    var a = ['{'], b, f, i, v;
                    for (i in x) {
                        v = x[i];
                        f = s[typeof v];
                        if (f) {
                            v = f(v);
                            if (typeof v == 'string') {
                                if (b) {
                                    a[a.length] = ',';
                                }
                                a.push(s.string(i), ':', v);
                                b = true;
                            }
                        }
                    }
                    a[a.length] = '}';
                    return a.join('');
                }
                return 'null';
            }
        };
    JSON.serialize = function(o) { return s.object(o); };
})();
/* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2 */
(function($) { $.fn.hoverIntent = function(f, g) { var cfg = { sensitivity: 7, interval: 100, timeout: 0 }; cfg = $.extend(cfg, g ? { over: f, out: g} : f); var cX, cY, pX, pY; var track = function(ev) { cX = ev.pageX; cY = ev.pageY; }; var compare = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) { $(ob).unbind("mousemove", track); ob.hoverIntent_s = 1; return cfg.over.apply(ob, [ev]); } else { pX = cX; pY = cY; ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } }; var delay = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); ob.hoverIntent_s = 0; return cfg.out.apply(ob, [ev]); }; var handleHover = function(e) { var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; while (p && p != this) { try { p = p.parentNode; } catch (e) { p = this; } } if (p == this) { return false; } var ev = jQuery.extend({}, e); var ob = this; if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } if (e.type == "mouseover") { pX = ev.pageX; pY = ev.pageY; $(ob).bind("mousemove", track); if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } } else { $(ob).unbind("mousemove", track); if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob); }, cfg.timeout); } } }; return this.mouseover(handleHover).mouseout(handleHover); }; })(jQuery);

/** getXML - sets text for specified object from call to specified url
 * @param strURL					- url to get
 * @param oElmToPresentContentIn	- element to set innerHTML for
 * @param doAfterCompletion			- optional. function to call after completion /TS (T1)
 */
function getXML(strURL, oElmToPresentContentIn, doAfterCompletion){
	if ( ! oElmToPresentContentIn)
		return;

	var oXMLHTTPRequest;	
	var strHTML;
	if(typeof XMLHttpRequest != "undefined"){oXMLHTTPRequest = new XMLHttpRequest();}
	else if(typeof window.ActiveXObject != "undefined"){
	try {oXMLHTTPRequest = new ActiveXObject("Msxml2.XMLHTTP.4.0");}
		catch(e){try {oXMLHTTPRequest = new ActiveXObject("MSXML2.XMLHTTP");}
		catch(e){try {oXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP");}
		catch(e){oXMLHTTPRequest = null;alert(strSorryXmlHttp);}}}}
	else{alert(strSorryXmlHttp);}
	if(oXMLHTTPRequest)	{
		oXMLHTTPRequest.onreadystatechange = function (){
			if(oXMLHTTPRequest.readyState == 4){
				try{strHTML = oXMLHTTPRequest.responseText;
					oElmToPresentContentIn.innerHTML = strHTML;
					if (doAfterCompletion)	// perform extra task after load?
						doAfterCompletion();
					this.onreadystatechange = new function(){};
					if(oXMLHTTPRequest && typeof oXMLHTTPRequest.abort == "function"){
						oXMLHTTPRequest.abort();
						oXMLHTTPRequest = null;}}
				catch(e){}				
				return true;}}
		oXMLHTTPRequest.open("GET", strURL, true); 
		oXMLHTTPRequest.send(null);	}
	return oXMLHTTPRequest;}
function getJavaScriptArray(strURL, oFunctionToCall){
	var oXMLHTTPRequest;	
	var strHTML;
	if(typeof XMLHttpRequest != "undefined"){oXMLHTTPRequest = new XMLHttpRequest();}
	else if(typeof window.ActiveXObject != "undefined"){
		try {oXMLHTTPRequest = new ActiveXObject("Msxml2.XMLHTTP.4.0");}
		catch(e){try {oXMLHTTPRequest = new ActiveXObject("MSXML2.XMLHTTP");}
		catch(e){try {oXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP");	}
		catch(e){oXMLHTTPRequest = null; alert(strSorryXmlHttp);}}}}
	else{alert(strSorryXmlHttp);}
	if(oXMLHTTPRequest){
		oXMLHTTPRequest.onreadystatechange = function (){
			if(oXMLHTTPRequest.readyState == 4){
			    strJavaScript = oXMLHTTPRequest.responseText;
			    strJavaScript = strJavaScript.substring(0, strJavaScript.lastIndexOf(']') + 1);
				if (oFunctionToCall)
					eval(oFunctionToCall + "(" + strJavaScript.replace(/[\n\r\t]/g, "") + ")");
				this.onreadystatechange = new function(){};
				if(oXMLHTTPRequest && typeof oXMLHTTPRequest.abort == "function"){
					oXMLHTTPRequest.abort();
					oXMLHTTPRequest = null;}
				return true;}}
		oXMLHTTPRequest.open("GET", strURL, true); 
		oXMLHTTPRequest.send(null);}}
function getJavaScriptArrayWithIdentifier(strId, strURL, oFunctionToCall) {
	var oXMLHTTPRequest;	
	var strHTML;
	if(typeof XMLHttpRequest != "undefined"){oXMLHTTPRequest = new XMLHttpRequest();}
	else if(typeof window.ActiveXObject != "undefined"){try {oXMLHTTPRequest = new ActiveXObject("Msxml2.XMLHTTP.4.0");}
		catch(e){try {oXMLHTTPRequest = new ActiveXObject("MSXML2.XMLHTTP");}
		catch(e){try {oXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP");}
		catch(e){oXMLHTTPRequest = null;alert(strSorryXmlHttp);}}}}
	else{alert(strSorryXmlHttp);}
	if(oXMLHTTPRequest){
	    oXMLHTTPRequest.onreadystatechange = function() {
	        if (oXMLHTTPRequest.readyState == 4) {
	            strJavaScript = oXMLHTTPRequest.responseText;
	            if (oFunctionToCall) {
	                strJavaScript = strJavaScript.substring(0, strJavaScript.lastIndexOf(']')+1);
	                var toDo = oFunctionToCall + "('" + strId + "'," + strJavaScript.replace(/[\n\r\t]/g, "") + ")";
	                try { eval(toDo); }
	                catch (e) { } 
	            }
	            this.onreadystatechange = new function() { };
	            if (oXMLHTTPRequest && typeof oXMLHTTPRequest.abort == "function") {
	                oXMLHTTPRequest.abort();
	                oXMLHTTPRequest = null;
	            }
	            return true;
	        } 
	    }		
		oXMLHTTPRequest.open("GET", strURL, true); 
		oXMLHTTPRequest.send(null);}}
function onLoadFunctionality(){
	if(document.getElementById&&document.getElementsByTagName){
		if(typeof addEventsForInnerTabNavigation!="undefined"){addEventsForInnerTabNavigation();}	
		if(typeof addPrintExpandBlock!="undefined"){addPrintExpandBlock();}		
		if(typeof addDynamicDropDownEvents!="undefined"){addDynamicDropDownEvents();}
		if(typeof addQuickPoll!="undefined"){addQuickPoll();}
		if(typeof addWeatherForecastEvents!="undefined"){addWeatherForecastEvents();}
		if(typeof addDynamicDropDownEventsProperty!="undefined"){addDynamicDropDownEventsProperty();}
		if(typeof addOpenMoreFactsBlock!="undefined"){addOpenMoreFactsBlock();}			
	    if(typeof addExpandMoreHotelInfo!="undefined"){addExpandMoreHotelInfo();}										
		if(typeof addHelpInfoCenterEvents!="undefined"){addHelpInfoCenterEvents();}
		if(typeof addInfoLayerEvents!="undefined"){addInfoLayerEvents();}	
		if(typeof addHelpInfoEvents!="undefined"){addHelpInfoEvents();}
		if(typeof addCloseWeatherPanel!="undefined"){addCloseWeatherPanel();}		
		if(typeof createPaging!="undefined"){createPaging();}
		if(typeof addOpenCityIntroText!="undefined"){addOpenCityIntroText();}
		if(typeof addOpenCityIntroTextTema!="undefined"){addOpenCityIntroTextTema();}
		if(typeof addPrintEvent!="undefined"){addPrintEvent();}
		if(typeof addDynamicDropDownEventsDestCode!="undefined"){addDynamicDropDownEventsDestCode();}				
		if(typeof printPageAndSubPages!="undefined"){printPageAndSubPages();}		
		if(typeof addRedirectDropDownPusher!="undefined"){addRedirectDropDownPusher();}				
		
		oBodyElmForIE=(bIsIE5)?document.body:document.documentElement;
}}
var bIsIE5 = (String(navigator.userAgent).search(/MSIE 5/) != -1) ? true : false;
function addEvent(oElement,strEvent,oFunction,bCapture){
    if (oElement.addEventListener) {
        oElement.addEventListener(strEvent, oFunction, bCapture);
    }
    else if (oElement.attachEvent) {
        oElement.attachEvent(("on" + strEvent), oFunction);
    }
}
function clickSubmitButton(oEvent,strButtonId){
	if(oEvent&&oEvent.keyCode==13){
		var oButton=document.getElementById(strButtonId);
		if(oButton){
			oButton.click();
			oEvent.returnValue=false;
			if(oEvent.preventDefault){oEvent.preventDefault();}
			return false;}}	
}
addEvent(window,"load",onLoadFunctionality,false);
function getElementsByClassName(oElm,strTagName,strClassName){
	var arrElements=(strTagName=="*"&&document.all)?document.all:oElm.getElementsByTagName(strTagName);
	var arrReturnElements=new Array();
	strClassName=strClassName.replace(/\-/g, "\\-");
	var oRegExp=new RegExp("(^|\\s)"+strClassName+"(\\s|$)");
	var oElement;
	for(var i=0;i<arrElements.length;i++){
		oElement=arrElements[i];		
		if(oRegExp.test(oElement.className)){arrReturnElements.push(oElement);}	
	}
	return (arrReturnElements);
}

function setFormAction(action){
	document.forms[0].action = action;
	document.forms[0].method = "post";
	if ($("input[type='file']").length > 0) {
	    document.forms[0].encoding = "multipart/form-data";
	}
}
function fillDropDown(arrOptions){
	if(arrOptions!==null){
		if(oDropDownToFill){
			var selectedOption=oDropDownToFill.value;
			var oOption;
			var arrayOption;	
			for(var i=(oDropDownToFill.options.length-1);i>=0;i--){oDropDownToFill.options[i].parentNode.removeChild(oDropDownToFill.options[i]);}
			for(var j=0;j<arrOptions.length;j++){
				arrayOption=arrOptions[j];
				if(arrayOption!==null){
					oOption = document.createElement("option");
					oOption.setAttribute("value", arrayOption.value);
					oOption.innerHTML = arrayOption.text;
					if (arrayOption.value == selectedOption) {
					    oOption.selected = true;
					}
						
					oDropDownToFill.appendChild(oOption);
			}}
			oDropDownToFill = null;
}}}
function fillDropDownWithIdentifier(strId,arrOptions){
	if(arrOptions!==null){
		var oDropDownToFill=document.getElementById(strId);
		if (oDropDownToFill){
			var selectedOption=oDropDownToFill.value;
			var oOption;
			var arrayOption;			
			for(var i=(oDropDownToFill.options.length-1);i>=0;i--){oDropDownToFill.options[i].parentNode.removeChild(oDropDownToFill.options[i]);}
			for(var j=0;j<arrOptions.length;j++){
				arrayOption=arrOptions[j];
				if(arrayOption!==null){
					oOption=document.createElement("option");
					oOption.setAttribute("value",arrayOption.value);
					oOption.innerHTML=arrayOption.text;
					if(arrayOption.value == selectedOption) {
						oOption.selected = true;
					}						
					oDropDownToFill.appendChild(oOption);
}}}}}


var 
    globalCommonDialogElement,
    globalCommonDialogControl;

// New version of showInfoLayer based on the TUI.Web.UI.WebControls.Dialog MS AJAX control, replace old showInfoLayer() with this one whenever and wherever you can
function showInfoLayerNewVersion(dynamicUrl, width, height, targetElement){
    if (globalCommonDialogControl != null){
        Sys.Application.removeComponent(globalCommonDialogControl);
        $(globalCommonDialogElement).remove();
    }
    
    globalCommonDialogElement = $("<div id='global-common-dialog'></div>").appendTo(targetElement ? $(targetElement).parent() : document.body).get(0);
    globalCommonDialogControl = new TUI.Web.UI.WebControls.Dialog(globalCommonDialogElement);

    globalCommonDialogControl.beginUpdate();
    globalCommonDialogControl.set_innerHtmlTop(String.format("<div class='dialog-top-print' style='float: right; font-weight: normal; cursor: pointer;'>{0}</div>{1}", strCaptionPrint, strHelpInfo));
    globalCommonDialogControl.set_dynamicServiceFullPath(dynamicUrl);
    globalCommonDialogControl.set_isDraggable(true);
    $(globalCommonDialogElement).find('div.dialog-top-print').click( function() { printHTML($(globalCommonDialogElement).find('div.dialog-center-inner').html()); } );
    
    if (targetElement) {
        globalCommonDialogControl.set_targetControl(targetElement);
        globalCommonDialogControl.set_dialogPosition(TUI.Web.UI.WebControls.DialogPosition.nearTargetInsideClient);
    }
    
    globalCommonDialogControl.endUpdate();
    
    if (width) {
        $(globalCommonDialogElement).width(width);
    }
    
    if (height) {
        $(globalCommonDialogElement).find('div.dialog-center-inner').height(height);
    }
    
    globalCommonDialogControl.show();    
    Sys.Application.addComponent(globalCommonDialogControl);
}

var 
    globalCommonHelpPopupDialogElement,
    globalCommonHelpPopupDialogControl;

function registerHelpTextPopups(container) {
    $(container ? container : document).find('a.help-text-popup').click(function(e) {
            var 
                helpSection = this.rel.split("|")[0],
                helpPage = this.rel.split("|")[1];

            if (globalCommonHelpPopupDialogControl != null) {
                if (globalCommonHelpPopupDialogControl.get_targetControl() == this) {
                    return; // A dialog is already attached to the help link - let it take care of hiding and showing or whatever
                }
                else {
                    Sys.Application.removeComponent(globalCommonHelpPopupDialogControl);
                    $(globalCommonHelpPopupDialogElement).remove();
                }
            }

            globalCommonHelpPopupDialogElement = $("<div id='help-text-dialog'></div>").appendTo($(this).parent()).get(0);
            globalCommonHelpPopupDialogControl = new TUI.Web.UI.WebControls.Dialog(globalCommonHelpPopupDialogElement);
            globalCommonHelpPopupDialogControl.beginUpdate();
            globalCommonHelpPopupDialogControl.set_innerHtmlTop(this.title);
            globalCommonHelpPopupDialogControl.set_dynamicServiceFullPath(oBaseAjaxUrls.DynamicContent + 'GetEPiHelpPage.aspx?helpSection=' + helpSection + '&helpPage=' + helpPage);                       
            globalCommonHelpPopupDialogControl.set_isDraggable(true);
            globalCommonHelpPopupDialogControl.set_targetControl(this);
            globalCommonHelpPopupDialogControl.set_dialogPosition(TUI.Web.UI.WebControls.DialogPosition.nearTargetInsideClient);
            globalCommonHelpPopupDialogControl.endUpdate();

            globalCommonHelpPopupDialogControl.show();

            Sys.Application.addComponent(globalCommonHelpPopupDialogControl);
    });
}



function addHelpInfoEvents(){
	$("a.help-info-new-version").click( function (event) { displayHelpInfoNewVersion(event,event.target); } );
	$("a.help-info, a.help-info-no-book").click (function (event) { displayHelpInfo(event,event.target); } );
	$("a.help-info-window").click(function (event) {
			event.returnValue=false;
			event.preventDefault();			
			var w=screen.availWidth;
			var h=screen.availHeight;
			var popW=835,popH=710;
			var leftPos=(w-popW)/2,topPos=(h-popH)/2;				
			OpenWindow(this.getAttribute("href"),835,710,"toolbar=false,directories=false,menubar=false,scrollbars=yes,resizable=false,status=false,left = "+leftPos+",top = "+topPos+" '");
			return false;
	});
}
var infoContent = document.createElement("div");
function displayHelpInfo(oEvent,oElm){
	if (oElm.tagName.toLowerCase()!="a"){oElm=oElm.parentNode;}
	var strURL=oElm.getAttribute("href");
	oEvent.returnValue=false;
	oEvent.preventDefault();
	getXML(strURL, infoContent, _displayHelpInfo);
}
function displayHelpInfoNewVersion(oEvent,oElm)
{
	if (oElm.tagName.toLowerCase()!="a"){oElm=oElm.parentNode;}
	var strURL=oElm.getAttribute("href");
	oEvent.returnValue=false;
	oEvent.preventDefault();
	showInfoLayerNewVersion(strURL, null, null, oElm);
}
function _displayHelpInfo() {
	showInfoLayer(null,infoContent.innerHTML,400);
}
function OpenWindow(url,width,height,features){
	width=(width>0)?",width="+width:"";
	height=(height>0)?",height="+height:"";
	features=(features!=null)?","+features:"";	
	var newWin=window.open(url,'',""+width+""+height+""+features);
	newWin.focus();
}
//--- End Printfunctions ---//
/*** hideOrShowElements -	hides or shows multiple elements (comma separated list of id's)
 *							by altering style.display to and from 'none' and ''
 * @param show				- true if the elements should be shown, otherwise false
 * @param elementsToAffect	- comma separated list of id's
 */
function hideOrShowElements(show,elementsToAffect){
	if ((show==true||show==false)&&elementsToAffect){
		var arrOfIdsToAffect=elementsToAffect.split(",");
		for(idOfElement in arrOfIdsToAffect){
			try{
				var ctrl=document.getElementById(arrOfIdsToAffect[idOfElement]);
				if (ctrl)
					ctrl.className=(show==true?'':'display-none');
			}catch(e){}}}	
}
/*** openElementAndPrint - opens the named element in a new window and prints
 * @param element			- id or reference to the element to print
 * @param elementsToHide	- comma separated string of id's for items to hide before print and show after*/
function openElementAndPrint (element,elementsToHide,ignorePrintEvent){
	if (elementsToHide){hideOrShowElements (false, elementsToHide);}
	var prtContent=typeof element=="object"?element:document.getElementById(element);
	printHTML(prtContent.innerHTML,ignorePrintEvent);
	if (elementsToHide) {
	    hideOrShowElements(true, elementsToHide);
	}
}
function printExpandablePanel(elementId, preHTML, postHTML){
	var 
		infoContainer=document.getElementById(elementId),
		infoBox=getElementsByClassName(infoContainer,"div","box-extra-info")[0],
		allBoxes=getElementsByClassName(infoContainer,"div","box-extra-info-expand");
    
	for(i=0;i<allBoxes.length;i++){allBoxes[i].className = "box-extra-info-expand display-block";}
	infoBox.style.display="none";	
	printHTML((preHTML ? preHTML : '') + infoContainer.innerHTML + (postHTML ? postHTML : ''));
	for(i=0;i<allBoxes.length;i++){allBoxes[i].className="box-extra-info-expand display-none";}
	infoBox.style.display="block";	
}
function printHTML(htmlCode,ignorePrintEvent){
	var useScrollBars = (!ignorePrintEvent) ? '0' : '1';
	var WinPrint=window.open('','','left=0,top=0,width=700,height=500,toolbar=1,scrollbars=' + useScrollBars + ',status=0,resizable=1,menubar=1');		
	WinPrint.document.write('<html>\n');
	WinPrint.document.write('	<head>\n');
	WinPrint.document.write('		<link rel="stylesheet" type="text/css" href="' + oBaseAppSettings.IncludeSiteDirectory + '/Css/BlueSites/general.css" />\n');
	if(isTemaSite){
	    WinPrint.document.write('		<link rel="stylesheet" type="text/css" href="' + oBaseAppSettings.IncludeSiteDirectory + '/Css/Tema/general.css" />\n');		
	}
	WinPrint.document.write('		<link rel="stylesheet" type="text/css" href="' + oBaseAppSettings.IncludeSiteDirectory + '/Css/BlueSites/print.css" media="print, screen" />\n');
	WinPrint.document.write('		<!--[if lt IE 6]>\n');
	WinPrint.document.write('			<link rel="stylesheet" type="text/css" href="' + oBaseAppSettings.IncludeSiteDirectory + '/Css/BlueSites/ie5.css"  />\n');
	WinPrint.document.write('		<![endif]-->\n');
	WinPrint.document.write('		<!--[if lt IE 7]>\n');
	WinPrint.document.write('			<link rel="stylesheet" type="text/css" href="' + oBaseAppSettings.IncludeSiteDirectory + '/Css/BlueSites/ie.css" />\n');
	WinPrint.document.write('		<![endif]-->\n');
	WinPrint.document.write('	</head>\n');
	WinPrint.document.write('	<body>\n');
	WinPrint.document.write('		<form>\n');
	WinPrint.document.write('			<div width="700" height="700" style="margin: 10px;">\n');
	WinPrint.document.write(htmlCode);
	WinPrint.document.write('			</div>\n');
	WinPrint.document.write('		</form>\n');
	WinPrint.document.write('	</body>\n');
	WinPrint.document.write('</html>\n');
	WinPrint.document.close();	
	if (!ignorePrintEvent) 
	{
		WinPrint.print();
		WinPrint.close();
	}
}
function addPrintEvent(){
	var oPrintButton=document.getElementById("print-button");
	var oPrintButton5=document.getElementById("print-button5");
	if(oPrintButton){	
		oPrintButton.onclick=function(oEvent){
			var oEvent=(typeof oEvent!="undefined")?oEvent:event;
			oEvent.returnValue=false;
			if(oEvent.preventDefault){oEvent.preventDefault();}		
			var w=screen.availWidth;
			var h=screen.availHeight;
			var popW=800,popH=780;
			var leftPos=(w-popW)/2,topPos=(h-popH)/2;
			var _width=parseInt(document.getElementById("left-and-main").offsetWidth.toString().replace(/px/i,''))+50;			
			var oNewWindow=window.open((location.href.replace(/travel.aspx/i,'print.aspx')+'?print=true'),"",("width="+_width)+",scrollbars=yes,left = "+leftPos+",top = "+topPos);
	}}	
	if(oPrintButton5){
		oPrintButton5.onclick=function(oEvent){
			var oEvent=(typeof oEvent!="undefined")?oEvent:event;
			oEvent.returnValue=false;
			if(oEvent.preventDefault){oEvent.preventDefault();}
			var w=screen.availWidth;
			var h=screen.availHeight;
			var popW=800,popH=780;
			var leftPos=(w-popW)/2,topPos=(h-popH)/2;
			var oNewWindow = window.open((location.href.replace(/travel.aspx/i, 'print.aspx') + '&print=true'), "", ("width=" + document.getElementById("hotel-comparison").offsetWidth) + ",scrollbars=yes,left = " + leftPos + ",top = " + topPos);	
	}}
	if (location.href.search(/print=true/i) != -1) {
		setTimeout("window.print()", 200);
		setTimeout("window.close()", 300);
	}
}
// Finns en funktion med samma namn i Contentblocks.js En borde bort!?
var oDropDown = null;
var oDropDownToFill = null;
function addDynamicDropDownEvents(){
	var oSelectedBookingType = document.getElementById("selected-booking-type");
	var arrAllDynamicDropDowns=getElementsByClassName(document,"select","dynamic-dropdown");	
	for(var i=0; i<arrAllDynamicDropDowns.length; i++){
		var divValidation=getElementsByClassName(document, "div", "validation-message");
		if (divValidation.length==0){
			switch (arrAllDynamicDropDowns[i].className.replace(/.*type-(\w+)(\b.*|$)/i, "$1")){
				case 'resortStart':
					arrAllDynamicDropDowns[i].options.selectedIndex=0;
					var selectResort=document.getElementById("select-resort");
					if (selectResort){selectResort.options.selectedIndex=0};
				break;
		}}
		arrAllDynamicDropDowns[i].onchange=function(){		
			var strClassName=this.className;			
			var strType=strClassName.replace(/.*type-(\w+)(\b.*|$)/i, "$1");
			var strId=this.options[this.options.selectedIndex].value;			
			if(strId!=''&&strId!=null){
				if(strType=='resort'){			
					var depCode=arrAllDynamicDropDowns[0].value;
					var strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?type=" + strType + "&id=" + strId + "&dep=" + depCode;
				}
				else if(strType=='resortStart'){
					var depCode=arrAllDynamicDropDowns[0].value;
					var strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?type=" + strType + "&id=" + strId + "&dep=" + depCode;
				}
				else if (strType == 'cat_entry') { var strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?type=" + strType + "&id=" + strId; }			
				else{
				    var strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?strBookingType=" + oSelectedBookingType.value + "&type=" + strType + "&id=" + strId;
					oDropDown=this;
					var	sec=getElementsByClassName(document,"select","element-to-fill-return-date");
					if(sec!=null&&sec.length>0&&strClassName.indexOf("element-to-fill-return-date")==-1){setTimeout("SetSec()",100);}
				}			
				var strIdOfElementToFill=strClassName.replace(/.*element-to-fill-([\w\d\-]+)(\b.*|$)/i, "$1");
				getJavaScriptArrayWithIdentifier(strIdOfElementToFill,strURL,"fillDropDownWithIdentifier");				
				var stringToSave=document.getElementById("postbackXml");
				if(stringToSave){
					var PickedTd=document.getElementById("PickedTd");
					var array=this.options[this.options.selectedIndex].value.split("_");	
					var destinationName=this.options[this.options.selectedIndex].text.replace("-","");	
					if(destinationName.indexOf(" ")==0)
						destinationName=destinationName.substring(1,destinationName.length);
						
					stringToSave.value=array[1]+"|"+destinationName;	 
					PickedTd.innerHTML=destinationName;					
				}}};
arrAllDynamicDropDowns[i].onchange();
}}

ClientXY = function(oEvent) {
	intOffsetX = (oEvent.offsetX) ? oEvent.offsetX : 0;
	intOffsetY = 0;
	intScrollLeft = (window.pageXOffset) ? window.scrollX : oBodyElmForIE.scrollLeft;
	intScrollTop = (window.pageYOffset) ? window.scrollY : oBodyElmForIE.scrollTop;
	this.x = (oEvent.clientX - intOffsetX) + intScrollLeft;
	this.y = (oEvent.clientY - intOffsetY) + intScrollTop;
	this.offsetX = intOffsetX;
	this.scrollLeft = intScrollLeft;
}

//  TWINGLY
var tw_language = "swedish";
//var tw_url = "http://www.fritidsresor.se/";
var tw_onComplete = function() {
    $("div.tw_header").html("").append($("div.tw-box span.tw-header"));
    $("div.tw_lw_c").children("div").html("").append($("div.tw-box span.tw-noblogs-header")).append($("div.tw-box span.tw-noblogs-footer"));
    $("div.tw_footer").append($("div.tw_sub_header a").html("").append($("div.tw-box span.tw-footer")));
};

/* Close the panel on fun-staff pages. Called from ContentBlock "/BlueSites/Templates/ContentBlocks/CheckoutWeather.ascx" */
function addCloseWeatherPanel() {
    $("a.close-link-weather").click(function() {
        $("div#weatherDIV").removeClass("display-block").fadeOut("slow");
        $("div#weatherDIVInfo").fadeIn("slow");
        return false;
    });
}

$(document).ready(function() {
    registerHelpTextPopups(document);
});        
function openHotelLightBox(hotelId,catId){
    $("select.start-page-select-country-and-resort").hide();
    $("div#light-box").removeClass("light-box-layer").addClass("unique-lightbox").css("height", $(document).height() + 630 + "px").show();
    $("div#light-box-content").css("top", "10px").load(String.format("/BlueSites/Templates/DynamicContent/BlueUnique.aspx?hotel={0}&cat={1}", hotelId, catId), function() {
        $.getScript(oBaseAppSettings.IncludeSiteDirectory+"/Js/JQuery/reflection.js", function() {
            setTimeout('addReflections()', 100);
            Cufon.replace('span.blue-unique-second-heading', { fontFamily: 'TUIType' })('span.grade', { fontFamily: 'TUIType' })('span.cityname', { fontFamily: 'TUIType' })('span#image-counter', { fontFamily: 'TUIType' });
        });
    }).fadeIn("slow");
    scroll(0,0);
}
function openLightBox(id,catId){
    $("select.start-page-select-country-and-resort").hide();
    $("div#light-box").removeClass("light-box-layer").addClass("unique-lightbox").css("height", $(document).height() + 680 + "px").show();
    $("div#light-box-content").css("top", "10px").load(String.format("/BlueSites/Templates/DynamicContent/BlueUnique.aspx?index={0}&cat={1}", id, catId), function() {
        $.getScript(oBaseAppSettings.IncludeSiteDirectory+"/Js/JQuery/reflection.js", function() {
            $.getScript(oBaseAppSettings.IncludeSiteDirectory+"/Js/JQuery/jquery.scrollfollow.js", function() {
                addReflections();
                Cufon.replace('span.blue-unique-second-heading', { fontFamily: 'TUIType' })('span.grade', { fontFamily: 'TUIType' })('span.cityname', { fontFamily: 'TUIType' })('span#image-counter', { fontFamily: 'TUIType' });
                $('img.unique-arrow-left').scrollFollow({ speed: 300, offset: 200 });
                $('img.unique-arrow-right').scrollFollow({ speed: 300, offset: 200 });
            });
        });
    }).fadeIn("slow");
    scroll(0,0);
}
function openGenericLightBox(epiId, width){
    var w=0;
    if (typeof (width) != 'undefined'){
        w=width;
    }

    $("select.start-page-select-country-and-resort").hide();
    $("div#light-box").removeClass("light-box-layer").addClass("unique-lightbox").css("height", $(document).height() + 100 + "px").show();
    $("div#light-box-content").css("top", "10px").load("/BlueSites/Templates/DynamicContent/GenericContent.aspx?epiid=" + epiId + "&width=" + w, function() {

    }).fadeIn("slow");
    scroll(0,0);
}
$(document).ready(function() {
    $("a#open-light-box").click(function() {
        var rel = $(this).attr("rel");
        if (rel.indexOf("|") == -1) {
            rel = rel + "|" + 324;
        }
        var arr = rel.split("|");
        openHotelLightBox(arr[0], arr[1]);
    });
    $("#toggler-container a").click(function() {
        $("#toggler-container a").removeClass("selected");
        $(this).addClass("selected");

        var currentId = $(this).attr("id").replace("listItem_", "");
        $("#expandPanelImage").attr("src", $("#hidden_" + currentId).attr("value"));

        $(".box-extra-info-expand").removeClass("display-block").addClass("display-none");
        $("#container_" + currentId).removeClass("display-none").addClass("display-block");
    });
    $("a.close-expand-panel-JS, a.close-link").click(function() {
        var currentId = $(this).attr("id").replace("close_", "");
        $("#container_" + currentId).removeClass("display-block").addClass("display-none");
        $("#listItem_" + currentId).removeClass("selected");
        return false;
    });
    $('div#flash-map-small div#flash-container a.map-link, #page #select-country-or-map a').click(function(event) {
        event.preventDefault();
        if ($("div.dialog-google-maps").length == 0) {
            var mapsUrl = "/BlueSites/Templates/DynamicContent/GoogleMapsOverView.aspx";
            var dialogControl = TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog({ 'innerHtmlCenter': '<iframe frameborder="0" scrolling="no" src="' + mapsUrl + '"></iframe>', 'showOverlay': true, 'isDraggable': true }, 'dialog-google-maps');
            $("div#light-box").css("height", $(document).height() + 100 + "px").show();
            dialogControl.show();
            $("div.dialog-google-maps").css({ zIndex: "101", position: "absolute" }).find("a.dialog-top-close-link").click(function() {
                $("div#light-box").hide();
            });
            $("div.dialog-overlay").hide();
        }
        else {
            $("div#light-box, div.dialog-google-maps").css("visibility", "visible").show();
        }
        return false;
    });
});
function triggerOpenLightBox2(){openLightBox(this.id);}
function triggerOpenLightBox(id,catId){openLightBox(id,catId);}
function triggerOpenGenericLightBox(id, width){openGenericLightBox(id,width);}
    
/** SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php */
if(typeof deconcept=="undefined")var deconcept=new Object();if(typeof deconcept.util=="undefined")deconcept.util=new Object();
if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil=new Object();deconcept.SWFObject=function(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){
	if(!document.getElementById){return;}this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();
	this.attributes=new Array();if(swf){this.setAttribute('swf',swf);}if(id){this.setAttribute('id',id);}if(w){this.setAttribute('width',w);}
	if(h){this.setAttribute('height',h);}
	if(ver){this.setAttribute('version',new deconcept.PlayerVersion(ver.toString().split(".")));}
	this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
	if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}
	if(c){this.addParam('bgcolor',c);}var q=quality?quality:'high';
	this.addParam('quality',q);this.setAttribute('useExpressInstall',false);
	this.setAttribute('doExpressInstall',false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;
	this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');
	if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl);}}
deconcept.SWFObject.prototype={useExpressInstall: function(path){this.xiSWFPath=!path?"expressinstall.swf":path;
		this.setAttribute('useExpressInstall',true);},setAttribute: function(name,value){this.attributes[name]=value;
	},getAttribute: function(name){return this.attributes[name];},addParam: function(name,value){this.params[name] = value;},getParams: function(){
		return this.params;},addVariable: function(name,value){this.variables[name]=value;},getVariable: function(name){return this.variables[name];
	},getVariables: function(){return this.variables;},getVariablePairs: function(){var variablePairs=new Array();var key;var variables=this.getVariables();
		for(key in variables){variablePairs[variablePairs.length]=key+"="+variables[key];}return variablePairs;},getSWFHTML: function(){var swfNode="";
		if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");
				this.setAttribute('swf', this.xiSWFPath);}
			swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute('swf')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+this.getAttribute('style')+'"';
			swfNode+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';var params=this.getParams(); for(var key in params){swfNode+=[key]+'="'+params[key]+'" ';}
			var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}swfNode+='/>';}else{if(this.getAttribute("doExpressInstall")){
				this.addVariable("MMplayerType","ActiveX");this.setAttribute('swf',this.xiSWFPath);}swfNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+this.getAttribute('style')+'">';
			swfNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var params=this.getParams();	for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'" />';}
			var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}swfNode+="</object>";}return swfNode;
	},write: function(elementId){if(this.getAttribute('useExpressInstall')){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){
				this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+" - Flash Player Installation";
				this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n=(typeof elementId=='string')?document.getElementById(elementId):elementId;n.innerHTML=this.getSWFHTML();return true;}else{
			if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'));}}return false;}}
deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){
		var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var counter=3;while(axo){try{counter++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter);
				PlayerVersion=new deconcept.PlayerVersion([counter,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{
				var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";
			}catch(e){if(PlayerVersion.major==6){return PlayerVersion;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
	}return PlayerVersion;}
deconcept.PlayerVersion=function(arrVersion){
	this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;this.rev=arrVersion[2]!=null?parseInt(arrVersion[2]):0;}
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
	if(this.major<fv.major)return false; if(this.major>fv.major)return true; if(this.minor<fv.minor)return false; if(this.minor>fv.minor)return true; if(this.rev<fv.rev)return false; return true;}
deconcept.util={
	getRequestParameter: function(param){
		var q=document.location.search||document.location.hash;
		if(param==null){return q;}
		if(q){var pairs=q.substring(1).split("&");
			for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1));}}}return "";}}
deconcept.SWFObjectUtil.cleanupSWFs=function(){
	var objects=document.getElementsByTagName("OBJECT");
	for(var i=objects.length-1;i>=0;i--){
		objects[i].style.display='none';
		for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[i][x]=function(){};}}}}
if(deconcept.SWFObject.doPrepUnload){
	if(!deconcept.unloadSet){
		deconcept.SWFObjectUtil.prepUnload=function(){
			__flash_unloadHandler=function(){};
			__flash_savedUnloadHandler=function(){};
			window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet=true;}}
if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/** getXML - sets text for specified object from call to specified url
* @param strURL					- url to get
* @param oElmToPresentContentIn	- element to set innerHTML for
* @param doAfterCompletion			- optional. function to call after completion /TS (T1)
*/
function getXML(strURL, oElmToPresentContentIn, doAfterCompletion) {
    if (!oElmToPresentContentIn)
        return;

    var oXMLHTTPRequest;
    var strHTML;
    if (typeof XMLHttpRequest != "undefined") { oXMLHTTPRequest = new XMLHttpRequest(); }
    else if (typeof window.ActiveXObject != "undefined") {
        try { oXMLHTTPRequest = new ActiveXObject("Msxml2.XMLHTTP.4.0"); }
        catch (e) {
            try { oXMLHTTPRequest = new ActiveXObject("MSXML2.XMLHTTP"); }
            catch (e) {
                try { oXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP"); }
                catch (e) { oXMLHTTPRequest = null; alert(strSorryXmlHttp); } 
            } 
        } 
    }
    else { alert(strSorryXmlHttp); }
    if (oXMLHTTPRequest) {
        oXMLHTTPRequest.onreadystatechange = function() {
            if (oXMLHTTPRequest.readyState == 4) {
                try {
                    strHTML = oXMLHTTPRequest.responseText;
                    oElmToPresentContentIn.innerHTML = strHTML;
                    if (doAfterCompletion)	// perform extra task after load?
                        doAfterCompletion();
                    this.onreadystatechange = new function() { };
                    if (oXMLHTTPRequest && typeof oXMLHTTPRequest.abort == "function") {
                        oXMLHTTPRequest.abort();
                        oXMLHTTPRequest = null;
                    } 
                }
                catch (e) { }
                return true;
            } 
        }
        oXMLHTTPRequest.open("GET", strURL, true);
        oXMLHTTPRequest.send(null);
    }
    return oXMLHTTPRequest;
}
function getJavaScriptArray(strURL, oFunctionToCall) {
    var oXMLHTTPRequest;
    var strHTML;
    if (typeof XMLHttpRequest != "undefined") { oXMLHTTPRequest = new XMLHttpRequest(); }
    else if (typeof window.ActiveXObject != "undefined") {
        try { oXMLHTTPRequest = new ActiveXObject("Msxml2.XMLHTTP.4.0"); }
        catch (e) {
            try { oXMLHTTPRequest = new ActiveXObject("MSXML2.XMLHTTP"); }
            catch (e) {
                try { oXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP"); }
                catch (e) { oXMLHTTPRequest = null; alert(strSorryXmlHttp); } 
            } 
        } 
    }
    else { alert(strSorryXmlHttp); }
    if (oXMLHTTPRequest) {
        oXMLHTTPRequest.onreadystatechange = function() {
            if (oXMLHTTPRequest.readyState == 4) {
                strJavaScript = oXMLHTTPRequest.responseText;
                strJavaScript = strJavaScript.substring(0, strJavaScript.lastIndexOf(']') + 1);
                if (oFunctionToCall)
                    eval(oFunctionToCall + "(" + strJavaScript.replace(/[\n\r\t]/g, "") + ")");
                this.onreadystatechange = new function() { };
                if (oXMLHTTPRequest && typeof oXMLHTTPRequest.abort == "function") {
                    oXMLHTTPRequest.abort();
                    oXMLHTTPRequest = null;
                }
                return true;
            } 
        }
        oXMLHTTPRequest.open("GET", strURL, true);
        oXMLHTTPRequest.send(null);
    } 
}
function getJavaScriptArrayWithIdentifier(strId, strURL, oFunctionToCall) {
    var oXMLHTTPRequest;
    var strHTML;
    if (typeof XMLHttpRequest != "undefined") { oXMLHTTPRequest = new XMLHttpRequest(); }
    else if (typeof window.ActiveXObject != "undefined") {
        try { oXMLHTTPRequest = new ActiveXObject("Msxml2.XMLHTTP.4.0"); }
        catch (e) {
            try { oXMLHTTPRequest = new ActiveXObject("MSXML2.XMLHTTP"); }
            catch (e) {
                try { oXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP"); }
                catch (e) { oXMLHTTPRequest = null; alert(strSorryXmlHttp); } 
            } 
        } 
    }
    else { alert(strSorryXmlHttp); }
    if (oXMLHTTPRequest) {
        oXMLHTTPRequest.onreadystatechange = function() {
            if (oXMLHTTPRequest.readyState == 4) {
                strJavaScript = oXMLHTTPRequest.responseText;
                if (oFunctionToCall) {
                    strJavaScript = strJavaScript.substring(0, strJavaScript.lastIndexOf(']') + 1);
                    var toDo = oFunctionToCall + "('" + strId + "'," + strJavaScript.replace(/[\n\r\t]/g, "") + ")";
                    try { eval(toDo); }
                    catch (e) { }
                }
                this.onreadystatechange = new function() { };
                if (oXMLHTTPRequest && typeof oXMLHTTPRequest.abort == "function") {
                    oXMLHTTPRequest.abort();
                    oXMLHTTPRequest = null;
                }
                return true;
            }
        }
        oXMLHTTPRequest.open("GET", strURL, true);
        oXMLHTTPRequest.send(null);
    } 
}

//Humany
$(document).ready(function() {
    $("#humanySuggestSearchInput").keyup(function(event) {
        clearTimeout(timer);
        if (event.keyCode == 13) {
            var selectedIndex = $("div#humanySuggestResult div.entry-item").index($("div#humanySuggestResult div.hover"));
            if (selectedIndex > -1) {
                browseToItem(selectedIndex);
            } else {
                browseToLargeSearch();
            }
            return;
        } else if (event.keyCode == 38 || event.keyCode == 40) {
            step(event.keyCode);
            return;
        }
        timer = setTimeout("initHumanySearch()", 500);
        $("#humanySuggestSearchInput").addClass("searching");
    });

    // For notfound page
    $("#not-found #search-field").keyup(function(event) {
        clearTimeout(timer);
        if (event.keyCode == 13) {            
                browseToLargeSearch();           
            return;
        } else if (event.keyCode == 38 || event.keyCode == 40) {
            step(event.keyCode);
            return;
        }
    });

    $("#humanySearchInput").keyup(function() {
        clearTimeout(timer);
        timer = setTimeout("initHumanySearchLarge()", 500);
        $("#humanySearchInput").addClass("searching");
    });

    $("input#humanySearchSubmit, input.search-humany-button").click(function(event) {
        event.preventDefault();
        browseToLargeSearch();
        //$("div#humanySuggestResult").show();
        return false;
    });

    $("#humanySuggestSearchInput, #humanySearchInput").keydown(function(event) {
        return (event.keyCode != 13);
    });

    $("#humanySuggestSearchInput").focus(function() {
        if (($("div#humanySuggestResult").children("div").length > 0) && ($.trim($(this).val()) != "") && ($.trim($(this).val()) != initialTextValue)) {
            $("div#humanySuggestResult").show();
            $("#panorama-container").css("visibility", "hidden");
        }
        else {
            $("#panorama-container").css("visibility", "visible");
        }
    });

    oTabHelper = new TabHelper();
    oTabHelper.listItemsTop.children("a").click(toggleTabContent);
    oTabHelper.listItemsRight.children("a").click(toggleTabContent);

    $("div.tab-content div.section-header span.item-count a").click(function() {
        selectedTab = $("ul.tabs-large li a").eq(($("div.tab-content div.section-container").index($(this).parents("div.section-container:first")) + 1));
        $(document).scrollTo(250, 500, function() {
            selectedTab.trigger("click");
        });
    });

    initialTextValue = getInitialTextValue();
});

HumanyEventTracker = function() {
    this.SearchType = "Search box";
    this.NoResult = false;
    this.NoResultURIAttr = "&gaCat2=No result";
    this.SetSearchType = function() {
        if ($("div#search-box input#humanySearchInput").length > 0) { this.SearchType = "Actual search page"; }
    }
    this.NoOfHits = 0;
    this.SearchPhrase = "";
    this.SearchPhrasePrevious = this.SearchPhrase;
    this.SetSearchPhrase = function(searchPhrase) {
        this.SearchPhrase = $.trim(searchPhrase);
    }
    this.SetCountryResult = function(numberOfHits) {
        this.NoOfHits += numberOfHits;
    }
    this.SetDestinationResult = function(numberOfHits) {
        this.NoOfHits += numberOfHits;
    }
    this.SetHotelResult = function(numberOfHits) {
        this.NoOfHits += numberOfHits;
    }
    this.SetFaqResult = function(numberOfHits) {
        this.NoOfHits += numberOfHits;
    }
    this.SetExcursionResult = function(numberOfHits) {
        this.NoOfHits += numberOfHits;
    }
    this.SendEvent = function(pageNum) {
        if (this.SearchPhrase == "" || this.SearchPhrase == "undefined" || typeof (this.SearchPhrase) == "undefined") {
            return;
        }
        if ((pageNum == 1) && (this.SearchPhrase != this.SearchPhrasePrevious)) {
            this.SetSearchType();
            this.NoResult = (!this.NoOfHits > 0);
            try {
                var siteSearchURI = encodeURI(WebGuideStrings.showAllLinkUrl + "?gaEntry=" + this.SearchPhrase + "&gaCat1=" + this.SearchType + ((this.NoResult) ? this.NoResultURIAttr : "") + "&view=" + Math.ceil(999999 * Math.random()));
                //$("body").prepend("<b>" + this.SearchType + ", " + this.NoOfHits + ", " + siteSearchURI + "</b><br/>");
                _gaq.push(['_trackPageview', siteSearchURI]);
            } catch (err) { }
        }
        this.SearchPhrasePrevious = this.SearchPhrase;
        this.NoOfHits = 0;
    }
}
humanyEventTracker = new HumanyEventTracker();

var defaultItemsPerPage = 10;
var itemsPerPage = 10;
var itemsPerSuggestion = 2;
var oTabHelper = null;
TabHelper = function() {
    this.selectedIndex = 1;
    this.listTop = $("ul.tabs-large");
    this.listItemsTop = this.listTop.children("li");
    this.listRight = $("div.right-column ul.tab-links");
    this.listItemsRight = this.listRight.children("li");
}

toggleTabContent = function(event) {
    event.preventDefault();
    if ($(this).parent("li").hasClass("disabled")) {
        return false;
    }
    oTabHelper.selectedIndex = $(this).parents("ul:first").find("li a").index(this);
    oTabHelper.listItemsTop.removeClass("selected");
    oTabHelper.listItemsRight.removeClass("selected");

    oTabHelper.listItemsTop.eq(oTabHelper.selectedIndex).addClass("selected");
    oTabHelper.listItemsRight.eq(oTabHelper.selectedIndex).addClass("selected");

    $("div#tab-box-large").attr("class", "tab-box-large-left tab-selected-" + (oTabHelper.selectedIndex + 1));

    if (oTabHelper.selectedIndex == 0) {
        itemsPerPage = 10;
        if (typeof ($("div.countries div.country-result")[0].itemsPerPage) != "undefined" && $("div.countries div.country-result")[0].itemsPerPage != itemsPerPage && $("div.countries div.country-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedCountries($("div.countries div.country-result").html("").addClass("searching"), 1);
        }
        if (typeof ($("div.destinations div.destination-result")[0].itemsPerPage) != "undefined" && $("div.destinations div.destination-result")[0].itemsPerPage != itemsPerPage && $("div.destinations div.destination-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedDestinations($("div.destinations div.destination-result").html("").addClass("searching"), 1);
        }
        if (typeof ($("div.hotels div.hotel-result")[0].itemsPerPage) != "undefined" && $("div.hotels div.hotel-result")[0].itemsPerPage != itemsPerPage && $("div.hotels div.hotel-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedHotels($("div.hotels div.hotel-result").html("").addClass("searching"), 1);
        }
        if (typeof ($("div.excursions div.excursion-result")[0].itemsPerPage) != "undefined" && $("div.excursions div.excursion-result")[0].itemsPerPage != itemsPerPage && $("div.excursions div.excursion-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedExcursions($("div.excursions div.excursion-result").html("").addClass("searching"), 1);
        }
    }
    else if (oTabHelper.selectedIndex == 2) {
        itemsPerPage = 30;
        if (typeof ($("div.countries div.country-result")[0].itemsPerPage) != "undefined" && $("div.countries div.country-result")[0].itemsPerPage != itemsPerPage && $("div.countries div.country-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedCountries($("div.countries div.country-result").html("").addClass("searching"), 1);
        }
    }
    else if (oTabHelper.selectedIndex == 3) {
        itemsPerPage = 30;
        if (typeof ($("div.destinations div.destination-result")[0].itemsPerPage) != "undefined" && $("div.destinations div.destination-result")[0].itemsPerPage != itemsPerPage && $("div.destinations div.destination-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedDestinations($("div.destinations div.destination-result").html("").addClass("searching"), 1);
        }
    }
    else if (oTabHelper.selectedIndex == 4) {
        itemsPerPage = 30;
        if (typeof ($("div.hotels div.hotel-result")[0].itemsPerPage) != "undefined" && $("div.hotels div.hotel-result")[0].itemsPerPage != itemsPerPage && $("div.hotels div.hotel-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedHotels($("div.hotels div.hotel-result").html("").addClass("searching"), 1);
        }
    }
    else if (oTabHelper.selectedIndex == 5) {
        itemsPerPage = 30;
        if (typeof ($("div.excursions div.excursion-result")[0].itemsPerPage) != "undefined" && $("div.excursions div.excursion-result")[0].itemsPerPage != itemsPerPage && $("div.excursions div.excursion-result")[0].numberOfHits > defaultItemsPerPage) {
            getPagedExcursions($("div.excursions div.excursion-result").html("").addClass("searching"), 1);
        }
    }
}

var timer = null;
initHumanySearch = function() {
    clearTimeout(timer);
    timer = null;
    performHumanySearch();
}

initHumanySearchLarge = function() {
    clearTimeout(timer);
    timer = null;
    performHumanySearchLarge();
}

var loadingContainersTimer = null;
checkForLoadingContainers = function() {
    clearTimeout(loadingContainersTimer);
    loadingContainersTimer = null;
    if ($("div#humanySuggestResult").length > 0) { $("div#humanySuggestResult div.searching").removeClass("searching").addClass("empty"); }
    else if ($("div#humany-container").length > 0) { $("div#humany-container div.searching").removeClass("searching").addClass("empty"); }
}

initCheckForLoadingContainers = function() {
    if (loadingContainersTimer == null && timer == null) { loadingContainersTimer = setTimeout("checkForLoadingContainers()", 1500); }
}

getInitialTextValue = function() {
    if ($("#humanySuggestSearchInput").length > 0) {
        return $("#humanySuggestSearchInput").val();
    }
    else {
        return "";
    }
}

var currentSearchText = "";
var initialTextValue = "";
performHumanySearch = function() {
    var inputValue = $.trim($("#humanySuggestSearchInput").val()).toLowerCase();
    if (inputValue == "" || inputValue == "undefined" || typeof (inputValue) == "undefined") {
        $("#humanySuggestResult").hide();
        $("#humanySuggestSearchInput").removeClass("searching");
        currentSearchText = "";
        return;
    }
    else if ((inputValue == currentSearchText) || (inputValue == initialTextValue)) {
        $("#humanySuggestSearchInput").removeClass("searching");
        return;
    }
    currentSearchText = inputValue;
    var loadingResultHTML =
        "<div class=\"entry-top\">" +
            "<a href=\"javascript:void(0)\"><img src=\"" + oBaseAppSettings.IncludeSiteDirectory + "/Images/BlueSites/Humany/1/btn_close.png\" alt=\"\" /></a>" +
        "</div>" +
        "<div class=\"entry-middle\">" +
            "<div class=\"entry-result\"></div>" +
        "</div>" +
        "<div class=\"entry-bottom\"><a href=\"" + WebGuideStrings.showAllLinkUrl + "?humanyEntry=" + currentSearchText + "&view=" + Math.ceil(999999 * Math.random()) + "\">" + WebGuideStrings.showAllOnOwnPage + " &#187;</a></div>" +
        "<div class=\"clear\"></div>";
    $("#humanySuggestResult").html(loadingResultHTML).show();
    $("#humanySuggestResult .entry-top a").click(function() { $("#humanySuggestResult").hide(); $("#panorama-container").css("visibility", "visible"); });
    var resultHTML =
        "<div class=\"countries searching\">" +
            "<span class=\"status\"></span><h3>" + WebGuideStrings.countries + "</h3>" +
        "</div>" +
        "<div class=\"destinations searching\">" +
            "<span class=\"status\"></span><h3>" + WebGuideStrings.destinations + "</h3>" +
        "</div>" +
        "<div class=\"hotels searching\">" +
            "<span class=\"status\"></span><h3>" + WebGuideStrings.hotels + "</h3>" +
        "</div>" +
        "<div class=\"excursions searching\">" +
            "<span class=\"status\"></span><h3>" + WebGuideStrings.excursions + "</h3>" +
        "</div>" +
        "<div class=\"faq searching\">" +
            "<h3>" + WebGuideStrings.faq + "</h3>" +
        "</div>" +
        "<div class=\"all-empty\">" +
            "<h3>&#160;</h3>" +
            "<div class=\"text-item\">" + WebGuideStrings.searchNoResult + "</div>" +
        "</div>";
    var resultElems = $(resultHTML);
    $("#panorama-container").css("visibility", "hidden");
    $("#humanySuggestResult div.entry-result").html("").append(resultElems);

    humanyEventTracker.SetSearchPhrase(inputValue);

    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(inputValue) + "&type=country&pageSize=" + itemsPerSuggestion + "&pageNumber=1&suggest=true&callback=?", function(data) {
        var entryHTML = "";
        var entryCounter = 0;
        if (data.country != null) {
            $.each(data.country, function(ientry, entry) {
                if (entryCounter < itemsPerSuggestion) {
                    entryHTML += getItemHTML(entryCounter, entry);
                }
                entryCounter++;
            });
        }
        humanyEventTracker.SetCountryResult(data.numberOfHits);
        resultElems.eq(0).children("span.status").html(String.format(WebGuideStrings.textNumberOfHits, ((entryCounter > itemsPerSuggestion) ? itemsPerSuggestion : entryCounter), data.numberOfHits));
        resultElems.eq(0).children("h3").after(entryHTML);
        if (resultElems.eq(0).children("div.entry-item").length > 0) {
            resultElems.eq(0).removeClass("searching").show();
            bindEntryItemEvents(resultElems.eq(0).children("div.entry-item"));
        } else { resultElems.eq(0).removeClass("searching").addClass("empty"); }
        if (resultElems.filter(".empty").length == 5) { $("div#humanySuggestResult div.all-empty").show(); humanyEventTracker.SendEvent(1); }
        else if (resultElems.filter(".searching").length == 0) { resultElems.find("span.status:visible").eq(0).addClass("first"); humanyEventTracker.SendEvent(1); }
        $("#humanySuggestSearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });

    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(inputValue) + "&type=destination&pageSize=" + itemsPerSuggestion + "&pageNumber=1&suggest=true&callback=?", function(data) {
        var destinationHTML = "";
        var destinationCounter = 0;
        if (data.destination != null) {
            $.each(data.destination, function(idestination, destination) {
                if (typeof (destination.name) != "undefined") {
                    if (destinationCounter < itemsPerSuggestion) {
                        destinationHTML += getItemHTML(destinationCounter, destination);
                    }
                    destinationCounter++;
                }
            });
        }
        humanyEventTracker.SetDestinationResult(data.numberOfHits);
        resultElems.eq(1).children("span.status").html(String.format(WebGuideStrings.textNumberOfHits, ((destinationCounter > itemsPerSuggestion) ? itemsPerSuggestion : destinationCounter), data.numberOfHits));
        resultElems.eq(1).children("h3").after(destinationHTML);
        if (resultElems.eq(1).children("div.entry-item").length > 0) {
            resultElems.eq(1).removeClass("searching").show();
            bindEntryItemEvents(resultElems.eq(1).children("div.entry-item"));
        } else { resultElems.eq(1).removeClass("searching").addClass("empty"); }
        if (resultElems.filter(".empty").length == 5) { $("div#humanySuggestResult div.all-empty").show(); humanyEventTracker.SendEvent(1); }
        else if (resultElems.filter(".searching").length == 0) { resultElems.find("span.status:visible").eq(0).addClass("first"); humanyEventTracker.SendEvent(1); }
        $("#humanySuggestSearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });

    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(inputValue) + "&type=hotel&pageSize=" + itemsPerSuggestion + "&pageNumber=1&suggest=true&callback=?", function(data) {
        var hotelHTML = "";
        var hotelCounter = 0;
        if (data.hotel != null) {
            $.each(data.hotel, function(ihotel, hotel) {
                if (hotelCounter < itemsPerSuggestion) {
                    hotelHTML += getItemHTML(hotelCounter, hotel);
                }
                hotelCounter++;
            });
        }
        humanyEventTracker.SetHotelResult(data.numberOfHits);
        resultElems.eq(2).children("span.status").html(String.format(WebGuideStrings.textNumberOfHits, ((hotelCounter > itemsPerSuggestion) ? itemsPerSuggestion : hotelCounter), data.numberOfHits));
        resultElems.eq(2).children("h3").after(hotelHTML);
        if (resultElems.eq(2).children("div.entry-item").length > 0) {
            resultElems.eq(2).removeClass("searching").show();
            bindEntryItemEvents(resultElems.eq(2).children("div.entry-item"));
        } else { resultElems.eq(2).removeClass("searching").addClass("empty"); }
        if (resultElems.filter(".empty").length == 5) { $("div#humanySuggestResult div.all-empty").show(); humanyEventTracker.SendEvent(1); }
        else if (resultElems.filter(".searching").length == 0) { resultElems.find("span.status:visible").eq(0).addClass("first"); humanyEventTracker.SendEvent(1); }
        $("#humanySuggestSearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });
    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(inputValue) + "&type=excursion&pageSize=" + itemsPerSuggestion + "&pageNumber=1&suggest=true&callback=?", function(data) {
        var excursionHTML = "";
        var excursionCounter = 0;
        if (data.excursion != null) {
            $.each(data.excursion, function(iexcursion, excursion) {
                if (excursionCounter < itemsPerSuggestion) {
                    excursionHTML += getExcursionHTML(excursionCounter, excursion);
                }
                excursionCounter++;
            });
        }
        humanyEventTracker.SetExcursionResult(data.numberOfHits);
        resultElems.eq(3).children("span.status").html(String.format(WebGuideStrings.textNumberOfHits, ((excursionCounter > itemsPerSuggestion) ? itemsPerSuggestion : excursionCounter), data.numberOfHits));
        resultElems.eq(3).children("h3").after(excursionHTML);
        if (resultElems.eq(3).children("div.entry-item").length > 0) {
            resultElems.eq(3).removeClass("searching").show();
            bindEntryItemEvents(resultElems.eq(3).children("div.entry-item"));
        } else { resultElems.eq(3).removeClass("searching").addClass("empty"); }
        if (resultElems.filter(".empty").length == 5) { $("div#humanySuggestResult div.all-empty").show(); humanyEventTracker.SendEvent(1); }
        else if (resultElems.filter(".searching").length == 0) { resultElems.find("span.status:visible").eq(0).addClass("first"); humanyEventTracker.SendEvent(1); }
        $("#humanySuggestSearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });

    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(inputValue) + "&type=faq&pageSize=" + itemsPerSuggestion + "&pageNumber=1&suggest=true&callback=?", function(data) {
        renderFaqResults(data, resultElems);
        initCheckForLoadingContainers();
    });
}
renderFaqResults = function(data, resultElems) {
    resultElems.eq(4).addClass("searching").find("div.entry-item-faq").remove();
    var faqHTML = "";
    var faqCounter = 0;
    if (data.faq != null && data.numberOfHits > 0) {
        $.each(data.faq, function(ifaq, faq) {
            if (faqCounter < itemsPerPage) {
                faqHTML += "<div class=\"entry-item-faq\">" + ((faq.title != "") ? "<h4>" + faq.title + "</h4>" : "") +
                            "<span>" + faq.answer + "</span>" + "</div>";
            }
            faqCounter++;
        });
    }
    resultElems.eq(4).children("h3").after(faqHTML);

    humanyEventTracker.SetFaqResult(data.numberOfHits);

    if (resultElems.eq(4).children("div.entry-item-faq").length > 0) {
        resultElems.eq(4).removeClass("searching").show();

        resultElems.eq(4).find("a").bind("click", function(e) {
            if ($(this).attr("href").indexOf("fritidsresor.humany.com") != -1) {
                $.getJSON($(this).attr("href") + "&callback=?", function(datadata) {
                    renderFaqResults(datadata, resultElems);
                });
                return false;
            }
        });

    } else { resultElems.eq(4).removeClass("searching").addClass("empty"); }
    if (resultElems.filter(".empty").length == 5) { $("div#humanySuggestResult div.all-empty").show(); humanyEventTracker.SendEvent(1); }
    else if (resultElems.filter(".searching").length == 0) { resultElems.find("span.status:visible").eq(0).addClass("first"); humanyEventTracker.SendEvent(1); }
    $("#humanySuggestSearchInput").removeClass("searching");
}

performHumanySearchLarge = function() {
    $("div.tab-content div.all-empty").hide();
    var inputValue = $.trim($("#humanySearchInput").val()).toLowerCase();
    if (inputValue == "" || inputValue == currentSearchText) {
        currentSearchText = inputValue;
        $("#humanySearchInput").removeClass("searching");
        return;
    }
    else if (inputValue == initialTextValue) {
        $("#humanySearchInput").removeClass("searching");
        return;
    }
    currentSearchText = inputValue;

    humanyEventTracker.SetSearchPhrase(inputValue);

    var faqResultHTML = "<div class=\"faq-result searching\"></div>";
    var faqResultElem = $(faqResultHTML);
    $("div.tab-content div.section-container").eq(0).children("div.section-content").html("").append(faqResultElem);
    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(inputValue) + "&type=faq&pageSize=" + itemsPerPage + "&pageNumber=1&callback=?", function(data) {
        renderFaqResultsLarge(data, faqResultElem);
        initCheckForLoadingContainers();
    });

    var countriesResultHTML = "<div class=\"country-result searching\"></div>";
    getPagedCountries($(countriesResultHTML), 1);

    var destinationsResultHTML = "<div class=\"destination-result searching\"></div>";
    getPagedDestinations($(destinationsResultHTML), 1);

    var hotelResultHTML = "<div class=\"hotel-result searching\"></div>";
    getPagedHotels($(hotelResultHTML), 1);

    var excursionsResultHTML = "<div class=\"excursion-result searching\"></div>";
    getPagedExcursions($(excursionsResultHTML), 1);
}

renderFaqResultsLarge = function(data, faqResultElem) {
    var faqHTML = "";
    var tipHTML = "";
    var faqCounter = 0;
    if (data.faq != null) {
        $("div.tab-content div.section-container").eq(0).removeClass("number-of-hits-0").removeClass("number-of-hits-1").addClass(String.format("number-of-hits-{0}", data.numberOfHits));
        $.each(data.faq, function(i, faq) {
            if (faqCounter < itemsPerPage) {
                faqHTML += ((faq.title != "") ? "<h3>" + faq.title + "</h3>" : "") +
                            "<span>" + faq.answer + "</span>";
                tipHTML += (typeof (faq.suggestion) != "undefined" && faq.suggestion != null && faq.suggestion != "") ? "<p>" + faq.suggestion + "</p>" : "";
            }
            faqCounter++;
        });
    }
    faqResultElem.append(faqHTML);

    humanyEventTracker.SetFaqResult(data.numberOfHits);

    $("ul.tabs-large li").eq(1).find("span b").text((data.numberOfHits > 0) ? "(" + data.numberOfHits + ")" : "");
    $("div.right-column ul.tab-links li").eq(1).find("b").text((data.numberOfHits > 0) ? "(" + data.numberOfHits + ")" : "");
    $("div#tab-box-large div.right-column div.small-box div.small-box-content").html(tipHTML).find("a.suggestion").click(function() {
        $("input#humanySearchInput").val($("input#humanySearchInput").val() + " " + $(this).text());
        initHumanySearchLarge();
    });
    if (faqResultElem.children("span").length > 0) {
        faqResultElem.removeClass("searching");

        faqResultElem.find("a").bind("click", function(e) {
            if ($(this).attr("href").indexOf("fritidsresor.humany.com") != -1) {
                faqResultElem.addClass("searching").html("");
                $.getJSON($(this).attr("href") + "&callback=?", function(datadata) {
                    renderFaqResultsLarge(datadata, faqResultElem);
                });
                return false;
            }
        });

    } else { faqResultElem.removeClass("searching").addClass("empty").html(WebGuideStrings.searchNoResult); }
    if (($("div.tab-content div.section-container .empty").length == 4) || ($("div.tab-content div.section-container .searching").length == 0)) { humanyEventTracker.SendEvent(1); }
    $("#humanySearchInput").removeClass("searching");
}

getItemHTML = function(counter, item, cssClass, catalogues) {
    if (item == null) { return ""; }
    var seasonIconHTML = "";
    if (catalogues != null) {
        seasonIconHTML = getSeasonIconHTML(catalogues, item.catalogue_id);
    }
    var itemName = item.name;
    var itemText = ((typeof (item.text) != "undefined") ? item.text : "");
    if (itemText == "") { itemText = (typeof (item.info) != "undefined" && typeof (item.info.usp) != "undefined") ? item.info.usp : ""; }
    if (itemName == "" && itemText == "" && typeof (item.city) != "undefined") { itemName = item.city; }
    return "<div class=\"entry-item" + ((counter > 0) ? " delimiter" : "") + "" + ((typeof (cssClass) != "undefined") ? " " + cssClass : "") + "\">" +
            "<img src=\"" + item.media.icon_picture.replace(/w=152&h=100/gi, "cw=45&h=30&ct=0") + "\" class=\"thumb\" alt=\"\" />" +
            "<div class=\"info" + (seasonIconHTML != "" ? " info-small" : "") + "\">" +
                "<h4><a href=\"" + item.page + "\">" + itemName + ((typeof (item.grade) != "undefined") ? " " + writeHotelGrade(item.grade) : "") + "</a></h4>" +
                "<p>" + itemText + "</p>" +
            "</div>" +
            seasonIconHTML +
            "<div class=\"clear\"></div>" +
        "</div>";
}

getHotelHTML = function(counter, item, cssClass, catalogues, priceExample) {
    if (item == null) { return ""; }
    var seasonIconHTML = "";
    var priceExampleHTML = "", priceExampleInfoHTML = "";
    if (catalogues != null) {
        seasonIconHTML = getSeasonIconHTML(catalogues, item.catalogue_id);
    }
    if (priceExample != null) {
        priceExampleHTML = getPriceExampleHTML(priceExample);
        priceExampleInfoHTML = getPriceExampleTextHTML(priceExample);
    }
    var itemName = item.name;
    var itemText = ((typeof (item.text) != "undefined") ? item.text : "");
    if (itemText == "") { itemText = (typeof (item.info) != "undefined" && typeof (item.info.usp) != "undefined") ? item.info.usp : ""; }
    if (itemName == "" && itemText == "" && typeof (item.city) != "undefined") { itemName = item.city; item.city = ""; }
    return "<div class=\"entry-item" + ((counter > 0) ? " delimiter" : "") + "" + ((typeof (cssClass) != "undefined") ? " " + cssClass : "") + "\">" +
            "<img src=\"" + item.media.icon_picture.replace(/w=152&h=100/gi, "w=115&h=78&ct=0") + "\" class=\"hotel-thumb\" alt=\"\" />" +
            "<div class=\"info" + (seasonIconHTML != "" ? " info-small hotel-info-small" : "") + "\">" +
                "<div class=\"breadcrumbs\"><a href=\"" + item.country_page + "\">" + item.country + "</a>" + ((typeof (item.destination) != "undefined" && item.destination != null && item.destination != "") ? "<span class=\"pipe\">|</span><a href=\"" + item.destination_page + "\">" + item.destination + "</a>" : "") + ((typeof (item.city) != "undefined" && item.city != null && item.city != "") ? "<span class=\"pipe\">|</span><a href=\"" + item.city_page + "\">" + item.city + "</a>" : "") + "</div>" +
                "<h4><a href=\"" + item.page + "\">" + itemName + ((typeof (item.grade) != "undefined") ? " " + writeHotelGrade(item.grade) : "") + "</a></h4>" +
                "<p>" + itemText + "</p>" +
            "</div>" +
            priceExampleHTML +
            seasonIconHTML +
            "<div class=\"clear\"></div>" +
            priceExampleInfoHTML +
        "</div>";
}

getExcursionHTML = function(counter, item) {
    if (item == null) { return ""; }
    return "<div class=\"entry-item" + ((counter > 0) ? " delimiter" : "") + "\">" +
            "<img src=\"" + item.media.icon_picture.replace(/g=excursion/gi, "&g=extra").replace(/w=152&h=100/gi, "cw=45&h=30&ct=0") + "\" class=\"thumb\" alt=\"\" />" +
            "<div class=\"info\">" +
                "<h4><a href=\"" + item.page + "\">" + item.name + "</a></h4>" +
                "<p>" + item.intro + "</p>" +
            "</div>" +
            "<div class=\"clear\"></div>" +
        "</div>";
}

getSeasonIconHTML = function(catalogues, catid) {
    var seasonIconHTML = "";
    $.each(catalogues, function(icatalogue, catalogue) {
        if (catalogue.id == catid) {
            seasonIconHTML = "<div class=\"season-icon season-" + catalogue.symbol + "\">" + catalogue.name + "</div>";
            return;
        }
    });
    return seasonIconHTML;
}

getPriceExampleHTML = function(priceExample) {
    return "<span class=\"hotel-price-example\">" + WebGuideStrings.priceExamplePerAdult + "*<b>" + formatPriceExample(parseInt(priceExample.price.replace(" ", ""), 10) / 2) + "</b></span>";
}

formatPriceExample = function(n) {
    if (isNaN(n)) { return ("0"); }
    s = n.toString(); nStart = s.indexOf(" ");
    if (nStart < 0) { nStart = s.length; } nStart -= 3;
    while (nStart >= 1) { s = s.substring(0, nStart) + " " + s.substring(nStart, s.length); nStart -= 3; }
    return ((s.indexOf(WebGuideStrings.currencySign) != -1) ? s : s + WebGuideStrings.currencySign);
}

getPriceExampleTextHTML = function(priceexample) {
    var priceExampleInfoHTML = "";
    if ((typeof (priceexample) != "undefined") && (priceexample != null)) {
        priceExampleInfoHTML = "<div class=\"hotel-price-example-text\">* " + WebGuideStrings.date + " " + priceexample.departuredate + " | " + WebGuideStrings.departure + ": " + priceexample.departurecity + " | " + priceexample.lengthofstay + " " + WebGuideStrings.days + "</div>"
    }
    return priceExampleInfoHTML;
}

getHotelItemHTML = function(counter, country, destination, city, hotel) {
    return "<div class=\"c_1\">" +
            getHotelConceptHTML(hotel.category) +
            "<a href=\"#\">" + country.name + "</a> | " +
            ((typeof (destination.name) != "undefined" && destination.name != "") ? "<a href=\"#\">" + destination.name + "</a> | " : "") +
            "<a href=\"#\">" + city.name + "</a>" +
            "<h2>" + hotel.name + ((typeof (hotel.grade) != "undefined") ? " " + writeHotelGrade(hotel.grade) : "") + "</h2>" +
            "<div class=\"clear\"></div>" +
        "</div>" +
        "<div class=\"c_2\">" +
            ((typeof (hotel.info) != "undefined" && typeof (hotel.info[0]) != "undefined" && typeof (hotel.info[0].usp) != "undefined") ? "<h3 class=\"usp\"><span>" + hotel.info[0].usp + "</span></h3>" : "") +
            "<div class=\"left-container\">" +
                "<div style=\"background-image: url(" + hotel.media.icon_picture.replace(/&w=152&h=100/gi, "&w=254") + ");\" class=\"hotel-image-bg\">" +
                    "<a class=\"hotel-about-info\" href=\"javascript:void(0)\">" +
                        "<img alt=\"" + hotel.name + "\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/Layout/HotelItem/hi-border.png\"/>" +
                    "</a>" +
                "</div>" +
            "</div>" +
            "<div class=\"right-container\">" +
                "<div class=\"hotel-facts-dp\">" +
                    "<table class=\"hotel-facts-dp\">" +
                        "<tbody>" +
                            getHotelFactsHTML(hotel.fact) +
                        "</tbody>" +
                    "</table>" +
                    "<a href=\"#\" class=\"read-more\">L�s mer &#187;</a>" +
                "</div> " +
                getPriceExamplePriceHTML(hotel.priceexample) +
            "</div>" +
            "<input type=\"image\" class=\"select-package-btn\" alt=\"V�lj resa\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/Buttons/1/select.gif\"/>" +
        "</div>" +
        getPriceExampleInfoHTML(hotel.priceexample);
}

getHotelConceptHTML = function(concept) {
    var conceptHTML = "";
    if (concept == "BlueVillage") {
        conceptHTML = "<img class=\"concept-logo\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/ConceptLogo/1/BlueVillage.png\" />";
    } else if (concept == "BlueVillageExotic") {
        conceptHTML = "<img class=\"concept-logo\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/ConceptLogo/1/BlueVillageExotic.png\" />";
    } else if (concept == "BlueInclusive") {
        conceptHTML = "<img class=\"concept-logo\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/ConceptLogo/1/BlueInclusive.png\" />";
    } else if (concept == "BlueCouples") {
        conceptHTML = "<img class=\"concept-logo\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/ConceptLogo/1/BlueCouples.png\" />";
    } else if (concept == "BlueSelection") {
        conceptHTML = "<img class=\"concept-logo\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/ConceptLogo/1/BlueSelection.png\" />";
    } else if (concept == "BlueUnique") {
        conceptHTML = "<img class=\"concept-logo\" src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/ConceptLogo/1/BlueUnique.png\" />";
    }
    return conceptHTML;
}

getHotelFactsHTML = function(facts) {
    var factHTML = "";
    if ((typeof (facts) != "undefined") && (facts != null)) {
        $.each(facts, function(ifact, fact) {
            if (ifact > 4) {
                return;
            }
            factHTML += "<tr class=\"" + ((ifact % 2 == 0) ? "odd" : "") + "\">" +
                    "<td class=\"label\">" + fact.text + ":</td><td>" + fact.value + "</td>" +
                "</tr>"
        });
    }
    return factHTML;
}

getPriceExamplePriceHTML = function(priceexample) {
    var priceExamplePriceHTML = "";
    if ((typeof (priceexample) != "undefined") && (priceexample != null)) {
        priceExamplePriceHTML = "<span class=\"hotel-price-text\">Prisex/vuxen*</span><span class=\"hotel-price\">" + priceexample.price + ":-</span>";
    }
    return priceExamplePriceHTML;
}

getPriceExampleInfoHTML = function(priceexample) {
    var priceExampleInfoHTML = "";
    if ((typeof (priceexample) != "undefined") && (priceexample != null)) {
        priceExampleInfoHTML = "<div class=\"c_3\">* Datum " + priceexample.departuredate + " | Avresa fr�n " + priceexample.departurecity + " | " + priceexample.lengthofstay + " dagar</div>"
    }
    return priceExampleInfoHTML;
}

writeHotelGrade = function(grade) {
    var gradeLetters = "";
    var letter = "F";
    if ($("body").hasClass("brand-id-2") || $("body").hasClass("brand-id-4")) { letter = "S"; }
    for (i = 0; i < Math.floor(parseInt(grade)); i++) {
        gradeLetters += letter;
    }
    if (grade.toString().length > 1) {
        gradeLetters += "+";
    }
    return gradeLetters;
}

bindEntryItemEvents = function(entryItems) {
    entryItems.hover(
        function() {
            $(this).addClass("hover");
        },
        function() {
            $(this).removeClass("hover");
        }
    );
    entryItems.click(function(event) {
        event.stopPropagation();
        document.location.href = $(this).find("h4 a").attr("href");
    });
}

step = function(keyCode) {
    var selectedIndex = $("div#humanySuggestResult div.entry-item").index($("div#humanySuggestResult div.hover"));
    selectedIndex = (keyCode == 38) ? (selectedIndex - 1) : (selectedIndex + 1);
    if (selectedIndex < -1) { selectedIndex = ($("div#humanySuggestResult div.entry-item").length - 1); }
    else if (selectedIndex > $("div#humanySuggestResult div.entry-item").length) { selectedIndex = -1; }
    $("div#humanySuggestResult div.entry-item").removeClass("hover");
    if (selectedIndex >= 0) {
        $("div#humanySuggestResult div.entry-item").eq(selectedIndex).addClass("hover");
    }
}

browseToLargeSearch = function() {
    var entryValue = $.trim($("input#humanySuggestSearchInput").val());
    if (entryValue == "" || entryValue == "undefined" || typeof (entryValue) == "undefined") {
        $("#humanySuggestSearchInput").removeClass("searching");
        return;
    }
    if (entryValue != initialTextValue) {
        document.location.href = WebGuideStrings.showAllLinkUrl + "?humanyEntry=" + entryValue + "&view=" + Math.ceil(999999 * Math.random());
    }
    else {
        // For notfound page
        var notFoundEntryValue = $("input#search-field").val();
        if (notFoundEntryValue != initialTextValue) {
            document.location.href = WebGuideStrings.showAllLinkUrl + "?humanyEntry=" + notFoundEntryValue + "&view=" + Math.ceil(999999 * Math.random());
        }
    }
}

browseToItem = function(itemIndex) {
    $("div#humanySuggestResult div.entry-item").eq(itemIndex).trigger("click");
}

jQuery.fn.extend({
    setNumberOfHitsCssClass: function(numberOfHits) {
        if (numberOfHits == 0) {
            $(this).addClass("disabled");
        } else {
            $(this).removeClass("disabled");
        }
        return $(this);
    },
    addPaging: function(numberOfHits, searchType) {
        var itemContainer = $(this);
        if (numberOfHits <= itemsPerPage) {
            itemContainer.find("div.section-header span.item-count b").hide();
        } else {
            itemContainer.find("div.section-header span.item-count b").show();
        }
        var pagingContainer = $(this).prev("div.section-paging");
        pagingContainer.children("ul.paging-items").html("");
        var numberOfPages = Number(numberOfHits / itemsPerPage);
        if ((numberOfHits % itemsPerPage) > 0) {
            numberOfPages++;
        }
        if (numberOfPages < 2) {
            return;
        }
        var listItemsHTML = "";
        for (i = 1; i <= numberOfPages; i++) {
            listItemsHTML += "<li class=\"" + ((i == 1) ? "selected " : "") + ((i > 9) ? "two-digits " : "") + ((i > itemsPerPage) ? "overflow " : "") + "digit\"><span>" + i.toString() + "</span></li>";
        }
        var listItems = $("<li class=\"prev disabled\">&#171;&#171;</li>" + listItemsHTML + "<li class=\"next\">&#187;&#187;</li>");
        listItems.filter(".overflow:first").addClass("dotted");
        pagingContainer.show().children("ul.paging-items").append(listItems);
        listItems.filter(".digit").click(function() {
            pagingContainer.find("ul.paging-items li.digit").removeClass("selected");
            $(this).addClass("selected");
            var selectedIndex = pagingContainer.find("ul.paging-items li.digit").index($(this));
            pagingContainer.find("ul.paging-items li.prev, ul.paging-items li.next").removeClass("disabled");
            if (selectedIndex == 0) {
                pagingContainer.find("ul.paging-items li.prev").addClass("disabled");
            } else if (selectedIndex >= (pagingContainer.find("ul.paging-items li.digit").length - 1)) {
                pagingContainer.find("ul.paging-items li.next").addClass("disabled");
            }
            if ($(this).hasClass("dotted")) {
                var dir = (!$(this).prev("li.digit").hasClass("overflow")) ? (selectedIndex - 1) : (selectedIndex - itemsPerPage);
                var listItemsNext = null;
                if (dir > 0) {
                    listItemsNext = listItems.filter(".digit").removeClass("dotted").addClass("overflow").filter(":gt(" + (dir) + "):lt(" + (itemsPerPage) + ")").removeClass("overflow");
                } else {
                    listItemsNext = listItems.filter(".digit").removeClass("dotted").addClass("overflow").filter(":lt(" + (itemsPerPage) + ")").removeClass("overflow");
                }
                listItemsNext.filter(":first").prev("li.digit").addClass("dotted");
                listItemsNext.filter(":last").next("li.digit").addClass("dotted");
            }
            itemContainer.find("div.section-content").children("div").html("").addClass("searching");
            if (searchType == "countries") {
                getPagedCountries(itemContainer.find("div.section-content").children("div"), selectedIndex + 1);
            } else if (searchType == "destinations") {
                getPagedDestinations(itemContainer.find("div.section-content").children("div"), selectedIndex + 1);
            } else if (searchType == "hotels") {
                getPagedHotels(itemContainer.find("div.section-content").children("div"), selectedIndex + 1);
            } else if (searchType == "excursions") {
                getPagedExcursions(itemContainer.find("div.section-content").children("div"), selectedIndex + 1);
            }
        });
        listItems.filter(function() { return ($(this).hasClass("prev") || $(this).hasClass("next")); }).click(function() {
            if ($(this).hasClass("disabled")) {
                return;
            }
            var dir = (($(this).hasClass("next")) ? 1 : -1);
            var selectedIndex = (pagingContainer.find("ul.paging-items li.digit").index(pagingContainer.find("ul.paging-items li.digit.selected"))) + dir;
            pagingContainer.find("ul.paging-items li.digit").eq(selectedIndex).trigger("click");
        });
        return $(this);
    },
    removePaging: function() {
        var pagingContainer = $(this).prev("div.section-paging");
        pagingContainer.hide();
        pagingContainer.find("ul.paging-items li").unbind("click");
        return $(this);
    }
});

getPagedCountries = function(countryContainer, pageNum) {
    var countriesResultElem = countryContainer;
    countriesResultElem[0].itemsPerPage = itemsPerPage;
    $("div.tab-content div.section-container").eq(1).removeClass("disabled").find("div.section-header span.item-count").hide();
    if (pageNum == 1) {
        $("div.tab-content div.section-container").eq(1).children("div.section-content").html("").append(countriesResultElem);
    }
    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(currentSearchText) + "&type=country&pageSize=" + itemsPerPage + "&pageNumber=" + pageNum + "&callback=?", function(data) {
        var entryHTML = "";
        var entryCounter = 0;
        if (data.country != null) {
            $.each(data.country, function(ientry, entry) {
                if (entryCounter < itemsPerPage) {
                    entryHTML += getItemHTML(entryCounter, entry, "", data.catalogue);
                }
                entryCounter++;
            });
        }

        humanyEventTracker.SetCountryResult(data.numberOfHits);

        $("div.tab-content div.section-container").eq(1).setNumberOfHitsCssClass(data.numberOfHits).find("div.section-header span.item-count").show().children("span").html(String.format(WebGuideStrings.textNumberOfHits, getFirstPos(pageNum), getLastPos(pageNum, data.numberOfHits), data.numberOfHits));
        $("ul.tabs-large li").eq(2).setNumberOfHitsCssClass(data.numberOfHits).find("span b").text("(" + data.numberOfHits + ")");
        $("div.right-column ul.tab-links li").eq(2).setNumberOfHitsCssClass(data.numberOfHits).find("b").text("(" + data.numberOfHits + ")");
        countriesResultElem[0].numberOfHits = data.numberOfHits;
        countriesResultElem.append(entryHTML);
        if (countriesResultElem.children("div.entry-item").length > 0) {
            countriesResultElem.removeClass("searching");
            bindEntryItemEvents(countriesResultElem.children("div.entry-item"));
            if (pageNum == 1) {
                $("div.tab-content div.section-container.countries").removePaging().addPaging(data.numberOfHits, "countries");
            }
        } else { $("div.tab-content div.section-container.countries").removePaging(); countriesResultElem.removeClass("searching").addClass("empty").html(WebGuideStrings.searchNoResult); }
        if (($("div.tab-content div.section-container.disabled").length == 4) && ($("div.tab-content div.section-container.number-of-hits-0").length == 1)) { $("div.tab-content div.all-empty").show(); humanyEventTracker.SendEvent(pageNum); }
        else if ($("div.tab-content div.section-container .searching").length == 0) { humanyEventTracker.SendEvent(pageNum); }
        $("#humanySearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });
}

getPagedDestinations = function(destinationContainer, pageNum) {
    var destinationsResultElem = destinationContainer;
    destinationsResultElem[0].itemsPerPage = itemsPerPage;
    $("div.tab-content div.section-container").eq(2).removeClass("disabled").find("div.section-header span.item-count").hide();
    if (pageNum == 1) {
        $("div.tab-content div.section-container").eq(2).children("div.section-content").html("").append(destinationsResultElem);
    }
    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(currentSearchText) + "&type=destination&pageSize=" + itemsPerPage + "&pageNumber=" + pageNum + "&callback=?", function(data) {
        var destinationHTML = "";
        var destinationCounter = 0;
        if (data.destination != null) {
            $.each(data.destination, function(idestination, destination) {
                var cssClass = (typeof (destination.destination) != "undefined") ? "city-item" : "destination-item";
                if (typeof (destination.name) != "undefined") {
                    if (destinationCounter < itemsPerPage) {
                        destinationHTML += getItemHTML(destinationCounter, destination, cssClass, data.catalogue);
                    }
                    destinationCounter++;
                }
            });
        }

        humanyEventTracker.SetDestinationResult(data.numberOfHits);

        $("div.tab-content div.section-container").eq(2).setNumberOfHitsCssClass(data.numberOfHits).find("div.section-header span.item-count").show().children("span").html(String.format(WebGuideStrings.textNumberOfHits, getFirstPos(pageNum), getLastPos(pageNum, data.numberOfHits), data.numberOfHits));
        $("ul.tabs-large li").eq(3).setNumberOfHitsCssClass(data.numberOfHits).find("span b").text("(" + data.numberOfHits + ")");
        $("div.right-column ul.tab-links li").eq(3).setNumberOfHitsCssClass(data.numberOfHits).find("b").text("(" + data.numberOfHits + ")");
        destinationsResultElem[0].numberOfHits = data.numberOfHits;
        destinationsResultElem.append(destinationHTML);
        if (destinationsResultElem.children("div.entry-item").length > 0) {
            destinationsResultElem.removeClass("searching");
            bindEntryItemEvents(destinationsResultElem.children("div.entry-item"));
            if (pageNum == 1) {
                $("div.tab-content div.section-container.destinations").removePaging().addPaging(data.numberOfHits, "destinations");
            }
        } else { $("div.tab-content div.section-container.destinations").removePaging(); destinationsResultElem.removeClass("searching").addClass("empty").html(WebGuideStrings.searchNoResult); }
        if (($("div.tab-content div.section-container.disabled").length == 4) && ($("div.tab-content div.section-container.number-of-hits-0").length == 1)) { $("div.tab-content div.all-empty").show(); humanyEventTracker.SendEvent(pageNum); }
        else if ($("div.tab-content div.section-container .searching").length == 0) { humanyEventTracker.SendEvent(pageNum); }
        $("#humanySearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });
}

getPagedHotels = function(hotelContainer, pageNum) {
    var hotelResultElem = hotelContainer;
    hotelResultElem[0].itemsPerPage = itemsPerPage;
    $("div.tab-content div.section-container").eq(3).removeClass("disabled").find("div.section-header span.item-count").hide();
    if (pageNum == 1) {
        $("div.tab-content div.section-container").eq(3).children("div.section-content").html("").append(hotelResultElem);
    }
    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(currentSearchText) + "&type=hotel&pageSize=" + itemsPerPage + "&pageNumber=" + pageNum + "&callback=?", function(data) {
        var hotelHTML = "";
        var hotelCounter = 0;
        if (data.hotel != null) {
            $.each(data.hotel, function(ihotel, hotel) {
                if (hotelCounter < itemsPerPage) {
                    hotelHTML += getHotelHTML(hotelCounter, hotel, "", data.catalogue, hotel.priceexample);
                }
                hotelCounter++;
            });
        }

        humanyEventTracker.SetHotelResult(data.numberOfHits);

        $("div.tab-content div.section-container").eq(3).setNumberOfHitsCssClass(data.numberOfHits).find("div.section-header span.item-count").show().children("span").html(String.format(WebGuideStrings.textNumberOfHits, getFirstPos(pageNum), getLastPos(pageNum, data.numberOfHits), data.numberOfHits));
        $("ul.tabs-large li").eq(4).setNumberOfHitsCssClass(data.numberOfHits).find("span b").text("(" + data.numberOfHits + ")");
        $("div.right-column ul.tab-links li").eq(4).setNumberOfHitsCssClass(data.numberOfHits).find("b").text("(" + data.numberOfHits + ")");
        hotelResultElem[0].numberOfHits = data.numberOfHits;
        hotelResultElem.append(hotelHTML);
        if (hotelResultElem.children("div.entry-item").length > 0) {
            hotelResultElem.removeClass("searching");
            bindEntryItemEvents(hotelResultElem.children("div.entry-item")); // remove
            if (pageNum == 1) {
                $("div.tab-content div.section-container.hotels").removePaging().addPaging(data.numberOfHits, "hotels");
            }
        } else { $("div.tab-content div.section-container.hotels").removePaging(); hotelResultElem.removeClass("searching").addClass("empty").html(WebGuideStrings.searchNoResult); }
        if (($("div.tab-content div.section-container.disabled").length == 4) && ($("div.tab-content div.section-container.number-of-hits-0").length == 1)) { $("div.tab-content div.all-empty").show(); humanyEventTracker.SendEvent(pageNum); }
        else if ($("div.tab-content div.section-container .searching").length == 0) { humanyEventTracker.SendEvent(pageNum); }
        $("#humanySearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });
}

getPagedExcursions = function(excursionContainer, pageNum) {
    var excursionsResultElem = excursionContainer;
    excursionsResultElem[0].itemsPerPage = itemsPerPage;
    $("div.tab-content div.section-container").eq(4).removeClass("disabled").find("div.section-header span.item-count").hide();
    if (pageNum == 1) {
        $("div.tab-content div.section-container").eq(4).children("div.section-content").html("").append(excursionsResultElem);
    }
    $.getJSON("http://fritidsresor.humany.com/" + WebGuideStrings.countryCode + "/json_flat.asp?entry=" + escape(currentSearchText) + "&type=excursion&pageSize=" + itemsPerPage + "&pageNumber=" + pageNum + "&callback=?", function(data) {
        var excursionHTML = "";
        var excursionCounter = 0;
        if (data.excursion != null) {
            $.each(data.excursion, function(i, excursion) {
                if (excursionCounter < itemsPerPage) {
                    excursionHTML += getExcursionHTML(excursionCounter, excursion);
                }
                excursionCounter++;
            });
        }

        humanyEventTracker.SetExcursionResult(data.numberOfHits);
        
        $("div.tab-content div.section-container").eq(4).setNumberOfHitsCssClass(data.numberOfHits).find("div.section-header span.item-count").show().children("span").html(String.format(WebGuideStrings.textNumberOfHits, getFirstPos(pageNum), getLastPos(pageNum, data.numberOfHits), data.numberOfHits));
        $("ul.tabs-large li").eq(5).setNumberOfHitsCssClass(data.numberOfHits).find("span b").text("(" + data.numberOfHits + ")");
        $("div.right-column ul.tab-links li").eq(5).setNumberOfHitsCssClass(data.numberOfHits).find("b").text("(" + data.numberOfHits + ")");
        excursionsResultElem[0].numberOfHits = data.numberOfHits;
        excursionsResultElem.append(excursionHTML);
        if (excursionsResultElem.children("div.entry-item").length > 0) {
            excursionsResultElem.removeClass("searching");
            bindEntryItemEvents(excursionsResultElem.children("div.entry-item"));
            if (pageNum == 1) {
                $("div.tab-content div.section-container.excursions").removePaging().addPaging(data.numberOfHits, "excursions");
            }
        } else { $("div.tab-content div.section-container.excursions").removePaging(); excursionsResultElem.removeClass("searching").addClass("empty").html(WebGuideStrings.searchNoResult); }
        if (($("div.tab-content div.section-container.disabled").length == 4) && ($("div.tab-content div.section-container.number-of-hits-0").length == 1)) { $("div.tab-content div.all-empty").show(); humanyEventTracker.SendEvent(pageNum); }
        else if ($("div.tab-content div.section-container .searching").length == 0) { humanyEventTracker.SendEvent(pageNum); }
        $("#humanySearchInput").removeClass("searching");
        initCheckForLoadingContainers();
    });
}

getFirstPos = function(pageNum) {
    return (((pageNum - 1) * itemsPerPage) + 1).toString();
}

getLastPos = function(pageNum, numberOfHits) {
    var lastPos = (pageNum * itemsPerPage);
    return ((lastPos > numberOfHits) ? numberOfHits : lastPos);
}

//overlibmws.js
/* Do not remove or change this notice.
overlibmws.js core module - Copyright Foteos Macrides 2002-2007. All rights reserved.
Initial: August 18, 2002 - Last Revised: March 30, 2007
This module is subject to the same terms of usage as for Erik Bosrup's overLIB,
though only a minority of the code and API now correspond with Erik's version.
See the overlibmws Change History and Command Reference via:
http://www.macridesweb.com/oltest/
Published under an open source license: http://www.macridesweb.com/oltest/license.html
Give credit on sites that use overlibmws and submit changes so others can use them as well.
You can get Erik's version via: http://www.bosrup.com/web/overlib/*/
// PRE-INIT -- Ignore these lines, configuration is below.
var OLloaded = 0, pmCnt = 1, pMtr = new Array(), OLcmdLine = new Array(), OLrunTime = new Array(), OLv, OLudf,
OLpct = new Array("83%", "67%", "83%", "100%", "117%", "150%", "200%", "267%"), OLrefXY, OLbubblePI = 0,
OLcrossframePI = 0, OLdebugPI = 0, OLdraggablePI = 0, OLexclusivePI = 0, OLfilterPI = 0, OLfunctionPI = 0,
OLhidePI = 0, OLiframePI = 0, OLmodalPI = 0, OLovertwoPI = 0, OLscrollPI = 0, OLshadowPI = 0, OLprintPI = 0;
if (typeof OLgateOK == 'undefined') var OLgateOK = 1;
var OLp1or2c = 'inarray,caparray,caption,closetext,right,left,center,autostatuscap,padx,pady,'
+ 'below,above,vcenter,donothing', OLp1or2co = 'nofollow,background,offsetx,offsety,fgcolor,'
+ 'bgcolor,cgcolor,textcolor,capcolor,width,wrap,wrapmax,height,border,base,status,autostatus,'
+ 'snapx,snapy,fixx,fixy,relx,rely,midx,midy,ref,refc,refp,refx,refy,fgbackground,bgbackground,'
+ 'cgbackground,fullhtml,capicon,textfont,captionfont,textsize,captionsize,timeout,delay,hauto,'
+ 'vauto,nojustx,nojusty,fgclass,bgclass,cgclass,capbelow,textpadding,textfontclass,'
+ 'captionpadding,captionfontclass,sticky,noclose,mouseoff,offdelay,closecolor,closefont,'
+ 'closesize,closeclick,closetitle,closefontclass,decode', OLp1or2o = 'text,cap,close,hpos,vpos,'
+ 'padxl,padxr,padyt,padyb', OLp1co = 'label', OLp1or2 = OLp1or2co + ',' + OLp1or2o, OLp1 = OLp1co + ',' + 'frame';
OLregCmds(OLp1or2c + ',' + OLp1or2co + ',' + OLp1co);
function OLud(v) { return eval('typeof ol_' + v + '=="undefined"') ? 1 : 0; }
if (OLud('fgcolor')) var ol_fgcolor = "#ccccff";
if (OLud('bgcolor')) var ol_bgcolor = "#333399";
if (OLud('cgcolor')) var ol_cgcolor = "#333399";
if (OLud('textcolor')) var ol_textcolor = "#000000";
if (OLud('capcolor')) var ol_capcolor = "#ffffff";
if (OLud('closecolor')) var ol_closecolor = "#eeeeff";
if (OLud('textfont')) var ol_textfont = "Verdana,Arial,Helvetica";
if (OLud('captionfont')) var ol_captionfont = "Verdana,Arial,Helvetica";
if (OLud('closefont')) var ol_closefont = "Verdana,Arial,Helvetica";
if (OLud('textsize')) var ol_textsize = 1;
if (OLud('captionsize')) var ol_captionsize = 1;
if (OLud('closesize')) var ol_closesize = 1;
if (OLud('fgclass')) var ol_fgclass = "";
if (OLud('bgclass')) var ol_bgclass = "";
if (OLud('cgclass')) var ol_cgclass = "";
if (OLud('textpadding')) var ol_textpadding = 2;
if (OLud('textfontclass')) var ol_textfontclass = "";
if (OLud('captionpadding')) var ol_captionpadding = 2;
if (OLud('captionfontclass')) var ol_captionfontclass = "";
if (OLud('closefontclass')) var ol_closefontclass = "";
if (OLud('close')) var ol_close = "Close";
if (OLud('closeclick')) var ol_closeclick = 0;
if (OLud('closetitle')) var ol_closetitle = "Click to Close";
if (OLud('text')) var ol_text = "Default Text";
if (OLud('cap')) var ol_cap = "";
if (OLud('capbelow')) var ol_capbelow = 0;
if (OLud('background')) var ol_background = "";
if (OLud('width')) var ol_width = 200;
if (OLud('wrap')) var ol_wrap = 0;
if (OLud('wrapmax')) var ol_wrapmax = 0;
if (OLud('height')) var ol_height = -1;
if (OLud('border')) var ol_border = 1;
if (OLud('base')) var ol_base = 0;
if (OLud('offsetx')) var ol_offsetx = 10;
if (OLud('offsety')) var ol_offsety = 10;
if (OLud('sticky')) var ol_sticky = 0;
if (OLud('nofollow')) var ol_nofollow = 0;
if (OLud('noclose')) var ol_noclose = 0;
if (OLud('mouseoff')) var ol_mouseoff = 0;
if (OLud('offdelay')) var ol_offdelay = 300;
if (OLud('hpos')) var ol_hpos = RIGHT;
if (OLud('vpos')) var ol_vpos = BELOW;
if (OLud('status')) var ol_status = "";
if (OLud('autostatus')) var ol_autostatus = 0;
if (OLud('snapx')) var ol_snapx = 0;
if (OLud('snapy')) var ol_snapy = 0;
if (OLud('fixx')) var ol_fixx = -1;
if (OLud('fixy')) var ol_fixy = -1;
if (OLud('relx')) var ol_relx = null;
if (OLud('rely')) var ol_rely = null;
if (OLud('midx')) var ol_midx = null;
if (OLud('midy')) var ol_midy = null;
if (OLud('ref')) var ol_ref = "";
if (OLud('refc')) var ol_refc = 'UL';
if (OLud('refp')) var ol_refp = 'UL';
if (OLud('refx')) var ol_refx = 0;
if (OLud('refy')) var ol_refy = 0;
if (OLud('fgbackground')) var ol_fgbackground = "";
if (OLud('bgbackground')) var ol_bgbackground = "";
if (OLud('cgbackground')) var ol_cgbackground = "";
if (OLud('padxl')) var ol_padxl = 1;
if (OLud('padxr')) var ol_padxr = 1;
if (OLud('padyt')) var ol_padyt = 1;
if (OLud('padyb')) var ol_padyb = 1;
if (OLud('fullhtml')) var ol_fullhtml = 0;
if (OLud('capicon')) var ol_capicon = "";
if (OLud('frame')) var ol_frame = self;
if (OLud('timeout')) var ol_timeout = 0;
if (OLud('delay')) var ol_delay = 0;
if (OLud('hauto')) var ol_hauto = 0;
if (OLud('vauto')) var ol_vauto = 0;
if (OLud('nojustx')) var ol_nojustx = 0;
if (OLud('nojusty')) var ol_nojusty = 0;
if (OLud('label')) var ol_label = "";
if (OLud('decode')) var ol_decode = 0;
if (OLud('texts')) var ol_texts = new Array("Text 0", "Text 1");
if (OLud('caps')) var ol_caps = new Array("Caption 0", "Caption 1");
var o3_text = "", o3_cap = "", o3_sticky = 0, o3_nofollow = 0, o3_background = "", o3_noclose = 0, o3_mouseoff = 0,
o3_offdelay = 300, o3_hpos = RIGHT, o3_offsetx = 10, o3_offsety = 10, o3_fgcolor = "", o3_bgcolor = "",
o3_cgcolor = "", o3_textcolor = "", o3_capcolor = "", o3_closecolor = "", o3_width = 200, o3_wrap = 0,
o3_wrapmax = 0, o3_height = -1, o3_border = 1, o3_base = 0, o3_status = "", o3_autostatus = 0, o3_snapx = 0,
o3_snapy = 0, o3_fixx = -1, o3_fixy = -1, o3_relx = null, o3_rely = null, o3_midx = null, o3_midy = null, o3_ref = "",
o3_refc = 'UL', o3_refp = 'UL', o3_refx = 0, o3_refy = 0, o3_fgbackground = "", o3_bgbackground = "",
o3_cgbackground = "", o3_padxl = 0, o3_padxr = 0, o3_padyt = 0, o3_padyb = 0, o3_fullhtml = 0, o3_vpos = BELOW,
o3_capicon = "", o3_textfont = "Verdana,Arial,Helvetica", o3_captionfont = "", o3_closefont = "",
o3_textsize = 1, o3_captionsize = 1, o3_closesize = 1, o3_frame = self, o3_timeout = 0, o3_delay = 0, o3_hauto = 0,
o3_vauto = 0, o3_nojustx = 0, o3_nojusty = 0, o3_close = "", o3_closeclick = 0, o3_closetitle = "", o3_fgclass = "",
o3_bgclass = "", o3_cgclass = "", o3_textpadding = 2, o3_textfontclass = "", o3_captionpadding = 2,
o3_captionfontclass = "", o3_closefontclass = "", o3_capbelow = 0, o3_label = "", o3_decode = 0,
CSSOFF = DONOTHING, CSSCLASS = DONOTHING, OLdelayid = 0, OLtimerid = 0, OLshowid = 0, OLndt = 0, over = null,
OLfnRef = "", OLhover = 0, OLx = 0, OLy = 0, OLshowingsticky = 0, OLallowmove = 0, OLcC = null,
OLua = navigator.userAgent.toLowerCase(),
OLns4 = (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) == 4) ? 1 : 0,
OLns6 = (document.getElementById) ? 1 : 0,
OLie4 = (document.all) ? 1 : 0,
OLgek = (OLv = OLua.match(/gecko\/(\d{8})/i)) ? parseInt(OLv[1]) : 0,
OLmac = (OLua.indexOf('mac') >= 0) ? 1 : 0,
OLsaf = (OLua.indexOf('safari') >= 0) ? 1 : 0,
OLkon = (OLua.indexOf('konqueror') >= 0) ? 1 : 0,
OLkht = (OLsaf || OLkon) ? 1 : 0,
OLopr = (OLua.indexOf('opera') >= 0) ? 1 : 0,
OLop7 = (OLopr && document.createTextNode) ? 1 : 0;
if (OLopr) { OLns4 = OLns6 = 0; if (!OLop7) OLie4 = 0; }
var OLieM = ((OLie4 && OLmac) && !(OLkht || OLopr)) ? 1 : 0,
OLie5 = 0, OLie55 = 0; OLie7 = 0; if (OLie4 && !OLop7) {
    if ((OLv = OLua.match(/msie (\d\.\d+)\.*/i)) && (OLv = parseFloat(OLv[1])) >= 5.0) {
        OLie5 = 1; OLns6 = 0; if (OLv >= 5.5) OLie55 = 1; if (OLv >= 7.0) OLie7 = 1;
    } if (OLns6) OLie4 = 0;
}
if (OLns4) window.onresize = function() { location.reload(); }
var OLchkMh = 1, OLdw;
if (OLns4 || OLie4 || OLns6) OLmh(); else { overlib = nd = cClick = OLpageDefaults = no_overlib; }
function overlib() {
    if (!(OLloaded && OLgateOK)) return; if ((OLexclusivePI) && OLisExclusive(arguments)) return true;
    if (OLchkMh) OLmh(); if (OLndt && !OLtimerid) OLndt = 0; if (over) cClick(); OLload(OLp1or2); OLload(OLp1);
    OLfnRef = ""; OLhover = 0; OLsetRunTimeVar(); OLparseTokens('o3_', arguments);
    if (!(over = OLmkLyr())) return false; if (o3_decode) OLdecode(); if (OLprintPI) OLchkPrint();
    if (OLbubblePI) OLchkForBubbleEffect(); if (OLdebugPI) OLsetDebugCanShow();
    if (OLshadowPI) OLinitShadow(); if (OLiframePI) OLinitIfs(); if (OLfilterPI) OLinitFilterLyr();
    if (OLexclusivePI && o3_exclusive && o3_exclusivestatus != "") o3_status = o3_exclusivestatus;
    else if (o3_autostatus == 2 && o3_cap != "") o3_status = o3_cap;
    else if (o3_autostatus == 1 && o3_text != "") o3_status = o3_text; if (!o3_delay) {
        return OLmain();
    } else {
        OLdelayid = setTimeout("OLmain()", o3_delay); if (o3_status != "") {
            self.status = o3_status;
            return true;
        } else if (!(OLop7 && event && event.type == 'mouseover')) return false;
    } 
}
function nd(time) {
    if (OLloaded && OLgateOK) {
        if (!((OLexclusivePI) && OLisExclusive())) {
            if (time && over && !o3_delay) {
                if (OLtimerid > 0) clearTimeout(OLtimerid); OLtimerid = (OLhover && o3_frame == self && !OLcursorOff()) ? 0 :
setTimeout("cClick()", (o3_timeout = OLndt = time));
            } else {
                if (!OLshowingsticky) {
                    OLallowmove = 0;
                    if (over) OLhideObject(over);
                } 
            } 
        } 
    } return false;
}
function cClick() {
    if (OLloaded && OLgateOK) {
        OLhover = 0; if (over) {
            if (OLovertwoPI && over == over2) cClick2();
            OLhideObject(over); OLshowingsticky = 0;
        } if (OLmodalPI) OLclearModal();
    } return false;
}
function OLpageDefaults() {
    OLparseTokens('ol_', arguments);
}
function OLgetRef(l, d) { var r = OLgetRefById(l, d); return (r) ? r : OLgetRefByName(l, d); }
function no_overlib() { return false; }
function OLmain() {
    o3_delay = 0;
    if (o3_frame == self) { if (o3_noclose) OLoptMOUSEOFF(0); else if (o3_mouseoff) OLoptMOUSEOFF(1); }
    if (o3_sticky) OLshowingsticky = 1; OLdoLyr(); OLallowmove = 0; if (o3_timeout > 0) {
        if (OLtimerid > 0) clearTimeout(OLtimerid); OLtimerid = setTimeout("cClick()", o3_timeout);
    }
    if (o3_ref) { OLrefXY = OLgetRefXY(o3_ref); if (OLrefXY[0] == null) { o3_ref = ""; o3_midx = 0; o3_midy = 0; } }
    OLdisp(o3_status); if (OLdraggablePI) OLcheckDrag();
    if (o3_status != "") return true; else if (!(OLop7 && event && event.type == 'mouseover')) return false;
}
function OLload(c) { var i, m = c.split(','); for (i = 0; i < m.length; i++) eval('o3_' + m[i] + '=ol_' + m[i]); }
function OLdoLGF() {
    return (o3_background != '' || o3_fullhtml) ? OLcontentBackground(o3_text, o3_background, o3_fullhtml) :
(o3_cap == "") ? OLcontentSimple(o3_text) :
(o3_sticky) ? OLcontentCaption(o3_text, o3_cap, o3_close) : OLcontentCaption(o3_text, o3_cap, '');
}
function OLmkLyr(id, f, z) {
    id = (id || 'overDiv'); f = (f || o3_frame); z = (z || 1000); var fd = f.document, d = OLgetRefById(id, fd);
    if (!d) {
        if (OLns4) d = fd.layers[id] = new Layer(1024, f); else if (OLie4 && !document.getElementById) {
            fd.body.insertAdjacentHTML('BeforeEnd', '<div id="' + id + '"></div>'); d = fd.all[id];
        } else { d = fd.createElement('div'); if (d) { d.id = id; fd.body.appendChild(d); } } if (!d) return null;
        if (OLns4) d.zIndex = z; else { var o = d.style; o.position = 'absolute'; o.visibility = 'hidden'; o.zIndex = z; } 
    }
    return d;
}
function OLdoLyr() {
    if (o3_sticky && OLtimerid > 0) { clearTimeout(OLtimerid); OLtimerid = 0; }
    if (o3_background == '' && !o3_fullhtml) {
        if (o3_fgbackground != '') o3_fgbackground = ' background="' + o3_fgbackground + '"';
        if (o3_bgbackground != '') o3_bgbackground = ' background="' + o3_bgbackground + '"';
        if (o3_cgbackground != '') o3_cgbackground = ' background="' + o3_cgbackground + '"';
        if (o3_fgcolor != '') o3_fgcolor = ' bgcolor="' + o3_fgcolor + '"';
        if (o3_bgcolor != '') o3_bgcolor = ' bgcolor="' + o3_bgcolor + '"';
        if (o3_cgcolor != '') o3_cgcolor = ' bgcolor="' + o3_cgcolor + '"';
        if (o3_height > 0) o3_height = ' height="' + o3_height + '"'; else o3_height = '';
    }
    if (!OLns4) OLrepositionTo(over, (OLns6 ? 20 : 0), 0); var lyrHtml = OLdoLGF();
    if (o3_wrap && !o3_fullhtml) {
        OLlayerWrite(lyrHtml);
        o3_width = (OLns4 ? over.clip.width : over.offsetWidth); if (OLie4) {
            var w = OLfd().clientWidth;
            if (o3_width >= w) {
                if (OLop7) {
                    if (OLovertwoPI && over == over2) {
                        var z = over2.style.zIndex;
                        o3_frame.document.body.removeChild(over); over2 = OLmkLyr('overDiv2', o3_frame, z); over = over2;
                    } else { o3_frame.document.body.removeChild(over); over = OLmkLyr(); } 
                } o3_width = w - 20;
            } 
        }
        if (o3_wrapmax < 1 && o3_frame.innerWidth) o3_wrapmax = o3_frame.innerWidth - 40;
        if (o3_wrapmax > 0 && o3_width > o3_wrapmax) o3_width = o3_wrapmax; o3_wrap = 0; lyrHtml = OLdoLGF();
    }
    OLlayerWrite(lyrHtml); o3_width = (OLns4 ? over.clip.width : over.offsetWidth);
    if (OLbubblePI) OLgenerateBubble(lyrHtml);
}
function OLcontentSimple(txt) {
    var t = OLbgLGF() + OLfgLGF(txt) + OLbaseLGF(); OLsetBackground(''); return t;
}
function OLcontentCaption(txt, title, close) {
    var closing = (OLprintPI ? OLprintCapLGF() : ''), closeevent = 'onmouseover', caption, t,
cC = 'javascript:return ' + OLfnRef + (OLovertwoPI && over == over2 ? 'cClick2();' : 'cClick();');
    if (o3_closeclick) closeevent = (o3_closetitle ? 'title="' + o3_closetitle + '" ' : '') + 'onclick';
    if (o3_capicon != '') o3_capicon = '<img src="' + o3_capicon + '" /> ';
    if (close) {
        closing += '<td align="right"><a href="' + cC + '" ' + closeevent + '="' + cC + '"'
+ (o3_closefontclass ? ' class="' + o3_closefontclass + '">' : (OLns4 ? '><' : '')
+ OLlgfUtil(0, 1, '', 'a', o3_closecolor, o3_closefont, o3_closesize)) + close +
(o3_closefontclass ? '' : (OLns4 ? OLlgfUtil(1, 1, '', 'a') : '')) + '</a></td>';
    }
    caption = '<table id="overCap' + (OLovertwoPI && over == over2 ? '2' : '') + '"' + OLwd(0)
+ ' border="0" cellpadding="' + o3_captionpadding + '" cellspacing="0"' + (o3_cgclass ? ' class="'
+ o3_cgclass + '"' : o3_cgcolor + o3_cgbackground) + '><tr><td' + OLwd(0) + (o3_cgclass ? ' class="'
+ o3_cgclass + '">' : '>') + (o3_captionfontclass ? '<div class="' + o3_captionfontclass
+ '">' : OLlgfUtil(0, 1, '', 'div', o3_capcolor, o3_captionfont, o3_captionsize)) + o3_capicon + title
+ OLlgfUtil(1, 1, '', 'div') + '</td>' + closing + '</tr></table>';
    t = OLbgLGF() + (o3_capbelow ? OLfgLGF(txt) + caption : caption + OLfgLGF(txt)) + OLbaseLGF();
    OLsetBackground(''); return t;
}
function OLcontentBackground(txt, image, hasfullhtml) {
    var t; if (hasfullhtml) { t = txt; } else {
        t = '<table' + OLwd(1) + ' border="0" cellpadding="0" '
+ 'cellspacing="0" ' + 'height="' + o3_height + '"><tr><td colspan="3" height="' + o3_padyt
+ '"></td></tr><tr><td width="' + o3_padxl + '"></td><td valign="top"' + OLwd(2) + '>'
+ OLlgfUtil(0, 0, o3_textfontclass, 'div', o3_textcolor, o3_textfont, o3_textsize) + txt +
OLlgfUtil(1, 0, '', 'div') + '</td><td width="' + o3_padxr + '"></td></tr><tr><td colspan="3" height="'
+ o3_padyb + '"></td></tr></table>';
    } OLsetBackground(image); return t;
}
function OLbgLGF() {
    return '<table' + OLwd(1) + o3_height + ' border="0" cellpadding="' + o3_border + '" cellspacing="0"'
+ (o3_bgclass ? ' class="' + o3_bgclass + '"' : o3_bgcolor + o3_bgbackground) + '><tr><td>';
}
function OLfgLGF(t) {
    return '<table' + OLwd(0) + o3_height + ' border="0" cellpadding="' + o3_textpadding
+ '" cellspacing="0"' + (o3_fgclass ? ' class="' + o3_fgclass + '"' : o3_fgcolor + o3_fgbackground)
+ '><tr><td valign="top"' + (o3_fgclass ? ' class="' + o3_fgclass + '"' : '') + '>'
+ OLlgfUtil(0, 0, o3_textfontclass, 'div', o3_textcolor, o3_textfont, o3_textsize) + t
+ (OLprintPI ? OLprintFgLGF() : '') + OLlgfUtil(1, 0, '', 'div') + '</td></tr></table>';
}
function OLlgfUtil(end, stg, tfc, ele, col, fac, siz) {
    if (end) return ('</' + (OLns4 ? 'font' + (stg ? '></strong' : '') : ele) + '>');
    else return (tfc ? '<div class="' + tfc + '">' : ((ele == 'a' ? '' : '<') + (OLns4 ? (stg ? 'strong><' : '')
+ 'font color="' + col + '" face="' + OLquoteMultiNameFonts(fac) + '" size="' + siz : (ele == 'a' ? '' : ele)
+ ' style="color:' + col + (stg ? ';font-weight:bold' : '') + ';font-family:' + OLquoteMultiNameFonts(fac)
+ ';font-size:' + siz + ';' + (ele == 'span' ? 'text-decoration:underline;' : '')) + '">'));
}
function OLquoteMultiNameFonts(f) {
    var i, v, pM = f.split(',');
    for (i = 0; i < pM.length; i++) {
        v = pM[i]; v = v.replace(/^\s+/, '').replace(/\s+$/, '');
        if (/\s/.test(v) && !/['"]/.test(v)) { v = "\'" + v + "\'"; pM[i] = v; } 
    } return pM.join();
}
function OLbaseLGF() {
    return ((o3_base > 0 && !o3_wrap) ? ('<table width="100%" border="0" cellpadding="0" cellspacing="0"'
+ (o3_bgclass ? ' class="' + o3_bgclass + '"' : '') + '><tr><td height="' + o3_base
+ '"></td></tr></table>') : '') + '</td></tr></table>';
}
function OLwd(a) {
    return (o3_wrap ? '' : ' width="' + (!a ? '100%' : (a == 1 ? o3_width : (o3_width - o3_padxl - o3_padxr))) + '"');
}
function OLsetBackground(i) {
    if (i == '') {
        if (OLns4) over.background.src = null; else {
            if (OLns6) over.style.width = '';
            over.style.backgroundImage = 'none';
        } 
    } else {
        if (OLns4) over.background.src = i; else {
            if (OLns6) over.style.width = o3_width + 'px'; over.style.backgroundImage = 'url(' + i + ')';
        } 
    } 
}
function OLdisp(s) {
    if (OLmodalPI) OLchkModal(); if (!OLallowmove) {
        if (OLshadowPI) OLdispShadow();
        if (OLiframePI) OLdispIfs(); OLplaceLayer(); if (OLndt) OLshowObject(over);
        else OLshowid = setTimeout("OLshowObject(over)", 1);
        OLallowmove = (o3_sticky || o3_nofollow) ? 0 : 1;
    } OLndt = 0; if (s != "") self.status = s;
}
function OLplaceLayer() {
    var snp, X, Y, pgLeft, pgTop, pWd = o3_width, pHt, iWd = 100, iHt = 100, SB = 0, LM = 0, CX = 0, TM = 0, BM = 0, CY = 0,
o = OLfd(), nsb = (OLgek >= 20010505 && !o3_frame.scrollbars.visible) ? 1 : 0;
    if (!OLkht && o && o.clientWidth) iWd = o.clientWidth;
    else if (o3_frame.innerWidth) {
        SB = Math.ceil(1.4 * (o3_frame.outerWidth - o3_frame.innerWidth));
        if (SB > 20) SB = 20; iWd = o3_frame.innerWidth;
    }
    pgLeft = (OLie4) ? o.scrollLeft : o3_frame.pageXOffset;
    if (OLie55 && OLfilterPI && o3_filter && o3_filtershadow) SB = CX = 5; else
        if ((OLshadowPI) && bkdrop && o3_shadow && o3_shadowx) {
        SB += ((o3_shadowx > 0) ? o3_shadowx : 0);
        LM = ((o3_shadowx < 0) ? Math.abs(o3_shadowx) : 0); CX = Math.abs(o3_shadowx);
    }
    if (o3_ref != "" || o3_fixx > -1 || o3_relx != null || o3_midx != null) {
        if (o3_ref != "") {
            X = OLrefXY[0]; if (OLie55 && OLfilterPI && o3_filter && o3_filtershadow) {
                if (o3_refp == 'UR' || o3_refp == 'LR') X -= 5;
            }
            else if ((OLshadowPI) && bkdrop && o3_shadow && o3_shadowx) {
                if (o3_shadowx < 0 && (o3_refp == 'UL' || o3_refp == 'LL')) X -= o3_shadowx; else
                    if (o3_shadowx > 0 && (o3_refp == 'UR' || o3_refp == 'LR')) X -= o3_shadowx;
            }
        } else {
            if (o3_midx != null) {
                X = parseInt(pgLeft + ((iWd - pWd - SB - LM) / 2) + o3_midx);
            } else {
                if (o3_relx != null) {
                    if (o3_relx >= 0) X = pgLeft + o3_relx + LM; else X = pgLeft + o3_relx + iWd - pWd - SB;
                } else { X = o3_fixx + LM; } 
            } 
        }
    } else {
        if (o3_hauto) {
            if (o3_hpos == LEFT && OLx - pgLeft < iWd / 2 && OLx - pWd - o3_offsetx < pgLeft + LM) o3_hpos = RIGHT; else
                if (o3_hpos == RIGHT && OLx - pgLeft > iWd / 2 && OLx + pWd + o3_offsetx > pgLeft + iWd - SB) o3_hpos = LEFT;
        }
        X = (o3_hpos == CENTER) ? parseInt(OLx - ((pWd + CX) / 2) + o3_offsetx) :
(o3_hpos == LEFT) ? OLx - o3_offsetx - pWd : OLx + o3_offsetx;
        if (o3_snapx > 1) {
            snp = X % o3_snapx;
            if (o3_hpos == LEFT) { X = X - (o3_snapx + snp); } else { X = X + (o3_snapx - snp); } 
        } 
    }
    if (!o3_nojustx && X + pWd > pgLeft + iWd - SB)
        X = iWd + pgLeft - pWd - SB; if (!o3_nojustx && X - LM < pgLeft) X = pgLeft + LM;
    pgTop = OLie4 ? o.scrollTop : o3_frame.pageYOffset;
    if (!OLkht && !nsb && o && o.clientHeight) iHt = o.clientHeight;
    else if (o3_frame.innerHeight) iHt = o3_frame.innerHeight;
    if (OLbubblePI && o3_bubble) pHt = OLbubbleHt; else pHt = OLns4 ? over.clip.height : over.offsetHeight;
    if ((OLshadowPI) && bkdrop && o3_shadow && o3_shadowy) {
        TM = (o3_shadowy < 0) ? Math.abs(o3_shadowy) : 0;
        if (OLie55 && OLfilterPI && o3_filter && o3_filtershadow) BM = CY = 5; else
            BM = (o3_shadowy > 0) ? o3_shadowy : 0; CY = Math.abs(o3_shadowy);
    }
    if (o3_ref != "" || o3_fixy > -1 || o3_rely != null || o3_midy != null) {
        if (o3_ref != "") {
            Y = OLrefXY[1]; if (OLie55 && OLfilterPI && o3_filter && o3_filtershadow) {
                if (o3_refp == 'LL' || o3_refp == 'LR') Y -= 5;
            } else if ((OLshadowPI) && bkdrop && o3_shadow && o3_shadowy) {
                if (o3_shadowy < 0 && (o3_refp == 'UL' || o3_refp == 'UR')) Y -= o3_shadowy; else
                    if (o3_shadowy > 0 && (o3_refp == 'LL' || o3_refp == 'LR')) Y -= o3_shadowy;
            }
        } else {
            if (o3_midy != null) {
                Y = parseInt(pgTop + ((iHt - pHt - CY) / 2) + o3_midy);
            } else {
                if (o3_rely != null) {
                    if (o3_rely >= 0) Y = pgTop + o3_rely + TM; else Y = pgTop + o3_rely + iHt - pHt - BM;
                } else {
                    Y = o3_fixy + TM;
                } 
            } 
        }
    } else {
        if (o3_vauto) {
            if (o3_vpos == ABOVE && OLy - pgTop < iHt / 2 && OLy - pHt - o3_offsety < pgTop) o3_vpos = BELOW; else
                if (o3_vpos == BELOW && OLy - pgTop > iHt / 2 && OLy + pHt + o3_offsety + ((OLns4 || OLkht) ? 17 : 0) > pgTop + iHt - BM)
                o3_vpos = ABOVE;
        } Y = (o3_vpos == VCENTER) ? parseInt(OLy - ((pHt + CY) / 2) + o3_offsety) :
(o3_vpos == ABOVE) ? OLy - (pHt + o3_offsety + BM) : OLy + o3_offsety + TM;
        if (o3_snapy > 1) {
            snp = Y % o3_snapy;
            if (pHt > 0 && o3_vpos == ABOVE) { Y = Y - (o3_snapy + snp); } else { Y = Y + (o3_snapy - snp); } 
        } 
    }
    if (!o3_nojusty && Y + pHt + BM > pgTop + iHt) Y = pgTop + iHt - pHt - BM; if (!o3_nojusty && Y - TM < pgTop) Y = pgTop + TM;
    OLrepositionTo(over, X, Y);
    if (OLshadowPI) OLrepositionShadow(X, Y); if (OLiframePI) OLrepositionIfs(X, Y);
    if (OLns6 && o3_frame.innerHeight) { iHt = o3_frame.innerHeight; OLrepositionTo(over, X, Y); }
    if (OLscrollPI) OLchkScroll(X - pgLeft, Y - pgTop);
}
function OLfd(f) {
    var fd = ((f) ? f : o3_frame).document, fdc = fd.compatMode, fdd = fd.documentElement;
    return (!OLop7 && fdc && fdc != 'BackCompat' && fdd && fdd.clientWidth) ? fd.documentElement : fd.body;
}
function OLgetRefXY(r, d) {
    var o = OLgetRef(r, d), ob = o, rXY = [o3_refx, o3_refy], of; if (!o) return [null, null];
    if (OLns4) {
        if (typeof o.length != 'undefined' && o.length > 1) {
            ob = o[0];
            rXY[0] += o[0].x + o[1].pageX; rXY[1] += o[0].y + o[1].pageY;
        } else {
            if ((o.toString().indexOf('Image') != -1) || (o.toString().indexOf('Anchor') != -1)) {
                rXY[0] += o.x; rXY[1] += o.y;
            } else { rXY[0] += o.pageX; rXY[1] += o.pageY; } 
        }
    } else { rXY[0] += OLpageLoc(o, 'Left'); rXY[1] += OLpageLoc(o, 'Top'); }
    of = OLgetRefOffsets(ob); rXY[0] += of[0]; rXY[1] += of[1]; return rXY;
}
function OLgetRefById(l, d) {
    l = (l || 'overDiv'); d = (d || o3_frame.document); var j, r; if (OLie4 && d.all) return d.all[l];
    if (d.getElementById) return d.getElementById(l); if (d.layers && d.layers.length > 0) {
        if (d.layers[l]) return d.layers[l]; for (j = 0; j < d.layers.length; j++) {
            r = OLgetRefById(l, d.layers[j].document); if (r) return r;
        } 
    } return null;
}
function OLgetRefByName(l, d) {
    d = (d || o3_frame.document); var j, r, v = OLie4 ? d.all.tags('iframe') :
OLns6 ? d.getElementsByTagName('iframe') : null;
    if (typeof d.images != 'undefined' && d.images[l]) return d.images[l];
    if (typeof d.anchors != 'undefined' && d.anchors[l]) return d.anchors[l];
    if (v) for (j = 0; j < v.length; j++) if (v[j].name == l) return v[j];
    if (d.layers && d.layers.length > 0) for (j = 0; j < d.layers.length; j++) {
        r = OLgetRefByName(l, d.layers[j].document);
        if (r && r.length > 0) return r; else if (r) return [r, d.layers[j]];
    } return null;
}
function OLgetRefOffsets(o) {
    var c = o3_refc.toUpperCase(), p = o3_refp.toUpperCase(), W = 0, H = 0, pW = 0, pH = 0, of = [0, 0];
    pW = (OLbubblePI && o3_bubble) ? o3_width : OLns4 ? over.clip.width : over.offsetWidth;
    pH = (OLbubblePI && o3_bubble) ? OLbubbleHt : OLns4 ? over.clip.height : over.offsetHeight;
    if ((!OLop7) && o.toString().indexOf('Image') != -1) {
        W = o.width; H = o.height;
    } else if ((!OLop7) && o.toString().indexOf('Anchor') != -1) { c = o3_refc = 'UL'; } else {
        W = (OLns4) ? o.clip.width : o.offsetWidth; H = (OLns4) ? o.clip.height : o.offsetHeight;
    }
    if ((OLns4 || (OLns6 && OLgek)) && o.border) { W += 2 * parseInt(o.border); H += 2 * parseInt(o.border); }
    if (c == 'UL') {
        of = (p == 'UR') ? [-pW, 0] : (p == 'LL') ? [0, -pH] : (p == 'LR') ? [-pW, -pH] : [0, 0];
    } else if (c == 'UR') {
        of = (p == 'UR') ? [W - pW, 0] : (p == 'LL') ? [W, -pH] : (p == 'LR') ? [W - pW, -pH] : [W, 0];
    } else if (c == 'LL') {
        of = (p == 'UR') ? [-pW, H] : (p == 'LL') ? [0, H - pH] : (p == 'LR') ? [-pW, H - pH] : [0, H];
    } else if (c == 'LR') { of = (p == 'UR') ? [W - pW, H] : (p == 'LL') ? [W, H - pH] : (p == 'LR') ? [W - pW, H - pH] : [W, H]; }
    return of;
}
function OLpageLoc(o, t) {
    var l = 0, s = o; while (o.offsetParent && o.offsetParent.tagName.toLowerCase() != 'html') {
        l += o['offset' + t]; o = o.offsetParent;
    } l += o['offset' + t]; while (s = s.parentNode) {
        if ((s['scroll' + t] > 0) && s.tagName.toLowerCase() == 'div') l -= s['scroll' + t];
    } return l;
}
function OLmouseMove(e) {
    var e = (e || event); OLcC = (OLovertwoPI && over2 && over == over2 ? cClick2 : cClick);
    OLx = (e.pageX || e.clientX + OLfd().scrollLeft); OLy = (e.pageY || e.clientY + OLfd().scrollTop);
    if ((OLallowmove && over) && (o3_frame == self || over == OLgetRefById()
|| (OLovertwoPI && over2 == over && over == OLgetRefById('overDiv2')))) {
        OLplaceLayer(); if (OLhidePI) OLhideUtil(0, 1, 1, 0, 0, 0);
    }
    if (OLhover && over && o3_frame == self && OLcursorOff()) if (o3_offdelay < 1) OLcC(); else
    { if (OLtimerid > 0) clearTimeout(OLtimerid); OLtimerid = setTimeout("OLcC()", o3_offdelay); } 
}
function OLmh() {
    var fN, f, j, k, s, mh = OLmouseMove, w = (OLns4 && window.onmousemove), re = /function[ ]*(\w*)\(/;
    OLdw = document; if (document.onmousemove || w) {
        if (w) OLdw = window; f = OLdw.onmousemove.toString();
        fN = f.match(re); if (!fN || fN[1] == 'anonymous' || fN[1] == 'OLmouseMove') { OLchkMh = 0; return; }
        if (fN[1]) s = fN[1] + '(e)'; else { j = f.indexOf('{'); k = f.lastIndexOf('}') + 1; s = f.substring(j, k); }
        s += ';OLmouseMove(e);'; mh = new Function('e', s);
    }
    OLdw.onmousemove = mh; if (OLns4) OLdw.captureEvents(Event.MOUSEMOVE);
}
function OLparseTokens(pf, ar) {
    var i, v, md = -1, par = (pf != 'ol_'), p = OLpar, q = OLparQuo, t = OLtoggle; OLudf = (par && !ar.length ? 1 : 0);
    for (i = 0; i < ar.length; i++) {
        if (md < 0) {
            if (typeof ar[i] == 'number') { OLudf = (par ? 1 : 0); i--; }
            else { switch (pf) { case 'ol_': ol_text = ar[i]; break; default: o3_text = ar[i]; } } md = 0;
        } else {
            if (ar[i] == INARRAY) { OLudf = 0; eval(pf + 'text=ol_texts[' + ar[++i] + ']'); continue; }
            if (ar[i] == CAPARRAY) { eval(pf + 'cap=ol_caps[' + ar[++i] + ']'); continue; }
            if (ar[i] == CAPTION) { q(ar[++i], pf + 'cap'); continue; }
            if (Math.abs(ar[i]) == STICKY) { t(ar[i], pf + 'sticky'); continue; }
            if (Math.abs(ar[i]) == NOFOLLOW) { t(ar[i], pf + 'nofollow'); continue; }
            if (ar[i] == BACKGROUND) { q(ar[++i], pf + 'background'); continue; }
            if (Math.abs(ar[i]) == NOCLOSE) { t(ar[i], pf + 'noclose'); continue; }
            if (Math.abs(ar[i]) == MOUSEOFF) { t(ar[i], pf + 'mouseoff'); continue; }
            if (ar[i] == OFFDELAY) { p(ar[++i], pf + 'offdelay'); continue; }
            if (ar[i] == RIGHT || ar[i] == LEFT || ar[i] == CENTER) { p(ar[i], pf + 'hpos'); continue; }
            if (ar[i] == OFFSETX) { p(ar[++i], pf + 'offsetx'); continue; }
            if (ar[i] == OFFSETY) { p(ar[++i], pf + 'offsety'); continue; }
            if (ar[i] == FGCOLOR) { q(ar[++i], pf + 'fgcolor'); continue; }
            if (ar[i] == BGCOLOR) { q(ar[++i], pf + 'bgcolor'); continue; }
            if (ar[i] == CGCOLOR) { q(ar[++i], pf + 'cgcolor'); continue; }
            if (ar[i] == TEXTCOLOR) { q(ar[++i], pf + 'textcolor'); continue; }
            if (ar[i] == CAPCOLOR) { q(ar[++i], pf + 'capcolor'); continue; }
            if (ar[i] == CLOSECOLOR) { q(ar[++i], pf + 'closecolor'); continue; }
            if (ar[i] == WIDTH) { p(ar[++i], pf + 'width'); continue; }
            if (Math.abs(ar[i]) == WRAP) { t(ar[i], pf + 'wrap'); continue; }
            if (ar[i] == WRAPMAX) { p(ar[++i], pf + 'wrapmax'); continue; }
            if (ar[i] == HEIGHT) { p(ar[++i], pf + 'height'); continue; }
            if (ar[i] == BORDER) { p(ar[++i], pf + 'border'); continue; }
            if (ar[i] == BASE) { p(ar[++i], pf + 'base'); continue; }
            if (ar[i] == STATUS) { q(ar[++i], pf + 'status'); continue; }
            if (Math.abs(ar[i]) == AUTOSTATUS) {
                v = pf + 'autostatus';
                eval(v + '=(' + ar[i] + '<0)?(' + v + '==2?2:0):(' + v + '==1?0:1)'); continue;
            }
            if (Math.abs(ar[i]) == AUTOSTATUSCAP) {
                v = pf + 'autostatus';
                eval(v + '=(' + ar[i] + '<0)?(' + v + '==1?1:0):(' + v + '==2?0:2)'); continue;
            }
            if (ar[i] == CLOSETEXT) { q(ar[++i], pf + 'close'); continue; }
            if (ar[i] == SNAPX) { p(ar[++i], pf + 'snapx'); continue; }
            if (ar[i] == SNAPY) { p(ar[++i], pf + 'snapy'); continue; }
            if (ar[i] == FIXX) { p(ar[++i], pf + 'fixx'); continue; }
            if (ar[i] == FIXY) { p(ar[++i], pf + 'fixy'); continue; }
            if (ar[i] == RELX) { p(ar[++i], pf + 'relx'); continue; }
            if (ar[i] == RELY) { p(ar[++i], pf + 'rely'); continue; }
            if (ar[i] == MIDX) { p(ar[++i], pf + 'midx'); continue; }
            if (ar[i] == MIDY) { p(ar[++i], pf + 'midy'); continue; }
            if (ar[i] == REF) { q(ar[++i], pf + 'ref'); continue; }
            if (ar[i] == REFC) { q(ar[++i], pf + 'refc'); continue; }
            if (ar[i] == REFP) { q(ar[++i], pf + 'refp'); continue; }
            if (ar[i] == REFX) { p(ar[++i], pf + 'refx'); continue; }
            if (ar[i] == REFY) { p(ar[++i], pf + 'refy'); continue; }
            if (ar[i] == FGBACKGROUND) { q(ar[++i], pf + 'fgbackground'); continue; }
            if (ar[i] == BGBACKGROUND) { q(ar[++i], pf + 'bgbackground'); continue; }
            if (ar[i] == CGBACKGROUND) { q(ar[++i], pf + 'cgbackground'); continue; }
            if (ar[i] == PADX) { p(ar[++i], pf + 'padxl'); p(ar[++i], pf + 'padxr'); continue; }
            if (ar[i] == PADY) { p(ar[++i], pf + 'padyt'); p(ar[++i], pf + 'padyb'); continue; }
            if (Math.abs(ar[i]) == FULLHTML) { t(ar[i], pf + 'fullhtml'); continue; }
            if (ar[i] == BELOW || ar[i] == ABOVE || ar[i] == VCENTER) { p(ar[i], pf + 'vpos'); continue; }
            if (ar[i] == CAPICON) { q(ar[++i], pf + 'capicon'); continue; }
            if (ar[i] == TEXTFONT) { q(ar[++i], pf + 'textfont'); continue; }
            if (ar[i] == CAPTIONFONT) { q(ar[++i], pf + 'captionfont'); continue; }
            if (ar[i] == CLOSEFONT) { q(ar[++i], pf + 'closefont'); continue; }
            if (ar[i] == TEXTSIZE) { q(ar[++i], pf + 'textsize'); continue; }
            if (ar[i] == CAPTIONSIZE) { q(ar[++i], pf + 'captionsize'); continue; }
            if (ar[i] == CLOSESIZE) { q(ar[++i], pf + 'closesize'); continue; }
            if (ar[i] == TIMEOUT) { p(ar[++i], pf + 'timeout'); continue; }
            if (ar[i] == DELAY) { p(ar[++i], pf + 'delay'); continue; }
            if (Math.abs(ar[i]) == HAUTO) { t(ar[i], pf + 'hauto'); continue; }
            if (Math.abs(ar[i]) == VAUTO) { t(ar[i], pf + 'vauto'); continue; }
            if (Math.abs(ar[i]) == NOJUSTX) { t(ar[i], pf + 'nojustx'); continue; }
            if (Math.abs(ar[i]) == NOJUSTY) { t(ar[i], pf + 'nojusty'); continue; }
            if (Math.abs(ar[i]) == CLOSECLICK) { t(ar[i], pf + 'closeclick'); continue; }
            if (ar[i] == CLOSETITLE) { q(ar[++i], pf + 'closetitle'); continue; }
            if (ar[i] == FGCLASS) { q(ar[++i], pf + 'fgclass'); continue; }
            if (ar[i] == BGCLASS) { q(ar[++i], pf + 'bgclass'); continue; }
            if (ar[i] == CGCLASS) { q(ar[++i], pf + 'cgclass'); continue; }
            if (ar[i] == TEXTPADDING) { p(ar[++i], pf + 'textpadding'); continue; }
            if (ar[i] == TEXTFONTCLASS) { q(ar[++i], pf + 'textfontclass'); continue; }
            if (ar[i] == CAPTIONPADDING) { p(ar[++i], pf + 'captionpadding'); continue; }
            if (ar[i] == CAPTIONFONTCLASS) { q(ar[++i], pf + 'captionfontclass'); continue; }
            if (ar[i] == CLOSEFONTCLASS) { q(ar[++i], pf + 'closefontclass'); continue; }
            if (Math.abs(ar[i]) == CAPBELOW) { t(ar[i], pf + 'capbelow'); continue; }
            if (ar[i] == LABEL) { q(ar[++i], pf + 'label'); continue; }
            if (Math.abs(ar[i]) == DECODE) { t(ar[i], pf + 'decode'); continue; }
            if (ar[i] == DONOTHING) { continue; }
            i = OLparseCmdLine(pf, i, ar);
        } 
    }
    if ((OLfunctionPI) && OLudf && o3_function) o3_text = o3_function();
    if (pf == 'o3_') OLfontSize();
}
function OLpar(a, v) { eval(v + '=' + a); }
function OLparQuo(a, v) { eval(v + "='" + OLescSglQt(a) + "'"); }
function OLescSglQt(s) { return s.toString().replace(/\\/g, "\\\\").replace(/'/g, "\\'"); }
function OLtoggle(a, v) { eval(v + '=(' + v + '==0&&' + a + '>=0)?1:0'); }
function OLhasDims(s) { return /[%\-a-z]+$/.test(s); }
function OLfontSize() {
    var i; if (OLhasDims(o3_textsize)) { if (OLns4) o3_textsize = "2"; } else
        if (!OLns4) { i = parseInt(o3_textsize); o3_textsize = (i > 0 && i < 8) ? OLpct[i] : OLpct[0]; }
    if (OLhasDims(o3_captionsize)) { if (OLns4) o3_captionsize = "2"; } else
        if (!OLns4) { i = parseInt(o3_captionsize); o3_captionsize = (i > 0 && i < 8) ? OLpct[i] : OLpct[0]; }
    if (OLhasDims(o3_closesize)) { if (OLns4) o3_closesize = "2"; } else
        if (!OLns4) { i = parseInt(o3_closesize); o3_closesize = (i > 0 && i < 8) ? OLpct[i] : OLpct[0]; }
    if (OLprintPI) OLprintDims();
}
function OLdecode() {
    var re = /%[0-9A-Fa-f]{2,}/, t = o3_text, c = o3_cap, u = unescape, d = !OLns4 && (!OLgek || OLgek >= 20020826)
&& typeof decodeURIComponent ? decodeURIComponent : u; if (typeof (window.TypeError) == 'function') {
        if (re.test(t)) {
            eval(new Array('try{', 'o3_text=d(t);', '}catch(e){', 'o3_text=u(t);',
'}').join('\n'))
        }; if (c && re.test(c)) {
            eval(new Array('try{', 'o3_cap=d(c);', '}catch(e){',
'o3_cap=u(c);', '}').join('\n'))
        } 
    } else { if (re.test(t)) o3_text = u(t); if (c && re.test(c)) o3_cap = u(c); } 
}
function OLlayerWrite(t) {
    t += "\n"; if (OLns4) { over.document.write(t); over.document.close(); }
    else if (typeof over.innerHTML != 'undefined') {
        if (OLieM) over.innerHTML = ''; over.innerHTML = t;
    } else {
        var range = o3_frame.document.createRange(); range.setStartAfter(over);
        var domfrag = range.createContextualFragment(t); while (over.hasChildNodes()) {
            over.removeChild(over.lastChild);
        } over.appendChild(domfrag);
    }
    if (OLprintPI) over.print = o3_print ? t : null;
}
function OLshowObject(o) {
    OLshowid = 0; o = (OLns4) ? o : o.style;
    if (((OLfilterPI) && !OLchkFilter(o)) || !OLfilterPI) o.visibility = "visible";
    if (OLshadowPI) OLshowShadow(); if (OLiframePI) OLshowIfs(); if (OLhidePI) OLhideUtil(1, 1, 0);
}
function OLhideObject(o) {
    if (OLshowid > 0) { clearTimeout(OLshowid); OLshowid = 0; }
    if (OLtimerid > 0) clearTimeout(OLtimerid); if (OLdelayid > 0) clearTimeout(OLdelayid);
    OLtimerid = 0; OLdelayid = 0; self.status = ""; o3_label = ol_label; if (o3_frame != self) o = OLgetRefById();
    if (o) {
        if (o.onmouseover) o.onmouseover = null; if (OLscrollPI && o == over) OLclearScroll();
        if (OLdraggablePI) OLclearDrag(); if (OLfilterPI) OLcleanupFilter(o); if (OLshadowPI) OLhideShadow();
        var os = (OLns4) ? o : o.style; if (((OLfilterPI) && !OLchkFadeOut(os)) || !OLfilterPI) {
            os.visibility = "hidden";
        } if (OLhidePI && o == over) OLhideUtil(0, 0, 1); if (OLiframePI) OLhideIfs(o);
    } 
}
function OLrepositionTo(o, xL, yL) {
    o = (OLns4) ? o : o.style; o.left = (OLns4 ? xL : xL + 'px'); o.top = (OLns4 ? yL : yL + 'px');
}
function OLoptMOUSEOFF(c) {
    if (!c) o3_close = "";
    over.onmouseover = function() { OLhover = 1; if (OLtimerid > 0) { clearTimeout(OLtimerid); OLtimerid = 0; } } 
}
function OLcursorOff() {
    var o = (OLns4 ? over : over.style), pHt = OLns4 ? over.clip.height : over.offsetHeight,
left = parseInt(o.left), top = parseInt(o.top),
right = left + o3_width, bottom = top + ((OLbubblePI && o3_bubble) ? OLbubbleHt : pHt);
    if (OLx < left || OLx > right || OLy < top || OLy > bottom) return true; return false;
}
function OLsetRunTimeVar() {
    if (OLrunTime.length) for (var k = 0; k < OLrunTime.length; k++) OLrunTime[k]();
}
function OLparseCmdLine(pf, i, ar) {
    if (OLcmdLine.length) {
        for (var k = 0; k < OLcmdLine.length; k++) {
            var j = OLcmdLine[k](pf, i, ar); if (j > -1) { i = j; break; } 
        } 
    } return i;
}
function OLregCmds(c) {
    if (typeof c != 'string') return; var pM = c.split(','); pMtr = pMtr.concat(pM);
    for (var i = 0; i < pM.length; i++) eval(pM[i].toUpperCase() + '=' + pmCnt++);
}
function OLregRunTimeFunc(f) {
    if (typeof f == 'object') OLrunTime = OLrunTime.concat(f); else OLrunTime[OLrunTime.length++] = f;
}
function OLregCmdLineFunc(f) {
    if (typeof f == 'object') OLcmdLine = OLcmdLine.concat(f); else OLcmdLine[OLcmdLine.length++] = f;
}
OLloaded = 1;

//overlibmws_draggable.js
/* overlibmws_draggable.js plug-in module - Copyright Foteos Macrides 2002-2007. All rights reserved.
For support of the DRAGGABLE feature.
Initial: August 24, 2002 - Last Revised: January 1, 2007
See the Change History and Command Reference for overlibmws via:
http://www.macridesweb.com/oltest/
Published under an open source license: http://www.macridesweb.com/oltest/license.html*/
OLloaded = 0;
var OLdraggableCmds = 'draggable,dragcap,dragid';
OLregCmds(OLdraggableCmds);
if (OLud('draggable')) var ol_draggable = 0;
if (OLud('dragcap')) var ol_dragcap = 0;
if (OLud('dragid')) var ol_dragid = '';
var o3_draggable = 0, o3_dragcap = 0, o3_dragid = '', o3_dragging = 0, OLdrg = null, OLmMv,
OLcX, OLcY, OLcbX, OLcbY; function OLloadDraggable() { OLload(OLdraggableCmds); }
function OLparseDraggable(pf, i, ar) {
    var t = OLtoggle, k = i; if (k < ar.length) {
        if (Math.abs(ar[k]) == DRAGGABLE) { t(ar[k], pf + 'draggable'); return k; }
        if (Math.abs(ar[k]) == DRAGCAP) { t(ar[k], pf + 'dragcap'); return k; }
        if (ar[k] == DRAGID) { OLparQuo(ar[++k], pf + 'dragid'); return k; } 
    } return -1;
}
function OLcheckDrag() {
    if (o3_draggable) { if (o3_sticky && (o3_frame == self)) OLinitDrag(); else o3_draggable = 0; } 
}
function OLinitDrag() {
    OLmMv = OLdw.onmousemove; o3_dragging = 0;
    if (OLns4) {
        document.captureEvents(Event.MOUSEDOWN | Event.CLICK);
        document.onmousedown = OLgrabEl; document.onclick = function(e) { return routeEvent(e); } 
    }
    else {
        var dvido = (o3_dragid) ? OLgetRef(o3_dragid) : null, capid = (OLovertwoPI && over == over2 ?
'overCap2' : 'overCap'); if (dvido) dvido.onscroll = function() {
    OLdw.onmousemove = OLmMv;
    OLinitDrag();
}; OLdrg = (o3_cap && o3_dragcap) ? OLgetRef(capid) : over;
        if (!OLdrg || !OLdrg.style) OLdrg = over; OLdrg.onmousedown = OLgrabEl; OLsetDrgCur(1);
    } 
}
function OLsetDrgCur(d) { if (!OLns4 && OLdrg) OLdrg.style.cursor = (d ? 'move' : 'auto'); }
function OLgrabEl(e) {
    var e = (e || event);
    var cKy = (OLns4 ? e.modifiers & Event.ALT_MASK : (e.altKey || (OLop7 && e.ctrlKey))); o3_dragging = 1;
    if (cKy) {
        OLsetDrgCur(0); document.onmouseup = function() { OLsetDrgCur(1); o3_dragging = 0; }
        return (OLns4 ? routeEvent(e) : true);
    }
    OLx = (e.pageX || e.clientX + OLfd().scrollLeft); OLy = (e.pageY || e.clientY + OLfd().scrollTop);
    if (OLie4) over.onselectstart = function() { return false; }
    if (OLns4) { OLcX = OLx; OLcY = OLy; document.captureEvents(Event.MOUSEUP) } else {
        OLcX = OLx - (OLns4 ? over.left : parseInt(over.style.left));
        OLcY = OLy - (OLns4 ? over.top : parseInt(over.style.top));
        if ((OLshadowPI) && bkdrop && o3_shadow) {
            OLcbX = OLx - (parseInt(bkdrop.style.left));
            OLcbY = OLy - (parseInt(bkdrop.style.top));
        } 
    } OLdw.onmousemove = OLmoveEl;
    document.onmouseup = function() {
        if (OLie4) over.onselectstart = null; o3_dragging = 0; OLdw.onmousemove = OLmMv;
    }
    return (OLns4 ? routeEvent(e) : false);
}
function OLmoveEl(e) {
    var e = (e || event);
    OLx = (e.pageX || e.clientX + OLfd().scrollLeft); OLy = (e.pageY || e.clientY + OLfd().scrollTop);
    if (o3_dragging) {
        if (OLns4) {
            over.moveBy(OLx - OLcX, OLy - OLcY);
            if (OLshadowPI && bkdrop && o3_shadow) bkdrop.moveBy(OLx - OLcX, OLy - OLcY);
        }
        else {
            OLrepositionTo(over, OLx - OLcX, OLy - OLcY);
            if ((OLiframePI) && OLie55 && OLifsP1) OLrepositionTo(OLifsP1, OLx - OLcX, OLy - OLcY);
            if ((OLshadowPI) && bkdrop && o3_shadow) {
                OLrepositionTo(bkdrop, OLx - OLcbX, OLy - OLcbY);
                if ((OLiframePI) && OLie55 && OLifsSh) OLrepositionTo(OLifsSh, OLx - OLcbX, OLy - OLcbY);
            } 
        }
        if (OLhidePI) OLhideUtil(0, 1, 1, 0, 0, 0);
    } if (OLns4) { OLcX = OLx; OLcY = OLy; }
    return false;
}
function OLclearDrag() {
    if (OLns4) {
        document.releaseEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.CLICK);
        document.onmousedown = document.onclick = null;
    } else {
        if (OLdrg) OLdrg.onmousedown = null; over.onmousedown = null; OLsetDrgCur(0);
    }
    document.onmouseup = null; o3_dragging = 0;
}
OLregRunTimeFunc(OLloadDraggable);
OLregCmdLineFunc(OLparseDraggable);
OLdraggablePI = 1;
OLloaded = 1;
//overlibmws_iframe.js
/* overlibmws_iframe.js plug-in module - Copyright Foteos Macrides 2003-2007. All rights reserved.
Masks system controls to prevent obscuring of popops for IE v5.5 or higher.
Initial: October 19, 2003 - Last Revised: April 22, 2007
See the Change History and Command Reference for overlibmws via:
http://www.macridesweb.com/oltest/
Published under an open source license: http://www.macridesweb.com/oltest/license.html*/
OLloaded = 0;
var OLifsP1 = null, OLifsSh = null, OLifsP2 = null;
function OLinitIfs() {
    if (!OLie55) return;
    if ((OLovertwoPI) && over2 && over == over2) {
        var o = o3_frame.document.all['overIframeOvertwo'];
        if (!o || OLifsP2 != o) { OLifsP2 = null; OLgetIfsP2Ref(); } return;
    }
    o = o3_frame.document.all['overIframe'];
    if (!o || OLifsP1 != o) { OLifsP1 = null; OLgetIfsRef(); }
    if ((OLshadowPI) && o3_shadow) {
        o = o3_frame.document.all['overIframeShadow'];
        if (!o || OLifsSh != o) { OLifsSh = null; OLgetIfsShRef(); } 
    } 
}
function OLsetIfsRef(o, i, z) {
    o.id = i; o.src = 'javascript:false;'; o.scrolling = 'no'; var os = o.style; os.position = 'absolute';
    os.top = '0px'; os.left = '0px'; os.width = '1px'; os.height = '1px'; os.visibility = 'hidden';
    os.zIndex = over.style.zIndex - z; os.filter = 'Alpha(style=0,opacity=0)';
}
function OLgetIfsRef() {
    if (OLifsP1 || !OLie55) return;
    OLifsP1 = o3_frame.document.createElement('iframe');
    OLsetIfsRef(OLifsP1, 'overIframe', 2);
    o3_frame.document.body.appendChild(OLifsP1);
}
function OLgetIfsShRef() {
    if (OLifsSh || !OLie55) return;
    OLifsSh = o3_frame.document.createElement('iframe');
    OLsetIfsRef(OLifsSh, 'overIframeShadow', 3);
    o3_frame.document.body.appendChild(OLifsSh);
}
function OLgetIfsP2Ref() {
    if (OLifsP2 || !OLie55) return;
    OLifsP2 = o3_frame.document.createElement('iframe');
    OLsetIfsRef(OLifsP2, 'overIframeOvertwo', 1);
    o3_frame.document.body.appendChild(OLifsP2);
}
function OLsetDispIfs(o, w, h) {
    var os = o.style;
    os.width = w + 'px'; os.height = h + 'px'; os.clip = 'rect(0px ' + w + 'px ' + h + 'px 0px)';
    o.filters.alpha.enabled = true;
}
function OLdispIfs() {
    if (!OLie55) return;
    var wd = over.offsetWidth, ht = over.offsetHeight;
    if (OLfilterPI && o3_filter && o3_filtershadow) { wd += 5; ht += 5; }
    if ((OLovertwoPI) && over2 && over == over2) {
        if (!OLifsP2) return;
        OLsetDispIfs(OLifsP2, wd, ht); return;
    }
    if (!OLifsP1) return;
    OLsetDispIfs(OLifsP1, wd, ht);
    if ((!OLshadowPI) || !o3_shadow || !OLifsSh) return;
    OLsetDispIfs(OLifsSh, wd, ht);
}
function OLshowIfs() {
    if (OLifsP1) {
        OLifsP1.style.visibility = "visible";
        if ((OLshadowPI) && o3_shadow && OLifsSh) OLifsSh.style.visibility = "visible";
    } 
}
function OLhideIfs(o) {
    if (!OLie55 || o != over) return;
    if (OLifsP1) OLifsP1.style.visibility = "hidden";
    if ((OLshadowPI) && o3_shadow && OLifsSh) OLifsSh.style.visibility = "hidden";
}
function OLrepositionIfs(X, Y) {
    if (OLie55) {
        if ((OLovertwoPI) && over2 && over == over2) {
            if (OLifsP2) OLrepositionTo(OLifsP2, X, Y);
        }
        else {
            if (OLifsP1) {
                OLrepositionTo(OLifsP1, X, Y); if ((OLshadowPI) && o3_shadow && OLifsSh)
                    OLrepositionTo(OLifsSh, X + o3_shadowx, Y + o3_shadowy);
            } 
        } 
    } 
}
OLiframePI = 1;
OLloaded = 1;

addEvent(window, "load", addPriceExampleEvents, false);
var isClicked;
/* Used by the Table Builder property to enable tab navigation. Called from ContentBlock "/BlueSites/Templates/ContentBlocks/DynamicTable.ascx" */
function addEventsForInnerTabNavigation() {
    $("div.inner-sub-tab-navigation").each(function() {
        $(this).find("li").each(function(j) {
            $(this).attr("tabnavindex", "tabnavindex-" + j).click
            (
                function() {
                    var 
                        $this = $(this),
                	    $tables = $this.parent().parent().find('table'),
	                    intTabIndex = this.getAttribute("tabnavindex").replace(/tabnavindex-/, "");

                    $this.parent().find('li').removeAttr('class');
                    $this.addClass('selected');

                    if (intTabIndex === 0) {
                        $this.addClass('first-tab-selected');
                    }

                    $tables.attr('class', 'dynamic-table display-none');
                    $tables.eq(parseInt(intTabIndex)).attr('class', 'dynamic-table display-table');
                }
            );
        });
    });
}
/* Print the panel on Blue concept pages. Called from ContentBlock "/BlueSites/Templates/ContentBlocks/ExpandablePanel.ascx"
* and "hosturl/Xslt/BlueSites/City.xslt". */
function addPrintExpandBlock(){
    
	$(".print-expand-panel-JS").click(function (){	
			openElementAndPrint(this.parentNode);
	});
	$(".open-expand-panel-JS").click(function () {	
			openElementAndPrint(this.parentNode, null, true);
	});
}

var oDropDown = null;
var oDropDownToFill = null;
function addDynamicDropDownEvents(oParentElem){
	oParentElem = (oParentElem) ? oParentElem : document;
	var arrAllDynamicDropDowns = getElementsByClassName(oParentElem, "select", "dynamic-dropdown");
	for (var i=0; i<arrAllDynamicDropDowns.length; i++){
	    arrAllDynamicDropDowns[i].onchange = function() {
	        var strClassName = this.className;
	        var strType = strClassName.replace(/.*type-(\w+)(\b.*|$)/i, "$1");
	        var strDat = strClassName.replace(/.*dat-(\w+)(\b.*|$)/i, "$1");
	        var strId = this.options.selectedIndex != '-1' ? this.options[this.options.selectedIndex].value : '';
	        var oSelectedBookingType = document.getElementById("selected-booking-type");
	        var oHidden = document.getElementById(this.id + "-hidden");
	        if (oHidden) {
	            oHidden.value = strId;
	        }

	        if (strId !== null && strId.length > 0) {
	            var 
	                depCode,
	                strURL;

	            if (strType == 'resort') {
	                //Depcodes always in first dropdown
	                depCode = arrAllDynamicDropDowns[0].value;
	                strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?type=" + strType + "&id=" + strId + "&dep=" + depCode;
	            }
	            else if (strType == 'resortStart') {
	                depCode = arrAllDynamicDropDowns[0].value;
	                strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?strBookingType=" + oSelectedBookingType.value + "&type=" + strType + "&id=" + strId + "&dep=" + depCode;
	            }
	            else if (strType == 'cat_entry') {
	                strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?type=" + strType + "&id=" + strId;
	            }
	            else if (strType == 'cat_resort' || strType == 'cat_hotel') {
	                strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?type=" + strType + "&id=" + strId;
	            }
	            else {
	                strURL = "/BlueSites/Templates/DynamicContent/GetDropDownItems.aspx?strBookingType=" + oSelectedBookingType.value + "&type=" + strType + "&id=" + strId;
	                //Save in global variable
	                oDropDown = this;
	                var sec = getElementsByClassName(document, "select", "element-to-fill-return-date");
	                if (sec !== null && sec.length > 0 && strClassName.indexOf("element-to-fill-return-date") == -1) {
	                    setTimeout("SetSec()", 100);
	                }
	            }
	            var strIdOfElementToFill = strClassName.replace(/.*element-to-fill-([\w\d\-]+)(\b.*|$)/i, "$1");
	            getJavaScriptArrayWithIdentifier(strIdOfElementToFill, strURL, "fillDropDownWithIdentifier");

	            var stringToSave = document.getElementById("postbackXml");
	            if (stringToSave) {
	                var PickedTd = document.getElementById("PickedTd");
	                var array = this.options[this.options.selectedIndex].value.split("_");
	                var destinationName = this.options[this.options.selectedIndex].text.replace("-", "");

	                if (destinationName.indexOf(" ") === 0) {
	                    destinationName = destinationName.substring(1, destinationName.length);
	                }

	                stringToSave.value = array[1] + "|" + destinationName;
	                PickedTd.innerHTML = destinationName;
	            }
	        }
	    };
		arrAllDynamicDropDowns[i].onkeyup = arrAllDynamicDropDowns[i].onchange;
	}
}
function GetDaysInMonth(month, year) {
    var selMonth = parseInt(month, 10);
    var dayArray = new Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    var days = dayArray[selMonth]
    if (selMonth == 2 && ((year % 4) == 0) && ((year % 100) != 0) || ((year % 400) == 0))
        days = 29;

    return days;
}
function SetSec(){
	var strDateForward = 4;
	var	sec = getElementsByClassName(document, "select", "element-to-fill-return-date");		
	
	if(sec !== null && sec.length > 0){
		//oDropDown is set in onChange function
		sec[0].value = oDropDown.options[oDropDown.options.selectedIndex].value;
		sec.onChange;
		//get control to update
		var srcDepDays = document.getElementById('departure-date');
		//get control to update
		var srcArrDays = document.getElementById('return-date');
		var year = oDropDown.options[oDropDown.options.selectedIndex].value.substring (0,4);
		var month = oDropDown.options[oDropDown.options.selectedIndex].value.substring (5,7);
		var daysInMonth = GetDaysInMonth (month, year);
		var nextIdx = parseInt(srcDepDays.value) + strDateForward;
		if (nextIdx > daysInMonth)	{
			// set new value in month
			sec[0].selectedIndex++;

			if (sec[0].onChange) {
			    sec[0].onChange();
			}
			
			//get no of days in new month
			var month = sec[0].value.substring (5,7);
			var daysInMonth2 = GetDaysInMonth (month, year);
			// returnDay must be reloades with days in month for new month
			// first "empty" the control
			for (var i = (srcArrDays.options.length-1); i >= 0; i--){
				srcArrDays.options[i]=null;
			}
			// fill control with new values
			//then fill returnMonth with values
			for (var j = 1 ; j<=daysInMonth2; j++){
				srcArrDays.options[j-1]=new Option (j, j);
			}
			// calculate new index
			var stepForward = nextIdx - daysInMonth;// - srcDepDays.value);
			// set new index in returnDay							
			srcArrDays.value = stepForward;
		}
		else{
			//set next index
			srcArrDays.value = nextIdx;
		}
	}
}
function fillDropDownWithIdentifier(strId, arrOptions){
	if(arrOptions !== null){
	    var oDropDownToFill = document.getElementById(strId);
		if (oDropDownToFill) {
			var selectedOption = oDropDownToFill.value;
			var oHidden = document.getElementById(oDropDownToFill.id + "-hidden");
			if (oHidden) {
			    selectedOption = oHidden.value;
			}

			var oOption;
			var arrayOption;
			oDropDownToFill.options.length = 0;
			
			for(var j=0; j<arrOptions.length; j++){
				arrayOption = arrOptions[j];
				if( arrayOption !== null ) {
					oDropDownToFill.options.length++;
					oDropDownToFill.options[j].value = arrayOption.value;
					oDropDownToFill.options[j].text = arrayOption.text;
					if (arrayOption.value == selectedOption) {
					    oDropDownToFill.options[j].selected = true;
					}
				}
			}			
			oDropDownToFill.onchange();
		}
	}
}
/** addQuickPoll - Loads Quick-Poll In Div Note. Calls addQuickPollInner() via the Ajax-load function getXML */
function addQuickPoll (){
	var oPollDiv = document.getElementById("divPollContent-isFunctionPointer");
	if (oPollDiv){
		var toGetFrom = oPollDiv.getAttribute ("src");
		getXML (toGetFrom, oPollDiv, addQuickPollInner);
	}
}
/* findVoteItem - tries to find a selected input tags with value "PollAltValue__XX" (XX is int) returns XX if found returns null otherwise */
function findVoteItem(){
	var options = new Array();
	var options = document.getElementsByTagName("input");
	for (var i = 0; i < options.length; i++){
		if (options[i].type && options[i].type=="radio"){
			var option = options[i];
			var value = option.value;
			var rexfindPollAlt = /^PollAltValue__/;
			
			if (value.match (rexfindPollAlt)){
			    if (option.checked) {
			        return String(option.value).replace(/PollAltValue__/, "");
			    }
			}
		}
	}
}
/** addQuickPollInner add events to inner content of loaded quick poll dev	called from addQuickPoll()*/
function addQuickPollInner (){
	var oPollDiv = document.getElementById("divPollContent-isFunctionPointer");
	var oPollSubmitButton = document.getElementById("quickpoll-vote-button-isFunctionPointer");
	if (oPollSubmitButton && oPollDiv){
		oPollSubmitButton.onclick = function () {
			var selectedItem = findVoteItem();
			if (selectedItem){
				var toGetFrom = oPollDiv.getAttribute ("src");
				toGetFrom += "&vote=" + selectedItem;
				getXML (toGetFrom, oPollDiv, addQuickPollInner);
			}
			return false;
		}
	}	
	var oPollSwitchViewLink = document.getElementById("quickpoll-swith-view-link-isFunctionPointer");
	if (oPollSwitchViewLink && oPollDiv){
		oPollSwitchViewLink.onclick = function () {
			var toGetFrom = oPollDiv.getAttribute ("src");
			toGetFrom += "&pollact=switch";
			getXML (toGetFrom, oPollDiv, addQuickPollInner);
			return false;
		}
	}
	var oPollHideLink = document.getElementById ("quickpoll-hide-poll-isFunctionPointer");
	if (oPollHideLink){
		var hdnIdHolder = document.getElementById ("hdnPollId");
		var pollCookieId = "quickpoll-hide-poll-isFunctionPointer-pollHidden" + hdnIdHolder.getAttribute ("value");

		oPollHideLink.onclick = function() {
		    setCookie(pollCookieId, true, 100); // Set hide-cookie and hide poll
		    oPollDiv.className = 'display-none';
		    return false;
		}
	}
}
/*** getCookie - returns cookie value for named cookie
  * @param c_name - cookie name
  */
function getCookie(c_name){
	if (document.cookie.length>0){
	    var c_start = document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){
		    c_start = c_start + c_name.length + 1;
			var c_end = document.cookie.indexOf(";", c_start);
			if (c_end == -1) {
			    c_end = document.cookie.length;
			}
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return null;
}
/*** setCookie - sets cookie value
 * @param c_name		- cookie name
 * @param value			- value for cookie
 * @param expiredays	- days to live for cookie (optional, default = 30days)
  */
function setCookie(c_name, value, expiredays){
    if (!expiredays) {
        expiredays = 30;
    }
	var exdate = new Date();
	exdate.setDate (exdate.getDate() + expiredays);
	document.cookie= c_name + "=" + escape(value) + ";expires=" + exdate;
}

/* Site Feedback*/
function ShowAnotherPageForm(display){
	var AnotherPageDiv = document.getElementById('AnotherPage');	
	AnotherPageDiv.className = display;
}
function printPageAndSubPages(){
	$("a#page-print-button").click(function(){	
		openElementAndPrint(this.parentNode);		
		return;
	});
}

function addPriceExampleEvents(){
	var arrAllPriceExamples = getElementsByClassName(document, "a", "price-example-link");
		for(var j=0; j<arrAllPriceExamples.length; j++){
			arrAllPriceExamples[j].onclick = function (oEvent){
				var oEvent = (typeof oEvent != "undefined")? oEvent : event;
				displayPriceExampleInfo(oEvent, this);
			};
		}
}
function displayPriceExampleInfo(oEvent, oElm){
	var intHotelId = oElm.getAttribute("id").replace(/price-example-/g, "");
	var strId = "price-example-details-" + intHotelId;
	var oPriceExampleInfo = document.getElementById("price-example-details-" + intHotelId);
	if(oPriceExampleInfo){
		oEvent.returnValue = false;
		if(oEvent.preventDefault){
			oEvent.preventDefault();
		}
		var bShow = (oPriceExampleInfo.className.search(/display-block/) == -1)? true : false;
		oPriceExampleInfo.className = "price-example-details " + ((bShow)? "display-block" : "display-none");			
	}
	var srcElement = oEvent.target ? oEvent.target : oEvent.srcElement;
	var bSelected = (srcElement.className.search(/selected/) != -1)? true : false;
	if (bSelected) {
	    srcElement.className = srcElement.className.replace("selected", "");
	}
	else {
	    srcElement.className = srcElement.className + " selected";
	}
}
function addRedirectDropDownPusher(){
	$("select.drop-down-pusher").change(function(){			
		var val = this.value;				
		var url = val.split(",");	
		if(this.selectedIndex !== 0) {	
			if(url[1] == "_blank"){				
				window.open(url[0]);
			}
			else{		
				location.href = url[0];
			}
		}
		return false;
   });      
}
$(document).ready(function() {
    $("a.expand-panel-list-JS2").click(function() {

        var containerDiv = $("#box_container_" + $(this).attr("id").replace("expand_listItem_", ""));

        if ($(containerDiv).hasClass("display-block")) {
            $(containerDiv).removeClass("display-block").addClass("display-none");
        }
        else {
            $(containerDiv).removeClass("display-none").addClass("display-block");
        }

        if ($(this).hasClass("selected")) {
            $(this).removeClass("selected");
        }
        else {
            $(this).addClass("selected");
        }

        return false;
    });
    $("a.close-expand-JS").click(function() {
        var currentId = $(this).attr("id").replace("expand_close_", "");
        $("#box_container_" + currentId).removeClass("display-block").addClass("display-none");
        $("#expand_listItem_" + currentId).removeClass("selected");
    });


    $("#add-hotel-container #select-catalogue,#add-hotel-container #select-entry,#add-hotel-container #select-resort,#add-hotel-container #select-hotel").change(function() {
        if ($(this).val() == "0") {
            return false;
        }

        var 
            array = $(this).val().split('|'),
            inputData = "{catalogueId: " + $(this).val() + "}",
            url = "/BlueSites/Templates/AjaxHandlers/GetJson.asmx/GetEntries",
            $nextList = $("#select-entry"),
            $submitButton = $("#btnAddHotel");

        $submitButton.attr("disabled", "disabled").attr("src", $submitButton.attr("src").replace("add.gif", "add-disabled.gif"));

        switch ($(this).attr("id")) {
            case "select-entry":
                inputData = "{catalogueId: " + array[0] + ", entryId : " + array[1] + ", entryName: '" + array[2] + "'}";
                url = "/BlueSites/Templates/AjaxHandlers/GetJson.asmx/GetResorts";
                $nextList = $("#select-resort");
                $("#select-resort, #select-hotel").empty();
                break;
            case "select-resort":
                inputData = "{catalogueId: " + array[0] + ", cityId : " + array[2] + ", enokType: '" + array[1] + "'}";
                url = "/BlueSites/Templates/AjaxHandlers/GetJson.asmx/GetHotels";
                $nextList = $("#select-hotel");
                break;
            case "select-hotel":
                $submitButton.removeAttr("disabled").attr("src", $submitButton.attr("src").replace("-disabled", ""));
                return;
            default:
                $("#select-entry, #select-resort, #select-hotel").empty();
                break;
        }

        $.ajax({
            type: "POST",
            url: url,
            data: inputData,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(data) {
                var jsonItems = (typeof data.d) == 'string' ? eval('(' + data.d + ')') : data.d;
                $nextList.empty();
                for (var i = 0, il = jsonItems.Items.length; i < il; i++) {
                    $($nextList).append(
                        $("<option></option>").val(jsonItems.Items[i].Value).html(jsonItems.Items[i].Text)
                    );
                }
            }
        });
    });

    $('#hotel-menu a[href*=#], .our-hotels a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
               && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');

            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({ scrollTop: targetOffset }, 1000);
                return false;
            }
        }
    });


    $("div.new-price-container").find("a.lms-price-link").click(function() {
        window.location = $(this).attr("rel");
        return false;
    });

    $('.concept-listning li').click(function() {
        window.location = $(this).find('a:first').attr('href');
    });


    hotelListHelper = new HotelListHelper($("#hotel-list-container"));

    var videoContainer = $("#video-player-container");

    if (videoContainer.length !== 0) {
        videoContainer.load("/BlueSites/Templates/DynamicContent/Media/EmbedCode.aspx?epiId=" + hotelListHelper.EpiId);
    }

    // TODO: kanske ladda lite b�ttre
    hotelListHelper.Holder.find("#hotel-container").load(hotelListHelper.RequestUrl($("#first-available-catalogue").val(), hotelListHelper.HotelType, 0, 'resort') + "&page=0", function() {
        hotelListHelper.BuildPaging();
    });
    hotelListHelper.Holder.find('input:radio[name=radio-season-selector]').change(function() {

        var countryId = $("#country-selector").val();
        $.ajax({
            type: "POST",
            url: "/BlueSites/Templates/AjaxHandlers/GetJson.asmx/GetValidEntriesForHotelType",
            data: "{type: '" + $("#hotel-type-hidden").val() + "', cat: " + $(this).val() + ", epiId: " + hotelListHelper.EpiId + "}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(data) {
                var jsonItems = (typeof data.d) == 'string' ? eval('(' + data.d + ')') : data.d;
                // TODO S�tta tillbaka det valda landet
                hotelListHelper.Holder.find("#country-selector").empty().append($("<option></option>").val("0").text(strAllCountries));
                for (var i = 0, il = jsonItems.Items.length; i < il; i++) {
                    hotelListHelper.Holder.find("#country-selector").append($("<option></option>").val(jsonItems.Items[i].Value).html(jsonItems.Items[i].Text));
                }
                hotelListHelper.Holder.find("#country-selector").val(countryId);
            }
        });

        hotelListHelper.Holder.find("#hotel-container").html(hotelListHelper.AjaxLoaderImage);
        var 
            season = $(this).val(),
            sortOrder = hotelListHelper.Holder.find('#sorting-selector').val();

        hotelListHelper.Holder.find("#hotel-container").load(hotelListHelper.RequestUrl(season, hotelListHelper.HotelType, countryId, sortOrder), function() {
            hotelListHelper.BuildPaging();
        });
    });

    hotelListHelper.Holder.find('#country-selector').change(function() {
        hotelListHelper.Holder.find("#hotel-container").html(hotelListHelper.AjaxLoaderImage);
        var 
            season = $('input:radio[name=radio-season-selector]:checked').val(),
            countryId = $(this).val(),
            sortOrder = hotelListHelper.Holder.find('#sorting-selector').val();

        hotelListHelper.Holder.find("#hotel-container").load(hotelListHelper.RequestUrl(season, hotelListHelper.HotelType, countryId, sortOrder), function() {
            hotelListHelper.Holder.find("#select-season").find("input").removeAttr("disabled");
            hotelListHelper.Holder.find("#select-season").find("label").removeClass("not-valid");

            var seasonsToHide = $(".season-to-hide").val().split(',');
            for (i = 0; i < seasonsToHide.length; i++) {
                hotelListHelper.Holder.find("#select-season").find("#value-" + seasonsToHide[i]).attr("disabled", "disabled").parents().filter("label").addClass("not-valid");
            }
            hotelListHelper.BuildPaging();
        });
    });

    hotelListHelper.Holder.find('#sorting-selector').change(function() {
        hotelListHelper.Holder.find("#hotel-container").html(hotelListHelper.AjaxLoaderImage);
        var 
            season = $('input:radio[name=radio-season-selector]:checked').val(),
            countryId = $("#country-selector").val(),
            sortOrder = hotelListHelper.Holder.find('#sorting-selector').val();

        hotelListHelper.Holder.find("#hotel-container").load(hotelListHelper.RequestUrl(season, hotelListHelper.HotelType, countryId, sortOrder), function() {
            hotelListHelper.SortOrder = $('#sorting-selector').val();
            hotelListHelper.BuildPaging();
        });
    });

    hotelListHelper.Holder.find('.paging-links-ajax a, .paging-results-ajax a.previous-page, .paging-results-ajax a.next-page').live('click', function() {
        var 
            season = $('input:radio[name=radio-season-selector]:checked').val(),
            countryId = $("#country-selector").val(),
            page = $(this).attr("rel"),
            currentSelectedLink = hotelListHelper.Holder.find('a.selected'),
            firstItemText = hotelListHelper.Holder.find('#top-paging a:first').text(),
            lastItemText = hotelListHelper.Holder.find('#top-paging a:last').text(),
            sortOrder = hotelListHelper.Holder.find('#sorting-selector').val();

        if ($(this).hasClass('next-page')) {
            page = parseInt(currentSelectedLink.attr('rel'), 10) + 10;
            $('.previous-page').show();
        }
        else if ($(this).hasClass('previous-page')) {
            page = parseInt(currentSelectedLink.attr('rel'), 10) - 10;
            $('.next-page').show();
        }

        hotelListHelper.Holder.find("#hotel-container").html(hotelListHelper.AjaxLoaderImage);

        hotelListHelper.Holder.find("#hotel-container").load(hotelListHelper.RequestUrl(season, hotelListHelper.HotelType, countryId, sortOrder) + "&page=" + page);
        hotelListHelper.Holder.find('.paging-links-ajax a').removeClass("selected");

        if ($(this).hasClass('next-page')) {
            hotelListHelper.Holder.find('[rel=' + page + ']').addClass('selected');
            if ($('#top-paging').find('[rel=' + page + ']').text() === lastItemText) {
                $('.next-page').hide();
            }
        }
        else if ($(this).hasClass('previous-page')) {
            hotelListHelper.Holder.find('[rel=' + page + ']').addClass('selected');
            if ($('#top-paging').find('[rel=' + page + ']').text() === firstItemText) {
                $('.previous-page').hide();
            }
        }
        else {
            hotelListHelper.Holder.find('[rel=' + page + ']').addClass('selected');
            if ($('#top-paging').find('[rel=' + page + ']').text() === firstItemText) {
                $('.previous-page').hide();
                $('.next-page').show();
            }
            else if ($('#top-paging').find('[rel=' + page + ']').text() === lastItemText) {
                $('.next-page').hide();
                $('.previous-page').show();
            }
            else {
                $('.next-page').show();
                $('.previous-page').show();
            }
        }
    });

    $("a.images,a.map,a.video, a.open-movie, a.open-images").live('click', function(event) {
        event.preventDefault();

        var 
            showLarge = (screen.height > hotelListHelper.LargeScreenSize),
            dialogClass = (showLarge) ? "div.media-large" : "div.media-medium",
            type = $(this).attr("class"),
            hotelId = $(this).attr("rel"),
            catalouge = $('input:radio[name=radio-season-selector]:checked').val(),
            queryString = "?hotel=" + hotelId + "&cat=" + catalouge + "&type=" + type + "&showLarge=" + showLarge;

        if ($(this).hasClass("open-movie")) {
            queryString = "?epiid=" + $(this).attr("rel") + "&showLarge=" + 'true' + "&type=" + type;
            dialogClass = "div.media-large";
        }

        var mapsUrl = "/BlueSites/Templates/DynamicContent/Media/MediaViewer.aspx" + queryString;
        var dialogControl = TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog({ 'innerHtmlCenter': '<iframe frameborder="0" style="overflow: hidden;" scrolling="no" allowTransparency="true" backgroundColor="transparent" src="' + mapsUrl + '"></iframe>', 'showOverlay': false, 'isDraggable': true }, dialogClass.replace('div.', ''));
        $("div#light-box").css("height", $(document).height() + 100 + "px").show();
        $(dialogClass).css({ zIndex: "100", position: "absolute" }).find("a.dialog-top-close-link").click(function() {
            $(dialogClass).remove();
            $("div#light-box").hide();
        });
        dialogControl.show();

        return false;
    });

});

this.imagePreview = function() {
    xOffset = 150;
    yOffset = 30;

    xConceptOffset = 70;
    yConceptOffset = 30;

    $("a.lms-img-preview").click(function() {
        document.location.href = $(this).parent().find("div a").attr("href");
        return false;
    });

    $("a.lms-img-preview").hover(function(e) {
        this.t = this.title;
        this.title = "";
        var c = (this.t != "") ? "<br />" + this.t : "";
        $("body").append("<p id='preview'><img src='" + this.href + "' alt='Image preview' /><span id='img-title'>" + c + "</span></p>");
        $("#preview")
			.css("top", (e.pageY - xOffset) + "px")
			.css("left", (e.pageX + yOffset) + "px")
			.fadeIn("fast");
    },
	function() {
	    this.title = this.t;
	    $("#preview").remove();
	});
    $("a.lms-img-preview").mousemove(function(e) {
        $("#preview")
			.css("top", (e.pageY - xOffset) + "px")
			.css("left", (e.pageX + yOffset) + "px");
    });

    $("#hotel-menu a").hoverIntent(function(e) {
        this.t = this.title;
        this.title = "";
        var c = (this.t != "") ? "<br />" + this.t : "";
        var pageId = this.rel;

        if (!pageId) {
            return false;
        }

        $("body").append("<div id='preview' class='concept-label-preview'></div>");
        $('#preview').load('/BlueSites/Templates/DynamicContent/ConceptAndLabels.aspx?epiid=' + pageId + ' #epi-content');
        $("#preview")
			.css("top", (e.pageY - xConceptOffset) + "px")
			.css("left", (e.pageX + yConceptOffset) + "px")
			.delay(500)
			.fadeIn("fast");
    },
    function() {
        this.title = this.t;
        $("#preview").remove();
    });
    $("#hotel-menu a").mousemove(function(e) {
        $("#preview")
			.css("top", (e.pageY - xConceptOffset) + "px")
			.css("left", (e.pageX + yConceptOffset) + "px");
    });
};

this.setSeasonSelectorWidth = function() {
    var totalWidth = 0;
    $(".concept-and-labels #select-season label").each(function(index) {
        totalWidth += $(this).width();
    });
    $(".concept-and-labels #select-season").find(".season-labels").eq(0).width(totalWidth);
}

$(document).ready(function() {
    imagePreview();
    //IE7 fix, set a fixed width for the season-labels div
    if (jQuery.browser.msie && jQuery.browser.version == 7) {
        setSeasonSelectorWidth();
    }
});

// TODO: Fixa obaseSettings s� det funkar
var tempInc = "/includes";
HotelListHelper = function(oParent) {
    this.Holder = oParent;
    //this.AjaxLoaderImage = "<img src=\"" + oBaseAppSettings.IncludeSiteDirectory + "/Images/Layout/HotelItem/icon-load-66x66.gif\"' id=\"hotel-loader-icon\" />";
    this.AjaxLoaderImage = "<img src=\"" + tempInc + "/Images/Layout/HotelItem/icon-load-66x66.gif\"' id=\"hotel-loader-icon\" />";
    this.LargeScreenSize = 899;
    this.HotelType = $('#hotel-type-hidden').val();
    this.NumOfPages = parseInt($('.nr-of-pages').val(), 10);
    this.EpiId = $('#epi-id').val();    
    this.RequestUrl = function(season, hotelType, countryId, sortOrder) {
        return "/BlueSites/Templates/DynamicContent/ConceptAndLabelsHotelList.aspx?cat=" + season + "&type=" + hotelType + "&entry=" + countryId + "&epiId=" + this.EpiId + "&searchFilter=" + sortOrder;
    };
    this.BuildPaging = function() {
        var 
            listItems = "",
            relNum = 10,
            numOfPages = $(".nr-of-pages").val();

        if (numOfPages < 2) {
            $(".paging-results-ajax").hide();
            return;
        }
        else {
            $(".paging-results-ajax").show().find("ul").html("");
            $('.next-page').show();
        }

        for (i = 0; i < numOfPages; i++) {
            if (i === 0) {
                listItems = listItems + '<li class="first"><a href="javascript:void(0);" rel="0">1</a></li>';
            }
            else {
                listItems = listItems + String.format('<li><a href="javascript:void(0);" rel="{0}">{1}</a></li>', relNum, (i + 1));
                relNum = relNum + 10;
            }
        }
        $(".paging-links-ajax").append(listItems);
        hotelListHelper.Holder.find('.paging-links-ajax a:first').addClass("selected");
    };
};
$(document).ready(function() {
    $("#toggler-container a").click(function() {
        $("#toggler-container a").removeClass("selected");
        $(this).addClass("selected");
        var currentId = $(this).attr("id").replace("listItem_", "");        
        $("#expandPanelImage").attr("src", $("#hidden_" + currentId).attr("value"));
        $(".box-extra-info-expand").removeClass("display-block").addClass("display-none");        
        $("#container_" + currentId).removeClass("display-none").addClass("display-block"); ;
        if (currentId === "2") {
            $("#container_day_by_day > div").removeClass("display-block").addClass("display-none");
            $("#day_1_container").removeClass("display-none").addClass("display-block");
        }
    });
    $("a.day_link").click(function() {
        window.location.hash = 'box-anchor';        
        $("#toggler-container a").removeClass("selected");
        $("#listItem_2").addClass("selected");
        $(".box-extra-info-expand").removeClass("display-block").addClass("display-none");
        $("#container_2").removeClass("display-none").addClass("display-block");

        $("#container_day_by_day > div").removeClass("display-block").addClass("display-none");
        $("#day_" + $(this).attr("id").replace("day_", "") + "_container").removeClass("display-none").addClass("display-block");
        return false;
    });
    $("a.forward_bottom").click(function() {        
        $("#container_day_by_day > div").removeClass("display-block").addClass("display-none");
        $("#day_" + $(this).attr("id").replace("next_", "") + "_container").removeClass("display-none").addClass("display-block");
        return false;
    });
    $("a.back_bottom").click(function() {        
        $("#container_day_by_day > div").removeClass("display-block").addClass("display-none");
        $("#day_" + $(this).attr("id").replace("prev_", "") + "_container").removeClass("display-none").addClass("display-block");
        return false;
    });
    $("a.close-expand-panel-JS").click(function() {
        var currentId = $(this).attr("id").replace("close_", "");
        $("#container_" + currentId).removeClass("display-block").addClass("display-none");
        $("#listItem_" + currentId).removeClass("selected");        
        return false;
    });
});
function addOpenCityIntroTextTema(){
    $("a#texts-text-link-tema").click(function() {
        if ($(this).attr("id") == "texts-text-link-tema") {
            $(this).text(($(this).text() == strReadMoreCity) ? strReadLessCity : strReadMoreCity);
        }

        if ($(this).attr("class") == "more-text-JS") {
            $("div#texts-text-ingress").removeClass("display-block").addClass("display-none");
            $(this).removeClass("more-text-JS").addClass("more-text-JS-hide").toggleClass("selected");
            $("div#texts-text-container").fadeIn("slow");
        }
        else {
            $("div#texts-text-ingress").removeClass("display-none").addClass("display-block");
            $(this).removeClass("more-text-JS-hide").addClass("more-text-JS").toggleClass("selected");
            $("div#texts-text-container").fadeOut("slow");
        }
        return false;
    });
}
function addHelpInfoCenterEvents() {
    $("a.help-info-center").click(function(event) {
        event.returnValue = false;
        event.preventDefault();
        var strURL = this.getAttribute("href");
        var content = showInfoLayer(null, null, 450, 200, ["TEXTFONTCLASS", "'overlib-text-font-class overlib-height-200'"]);
        getXML(strURL, content);
    });
    $("a.help-info-center-large").click(function(event) {
        event.returnValue = false;
        event.preventDefault();
        var strURL = this.getAttribute("href");
        var content = showInfoLayer(null, null, 500, 200, ["TEXTFONTCLASS", "'overlib-text-font-class overlib-height-200'"]);
        getXML(strURL, content);
    });
    /*$("a.help-info-center-car").click (function (event){ event.returnValue=false; event.preventDefault();	var topPos=((document.documentElement.clientHeight-210)/2); hideElemenstBelowInfoLayer(); displayHelpInfoCenterIframe("1",this,"400","200","180");});*/
    /*$("a.help-info-center-window").click (function (event){var w=screen.availWidth;var h=screen.availHeight;var popW=835,popH=710;var leftPos=(w-popW)/2,topPos=(h-popH)/2;OpenWindow(this.getAttribute("href"),835,710,"toolbar=false,directories=false,menubar=false,scrollbars=yes,resizable=false,status=false,left = " + leftPos + ",top = " + topPos + " '");return false;});*/
}

function showInfoLayer(caption, content, strWidth, strHeight, options) {
    var 
		cont = content ? content : "",
		capt = caption ? caption : "<div id=\'overlib-print\' style=\'float: right; font-weight: normal; cursor: pointer;\'>" + strCaptionPrint + "</div>" + strHelpInfo,
		width = strWidth ? strWidth : DONOTHING,
		height = strHeight ? strHeight : 100;

    var call = 'overlib(cont, NOFOLLOW, CAPTION, capt, CLOSETEXT, strCaptionClose, WIDTH, width, HEIGHT, height, STICKY, DRAGGABLE, DRAGCAP, CLOSECLICK, HAUTO, VAUTO, BGCLASS, \'overlib-table\', FGCLASS, \'overlib-text-cell\', CGCLASS, \'overlib-caption\', TEXTFONTCLASS, \'overlib-text-font-class float-container\', CAPTIONFONTCLASS, \'overlib-caption-font float-container\', CLOSEFONTCLASS, \'overlib-close-font\'';
    if (options) {
        for (command in options) { call += ', ' + options[command].toString(); }
    }
    call += ' );';
    eval(call);
    if (!caption) {
        $("div#overlib-print").click(function() {
            printHTML($("div.overlib-text-font-class")[0].innerHTML);
        });
    }
    return $("div.overlib-text-font-class")[0];
}

function displayHelpInfoCenterIframe(topPos, oElm, width, height) {
    var strURL = oElm.getAttribute("href");
    var content = showInfoLayer(null, null, width, height, ["TEXTFONTCLASS", "'overlib-text-font-class overlib-height-200'"]);
    getXML(strURL, content);
}

function hideElemenstBelowInfoLayer() {
    if ($.browser.msie && $.browser.version <= 6) {
        var arrAllHideBelowInfoLayer = getElementsByClassName(document, "select", "hide-below-info-layer");
        for (var j = 0; j < arrAllHideBelowInfoLayer.length; j++) {
            arrAllHideBelowInfoLayer[j].className = arrAllHideBelowInfoLayer[j].className.replace(/visibility-hidden/gi, '') + ' visibility-hidden';
        } 
    } 
}

function showElementsBelowInfoLayer() {
    if ($.browser.msie && $.browser.version <= 6) {
        var arrAllHideBelowInfoLayer = etElementsByClassName(document, "select", "hide-below-info-layer");
        for (var j = 0; j < arrAllHideBelowInfoLayer.length; j++) {
            arrAllHideBelowInfoLayer[j].className = arrAllHideBelowInfoLayer[j].className.replace(/visibility-hidden/gi, '');
        } 
    } 
}

var oDragObj;
var intOffsetX;
var intOffsetY;
var intContainerOffsetLeft;
var intContainerOffsetTop;
function initDrag(oEvent, oElm) {
    if (!document.getElementById("page")) {
        return;
    }

    var oEvent = (typeof oEvent != "undefined") ? oEvent : event;
    oDragObj = oElm.parentNode;
    intOffsetX = (oEvent.layerX) ? oEvent.layerX : oEvent.offsetX;
    intOffsetY = (oEvent.layerY) ? oEvent.layerY : oEvent.offsetY;
    intContainerOffsetLeft = document.getElementById("page").offsetLeft;
    intContainerOffsetTop = document.getElementById("page").offsetTop;
    if (oEvent.preventDefault) { oEvent.preventDefault(); }
    oElm.ondragstart = function() { event.returnValue = false; }
    document.onselectstart = function() { event.returnValue = false; }
}
var intScrollLeft = 0;
var intScrollTop = 0;

var oBodyElmForIE;
document.onmousemove = function(oEvent) {
    if (oDragObj) {
        intScrollLeft = (window.pageXOffset) ? window.scrollX : oBodyElmForIE.scrollLeft;
        intScrollTop = (window.pageYOffset) ? window.scrollY : oBodyElmForIE.scrollTop;
        var oEvent = (typeof oEvent != "undefined") ? oEvent : event;
        oDragObj.style.left = (oEvent.clientX - (intOffsetX + intContainerOffsetLeft)) + intScrollLeft + "px";
        oDragObj.style.top = (oEvent.clientY - (intOffsetY + intContainerOffsetTop)) + intScrollTop + "px";
        if (oEvent.preventDefault) { oEvent.preventDefault(); }
    } 
}
document.onmouseup = function() {
    oDragObj = null;
    document.onselectstart = function() { event.returnValue = true; }
}
/*
Filename : /TUI.Web.Includes/Js/booking.js
Description :
Contains common logic to the booking procedure.
*/
var CallBacks = new Array();
var temaStr = "";
if ($("body").hasClass("is-tema") || $("body").hasClass("brand-id-18") || $("body").hasClass("brand-id-19") || $("body").hasClass("brand-id-20") || $("body").hasClass("brand-id-23")) {
    temaStr = "-tema";
}
$(document).ready(
    function() {
        registerHelpTextPopupHandlers(document);

        $("div#draggable div.ui-handle a").click(function() { $("div#draggable").hide().removeClass("popup-666").removeAttr("style").find("div.ui-content:first").removeClass("no-padding").removeAttr("style"); if ($.browser.msie && $.browser.version < 7) { $("select").show(); } });
        $("a.print-icon, a.print").click(function(event) { killDefault(event); window.print(); });

        TUIWebSession = function() {
            this.ID = ($("input#TUIWebSessionID").length > 0) ? $("input#TUIWebSessionID").val() : "";
            this.UrlPart = "?" + oBaseAppSettings.SessionParameterName + "=" + this.ID + oBaseAppSettings.DEBUG;
            this.Reload = function() { this.ID = ($("input#TUIWebSessionID").length > 0) ? $("input#TUIWebSessionID").val() : ""; this.UrlPart = "?" + oBaseAppSettings.SessionParameterName + "=" + this.ID };
        }
        oTUIWebSession = new TUIWebSession();

        Logger = function() {
            this.Count = 1;
            this.Init = function() {
                $("form:first").append("<div id=\"logger\"></div>");
                $("div#logger").css({ position: "fixed", left: "50px", top: "50px", width: "200px", height: "400px", background: "#FFF", border: "1px solid #000", overflow: "scroll", fontSize: "10px" });
            }
            this.Write = function(logText) {
                if ($("div#logger").length == 0) { this.Init(); }
                $("div#logger").html(this.Count.toString() + ". " + logText + "<br/>" + $("div#logger").html());
                this.Count++;
            };
        }
        oLogger = new Logger();

        //List boxes
        Array.prototype.GetFunction = function(s) { for (i = 0; i < this.length; i++) { if (this[i].indexOf(s + "|") == 0) { return (this[i].replace(s + "|", "")); } } return (""); }
        Status = "ready"; ActiveListBox = null;
        jQuery.fn.extend({
            ListContainer: function() { return $(this).parents("div.list-box:first"); },
            ValueHolder: function() { return $(this).ListContainer().children("input:first"); },
            TextHolder: function() { return $(this).ListContainer().children("span"); },
            ListHolder: function() { return $(this).children("dl:first"); },
            ListItems: function(s) { return $(this).ListHolder().children("dd" + ((s != null) ? "." + s : "")); },
            ValueItems: function(s) { return $(this).ListHolder().children("dt" + ((s != null) ? "." + s : "")); },
            Open: function() { Status = "processing"; if (ActiveListBox != null) { ActiveListBox.Close("processing"); } $(this).addClass("active-box"); ActiveListBox = $(this); $(this).ListHolder().show(); setTimeout("Status=\"open\"", 300); },
            Close: function(s) { $(this).removeClass("active-box"); $(this).ListHolder().hide(); ActiveListBox = null; if (s != null) { Status = s; } else { Status = "ready"; } },
            ItemText: function() { return ($(this).find(".text").length > 0) ? $(this).find(".text").text() : $(this).text(); },
            SetSelected: function() { $(this).TextHolder().text($(this).ItemText()); $(this).ValueHolder().val(((($(this).prev("dt").attr("class") != null) && ($(this).prev("dt").attr("class") != "")) ? $(this).prev("dt").attr("class") + "|" : "") + $(this).prev("dt").text()); $(this).parent("dl").children("dd.selected").removeClass("selected"); $(this).addClass("selected"); },
            Call: function() { if (typeof CallBacks == "undefined") { return; } s = CallBacks.GetFunction($(this).ListContainer().attr("id")); if (s == "") { return; } eval(s + "(\"" + $(this).prev("dt").text() + "\")"); },
            SetHeight: function() { if ($(this).length > 12) { $(this).parent("dl").addClass("overflow"); if ($.browser.opera) { $(this).parent("dl").css("overflow", "scroll"); $(this).css("width", ($(this).parent("dl").width() - 24) + "px"); } } else { $(this).parent("dl").removeClass("overflow"); if ($.browser.opera) { $(this).parent("dl").css("overflow", "visible"); $(this).css("width", "auto"); } } },
            ClickItem: function() { if (($(this).hasClass("disabled")) || ($(this).hasClass("non-clickable"))) { Status = "processing"; setTimeout("Status=\"open\"", 100); return; } $(this).SetSelected(); $(this).Call(); },
            InitEvents: function() { $(this).mousedown(function() { return false; }); $(this).hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); }); $(this).click($(this).ClickItem); $(this).SetHeight(); },
            Scroll: function() { if (($(this).ListItems("selected").length > 0) && ($(this).ListItems().index($(this).ListItems("selected:first").get(0)) > 11)) { $(this).ListHolder().scrollTo($(this).ListItems("selected")); } else { $(this).ListHolder().scrollTo(0); } },
            MoveLabelItem: function() { $(this).TextHolder().text($(this).text()); $(this).prev("dt").remove(); $(this).remove(); },
            SelectFirstItem: function() { $(this).children("dd:first").SetSelected(); },
            SetLoadStatus: function() { $(this).addClass("list-box-loading"); if ($(this).children("span").html() == "") { $(this).children("span").html("&#160;"); } return $(this); },
            RemoveLoadStatus: function() { $(this).removeClass("list-box-loading"); }
        });
        InitListBoxes = function(o) {
            o.find("div.list-box").each(function(i) {
                $(this).children("span").mousedown(function() { return false; }).click(function() { $(this).parent("div").trigger("click"); return false; });
                $(this).hover(function() { $(this).addClass("list-box-hover"); }, function() { $(this).removeClass("list-box-hover"); });
                $(this).click(function() { if (Status == "processing") { return; } else if (($(this).ListHolder().is(":visible")) && (Status == "open")) { $(this).Close(); return; } $(this).Open(); $(this).Scroll(); });
                //$(this).focus(function(){if(Status=="processing"){return;}else if(($(this).ListHolder().is(":visible"))&&(Status=="open")){$(this).Close();return;}$(this).Open();$(this).Scroll();});
                $(this).ListItems().InitEvents();
                if ($(this).ListItems("label").length > 0) { $(this).ListItems("label").MoveLabelItem(); if ($(this).ListItems("selected").length > 0) { $(this).ListItems("selected").SetSelected(); } } else if ($(this).ListItems("selected").length > 0) { $(this).ListItems("selected").SetSelected(); } else { $(this).ListItems().eq(0).SetSelected(); }
            });
        }
        $(document).click(function() { if (Status == "open" && ActiveListBox != null) { ActiveListBox.Close(); } });
        var nCurrPos = 0;
        $(document).keydown(function(event) {
            if ((Status == "open") && (typeof (ActiveListBox) != "undefined")) {
                arrList = ActiveListBox.find("dd");
                oSelected = arrList.filter(".selected:first");
                if (event.keyCode == 9 || event.keyCode == 13) { oSelected.trigger("click"); ActiveListBox.Close(); return (true); }
                else if (event.keyCode == 40) {
                    o = (oSelected.length > 0) ? oSelected : null;
                    if (o != null) { o.removeClass("selected"); o.nextAll("dd:first").addClass("selected"); }
                    else { arrList.eq(0).addClass("selected"); }
                    ActiveListBox.Scroll();
                    return (false);
                } else if (event.keyCode == 38) {
                    o = (oSelected.length > 0) ? oSelected : null;
                    if (o != null) { o.removeClass("selected"); o.prevAll("dd:first").addClass("selected"); }
                    else { arrList.filter(":last").addClass("selected"); }
                    ActiveListBox.Scroll();
                    return (false);
                } else {
                    s = "";
                    if (event.keyCode >= 65 && event.keyCode <= 90) { n = (event.keyCode - 65); s = oTUIStrings.sLetters.substring(n, (n + 1)); }
                    else if (event.keyCode >= 48 && event.keyCode <= 57) { s = (event.keyCode - 48).toString(); }
                    else if (event.keyCode >= 96 && event.keyCode <= 105) { s = (event.keyCode - 96).toString(); }
                    else {
                        switch (event.keyCode) {
                            case 192: s = oTUIStrings.arrCharacters[2]; break;
                            case 221: s = oTUIStrings.arrCharacters[0]; break;
                            case 222: s = oTUIStrings.arrCharacters[1]; break;
                        }
                    } if (s == "") { return (false); }
                    sFirstLetter = (oSelected.length > 0) ? oSelected.text().substring(0, 1) : "";
                    nCurrPos = (sFirstLetter.toLowerCase() == s.toLowerCase()) ? (nCurrPos + 1) : 0;
                    arrList.removeClass("selected");
                    o = arrList.filter(function(nPos) { return ($(this).text().substring(0, 1).toLowerCase() == s && nPos >= nCurrPos); }).eq(0);
                    nCurrPos = arrList.index(o);
                    o.addClass("selected");
                    ActiveListBox.Scroll();
                    return (false);
                }
            }
        });

        var $pageCombinations = $('div.page-combinations');
        
        $pageCombinations.find("div.hotel-description a.about, #combination-periods a.about").click
        (
            function(e) {
                var 
                    iframe = String.format("<img src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/Layout/HotelItem/icon-load-66x66{0}.gif\" class=\"icon-load\" /><iframe scrolling='auto' frameborder='0' src='{1}HotelAbout.aspx{2}&period={3}&remote=true'></iframe>", temaStr, oBaseAjaxUrls.BookingSite, oTUIWebSession.UrlPart, this.periodIndex),
                    dialogControl = TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog({ 'innerHtmlTop': this.hotelName, 'innerHtmlCenter': iframe, 'isDraggable': true, 'showOverlay': true }, 'dialog-hotel-description');

                dialogControl.show();
            }
        );

        $pageCombinations.find('div.hotel-description a.remove, #combination-periods a.remove').click
        (
            function(e) {
                var nCurrentPeriodIndex = $pageCombinations.find('div.hotel-description a.remove, #combination-periods a.remove').filter(":visible").length,
                    nPeriodIndex = Number(this.periodIndex);
                if ((nCurrentPeriodIndex - 1) <= nPeriodIndex) { document.location.href = String.format("{0}SearchResult.aspx{1}&period={2}", oBaseAjaxUrls.BookingSite, oTUIWebSession.UrlPart, nPeriodIndex); return; }
                var 
                    html = String.format("<p>{0}</p><p>{1}</p><p class=\"button-holder\"><a href=\"javascript:void(0)\" class=\"dialog-change-hotel-cancel\"><img src=\"{2}/Images/Buttons/{3}/cancel.gif\" /></a><a href=\"javascript:void(0)\" class=\"dialog-change-hotel-ok\"><img src=\"/{2}/Images/Buttons/{3}/change-hotel.gif\" /></a></p>", this.resQuestion, this.resWarning, oBaseAppSettings.IncludeSiteDirectory, oBaseAppSettings.BrandID),
                    dialogControl = TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog({ 'innerHtmlTop': $(this).text(), 'innerHtmlCenter': html, 'showOverlay': true }, 'dialog-change-hotel');

                $(dialogControl.get_element()).find('a.dialog-change-hotel-ok').click(function(e) {
                    $(this).parents("div.dialog-center-inner:first").html(String.format("<img src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/Layout/HotelItem/icon-load-66x66{0}.gif\" class=\"icon-load\" />", temaStr));
                    document.location.href = String.format("{0}SearchResult.aspx{1}&period={2}", oBaseAjaxUrls.BookingSite, oTUIWebSession.UrlPart, nPeriodIndex);
                });
                $(dialogControl.get_element()).find('a.dialog-change-hotel-cancel').click(function(e) {
                    dialogControl.hide();
                });

                dialogControl.show();
            }
        );

        $pageCombinations.find('a.price-spec-details').click
        (
            function(e) {
                var 
                    urlPriceSpecHandler = String.format("{0}PriceSpecCombi.aspx{1}", oBaseAjaxUrls.DynamicContent, oTUIWebSession.UrlPart),
                    dialogControl = TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog({ 'innerHtmlTop': oTUIStrings.sPriceSpecificationTitle, 'dynamicServiceFullPath': urlPriceSpecHandler, 'showOverlay': true }, 'dialog-price-specification');

                dialogControl.show();
            }
        );

        $("div.secure-page a.price-spec-details").click
        (
            function() {
                if (this.isCombination == "true") {
                    s = oBaseAjaxUrls.DynamicContent + "PriceSpecCombi.aspx" + oTUIWebSession.UrlPart;
                }
                else {
                    s = oBaseAjaxUrls.DynamicContent + "PriceSpec.aspx" + oTUIWebSession.UrlPart;
                }
                //displayDialog(this, oTUIStrings.sPriceSpecificationTitle, s, 670);
                dialogControl = TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog({ 'innerHtmlTop': oTUIStrings.sPriceSpecificationTitle, 'dynamicServiceFullPath': s, 'showOverlay': true }, 'dialog-price-specification');
                dialogControl.show();
            }
        );
    }
);
addDays=function(yyyy,mm,dd,n){mm=parseInt(mm,10)-1;d=new Date();d.setFullYear(yyyy,mm,dd);d.setDate(d.getDate()+n);return d;}
killDefault=function(e){e.returnValue=false;if(e.preventDefault)e.preventDefault();}

String.prototype.appendSessionID=function(){
    sURI=oBaseAppSettings.SessionParameterName+"="
    if((this.indexOf("?"+sURI)!=-1)||(this.indexOf("&"+sURI)!=-1)||(this.indexOf(" ")!=-1)){return(this);}
    sURI=(this.indexOf("?")==-1)?"?"+sURI:"&"+sURI;
    return((oTUIWebSession.ID!="")?this+sURI+oTUIWebSession.ID:this);
};

String.prototype.trim=function(){
    var objRegExp=/^(\s*)$/,strValue=this;
    if(objRegExp.test(strValue)){
        strValue=strValue.replace(objRegExp, '');
        if(strValue.length==0){return(strValue)}
    }
    objRegExp=/^(\s*)([\W\w]*)(\b\s*$)/;
    if(objRegExp.test(strValue)){strValue=strValue.replace(objRegExp,'$2');}
    return(strValue);
};

EventTracker=function(){
    this.Category="";
    this.Action="";
    this.Label="";
    this.SendEvent=function(){
        try{
            _gaq.push(['_trackEvent', this.Category, this.Action, this.Label]);
        }catch(err){}
    };
}
oEventTracker=new EventTracker();

var 
    globalCommonHelpPopupDialogElement,
    globalCommonHelpPopupDialogControl;
    
// TODO: The 'TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog' function uses a better pattern than 'registerHelpTextPopupHandlers' and 'displayDialog' - consider major refactoring
function registerHelpTextPopupHandlers(container)
{
    $(container ? container : document).find('a.help-text-popup,img.help-text-popup').click
    (
        function (e)
        {
            e.stopPropagation();
            
            var
                $this = $(this),
                helpSection = $this.attr('rel').split("|")[0],
                helpPage = $this.attr('rel').split("|")[1],
                targetControlCssClass = $this.attr('class').replace("help-text-popup", "");
            
            if (globalCommonHelpPopupDialogControl != null)
            {
                if (globalCommonHelpPopupDialogControl.get_targetControl() == this)
                {
                    return; // A dialog is already attached to the help link - let it take care of hiding and showing or whatever
                }
                else
                {
                    Sys.Application.removeComponent(globalCommonHelpPopupDialogControl);
                    $(globalCommonHelpPopupDialogElement).remove();
                }
            }
            
            globalCommonHelpPopupDialogElement = $("<div id='help-text-dialog'></div>").appendTo($(this).parent()).get(0);
            globalCommonHelpPopupDialogControl = new TUI.Web.UI.WebControls.Dialog(globalCommonHelpPopupDialogElement);
            
            if (targetControlCssClass != null && targetControlCssClass != "")
            {
                $(globalCommonHelpPopupDialogElement).addClass(targetControlCssClass);
            }

            globalCommonHelpPopupDialogControl.beginUpdate();
            globalCommonHelpPopupDialogControl.set_innerHtmlTop(this.title);
            globalCommonHelpPopupDialogControl.set_dynamicServiceFullPath(oBaseAjaxUrls.DynamicContent + 'GetEPiHelpPage.aspx?helpSection=' + helpSection + '&helpPage=' + helpPage);
            globalCommonHelpPopupDialogControl.set_isDraggable(true);
            globalCommonHelpPopupDialogControl.set_targetControl(this);
            globalCommonHelpPopupDialogControl.set_dialogPosition(TUI.Web.UI.WebControls.DialogPosition.nearTargetInsideClient);
            globalCommonHelpPopupDialogControl.endUpdate();
            
            globalCommonHelpPopupDialogControl.show();
            
            Sys.Application.addComponent(globalCommonHelpPopupDialogControl);
            return(false);
        }
    );
    $("a.help-text-dialog").unbind("click").bind("click", function(e){
        e.stopPropagation();
        displayDialog(this, this.title, oBaseAjaxUrls.DynamicContent + "GetEPiHelpPage.aspx?helpSection="+this.rel.split("|")[0]+"&helpPage="+this.rel.split("|")[1]);
        return(false);
    });
}

// TODO: The 'TUI.Web.UI.WebControls.Dialog.createNewGlobalDialog' function uses a better pattern than 'registerHelpTextPopupHandlers' and 'displayDialog' - consider major refactoring
function displayDialog(oTriggeringElement, sTitle, sUrl, nWidth, sClass, sCallBack)
{
    if (globalCommonHelpPopupDialogControl != null) {
        if (globalCommonHelpPopupDialogControl.get_targetControl() == oTriggeringElement) {
            //return; // A dialog is already attached to the help link - let it take care of hiding and showing or whatever
        }
        else {
            //Sys.Application.removeComponent(globalCommonHelpPopupDialogControl);
            //$(globalCommonHelpPopupDialogElement).remove();
        }
        Sys.Application.removeComponent(globalCommonHelpPopupDialogControl);
        $(globalCommonHelpPopupDialogElement).remove();
    }else{
        //globalCommonHelpPopupDialogElement = $("<div id='help-text-dialog'></div>").appendTo("body").get(0);
        //globalCommonHelpPopupDialogControl = new TUI.Web.UI.WebControls.Dialog(globalCommonHelpPopupDialogElement);
        //Sys.Application.addComponent(globalCommonHelpPopupDialogControl);
    }
    globalCommonHelpPopupDialogElement = $("<div id='help-text-dialog'></div>").appendTo("body").get(0);
    globalCommonHelpPopupDialogControl = new TUI.Web.UI.WebControls.Dialog(globalCommonHelpPopupDialogElement);
    Sys.Application.addComponent(globalCommonHelpPopupDialogControl);
    globalCommonHelpPopupDialogControl.beginUpdate();
    globalCommonHelpPopupDialogControl.set_innerHtmlTop(sTitle);
    if(sUrl){globalCommonHelpPopupDialogControl.set_dynamicServiceFullPath(sUrl);}
    globalCommonHelpPopupDialogControl.set_isDraggable(true);
    globalCommonHelpPopupDialogControl.set_targetControl(oTriggeringElement);
    globalCommonHelpPopupDialogControl.set_dialogPosition(TUI.Web.UI.WebControls.DialogPosition.custom);
    if (sCallBack) { globalCommonHelpPopupDialogControl.set_callBackFunction(sCallBack); }
    globalCommonHelpPopupDialogControl.endUpdate();
    
    if(nWidth){
        $(globalCommonHelpPopupDialogElement).addClass((sClass)?sClass:"").css("width","auto").find("div.dialog-center-inner").css("width",nWidth.toString()+"px");
        $(globalCommonHelpPopupDialogElement).find("div.dialog-top-inner, div.dialog-bottom-inner").css("width",(nWidth-18).toString()+"px");
    }
    globalCommonHelpPopupDialogControl.show();
    
    return $(globalCommonHelpPopupDialogElement).css({left:($(oTriggeringElement).offset().left-400)+"px",top:($(oTriggeringElement).offset().top+20)+"px",background:"none"});
}

function displayDraggable(triggeringElement, width)
{
    var
        $triggeringElement = $(triggeringElement),
        $targetDraggable = $("div#draggable");
    width=(width)?width:500;
    //width=(width>500)?666:500;
    if(width>800){width=900;$targetDraggable.addClass("popup-900");}
    else if(width>500){width=666;$targetDraggable.addClass("popup-666");}
    else{$targetDraggable.removeClass("popup-666").removeClass("popup-900");}
    $targetDraggable.find("div.ui-content:first").html("<img class=\"icon-load\" src=\"" + oBaseAppSettings.IncludeSiteDirectory + "/Images/Layout/HotelItem/icon-load-66x66" + temaStr + ".gif\"/>");
    nPosLeft=($triggeringElement.offset().left-(width-300));if(nPosLeft<50){nPosLeft=50;}
    if($triggeringElement.parents("div#content-start:first").length>0){$targetDraggable.css({width:width,top:"465px",left:(($(document).width()/2)-250)+"px"});}
    else{$targetDraggable.css({width:width,top:($triggeringElement.offset().top-100)+"px",left:nPosLeft+"px"});}
    if($.browser.msie&&$.browser.version<7){$("select").hide();}
    if(!$targetDraggable.hasClass("ui-draggable")){
        if($.browser.msie&&$.browser.version<8){$targetDraggable.draggable({handle:'div.ui-handle',cursor:'move'}).show();}else{$targetDraggable.draggable({handle:'div.ui-handle',cursor:'move',opacity:0.5}).show();}
        $targetDraggable.find("div.ui-handle a").click(function(){$targetDraggable.hide().removeAttr("style").find("div.ui-content:first").removeClass("no-padding").removeAttr("style");});
    }else{$targetDraggable.show();}
    return $targetDraggable;
}

formatNumber=function(n){
    if(isNaN(n)){return("0");}
    s=n.toString();nStart = s.indexOf(" ");
	if(nStart<0){nStart=s.length;}nStart-=3;
	while(nStart>= 1){s=s.substring(0,nStart)+" "+s.substring(nStart,s.length);nStart-=3;}
	return((s.indexOf(oTUIStrings.sCurrencySign)!=-1)?s:s+oTUIStrings.sCurrencySign);
}

//Calendar
var oDate=new Date();
TUICalendar = function() {
    jQuery.fn.extend({ Display: function(o) { var temaStr = (oFormHelper.Type == "TEMA") ? "-tema" : ""; oTUICalendar.WeekHolder.html("<img src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/Layout/HotelItem/icon-load-66x66" + temaStr + ".gif\" />"); oTUICalendar.CalendarObject.css({ top: o.offset().top + 17, left: o.offset().left - 113 }); oTUICalendar.CalendarObject.show(); } });
    Number.prototype.toDatePartString = function() { return (this < 10) ? "0" + this.toString() : this.toString(); };
    this.Init = function() { this.CalendarObject = $("div#calendar"); this.WeekHolder = this.CalendarObject.find("div.content div.week-holder:first"); this.InfoTextHolder = this.CalendarObject.find("div.content span.info:first"); this.MonthList = this.CalendarObject.find("div.head div#month-list"); /*this.CalendarObject.draggable({handle:'div.head',cursor:'move'});*/this.CalendarObject.find("div.head a.close").click(function() { oTUICalendar.Close(); }); this.CalendarObject.find("div.head a.prev").click(function() { oTUICalendar.SelectPrevMonth(); }); this.CalendarObject.find("div.head a.next").click(function() { oTUICalendar.SelectNextMonth(); }); }
    this.InitWeekEvents = function() { this.WeekHolder.find("li a").click(function() { oTUICalendar.Day = parseInt($(this).text(), 10); oTUICalendar.SetInputDate(); if (typeof (SetReturnDate) == "function" && oTUICalendar.DateHolder != null && oTUICalendar.DateHolder.hasClass("departure-date")) { SetReturnDate(); } oTUICalendar.Close(); }); };
    this.CalendarObject = null;
    this.WeekHolder = null;
    this.InfoTextHolder = null;
    this.MonthList = null;
    this.MonthListIndex = 0;
    this.UpdateMonthListIndex = function() { this.MonthListIndex = this.MonthList.ListItems().index(this.MonthList.ListItems("selected").get(0)); };
    this.DateHolder = null;
    this.Year = oDate.getFullYear();
    this.Month = (oDate.getMonth() + 1);
    this.ActiveMonth = this.Month;
    this.FirstActiveMonth = null;
    this.Day = oDate.getDate();
    this.SetDate = function() { this.Year = this.DateHolder.children("span.year").text(); this.Month = parseInt(this.DateHolder.children("span.month").text(), 10); this.Day = parseInt(this.DateHolder.children("span.day").text(), 10); this.UpdateMonthListIndex(); };
    this.GetDateString = function() { return this.Year.toString() + "-" + this.Month.toDatePartString() + "-" + this.Day.toDatePartString(); };
    this.SetInputDate = function() { this.DateHolder.children("span.year").text(this.Year.toString()); this.DateHolder.children("span.month").text(this.Month.toDatePartString()); this.DateHolder.children("span.day").text(this.Day.toDatePartString()); };
    this.HotelIdUrlPart = function() { return ($("input#enokhotelid").length > 0) ? "&hotelid=" + $("input#enokhotelid").val() : ""; };
    this.LoadMonthList = function() { sDestCode = ((oFormHelper.GetResortCodeCRS() != "") ? oFormHelper.GetResortCodeCRS() : oFormHelper.GetDestinationCodeCRS()); s = oBaseAjaxUrls.DynamicContent + "Calendar.aspx?year=" + this.Year.toString() + "&month=" + this.Month.toString() + "&mode=months&depcode=" + oFormHelper.GetDepartureCodeCRS() + "&destcode=" + sDestCode + "&type=" + oFormHelper.Type + this.HotelIdUrlPart(); this.MonthList.ListHolder().load(s, function() { oTUICalendar.MonthList.RemoveLoadStatus(); oTUICalendar.MonthList.ListItems().InitEvents(); oSelectedMonth = oTUICalendar.MonthList.ListItems("selected:first"); oFirstActiveMonth = oTUICalendar.MonthList.ListItems().filter(function() { return (!$(this).hasClass("disabled")); }).eq(0); if (oFirstActiveMonth.length == 0) { oFirstActiveMonth = oTUICalendar.MonthList.ListItems().eq(0).addClass("selected"); } oTUICalendar.FirstActiveMonth = oFirstActiveMonth.prev("dt:first").text().split(",")[0]; if (oSelectedMonth.length == 0) { oFirstActiveMonth.SetSelected(); oFirstActiveMonth.Call(); } else { oSelectedMonth.SetSelected(); oSelectedMonth.Call(); }; registerHelpTextPopupHandlers($(this)); }); return this.MonthList; };
    this.SelectMonth = function(s) { a = s.split(","); this.Year = parseInt(a[1], 10); this.Month = parseInt(a[0], 10); /*this.SetInputDate();*/this.LoadWeeks(); this.UpdateMonthListIndex(); };
    this.SelectNextMonth = function() {
        oDD = this.MonthList.find("dd.selected:first").nextAll("dd:first");
        if (oDD.length == 0) { return; }
        oDD.SetSelected();
        a = oDD.prev("dt").text().split(",");
        this.Year = parseInt(a[1], 10); this.Month = parseInt(a[0], 10); this.LoadWeeks(); this.UpdateMonthListIndex();
    };
    this.SelectPrevMonth = function() {
        oDD = this.MonthList.find("dd.selected:first").prevAll("dd:first");
        if (oDD.length == 0) { return; }
        oDD.SetSelected();
        a = oDD.prev("dt").text().split(",");
        this.Year = parseInt(a[1], 10); this.Month = parseInt(a[0], 10); this.LoadWeeks(); this.UpdateMonthListIndex();
    };
    this.LoadWeeks = function() {
        sDestCode = ((oFormHelper.GetResortCodeCRS() != "") ? oFormHelper.GetResortCodeCRS() : oFormHelper.GetDestinationCodeCRS());
        this.WeekHolder.load(oBaseAjaxUrls.DynamicContent + "Calendar.aspx?year=" + this.Year.toString()
            + "&month=" + this.Month.toString()
            + "&day=" + this.Day.toString() + "&depcode=" + oFormHelper.GetDepartureCodeCRS()
            + "&destcode=" + sDestCode
            + "&selmonth=" + this.Month.toString()
            + "&selday=" + this.Day.toString()
            + "&type=" + oFormHelper.Type
            + ((this.DateHolder.hasClass("return-date")) ? "&depdate=" + oFormHelper.DepartureDate() : "")
            + "&icon=true" + this.HotelIdUrlPart(),
    	function() {
    	    oTUICalendar.InitWeekEvents();
    	    oTUICalendar.UpdateMonthListIndex();
    	    if (oTUICalendar.WeekHolder.find("a").length == 0) { oTUICalendar.SetStatusText(oTUIStrings.sCalendarMonthNoDepartures); } else {
    	        if (parseInt(oTUICalendar.FirstActiveMonth) == oTUICalendar.Month) { oTUICalendar.SetStatusText(oTUIStrings.sCalendarEarliestDepartureDate + ": " + oTUICalendar.WeekHolder.find("a:first").text() + "/" + oTUICalendar.Month.toString()); } else { oTUICalendar.SetStatusText(""); }
    	    }
    	});
    };
    this.Open = function(o) {
        CalendarStatus = "ready"; setTimeout("CalendarStatus=\"open\";", 100);
        this.DateHolder = o.prevAll("span.calendar-dates:first");
        this.SetDate();
        if ($.browser.msie && $.browser.version < 7) { this.AllSelectLists.hide(); }
        this.CalendarObject.Display(o);
        this.LoadMonthList().SetLoadStatus();
    };
    this.Close = function() { this.CalendarObject.hide(); if ($.browser.msie && $.browser.version < 7) { this.AllSelectLists.show(); } };
    this.SetStatusText = function(s) { if (s == "") { s = "&#160;"; } this.InfoTextHolder.html(s); };
    this.AllSelectLists = null;
}
var oTUICalendar = new TUICalendar();
//
CallBacks.push("charter-departure|departureClick");
CallBacks.push("charter-departure-ow|departureOWClick");
CallBacks.push("charter-destination|destinationClick");
CallBacks.push("charter-destination-ow|destinationOWClick");
CallBacks.push("charter-resort|resortClick");
CallBacks.push("no-of-rooms|addRoomAllocationContainer");
CallBacks.push("period|periodClick");
CallBacks.push("adults1|adultsClick1");
CallBacks.push("adults2|adultsClick2");
CallBacks.push("adults3|adultsClick3");
CallBacks.push("children1|childrenClick1");
CallBacks.push("children2|childrenClick2");
CallBacks.push("children3|childrenClick3");
var oFormHelper = null;
var setDestinationSelected = false;
var typeForCurrentPeriodCall = "CHARTER";
$(document).ready(
    function() {
        InitPage = function() {
            jQuery.fn.extend({ toggle2: function() { if ($(this).is(":visible")) { $(this).css("display", "none"); } else { $(this).css("display", "block"); } } });
            RoomHelper = function(o) {
                this.Container = o.children("div.no-of-rooms-holder:first");
                this.Template = this.Container.find("div.room-allocation:first");
                this.AllocationContainer = function(s) { return this.Container.find("div.room-allocation" + ((s != null) ? s : "")); };
            }
            oRoomHelper = new RoomHelper($("div.bp-content:first"));
            ListHelper = function() {
                this.PageContainer = $("div.page-container");
                this.StartPageContainer = $("div#search-form");
                this.BookingPanelContainer = this.StartPageContainer;
                this.CharterContainer = this.StartPageContainer.find("div#charter");
                this.CharterToggleChoices = this.StartPageContainer.find("span.toggle");
                this.DepartureContainer = this.BookingPanelContainer.find("div#charter-departure");
                this.DepartureList = this.DepartureContainer.children("dl:first");
                this.DepartureContainerOW = this.BookingPanelContainer.find("div#charter-departure-ow");
                this.DepartureListOW = this.DepartureContainerOW.children("dl:first");
                this.DestinationContainer = this.BookingPanelContainer.find("div#charter-destination");
                this.DestinationList = this.DestinationContainer.children("dl:first");
                this.DestinationContainerOW = this.BookingPanelContainer.find("div#charter-destination-ow");
                this.DestinationListOW = this.DestinationContainerOW.children("dl:first");
                this.ResortContainer = this.BookingPanelContainer.find("div#charter-resort");
                this.ResortList = this.ResortContainer.children("dl:first");
                this.PeriodContainer = this.BookingPanelContainer.find("div#period");
                this.PeriodList = this.PeriodContainer.children("dl:first");
                this.NumberOfRoomList = this.BookingPanelContainer.find("div#no-of-rooms");
                this.AdultsList = this.BookingPanelContainer.find("div#adults1,div#adults2,div#adults3");
                this.ChildrenList = this.BookingPanelContainer.find("div#children1,div#children2,div#children3");
                this.ChildrenAgesHolder = this.BookingPanelContainer.find("div.children-ages");
                this.DepartureDateHolder = this.BookingPanelContainer.find("span.departure-date");
                this.ReturnDateHolder = this.BookingPanelContainer.find("span.return-date");
                this.HotelCodeHolder = this.BookingPanelContainer.find("input#hotel-code");
                this.BookingCodeHolder = this.BookingPanelContainer.find("input#booking-code");
            }
            oListHelper = new ListHelper();
            Validator = function() {
                this.TotalPax = oRoomHelper.AllocationContainer(":eq(2)").find("span.pax-overflow-error");
                this.ValidateTotalPax = function() { n = 0; oListHelper.AdultsList.children("input").each(function() { n += parseInt($(this).val()); }); oListHelper.ChildrenList.children("input").each(function() { n += parseInt($(this).val()); }); if (n > 15) { this.TotalPax.css("display", "block"); return (false); } else { this.TotalPax.css("display", "none"); return (true); } };
                this.ChildrenAges = function(arr) { return (arr.parents("div.room-allocation").find("span.children-ages-error")); };
                this.ValidateChildrenAges = function() {
                    arrIncorrectInputs = oListHelper.ChildrenAgesHolder.filter(function() { return ($(this).is(":visible")); }).find("span:visible input").filter(function() { return ($(this).val().length == 0); });
                    oListHelper.ChildrenAgesHolder.find("span input").css("border", "1px solid #999");
                    arrIncorrectInputs.css("border", "1px solid #EF0000");
                    this.ChildrenAges(oListHelper.ChildrenAgesHolder).css("display", "none");
                    this.ChildrenAges(arrIncorrectInputs).css("display", (arrIncorrectInputs.length > 0) ? "block" : "none");
                    return (arrIncorrectInputs.length == 0);
                };
                this.Period = oListHelper.CharterContainer.find("span.period-error");
                this.ValidatePeriod = function() {
                    s = oListHelper.PeriodContainer.children("span").text();
                    b = oListHelper.PeriodList.children("dd").filter(function() { return ($(this).text() == s); }).hasClass("disabled");
                    if (b) { oListHelper.PeriodContainer.css("border", "1px solid #EF0000"); this.Period.css("display", "block"); }
                    else { this.ResetPeriod(); }
                    return (!b);
                };
                this.ResetPeriod = function() { oListHelper.PeriodContainer.css("border", "1px solid #999"); this.Period.css("display", "none"); };
                this.CharterDestination = oListHelper.CharterContainer.find("span.charter-destination-error");
                this.ResetCharterDestination = function() { oListHelper.DestinationContainer.css("border", "1px solid #999"); this.CharterDestination.css("display", "none"); };
                this.ValidateCharterDestination = function() {
                    s = $.trim(oFormHelper.GetDestinationCodeCRS());
                    b = (s.length == 0) ? false : (s.substring(s.length - 1) == "d");
                    if (!b) { oListHelper.DestinationContainer.css("border", "1px solid #EF0000"); this.CharterDestination.css("display", "block"); }
                    else { this.ResetCharterDestination(); }
                    return (b);
                };
                this.Validate = function() {
                    b1 = this.ValidateChildrenAges();
                    b2 = ((oFormHelper.Type == "TEMA") || (oFormHelper.Type == "FLEX_HTL") || (oFormHelper.Type == "CHARTER_FLT" && oFormHelper.OneWay == "1")) ? true : this.ValidatePeriod();
                    b3 = (oFormHelper.Type == "COMBINATION") ? this.ValidateCharterDestination() : true;
                    return (b1 && b2 && b3);
                };
            }
            oValidator = new Validator();
            InitListBoxes(oListHelper.CharterContainer);
            Array.prototype.trim = function() { s = ""; for (i = 0; i < this.length; i++) { s += (this[i] != "" && this[i] != ";") ? ((i > 0) ? "|" + this[i] : this[i]) : ""; } return s; }
            FormHelper = function() {
                if ($("input#isBookableOnline").val()) {
                    if (oListHelper.DepartureContainer.length === 0 || $("input#isBookableOnline").val().toLowerCase() != "true") {
                        $("#search-form h3").text(oTUIStrings.sEnokNotBookableOnlineHeader);
                        return;
                    }
                }
                else {
                    if (oListHelper.DepartureContainer.length === 0) {
                        $("#search-form h3").text(oTUIStrings.sEnokNotBookableOnlineHeader);
                        return;
                    }
                }
                this.Status = "Ready";
                this.TabIndex = "1";
                this.HotelIdUrlPart = function() { return ($("input#enokhotelid").length > 0) ? "&hotelid=" + $("input#enokhotelid").val() : ""; };
                this.Type = "CHARTER";
                this.SetType = function() {
                    switch (this.TabIndex) {
                        case "1":
                            if (oBaseAppSettings.IsTemaSite)
                                this.Type = "TEMA";
                            else if (oListHelper.BookingPanelContainer.find("span.choice:visible input:visible:checked").length != 0)
                                this.Type = oListHelper.BookingPanelContainer.find("span.choice:visible input:visible:checked").val();
                            else
                                this.Type = "CHARTER";
                            break;
                        case "2": this.Type = "CHARTER_FLT";
                            break;
                        case "3": this.Type = "FLEX_HTL";
                            break;
                    }
                };
                this.OneWay = ($("span.sub-choice input:checked").length == 0) ? "0" : $("span.sub-choice input:checked").val();
                this.SetOneWay = function(o) { this.OneWay = o.val(); this.SetDepartureCodes((o.val() == "1") ? oListHelper.DepartureContainerOW : oListHelper.DepartureContainer); this.SetDestinationCodes((o.val() == "1") ? oListHelper.DestinationContainerOW : oListHelper.DestinationContainer); };
                this.DepartureCodes = oListHelper.DepartureContainer.children("input:first").val().split("|");
                this.DestinationCodes = oListHelper.DestinationContainer.children("input:first").val().split("|");
                this.ResortCodes = oListHelper.ResortContainer.children("input:first").val().split("|");
                this.SetDepartureCodes = function(o) { this.DepartureCodes = o.children("input:first").val().split("|"); };
                this.SetDestinationCodes = function(o) { this.ResortCodes = [""]; this.DestinationCodes = o.children("input:first").val().split("|"); };
                this.SetResortCodes = function() { this.ResortCodes = oListHelper.ResortContainer.children("input:first").val().split("|"); };
                this.GetDepartureCodeOWCRS = function() { s = this.DepartureCodes[0].replace(/CRS-/gi, ""); return ((s == "0") ? "" : s); };
                this.GetDepartureCodeCRS = function() { if (this.OneWay.toString() == "1" && this.DepartureCodes[1].substring(0, 1) == "d") { return this.GetDepartureCodeOWCRS(); } s = this.DepartureCodes[1].substring(2); return ((s == "0") ? "" : s); };
                this.GetDestinationCodeCRS = function() { s = this.DestinationCodes[0].replace(/CRS-/gi, ""); return ((s == "0") ? "" : s); };
                this.GetResortCodeCRS = function() { s = this.ResortCodes[0].replace(/CRS-/gi, ""); return ((s == "0") ? "" : s); };
                this.Period = oListHelper.PeriodContainer.children("input:first").val();
                //this.GetPeriod=function(){if(typeof(oSearchParams.period)!="undefined"&&oSearchParams.period!=null&&oSearchParams.period!="") return oSearchParams.period;return this.Period;}
                this.DepartureDate = function() { return oListHelper.DepartureDateHolder.children("span.year").text() + "-" + oListHelper.DepartureDateHolder.children("span.month").text() + "-" + oListHelper.DepartureDateHolder.children("span.day").text(); };
                this.ReturnDate = function() { return oListHelper.ReturnDateHolder.children("span.year").text() + "-" + oListHelper.ReturnDateHolder.children("span.month").text() + "-" + oListHelper.ReturnDateHolder.children("span.day").text(); };
                this.Pax = [";", ";", ";"];
                this.SetPax = function() {
                    oListHelper.ChildrenAgesHolder.each(function(i) {
                        a = ["", ""]; if ($(this).parent("div.room-allocation").is(":visible")) { a[0] = oListHelper.AdultsList.eq(i).children("input:first").val(); }
                        if ($(this).is(":visible")) { $(this).find("span:visible input").each(function(j) { a[1] += (j > 0) ? "," + $(this).val() : $(this).val(); }); }
                        oFormHelper.Pax[i] = a.join(";");
                    });
                };
                this.GetLmsCode = function() { if (typeof (oSearchParams) != "undefined" && oSearchParams != null && typeof (oSearchParams.lmscode) != "undefined" && oSearchParams.lmscode != null) return oSearchParams.lmscode; return ""; }
                this.GetSource = function() { if (typeof (oSearchParams) != "undefined" && oSearchParams != null && typeof (oSearchParams.source) != "undefined" && oSearchParams.source != null) return oSearchParams.source; return ""; }
                this.GetHotelCodeCrs = function() { if (typeof (oSearchParams) != "undefined" && oSearchParams != null && typeof (oSearchParams.hotel) != "undefined" && oSearchParams.hotel != null) return oSearchParams.hotel; return ""; }
                this.GetHotelCode = function() { var hotelParams = ""; if (typeof (oSearchParams) != "undefined" && oSearchParams != null) { var webcode = oListHelper.HotelCodeHolder.val(); if (webcode != "") { hotelParams = webcode; } else if (typeof (oSearchParams.hotelcode) != "undefined" && oSearchParams.hotelcode != null) { hotelParams = oSearchParams.hotelcode; } } return hotelParams; }
                this.GetBookingCode = function() { return oListHelper.BookingCodeHolder.val(); };
                this.GetQuerystringParam = function(k, v, d) { return v != "" ? "&" + k + "=" + v : ""; }
            }
            oFormHelper = new FormHelper();
            if (oFormHelper.Status !== "Ready") { return; }
            if (oListHelper.StartPageContainer.hasClass("bp-tab2")) { oFormHelper.TabIndex = "2"; }
            else if (oListHelper.StartPageContainer.hasClass("bp-tab3")) { oFormHelper.TabIndex = "3"; }
            oFormHelper.SetType();
            $("a.search-button").click(function() { performSearch(); return; });
            jQuery.fn.extend({
                ResetPeriodList: function() {
                    if ($(this).children("dt").filter(function() { return ($(this).text() == oListHelper.PeriodContainer.children("input:hidden").val()); }).length == 0) {
                        $(this).children("dd.selected:first").trigger("click");
                    }
                }
            });
            LoadPanel = function() {
                s = oFormHelper.Type;
                if (s == "COMBINATION") { oListHelper.BookingPanelContainer.addClass("bp-combinations"); }
                else { oListHelper.BookingPanelContainer.removeClass("bp-combinations"); }
                oListHelper.ResortContainer.hide();
                oListHelper.DepartureContainer.SetLoadStatus(); oListHelper.DestinationContainer.SetLoadStatus();
                if (s == "FLEX_HTL") {
                    oListHelper.DestinationList.load(oBaseAjaxUrls.DynamicContent + "Destinations/GetDestinations.aspx?code=f_&type=" + s, function() {
                        oListHelper.DestinationContainer.RemoveLoadStatus();
                        oListHelper.DestinationContainer.ListItems().InitEvents();
                        oListHelper.DestinationContainer.ListItems().eq(0).ClickItem();
                    });
                }
                else {
                    oListHelper.DepartureList.load(oBaseAjaxUrls.DynamicContent + "Destinations/GetDestinations.aspx?code=b_&type=" + s + "&hotelcode=" + getEnokHotelId(), function() {
                        oListHelper.DepartureContainer.RemoveLoadStatus();
                        oListHelper.DepartureContainer.ListItems().InitEvents();
                        oListHelper.DepartureContainer.ListItems().eq(0).ClickItem();
                    });
                }
            }
            oListHelper.StartPageContainer.find("ul.tabs li").click(function() { s = $(this).attr("id"); oFormHelper.TabIndex = s.replace(/tab/gi, ""); $(this).parent("ul").attr("class", "tabs " + s); bIsInner = oListHelper.BookingPanelContainer.hasClass("inner-booking-panel"); oListHelper.BookingPanelContainer.attr("class", ((bIsInner) ? "inner-booking-panel" : "booking-panel") + " bp-" + s + ((s == "tab2") ? " bp-" + s + "-" + oFormHelper.OneWay : "")); oFormHelper.SetType(); LoadPanel(); if (!$(this).hasClass("selected")) { $(this).parent("ul").find("li").toggleClass("selected") } });
            oListHelper.StartPageContainer.find("a.calendar-icon").click(function() { oTUICalendar.Open($(this)); });
            oListHelper.StartPageContainer.find("span.calendar-dates").click(function() { oTUICalendar.Open($(this).nextAll("a.calendar-icon:first")); });
            oListHelper.StartPageContainer.find("a.toggle-choices").click(function() { $(this).children("span").toggle(); oListHelper.CharterToggleChoices.toggleClass("toggle"); if (($(this).children("span:visible").hasClass("show")) && (oFormHelper.Type == "TRAIN" || oFormHelper.Type == "CRUISE" || oFormHelper.Type == "CAR")) { oListHelper.StartPageContainer.find("span.choice:first input").attr("checked", "checked"); oListHelper.StartPageContainer.find("span.choice:first input").trigger("click"); } });
            oListHelper.StartPageContainer.find("span.choice input").click(function() { if ($(this).parent("span").hasClass("sub-choice")) { return; } oFormHelper.SetType(); LoadPanel(); });
            oListHelper.StartPageContainer.find("span.sub-choice input").click(function() {
                oFormHelper.SetOneWay($(this)); bIsInner = oListHelper.BookingPanelContainer.hasClass("inner-booking-panel"); oListHelper.BookingPanelContainer.attr("class", ((bIsInner) ? "inner-booking-panel" : "booking-panel") + " bp-tab2 bp-tab2-" + oFormHelper.OneWay);
                oListHelper.DestinationContainer.ListItems().eq(0).SetSelected(); oListHelper.ResortContainer.hide();
                if ((oListHelper.DepartureContainerOW.hasClass("list-box-loading")) && (oFormHelper.OneWay == "1")) {
                    oListHelper.DepartureListOW.load(oBaseAjaxUrls.DynamicContent + "Destinations/GetDestinations.aspx?code=o_&type=CHARTER", function() {
                        oListHelper.DepartureContainerOW.removeClass("list-box-loading");
                        oListHelper.DepartureContainerOW.ListItems().InitEvents();
                        oListHelper.DepartureContainerOW.ListItems().eq(0).ClickItem();
                    });
                } else if (oListHelper.DepartureContainer.ListItems().length == 0) {
                    LoadPanel();
                }
            });
            oListHelper.StartPageContainer.find("a.hotel-code-link, a.booking-code-link").click(function() { $(this).hide(); $(this).next("span").css("display", "block"); });
            oListHelper.StartPageContainer.find("input#hotel-code, input#booking-code").blur(function() { if ($(this).val() != "") { return; } $(this).parent("span").hide(); $(this).parent("span").prev("a").css("display", "block"); });
            //resetDestinations=function(){if(oFormHelper.DestinationCodes[0]!=""){if(oListHelper.DestinationContainer.ValueItems(oFormHelper.DestinationCodes[0]).length==0){oListHelper.DestinationList.children("dd:first").ClickItem();}}}
            resetDestinations = function() {
                if (oFormHelper.DestinationCodes[0] != "") {
                    if (oListHelper.DestinationContainer.ValueItems(oFormHelper.DestinationCodes[0]).length == 0) {
                        oListHelper.DestinationList.children("dd:first").ClickItem();
                    }
                    else {
                        oListHelper.DestinationList.find("dd").filter(function() { return ($(this).text() == oListHelper.DestinationContainer.children("span:first").text()); }).ClickItem();
                    }
                } else { oListHelper.DestinationContainer.ListItems().eq(0).SetSelected(); }
            }
            addRoomAllocationContainer = function(s) { oRoomHelper.AllocationContainer(":gt(" + (parseInt(s) - 1).toString() + ")").addClass("toggle"); oRoomHelper.AllocationContainer(":lt(" + s + "):gt(0)").removeClass("toggle"); }
            departureClick = function(s) {
                oFormHelper.SetDepartureCodes(oListHelper.DepartureContainer);
                oListHelper.DestinationContainer.SetLoadStatus();
                oListHelper.DestinationList.load(oBaseAjaxUrls.DynamicContent + "Destinations/GetDestinations.aspx?code=" + s + "&type=" + oFormHelper.Type, function() {
                    oListHelper.DestinationContainer.RemoveLoadStatus();
                    oListHelper.DestinationContainer.ListItems().InitEvents();
                    setTimeout("resetDestinations()", 100);
                });
            }
            departureOWClick = function(s) {
                oFormHelper.SetDepartureCodes(oListHelper.DepartureContainerOW);
                oListHelper.ResortContainer.hide();
                oListHelper.DestinationContainerOW.SetLoadStatus();
                oListHelper.DestinationListOW.load(oBaseAjaxUrls.DynamicContent + "Destinations/GetDestinations.aspx?code=" + s + "&type=CHARTER&oneway=1", function() {
                    oListHelper.DestinationContainerOW.RemoveLoadStatus();
                    oListHelper.DestinationContainerOW.ListItems().InitEvents();
                    if ((setDestinationSelected) && (typeof (oSearchParams) != "undefined") && (oFormHelper.Type == "CHARTER_FLT") && (oSearchParams.type == "ONEWAY")) {
                        oListHelper.DestinationListOW.children("dt").filter(function() { return ($(this).attr("class").indexOf(oSearchParams.destcode) > -1); }).filter(":last").next("dd").ClickItem();
                    } else {
                        oListHelper.DestinationContainerOW.ListItems().eq(0).SetSelected();
                    }
                });
            }
            destinationClick = function(s) {
                oValidator.ResetCharterDestination();
                oFormHelper.SetDestinationCodes(oListHelper.DestinationContainer);
                if (oFormHelper.Type != "FLEX_HTL") {
                    oListHelper.PeriodContainer.SetLoadStatus();
                    oListHelper.PeriodList.load(oBaseAjaxUrls.DynamicContent + "GetPeriods.aspx?type=" + oFormHelper.Type + "&depcode=" + oFormHelper.GetDepartureCodeCRS() + "&destcode=" + oFormHelper.GetDestinationCodeCRS() + ((typeForCurrentPeriodCall == oFormHelper.Type) ? "&period=" + oFormHelper.Period : "") + oFormHelper.HotelIdUrlPart(), function() {
                        oListHelper.PeriodContainer.RemoveLoadStatus();
                        oListHelper.PeriodContainer.ListItems().InitEvents();
                        if (oListHelper.PeriodContainer.ListItems(".selected:first").hasClass("disabled")) {
                            oListHelper.PeriodContainer.ListItems().filter(function() { return (!$(this).hasClass("disabled")); }).eq(0).ClickItem();
                        } else if (oListHelper.PeriodContainer.ListItems(".selected").length == 0) {
                            oListHelper.PeriodContainer.ListItems().eq(0).ClickItem();
                        } else {
                            oListHelper.PeriodContainer.ListItems(".selected:first").ClickItem();
                        }
                        oValidator.ValidatePeriod();
                        typeForCurrentPeriodCall = oFormHelper.Type;
                    });
                }
                if (s == "" || s == "0") { oListHelper.ResortContainer.hide(); oListHelper.PeriodList.children("dd").removeClass("disabled"); return; }
                oListHelper.ResortContainer.SetLoadStatus().show(); oListHelper.NumberOfRoomList.addClass("ie6-bug-fix");
                oListHelper.ResortList.load(oBaseAjaxUrls.DynamicContent + "Destinations/GetDestinations.aspx?code=" + s + "&type=" + oFormHelper.Type + "&depcode=" + oFormHelper.GetDepartureCodeCRS(), function() {
                    $(this).SelectFirstItem();
                    oListHelper.ResortContainer.RemoveLoadStatus();
                    oListHelper.ResortContainer.ListItems().InitEvents();
                });
            }
            destinationOWClick = function(s) {
                oFormHelper.SetDestinationCodes(oListHelper.DestinationContainerOW);
                if (s == "" || s == "0" || (oFormHelper.DepartureCodes[0].replace(/CRS-/gi, "") != "")) { oListHelper.ResortContainer.hide(); return; }
                oListHelper.ResortContainer.SetLoadStatus().show();
                oListHelper.ResortList.load(oBaseAjaxUrls.DynamicContent + "Destinations/GetDestinations.aspx?code=" + s + "&type=CHARTER", function() {
                    $(this).SelectFirstItem();
                    oListHelper.ResortContainer.RemoveLoadStatus();
                    oListHelper.ResortContainer.ListItems().InitEvents();
                });
            }
            resortClick = function(s) {
                if (s == "0") { if (oListHelper.DestinationContainerOW.is(":visible")) { oFormHelper.SetDestinationCodes(oListHelper.DestinationContainerOW); } else { oFormHelper.SetDestinationCodes(oListHelper.DestinationContainer); } }
                else { oFormHelper.SetResortCodes(); }
                if (s.substring(0, 2) == "d_") {
                    oListHelper.PeriodContainer.SetLoadStatus();
                    sDestCode = ((oFormHelper.GetResortCodeCRS() != "") ? oFormHelper.GetResortCodeCRS() : oFormHelper.GetDestinationCodeCRS());
                    if (oFormHelper.Type != "FLEX_HTL") {
                        oListHelper.PeriodList.load(oBaseAjaxUrls.DynamicContent + "GetPeriods.aspx?type=" + oFormHelper.Type + "&depcode=" + oFormHelper.GetDepartureCodeCRS() + "&destcode=" + sDestCode + ((typeForCurrentPeriodCall == oFormHelper.Type) ? "&period=" + oFormHelper.Period : "") + oFormHelper.HotelIdUrlPart(), function() {
                            oListHelper.PeriodContainer.RemoveLoadStatus();
                            oListHelper.PeriodContainer.ListItems().InitEvents();
                            if (oListHelper.PeriodContainer.ListItems(".selected:first").hasClass("disabled")) {
                                oListHelper.PeriodContainer.ListItems().filter(function() { return (!$(this).hasClass("disabled")); }).eq(0).ClickItem();
                            } else if (oListHelper.PeriodContainer.ListItems(".selected").length == 0) {
                                oListHelper.PeriodContainer.ListItems().eq(0).ClickItem();
                            } else {
                                oListHelper.PeriodContainer.ListItems(".selected:first").ClickItem();
                            }
                            oValidator.ValidatePeriod();
                            typeForCurrentPeriodCall = oFormHelper.Type;
                        });
                    }
                }
            }
            periodClick = function(s) { oFormHelper.Period = s; oValidator.ResetPeriod(); }
            adultsClick1 = function(s) { oListHelper.ChildrenList.eq(0).ListItems().removeClass("disabled"); oListHelper.ChildrenList.eq(0).ListItems().filter(function() { return (parseInt($(this).text()) > (oBaseAppSettings.MaxPax - parseInt(s))); }).addClass("disabled"); oValidator.ValidateTotalPax(); }
            adultsClick2 = function(s) { oListHelper.ChildrenList.eq(1).ListItems().removeClass("disabled"); oListHelper.ChildrenList.eq(1).ListItems().filter(function() { return (parseInt($(this).text()) > (oBaseAppSettings.MaxPax - parseInt(s))); }).addClass("disabled"); oValidator.ValidateTotalPax(); }
            adultsClick3 = function(s) { oListHelper.ChildrenList.eq(2).ListItems().removeClass("disabled"); oListHelper.ChildrenList.eq(2).ListItems().filter(function() { return (parseInt($(this).text()) > (oBaseAppSettings.MaxPax - parseInt(s))); }).addClass("disabled"); oValidator.ValidateTotalPax(); }
            childrenClick1 = function(s) { oListHelper.ChildrenAgesHolder.eq(0).attr("class", "children-ages number-" + s); oValidator.ValidateTotalPax(); if (s == "0") { oValidator.ValidateChildrenAges(); } }
            childrenClick2 = function(s) { oListHelper.ChildrenAgesHolder.eq(1).attr("class", "children-ages number-" + s); oValidator.ValidateTotalPax(); if (s == "0") { oValidator.ValidateChildrenAges(); } }
            childrenClick3 = function(s) { oListHelper.ChildrenAgesHolder.eq(2).attr("class", "children-ages number-" + s); oValidator.ValidateTotalPax(); if (s == "0") { oValidator.ValidateChildrenAges(); } }
            handleKeyDown = function(o, n) {
                if ((n == 9) || (n == 37) || (n == 39) || (n == 8) || (n == 46)) { return true; }
                else { return ((n >= 48 && n <= 57) || (n >= 96 && n <= 105)); }
            }
            handleKeyUp = function(o) {
                if (o.val() > 17) { o.val(o.val().substring(0, (o.val().length - 1))) }
            }
            $("span.child input").keydown(function(event) { return handleKeyDown($(this), event.keyCode); });
            $("span.child input").keyup(function() { return handleKeyUp($(this)); });
            if (typeof overRide != "undefined") { overRide(); }
        }
        LoadBookingPanel = function() {
            sUrlParams = "";
            if (typeof (oSearchParams) == "undefined" && $.cookie("tui.searchparams") != null) { oSearchParams = JSON.parse($.cookie("tui.searchparams")); }
            else if ((typeof (oSearchParams) != "undefined") && (oSearchParams.source != "") && (oSearchParams.source != "lms")) { oSearchParams.type = "CHARTER"; }
            if ((typeof (oSearchParams) != "undefined") && ($("div.enok-hotel-level").length == 0)) {
                sInnerBookingPanelClass = ($("body:first").hasClass("searchresult")) ? "booking-panel inner-booking-panel" : "inner-booking-panel";
                if (oSearchParams.type == "COMBINATION" || oSearchParams.type == "TRAIN" || oSearchParams.type == "CRUISE" || oSearchParams.type == "CAR") { if (oSearchParams.type == "COMBINATION") { $("div#search-form").addClass("bp-combinations"); } $("div#search-form span.choice input").filter(function() { return ($(this).val() == oSearchParams.type); }).attr("checked", "checked"); }
                else if (oSearchParams.type == "CHARTER_FLT") {
                    sBPClass = ($("div#search-form").hasClass("inner-booking-panel")) ? sInnerBookingPanelClass : "booking-panel";
                    $("div#search-form").attr("class", sBPClass + " bp-tab2 bp-tab2-0").children("ul.tabs:first").attr("class", "tabs tab2");
                }
                else if (oSearchParams.type == "ONEWAY") {
                    sBPClass = ($("div#search-form").hasClass("inner-booking-panel")) ? sInnerBookingPanelClass : "booking-panel";
                    $("input#tab2_4").attr("checked", "checked");
                    $("div#search-form").attr("class", sBPClass + " bp-tab2 bp-tab2-1").children("ul.tabs:first").attr("class", "tabs tab2");
                }
                else if (oSearchParams.type == "FLEX_HTL") {
                    sBPClass = ($("div#search-form").hasClass("inner-booking-panel")) ? sInnerBookingPanelClass : "booking-panel";
                    $("div#search-form").attr("class", sBPClass + " bp-tab3").children("ul.tabs:first").attr("class", "tabs tab3");
                }
                sUrlParams = oSearchParams.urlparams;
                typeForCurrentPeriodCall = oSearchParams.type;
            }
            else if ((typeof (oSearchParams) != "undefined") && ($("div.enok-hotel-level").length > 0)) { sUrlParams = oSearchParams.urlparams; }
            var bookableString = "";
            if ($("input#isBookableOnline").val()) {
                bookableString = "&bookableonline=" + $("input#isBookableOnline").val().toLowerCase();
            }
            $("div#charter").load(oBaseAjaxUrls.DynamicContent + "BookingPanel/BookingPanel.aspx?bid=" + oBaseAppSettings.BrandID + sUrlParams + "&hotelcode=" + getEnokHotelId() + bookableString, function() {

                // TODO: Timing issue: DreamVacation already loaded and displayed on top of the booking panel at this point. Booking panel elements "shine through" and causes white stripes to be displayed in the campaign Flash video. This code prevents this, but maybe there's a better solution.
                var hasQuery = (getQueryStringParameter("showCampaignPage") != "") ? true : false;
                var hasPageQuery = (getQueryStringParameter("page") != "") ? true : false;
                if (typeof Sys !== 'undefined' && typeof Tui !== 'undefined' && ($.cookie("CampaignHasBeenShown") == null || hasQuery))
                //if (typeof Sys !== 'undefined' && typeof Tui !== 'undefined')
                {
                    Tui.Web.DreamVacation.hideProblematicBookingPanelElements();
                }
                else if (hasPageQuery) {
                    if ($.browser.mozilla) {
                        $('.bp-content:first').find('.list-box span, .list-box-large span').hide();
                    }
                }

                $(this).removeClass("bp-content-loading"); InitPage();
                registerHelpTextPopupHandlers($(this));
                if (typeof (oSearchParams) != "undefined") {
                    if ((oFormHelper.Type == "CHARTER_FLT") && (oSearchParams.type == "ONEWAY") && (oSearchParams.destcode != "")) {
                        setDestinationSelected = true;
                        oListHelper.DepartureListOW.children("dd.selected").ClickItem();
                    }
                    else if (((oFormHelper.Type == "CHARTER_FLT") || (oSearchParams.source == "lms" || oSearchParams.source == "dynamictable")) && (oSearchParams.destcode != "")) {
                        oListHelper.DestinationList.children("dt").filter(function() { return ($(this).attr("class").indexOf(oSearchParams.destcode) > -1); }).filter(":last").next("dd").ClickItem();
                    }
                    if (($("div#search-form a.toggle-choices:visible").length > 0) && (oSearchParams.type == "TRAIN" || oSearchParams.type == "CRUISE" || oSearchParams.type == "CAR")) { $("div#search-form a.toggle-choices:visible").trigger("click"); }
                }
            });
        }
        SetReturnDate = function() {
            o = oTUICalendar.DateHolder;
            if (o.parents("div.column:first").find("span.return-date").length == 0) { return; }
            d = addDays(o.children("span.year").text(), o.children("span.month").text(), o.children("span.day").text(), 3);
            oTUICalendar.DateHolder = o.parents("div.column:first").find("span.return-date");
            oTUICalendar.Year = d.getFullYear();
            oTUICalendar.Month = d.getMonth() + 1;
            oTUICalendar.Day = d.getDate();
            oTUICalendar.SetInputDate();
        }
        if (!$("div#search-form").hasClass("inner-booking-panel")) { LoadBookingPanel(); }
        $("a.display-bp").click(function() { $("div#search-form").toggle(); if ($("div#search-form").is(":visible")) { LoadBookingPanel(); } });
        $("a.search-all").click(function() {
            s = $(this).attr("lang");
            if ((s == "") && (typeof (oSearchParams) == "undefined" && $.cookie("tui.searchparams") != null)) {
                oSearchParams = JSON.parse($.cookie("tui.searchparams"));
                var searchtype = (oSearchParams.type == "COMBINATION") ? "CHARTER" : oSearchParams.type;
                var returndateparam = ((oSearchParams.type == "FLEX_HTL") ? "&returndate=" + oSearchParams.returndate[0] + "-" + oSearchParams.returndate[1] + "-" + oSearchParams.returndate[2] : "");
                var combiparam = (oSearchParams.type == "COMBINATION") ? "&combi=true" : "";
                s = oBaseAjaxUrls.BookingSite + "SearchProduct.aspx?depcode=" + oSearchParams.depcode + "&destcode=" + ((oSearchParams.resortcode != "") ? oSearchParams.resortcode : oSearchParams.destcode) + "&period=" + oSearchParams.period + "&type=" + searchtype + "&depdate=" + oSearchParams.depdate[0] + "-" + oSearchParams.depdate[1] + "-" + oSearchParams.depdate[2] + returndateparam + "&PaxInRooms=" + oSearchParams.paxinrooms + "&alt=true" + combiparam;
            }
            else if (s == "") { document.location.href = oBaseAjaxUrls.BookingSite + "SearchForm" + (oBaseAppSettings.IsTemaSite ? "Tema" : "") + ".aspx"; return; }
            if ($("div.page-container").find("div#searching img").length == 0) {
                var imgtag = "<img src=\"" + oBaseAppSettings.IncludeSiteDirectory + "/Images/Layout/BookingPanel/searching" + (oBaseAppSettings.IsTemaSite ? "-tema" : "") + ".jpg\" alt=\"\" />"
                $("div.page-container").find("div#searching").append(imgtag);
            }
            $("div.page-container").addClass("searching");
            $.get(s, function(data) {
                sStatus = $(data).find("Status").text();
                if (sStatus == "OK") {
                    s = $(data).find("Url").text(); /*sHits = $(data).find("SearchHits").text();*/
                    $.cookie("tui.searchresult", null, { path: "/" });
                    document.location.href = s;
                } else {
                    $("input#searchurl").val(s);
                    var code = $(data).find("Code").text();
                    var producttype = $(data).find("ProductType").text();
                    $("input#errorcode").val(code);
                    $("input#producttype").val(producttype);
                    document.forms["errorform"].submit();
                }
            });
        });
        //Calendar
        CalendarStatus = "ready";
        oTUICalendar.Init();
        CallBacks.push("month-list|oTUICalendar.SelectMonth");
        InitListBoxes(oTUICalendar.CalendarObject);
        $(document).click(function() { if (CalendarStatus == "open") { oTUICalendar.Close(); } });
        $("div#calendar").click(function() { CalendarStatus = "ready"; setTimeout("CalendarStatus=\"open\";", 100); });
        if ($.browser.msie && $.browser.version < 7) { oTUICalendar.AllSelectLists = $("select"); }
        //
    }
);

getCountryName=function(){
    if($("div.enok-hotel-level").length>0 && $("div.breadcrumbs a").length>0){
        return $("div.breadcrumbs a:eq(0)").text();
    }else if(oListHelper.DestinationContainer.children("input:hidden").val()=="" || oListHelper.DestinationContainer.children("input:hidden").val()=="0"){
        return "-";
    }else if(oListHelper.DestinationContainer.children("input:hidden").val().split("|")[1].substring(0,1) == "c"){
        return oListHelper.DestinationContainer.children("span").text();
    }else{
        return oListHelper.DestinationContainer.find("dd.selected").prevAll("dd.parent:first").text();
    }
}
getDestinationName=function(){
    if($("div.enok-hotel-level").length>0 && $("div.breadcrumbs a").length>1){
        return $("div.breadcrumbs a:eq(1)").text();
    }else if(oListHelper.DestinationContainer.children("input:hidden").val()=="" || oListHelper.DestinationContainer.children("input:hidden").val()=="0"){
        return "-";
    }else if(oListHelper.DestinationContainer.children("input:hidden").val().split("|")[1].substring(0,1) == "c"){
        if(oListHelper.ResortContainer.children("input:hidden").val()=="" || oListHelper.ResortContainer.children("input:hidden").val()=="0"){
            return "-";
        }else if(oListHelper.ResortContainer.children("input:hidden").val().split("|")[1].substring(0,1) == "d"){
            return oListHelper.ResortContainer.children("span").text();
        }else{
            return oListHelper.ResortContainer.find("dd.selected").prevAll("dd.parent:first").text();
        }
    }else if(oListHelper.DestinationContainer.children("input:hidden").val().split("|")[1].substring(0,1) == "d"){
        return oListHelper.DestinationContainer.children("span").text();
    }else{
        return oListHelper.ResortContainer.find("dd.selected").prevAll("dd.parent:first").text();
    }
}
getResortName=function(){
    if($("div.enok-hotel-level").length>0 && $("div.breadcrumbs a").length>2){
        return $("div.breadcrumbs a:eq(2)").text();
    }else if(oListHelper.ResortContainer.filter(":visible").length>0 && oListHelper.ResortContainer.children("input:hidden").val()!="" && oListHelper.ResortContainer.children("input:hidden").val()!="0" && oListHelper.ResortContainer.children("input:hidden").val().split("|")[1].substring(0,1) == "r"){
        return oListHelper.ResortContainer.children("span").text();
    }else{
        return "-";
    }
}
getHotelName=function(){
    if($("div.enok-hotel-level div#main-header h1").length>0){
        return $("div.enok-hotel-level div#main-header h1").text();
    }else{
        return "-";
    }
}
getEnokHotelId=function(){
    if($("input#enokhotelid").length>0){
        return $("input#enokhotelid").val();
    }else if(typeof(oListHelper)=="object" && oListHelper.HotelCodeHolder.filter(":visible").length>0){
        return oListHelper.HotelCodeHolder.val();
    }else{
        return "-";
    }
}
getPaxPerRoom=function(roomIndex){
    allPax=(oFormHelper.Pax.trim() + "|;|;").split("|");
    if(allPax[roomIndex]==";"){
        return "-";
    }else{
        adults=allPax[roomIndex].split(";")[0];
        children = (allPax[roomIndex].split(";").length < 2 || allPax[roomIndex].split(";")[1] == "") ? "0+0+0" : getChildrenPerRoom(allPax[roomIndex].split(";")[1].split(","));
        return String.format("{0}+{1}", adults, children);
    }
}
getChildrenPerRoom = function(childAges) {
    var teens = 0,
        children = 0,
        infants = 0;
    for (i = 0; i < childAges.length; i++) {
        if (childAges[i] < 2) {
            infants++;
        }
        else if (childAges[i] < 12) {
            children++;
        }
        else {
            teens++;
        }
    }
    return String.format("{0}+{1}+{2}", teens, children, infants);
}
getPanelLocation=function(){
    if($("div#content-start").length>0){
        return "front page";
    }else if($("div.enok-hotel-level").length>0){
        return "hotel page";
    }else if($("div#page-content.message-page-container").length>0){
        return "general message page";
    }else if($("div.serp-holder").length>0){
        return "search result page";
    }else{
        return "booking tab";
    }
}
journeyDurationInDays=function(){
    if(oListHelper.ReturnDateHolder.filter(":visible").length>0){
        var date1 = new Date();
        date1.setFullYear(Number(oListHelper.ReturnDateHolder.children("span.year").text()), Number(oListHelper.ReturnDateHolder.children("span.month").text())-1, Number(oListHelper.ReturnDateHolder.children("span.day").text()));
        var date2 = new Date();
        date2.setFullYear(Number(oListHelper.DepartureDateHolder.children("span.year").text()), Number(oListHelper.DepartureDateHolder.children("span.month").text())-1, Number(oListHelper.DepartureDateHolder.children("span.day").text()));
        return Math.floor((date1.getTime() - date2.getTime()) / 86400000)+1;
    }else{
        return oFormHelper.Period;
    }
}
prepareEventTracking = function(bookingType) {
    var eventLabel = "";
    eventLabel = String.format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}",
        (bookingType == "FLEX_HTL") ? "HOTELONLY" : bookingType,
        oListHelper.DepartureContainer.children("span").text(),
        getCountryName(),
        getDestinationName(),
        getResortName(),
        getHotelName(),
        oListHelper.DepartureDateHolder.text(),
        journeyDurationInDays(),
        (oListHelper.NumberOfRoomList.filter(":visible").length > 0) ? oListHelper.NumberOfRoomList.children("input:hidden").val() : "-",
        getPaxPerRoom(0),
        getPaxPerRoom(1),
        getPaxPerRoom(2),
        getEnokHotelId(),
        (oListHelper.BookingCodeHolder.filter(":visible").length > 0) ? oListHelper.BookingCodeHolder.val() : "-"
    );
    oEventTracker.Category = "booking search";
    oEventTracker.Action = getPanelLocation();
    oEventTracker.Label = eventLabel;
}

performSearch = function() {
    if (!oValidator.Validate()) { return; }
    $("div#light-box,div#light-box-content").hide();
    oFormHelper.SetPax();
    var imgtag = "<img src=\""+oBaseAppSettings.IncludeSiteDirectory+"/Images/Layout/BookingPanel/searching" + (oBaseAppSettings.IsTemaSite ? "-tema" : "") + ".jpg\" alt=\"\" />"
    if (oListHelper.PageContainer.find("div#searching img").length == 0) { oListHelper.PageContainer.find("div#searching").append(imgtag); }
    oListHelper.PageContainer.addClass("searching");

    $.cookie("tui.searchparams", null, { path: "/" });
    if (typeof (oSearchParams) == "undefined" || oSearchParams == null) oSearchParams = new Object();
    oSearchParams.type = (((oFormHelper.Type == "CHARTER_FLT") && (oFormHelper.OneWay == "1")) ? "ONEWAY" : oFormHelper.Type);
    oSearchParams.depcode = oFormHelper.GetDepartureCodeCRS();
    oSearchParams.destcode = oFormHelper.GetDestinationCodeCRS();
    oSearchParams.resortcode = oFormHelper.GetResortCodeCRS();
    oSearchParams.period = oFormHelper.Period;
    oSearchParams.paxinrooms = oFormHelper.Pax.trim();
    oSearchParams.depdate = [oListHelper.DepartureDateHolder.children("span.year").text(), oListHelper.DepartureDateHolder.children("span.month").text(), oListHelper.DepartureDateHolder.children("span.day").text()];
    oSearchParams.returndate = [oListHelper.ReturnDateHolder.children("span.year").text(), oListHelper.ReturnDateHolder.children("span.month").text(), oListHelper.ReturnDateHolder.children("span.day").text()];
    //oSearchParams.urlparams="&bookingtype="+oSearchParams.type+"&depcode="+oFormHelper.DepartureCodes[1]+"&destcode="+oFormHelper.DestinationCodes[1]+"&destcodecrs="+((oSearchParams.resortcode!="")?oSearchParams.resortcode:oSearchParams.destcode)+"&resortcode="+((typeof(oFormHelper.ResortCodes[1])!="undefined")?oFormHelper.ResortCodes[1]:"")+"&depyear="+oSearchParams.depdate[0]+"&depmonth="+oSearchParams.depdate[1]+"&depday="+oSearchParams.depdate[2]+"&period="+oSearchParams.period+"&pax="+oSearchParams.paxinrooms;
    oSearchParams.urlparams = "&bookingtype=" + oSearchParams.type + "&depcode=" + oSearchParams.depcode.replace(/-d/gi, "").replace(/-/gi, "") + "&destcode=" + ((typeof (oFormHelper.DestinationCodes[1]) != "undefined") ? oFormHelper.DestinationCodes[1] : "") + "&destcodecrs=" + oSearchParams.destcode + "&resortcode=" + ((typeof (oFormHelper.ResortCodes[1]) != "undefined") ? oFormHelper.ResortCodes[1] : "") + "&depyear=" + oSearchParams.depdate[0] + "&depmonth=" + oSearchParams.depdate[1] + "&depday=" + oSearchParams.depdate[2] + "&period=" + oSearchParams.period + "&pax=" + oSearchParams.paxinrooms;

    var trackSearchEvent = true;
    try {
        prepareEventTracking(oSearchParams.type);
    }
    catch (err) { trackSearchEvent = false; }

    var returndateparam = ((oFormHelper.Type == "FLEX_HTL") ? oFormHelper.GetQuerystringParam("returndate", oFormHelper.ReturnDate()) : "");
    var hotelcodeparam = oFormHelper.GetQuerystringParam("hotelcode", oFormHelper.GetHotelCode());
    var sourceparam = oFormHelper.GetQuerystringParam("source", oFormHelper.GetSource());
    var hotelcodecrsparam = oFormHelper.GetQuerystringParam("hotel", oFormHelper.GetHotelCodeCrs());
    var lmscodeparam = oFormHelper.GetQuerystringParam("lmscode", oFormHelper.GetLmsCode());
    var bookingcodeparam = oFormHelper.GetQuerystringParam("BookingCode", oFormHelper.GetBookingCode());
    var searchtype = (oSearchParams.type == "COMBINATION") ? "CHARTER" : oSearchParams.type;
    var combiparam = (oSearchParams.type == "COMBINATION") ? oFormHelper.GetQuerystringParam("combi", "true") : "";
    var rndparam = oFormHelper.GetQuerystringParam("rnd", Math.ceil(10000 * Math.random()));
    oSearchParams.hotelcode = null;
    oSearchParams.hotel = null;
    oSearchParams.source = null;
    oSearchParams.lmscode = null;
    var hotelUrlPart = ($("input#enokhotelid").length > 0 && $("input#enokhotelid").val() != "" && hotelcodeparam == "") ? "&hotelcode=" + $("input#enokhotelid").val() : "";
    $.cookie("tui.searchparams", JSON.serialize(oSearchParams), { path: "/" });
    s = oBaseAjaxUrls.BookingSite + "SearchProduct.aspx?depcode=" + oSearchParams.depcode + "&destcode=" + ((oSearchParams.resortcode != "") ? oSearchParams.resortcode : oSearchParams.destcode) + "&period=" + oSearchParams.period + "&type=" + searchtype + "&depdate=" + oFormHelper.DepartureDate() + returndateparam + "&PaxInRooms=" + oSearchParams.paxinrooms + bookingcodeparam + hotelcodeparam + sourceparam + hotelcodecrsparam + lmscodeparam + hotelUrlPart + combiparam + rndparam;
    $.get(s, function(data) {
        sStatus = $(data).find("Status").text();
        if (sStatus == "OK") {
            s = $(data).find("Url").text(); /*sHits = $(data).find("SearchHits").text();*/
            $.cookie("tui.searchresult", null, { path: "/" });
            if (trackSearchEvent) {
                oEventTracker.Label = (oEventTracker.Label + "|" + "SUCCESS");
                oEventTracker.SendEvent();
            }
            document.location.href = s;
        } else {
            $("input#searchurl").val(s);
            var code = $(data).find("Code").text();
            var producttype = $(data).find("ProductType").text();
            $("input#errorcode").val(code);
            $("input#producttype").val(producttype);
            if (trackSearchEvent) {
                oEventTracker.Label = String.format((oEventTracker.Label + "|" + "FAILURE (CODE:{0})"), code)
                oEventTracker.SendEvent();
            }
            document.forms["errorform"].submit();
        }
    });
}


  function getQueryStringParameter(name) {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regexS = "[\\?&]" + name + "=([^&#]*)";
        var regex = new RegExp(regexS);
        var results = regex.exec(window.location.href);
        if (results == null) {
            return "";
        }
        else {
            return results[1];
        }
    }

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();