﻿// (c) 2010 CodePlex Foundation
(function(g,b){var o="object",t="set_",l="#",n="$",k="string",j=".",h=" ",s="onreadystatechange",m="load",y="_readyQueue",x="_domReadyQueue",r="error",d=false,q="on",a=null,c=true,e="undefined",f="function",i="number",A=function(a){a=a||{};p(arguments,function(b){b&&v(b,function(c,b){a[b]=c})},1);return a},v=function(a,c){for(var b in a)c(a[b],b)},p=function(a,g,h){var d;if(a){a=a instanceof Array||typeof a.length===i&&(typeof a.callee===f||a.item&&typeof a.nodeType===e&&!a.addEventListener&&!a.attachEvent)?a:[a];for(var b=h||0,j=a.length;b<j;b++)if(g(a[b],b)){d=c;break}}return!d},u=function(b,e,d){var c=b[e],a=typeof c===f;a&&c.call(b,d);return a};if(!b||!b.loader){function M(a){a=a||{};p(arguments,function(b){b&&v(b,function(c,b){if(typeof a[b]===e)a[b]=c})},1);return a}var z=!!document.attachEvent;function C(b,a){var c=b[a];delete b[a];return c}function K(d,b,c){p(C(d,b),function(b){b.apply(a,c||[])})}function I(a,c,b){return a?(a[c]=a[c]||b):b}function G(c,b,a){I(c,b,[]).push(a)}function B(b,a){return(a||document).getElementsByTagName(b)}function J(a){return document.createElement(a)}function D(b,e,g,i,h,f){function c(){if(!z||!h||/loaded|complete/.test(b.readyState)){if(z)b.detachEvent(g||q+e,c);else{b.removeEventListener(e,c,d);f&&b.removeEventListener(r,c,d)}i.apply(b);b=a}}if(z)b.attachEvent(g||q+e,c);else{b.addEventListener(e,c,d);f&&b.addEventListener(r,c,d)}}function E(){b._domReady&&b._2Pass(C(b,x))}function F(){var a=b._ready;if(!a&&b._domReady&&!(b.loader&&b.loader._loading))b._ready=a=c;a&&b._2Pass(C(b,y))}g.Sys=b=M(b,{version:[3,0,31106,0],__namespace:c,debug:d,scripts:{},activateDom:c,composites:{},components:{},plugins:{},create:{},converters:{},_domLoaded:function(){if(b._domChecked)return;b._domChecked=c;function d(){if(!b._domReady){b._domReady=c;var d=b._autoRequire;d&&b.require(d,function(){b._autoRequire=a;K(b,"_autoQueue")},autoToken);E();F()}}D(g,m,a,d);var e;if(z)if(g==g.top&&document.documentElement.doScroll){var h,i,f=J("div");e=function(){try{f.doScroll("left")}catch(b){h=g.setTimeout(e,0);return}f=a;d()};e()}else D(document,a,s,d,c);else document.addEventListener&&D(document,"DOMContentLoaded",a,d)},_getById:function(b,d,h,f,a,g){if(a)if(f&&a.id===d)b.push(a);else!g&&p(B("*",a),function(a){if(a.id===d){b.push(a);return c}});else{var e=document.getElementById(d);e&&b.push(e)}return b.length},_getByClass:function(l,d,g,m,a,n){function i(b){var e,a=b.className;if(a&&(a===d||a.indexOf(h+d)>=0||a.indexOf(d+h)>=0)){l.push(b);e=c}return e}var b,f,e;if(m&&i(a)&&g)return c;if(!n){a=a||document;var k=a.querySelectorAll||a.getElementsByClassName;if(k){if(a.querySelectorAll)d=j+d;e=k.call(a,d);for(b=0,f=e.length;b<f;b++){l.push(e[b]);if(g)return c}}else{e=B("*",a);for(b=0,f=e.length;b<f;b++)if(i(e[b])&&g)return c}}},query:function(a,c){return new b.ElementSet(a,c)},"get":function(b,a){return a&&typeof a.get===f?a.get(b):this._find(b,a,c)},_find:function(m,d,f,h){var e=[],j;if(typeof m===k)j=[m];else j=m;var i=d instanceof Array,o=/^([\$#\.])((\w|[$:\.\-])+)$/,q=/^((\w+)|\*)$/;if(typeof d===k||d instanceof Array)d=b._find(d);if(d instanceof b.ElementSet)d=d.get();p(j,function(a){if(typeof a!==k)if(h)contains(d,a)&&e.push(a);else e.push(a);else{var j=o.exec(a);if(j&&j.length===4){a=j[2];var s=j[1];if(s===n)b._getComponent(e,a,d);else{var r=s===l?b._getById:b._getByClass;if(d)p(d,function(b){if(b.nodeType===1)return r(e,a,f,i,b,h)});else r(e,a,f)}}else if(q.test(a))if(d instanceof Array)p(d,function(b){if(b.nodeType===1){if(i&&(a==="*"||b.tagName.toLowerCase()===a)){e.push(b);if(f)return c}if(!h)if(!p(B(a,b),function(a){e.push(a);if(f)return c}))return c}});else{var m=B(a,d);if(f){m[0]&&e.push(m[0]);return c}p(m,function(a){e.push(a)})}else if(g.jQuery){!h&&e.push.apply(e,jQuery(a,d).get());i&&e.push.apply(e,jQuery(d).filter(a).get())}}});return e.length?f?e[0]||a:e:a},onDomReady:function(a){G(this,x,a);E()},onReady:function(a){G(this,y,a);F()},_set:function(a,b){v(b,function(c,b){u(a,"add_"+b,c)||u(a,t+b,c)||(a[b]=c)})}});b._getComponent=b._getComponent||function(){};b._2Pass=b._2Pass||function(a){p(a,function(a){a()})};var w;if(!b.ElementSet){w=b.ElementSet=function(c,a){this._elements=typeof a===o&&typeof a.query===f?a.query(c).get():b._find(c,a)||[]};w.prototype={__class:c,components:function(d,c){var a=new b.ElementSet(this.get());return new b.ComponentSet(a,d,c)},component:function(b,a){return this.components(b,a).get(0)},each:function(c){for(var b=this._elements,a=0,e=b.length;a<e;a++)if(c.call(b[a],a)===d)break;return this},"get":function(c){var b=this._elements;return typeof c===e?Array.apply(a,b):b[c]||a},find:function(a){return new b.ElementSet(a,this)},filter:function(a){return new b.ElementSet(b._find(a,this._elements,d,c))}}}if(!b.ComponentSet){w=b.ComponentSet=function(a,d,c){this._elementSet=a||(a=new b.ElementSet);this._components=this._execute(a,d,c)};w.prototype={__class:c,setProperties:function(a){return this.each(function(){b._set(this,a)})},"get":function(c){var b=this._components;return typeof c===e?Array.apply(a,b):b[c||0]||a},each:function(a){p(this._components,function(b,e){if(a.call(b,e)===d)return c});return this},elements:function(){return this._elementSet},_execute:function(f,b,c){var a=[];function d(c){var a;return c instanceof b||(a=c.constructor)&&(a===b||a.inheritsFrom&&a.inheritsFrom(b)||a.implementsInterface&&a.implementsInterface(b))}if(b instanceof Array)a.push.apply(a,b);else f.each(function(){var c=this.control;c&&(!b||d(c))&&a.push(c);p(this._behaviors,function(c){(!b||d(c))&&a.push(c)})});if(typeof c!==e)if(a[c])a=[a[c]];else a=[];return a}}}w=a}var L=function(a,d){if(d)return function(){return b.plugins[a.name].plugin.apply(this,arguments)};else{var c=function(){var c=arguments.callee,a=c._component;return b._createComp.call(this,a,a.defaults,arguments)};c._component=a;return c}};b._getCreate=L;function H(){var sb="callback",Q="completed",hb="completedRequest",gb="invokingRequest",vb="Sys.Net.XMLHttpExecutor",M="Content-Type",kb="text/xml",rb="SelectionLanguage",fb="navigate",eb="dispose",db="init",L="unload",P="none",cb="HTML",I="absolute",O="BODY",bb="InternetExplorer",ab="disposing",H="+",qb="MonthNames",pb="MonthGenitiveNames",Z="Abbreviated",E="-",D="/",Y="yyyy",X="MMMM",W="dddd",B=100,J="collectionChanged",V="get_",C="propertyChanged",G=",",U="null",S="Firefox",T="initialize",jb="beginUpdate",y=-1,ob="Undefined",x="",F="\n",nb="Exception",w,z;b._foreach=p;b._forIn=v;b._merge=A;b._callIf=u;w=Function;w.__typeName="Function";w.__class=c;w.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){for(var d=[],c=0;c<e;c++)d[c]=arguments[c];d[e]=a;return b.apply(this,d)}return b.call(this,a)}};w.createDelegate=function(a,b){return function(){return b.apply(a,arguments)}};w.emptyFunction=w.emptyMethod=function(){};w.validateParameters=function(c,b,a){return Function._validateParams(c,b,a)};w._validateParams=function(i,g,e){var b,f=g.length;e=e!==d;b=Function._validateParameterCount(i,g,e);if(b){b.popStackFrame();return b}for(var c=0,k=i.length;c<k;c++){var h=g[Math.min(c,f-1)],j=h.name;if(h.parameterArray)j+="["+(c-f+1)+"]";else if(!e&&c>=f)break;b=Function._validateParameter(i[c],h,j);if(b){b.popStackFrame();return b}}return a};w._validateParameterCount=function(m,g,l){var b,f,e=g.length,h=m.length;if(h<e){var i=e;for(b=0;b<e;b++){var j=g[b];if(j.optional||j.parameterArray)i--}if(h<i)f=c}else if(l&&h>e){f=c;for(b=0;b<e;b++)if(g[b].parameterArray){f=d;break}}if(f){var k=Error.parameterCount();k.popStackFrame();return k}return a};w._validateParameter=function(d,b,j){var c,i=b.type,n=!!b.integer,m=!!b.domElement,o=!!b.mayBeNull;c=Function._validateParameterType(d,i,n,m,o,j);if(c){c.popStackFrame();return c}var g=b.elementType,h=!!b.elementMayBeNull;if(i===Array&&typeof d!==e&&d!==a&&(g||!h))for(var l=!!b.elementInteger,k=!!b.elementDomElement,f=0;f<d.length;f++){var p=d[f];c=Function._validateParameterType(p,g,l,k,h,j+"["+f+"]");if(c){c.popStackFrame();return c}}return a};w._validateParameterType=function(c,f,n,m,o,g){var d,k;if(typeof c===e||c===a){if(o)return a;d=c===a?Error.argumentNull(g):Error.argumentUndefined(g);d.popStackFrame();return d}if(f&&f.__enum){if(typeof c!==i){d=Error.argumentType(g,Object.getType(c),f);d.popStackFrame();return d}if(c%1===0){var h=f.prototype;if(!f.__flags||c===0){for(k in h)if(h[k]===c)return a}else{var l=c;for(k in h){var j=h[k];if(j===0)continue;if((j&c)===j)l-=j;if(l===0)return a}}}d=Error.argumentOutOfRange(g,c,String.format(b.Res.enumInvalidValue,c,f.getName()));d.popStackFrame();return d}if(m&&(!b._isDomElement(c)||c.nodeType===3)){d=Error.argument(g,b.Res.argumentDomElement);d.popStackFrame();return d}if(f&&!b._isInstanceOfType(f,c)){d=Error.argumentType(g,Object.getType(c),f);d.popStackFrame();return d}if(f===Number&&n)if(c%1!==0){d=Error.argumentOutOfRange(g,c,b.Res.argumentInteger);d.popStackFrame();return d}return a};w=Error;w.__typeName="Error";w.__class=c;b._errorArgument=function(e,a,g){var f="Sys.Argument"+e+nb,d=f+": "+(g||b.Res["argument"+e]);if(a)d+=F+String.format(b.Res.paramName,a);var c=Error.create(d,{name:f,paramName:a});c.popStackFrame();c.popStackFrame();return c};b._error=function(g,f,d){var c="Sys."+g+nb,e=c+": "+(f||b.Res[d]),a=Error.create(e,{name:c});a.popStackFrame();a.popStackFrame();return a};w.create=function(c,b){var a=new Error(c);a.message=c;if(b)for(var d in b)a[d]=b[d];a.popStackFrame();return a};w.argument=function(a,c){return b._errorArgument(x,a,c)};w.argumentNull=function(a,c){return b._errorArgument("Null",a,c)};w.argumentOutOfRange=function(f,c,h){var d="Sys.ArgumentOutOfRangeException: "+(h||b.Res.argumentOutOfRange);if(f)d+=F+String.format(b.Res.paramName,f);if(typeof c!==e&&c!==a)d+=F+String.format(b.Res.actualValue,c);var g=Error.create(d,{name:"Sys.ArgumentOutOfRangeException",paramName:f,actualValue:c});g.popStackFrame();return g};w.argumentType=function(e,d,c,f){var a="Sys.ArgumentTypeException: ";if(f)a+=f;else if(d&&c)a+=String.format(b.Res.argumentTypeWithTypes,d.getName(),c.getName());else a+=b.Res.argumentType;if(e)a+=F+String.format(b.Res.paramName,e);var g=Error.create(a,{name:"Sys.ArgumentTypeException",paramName:e,actualType:d,expectedType:c});g.popStackFrame();return g};w.argumentUndefined=function(a,c){return b._errorArgument(ob,a,c)};w.format=function(a){return b._error("Format",a,"format")};w.invalidOperation=function(a){return b._error("InvalidOperation",a,"invalidOperation")};w.notImplemented=function(a){return b._error("NotImplemented",a,"notImplemented")};w.parameterCount=function(a){return b._error("ParameterCount",a,"parameterCount")};w.prototype.popStackFrame=function(){var b=this;if(typeof b.stack===e||b.stack===a||typeof b.fileName===e||b.fileName===a||typeof b.lineNumber===e||b.lineNumber===a)return;var c=b.stack.split(F),f=c[0],h=b.fileName+":"+b.lineNumber;while(typeof f!==e&&f!==a&&f.indexOf(h)<0){c.shift();f=c[0]}var g=c[1];if(typeof g===e||g===a)return;var d=g.match(/@(.*):(\d+)$/);if(typeof d===e||d===a)return;b.fileName=d[1];b.lineNumber=parseInt(d[2]);c.shift();b.stack=c.join(F)};w=Object;w.__typeName="Object";w.__class=c;w.getType=function(b){var a=b.constructor;return!a||typeof a!==f||!a.__typeName||a.__typeName==="Object"?Object:a};w.getTypeName=function(a){return Object.getType(a).getName()};w=String;w.__typeName="String";w.__class=c;z=w.prototype;z.endsWith=function(a){return this.substr(this.length-a.length)===a};z.startsWith=function(a){return this.substr(0,a.length)===a};z.trim=function(){return this.replace(/^\s+|\s+$/g,x)};z.trimEnd=function(){return this.replace(/\s+$/,x)};z.trimStart=function(){return this.replace(/^\s+/,x)};w.format=function(){return String._toFormattedString(d,arguments)};w._toFormattedString=function(o,m){for(var f=x,h=m[0],b=0;c;){var i=h.indexOf("{",b),g=h.indexOf("}",b);if(i<0&&g<0){f+=h.slice(b);break}if(g>0&&(g<i||i<0)){f+=h.slice(b,g+1);b=g+2;continue}f+=h.slice(b,i);b=i+1;if(h.charAt(b)==="{"){f+="{";b++;continue}if(g<0)break;var k=h.substring(b,g),j=k.indexOf(":"),n=parseInt(j<0?k:k.substring(0,j),10)+1,l=j<0?x:k.substring(j+1),d=m[n];if(typeof d===e||d===a)d=x;if(d.toFormattedString)f+=d.toFormattedString(l);else if(o&&d.localeFormat)f+=d.localeFormat(l);else if(d.format)f+=d.format(l);else f+=d.toString();b=g+1}return f};w=Boolean;w.__typeName="Boolean";w.__class=c;w.parse=function(e){var b=e.trim().toLowerCase(),a;if(b==="false")a=d;else if(b==="true")a=c;return a};w=Date;w.__typeName="Date";w.__class=c;w=Number;w.__typeName="Number";w.__class=c;w=RegExp;w.__typeName="RegExp";w.__class=c;if(!g)this.window=this;g.Type=w=Function;z=w.prototype;z.callBaseMethod=function(a,e,c){var d=b._getBaseMethod(this,a,e);return c?d.apply(a,c):d.apply(a)};z.getBaseMethod=function(a,c){return b._getBaseMethod(this,a,c)};z.getBaseType=function(){return typeof this.__baseType===e?a:this.__baseType};z.getInterfaces=function(){var c=[],a=this;while(a){var b=a.__interfaces;if(b)for(var d=0,f=b.length;d<f;d++){var e=b[d];!Array.contains(c,e)&&c.push(e)}a=a.__baseType}return c};z.getName=function(){return typeof this.__typeName===e?x:this.__typeName};z.implementsInterface=function(h){var f=this;f.resolveInheritance();var g=h.getName(),a=f.__interfaceCache;if(a){var i=a[g];if(typeof i!==e)return i}else a=f.__interfaceCache={};var b=f;while(b){var j=b.__interfaces;if(j&&Array.indexOf(j,h)!==y)return a[g]=c;b=b.__baseType}return a[g]=d};z.inheritsFrom=function(a){this.resolveInheritance();return b._inheritsFrom(this,a)};b._inheritsFrom=function(e,b){var d;if(b){var a=e.__baseType;while(a){if(a===b){d=c;break}a=a.__baseType}}return!!d};z.initializeBase=function(b,c){this.resolveInheritance();var a=this.__baseType;if(a)c?a.apply(b,c):a.apply(b);return b};z.isImplementedBy=function(b){if(typeof b===e||b===a)return d;var c=Object.getType(b);return!!(c.implementsInterface&&c.implementsInterface(this))};z.isInstanceOfType=function(a){return b._isInstanceOfType(this,a)};z.registerClass=function(f,e,g){var a=this,j=a.prototype;j.constructor=a;a.__typeName=f;a.__class=c;if(e){a.__baseType=e;a.__basePrototypePending=c}b.__upperCaseTypes[f.toUpperCase()]=a;if(g)for(var i=a.__interfaces=[],d=2,k=arguments.length;d<k;d++){var h=arguments[d];i.push(h)}return a};b.registerComponent=function(d,c){var f=d.getName(),e=b.UI&&(b._inheritsFrom(d,b.UI.Control)||b._inheritsFrom(d,b.UI.Behavior)),a=c&&c.name;if(!a){a=f;var g=a.lastIndexOf(j);if(g>=0){a=a.substr(g+1);if(a&&a.charAt(0)==="_")return}a=a.substr(0,1).toLowerCase()+a.substr(1)}if(!c)c={};c.name=a;c.type=d;c.typeName=f;c._isBehavior=e;c=b.components[a]=A(b.components[a],c);var i=b._getCreate(c),h=e?b.ElementSet.prototype:b.create;h[a]=i};b.registerPlugin=function(a){var e=a.name,f=a.functionName||e;b.plugins[e]=A(b.plugins[e],a);var g=a.plugin,d;if(a.global)d=b;else if(a.dom)d=b.ElementSet.prototype;else if(a.components)d=b.ComponentSet.prototype;if(d)d[f]=b._getCreate(a,c)};b._createComp=function(d,l,f){var i=d.type,h=d.parameters||[],j=d._isBehavior,m=j?f[0]:a,c=f[h.length]||{};c=A({},l,c);p(h,function(a,g){var d=typeof a===k?a:a.name,b=f[g];if(typeof b!==e&&typeof c[d]===e)c[d]=b});if(this instanceof b.ElementSet){var g=[];this.each(function(){g.push(b._create(i,c,this))});return new b.ComponentSet(this,g)}else return b._create(i,c)};b._create=function(f,g,c){var d=typeof c;if(d===k)c=b.get(c);var a;b._2Pass(function(){a=d===e?new f:new f(c);u(a,jb);b._set(a,g);var h=b.Component;if(!h||!h._register(a))u(a,"endUpdate")||u(a,T)});return a};z.registerInterface=function(d){var a=this;b.__upperCaseTypes[d.toUpperCase()]=a;a.prototype.constructor=a;a.__typeName=d;a.__interface=c;return a};z.resolveInheritance=function(){var a=this;if(a.__basePrototypePending){var e=a.__baseType;e.resolveInheritance();var c=e.prototype,d=a.prototype;for(var b in c)d[b]=d[b]||c[b];delete a.__basePrototypePending}};w.getRootNamespaces=function(){return Array.clone(b.__rootNamespaces)};w.isClass=function(a){return!!(a&&a.__class)};w.isInterface=function(a){return!!(a&&a.__interface)};w.isNamespace=function(a){return!!(a&&a.__namespace)};w.parse=function(d,f){var c;if(f){c=b.__upperCaseTypes[f.getName().toUpperCase()+j+d.toUpperCase()];return c||a}if(!d)return a;var e=Type.__htClasses;if(!e)Type.__htClasses=e={};c=e[d];if(!c){c=g.eval(d);e[d]=c}return c};w.registerNamespace=function(a){Type._registerNamespace(a)};w._registerNamespace=function(h){for(var f=g,e=h.split(j),d=0,k=e.length;d<k;d++){var i=e[d],a=f[i];if(!a)a=f[i]={};if(!a.__namespace){!d&&h!=="Sys"&&b.__rootNamespaces.push(a);a.__namespace=c;a.__typeName=e.slice(0,d+1).join(j);a.getName=function(){return this.__typeName}}f=a}};w._checkDependency=function(f,a){var g=Type._registerScript._scripts,c=g?!!g[f]:d;if(typeof a!==e&&!c)throw Error.invalidOperation(String.format(b.Res.requiredScriptReferenceNotIncluded,a,f));return c};w._registerScript=function(a,e){var d=Type._registerScript._scripts;if(!d)Type._registerScript._scripts=d={};if(d[a])throw Error.invalidOperation(String.format(b.Res.scriptAlreadyLoaded,a));d[a]=c;if(e)for(var f=0,h=e.length;f<h;f++){var g=e[f];if(!Type._checkDependency(g))throw Error.invalidOperation(String.format(b.Res.scriptDependencyNotFound,a,g));}};w._registerNamespace("Sys");b.__upperCaseTypes={};b.__rootNamespaces=[b];b._isInstanceOfType=function(g,f){if(typeof f===e||f===a)return d;if(f instanceof g)return c;var b=Object.getType(f);return!!(b===g)||b.inheritsFrom&&b.inheritsFrom(g)||b.implementsInterface&&b.implementsInterface(g)};b._getBaseMethod=function(e,f,d){var c=e.getBaseType();if(c){var b=c.prototype[d];return b instanceof Function?b:a}return a};b._isDomElement=function(a){var e=d;if(typeof a.nodeType!==i){var c=a.ownerDocument||a.document||a;if(c!=a){var f=c.defaultView||c.parentWindow;e=f!=a}else e=!c.body||!b._isDomElement(c.body)}return!e};var ib=b._isBrowser=function(a){return b.Browser.agent===b.Browser[a]};p(b._ns,w._registerNamespace);delete b._ns;w=Array;w.__typeName="Array";w.__class=c;var tb=b._indexOf=function(d,f,a){if(typeof f===e)return y;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(d[b]===f)return b}return y};w.add=w.enqueue=function(a,b){a[a.length]=b};w.addRange=function(a,b){a.push.apply(a,b)};w.clear=function(a){a.length=0};w.clone=function(b){return b.length===1?[b[0]]:Array.apply(a,b)};w.contains=function(a,b){return tb(a,b)>=0};w.dequeue=function(a){return a.shift()};w.forEach=function(b,f,d){for(var a=0,g=b.length;a<g;a++){var c=b[a];typeof c!==e&&f.call(d,c,a,b)}};w.indexOf=tb;w.insert=function(a,b,c){a.splice(b,0,c)};w.parse=function(a){return a?g.eval("("+a+")"):[]};w.remove=function(b,c){var a=tb(b,c);a>=0&&b.splice(a,1);return a>=0};w.removeAt=function(a,b){a.splice(b,1)};Type._registerScript._scripts={"MicrosoftAjaxCore.js":c,"MicrosoftAjaxGlobalization.js":c,"MicrosoftAjaxSerialization.js":c,"MicrosoftAjaxComponentModel.js":c,"MicrosoftAjaxHistory.js":c,"MicrosoftAjaxNetwork.js":c,"MicrosoftAjaxWebServices.js":c};w=b.IDisposable=function(){};w.registerInterface("Sys.IDisposable");w=b.StringBuilder=function(b){this._parts=typeof b!==e&&b!==a&&b!==x?[b.toString()]:[];this._value={};this._len=0};w.prototype={append:function(a){this._parts.push(a);return this},appendLine:function(b){this._parts.push(typeof b===e||b===a||b===x?"\r\n":b+"\r\n");return this},clear:function(){this._parts=[];this._value={};this._len=0},isEmpty:function(){return!this._parts.length||!this.toString()},toString:function(b){var d=this;b=b||x;var c=d._parts;if(d._len!==c.length){d._value={};d._len=c.length}var i=d._value,h=i[b];if(typeof h===e){if(b!==x)for(var f=0;f<c.length;){var g=c[f];if(typeof g===e||g===x||g===a)c.splice(f,1);else f++}i[b]=h=c.join(b)}return h}};w.registerClass("Sys.StringBuilder");var lb=navigator.userAgent,K=b.Browser={InternetExplorer:{},Firefox:{},Safari:{},Opera:{},agent:a,hasDebuggerStatement:d,name:navigator.appName,version:parseFloat(navigator.appVersion),documentMode:0};if(lb.indexOf(" MSIE ")>y){K.agent=K.InternetExplorer;K.version=parseFloat(lb.match(/MSIE (\d+\.\d+)/)[1]);if(K.version>7&&document.documentMode>6)K.documentMode=document.documentMode;K.hasDebuggerStatement=c}else if(lb.indexOf(" Firefox/")>y){K.agent=K.Firefox;K.version=parseFloat(lb.match(/ Firefox\/(\d+\.\d+)/)[1]);K.name=S;K.hasDebuggerStatement=c}else if(lb.indexOf(" AppleWebKit/")>y){K.agent=K.Safari;K.version=parseFloat(lb.match(/ AppleWebKit\/(\d+(\.\d+)?)/)[1]);K.name="Safari"}else if(lb.indexOf("Opera/")>y)K.agent=K.Opera;w=b.EventArgs=function(){};w.registerClass("Sys.EventArgs");b.EventArgs.Empty=new b.EventArgs;w=b.CancelEventArgs=function(){b.CancelEventArgs.initializeBase(this);this._cancel=d};w.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};w.registerClass("Sys.CancelEventArgs",b.EventArgs);Type.registerNamespace("Sys.UI");w=b._Debug=function(){};w.prototype={_appendConsole:function(a){typeof Debug!==e&&Debug.writeln;g.console&&g.console.log&&g.console.log(a);g.opera&&g.opera.postError(a);g.debugService&&g.debugService.trace(a)},_getTrace:function(){var c=b.get("#TraceConsole");return c&&c.tagName.toUpperCase()==="TEXTAREA"?c:a},_appendTrace:function(b){var a=this._getTrace();if(a)a.value+=b+F},"assert":function(d,a,c){if(!d){a=c&&this.assert.caller?String.format(b.Res.assertFailedCaller,a,this.assert.caller):String.format(b.Res.assertFailed,a);confirm(String.format(b.Res.breakIntoDebugger,a))&&this.fail(a)}},clearTrace:function(){var a=this._getTrace();if(a)a.value=x},fail:function(a){this._appendConsole(a);b.Browser.hasDebuggerStatement&&g.eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){this._traceDump(a,b,c)},_traceDump:function(b,l,n,c,h){var d=this;l=l||"traceDump";c=c||x;var j=c+l+": ";if(b===a){d.trace(j+U);return}switch(typeof b){case e:d.trace(j+ob);break;case i:case k:case"boolean":d.trace(j+b);break;default:if(Date.isInstanceOfType(b)||RegExp.isInstanceOfType(b)){d.trace(j+b.toString());break}if(!h)h=[];else if(Array.contains(h,b)){d.trace(j+"...");return}h.push(b);if(b==g||b===document||g.HTMLElement&&b instanceof HTMLElement||typeof b.nodeName===k){var s=b.tagName||"DomElement";if(b.id)s+=" - "+b.id;d.trace(c+l+" {"+s+"}")}else{var q=Object.getTypeName(b);d.trace(c+l+(typeof q===k?" {"+q+"}":x));if(c===x||n){c+="    ";var m,r,t,o,p;if(b instanceof Array){r=b.length;for(m=0;m<r;m++)d._traceDump(b[m],"["+m+"]",n,c,h)}else for(o in b){p=b[o];typeof p!==f&&d._traceDump(p,o,n,c,h)}}}Array.remove(h,b)}}};w.registerClass("Sys._Debug");w=b.Debug=new b._Debug;w.isDebug=d;function Hb(e,g){var d=this,c,a,m;if(g){c=d.__lowerCaseValues;if(!c){d.__lowerCaseValues=c={};var j=d.prototype;for(var l in j)c[l.toLowerCase()]=j[l]}}else c=d.prototype;function h(c){if(typeof a!==i)throw Error.argument("value",String.format(b.Res.enumInvalidValue,c,this.__typeName));}if(!d.__flags){m=g?e.toLowerCase():e;a=c[m.trim()];typeof a!==i&&h.call(d,e);return a}else{for(var k=(g?e.toLowerCase():e).split(G),n=0,f=k.length-1;f>=0;f--){var o=k[f].trim();a=c[o];typeof a!==i&&h.call(d,e.split(G)[f].trim());n|=a}return n}}function Gb(d){var f=this;if(typeof d===e||d===a)return f.__string;var g=f.prototype,b;if(!f.__flags||d===0){for(b in g)if(g[b]===d)return b}else{var c=f.__sortedValues;if(!c){c=[];for(b in g)c.push({key:b,value:g[b]});c.sort(function(a,b){return a.value-b.value});f.__sortedValues=c}var i=[],j=d;for(b=c.length-1;b>=0;b--){var k=c[b],h=k.value;if(h===0)continue;if((h&d)===h){i.push(k.key);j-=h;if(j===0)break}}if(i.length&&j===0)return i.reverse().join(", ")}return x}w=Type;w.prototype.registerEnum=function(d,f){var a=this;b.__upperCaseTypes[d.toUpperCase()]=a;for(var e in a.prototype)a[e]=a.prototype[e];a.__typeName=d;a.parse=Hb;a.__string=a.toString();a.toString=Gb;a.__flags=f;a.__enum=c};w.isEnum=function(a){return!!(a&&a.__enum)};w.isFlags=function(a){return!!(a&&a.__flags)};w=b.CollectionChange=function(g,b,e,c,f){var d=this;d.action=g;if(b)if(!(b instanceof Array))b=[b];d.newItems=b||a;if(typeof e!==i)e=y;d.newStartingIndex=e;if(c)if(!(c instanceof Array))c=[c];d.oldItems=c||a;if(typeof f!==i)f=y;d.oldStartingIndex=f};w.registerClass("Sys.CollectionChange");w=b.NotifyCollectionChangedAction=function(){};w.prototype={add:0,remove:1,reset:2};w.registerEnum("Sys.NotifyCollectionChangedAction");w=b.NotifyCollectionChangedEventArgs=function(a){this._changes=a;b.NotifyCollectionChangedEventArgs.initializeBase(this)};w.prototype={get_changes:function(){return this._changes||[]}};w.registerClass("Sys.NotifyCollectionChangedEventArgs",b.EventArgs);w=b.Observer=function(){};w.registerClass("Sys.Observer");w.makeObservable=function(a){var d=a instanceof Array,c=b.Observer;if(a.setValue===c._observeMethods.setValue)return a;c._addMethods(a,c._observeMethods);d&&c._addMethods(a,c._arrayMethods);return a};w._addMethods=function(c,a){for(var b in a)c[b]=a[b]};w._addEventHandler=function(e,a,d){b.Observer._getContext(e,c).events._addHandler(a,d)};w.addEventHandler=function(d,a,c){b.Observer._addEventHandler(d,a,c)};w._removeEventHandler=function(e,a,d){b.Observer._getContext(e,c).events._removeHandler(a,d)};w.removeEventHandler=function(d,a,c){b.Observer._removeEventHandler(d,a,c)};w.clearEventHandlers=function(d,a){b.Observer._getContext(d,c).events._removeHandlers(a)};w.raiseEvent=function(c,f,e){var d=b.Observer._getContext(c);if(!d)return;var a=d.events.getHandler(f);a&&a(c,e||b.EventArgs.Empty)};w.addPropertyChanged=function(c,a){b.Observer._addEventHandler(c,C,a)};w.removePropertyChanged=function(c,a){b.Observer._removeEventHandler(c,C,a)};w.beginUpdate=function(a){b.Observer._getContext(a,c).updating=c};w.endUpdate=function(e){var c=b.Observer._getContext(e);if(!c||!c.updating)return;c.updating=d;var g=c.dirty;c.dirty=d;if(g){if(e instanceof Array){var f=c.changes;c.changes=a;b.Observer.raiseCollectionChanged(e,f)}b.Observer.raisePropertyChanged(e,x)}};w.isUpdating=function(c){var a=b.Observer._getContext(c);return a?a.updating:d};w._setValue=function(d,o,l){for(var g,v,p=d,i=o.split(j),n=0,r=i.length-1;n<r;n++){var q=i[n];g=d[V+q];if(typeof g===f)d=g.call(d);else d=d[q];var s=typeof d;if(d===a||s===e)throw Error.invalidOperation(String.format(b.Res.nullReferenceInPath,o));}var k,h=i[r];g=d[V+h];if(typeof g===f)k=g.call(d);else k=d[h];u(d,t+h,l)||(d[h]=l);if(k!==l){var m=b.Observer._getContext(p);if(m&&m.updating){m.dirty=c;return}b.Observer.raisePropertyChanged(p,i[0])}};w.setValue=function(c,a,d){b.Observer._setValue(c,a,d)};w.raisePropertyChanged=function(c,a){b.Observer.raiseEvent(c,C,new b.PropertyChangedEventArgs(a))};w.addCollectionChanged=function(c,a){b.Observer._addEventHandler(c,J,a)};w.removeCollectionChanged=function(c,a){b.Observer._removeEventHandler(c,J,a)};w._collectionChange=function(e,d){var a=this._getContext(e);if(a&&a.updating){a.dirty=c;var b=a.changes;if(!b)a.changes=b=[d];else b.push(d)}else{this.raiseCollectionChanged(e,[d]);this.raisePropertyChanged(e,"length")}};w.add=function(a,c){var d=new b.CollectionChange(b.NotifyCollectionChangedAction.add,[c],a.length);Array.add(a,c);b.Observer._collectionChange(a,d)};w.addRange=function(a,c){var d=new b.CollectionChange(b.NotifyCollectionChangedAction.add,c,a.length);Array.addRange(a,c);b.Observer._collectionChange(a,d)};w.clear=function(c){var d=Array.clone(c);Array.clear(c);b.Observer._collectionChange(c,new b.CollectionChange(b.NotifyCollectionChangedAction.reset,a,y,d,0))};w.insert=function(a,c,d){Array.insert(a,c,d);b.Observer._collectionChange(a,new b.CollectionChange(b.NotifyCollectionChangedAction.add,[d],c))};w.remove=function(e,f){var g=Array.indexOf(e,f);if(g!==y){Array.remove(e,f);b.Observer._collectionChange(e,new b.CollectionChange(b.NotifyCollectionChangedAction.remove,a,y,[f],g));return c}return d};w.removeAt=function(d,c){if(c>y&&c<d.length){var e=d[c];Array.removeAt(d,c);b.Observer._collectionChange(d,new b.CollectionChange(b.NotifyCollectionChangedAction.remove,a,y,[e],c))}};w.raiseCollectionChanged=function(c,a){b.Observer.raiseEvent(c,J,new b.NotifyCollectionChangedEventArgs(a))};w._observeMethods={add_propertyChanged:function(a){b.Observer._addEventHandler(this,C,a)},remove_propertyChanged:function(a){b.Observer._removeEventHandler(this,C,a)},addEventHandler:function(a,c){b.Observer._addEventHandler(this,a,c)},removeEventHandler:function(a,c){b.Observer._removeEventHandler(this,a,c)},clearEventHandlers:function(a){b.Observer._getContext(this,c).events._removeHandlers(a)},get_isUpdating:function(){return b.Observer.isUpdating(this)},beginUpdate:function(){b.Observer.beginUpdate(this)},endUpdate:function(){b.Observer.endUpdate(this)},setValue:function(c,a){b.Observer._setValue(this,c,a)},raiseEvent:function(d,c){b.Observer.raiseEvent(this,d,c||a)},raisePropertyChanged:function(a){b.Observer.raiseEvent(this,C,new b.PropertyChangedEventArgs(a))}};w._arrayMethods={add_collectionChanged:function(a){b.Observer._addEventHandler(this,J,a)},remove_collectionChanged:function(a){b.Observer._removeEventHandler(this,J,a)},add:function(a){b.Observer.add(this,a)},addRange:function(a){b.Observer.addRange(this,a)},clear:function(){b.Observer.clear(this)},insert:function(a,c){b.Observer.insert(this,a,c)},remove:function(a){return b.Observer.remove(this,a)},removeAt:function(a){b.Observer.removeAt(this,a)},raiseCollectionChanged:function(a){b.Observer.raiseEvent(this,J,new b.NotifyCollectionChangedEventArgs(a))}};w._getContext=function(c,d){var b=c._observerContext;return b?b():d?(c._observerContext=this._createContext())():a};w._createContext=function(){var a={events:new b.EventHandlerList};return function(){return a}};function N(a,c,b){return a<c||a>b}function Ib(c,a){var d=new Date,e=wb(d);if(a<B){var b=yb(d,c,e);a+=b-b%B;if(a>c.Calendar.TwoDigitYearMax)a-=B}return a}function wb(f,d){if(!d)return 0;for(var c,e=f.getTime(),b=0,g=d.length;b<g;b+=4){c=d[b+2];if(c===a||e>=c)return b}return 0}function yb(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];return a}b._appendPreOrPostMatch=function(f,b){for(var e=0,a=d,c=0,h=f.length;c<h;c++){var g=f.charAt(c);switch(g){case"'":if(a)b.push("'");else e++;a=d;break;case"\\":a&&b.push("\\");a=!a;break;default:b.push(g);a=d}}return e};w=Date;w._expandFormat=function(a,c){c=c||"F";var d=c.length;if(d===1)switch(c){case"d":return a.ShortDatePattern;case"D":return a.LongDatePattern;case"t":return a.ShortTimePattern;case"T":return a.LongTimePattern;case"f":return a.LongDatePattern+h+a.ShortTimePattern;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(b.Res.formatInvalidString);}else if(d===2&&c.charAt(0)==="%")c=c.charAt(1);return c};w._getParseRegExp=function(g,i){var h=g._parseRegExp;if(!h)g._parseRegExp=h={};else{var o=h[i];if(o)return o}var e=Date._expandFormat(g,i);e=e.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var d=["^"],p=[],j=0,m=0,l=Date._getTokenRegExp(),f;while((f=l.exec(e))!==a){var s=e.slice(j,f.index);j=l.lastIndex;m+=b._appendPreOrPostMatch(s,d);if(m%2){d.push(f[0]);continue}var q=f[0],t=q.length,c;switch(q){case W:case"ddd":case X:case"MMM":case"gg":case"g":c="(\\D+)";break;case"tt":case"t":c="(\\D*)";break;case Y:case"fff":case"ff":case"f":c="(\\d{"+t+"})";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":c="(\\d\\d?)";break;case"zzz":c="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":c="([+-]?\\d\\d?)";break;case D:c="(\\"+g.DateSeparator+")"}c&&d.push(c);p.push(f[0])}b._appendPreOrPostMatch(e.slice(j),d);d.push(n);var r=d.join(x).replace(/\s+/g,"\\s+"),k={regExp:r,groups:p};h[i]=k;return k};w._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|gg|g/g};w.parseLocale=function(a){return Date._parse(a,b.CultureInfo.CurrentCulture,arguments)};w.parseInvariant=function(a){return Date._parse(a,b.CultureInfo.InvariantCulture,arguments)};w._parse=function(k,g,l){var b,f,e,i,h,j=d;for(b=1,f=l.length;b<f;b++){i=l[b];if(i){j=c;e=Date._parseExact(k,i,g);if(e)return e}}if(!j){h=g._getDateTimeFormats();for(b=0,f=h.length;b<f;b++){e=Date._parseExact(k,h[b],g);if(e)return e}}return a};w._parseExact=function(w,J,s){w=w.trim();var e=s.dateTimeFormat,F=this._getParseRegExp(e,J),I=(new RegExp(F.regExp)).exec(w);if(I===a)return a;for(var H=F.groups,y=a,j=a,h=a,i=a,p=a,f=0,k,z=0,A=0,x=0,l=a,v=d,r=0,K=H.length;r<K;r++){var g=I[r+1];if(g){var G=H[r],m=G.length,c=parseInt(g,10);switch(G){case"dd":case"d":i=c;if(N(i,1,31))return a;break;case"MMM":case X:h=s._getMonthIndex(g,m===3);if(N(h,0,11))return a;break;case"M":case"MM":h=c-1;if(N(h,0,11))return a;break;case"y":case"yy":case Y:j=m<4?Ib(e,c):c;if(N(j,0,9999))return a;break;case"h":case"hh":f=c;if(f===12)f=0;if(N(f,0,11))return a;break;case"H":case"HH":f=c;if(N(f,0,23))return a;break;case"m":case"mm":z=c;if(N(z,0,59))return a;break;case"s":case"ss":A=c;if(N(A,0,59))return a;break;case"tt":case"t":var D=g.toUpperCase();v=D===e.PMDesignator.toUpperCase();if(!v&&D!==e.AMDesignator.toUpperCase())return a;break;case"f":case"ff":case"fff":x=c*Math.pow(10,3-m);if(N(x,0,999))return a;break;case"ddd":case W:p=s._getDayIndex(g,m===3);if(N(p,0,6))return a;break;case"zzz":var u=g.split(/:/);if(u.length!==2)return a;k=parseInt(u[0],10);if(N(k,-12,13))return a;var t=parseInt(u[1],10);if(N(t,0,59))return a;l=k*60+(g.startsWith(E)?-t:t);break;case"z":case"zz":k=c;if(N(k,-12,13))return a;l=k*60;break;case"g":case"gg":var o=g;if(!o||!e.eras)return a;o=o.toLowerCase().trim();for(var q=0,L=e.eras.length;q<L;q+=4)if(o===e.eras[q+1].toLowerCase()){y=q;break}if(y===a)return a}}}var b=new Date,C,n=e.Calendar.convert;C=n?n.fromGregorian(b)[0]:b.getFullYear();if(j===a)j=C;else if(e.eras)j+=e.eras[(y||0)+3];if(h===a)h=0;if(i===a)i=1;if(n){b=n.toGregorian(j,h,i);if(b===a)return a}else{b.setFullYear(j,h,i);if(b.getDate()!==i)return a;if(p!==a&&b.getDay()!==p)return a}if(v&&f<12)f+=12;b.setHours(f,z,A,x);if(l!==a){var B=b.getMinutes()-(l+b.getTimezoneOffset());b.setHours(b.getHours()+parseInt(B/60,10),B%60)}return b};z=w.prototype;z.format=function(a){return this._toFormattedString(a,b.CultureInfo.InvariantCulture)};z.localeFormat=function(a){return this._toFormattedString(a,b.CultureInfo.CurrentCulture)};z._toFormattedString=function(h,n){var d=this,e=n.dateTimeFormat,o=e.Calendar.convert;if(!h||!h.length||h==="i"){var a;if(n&&n.name.length)if(o)a=d._toFormattedString(e.FullDateTimePattern,n);else{var z=new Date(d.getTime()),K=wb(d,e.eras);z.setFullYear(yb(d,e,K));a=z.toLocaleString()}else a=d.toString();return a}var A=e.eras,w=h==="s";h=Date._expandFormat(e,h);a=[];var i,J=["0","00","000"];function g(c,a){var b=c+x;return a>1&&b.length<a?(J[a-2]+b).substr(-a):b}var l,t,C=/([^d]|^)(d|dd)([^d]|$)/g;function G(){if(l||t)return l;l=C.test(h);t=c;return l}var v=0,s=Date._getTokenRegExp(),k;if(!w&&o)k=o.fromGregorian(d);for(;c;){var I=s.lastIndex,m=s.exec(h),F=h.slice(I,m?m.index:h.length);v+=b._appendPreOrPostMatch(F,a);if(!m)break;if(v%2){a.push(m[0]);continue}function p(a,b){if(k)return k[b];switch(b){case 0:return a.getFullYear();case 1:return a.getMonth();case 2:return a.getDate()}}var y=m[0],f=y.length;switch(y){case"ddd":case W:q=f===3?e.AbbreviatedDayNames:e.DayNames;a.push(q[d.getDay()]);break;case"d":case"dd":l=c;a.push(g(p(d,2),f));break;case"MMM":case X:var u=f===3?Z:x,r=e[u+pb],q=e[u+qb],j=p(d,1);a.push(r&&G()?r[j]:q[j]);break;case"M":case"MM":a.push(g(p(d,1)+1,f));break;case"y":case"yy":case Y:j=k?k[0]:yb(d,e,wb(d,A),w);if(f<4)j=j%B;a.push(g(j,f));break;case"h":case"hh":i=d.getHours()%12;if(i===0)i=12;a.push(g(i,f));break;case"H":case"HH":a.push(g(d.getHours(),f));break;case"m":case"mm":a.push(g(d.getMinutes(),f));break;case"s":case"ss":a.push(g(d.getSeconds(),f));break;case"t":case"tt":j=d.getHours()<12?e.AMDesignator:e.PMDesignator;a.push(f===1?j.charAt(0):j);break;case"f":case"ff":case"fff":a.push(g(d.getMilliseconds(),3).substr(0,f));break;case"z":case"zz":i=d.getTimezoneOffset()/60;a.push((i<=0?H:E)+g(Math.floor(Math.abs(i)),f));break;case"zzz":i=d.getTimezoneOffset()/60;a.push((i<=0?H:E)+g(Math.floor(Math.abs(i)),2)+":"+g(Math.abs(d.getTimezoneOffset()%60),2));break;case"g":case"gg":e.eras&&a.push(e.eras[wb(d,A)+1]);break;case D:a.push(e.DateSeparator)}}return a.join(x)};String.localeFormat=function(){return String._toFormattedString(c,arguments)};var Fb={P:["Percent",["-n %","-n%","-%n"],["n %","n%","%n"],B],N:["Number",["(n)","-n","- n","n-","n -"],a,1],C:["Currency",["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"],["$n","n$","$ n","n $"],1]};b._toFormattedString=function(f,q){var i=this;if(!f||!f.length||f==="i")return q&&q.name.length?i.toLocaleString():i.toString();function o(a,c,d){for(var b=a.length;b<c;b++)a=d?"0"+a:a+"0";return a}function s(l,i,n,q,s){var k=n[0],m=1,r=Math.pow(10,i),p=Math.round(l*r)/r;if(!isFinite(p))p=l;l=p;var b=l+x,a=x,e,g=b.split(/e/i);b=g[0];e=g.length>1?parseInt(g[1]):0;g=b.split(j);b=g[0];a=g.length>1?g[1]:x;var t;if(e>0){a=o(a,e,d);b+=a.slice(0,e);a=a.substr(e)}else if(e<0){e=-e;b=o(b,e+1,c);a=b.slice(-e,b.length)+a;b=b.slice(0,-e)}if(i>0)a=s+(a.length>i?a.slice(0,i):o(a,i,d));else a=x;var f=b.length-1,h=x;while(f>=0){if(k===0||k>f)return b.slice(0,f+1)+(h.length?q+h+a:a);h=b.slice(f-k+1,f+1)+(h.length?q+h:x);f-=k;if(m<n.length){k=n[m];m++}}return b.slice(0,f+1)+q+h+a}var a=q.numberFormat,g=Math.abs(i);f=f||"D";var h=y;if(f.length>1)h=parseInt(f.slice(1),10);var m,e=f.charAt(0).toUpperCase();switch(e){case"D":m="n";if(h!==y)g=o(x+g,h,c);if(i<0)g=-g;break;case"C":case"N":case"P":e=Fb[e];var k=e[0];m=i<0?e[1][a[k+"NegativePattern"]]:e[2]?e[2][a[k+"PositivePattern"]]:"n";if(h===y)h=a[k+"DecimalDigits"];g=s(Math.abs(i)*e[3],h,a[k+"GroupSizes"],a[k+"GroupSeparator"],a[k+"DecimalSeparator"]);break;default:throw Error.format(b.Res.formatBadFormatSpecifier);}for(var r=/n|\$|-|%/g,l=x;c;){var t=r.lastIndex,p=r.exec(m);l+=m.slice(t,p?p.index:m.length);if(!p)break;switch(p[0]){case"n":l+=g;break;case n:l+=a.CurrencySymbol;break;case E:if(/[1-9]/.test(g))l+=a.NegativeSign;break;case"%":l+=a.PercentSymbol}}return l};w=Number;w.parseLocale=function(a){return Number._parse(a,b.CultureInfo.CurrentCulture)};w.parseInvariant=function(a){return Number._parse(a,b.CultureInfo.InvariantCulture)};w._parse=function(b,t){b=b.trim();if(b.match(/^[+-]?infinity$/i))return parseFloat(b);if(b.match(/^0x[a-f0-9]+$/i))return parseInt(b);var c=t.numberFormat,i=Number._parseNumberNegativePattern(b,c,c.NumberNegativePattern),k=i[0],f=i[1];if(k===x&&c.NumberNegativePattern!==1){i=Number._parseNumberNegativePattern(b,c,1);k=i[0];f=i[1]}if(k===x)k=H;var m,e,g=f.indexOf("e");if(g<0)g=f.indexOf("E");if(g<0){e=f;m=a}else{e=f.substr(0,g);m=f.substr(g+1)}var d,n,s=c.NumberDecimalSeparator,q=e.indexOf(s);if(q<0){d=e;n=a}else{d=e.substr(0,q);n=e.substr(q+s.length)}var p=c.NumberGroupSeparator;d=d.split(p).join(x);var r=p.replace(/\u00A0/g,h);if(p!==r)d=d.split(r).join(x);var o=k+d;if(n!==a)o+=j+n;if(m!==a){var l=Number._parseNumberNegativePattern(m,c,1);if(l[0]===x)l[0]=H;o+="e"+l[0]+l[1]}return o.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)?parseFloat(o):Number.NaN};w._parseNumberNegativePattern=function(a,d,e){var b=d.NegativeSign,c=d.PositiveSign;switch(e){case 4:b=h+b;c=h+c;case 3:if(a.endsWith(b))return[E,a.substr(0,a.length-b.length)];else if(a.endsWith(c))return[H,a.substr(0,a.length-c.length)];break;case 2:b+=h;c+=h;case 1:if(a.startsWith(b))return[E,a.substr(b.length)];else if(a.startsWith(c))return[H,a.substr(c.length)];break;case 0:if(a.startsWith("(")&&a.endsWith(")"))return[E,a.substr(1,a.length-2)]}return[x,a]};z=w.prototype;z.format=function(a){return b._toFormattedString.call(this,a,b.CultureInfo.InvariantCulture)};z.localeFormat=function(a){return b._toFormattedString.call(this,a,b.CultureInfo.CurrentCulture)};function Ab(a){return a.split(" ").join(h).toUpperCase()}function xb(b){var a=[];p(b,function(b,c){a[c]=Ab(b)});return a}function Cb(c){var b={};v(c,function(c,d){b[d]=c instanceof Array?c.length===1?[c]:Array.apply(a,c):typeof c===o?Cb(c):c});return b}w=b.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};w.prototype={_getDateTimeFormats:function(){var b=this._dateTimeFormats;if(!b){var a=this.dateTimeFormat;this._dateTimeFormats=b=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return b},_getMonthIndex:function(b,g){var a=this,c=g?"_upperAbbrMonths":"_upperMonths",e=c+"Genitive",h=a[c];if(!h){var f=g?Z:x;a[c]=xb(a.dateTimeFormat[f+qb]);a[e]=xb(a.dateTimeFormat[f+pb])}b=Ab(b);var d=tb(a[c],b);if(d<0)d=tb(a[e],b);return d},_getDayIndex:function(e,c){var a=this,b=c?"_upperAbbrDays":"_upperDays",d=a[b];if(!d)a[b]=xb(a.dateTimeFormat[(c?Z:x)+"DayNames"]);return tb(a[b],Ab(e))}};w.registerClass("Sys.CultureInfo");w._parse=function(a){var c=a.dateTimeFormat;if(c&&!c.eras)c.eras=a.eras;return new b.CultureInfo(a.name,a.numberFormat,c)};w._setup=function(){var c=this,b=g.__cultureInfo,f=["January","February","March","April","May","June","July","August","September","October","November","December",x],e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",x],h={name:x,numberFormat:{CurrencyDecimalDigits:2,CurrencyDecimalSeparator:j,CurrencyGroupSizes:[3],NumberGroupSizes:[3],PercentGroupSizes:[3],CurrencyGroupSeparator:G,CurrencySymbol:"¤",NaNSymbol:"NaN",CurrencyNegativePattern:0,NumberNegativePattern:1,PercentPositivePattern:0,PercentNegativePattern:0,NegativeInfinitySymbol:"-Infinity",NegativeSign:E,NumberDecimalDigits:2,NumberDecimalSeparator:j,NumberGroupSeparator:G,CurrencyPositivePattern:0,PositiveInfinitySymbol:"Infinity",PositiveSign:H,PercentDecimalDigits:2,PercentDecimalSeparator:j,PercentGroupSeparator:G,PercentSymbol:"%",PerMilleSymbol:"‰",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},DateSeparator:D,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:e,MonthNames:f,NativeCalendarName:"Gregorian Calendar",AbbreviatedMonthGenitiveNames:Array.clone(e),MonthGenitiveNames:Array.clone(f)},eras:[1,"A.D.",a,0]};c.InvariantCulture=c._parse(h);switch(typeof b){case k:b=g.eval("("+b+")");case o:c.CurrentCulture=c._parse(b);delete __cultureInfo;break;default:b=Cb(h);b.name="en-US";b.numberFormat.CurrencySymbol=n;var d=b.dateTimeFormat;d.FullDatePattern="dddd, MMMM dd, yyyy h:mm:ss tt";d.LongDatePattern="dddd, MMMM dd, yyyy";d.LongTimePattern="h:mm:ss tt";d.ShortDatePattern="M/d/yyyy";d.ShortTimePattern="h:mm tt";d.YearMonthPattern="MMMM, yyyy";c.CurrentCulture=c._parse(b)}};w._setup();Type.registerNamespace("Sys.Serialization");w=b.Serialization.JavaScriptSerializer=function(){};w.registerClass("Sys.Serialization.JavaScriptSerializer");w._esc={charsRegExs:{'"':/\"/g,"\\":/\\/g},chars:["\\",'"'],dateRegEx:/(^|[^\\])\"\\\/Date\((-?[0-9]+)(?:[a-zA-Z]|(?:\+|-)[0-9]{4})?\)\\\/\"/g,escapeChars:{"\\":"\\\\",'"':'\\"',"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r"},escapeRegExG:/[\"\\\x00-\x1F]/g,escapeRegEx:/[\"\\\x00-\x1F]/i,jsonRegEx:/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/g,jsonStringRegEx:/\"(\\.|[^\"\\])*\"/g};w._init=function(){for(var d=this._esc,g=d.chars,f=d.charsRegExs,e=d.escapeChars,b=0;b<32;b++){var a=String.fromCharCode(b);g[b+2]=a;f[a]=new RegExp(a,"g");e[a]=e[a]||"\\u"+("000"+b.toString(16)).slice(-4)}this._load=c};w._serializeNumberWithBuilder=function(a,c){if(!isFinite(a))throw Error.invalidOperation(b.Res.cannotSerializeNonFiniteNumbers);c.append(String(a))};w._serializeStringWithBuilder=function(a,e){e.append('"');var b=this._esc;if(b.escapeRegEx.test(a)){!this._load&&this._init();if(a.length<128)a=a.replace(b.escapeRegExG,function(a){return b.escapeChars[a]});else for(var d=0;d<34;d++){var c=b.chars[d];if(a.indexOf(c)!==y){var f=b.escapeChars[c];a=ib("Opera")||ib(S)?a.split(c).join(f):a.replace(b.charsRegExs[c],f)}}}e.append(a).append('"')};w._serializeWithBuilder=function(b,a,q,p){var h=this,g;switch(typeof b){case o:if(b)if(Number.isInstanceOfType(b))h._serializeNumberWithBuilder(b,a);else if(Boolean.isInstanceOfType(b))a.append(b);else if(String.isInstanceOfType(b))h._serializeStringWithBuilder(b,a);else if(b instanceof Array){a.append("[");for(g=0;g<b.length;++g){g&&a.append(G);h._serializeWithBuilder(b[g],a,d,p)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(').append(b.getTime()).append(')\\/"');break}var j=[],l=0;for(var m in b)if(m.charAt(0)!==n)if(m==="__type"&&l){j[l++]=j[0];j[0]=m}else j[l++]=m;q&&j.sort();a.append("{");var r;for(g=0;g<l;g++){var t=j[g],s=b[t],u=typeof s;if(u!==e&&u!==f){r&&a.append(G);h._serializeWithBuilder(t,a,q,p);a.append(":");h._serializeWithBuilder(s,a,q,p);r=c}}a.append("}")}else a.append(U);break;case i:h._serializeNumberWithBuilder(b,a);break;case k:h._serializeStringWithBuilder(b,a);break;case"boolean":a.append(b);break;default:a.append(U)}};w.serialize=function(c){var a=new b.StringBuilder;b.Serialization.JavaScriptSerializer._serializeWithBuilder(c,a,d);return a.toString()};w.deserialize=function(d,f){if(!d.length)throw Error.argument("data",b.Res.cannotDeserializeEmptyString);var h,c=b.Serialization.JavaScriptSerializer._esc;try{var e=d.replace(c.dateRegEx,"$1new Date($2)");if(f&&c.jsonRegEx.test(e.replace(c.jsonStringRegEx,x)))throw a;return g.eval("("+e+")")}catch(h){throw Error.argument("data",b.Res.cannotDeserializeInvalidJson);}};Type.registerNamespace("Sys.UI");w=b.EventHandlerList=function(){this._list={}};w.prototype={_addHandler:function(b,a){Array.add(this._getEvent(b,c),a)},addHandler:function(b,a){this._addHandler(b,a)},_removeHandler:function(c,b){var a=this._getEvent(c);if(!a)return;Array.remove(a,b)},_removeHandlers:function(b){if(!b)this._list={};else{var a=this._getEvent(b);if(!a)return;a.length=0}},removeHandler:function(b,a){this._removeHandler(b,a)},getHandler:function(c){var b=this._getEvent(c);if(!b||!b.length)return a;b=Array.clone(b);return function(c,d){for(var a=0,e=b.length;a<e;a++)b[a](c,d)}},_getEvent:function(c,d){var b=this._list[c];if(!b){if(!d)return a;this._list[c]=b=[]}return b}};w.registerClass("Sys.EventHandlerList");w=b.CommandEventArgs=function(f,c,d,e){var a=this;b.CommandEventArgs.initializeBase(a);a._commandName=f;a._commandArgument=c;a._commandSource=d;a._commandEvent=e};w.prototype={get_commandName:function(){return this._commandName||a},get_commandArgument:function(){return this._commandArgument},get_commandSource:function(){return this._commandSource||a},get_commandEvent:function(){return this._commandEvent||a}};w.registerClass("Sys.CommandEventArgs",b.CancelEventArgs);w=b.INotifyPropertyChange=function(){};w.registerInterface("Sys.INotifyPropertyChange");w=b.PropertyChangedEventArgs=function(a){b.PropertyChangedEventArgs.initializeBase(this);this._propertyName=a};w.prototype={get_propertyName:function(){return this._propertyName}};w.registerClass("Sys.PropertyChangedEventArgs",b.EventArgs);w=b.INotifyDisposing=function(){};w.registerInterface("Sys.INotifyDisposing");w=b.Component=function(){b.Application&&b.Application.registerDisposableObject(this)};w.prototype={get_events:function(){return b.Observer._getContext(this,c).events},get_id:function(){return this._id||a},set_id:function(a){this._id=a},get_isInitialized:function(){return!!this._initialized},get_isUpdating:function(){return!!this._updating},add_disposing:function(a){this._addHandler(ab,a)},remove_disposing:function(a){this._removeHandler(ab,a)},add_propertyChanged:function(a){this._addHandler(C,a)},remove_propertyChanged:function(a){this._removeHandler(C,a)},_addHandler:function(a,c){b.Observer.addEventHandler(this,a,c)},_removeHandler:function(a,c){b.Observer.removeEventHandler(this,a,c)},beginUpdate:function(){this._updating=c},dispose:function(){var a=this;b.Observer.raiseEvent(a,ab);b.Observer.clearEventHandlers(a);b.Application.unregisterDisposableObject(a);b.Application.removeComponent(a)},endUpdate:function(){var a=this;a._updating=d;!a._initialized&&a.initialize();a.updated()},initialize:function(){this._initialized=c},raisePropertyChanged:function(a){b.Observer.raisePropertyChanged(this,a)},updated:function(){}};w.registerClass("Sys.Component",a,b.IDisposable,b.INotifyPropertyChange,b.INotifyDisposing);w._setProperties=function(c,l){var e,m=Object.getType(c),h=m===Object||m===b.UI.DomElement,k=b.Component.isInstanceOfType(c)&&!c.get_isUpdating();k&&c.beginUpdate();for(var g in l){var d=l[g],i=h?a:c[V+g];if(h||typeof i!==f){var n=c[g];if(!d||typeof d!==o||h&&!n)c[g]=d;else this._setProperties(n,d)}else{var p=c[t+g];if(typeof p===f)p.apply(c,[d]);else if(d instanceof Array){e=i.apply(c);for(var j=0,q=e.length,r=d.length;j<r;j++,q++)e[q]=d[j]}else if(typeof d===o&&Object.getType(d)===Object){e=i.apply(c);this._setProperties(e,d)}}}k&&c.endUpdate()};w._setReferences=function(e,d){var a,c={};v(d,function(d,e){c[e]=a=$find(d);if(!a)throw Error.invalidOperation(String.format(b.Res.referenceNotFound,d));});b._set(e,c)};$create=w.create=function(g,d,c,h,e){var a=e?new g(e):new g;u(a,jb);d&&b.Component._setProperties(a,d);if(c)for(var f in c)a["add_"+f](c[f]);b.Component._register(a,h);return a};w._register=function(a,d,f){var g;if(b.Component.isInstanceOfType(a)){g=c;var e=b.Application;a.get_id()&&e.addComponent(a);if(e.get_isCreatingComponents()){e._createdComponents.push(a);if(d)e._addComponentToSecondPass(a,d);else!f&&a.endUpdate()}else{d&&b.Component._setReferences(a,d);!f&&a.endUpdate()}}return g};b._getComponent=function(d,c){var a=b.Application.findComponent(c);a&&d.push(a)};b._2Pass=function(d){var a=b.Application,c=!a.get_isCreatingComponents();c&&a.beginCreateComponents();p(d,function(a){a()});c&&a.endCreateComponents()};w=b.UI.MouseButton=function(){};w.prototype={leftButton:0,middleButton:1,rightButton:2};w.registerEnum("Sys.UI.MouseButton");w=b.UI.Key=function(){};w.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};w.registerEnum("Sys.UI.Key");w=b.UI.Point=function(a,b){this.x=a;this.y=b};w.registerClass("Sys.UI.Point");w=b.UI.Bounds=function(d,e,c,b){var a=this;a.x=d;a.y=e;a.height=b;a.width=c};w.registerClass("Sys.UI.Bounds");w=b.UI.DomEvent=function(h){var c=this,a=h,d=c.type=a.type.toLowerCase();c.rawEvent=a;c.altKey=a.altKey;if(typeof a.button!==e)c.button=typeof a.which!==e?a.button:a.button===4?b.UI.MouseButton.middleButton:a.button===2?b.UI.MouseButton.rightButton:b.UI.MouseButton.leftButton;if(d==="keypress")c.charCode=a.charCode||a.keyCode;else if(a.keyCode&&a.keyCode===46)c.keyCode=127;else c.keyCode=a.keyCode;c.clientX=a.clientX;c.clientY=a.clientY;c.ctrlKey=a.ctrlKey;c.target=a.target||a.srcElement;if(!d.startsWith("key"))if(typeof a.offsetX!==e&&typeof a.offsetY!==e){c.offsetX=a.offsetX;c.offsetY=a.offsetY}else if(c.target&&c.target.nodeType!==3&&typeof a.clientX===i){var f=b.UI.DomElement.getLocation(c.target),g=b.UI.DomElement._getWindow(c.target);c.offsetX=(g.pageXOffset||0)+a.clientX-f.x;c.offsetY=(g.pageYOffset||0)+a.clientY-f.y}c.screenX=a.screenX;c.screenY=a.screenY;c.shiftKey=a.shiftKey};w.prototype={preventDefault:function(){var a=this.rawEvent;if(a.preventDefault)a.preventDefault();else if(g.event)a.returnValue=d},stopPropagation:function(){var a=this.rawEvent;if(a.stopPropagation)a.stopPropagation();else if(g.event)a.cancelBubble=c}};w.registerClass("Sys.UI.DomEvent");$addHandler=w.addHandler=function(f,a,c,e){b.query(f).each(function(){var f=this,i=f.nodeType;if(i===3||i===2||i===8)return;if(!f._events)f._events={};var h=f._events[a];if(!h)f._events[a]=h=[];var j=f,g;if(f.addEventListener){g=function(a){return c.call(j,new b.UI.DomEvent(a))};f.addEventListener(a,g,d)}else if(f.attachEvent){g=function(){var d,a={};try{a=b.UI.DomElement._getWindow(j).event}catch(d){}return c.call(j,new b.UI.DomEvent(a))};f.attachEvent(q+a,g)}h.push({handler:c,browserHandler:g,autoRemove:e});e&&b.UI.DomElement._onDispose(f,b.UI.DomEvent._disposeHandlers)})};b.registerPlugin({name:"addHandler",dom:c,plugin:function(c,d,a){b.UI.DomEvent.addHandler(this.get(),c,d,a);return this}});$addHandlers=w.addHandlers=function(f,c,a,e){b.query(f).each(function(){var b=this.nodeType;if(b===3||b===2||b===8)return;for(var g in c){var f=c[g];if(a)f=Function.createDelegate(a,f);$addHandler(this,g,f,e||d)}})};b.registerPlugin({name:"addHandlers",dom:c,plugin:function(d,a,c){b.UI.DomEvent.addHandlers(this.get(),d,a,c);return this}});$clearHandlers=w.clearHandlers=function(a){b.query(a).each(function(){var a=this.nodeType;if(a===3||a===2||a===8)return;b.UI.DomEvent._clearHandlers(this,d)})};b.registerPlugin({name:"clearHandlers",dom:c,plugin:function(){b.UI.DomEvent.clearHandlers(this.get());return this}});w._clearHandlers=function(c,a){b.query(c).each(function(){var b=this.nodeType;if(b===3||b===2||b===8)return;var c=this._events;if(c)for(var g in c)for(var e=c[g],d=e.length-1;d>=0;d--){var f=e[d];(!a||f.autoRemove)&&$removeHandler(this,g,f.handler)}})};w._disposeHandlers=function(){b.UI.DomEvent._clearHandlers(this,c)};$removeHandler=w.removeHandler=function(c,a,d){b.UI.DomEvent._removeHandler(c,a,d)};w._removeHandler=function(e,c,f){b.query(e).each(function(){var b=this,i=b.nodeType;if(i===3||i===2||i===8)return;for(var h=a,g=b._events[c],e=0,j=g.length;e<j;e++)if(g[e].handler===f){h=g[e].browserHandler;break}if(b.removeEventListener)b.removeEventListener(c,h,d);else b.detachEvent&&b.detachEvent(q+c,h);g.splice(e,1)})};b.registerPlugin({name:"removeHandler",dom:c,plugin:function(a,c){b.UI.DomEvent.removeHandler(this.get(),a,c);return this}});w=b.UI.DomElement=function(){};w.registerClass("Sys.UI.DomElement");w.addCssClass=function(a,c){if(!b.UI.DomElement.containsCssClass(a,c))if(a.className===x)a.className=c;else a.className+=h+c};w.containsCssClass=function(b,a){return Array.contains(b.className.split(h),a)};w.getBounds=function(a){var c=b.UI.DomElement.getLocation(a);return new b.UI.Bounds(c.x,c.y,a.offsetWidth||0,a.offsetHeight||0)};$get=w.getElementById=function(d,c){return b.get(l+d,c||a)};if(document.documentElement.getBoundingClientRect)w.getLocation=function(d){if(d.self||d.nodeType===9||d===document.documentElement||d.parentNode===d.ownerDocument.documentElement)return new b.UI.Point(0,0);var j=d.getBoundingClientRect();if(!j)return new b.UI.Point(0,0);var n,e=d.ownerDocument,i=e.documentElement,f=Math.round(j.left)+(i.scrollLeft||(e.body?e.body.scrollLeft:0)),g=Math.round(j.top)+(i.scrollTop||(e.body?e.body.scrollTop:0));if(ib(bb)){try{var h=d.ownerDocument.parentWindow.frameElement||a;if(h){h=h.frameBorder;var k=h==="0"||h==="no"?2:0;f+=k;g+=k}}catch(n){}if(b.Browser.version===7&&!document.documentMode){var l=document.body,m=l.getBoundingClientRect(),c=(m.right-m.left)/l.clientWidth;c=Math.round(c*B);c=(c-c%5)/B;if(!isNaN(c)&&c!==1){f=Math.round(f/c);g=Math.round(g/c)}}if((document.documentMode||0)<8){f-=i.clientLeft;g-=i.clientTop}}return new b.UI.Point(f,g)};else if(ib("Safari"))w.getLocation=function(e){if(e.window&&e.window===e||e.nodeType===9)return new b.UI.Point(0,0);for(var f=0,g=0,k=a,i=a,d,c=e;c;k=c,i=d,c=c.offsetParent){d=b.UI.DomElement._getCurrentStyle(c);var h=c.tagName?c.tagName.toUpperCase():a;if((c.offsetLeft||c.offsetTop)&&(h!==O||(!i||i.position!==I))){f+=c.offsetLeft;g+=c.offsetTop}if(k&&b.Browser.version>=3){f+=parseInt(d.borderLeftWidth);g+=parseInt(d.borderTopWidth)}}d=b.UI.DomElement._getCurrentStyle(e);var l=d?d.position:a;if(l!==I)for(c=e.parentNode;c;c=c.parentNode){h=c.tagName?c.tagName.toUpperCase():a;if(h!==O&&h!==cb&&(c.scrollLeft||c.scrollTop)){f-=c.scrollLeft||0;g-=c.scrollTop||0}d=b.UI.DomElement._getCurrentStyle(c);var j=d?d.position:a;if(j&&j===I)break}return new b.UI.Point(f,g)};else w.getLocation=function(f){if(f.window&&f.window===f||f.nodeType===9)return new b.UI.Point(0,0);for(var g=0,h=0,j=a,i=a,d=a,c=f;c;j=c,i=d,c=c.offsetParent){var e=c.tagName?c.tagName.toUpperCase():a;d=b.UI.DomElement._getCurrentStyle(c);if((c.offsetLeft||c.offsetTop)&&!(e===O&&(!i||i.position!==I))){g+=c.offsetLeft;h+=c.offsetTop}if(j!==a&&d){if(e!=="TABLE"&&e!=="TD"&&e!==cb){g+=parseInt(d.borderLeftWidth)||0;h+=parseInt(d.borderTopWidth)||0}if(e==="TABLE"&&(d.position==="relative"||d.position===I)){g+=parseInt(d.marginLeft)||0;h+=parseInt(d.marginTop)||0}}}d=b.UI.DomElement._getCurrentStyle(f);var k=d?d.position:a;if(k!==I)for(c=f.parentNode;c;c=c.parentNode){e=c.tagName?c.tagName.toUpperCase():a;if(e!==O&&e!==cb&&(c.scrollLeft||c.scrollTop)){g-=c.scrollLeft||0;h-=c.scrollTop||0;d=b.UI.DomElement._getCurrentStyle(c);if(d){g+=parseInt(d.borderLeftWidth)||0;h+=parseInt(d.borderTopWidth)||0}}}return new b.UI.Point(g,h)};w.isDomElement=function(a){return b._isDomElement(a)};w.removeCssClass=function(d,c){var a=h+d.className+h,b=a.indexOf(h+c+h);if(b>=0)d.className=(a.substr(0,b)+h+a.substring(b+c.length+1,a.length)).trim()};w.resolveElement=function(d,e){var c=d;if(!c)return a;if(typeof c===k)c=b.get(l+c,e);return c};w.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){!a.onBubbleEvent(c,d)&&a._raiseBubbleEvent(c,d);return}b=b.parentNode}};w._ensureGet=function(a,c){return b.get(a,c)};w.setLocation=function(b,c,d){var a=b.style;a.position=I;a.left=c+"px";a.top=d+"px"};w.toggleCssClass=function(c,a){if(b.UI.DomElement.containsCssClass(c,a))b.UI.DomElement.removeCssClass(c,a);else b.UI.DomElement.addCssClass(c,a)};w.getVisibilityMode=function(a){return a._visibilityMode===b.UI.VisibilityMode.hide?b.UI.VisibilityMode.hide:b.UI.VisibilityMode.collapse};w.setVisibilityMode=function(a,c){b.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==c){a._visibilityMode=c;if(b.UI.DomElement.getVisible(a)===d)a.style.display=c===b.UI.VisibilityMode.hide?a._oldDisplayMode:P}};w.getVisible=function(d){var a=d.currentStyle||b.UI.DomElement._getCurrentStyle(d);return a?a.visibility!=="hidden"&&a.display!==P:c};w.setVisible=function(a,c){if(c!==b.UI.DomElement.getVisible(a)){b.UI.DomElement._ensureOldDisplayMode(a);var d=a.style;d.visibility=c?"visible":"hidden";d.display=c||a._visibilityMode===b.UI.VisibilityMode.hide?a._oldDisplayMode:P}};w.setCommand=function(d,f,a,e){b.UI.DomEvent.addHandler(d,"click",function(d){var c=e||this;b.UI.DomElement.raiseBubbleEvent(c,new b.CommandEventArgs(f,a,this,d))},c)};b.registerPlugin({name:"setCommand",dom:c,plugin:function(e,a,d){return this.addHandler("click",function(f){var c=d||this;b.UI.DomElement.raiseBubbleEvent(c,new b.CommandEventArgs(e,a,this,f))},c)}});w._ensureOldDisplayMode=function(b){if(!b._oldDisplayMode){var e=b.currentStyle||this._getCurrentStyle(b);b._oldDisplayMode=e?e.display:a;if(!b._oldDisplayMode||b._oldDisplayMode===P){var d=b.tagName,c="inline";if(/^(DIV|P|ADDRESS|BLOCKQUOTE|BODY|COL|COLGROUP|DD|DL|DT|FIELDSET|FORM|H1|H2|H3|H4|H5|H6|HR|IFRAME|LEGEND|OL|PRE|TABLE|TD|TH|TR|UL)$/i.test(d))c="block";else if(d.toUpperCase()==="LI")c="list-item";b._oldDisplayMode=c}}};w._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};w._getCurrentStyle=function(b){if(b.nodeType===3)return a;var c=this._getWindow(b);if(b.documentElement)b=b.documentElement;var d=c&&b!==c&&c.getComputedStyle?c.getComputedStyle(b,a):b.currentStyle||b.style;return d};w._onDispose=function(a,e){var c,d=a.dispose;if(d!==b.UI.DomElement._dispose){a.dispose=b.UI.DomElement._dispose;a.__msajaxdispose=c=[];typeof d===f&&c.push(d)}else c=a.__msajaxdispose;c.push(e)};w._dispose=function(){var b=this,c=b.__msajaxdispose;if(c)for(var d=0,e=c.length;d<e;d++)c[d].apply(b);b.control&&typeof b.control.dispose===f&&b.control.dispose();b.__msajaxdispose=a;b.dispose=a};w=b.IContainer=function(){};w.registerInterface("Sys.IContainer");w=b.ApplicationLoadEventArgs=function(c,a){b.ApplicationLoadEventArgs.initializeBase(this);this._components=c;this._isPartialLoad=a};w.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};w.registerClass("Sys.ApplicationLoadEventArgs",b.EventArgs);w=b._Application=function(){var a=this;b._Application.initializeBase(a);a._disposableObjects=[];a._components={};a._createdComponents=[];a._secondPassComponents=[];a._unloadHandlerDelegate=Function.createDelegate(a,a._unloadHandler);b.UI.DomEvent.addHandler(g,L,a._unloadHandlerDelegate)};w.prototype={_deleteCount:0,get_isCreatingComponents:function(){return!!this._creatingComponents},get_isDisposing:function(){return!!this._disposing},add_init:function(a){if(this._initialized)a(this,b.EventArgs.Empty);else this._addHandler(db,a)},remove_init:function(a){this._removeHandler(db,a)},add_load:function(a){this._addHandler(m,a)},remove_load:function(a){this._removeHandler(m,a)},add_unload:function(a){this._addHandler(L,a)},remove_unload:function(a){this._removeHandler(L,a)},addComponent:function(a){this._components[a.get_id()]=a},beginCreateComponents:function(){this._creatingComponents=c},dispose:function(){var a=this;if(!a._disposing){a._disposing=c;if(a._timerCookie){g.clearTimeout(a._timerCookie);delete a._timerCookie}var f=a._endRequestHandler,d=a._beginRequestHandler;if(f||d){var k=b.WebForms.PageRequestManager.getInstance();f&&k.remove_endRequest(f);d&&k.remove_beginRequest(d);delete a._endRequestHandler;delete a._beginRequestHandler}g.pageUnload&&g.pageUnload(a,b.EventArgs.Empty);b.Observer.raiseEvent(a,L);for(var i=Array.clone(a._disposableObjects),h=0,m=i.length;h<m;h++){var j=i[h];typeof j!==e&&j.dispose()}a._disposableObjects.length=0;b.UI.DomEvent.removeHandler(g,L,a._unloadHandlerDelegate);if(b._ScriptLoader){var l=b._ScriptLoader.getInstance();l&&l.dispose()}b._Application.callBaseMethod(a,eb)}},disposeElement:function(c,m){var i=this;if(c.nodeType===1){for(var h,d,b,k=c.getElementsByTagName("*"),j=k.length,l=new Array(j),e=0;e<j;e++)l[e]=k[e];for(e=j-1;e>=0;e--){var g=l[e];h=g.dispose;if(h&&typeof h===f)g.dispose();else{d=g.control;d&&typeof d.dispose===f&&d.dispose()}b=g._behaviors;b&&i._disposeComponents(b);b=g._components;if(b){i._disposeComponents(b);g._components=a}}if(!m){h=c.dispose;if(h&&typeof h===f)c.dispose();else{d=c.control;d&&typeof d.dispose===f&&d.dispose()}b=c._behaviors;b&&i._disposeComponents(b);b=c._components;if(b){i._disposeComponents(b);c._components=a}}}},endCreateComponents:function(){for(var c=this._secondPassComponents,a=0,g=c.length;a<g;a++){var f=c[a],e=f.component;b.Component._setReferences(e,f.references);e.endUpdate()}this._secondPassComponents=[];this._creatingComponents=d},findComponent:function(d,c){return c?b.IContainer.isInstanceOfType(c)?c.findComponent(d):c[d]||a:b.Application._components[d]||a},getComponents:function(){var c=[],a=this._components;for(var b in a)a.hasOwnProperty(b)&&c.push(a[b]);return c},initialize:function(){g.setTimeout(Function.createDelegate(this,this._doInitialize),0)},_doInitialize:function(){var a=this;if(!a.get_isInitialized()&&!a._disposing){b._Application.callBaseMethod(a,T);a._raiseInit();if(a.get_stateString){if(b.WebForms&&b.WebForms.PageRequestManager){var d=b.WebForms.PageRequestManager.getInstance();a._beginRequestHandler=Function.createDelegate(a,a._onPageRequestManagerBeginRequest);d.add_beginRequest(a._beginRequestHandler);a._endRequestHandler=Function.createDelegate(a,a._onPageRequestManagerEndRequest);d.add_endRequest(a._endRequestHandler)}var c=a.get_stateString();if(c!==a._currentEntry)a._navigate(c);else a._ensureHistory()}a.raiseLoad()}},notifyScriptLoaded:function(){},registerDisposableObject:function(b){if(!this._disposing){var a=this._disposableObjects,c=a.length;a[c]=b;b.__msdisposeindex=c}},raiseLoad:function(){var a=this,d=new b.ApplicationLoadEventArgs(Array.clone(a._createdComponents),!!a._loaded);a._loaded=c;b.Observer.raiseEvent(a,m,d);g.pageLoad&&g.pageLoad(a,d);a._createdComponents=[]},removeComponent:function(b){var a=b.get_id();if(a)delete this._components[a]},unregisterDisposableObject:function(a){var b=this;if(!b._disposing){var g=a.__msdisposeindex;if(typeof g===i){var c=b._disposableObjects;delete c[g];delete a.__msdisposeindex;if(++b._deleteCount>1e3){for(var d=[],f=0,h=c.length;f<h;f++){a=c[f];if(typeof a!==e){a.__msdisposeindex=d.length;d.push(a)}}b._disposableObjects=d;b._deleteCount=0}}}},_addComponentToSecondPass:function(b,a){this._secondPassComponents.push({component:b,references:a})},_disposeComponents:function(a){if(a)for(var b=a.length-1;b>=0;b--){var c=a[b];typeof c.dispose===f&&c.dispose()}},_raiseInit:function(){this.beginCreateComponents();b.Observer.raiseEvent(this,db);this.endCreateComponents()},_unloadHandler:function(){this.dispose()}};w.registerClass("Sys._Application",b.Component,b.IContainer);b.Application=new b._Application;g.$find=b.Application.findComponent;b.onReady(function(){b.Application._doInitialize()});w=b.UI.Behavior=function(a){b.UI.Behavior.initializeBase(this);this._element=a;var c=a._behaviors=a._behaviors||[];c.push(this)};w.prototype={get_element:function(){return this._element},get_id:function(){var c=b.UI.Behavior.callBaseMethod(this,"get_id");if(c)return c;var a=this._element;return!a||!a.id?x:a.id+n+this.get_name()},get_name:function(){var a=this;if(a._name)return a._name;var b=Object.getTypeName(a),c=b.lastIndexOf(j);if(c>=0)b=b.substr(c+1);if(!a._initialized)a._name=b;return b},set_name:function(a){this._name=a},initialize:function(){var a=this;b.UI.Behavior.callBaseMethod(a,T);var c=a.get_name();if(c)a._element[c]=a},dispose:function(){var c=this;b.UI.Behavior.callBaseMethod(c,eb);var d=c._element;if(d){var f=c.get_name();if(f)d[f]=a;var e=d._behaviors;Array.remove(e,c);if(!e.length)d._behaviors=a;delete c._element}}};w.registerClass("Sys.UI.Behavior",b.Component);w.getBehaviorByName=function(d,e){var c=d[e];return c&&b.UI.Behavior.isInstanceOfType(c)?c:a};w.getBehaviors=function(b){var a=b._behaviors;return a?Array.clone(a):[]};b.UI.Behavior.getBehaviorsByType=function(e,f){var a=e._behaviors,d=[];if(a)for(var b=0,g=a.length;b<g;b++){var c=a[b];f.isInstanceOfType(c)&&d.push(c)}return d};w=b.UI.VisibilityMode=function(){};w.prototype={hide:0,collapse:1};w.registerEnum("Sys.UI.VisibilityMode");w=b.UI.Control=function(c){var a=this;b.UI.Control.initializeBase(a);a._element=c;c.control=a;var d=a.get_role();d&&c.setAttribute("role",d)};w.prototype={_parent:a,_visibilityMode:b.UI.VisibilityMode.hide,get_element:function(){return this._element},get_id:function(){return this._id||(this._element?this._element.id:x)},get_parent:function(){var c=this;if(c._parent)return c._parent;if(!c._element)return a;var b=c._element.parentNode;while(b){if(b.control)return b.control;b=b.parentNode}return a},set_parent:function(a){this._parent=a},get_role:function(){return a},get_visibilityMode:function(){return b.UI.DomElement.getVisibilityMode(this._element)},set_visibilityMode:function(a){b.UI.DomElement.setVisibilityMode(this._element,a)},get_visible:function(){return b.UI.DomElement.getVisible(this._element)},set_visible:function(a){b.UI.DomElement.setVisible(this._element,a)},addCssClass:function(a){b.UI.DomElement.addCssClass(this._element,a)},dispose:function(){var c=this;b.UI.Control.callBaseMethod(c,eb);if(c._element){c._element.control=a;delete c._element}if(c._parent)delete c._parent},onBubbleEvent:function(){return d},raiseBubbleEvent:function(a,b){this._raiseBubbleEvent(a,b)},_raiseBubbleEvent:function(b,c){var a=this.get_parent();while(a){if(a.onBubbleEvent(b,c))return;a=a.get_parent()}},removeCssClass:function(a){b.UI.DomElement.removeCssClass(this._element,a)},toggleCssClass:function(a){b.UI.DomElement.toggleCssClass(this._element,a)}};w.registerClass("Sys.UI.Control",b.Component);w=b.HistoryEventArgs=function(a){b.HistoryEventArgs.initializeBase(this);this._state=a};w.prototype={get_state:function(){return this._state}};w.registerClass("Sys.HistoryEventArgs",b.EventArgs);w=b.Application;w._currentEntry=x;w._initialState=a;w._state={};z=b._Application.prototype;z.get_stateString=function(){var b=a;if(ib(S)){var d=g.location.href,c=d.indexOf(l);if(c!==y)b=d.substring(c+1);else b=x;return b}else b=g.location.hash;if(b.length&&b.charAt(0)===l)b=b.substring(1);return b};z.get_enableHistory=function(){return!!this._enableHistory};z.set_enableHistory=function(a){this._enableHistory=a};z.add_navigate=function(a){this._addHandler(fb,a)};z.remove_navigate=function(a){this._removeHandler(fb,a)};z.addHistoryPoint=function(g,j){var b=this;b._ensureHistory();var d=b._state;for(var f in g){var h=g[f];if(h===a){if(typeof d[f]!==e)delete d[f]}else d[f]=h}var i=b._serializeState(d);b._historyPointIsNew=c;b._setState(i,j);b._raiseNavigate()};z.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};z.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};z._deserializeState=function(a){var e={};a=a||x;var b=a.indexOf("&&");if(b!==y&&b+2<a.length){e.__s=a.substr(b+2);a=a.substr(0,b)}for(var g=a.split("&"),f=0,j=g.length;f<j;f++){var d=g[f],c=d.indexOf("=");if(c!==y&&c+1<d.length){var i=d.substr(0,c),h=d.substr(c+1);e[i]=decodeURIComponent(h)}}return e};z._enableHistoryInScriptManager=function(){this._enableHistory=c};z._ensureHistory=function(){var a=this;if(!a._historyInitialized&&a._enableHistory){if(ib(bb)&&b.Browser.documentMode<8){a._historyFrame=b.get("#__historyFrame");a._ignoreIFrame=c}a._timerHandler=Function.createDelegate(a,a._onIdle);a._timerCookie=g.setTimeout(a._timerHandler,B);var d;try{a._initialState=a._deserializeState(a.get_stateString())}catch(d){}a._historyInitialized=c}};z._navigate=function(d){var a=this;a._ensureHistory();var c=a._deserializeState(d);if(a._uniqueId){var e=a._state.__s||x,b=c.__s||x;if(b!==e){a._updateHiddenField(b);__doPostBack(a._uniqueId,b);a._state=c;return}}a._setState(d);a._state=c;a._raiseNavigate()};z._onIdle=function(){var a=this;delete a._timerCookie;var b=a.get_stateString();if(b!==a._currentEntry){if(!a._ignoreTimer){a._historyPointIsNew=d;a._navigate(b)}}else a._ignoreTimer=d;a._timerCookie=g.setTimeout(a._timerHandler,B)};z._onIFrameLoad=function(b){var a=this;a._ensureHistory();if(!a._ignoreIFrame){a._historyPointIsNew=d;a._navigate(b)}a._ignoreIFrame=d};z._onPageRequestManagerBeginRequest=function(){this._ignoreTimer=c;this._originalTitle=document.title};z._onPageRequestManagerEndRequest=function(n,m){var f=this,j=m.get_dataItems()[f._clientId],i=f._originalTitle;f._originalTitle=a;var h=b.get("#__EVENTTARGET");if(h&&h.value===f._uniqueId)h.value=x;if(typeof j!==e){f.setServerState(j);f._historyPointIsNew=c}else f._ignoreTimer=d;var g=f._serializeState(f._state);if(g!==f._currentEntry){f._ignoreTimer=c;if(typeof i===k){if(!ib(bb)||b.Browser.version>7){var l=document.title;document.title=i;f._setState(g);document.title=l}else f._setState(g);f._raiseNavigate()}else{f._setState(g);f._raiseNavigate()}}};z._raiseNavigate=function(){var a=this,e=a._historyPointIsNew,d={};for(var c in a._state)if(c!=="__s")d[c]=a._state[c];var f=new b.HistoryEventArgs(d);b.Observer.raiseEvent(a,fb,f);if(!e){var h;try{if(ib(S)&&g.location.hash&&(!g.frameElement||g.top.location.hash))b.Browser.version<3.5?g.history.go(0):(location.hash=a.get_stateString())}catch(h){}}};z._serializeState=function(d){var c=[];for(var a in d){var e=d[a];if(a==="__s")var b=e;else c.push(a+"="+encodeURIComponent(e))}return c.join("&")+(b?"&&"+b:x)};z._setState=function(h,i){var f=this;if(f._enableHistory){h=h||x;if(h!==f._currentEntry){if(g.theForm){var k=g.theForm.action,m=k.indexOf(l);g.theForm.action=(m!==y?k.substring(0,m):k)+l+h}if(f._historyFrame&&f._historyPointIsNew){f._ignoreIFrame=c;var j=f._historyFrame.contentWindow.document;j.open("javascript:'<html></html>'");j.write("<html><head><title>"+(i||document.title)+'</title><script type="text/javascript">parent.Sys.Application._onIFrameLoad('+b.Serialization.JavaScriptSerializer.serialize(h)+");<\/script></head><body></body></html>");j.close()}f._ignoreTimer=d;f._currentEntry=h;if(f._historyFrame||f._historyPointIsNew){var n=f.get_stateString();if(h!==n){g.location.hash=h;f._currentEntry=f.get_stateString();if(typeof i!==e&&i!==a)document.title=i}}f._historyPointIsNew=d}}};z._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};if(!g.XMLHttpRequest)g.XMLHttpRequest=function(){for(var e,c=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"],b=0,d=c.length;b<d;b++)try{return new ActiveXObject(c[b])}catch(e){}return a};Type.registerNamespace("Sys.Net");w=b.Net.WebRequestExecutor=function(){this._webRequest=a;this._resultObject=a};var R=function(){};w.prototype={get_started:R,get_responseAvailable:R,get_timedOut:R,get_aborted:R,get_responseData:R,get_statusCode:R,get_statusText:R,get_xml:R,executeRequest:R,abort:R,getAllResponseHeaders:R,getResponseHeader:R,get_webRequest:function(){return this._webRequest},_set_webRequest:function(a){this._webRequest=a},get_object:function(){var a=this._resultObject;if(!a)this._resultObject=a=b.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());return a}};w.registerClass("Sys.Net.WebRequestExecutor");b.Net.XMLDOM=function(f){if(!g.DOMParser)for(var j,e=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"],c=0,i=e.length;c<i;c++)try{var b=new ActiveXObject(e[c]);b.async=d;b.loadXML(f);b.setProperty(rb,"XPath");return b}catch(j){}else try{var h=new g.DOMParser;return h.parseFromString(f,kb)}catch(j){}return a};w=b.Net.XMLHttpExecutor=function(){var f=this;b.Net.XMLHttpExecutor.initializeBase(f);var d=f;f._onReadyStateChange=function(){if(d._xmlHttpRequest.readyState===4){try{if(typeof d._xmlHttpRequest.status===e)return}catch(f){return}d._clearTimer();d._responseAvailable=c;try{d._webRequest.completed(b.EventArgs.Empty)}finally{if(d._xmlHttpRequest){d._xmlHttpRequest.onreadystatechange=Function.emptyMethod;d._xmlHttpRequest=a}}}};f._clearTimer=function(){if(d._timer){g.clearTimeout(d._timer);d._timer=a}};f._onTimeout=function(){if(!d._responseAvailable){d._clearTimer();d._timedOut=c;var e=d._xmlHttpRequest;e.onreadystatechange=Function.emptyMethod;e.abort();d._webRequest.completed(b.EventArgs.Empty);d._xmlHttpRequest=a}}};w.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(){var b=this,e=b.get_webRequest();b._webRequest=e;var i=e.get_body(),h=e.get_headers(),d=new XMLHttpRequest;b._xmlHttpRequest=d;d.onreadystatechange=b._onReadyStateChange;var l=e.get_httpVerb();d.open(l,e.getResolvedUrl(),c);d.setRequestHeader("X-Requested-With","XMLHttpRequest");if(h)for(var k in h){var m=h[k];typeof m!==f&&d.setRequestHeader(k,m)}if(l.toLowerCase()==="post"){(h===a||!h[M])&&d.setRequestHeader(M,"application/x-www-form-urlencoded; charset=utf-8");if(!i)i=x}var j=e.get_timeout();if(j>0)b._timer=g.setTimeout(Function.createDelegate(b,b._onTimeout),j);d.send(i);b._started=c},getResponseHeader:function(b){var c,a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a=x;return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var b,a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var d="parsererror",e=this._xmlHttpRequest,c=e.responseXML;if(!c||!c.documentElement){c=b.Net.XMLDOM(e.responseText);if(!c||!c.documentElement)return a}else navigator.userAgent.indexOf("MSIE")!==y&&c.setProperty(rb,"XPath");return c.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&c.documentElement.tagName===d?a:c.documentElement.firstChild&&c.documentElement.firstChild.tagName===d?a:c},abort:function(){var d=this;if(d._aborted||d._responseAvailable||d._timedOut)return;d._aborted=c;d._clearTimer();var e=d._xmlHttpRequest;if(e&&!d._responseAvailable){e.onreadystatechange=Function.emptyMethod;e.abort();d._xmlHttpRequest=a;d._webRequest.completed(b.EventArgs.Empty)}}};w.registerClass(vb,b.Net.WebRequestExecutor);w=b.Net._WebRequestManager=function(){this._defaultExecutorType=vb};w.prototype={add_invokingRequest:function(a){b.Observer.addEventHandler(this,gb,a)},remove_invokingRequest:function(a){b.Observer.removeEventHandler(this,gb,a)},add_completedRequest:function(a){b.Observer.addEventHandler(this,hb,a)},remove_completedRequest:function(a){b.Observer.removeEventHandler(this,hb,a)},get_defaultTimeout:function(){return this._defaultTimeout||0},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(d){var a=d.get_executor();if(!a){var i,h;try{var f=g.eval(this._defaultExecutorType);a=new f}catch(i){h=c}d.set_executor(a)}if(!a.get_aborted()){var e=new b.Net.NetworkRequestEventArgs(d);b.Observer.raiseEvent(this,gb,e);!e.get_cancel()&&a.executeRequest()}}};w.registerClass("Sys.Net._WebRequestManager");b.Net.WebRequestManager=new b.Net._WebRequestManager;w=b.Net.NetworkRequestEventArgs=function(a){b.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};w.prototype={get_webRequest:function(){return this._webRequest}};w.registerClass("Sys.Net.NetworkRequestEventArgs",b.CancelEventArgs);w=b.Net.WebRequest=function(){var b=this;b._url=x;b._headers={};b._body=a;b._userContext=a;b._httpVerb=a};w.prototype={add_completed:function(a){b.Observer.addEventHandler(this,Q,a)},remove_completed:function(a){b.Observer.removeEventHandler(this,Q,a)},completed:function(e){var a=this;function d(g,f,d){var a=b.Observer._getContext(g,c).events.getHandler(d);a&&a(f,e)}d(b.Net.WebRequestManager,a._executor,hb);d(a,a._executor,Q);b.Observer.clearEventHandlers(a,Q)},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){return this._httpVerb===a?this._body===a?"GET":"POST":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||a},set_executor:function(a){this._executor=a;a._set_webRequest(this)},get_timeout:function(){return this._timeout||b.Net.WebRequestManager.get_defaultTimeout()},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return b.Net.WebRequest._resolveUrl(this._url)},invoke:function(){b.Net.WebRequestManager.executeRequest(this)}};w._resolveUrl=function(c,a){if(c&&c.indexOf("://")>0)return c;if(!a||!a.length){var e=b.get("base");if(e&&e.href&&e.href.length)a=e.href;else a=document.URL}var d=a.indexOf("?");if(d>0)a=a.substr(0,d);d=a.indexOf(l);if(d>0)a=a.substr(0,d);a=a.substr(0,a.lastIndexOf(D)+1);if(!c||!c.length)return a;if(c.charAt(0)===D){var f=a.indexOf("://"),h=a.indexOf(D,f+3);return a.substr(0,h)+c}else{var g=a.lastIndexOf(D);return a.substr(0,g+1)+c}};w._createQueryString=function(d,c,h){c=c||encodeURIComponent;var j=0,g,i,e,a=new b.StringBuilder;if(d)for(e in d){g=d[e];if(typeof g===f)continue;i=b.Serialization.JavaScriptSerializer.serialize(g);j++&&a.append("&");a.append(e);a.append("=");a.append(c(i))}if(h){j&&a.append("&");a.append(h)}return a.toString()};w._createUrl=function(c,d,e){if(!d&&!e)return c;var f=b.Net.WebRequest._createQueryString(d,a,e);return f.length?c+(c&&c.indexOf("?")>=0?"&":"?")+f:c};w.registerClass("Sys.Net.WebRequest");Type.registerNamespace("Sys.Net");w=b.Net.WebServiceProxy=function(){var a=Object.getType(this);if(a._staticInstance&&typeof a._staticInstance.get_enableJsonp===f)this._jsonp=a._staticInstance.get_enableJsonp()};w.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext===e?a:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||a},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||a},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return!!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||a},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||sb},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(h,i,k,j,g,f,d){var c=this;g=g||c.get_defaultSucceededCallback();f=f||c.get_defaultFailedCallback();if(d===a||typeof d===e)d=c.get_defaultUserContext();return b.Net.WebServiceProxy.invoke(h,i,k,j,g,f,d,c.get_timeout(),c.get_enableJsonp(),c.get_jsonpCallbackParameter())}};w.registerClass("Sys.Net.WebServiceProxy");w.invoke=function(v,f,r,q,p,h,l,m,C,u){var o=C!==d?b.Net.WebServiceProxy._xdomain.exec(v):a,i,s=o&&o.length===3&&(o[1]!==location.protocol||o[2]!==location.host);r=s||r;if(s){u=u||sb;i="_jsonp"+b._jsonp++}if(!q)q={};var w=q;if(!r||!w)w={};var n,k=a,t=a,A=b.Net.WebRequest._createUrl(f?v+D+encodeURIComponent(f):v,w,s?u+"=Sys."+i:a);if(s){function B(){if(k===a)return;k=a;n=new b.Net.WebServiceError(c,String.format(b.Res.webServiceTimedOut,f));delete b[i];h&&h(n,l,f)}function z(c,j){if(k!==a){g.clearTimeout(k);k=a}delete b[i];i=a;if(typeof j!==e&&j!==200){if(h){n=new b.Net.WebServiceError(d,c.Message||String.format(b.Res.webServiceFailedNoMsg,f),c.StackTrace||a,c.ExceptionType||a,c);n._statusCode=j;h(n,l,f)}}else p&&p(c,l,f)}b[i]=z;m=m||b.Net.WebRequestManager.get_defaultTimeout();if(m>0)k=g.setTimeout(B,m);b._loadJsonp(A,function(){i&&z({Message:String.format(b.Res.webServiceFailedNoMsg,f)},y)});return a}var j=new b.Net.WebRequest;j.set_url(A);j.get_headers()[M]="application/json; charset=utf-8";if(!r){t=b.Serialization.JavaScriptSerializer.serialize(q);if(t==="{}")t=x}j.set_body(t);j.add_completed(E);m>0&&j.set_timeout(m);j.invoke();function E(g){if(g.get_responseAvailable()){var s,i=g.get_statusCode(),c=a,k;try{var m=g.getResponseHeader(M);k=m.startsWith("application/json");c=k?g.get_object():m.startsWith(kb)?g.get_xml():g.get_responseData()}catch(s){}var o=g.getResponseHeader("jsonerror"),j=o==="true";if(j){if(c)c=new b.Net.WebServiceError(d,c.Message,c.StackTrace,c.ExceptionType,c)}else if(k)c=!c||typeof c.d===e?c:c.d;if(i<200||i>=300||j){if(h){if(!c||!j)c=new b.Net.WebServiceError(d,String.format(b.Res.webServiceFailedNoMsg,f));c._statusCode=i;h(c,l,f)}}else p&&p(c,l,f)}else{var n=g.get_timedOut(),q=String.format(n?b.Res.webServiceTimedOut:b.Res.webServiceFailedNoMsg,f);h&&h(new b.Net.WebServiceError(n,q,x,x),l,f)}}return j};w._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};b._jsonp=0;w._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;b._loadJsonp=function(h,g){var c=document.createElement("script");c.type="text/javascript";c.src=h;var f=c.attachEvent;function e(){if(!f||/loaded|complete/.test(c.readyState)){if(f)c.detachEvent(s,e);else{c.removeEventListener(m,e,d);c.removeEventListener(r,e,d)}g.apply(c);c=a}}if(f)c.attachEvent(s,e);else{c.addEventListener(m,e,d);c.addEventListener(r,e,d)}b.get("head").appendChild(c)};w=b.Net.WebServiceError=function(e,f,d,b,c){var a=this;a._timedOut=e;a._message=f;a._stackTrace=d;a._exceptionType=b;a._errorObject=c;a._statusCode=y};w.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||x},get_exceptionType:function(){return this._exceptionType||x},get_errorObject:function(){return this._errorObject||a}};w.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");var mb=b.Services,ub="Service",Eb="Role",Db="Authentication",Bb="Profile";function zb(a){this._path=a}mb[Db+ub]={set_path:zb,_setAuthenticated:function(a){this._auth=a}};mb["_"+Db+ub]={};mb[Bb+ub]={set_path:zb};mb["_"+Bb+ub]={};mb.ProfileGroup=function(a){this._propertygroup=a};mb[Eb+ub]={set_path:zb};mb["_"+Eb+ub]={};b._domLoaded()}if(b.loader)b.loader.registerScript("MicrosoftAjax",a,H);else H()})(window,window.Sys);var $get,$create,$addHandler,$addHandlers,$clearHandlers;
Type.registerNamespace('Sys');Sys.Res={"argumentInteger":"Value must be an integer.","argumentType":"Object cannot be converted to the required type.","argumentNull":"Value cannot be null.","scriptAlreadyLoaded":"The script \u0027{0}\u0027 has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.","scriptDependencyNotFound":"The script \u0027{0}\u0027 failed to load because it is dependent on script \u0027{1}\u0027.","formatBadFormatSpecifier":"Format specifier was invalid.","requiredScriptReferenceNotIncluded":"\u0027{0}\u0027 requires that you have included a script reference to \u0027{1}\u0027.","webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.","argumentDomElement":"Value must be a DOM element.","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.","argument":"Value does not fall within the expected range.","cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.","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.","paramName":"Parameter name: {0}","nullReferenceInPath":"Null reference while evaluating data path: \u0027{0}\u0027.","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?"};
// (c) 2010 CodePlex Foundation
(function(){function a(){var s="aria-hidden",k="status",j="submit",h="=",g="undefined",d=-1,f="",u="function",r="pageLoading",q="pageLoaded",p="initializeRequest",o="endRequest",n="beginRequest",m="script",l="error",t="readystatechange",i="load",a=null,c=true,b=false;Type._registerScript("MicrosoftAjaxWebForms.js",["MicrosoftAjaxCore.js","MicrosoftAjaxSerialization.js","MicrosoftAjaxNetwork.js","MicrosoftAjaxComponentModel.js"]);var e,v;Type.registerNamespace("Sys.WebForms");e=Sys.WebForms.BeginRequestEventArgs=function(d,c,b){var a=this;Sys.WebForms.BeginRequestEventArgs.initializeBase(a);a._request=d;a._postBackElement=c;a._updatePanelsToUpdate=b};e.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request},get_updatePanelsToUpdate:function(){return this._updatePanelsToUpdate?Array.clone(this._updatePanelsToUpdate):[]}};e.registerClass("Sys.WebForms.BeginRequestEventArgs",Sys.EventArgs);e=Sys.WebForms.EndRequestEventArgs=function(e,c,d){var a=this;Sys.WebForms.EndRequestEventArgs.initializeBase(a);a._errorHandled=b;a._error=e;a._dataItems=c||{};a._response=d};e.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}};e.registerClass("Sys.WebForms.EndRequestEventArgs",Sys.EventArgs);e=Sys.WebForms.InitializeRequestEventArgs=function(d,c,b){var a=this;Sys.WebForms.InitializeRequestEventArgs.initializeBase(a);a._request=d;a._postBackElement=c;a._updatePanelsToUpdate=b};e.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request},get_updatePanelsToUpdate:function(){return this._updatePanelsToUpdate?Array.clone(this._updatePanelsToUpdate):[]},set_updatePanelsToUpdate:function(a){this._updated=c;this._updatePanelsToUpdate=a}};e.registerClass("Sys.WebForms.InitializeRequestEventArgs",Sys.CancelEventArgs);e=Sys.WebForms.PageLoadedEventArgs=function(c,b,d){var a=this;Sys.WebForms.PageLoadedEventArgs.initializeBase(a);a._panelsUpdated=c;a._panelsCreated=b;a._dataItems=d||{}};e.prototype={get_dataItems:function(){return this._dataItems},get_panelsCreated:function(){return this._panelsCreated},get_panelsUpdated:function(){return this._panelsUpdated}};e.registerClass("Sys.WebForms.PageLoadedEventArgs",Sys.EventArgs);e=Sys.WebForms.PageLoadingEventArgs=function(c,b,d){var a=this;Sys.WebForms.PageLoadingEventArgs.initializeBase(a);a._panelsUpdating=c;a._panelsDeleting=b;a._dataItems=d||{}};e.prototype={get_dataItems:function(){return this._dataItems},get_panelsDeleting:function(){return this._panelsDeleting},get_panelsUpdating:function(){return this._panelsUpdating}};e.registerClass("Sys.WebForms.PageLoadingEventArgs",Sys.EventArgs);e=Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};e.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){var b=this;if(b._disposed)return;b._disposed=c;b._removeScriptElementHandlers();Sys._ScriptLoaderTask._clearScript(b._scriptElement);b._scriptElement=a},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){var a=this;a._scriptLoadDelegate=Function.createDelegate(a,a._scriptLoadHandler);if(document.addEventListener){a._scriptElement.readyState="loaded";$addHandler(a._scriptElement,i,a._scriptLoadDelegate)}else $addHandler(a._scriptElement,t,a._scriptLoadDelegate);if(a._scriptElement.addEventListener){a._scriptErrorDelegate=Function.createDelegate(a,a._scriptErrorHandler);a._scriptElement.addEventListener(l,a._scriptErrorDelegate,b)}},_removeScriptElementHandlers:function(){var c=this;if(c._scriptLoadDelegate){var d=c.get_scriptElement();if(document.addEventListener)$removeHandler(d,i,c._scriptLoadDelegate);else $removeHandler(d,t,c._scriptLoadDelegate);if(c._scriptErrorDelegate){c._scriptElement.removeEventListener(l,c._scriptErrorDelegate,b);c._scriptErrorDelegate=a}c._scriptLoadDelegate=a}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),b)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;this._completedCallback(a,c)}};e.registerClass("Sys._ScriptLoaderTask",a,Sys.IDisposable);e._clearScript=function(a){!Sys.Debug.isDebug&&a.parentNode.removeChild(a)};e=Sys._ScriptLoader=function(){var b=this;b._scriptsToLoad=a;b._sessions=[];b._scriptLoadedDelegate=Function.createDelegate(b,b._scriptLoadedHandler)};e.prototype={dispose:function(){var c=this;c._stopSession();c._loading=b;if(c._events)delete c._events;c._sessions=a;c._currentSession=a;c._scriptLoadedDelegate=a},loadScripts:function(f,d,e,c){var b=this,g={allScriptsLoadedCallback:d,scriptLoadFailedCallback:e,scriptLoadTimeoutCallback:c,scriptsToLoad:b._scriptsToLoad,scriptTimeout:f};b._scriptsToLoad=a;b._sessions.push(g);!b._loading&&b._nextSession()},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(b){var a=document.createElement(m);a.type="text/javascript";for(var c in b)a[c]=b[c];return a},_loadScriptsInternal:function(){var a=this,c=a._currentSession;if(c.scriptsToLoad&&c.scriptsToLoad.length>0){var d=Array.dequeue(c.scriptsToLoad),b=a._createScriptElement(d);if(b.text&&Sys.Browser.agent===Sys.Browser.Safari){b.innerHTML=b.text;delete b.text}if(typeof d.src==="string"){a._currentTask=new Sys._ScriptLoaderTask(b,a._scriptLoadedDelegate);a._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(b);Sys._ScriptLoaderTask._clearScript(b);a._loadScriptsInternal()}}else{a._stopSession();var e=c.allScriptsLoadedCallback;e&&e(a);a._nextSession()}},_nextSession:function(){var d=this;if(d._sessions.length===0){d._loading=b;d._currentSession=a;return}d._loading=c;var e=Array.dequeue(d._sessions);d._currentSession=e;if(e.scriptTimeout>0)d._timeoutCookie=window.setTimeout(Function.createDelegate(d,d._scriptLoadTimeoutHandler),e.scriptTimeout*1e3);d._loadScriptsInternal()},_raiseError:function(){var a=this,d=a._currentSession.scriptLoadFailedCallback,c=a._currentTask.get_scriptElement();a._stopSession();if(d){d(a,c);a._nextSession()}else{a._loading=b;throw Sys._ScriptLoader._errorScriptLoadFailed(c.src);}},_scriptLoadedHandler:function(c,d){var b=this;if(d){Array.add(Sys._ScriptLoader._getLoadedScripts(),c.src);b._currentTask.dispose();b._currentTask=a;b._loadScriptsInternal()}else b._raiseError()},_scriptLoadTimeoutHandler:function(){var a=this,b=a._currentSession.scriptLoadTimeoutCallback;a._stopSession();b&&b(a);a._nextSession()},_stopSession:function(){var b=this;if(b._timeoutCookie){window.clearTimeout(b._timeoutCookie);b._timeoutCookie=a}if(b._currentTask){b._currentTask.dispose();b._currentTask=a}}};e.registerClass("Sys._ScriptLoader",a,Sys.IDisposable);e.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};e.isScriptLoaded=function(b){var a=document.createElement(m);a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};e.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts)for(var c=Sys._ScriptLoader._referencedScripts=[],d=document.getElementsByTagName(m),b=d.length-1;b>=0;b--){var e=d[b],a=e.src;if(a.length)!Array.contains(c,a)&&Array.add(c,a)}};e._errorScriptLoadFailed=function(b){var a;a=Sys.Res.scriptLoadFailed;var d="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(d,{name:"Sys.ScriptLoadFailedException",scriptUrl:b});c.popStackFrame();return c};e._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};e=Sys.WebForms.PageRequestManager=function(){var c=this;c._form=a;c._activeDefaultButton=a;c._activeDefaultButtonClicked=b;c._updatePanelIDs=a;c._updatePanelClientIDs=a;c._updatePanelHasChildrenAsTriggers=a;c._asyncPostBackControlIDs=a;c._asyncPostBackControlClientIDs=a;c._postBackControlIDs=a;c._postBackControlClientIDs=a;c._scriptManagerID=a;c._pageLoadedHandler=a;c._additionalInput=a;c._onsubmit=a;c._onSubmitStatements=[];c._originalDoPostBack=a;c._originalDoPostBackWithOptions=a;c._originalFireDefaultButton=a;c._originalDoCallback=a;c._isCrossPost=b;c._postBackSettings=a;c._request=a;c._onFormSubmitHandler=a;c._onFormElementClickHandler=a;c._onWindowUnloadHandler=a;c._asyncPostBackTimeout=a;c._controlIDToFocus=a;c._scrollPosition=a;c._processingRequest=b;c._scriptDisposes={};c._transientFields=["__VIEWSTATEENCRYPTED","__VIEWSTATEFIELDCOUNT"]};e.prototype={get_isInAsyncPostBack:function(){return this._request!==a},add_beginRequest:function(a){Sys.Observer.addEventHandler(this,n,a)},remove_beginRequest:function(a){Sys.Observer.removeEventHandler(this,n,a)},add_endRequest:function(a){Sys.Observer.addEventHandler(this,o,a)},remove_endRequest:function(a){Sys.Observer.removeEventHandler(this,o,a)},add_initializeRequest:function(a){Sys.Observer.addEventHandler(this,p,a)},remove_initializeRequest:function(a){Sys.Observer.removeEventHandler(this,p,a)},add_pageLoaded:function(a){Sys.Observer.addEventHandler(this,q,a)},remove_pageLoaded:function(a){Sys.Observer.removeEventHandler(this,q,a)},add_pageLoading:function(a){Sys.Observer.addEventHandler(this,r,a)},remove_pageLoading:function(a){Sys.Observer.removeEventHandler(this,r,a)},abortPostBack:function(){var b=this;if(!b._processingRequest&&b._request){b._request.get_executor().abort();b._request=a}},beginAsyncPostBack:function(h,e,k,i,j){var d=this;if(i&&typeof Page_ClientValidate===u&&!Page_ClientValidate(j||a))return;d._postBackSettings=d._createPostBackSettings(c,h,e);var g=d._form;g.__EVENTTARGET.value=e||f;g.__EVENTARGUMENT.value=k||f;d._isCrossPost=b;d._additionalInput=a;d._onFormSubmit()},_cancelPendingCallbacks:function(){for(var b=0,g=window.__pendingCallbacks.length;b<g;b++){var e=window.__pendingCallbacks[b];if(e){if(!e.async)window.__synchronousCallBackIndex=d;window.__pendingCallbacks[b]=a;var f="__CALLBACKFRAME"+b,c=document.getElementById(f);c&&c.parentNode.removeChild(c)}}},_commitControls:function(b,d){var c=this;if(b){c._updatePanelIDs=b.updatePanelIDs;c._updatePanelClientIDs=b.updatePanelClientIDs;c._updatePanelHasChildrenAsTriggers=b.updatePanelHasChildrenAsTriggers;c._asyncPostBackControlIDs=b.asyncPostBackControlIDs;c._asyncPostBackControlClientIDs=b.asyncPostBackControlClientIDs;c._postBackControlIDs=b.postBackControlIDs;c._postBackControlClientIDs=b.postBackControlClientIDs}if(typeof d!==g&&d!==a)c._asyncPostBackTimeout=d*1e3},_createHiddenField:function(d,e){var b,a=document.getElementById(d);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=c;a.id=a.name=d;a.value=e},_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},_createPanelID:function(e,b){var c=b.asyncTarget,a=this._ensureUniqueIds(e||b.panelsToUpdate),d=a instanceof Array?a.join(","):a||this._scriptManagerID;if(c)d+="|"+c;return encodeURIComponent(this._scriptManagerID)+h+encodeURIComponent(d)+"&"},_createPostBackSettings:function(d,a,c,b){return{async:d,asyncTarget:c,panelsToUpdate:a,sourceElement:b}},_convertToClientIDs:function(a,g,e,d){if(a)for(var b=0,i=a.length;b<i;b+=d?2:1){var c=a[b],h=(d?a[b+1]:f)||this._uniqueIDToClientID(c);Array.add(g,c);Array.add(e,h)}},dispose:function(){var b=this;Sys.Observer.clearEventHandlers(b);if(b._form){Sys.UI.DomEvent.removeHandler(b._form,j,b._onFormSubmitHandler);Sys.UI.DomEvent.removeHandler(b._form,"click",b._onFormElementClickHandler);Sys.UI.DomEvent.removeHandler(window,"unload",b._onWindowUnloadHandler);Sys.UI.DomEvent.removeHandler(window,i,b._pageLoadedHandler)}if(b._originalDoPostBack){window.__doPostBack=b._originalDoPostBack;b._originalDoPostBack=a}if(b._originalDoPostBackWithOptions){window.WebForm_DoPostBackWithOptions=b._originalDoPostBackWithOptions;b._originalDoPostBackWithOptions=a}if(b._originalFireDefaultButton){window.WebForm_FireDefaultButton=b._originalFireDefaultButton;b._originalFireDefaultButton=a}if(b._originalDoCallback){window.WebForm_DoCallback=b._originalDoCallback;b._originalDoCallback=a}b._form=a;b._updatePanelIDs=a;b._updatePanelClientIDs=a;b._asyncPostBackControlIDs=a;b._asyncPostBackControlClientIDs=a;b._postBackControlIDs=a;b._postBackControlClientIDs=a;b._asyncPostBackTimeout=a;b._scrollPosition=a},_doCallback:function(d,b,c,f,a,e){!this.get_isInAsyncPostBack()&&this._originalDoCallback(d,b,c,f,a,e)},_doPostBack:function(e,l){var d=this;d._additionalInput=a;var j=d._form;if(e===a||typeof e===g||d._isCrossPost){d._postBackSettings=d._createPostBackSettings(b);d._isCrossPost=b}else{var f=d._masterPageUniqueID,k=d._uniqueIDToClientID(e),i=document.getElementById(k);if(!i&&f)if(k.indexOf(f+"$")===0)i=document.getElementById(k.substr(f.length+1));if(!i)if(Array.contains(d._asyncPostBackControlIDs,e))d._postBackSettings=d._createPostBackSettings(c,a,e);else if(Array.contains(d._postBackControlIDs,e))d._postBackSettings=d._createPostBackSettings(b);else{var h=d._findNearestElement(e);if(h)d._postBackSettings=d._getPostBackSettings(h,e);else{if(f){f+="$";if(e.indexOf(f)===0)h=d._findNearestElement(e.substr(f.length))}if(h)d._postBackSettings=d._getPostBackSettings(h,e);else d._postBackSettings=d._createPostBackSettings(b)}}else d._postBackSettings=d._getPostBackSettings(i,e)}if(!d._postBackSettings.async){j.onsubmit=d._onsubmit;d._originalDoPostBack(e,l);j.onsubmit=a;return}j.__EVENTTARGET.value=e;j.__EVENTARGUMENT.value=l;d._onFormSubmit()},_doPostBackWithOptions:function(a){this._isCrossPost=a&&a.actionUrl;this._originalDoPostBackWithOptions(a)},_elementContains:function(d,a){while(a){if(a===d)return c;a=a.parentNode}return b},_endPostBack:function(d,f,g){var c=this;if(c._request===f.get_webRequest()){c._processingRequest=b;c._additionalInput=a;c._request=a}var e=new Sys.WebForms.EndRequestEventArgs(d,g?g.dataItems:{},f);Sys.Observer.raiseEvent(c,o,e);if(d&&!e.get_errorHandled())throw d;},_ensureUniqueIds:function(a){if(!a)return a;a=a instanceof Array?a:[a];for(var c=[],b=0,g=a.length;b<g;b++){var f=a[b],e=Array.indexOf(this._updatePanelClientIDs,f);c.push(e>d?this._updatePanelIDs[e]:f)}return c},_findNearestElement:function(b){while(b.length>0){var f=this._uniqueIDToClientID(b),e=document.getElementById(f);if(e)return e;var c=b.lastIndexOf("$");if(c===d)return a;b=b.substring(0,c)}return a},_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(d,h){if(d.keyCode===13){var f=d.srcElement||d.target;if(!f||f.tagName.toLowerCase()!=="textarea"){var e=document.getElementById(h);if(e&&typeof e.click!==g){this._activeDefaultButton=e;this._activeDefaultButtonClicked=b;try{e.click()}finally{this._activeDefaultButton=a}d.cancelBubble=c;typeof d.stopPropagation===u&&d.stopPropagation();return b}}}return c},_getPageLoadedEventArgs:function(r,g){var q=[],p=[],o=g?g.version4:b,h=g?g.updatePanelData:a,i,k,l,e;if(!h){i=this._updatePanelIDs;k=this._updatePanelClientIDs;l=a;e=a}else{i=h.updatePanelIDs;k=h.updatePanelClientIDs;l=h.childUpdatePanelIDs;e=h.panelsToRefreshIDs}var c,j,n,m;if(e)for(c=0,j=e.length;c<j;c+=o?2:1){n=e[c];m=(o?e[c+1]:f)||this._uniqueIDToClientID(n);Array.add(q,document.getElementById(m))}for(c=0,j=i.length;c<j;c++)(r||Array.indexOf(l,i[c])!==d)&&Array.add(p,document.getElementById(k[c]));return new Sys.WebForms.PageLoadedEventArgs(q,p,g?g.dataItems:{})},_getPageLoadingEventArgs:function(h){var l=[],k=[],c=h.updatePanelData,m=c.oldUpdatePanelIDs,n=c.oldUpdatePanelClientIDs,p=c.updatePanelIDs,o=c.childUpdatePanelIDs,e=c.panelsToRefreshIDs,a,g,b,i,j=h.version4;for(a=0,g=e.length;a<g;a+=j?2:1){b=e[a];i=(j?e[a+1]:f)||this._uniqueIDToClientID(b);Array.add(l,document.getElementById(i))}for(a=0,g=m.length;a<g;a++){b=m[a];Array.indexOf(e,b)===d&&(Array.indexOf(p,b)===d||Array.indexOf(o,b)>d)&&Array.add(k,document.getElementById(n[a]))}return new Sys.WebForms.PageLoadingEventArgs(l,k,h.dataItems)},_getPostBackSettings:function(f,h){var e=this,i=f,g=a;while(f){if(f.id){if(!g&&Array.contains(e._asyncPostBackControlClientIDs,f.id))g=e._createPostBackSettings(c,a,h,i);else if(!g&&Array.contains(e._postBackControlClientIDs,f.id))return e._createPostBackSettings(b);else{var j=Array.indexOf(e._updatePanelClientIDs,f.id);if(j!==d)return e._updatePanelHasChildrenAsTriggers[j]?e._createPostBackSettings(c,[e._updatePanelIDs[j]],h,i):e._createPostBackSettings(c,a,h,i)}if(!g&&e._matchesParentIDInList(f.id,e._asyncPostBackControlClientIDs))g=e._createPostBackSettings(c,a,h,i);else if(!g&&e._matchesParentIDInList(f.id,e._postBackControlClientIDs))return e._createPostBackSettings(b)}f=f.parentNode}return!g?e._createPostBackSettings(b):g},_getScrollPosition:function(){var b=this,a=document.documentElement;if(a&&(b._validPosition(a.scrollLeft)||b._validPosition(a.scrollTop)))return{x:a.scrollLeft,y:a.scrollTop};else{a=document.body;return a&&(b._validPosition(a.scrollLeft)||b._validPosition(a.scrollTop))?{x:a.scrollLeft,y:a.scrollTop}:b._validPosition(window.pageXOffset)||b._validPosition(window.pageYOffset)?{x:window.pageXOffset,y:window.pageYOffset}:{x:0,y:0}}},_initializeInternal:function(k,l,d,e,h,f,g){var b=this;if(b._prmInitialized)throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);b._prmInitialized=c;b._masterPageUniqueID=g;b._scriptManagerID=k;b._form=Sys.UI.DomElement.resolveElement(l);b._onsubmit=b._form.onsubmit;b._form.onsubmit=a;b._onFormSubmitHandler=Function.createDelegate(b,b._onFormSubmit);b._onFormElementClickHandler=Function.createDelegate(b,b._onFormElementClick);b._onWindowUnloadHandler=Function.createDelegate(b,b._onWindowUnload);Sys.UI.DomEvent.addHandler(b._form,j,b._onFormSubmitHandler);Sys.UI.DomEvent.addHandler(b._form,"click",b._onFormElementClickHandler);Sys.UI.DomEvent.addHandler(window,"unload",b._onWindowUnloadHandler);b._originalDoPostBack=window.__doPostBack;if(b._originalDoPostBack)window.__doPostBack=Function.createDelegate(b,b._doPostBack);b._originalDoPostBackWithOptions=window.WebForm_DoPostBackWithOptions;if(b._originalDoPostBackWithOptions)window.WebForm_DoPostBackWithOptions=Function.createDelegate(b,b._doPostBackWithOptions);b._originalFireDefaultButton=window.WebForm_FireDefaultButton;if(b._originalFireDefaultButton)window.WebForm_FireDefaultButton=Function.createDelegate(b,b._fireDefaultButton);b._originalDoCallback=window.WebForm_DoCallback;if(b._originalDoCallback)window.WebForm_DoCallback=Function.createDelegate(b,b._doCallback);b._pageLoadedHandler=Function.createDelegate(b,b._pageLoadedInitialLoad);Sys.UI.DomEvent.addHandler(window,i,b._pageLoadedHandler);d&&b._updateControls(d,e,h,f,c)},_matchesParentIDInList:function(e,d){for(var a=0,f=d.length;a<f;a++)if(e.startsWith(d[a]+"_"))return c;return b},_onFormElementActive:function(a,e,f){var b=this;if(a.disabled)return;b._postBackSettings=b._getPostBackSettings(a,a.name);if(a.name){var c=a.tagName.toUpperCase();if(c==="INPUT"){var d=a.type;if(d===j)b._additionalInput=encodeURIComponent(a.name)+h+encodeURIComponent(a.value);else if(d==="image")b._additionalInput=encodeURIComponent(a.name)+".x="+e+"&"+encodeURIComponent(a.name)+".y="+f}else if(c==="BUTTON"&&a.name.length!==0&&a.type===j)b._additionalInput=encodeURIComponent(a.name)+h+encodeURIComponent(a.value)}},_onFormElementClick:function(a){this._activeDefaultButtonClicked=a.target===this._activeDefaultButton;this._onFormElementActive(a.target,a.offsetX,a.offsetY)},_onFormSubmit:function(r){var e=this,m,C,q=c,D=e._isCrossPost;e._isCrossPost=b;if(e._onsubmit)q=e._onsubmit();if(q)for(m=0,C=e._onSubmitStatements.length;m<C;m++)if(!e._onSubmitStatements[m]()){q=b;break}if(!q){r&&r.preventDefault();return}var w=e._form;if(D)return;e._activeDefaultButton&&!e._activeDefaultButtonClicked&&e._onFormElementActive(e._activeDefaultButton,0,0);if(!e._postBackSettings||!e._postBackSettings.async)return;var f=new Sys.StringBuilder,F=w.elements.length,z=e._createPanelID(a,e._postBackSettings);f.append(z);for(m=0;m<F;m++){var l=w.elements[m],o=l.name;if(typeof o===g||o===a||o.length===0||o===e._scriptManagerID)continue;var v=l.tagName.toUpperCase();if(v==="INPUT"){var t=l.type;if(t==="text"||t==="password"||t==="hidden"||(t==="checkbox"||t==="radio")&&l.checked){f.append(encodeURIComponent(o));f.append(h);f.append(encodeURIComponent(l.value));f.append("&")}}else if(v==="SELECT")for(var E=l.options.length,x=0;x<E;x++){var A=l.options[x];if(A.selected){f.append(encodeURIComponent(o));f.append(h);f.append(encodeURIComponent(A.value));f.append("&")}}else if(v==="TEXTAREA"){f.append(encodeURIComponent(o));f.append(h);f.append(encodeURIComponent(l.value));f.append("&")}}f.append("__ASYNCPOST=true&");if(e._additionalInput){f.append(e._additionalInput);e._additionalInput=a}var i=new Sys.Net.WebRequest,j=w.action;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var y=j.indexOf("#");if(y!==d)j=j.substr(0,y);var u=j.indexOf("?");if(u!==d){var B=j.substr(0,u);if(B.indexOf("%")===d)j=encodeURI(B)+j.substr(u)}else if(j.indexOf("%")===d)j=encodeURI(j)}i.set_url(j);i.get_headers()["X-MicrosoftAjax"]="Delta=true";i.get_headers()["Cache-Control"]="no-cache";i.set_timeout(e._asyncPostBackTimeout);i.add_completed(Function.createDelegate(e,e._onFormSubmitCompleted));i.set_body(f.toString());var s,k;s=e._postBackSettings.panelsToUpdate;k=new Sys.WebForms.InitializeRequestEventArgs(i,e._postBackSettings.sourceElement,s);Sys.Observer.raiseEvent(e,p,k);q=!k.get_cancel();if(!q){r&&r.preventDefault();return}if(k&&k._updated){s=k.get_updatePanelsToUpdate();i.set_body(i.get_body().replace(z,e._createPanelID(s,e._postBackSettings)))}e._scrollPosition=e._getScrollPosition();e.abortPostBack();k=new Sys.WebForms.BeginRequestEventArgs(i,e._postBackSettings.sourceElement,s||e._postBackSettings.panelsToUpdate);Sys.Observer.raiseEvent(e,n,k);e._originalDoCallback&&e._cancelPendingCallbacks();e._request=i;e._processingRequest=b;i.invoke();r&&r.preventDefault()},_onFormSubmitCompleted:function(h){var d=this;d._processingRequest=c;if(h.get_timedOut()){d._endPostBack(d._createPageRequestManagerTimeoutError(),h,a);return}if(h.get_aborted()){d._endPostBack(a,h,a);return}if(!d._request||h.get_webRequest()!==d._request)return;if(h.get_statusCode()!==200){d._endPostBack(d._createPageRequestManagerServerError(h.get_statusCode()),h,a);return}var e=d._parseDelta(h);if(!e)return;var g,j;if(e.asyncPostBackControlIDsNode&&e.postBackControlIDsNode&&e.updatePanelIDsNode&&e.panelsToRefreshNode&&e.childUpdatePanelIDsNode){var x=d._updatePanelIDs,t=d._updatePanelClientIDs,n=e.childUpdatePanelIDsNode.content,v=n.length?n.split(","):[],s=d._splitNodeIntoArray(e.asyncPostBackControlIDsNode),u=d._splitNodeIntoArray(e.postBackControlIDsNode),w=d._splitNodeIntoArray(e.updatePanelIDsNode),l=d._splitNodeIntoArray(e.panelsToRefreshNode),m=e.version4;for(g=0,j=l.length;g<j;g+=m?2:1){var o=(m?l[g+1]:f)||d._uniqueIDToClientID(l[g]);if(!document.getElementById(o)){d._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel,o)),h,e);return}}var k=d._processUpdatePanelArrays(w,s,u,m);k.oldUpdatePanelIDs=x;k.oldUpdatePanelClientIDs=t;k.childUpdatePanelIDs=v;k.panelsToRefreshIDs=l;e.updatePanelData=k}e.dataItems={};var i;for(g=0,j=e.dataItemNodes.length;g<j;g++){i=e.dataItemNodes[g];e.dataItems[i.id]=i.content}for(g=0,j=e.dataItemJsonNodes.length;g<j;g++){i=e.dataItemJsonNodes[g];e.dataItems[i.id]=Sys.Serialization.JavaScriptSerializer.deserialize(i.content)}var q=Sys.Observer._getContext(d,c).events.getHandler(r);q&&q(d,d._getPageLoadingEventArgs(e));Sys._ScriptLoader.readLoadedScripts();Sys.Application.beginCreateComponents();var p=Sys._ScriptLoader.getInstance();d._queueScripts(p,e.scriptBlockNodes,c,b);d._processingRequest=c;p.loadScripts(0,Function.createDelegate(d,Function.createCallback(d._scriptIncludesLoadComplete,e)),Function.createDelegate(d,Function.createCallback(d._scriptIncludesLoadFailed,e)),a)},_onWindowUnload:function(){this.dispose()},_pageLoaded:function(a,b){Sys.Observer.raiseEvent(this,q,this._getPageLoadedEventArgs(a,b));!a&&Sys.Application.raiseLoad()},_pageLoadedInitialLoad:function(){this._pageLoaded(c,a)},_parseDelta:function(n){var h=this,g=n.get_responseData(),i,o,K,L,J,f=0,j=a,p=[];while(f<g.length){i=g.indexOf("|",f);if(i===d){j=h._findText(g,f);break}o=parseInt(g.substring(f,i),10);if(o%1!==0){j=h._findText(g,f);break}f=i+1;i=g.indexOf("|",f);if(i===d){j=h._findText(g,f);break}K=g.substring(f,i);f=i+1;i=g.indexOf("|",f);if(i===d){j=h._findText(g,f);break}L=g.substring(f,i);f=i+1;if(f+o>=g.length){j=h._findText(g,g.length);break}J=g.substr(f,o);f+=o;if(g.charAt(f)!=="|"){j=h._findText(g,f);break}f++;Array.add(p,{type:K,id:L,content:J})}if(j){h._endPostBack(h._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails,j)),n,a);return a}for(var D=[],B=[],v=[],C=[],y=[],I=[],G=[],F=[],A=[],x=[],r,u,z,s,t,w,E,m,q=0,M=p.length;q<M;q++){var e=p[q];switch(e.type){case"#":m=e;break;case"updatePanel":Array.add(D,e);break;case"hiddenField":Array.add(B,e);break;case"arrayDeclaration":Array.add(v,e);break;case"scriptBlock":Array.add(C,e);break;case"scriptStartupBlock":Array.add(y,e);break;case"expando":Array.add(I,e);break;case"onSubmit":Array.add(G,e);break;case"asyncPostBackControlIDs":r=e;break;case"postBackControlIDs":u=e;break;case"updatePanelIDs":z=e;break;case"asyncPostBackTimeout":s=e;break;case"childUpdatePanelIDs":t=e;break;case"panelsToRefreshIDs":w=e;break;case"formAction":E=e;break;case"dataItem":Array.add(F,e);break;case"dataItemJson":Array.add(A,e);break;case"scriptDispose":Array.add(x,e);break;case"pageRedirect":if(m&&parseFloat(m.content)>=4)e.content=unescape(e.content);if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var k=document.createElement("a");k.style.display="none";k.attachEvent("onclick",H);k.href=e.content;h._form.parentNode.insertBefore(k,h._form);k.click();k.detachEvent("onclick",H);h._form.parentNode.removeChild(k);function H(a){a.cancelBubble=c}}else window.location.href=e.content;return a;case l:h._endPostBack(h._createPageRequestManagerServerError(Number.parseInvariant(e.id),e.content),n,a);return a;case"pageTitle":document.title=e.content;break;case"focus":h._controlIDToFocus=e.content;break;default:h._endPostBack(h._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken,e.type)),n,a);return a}}return{version4:m?parseFloat(m.content)>=4:b,executor:n,updatePanelNodes:D,hiddenFieldNodes:B,arrayDeclarationNodes:v,scriptBlockNodes:C,scriptStartupNodes:y,expandoNodes:I,onSubmitNodes:G,dataItemNodes:F,dataItemJsonNodes:A,scriptDisposeNodes:x,asyncPostBackControlIDsNode:r,postBackControlIDsNode:u,updatePanelIDsNode:z,asyncPostBackTimeoutNode:s,childUpdatePanelIDsNode:t,panelsToRefreshNode:w,formActionNode:E}},_processUpdatePanelArrays:function(e,r,s,g){var d,c,b;if(e){var j=e.length,k=g?2:1;d=new Array(j/k);c=new Array(j/k);b=new Array(j/k);for(var h=0,i=0;h<j;h+=k,i++){var q,a=e[h],l=g?e[h+1]:f;q=a.charAt(0)==="t";a=a.substr(1);if(!l)l=this._uniqueIDToClientID(a);b[i]=q;d[i]=a;c[i]=l}}else{d=[];c=[];b=[]}var o=[],m=[];this._convertToClientIDs(r,o,m,g);var p=[],n=[];this._convertToClientIDs(s,p,n,g);return{updatePanelIDs:d,updatePanelClientIDs:c,updatePanelHasChildrenAsTriggers:b,asyncPostBackControlIDs:o,asyncPostBackControlClientIDs:m,postBackControlIDs:p,postBackControlClientIDs:n}},_queueScripts:function(d,b,e,f){for(var a=0,h=b.length;a<h;a++){var g=b[a].id;switch(g){case"ScriptContentNoTags":if(!f)continue;d.queueScriptBlock(b[a].content);break;case"ScriptContentWithTags":var c=window.eval("("+b[a].content+")");if(c.src){if(!e||Sys._ScriptLoader.isScriptLoaded(c.src))continue}else if(!f)continue;d.queueCustomScriptTag(c);break;case"ScriptPath":if(!e||Sys._ScriptLoader.isScriptLoaded(b[a].content))continue;d.queueScriptReference(b[a].content)}}},_registerDisposeScript:function(a,b){if(!this._scriptDisposes[a])this._scriptDisposes[a]=[b];else Array.add(this._scriptDisposes[a],b)},_scriptIncludesLoadComplete:function(j,e){var i=this;if(e.executor.get_webRequest()!==i._request)return;i._commitControls(e.updatePanelData,e.asyncPostBackTimeoutNode?e.asyncPostBackTimeoutNode.content:a);if(e.formActionNode)i._form.action=e.formActionNode.content;var d,h,g;for(d=0,h=e.updatePanelNodes.length;d<h;d++){g=e.updatePanelNodes[d];var o=document.getElementById(g.id);if(!o){i._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel,g.id)),e.executor,e);return}i._updatePanel(o,g.content)}for(d=0,h=e.scriptDisposeNodes.length;d<h;d++){g=e.scriptDisposeNodes[d];i._registerDisposeScript(g.id,g.content)}for(d=0,h=i._transientFields.length;d<h;d++){var l=document.getElementById(i._transientFields[d]);if(l){var p=l._isContained?l.parentNode:l;p.parentNode.removeChild(p)}}for(d=0,h=e.hiddenFieldNodes.length;d<h;d++){g=e.hiddenFieldNodes[d];i._createHiddenField(g.id,g.content)}if(e.scriptsFailed)throw Sys._ScriptLoader._errorScriptLoadFailed(e.scriptsFailed.src,e.scriptsFailed.multipleCallbacks);i._queueScripts(j,e.scriptBlockNodes,b,c);var n=f;for(d=0,h=e.arrayDeclarationNodes.length;d<h;d++){g=e.arrayDeclarationNodes[d];n+="Sys.WebForms.PageRequestManager._addArrayElement('"+g.id+"', "+g.content+");\r\n"}var m=f;for(d=0,h=e.expandoNodes.length;d<h;d++){g=e.expandoNodes[d];m+=g.id+" = "+g.content+"\r\n"}n.length&&j.queueScriptBlock(n);m.length&&j.queueScriptBlock(m);i._queueScripts(j,e.scriptStartupNodes,c,c);var k=f;for(d=0,h=e.onSubmitNodes.length;d<h;d++){if(d===0)k="Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, function() {\r\n";k+=e.onSubmitNodes[d].content+"\r\n"}if(k.length){k+="\r\nreturn true;\r\n});\r\n";j.queueScriptBlock(k)}j.loadScripts(0,Function.createDelegate(i,Function.createCallback(i._scriptsLoadComplete,e)),a,a)},_scriptIncludesLoadFailed:function(d,c,b,a){a.scriptsFailed={src:c.src,multipleCallbacks:b};this._scriptIncludesLoadComplete(d,a)},_scriptsLoadComplete:function(k,h){var c=this,j=h.executor;if(window.__theFormPostData)window.__theFormPostData=f;if(window.__theFormPostCollection)window.__theFormPostCollection=[];window.WebForm_InitCallback&&window.WebForm_InitCallback();if(c._scrollPosition){window.scrollTo&&window.scrollTo(c._scrollPosition.x,c._scrollPosition.y);c._scrollPosition=a}Sys.Application.endCreateComponents();c._pageLoaded(b,h);c._endPostBack(a,j,h);if(c._controlIDToFocus){var d,i;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var e=$get(c._controlIDToFocus);d=e;if(e&&!WebForm_CanFocus(e))d=WebForm_FindFirstFocusableChild(e);if(d&&typeof d.contentEditable!==g){i=d.contentEditable;d.contentEditable=b}else d=a}WebForm_AutoFocus(c._controlIDToFocus);if(d)d.contentEditable=i;c._controlIDToFocus=a}},_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,e){this._commitControls(this._processUpdatePanelArrays(d,a,c,e),b)},_updatePanel:function(b,g){var a=this;for(var d in a._scriptDisposes)if(a._elementContains(b,document.getElementById(d))){for(var f=a._scriptDisposes[d],e=0,h=f.length;e<h;e++)window.eval(f[e]);delete a._scriptDisposes[d]}Sys.Application.disposeElement(b,c);b.innerHTML=g},_validPosition:function(b){return typeof b!==g&&b!==a&&b!==0}};e.getInstance=function(){var a=Sys.WebForms.PageRequestManager._instance;if(!a)a=Sys.WebForms.PageRequestManager._instance=new Sys.WebForms.PageRequestManager;return a};e._addArrayElement=function(a){if(!window[a])window[a]=[];for(var b=1,c=arguments.length;b<c;b++)Array.add(window[a],arguments[b])};e._initialize=function(){var a=Sys.WebForms.PageRequestManager.getInstance();a._initializeInternal.apply(a,arguments)};e.registerClass("Sys.WebForms.PageRequestManager");e=Sys.UI._UpdateProgress=function(d){var b=this;Sys.UI._UpdateProgress.initializeBase(b,[d]);b._displayAfter=500;b._dynamicLayout=c;b._associatedUpdatePanelId=a;b._beginRequestHandlerDelegate=a;b._startDelegate=a;b._endRequestHandlerDelegate=a;b._pageRequestManager=a;b._timerCookie=a};e.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},get_role:function(){return k},_clearTimeout:function(){if(this._timerCookie){window.clearTimeout(this._timerCookie);this._timerCookie=a}},_getUniqueID:function(c){var b=Array.indexOf(this._pageRequestManager._updatePanelClientIDs,c);return b===d?a:this._pageRequestManager._updatePanelIDs[b]},_handleBeginRequest:function(i,h){var a=this,e=h.get_postBackElement(),d=c,g=a._associatedUpdatePanelId;if(a._associatedUpdatePanelId){var f=h.get_updatePanelsToUpdate();if(f&&f.length)d=Array.contains(f,g)||Array.contains(f,a._getUniqueID(g));else d=b}while(!d&&e){if(e.id&&a._associatedUpdatePanelId===e.id)d=c;e=e.parentNode}if(d)a._timerCookie=window.setTimeout(a._startDelegate,a._displayAfter)},_startRequest:function(){var b=this;if(b._pageRequestManager.get_isInAsyncPostBack()){var c=b.get_element();if(b._dynamicLayout)c.style.display="block";else c.style.visibility="visible";b.get_role()===k&&c.setAttribute(s,"false")}b._timerCookie=a},_handleEndRequest:function(){var a=this,b=a.get_element();if(a._dynamicLayout)b.style.display="none";else b.style.visibility="hidden";a.get_role()===k&&b.setAttribute(s,"true");a._clearTimeout()},dispose:function(){var b=this;if(b._beginRequestHandlerDelegate!==a){b._pageRequestManager.remove_beginRequest(b._beginRequestHandlerDelegate);b._pageRequestManager.remove_endRequest(b._endRequestHandlerDelegate);b._beginRequestHandlerDelegate=a;b._endRequestHandlerDelegate=a}b._clearTimeout();Sys.UI._UpdateProgress.callBaseMethod(b,"dispose")},initialize:function(){var b=this;Sys.UI._UpdateProgress.callBaseMethod(b,"initialize");b.get_role()===k&&b.get_element().setAttribute(s,"true");b._beginRequestHandlerDelegate=Function.createDelegate(b,b._handleBeginRequest);b._endRequestHandlerDelegate=Function.createDelegate(b,b._handleEndRequest);b._startDelegate=Function.createDelegate(b,b._startRequest);if(Sys.WebForms&&Sys.WebForms.PageRequestManager)b._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();if(b._pageRequestManager!==a){b._pageRequestManager.add_beginRequest(b._beginRequestHandlerDelegate);b._pageRequestManager.add_endRequest(b._endRequestHandlerDelegate)}}};e.registerClass("Sys.UI._UpdateProgress",Sys.UI.Control)}if(window.Sys&&Sys.loader)Sys.loader.registerScript("WebForms",["ComponentModel","Serialization","Network"],a);else a()})();
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."};
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedCommon";function a(){var p="WatermarkChanged",l="hiddenInputToUpdateATBuffer_CommonToolkitScripts",g="HTMLEvents",r="mousemove",k="MouseEvents",m="UIEvents",o="display",q="DXImageTransform.Microsoft.Alpha",i="value",h="hidden",n="none",f="px",e="element",d="undefined",c=null,a=false,j="Sys.Extended.UI.BoxSide",b=true,s=Sys.version;if(!s&&!Sys._versionChecked){Sys._versionChecked=b;throw new Error("AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.");}Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.BoxSide=function(){};Sys.Extended.UI.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};Sys.Extended.UI.BoxSide.registerEnum(j,a);Sys.Extended.UI._CommonToolkitScripts=function(){};Sys.Extended.UI._CommonToolkitScripts.prototype={_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],getCurrentStyle:function(b,e,f){var a=c;if(b){if(b.currentStyle)a=b.currentStyle[e];else if(document.defaultView&&document.defaultView.getComputedStyle){var g=document.defaultView.getComputedStyle(b,c);if(g)a=g[e]}if(!a&&b.style.getPropertyValue)a=b.style.getPropertyValue(e);else if(!a&&b.style.getAttribute)a=b.style.getAttribute(e)}if(!a||a==""||typeof a===d)if(typeof f!=d)a=f;else a=c;return a},getInheritedBackgroundColor:function(d){var c="backgroundColor",a="#FFFFFF";if(!d)return a;var b=this.getCurrentStyle(d,c);try{while(!b||b==""||b=="transparent"||b=="rgba(0, 0, 0, 0)"){d=d.parentNode;if(!d)b=a;else b=this.getCurrentStyle(d,c)}}catch(e){b=a}return b},getLocation:function(a){return Sys.UI.DomElement.getLocation(a)},setLocation:function(b,a){Sys.UI.DomElement.setLocation(b,a.x,a.y)},getContentSize:function(a){if(!a)throw Error.argumentNull(e);var d=this.getSize(a),c=this.getBorderBox(a),b=this.getPaddingBox(a);return{width:d.width-c.horizontal-b.horizontal,height:d.height-c.vertical-b.vertical}},getSize:function(a){if(!a)throw Error.argumentNull(e);return{width:a.offsetWidth,height:a.offsetHeight}},setContentSize:function(a,c){var b="border-box",d=this;if(!a)throw Error.argumentNull(e);if(!c)throw Error.argumentNull("size");if(d.getCurrentStyle(a,"MozBoxSizing")==b||d.getCurrentStyle(a,"BoxSizing")==b){var h=d.getBorderBox(a),g=d.getPaddingBox(a);c={width:c.width+h.horizontal+g.horizontal,height:c.height+h.vertical+g.vertical}}a.style.width=c.width.toString()+f;a.style.height=c.height.toString()+f},setSize:function(a,b){if(!a)throw Error.argumentNull(e);if(!b)throw Error.argumentNull("size");var d=this.getBorderBox(a),c=this.getPaddingBox(a),f={width:b.width-d.horizontal-c.horizontal,height:b.height-d.vertical-c.vertical};this.setContentSize(a,f)},getBounds:function(a){return Sys.UI.DomElement.getBounds(a)},setBounds:function(a,b){if(!a)throw Error.argumentNull(e);if(!b)throw Error.argumentNull("bounds");this.setSize(a,b);$common.setLocation(a,b)},getClientBounds:function(){var b,a;if(document.compatMode=="CSS1Compat"){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{b=document.body.clientWidth;a=document.body.clientHeight}return new Sys.UI.Bounds(0,0,b,a)},getMarginBox:function(b){var c=this;if(!b)throw Error.argumentNull(e);var a={top:c.getMargin(b,Sys.Extended.UI.BoxSide.Top),right:c.getMargin(b,Sys.Extended.UI.BoxSide.Right),bottom:c.getMargin(b,Sys.Extended.UI.BoxSide.Bottom),left:c.getMargin(b,Sys.Extended.UI.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getBorderBox:function(b){var c=this;if(!b)throw Error.argumentNull(e);var a={top:c.getBorderWidth(b,Sys.Extended.UI.BoxSide.Top),right:c.getBorderWidth(b,Sys.Extended.UI.BoxSide.Right),bottom:c.getBorderWidth(b,Sys.Extended.UI.BoxSide.Bottom),left:c.getBorderWidth(b,Sys.Extended.UI.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getPaddingBox:function(b){var c=this;if(!b)throw Error.argumentNull(e);var a={top:c.getPadding(b,Sys.Extended.UI.BoxSide.Top),right:c.getPadding(b,Sys.Extended.UI.BoxSide.Right),bottom:c.getPadding(b,Sys.Extended.UI.BoxSide.Bottom),left:c.getPadding(b,Sys.Extended.UI.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},isBorderVisible:function(b,a){if(!b)throw Error.argumentNull(e);if(a<Sys.Extended.UI.BoxSide.Top||a>Sys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,j));var d=this._borderStyleNames[a],c=this.getCurrentStyle(b,d);return c!=n},getMargin:function(b,a){if(!b)throw Error.argumentNull(e);if(a<Sys.Extended.UI.BoxSide.Top||a>Sys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,j));var d=this._marginWidthNames[a],c=this.getCurrentStyle(b,d);try{return this.parsePadding(c)}catch(f){return 0}},getBorderWidth:function(c,a){var b=this;if(!c)throw Error.argumentNull(e);if(a<Sys.Extended.UI.BoxSide.Top||a>Sys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,j));if(!b.isBorderVisible(c,a))return 0;var f=b._borderWidthNames[a],d=b.getCurrentStyle(c,f);return b.parseBorderWidth(d)},getPadding:function(b,a){if(!b)throw Error.argumentNull(e);if(a<Sys.Extended.UI.BoxSide.Top||a>Sys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,j));var d=this._paddingWidthNames[a],c=this.getCurrentStyle(b,d);return this.parsePadding(c)},parseBorderWidth:function(d){var e=this;if(!e._borderThicknesses){var c={},a=document.createElement("div");a.style.visibility=h;a.style.position="absolute";a.style.fontSize="1px";document.body.appendChild(a);var b=document.createElement("div");b.style.height="0px";b.style.overflow=h;a.appendChild(b);var g=a.offsetHeight;b.style.borderTop="solid black";b.style.borderTopWidth="thin";c.thin=a.offsetHeight-g;b.style.borderTopWidth="medium";c.medium=a.offsetHeight-g;b.style.borderTopWidth="thick";c.thick=a.offsetHeight-g;a.removeChild(b);document.body.removeChild(a);e._borderThicknesses=c}if(d){switch(d){case"thin":case"medium":case"thick":return e._borderThicknesses[d];case"inherit":return 0}var i=e.parseUnit(d);Sys.Debug.assert(i.type==f,String.format(Sys.Extended.UI.Resources.Common_InvalidBorderWidthUnit,i.type));return i.size}return 0},parsePadding:function(a){if(a){if(a=="inherit")return 0;var b=this.parseUnit(a);b.type!==f&&Sys.Debug.fail(String.format(Sys.Extended.UI.Resources.Common_InvalidPaddingUnit,b.type));return b.size}return 0},parseUnit:function(a){if(!a)throw Error.argumentNull(i);a=a.trim().toLowerCase();for(var h=a.length,c=-1,g=0;g<h;g++){var b=a.substr(g,1);if((b<"0"||b>"9")&&b!="-"&&b!="."&&b!=",")break;c=g}if(c==-1)throw Error.create(Sys.Extended.UI.Resources.Common_UnitHasNoDigits);var e,d;if(c<h-1)e=a.substring(c+1).trim();else e=f;d=parseFloat(a.substr(0,c+1));if(e==f)d=Math.floor(d);return{size:d,type:e}},getElementOpacity:function(c){if(!c)throw Error.argumentNull(e);var d=a,f;if(c.filters){var h=c.filters;if(h.length!==0){var g=h[q];if(g){f=g.opacity/100;d=b}}}else{f=this.getCurrentStyle(c,"opacity",1);d=b}return d===a?1:parseFloat(f)},setElementOpacity:function(c,d){if(!c)throw Error.argumentNull(e);if(c.filters){var h=c.filters,f=b;if(h.length!==0){var g=h[q];if(g){f=a;g.opacity=d*100}}if(f)c.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+d*100+")"}else c.style.opacity=d},getVisible:function(a){return a&&n!=$common.getCurrentStyle(a,o)&&h!=$common.getCurrentStyle(a,"visibility")},setVisible:function(a,b){if(a&&b!=$common.getVisible(a)){if(b)if(a.style.removeAttribute)a.style.removeAttribute(o);else a.style.removeProperty(o);else a.style.display=n;a.style.visibility=b?"visible":h}},resolveFunction:function(a){if(a)if(a instanceof Function)return a;else if(String.isInstanceOfType(a)&&a.length>0){var b;if((b=window[a])instanceof Function)return b;else if((b=eval(a))instanceof Function)return b}return c},addCssClasses:function(c,b){for(var a=0;a<b.length;a++)Sys.UI.DomElement.addCssClass(c,b[a])},removeCssClasses:function(c,b){for(var a=0;a<b.length;a++)Sys.UI.DomElement.removeCssClass(c,b[a])},setStyle:function(a,b){$common.applyProperties(a.style,b)},removeHandlers:function(c,a){for(var b in a)$removeHandler(c,b,a[b])},overlaps:function(a,b){return a.x<b.x+b.width&&b.x<a.x+a.width&&a.y<b.y+b.height&&b.y<a.y+a.height},containsPoint:function(a,b,c){return b>=a.x&&b<a.x+a.width&&c>=a.y&&c<a.y+a.height},isKeyDigit:function(a){return 48<=a&&a<=57},isKeyNavigation:function(a){return Sys.UI.Key.left<=a&&a<=Sys.UI.Key.down},padLeft:function(d,c,e,b){return $common._pad(d,c||2,e||" ","l",b||a)},padRight:function(d,c,e,b){return $common._pad(d,c||2,e||" ","r",b||a)},_pad:function(c,b,h,e,g){c=c.toString();var f=c.length,d=new Sys.StringBuilder;e=="r"&&d.append(c);while(f<b){d.append(h);f++}e=="l"&&d.append(c);var a=d.toString();if(g&&a.length>b)if(e=="l")a=a.substr(a.length-b,b);else a=a.substr(0,b);return a},__DOMEvents:{focusin:{eventGroup:m,init:function(c){c.initUIEvent("focusin",b,a,window,1)}},focusout:{eventGroup:m,init:function(c){c.initUIEvent("focusout",b,a,window,1)}},activate:{eventGroup:m,init:function(a){a.initUIEvent("activate",b,b,window,1)}},focus:{eventGroup:m,init:function(b){b.initUIEvent("focus",a,a,window,1)}},blur:{eventGroup:m,init:function(b){b.initUIEvent("blur",a,a,window,1)}},click:{eventGroup:k,init:function(e,d){e.initMouseEvent("click",b,b,window,1,d.screenX||0,d.screenY||0,d.clientX||0,d.clientY||0,d.ctrlKey||a,d.altKey||a,d.shiftKey||a,d.metaKey||a,d.button||0,d.relatedTarget||c)}},dblclick:{eventGroup:k,init:function(e,d){e.initMouseEvent("click",b,b,window,2,d.screenX||0,d.screenY||0,d.clientX||0,d.clientY||0,d.ctrlKey||a,d.altKey||a,d.shiftKey||a,d.metaKey||a,d.button||0,d.relatedTarget||c)}},mousedown:{eventGroup:k,init:function(e,d){e.initMouseEvent("mousedown",b,b,window,1,d.screenX||0,d.screenY||0,d.clientX||0,d.clientY||0,d.ctrlKey||a,d.altKey||a,d.shiftKey||a,d.metaKey||a,d.button||0,d.relatedTarget||c)}},mouseup:{eventGroup:k,init:function(e,d){e.initMouseEvent("mouseup",b,b,window,1,d.screenX||0,d.screenY||0,d.clientX||0,d.clientY||0,d.ctrlKey||a,d.altKey||a,d.shiftKey||a,d.metaKey||a,d.button||0,d.relatedTarget||c)}},mouseover:{eventGroup:k,init:function(e,d){e.initMouseEvent("mouseover",b,b,window,1,d.screenX||0,d.screenY||0,d.clientX||0,d.clientY||0,d.ctrlKey||a,d.altKey||a,d.shiftKey||a,d.metaKey||a,d.button||0,d.relatedTarget||c)}},mousemove:{eventGroup:k,init:function(e,d){e.initMouseEvent(r,b,b,window,1,d.screenX||0,d.screenY||0,d.clientX||0,d.clientY||0,d.ctrlKey||a,d.altKey||a,d.shiftKey||a,d.metaKey||a,d.button||0,d.relatedTarget||c)}},mouseout:{eventGroup:k,init:function(e,d){e.initMouseEvent(r,b,b,window,1,d.screenX||0,d.screenY||0,d.clientX||0,d.clientY||0,d.ctrlKey||a,d.altKey||a,d.shiftKey||a,d.metaKey||a,d.button||0,d.relatedTarget||c)}},load:{eventGroup:g,init:function(b){b.initEvent("load",a,a)}},unload:{eventGroup:g,init:function(b){b.initEvent("unload",a,a)}},select:{eventGroup:g,init:function(c){c.initEvent("select",b,a)}},change:{eventGroup:g,init:function(c){c.initEvent("change",b,a)}},submit:{eventGroup:g,init:function(a){a.initEvent("submit",b,b)}},reset:{eventGroup:g,init:function(c){c.initEvent("reset",b,a)}},resize:{eventGroup:g,init:function(c){c.initEvent("resize",b,a)}},scroll:{eventGroup:g,init:function(c){c.initEvent("scroll",b,a)}}},tryFireRawEvent:function(c,d){try{if(c.fireEvent){c.fireEvent("on"+d.type,d);return b}else if(c.dispatchEvent){c.dispatchEvent(d);return b}}catch(e){}return a},tryFireEvent:function(g,f,e){try{if(document.createEventObject){var c=document.createEventObject();$common.applyProperties(c,e||{});g.fireEvent("on"+f,c);return b}else if(document.createEvent){var d=$common.__DOMEvents[f];if(d){var c=document.createEvent(d.eventGroup);d.init(c,e||{});g.dispatchEvent(c);return b}}}catch(c){}return a},wrapElement:function(a,b,c){var d=a.parentNode;d.replaceChild(b,a);(c||b).appendChild(a)},unwrapElement:function(b,a){var d=a.parentNode;if(d!=c){$common.removeElement(b);d.replaceChild(b,a)}},removeElement:function(a){var b=a.parentNode;b!=c&&b.removeChild(a)},applyProperties:function(e,d){for(var b in d){var a=d[b];if(a!=c&&Object.getType(a)===Object){var f=e[b];$common.applyProperties(f,a)}else e[b]=a}},createElementFromTemplate:function(a,j,e){if(typeof a.nameTable!=d){var g=a.nameTable;if(String.isInstanceOfType(g))g=e[g];if(g!=c)e=g}var l=c;if(typeof a.name!==d)l=a.name;var b=document.createElement(a.nodeName);if(typeof a.name!==d&&e)e[a.name]=b;if(typeof a.parent!==d&&j==c){var h=a.parent;if(String.isInstanceOfType(h))h=e[h];if(h!=c)j=h}typeof a.properties!==d&&a.properties!=c&&$common.applyProperties(b,a.properties);typeof a.cssClasses!==d&&a.cssClasses!=c&&$common.addCssClasses(b,a.cssClasses);typeof a.events!==d&&a.events!=c&&$addHandlers(b,a.events);typeof a.visible!==d&&a.visible!=c&&this.setVisible(b,a.visible);j&&j.appendChild(b);typeof a.opacity!==d&&a.opacity!=c&&$common.setElementOpacity(b,a.opacity);if(typeof a.children!==d&&a.children!=c)for(var k=0;k<a.children.length;k++){var m=a.children[k];$common.createElementFromTemplate(m,b,e)}var i=b;if(typeof a.contentPresenter!==d&&a.contentPresenter!=c)i=e[i];if(typeof a.content!==d&&a.content!=c){var f=a.content;if(String.isInstanceOfType(f))f=e[f];if(f.parentNode)$common.wrapElement(f,b,i);else i.appendChild(f)}return b},prepareHiddenElementForATDeviceUpdate:function(){var a=document.getElementById(l);if(!a){var a=document.createElement("input");a.setAttribute("type",h);a.setAttribute(i,"1");a.setAttribute("id",l);a.setAttribute("name",l);document.forms[0]&&document.forms[0].appendChild(a)}},updateFormToRefreshATDeviceBuffer:function(){var a=document.getElementById(l);if(a)if(a.getAttribute(i)=="1")a.setAttribute(i,"0");else a.setAttribute(i,"1")},appendElementToFormOrBody:function(a){if(document.forms&&document.forms[0])document.forms[0].appendChild(a);else document.body.appendChild(a)}};CommonToolkitScripts=Sys.Extended.UI.CommonToolkitScripts=new Sys.Extended.UI._CommonToolkitScripts;$common=CommonToolkitScripts;Sys.UI.DomElement.getVisible=$common.getVisible;Sys.UI.DomElement.setVisible=$common.setVisible;Sys.UI.Control.overlaps=$common.overlaps;Sys.Extended.UI._DomUtility=function(){};Sys.Extended.UI._DomUtility.prototype={isDescendant:function(f,e){for(var d=e.parentNode;d!=c;d=d.parentNode)if(d==f)return b;return a},isDescendantOrSelf:function(c,a){return c===a?b:Sys.Extended.UI.DomUtility.isDescendant(c,a)},isAncestor:function(a,b){return Sys.Extended.UI.DomUtility.isDescendant(b,a)},isAncestorOrSelf:function(a,c){return a===c?b:Sys.Extended.UI.DomUtility.isDescendant(c,a)},isSibling:function(f,e){for(var d=f.parentNode,c=0;c<d.childNodes.length;c++)if(d.childNodes[c]==e)return b;return a}};Sys.Extended.UI._DomUtility.registerClass("Sys.Extended.UI._DomUtility");Sys.Extended.UI.DomUtility=new Sys.Extended.UI._DomUtility;Sys.Extended.UI.TextBoxWrapper=function(d){var b=this;Sys.Extended.UI.TextBoxWrapper.initializeBase(b,[d]);b._current=d.value;b._watermark=c;b._isWatermarked=a};Sys.Extended.UI.TextBoxWrapper.prototype={dispose:function(){this.get_element().TextBoxWrapper=c;Sys.Extended.UI.TextBoxWrapper.callBaseMethod(this,"dispose")},get_Current:function(){this._current=this.get_element().value;return this._current},set_Current:function(a){this._current=a;this._updateElement()},get_Value:function(){return this.get_IsWatermarked()?"":this.get_Current()},set_Value:function(e){var d=this;d.set_Current(e);if(!e||0==e.length)c!=d._watermark&&d.set_IsWatermarked(b);else d.set_IsWatermarked(a)},get_Watermark:function(){return this._watermark},set_Watermark:function(a){this._watermark=a;this._updateElement()},get_IsWatermarked:function(){return this._isWatermarked},set_IsWatermarked:function(b){var a=this;if(a._isWatermarked!=b){a._isWatermarked=b;a._updateElement();a._raiseWatermarkChanged()}},_updateElement:function(){var a=this,b=a.get_element();if(a._isWatermarked){if(b.value!=a._watermark)b.value=a._watermark}else if(b.value!=a._current)b.value=a._current},add_WatermarkChanged:function(a){this.get_events().addHandler(p,a)},remove_WatermarkChanged:function(a){this.get_events().removeHandler(p,a)},_raiseWatermarkChanged:function(){var a=this.get_events().getHandler(p);a&&a(this,Sys.EventArgs.Empty)}};Sys.Extended.UI.TextBoxWrapper.get_Wrapper=function(a){if(c==a.TextBoxWrapper)a.TextBoxWrapper=new Sys.Extended.UI.TextBoxWrapper(a);return a.TextBoxWrapper};Sys.Extended.UI.TextBoxWrapper.registerClass("Sys.Extended.UI.TextBoxWrapper",Sys.UI.Behavior);Sys.Extended.UI.TextBoxWrapper.validatorGetValue=function(b){var a=$get(b);return a&&a.TextBoxWrapper?a.TextBoxWrapper.get_Value():Sys.Extended.UI.TextBoxWrapper._originalValidatorGetValue(b)};if(typeof ValidatorGetValue=="function"){Sys.Extended.UI.TextBoxWrapper._originalValidatorGetValue=ValidatorGetValue;ValidatorGetValue=Sys.Extended.UI.TextBoxWrapper.validatorGetValue}if(Sys.CultureInfo&&Sys.CultureInfo.prototype._getAbbrMonthIndex){Sys.CultureInfo.prototype._getAbbrMonthIndex=function(b){var a=this;if(!a._upperAbbrMonths)a._upperAbbrMonths=a._toUpperArray(a.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(a._upperAbbrMonths,a._toUpper(b))};Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex}}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ComponentModel"],a);else a()})();var $common,CommonToolkitScripts;
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedTimer";function a(){var a="tick",b="interval",c=Sys.version;if(!c&&!Sys._versionChecked){Sys._versionChecked=true;throw new Error("AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.");}Sys.Timer=function(){var a=this;Sys.Timer.initializeBase(a);a._interval=1e3;a._enabled=false;a._timer=null};Sys.Timer.prototype={get_interval:function(){return this._interval},set_interval:function(c){var a=this;if(a._interval!==c){a._interval=c;a.raisePropertyChanged(b);if(!a.get_isUpdating()&&a._timer!==null){a._stopTimer();a._startTimer()}}},get_enabled:function(){return this._enabled},set_enabled:function(b){var a=this;if(b!==a.get_enabled()){a._enabled=b;a.raisePropertyChanged("enabled");if(!a.get_isUpdating())if(b)a._startTimer();else a._stopTimer()}},add_tick:function(b){this.get_events().addHandler(a,b)},remove_tick:function(b){this.get_events().removeHandler(a,b)},dispose:function(){this.set_enabled(false);this._stopTimer();Sys.Timer.callBaseMethod(this,"dispose")},updated:function(){var a=this;Sys.Timer.callBaseMethod(a,"updated");if(a._enabled){a._stopTimer();a._startTimer()}},_timerCallback:function(){var b=this.get_events().getHandler(a);b&&b(this,Sys.EventArgs.Empty)},_startTimer:function(){var a=this;a._timer=window.setInterval(Function.createDelegate(a,a._timerCallback),a._interval)},_stopTimer:function(){window.clearInterval(this._timer);this._timer=null}};Sys.Timer.descriptor={properties:[{name:b,type:Number},{name:"enabled",type:Boolean}],events:[{name:a}]};Sys.Timer.registerClass("Sys.Timer",Sys.Component)}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ComponentModel"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedAnimations";function a(){var k="unit",x="endValue",w="startValue",h="style",y="property",v="forceLayoutInIE",u="maximumOpacity",t="minimumOpacity",j="px",q="height",p="width",g="onEnd",d="onStart",i="animations",o="step",n="ended",m="started",s="percentComplete",r="isActive",f="isPlaying",e=100,b=false,c=true,l="dispose",a=null;Type.registerNamespace("Sys.Extended.UI.Animation");$AA=Sys.Extended.UI.Animation;$AA.registerAnimation=function(c,b){if(b&&(b===$AA.Animation||b.inheritsFrom&&b.inheritsFrom($AA.Animation))){if(!$AA.__animations)$AA.__animations={};$AA.__animations[c.toLowerCase()]=b;b.play=function(){var c=new b;b.apply(c,arguments);c.initialize();var d=Function.createDelegate(c,function(){c.remove_ended(d);d=a;c.dispose()});c.add_ended(d);c.play()}}else throw Error.argumentType("type",b,$AA.Animation,Sys.Extended.UI.Resources.Animation_InvalidBaseType);};$AA.buildAnimation=function(b,d){if(!b||b==="")return a;var c;b="("+b+")";if(!Sys.Debug.isDebug)try{c=Sys.Serialization.JavaScriptSerializer.deserialize(b)}catch(e){}else c=Sys.Serialization.JavaScriptSerializer.deserialize(b);return $AA.createAnimation(c,d)};$AA.createAnimation=function(d,l){var a="obj";if(!d||!d.AnimationName)throw Error.argument(a,Sys.Extended.UI.Resources.Animation_MissingAnimationName);var c=$AA.__animations[d.AnimationName.toLowerCase()];if(!c)throw Error.argument("type",String.format(Sys.Extended.UI.Resources.Animation_UknownAnimationName,d.AnimationName));var e=new c;l&&e.set_target(l);if(d.AnimationChildren&&d.AnimationChildren.length)if($AA.ParentAnimation.isInstanceOfType(e))for(var k=0;k<d.AnimationChildren.length;k++){var m=$AA.createAnimation(d.AnimationChildren[k]);m&&e.add(m)}else throw Error.argument(a,String.format(Sys.Extended.UI.Resources.Animation_ChildrenNotAllowed,c.getName()));var h=c.__animationProperties;if(!h){c.__animationProperties={};c.resolveInheritance();for(var j in c.prototype)if(j.startsWith("set_"))c.__animationProperties[j.substr(4).toLowerCase()]=j;delete c.__animationProperties.id;h=c.__animationProperties}for(var f in d){var g=f.toLowerCase();if(g=="animationname"||g=="animationchildren")continue;var i=d[f],b=h[g];if(b&&String.isInstanceOfType(b)&&e[b])if(!Sys.Debug.isDebug)try{e[b](i)}catch(n){}else e[b](i);else if(g.endsWith("script")){b=h[g.substr(0,f.length-6)];if(b&&String.isInstanceOfType(b)&&e[b])e.DynamicProperties[b]=i;else if(Sys.Debug.isDebug)throw Error.argument(a,String.format(Sys.Extended.UI.Resources.Animation_NoDynamicPropertyFound,f,f.substr(0,f.length-5)));}else if(Sys.Debug.isDebug)throw Error.argument(a,String.format(Sys.Extended.UI.Resources.Animation_NoPropertyFound,f));}return e};$AA.Animation=function(d,c,e){var b=this;$AA.Animation.initializeBase(b);b._duration=1;b._fps=25;b._target=a;b._tickHandler=a;b._timer=a;b._percentComplete=0;b._percentDelta=a;b._owner=a;b._parentAnimation=a;b.DynamicProperties={};d&&b.set_target(d);c&&b.set_duration(c);e&&b.set_fps(e)};$AA.Animation.prototype={dispose:function(){var b=this;if(b._timer){b._timer.dispose();b._timer=a}b._tickHandler=a;b._target=a;$AA.Animation.callBaseMethod(b,l)},play:function(){var a=this;if(!a._owner){var d=c;if(!a._timer){d=b;if(!a._tickHandler)a._tickHandler=Function.createDelegate(a,a._onTimerTick);a._timer=new Sys.Timer;a._timer.add_tick(a._tickHandler);a.onStart();a._timer.set_interval(1e3/a._fps);a._percentDelta=e/(a._duration*a._fps);a._updatePercentComplete(0,c)}a._timer.set_enabled(c);a.raisePropertyChanged(f);!d&&a.raisePropertyChanged(r)}},pause:function(){var a=this;if(!a._owner)if(a._timer){a._timer.set_enabled(b);a.raisePropertyChanged(f)}},stop:function(c){var b=this;if(!b._owner){var d=b._timer;b._timer=a;if(d){d.dispose();if(b._percentComplete!==e){b._percentComplete=e;b.raisePropertyChanged(s);if(c||c===undefined)b.onStep(e)}b.onEnd();b.raisePropertyChanged(f);b.raisePropertyChanged(r)}}},onStart:function(){var a=this;a.raiseStarted();for(var b in a.DynamicProperties)try{a[b](eval(a.DynamicProperties[b]))}catch(c){if(Sys.Debug.isDebug)throw c;}},onStep:function(a){this.setValue(this.getAnimatedValue(a));this.raiseStep()},onEnd:function(){this.raiseEnded()},getAnimatedValue:function(){throw Error.notImplemented();},setValue:function(){throw Error.notImplemented();},interpolate:function(a,c,b){return a+(c-a)*(b/e)},_onTimerTick:function(){this._updatePercentComplete(this._percentComplete+this._percentDelta,c)},_updatePercentComplete:function(a,d){var c=this;if(a>e)a=e;c._percentComplete=a;c.raisePropertyChanged(s);if(d)c.onStep(a);a===e&&c.stop(b)},setOwner:function(a){this._owner=a},raiseStarted:function(){var a=this.get_events().getHandler(m);a&&a(this,Sys.EventArgs.Empty)},add_started:function(a){this.get_events().addHandler(m,a)},remove_started:function(a){this.get_events().removeHandler(m,a)},raiseEnded:function(){var a=this.get_events().getHandler(n);a&&a(this,Sys.EventArgs.Empty)},add_ended:function(a){this.get_events().addHandler(n,a)},remove_ended:function(a){this.get_events().removeHandler(n,a)},raiseStep:function(){var a=this.get_events().getHandler(o);a&&a(this,Sys.EventArgs.Empty)},add_step:function(a){this.get_events().addHandler(o,a)},remove_step:function(a){this.get_events().removeHandler(o,a)},get_target:function(){var a=this;return!a._target&&a._parentAnimation?a._parentAnimation.get_target():a._target},set_target:function(a){if(this._target!=a){this._target=a;this.raisePropertyChanged("target")}},set_animationTarget:function(d){var c=a,b=$get(d);if(b)c=b;else{var e=$find(d);if(e){b=e.get_element();if(b)c=b}}if(c)this.set_target(c);else throw Error.argument("id",String.format(Sys.Extended.UI.Resources.Animation_TargetNotFound,d));},get_duration:function(){return this._duration},set_duration:function(b){var a=this;b=a._getFloat(b);if(a._duration!=b){a._duration=b;a.raisePropertyChanged("duration")}},get_fps:function(){return this._fps},set_fps:function(b){var a=this;b=a._getInteger(b);if(a.fps!=b){a._fps=b;a.raisePropertyChanged("fps")}},get_isActive:function(){return this._timer!==a},get_isPlaying:function(){return this._timer!==a&&this._timer.get_enabled()},get_percentComplete:function(){return this._percentComplete},_getBoolean:function(a){return String.isInstanceOfType(a)?Boolean.parse(a):a},_getInteger:function(a){return String.isInstanceOfType(a)?parseInt(a):a},_getFloat:function(a){return String.isInstanceOfType(a)?parseFloat(a):a},_getEnum:function(a,b){return String.isInstanceOfType(a)&&b&&b.parse?b.parse(a):a}};$AA.Animation.registerClass("Sys.Extended.UI.Animation.Animation",Sys.Component);$AA.registerAnimation("animation",$AA.Animation);$AA.ParentAnimation=function(d,c,e,a){$AA.ParentAnimation.initializeBase(this,[d,c,e]);this._animations=[];if(a&&a.length)for(var b=0;b<a.length;b++)this.add(a[b])};$AA.ParentAnimation.prototype={initialize:function(){var a=this;$AA.ParentAnimation.callBaseMethod(a,"initialize");if(a._animations)for(var c=0;c<a._animations.length;c++){var b=a._animations[c];b&&!b.get_isInitialized&&b.initialize()}},dispose:function(){this.clear();this._animations=a;$AA.ParentAnimation.callBaseMethod(this,l)},get_animations:function(){return this._animations},add:function(b){var a=this;if(a._animations){if(b)b._parentAnimation=a;Array.add(a._animations,b);a.raisePropertyChanged(i)}},remove:function(a){if(this._animations){a&&a.dispose();Array.remove(this._animations,a);this.raisePropertyChanged(i)}},removeAt:function(c){var a=this;if(a._animations){var b=a._animations[c];b&&b.dispose();Array.removeAt(a._animations,c);a.raisePropertyChanged(i)}},clear:function(){var b=this;if(b._animations){for(var c=b._animations.length-1;c>=0;c--){b._animations[c].dispose();b._animations[c]=a}Array.clear(b._animations);b._animations=[];b.raisePropertyChanged(i)}}};$AA.ParentAnimation.registerClass("Sys.Extended.UI.Animation.ParentAnimation",$AA.Animation);$AA.registerAnimation("parent",$AA.ParentAnimation);$AA.ParallelAnimation=function(c,b,d,a){$AA.ParallelAnimation.initializeBase(this,[c,b,d,a])};$AA.ParallelAnimation.prototype={add:function(a){$AA.ParallelAnimation.callBaseMethod(this,"add",[a]);a.setOwner(this)},onStart:function(){$AA.ParallelAnimation.callBaseMethod(this,d);for(var b=this.get_animations(),a=0;a<b.length;a++)b[a].onStart()},onStep:function(c){for(var b=this.get_animations(),a=0;a<b.length;a++)b[a].onStep(c)},onEnd:function(){for(var b=this.get_animations(),a=0;a<b.length;a++)b[a].onEnd();$AA.ParallelAnimation.callBaseMethod(this,g)}};$AA.ParallelAnimation.registerClass("Sys.Extended.UI.Animation.ParallelAnimation",$AA.ParentAnimation);$AA.registerAnimation("parallel",$AA.ParallelAnimation);$AA.SequenceAnimation=function(g,f,h,e,d){var c=this;$AA.SequenceAnimation.initializeBase(c,[g,f,h,e]);c._handler=a;c._paused=b;c._playing=b;c._index=0;c._remainingIterations=0;c._iterations=d!==undefined?d:1};$AA.SequenceAnimation.prototype={dispose:function(){this._handler=a;$AA.SequenceAnimation.callBaseMethod(this,l)},stop:function(){var a=this;if(a._playing){var c=a.get_animations();if(a._index<c.length){c[a._index].remove_ended(a._handler);for(var d=a._index;d<c.length;d++)c[d].stop()}a._playing=b;a._paused=b;a.raisePropertyChanged(f);a.onEnd()}},pause:function(){var b=this;if(b.get_isPlaying()){var d=b.get_animations()[b._index];d!=a&&d.pause();b._paused=c;b.raisePropertyChanged(f)}},play:function(){var d=this,g=d.get_animations();if(!d._playing){d._playing=c;if(d._paused){d._paused=b;var h=g[d._index];if(h!=a){h.play();d.raisePropertyChanged(f)}}else{d.onStart();d._index=0;var e=g[d._index];if(e){e.add_ended(d._handler);e.play();d.raisePropertyChanged(f)}else d.stop()}}},onStart:function(){var a=this;$AA.SequenceAnimation.callBaseMethod(a,d);a._remainingIterations=a._iterations-1;if(!a._handler)a._handler=Function.createDelegate(a,a._onEndAnimation)},_onEndAnimation:function(){var a=this,b=a.get_animations(),c=b[a._index++];c&&c.remove_ended(a._handler);if(a._index<b.length){var e=b[a._index];e.add_ended(a._handler);e.play()}else if(a._remainingIterations>=1||a._iterations<=0){a._remainingIterations--;a._index=0;var d=b[0];d.add_ended(a._handler);d.play()}else a.stop()},onStep:function(){throw Error.invalidOperation(Sys.Extended.UI.Resources.Animation_CannotNestSequence);},onEnd:function(){this._remainingIterations=0;$AA.SequenceAnimation.callBaseMethod(this,g)},get_isActive:function(){return c},get_isPlaying:function(){return this._playing&&!this._paused},get_iterations:function(){return this._iterations},set_iterations:function(b){var a=this;b=a._getInteger(b);if(a._iterations!=b){a._iterations=b;a.raisePropertyChanged("iterations")}},get_isInfinite:function(){return this._iterations<=0}};$AA.SequenceAnimation.registerClass("Sys.Extended.UI.Animation.SequenceAnimation",$AA.ParentAnimation);$AA.registerAnimation("sequence",$AA.SequenceAnimation);$AA.SelectionAnimation=function(d,c,e,b){$AA.SelectionAnimation.initializeBase(this,[d,c,e,b]);this._selectedIndex=-1;this._selected=a};$AA.SelectionAnimation.prototype={getSelectedIndex:function(){throw Error.notImplemented();},onStart:function(){var a=this;$AA.SelectionAnimation.callBaseMethod(a,d);var b=a.get_animations();a._selectedIndex=a.getSelectedIndex();if(a._selectedIndex>=0&&a._selectedIndex<b.length){a._selected=b[a._selectedIndex];if(a._selected){a._selected.setOwner(a);a._selected.onStart()}}},onStep:function(a){if(this._selected)this._selected.onStep(a)},onEnd:function(){var b=this;if(b._selected){b._selected.onEnd();b._selected.setOwner(a)}b._selected=a;b._selectedIndex=a;$AA.SelectionAnimation.callBaseMethod(b,g)}};$AA.SelectionAnimation.registerClass("Sys.Extended.UI.Animation.SelectionAnimation",$AA.ParentAnimation);$AA.registerAnimation("selection",$AA.SelectionAnimation);$AA.ConditionAnimation=function(d,c,e,b,a){$AA.ConditionAnimation.initializeBase(this,[d,c,e,b]);this._conditionScript=a};$AA.ConditionAnimation.prototype={getSelectedIndex:function(){var a=-1;if(this._conditionScript&&this._conditionScript.length>0)try{a=eval(this._conditionScript)?0:1}catch(b){}return a},get_conditionScript:function(){return this._conditionScript},set_conditionScript:function(a){if(this._conditionScript!=a){this._conditionScript=a;this.raisePropertyChanged("conditionScript")}}};$AA.ConditionAnimation.registerClass("Sys.Extended.UI.Animation.ConditionAnimation",$AA.SelectionAnimation);$AA.registerAnimation("condition",$AA.ConditionAnimation);$AA.CaseAnimation=function(d,c,e,b,a){$AA.CaseAnimation.initializeBase(this,[d,c,e,b]);this._selectScript=a};$AA.CaseAnimation.prototype={getSelectedIndex:function(){var a=-1;if(this._selectScript&&this._selectScript.length>0)try{var b=eval(this._selectScript);if(b!==undefined)a=b}catch(c){}return a},get_selectScript:function(){return this._selectScript},set_selectScript:function(a){if(this._selectScript!=a){this._selectScript=a;this.raisePropertyChanged("selectScript")}}};$AA.CaseAnimation.registerClass("Sys.Extended.UI.Animation.CaseAnimation",$AA.SelectionAnimation);$AA.registerAnimation("case",$AA.CaseAnimation);$AA.FadeEffect=function(){throw Error.invalidOperation();};$AA.FadeEffect.prototype={FadeIn:0,FadeOut:1};$AA.FadeEffect.registerEnum("Sys.Extended.UI.Animation.FadeEffect",b);$AA.FadeAnimation=function(j,i,k,h,g,f,e){var d=this;$AA.FadeAnimation.initializeBase(d,[j,i,k]);d._effect=h!==undefined?h:$AA.FadeEffect.FadeIn;d._max=f!==undefined?f:1;d._min=g!==undefined?g:0;d._start=d._min;d._end=d._max;d._layoutCreated=b;d._forceLayoutInIE=e===undefined||e===a?c:e;d._currentTarget=a;d._resetOpacities()};$AA.FadeAnimation.prototype={_resetOpacities:function(){var a=this;if(a._effect==$AA.FadeEffect.FadeIn){a._start=a._min;a._end=a._max}else{a._start=a._max;a._end=a._min}},_createLayout:function(){var a=this,b=a._currentTarget;if(b){a._originalWidth=$common.getCurrentStyle(b,p);var d=$common.getCurrentStyle(b,q);a._originalBackColor=$common.getCurrentStyle(b,"backgroundColor");if((!a._originalWidth||a._originalWidth==""||a._originalWidth=="auto")&&(!d||d==""||d=="auto"))b.style.width=b.offsetWidth+j;if(!a._originalBackColor||a._originalBackColor==""||a._originalBackColor=="transparent"||a._originalBackColor=="rgba(0, 0, 0, 0)")b.style.backgroundColor=$common.getInheritedBackgroundColor(b);a._layoutCreated=c}},onStart:function(){var a=this;$AA.FadeAnimation.callBaseMethod(a,d);a._currentTarget=a.get_target();a.setValue(a._start);a._forceLayoutInIE&&!a._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer&&a._createLayout()},getAnimatedValue:function(a){return this.interpolate(this._start,this._end,a)},setValue:function(a){this._currentTarget&&$common.setElementOpacity(this._currentTarget,a)},get_effect:function(){return this._effect},set_effect:function(b){var a=this;b=a._getEnum(b,$AA.FadeEffect);if(a._effect!=b){a._effect=b;a._resetOpacities();a.raisePropertyChanged("effect")}},get_minimumOpacity:function(){return this._min},set_minimumOpacity:function(b){var a=this;b=a._getFloat(b);if(a._min!=b){a._min=b;a._resetOpacities();a.raisePropertyChanged(t)}},get_maximumOpacity:function(){return this._max},set_maximumOpacity:function(b){var a=this;b=a._getFloat(b);if(a._max!=b){a._max=b;a._resetOpacities();a.raisePropertyChanged(u)}},get_forceLayoutInIE:function(){return this._forceLayoutInIE},set_forceLayoutInIE:function(b){var a=this;b=a._getBoolean(b);if(a._forceLayoutInIE!=b){a._forceLayoutInIE=b;a.raisePropertyChanged(v)}},set_startValue:function(a){a=this._getFloat(a);this._start=a}};$AA.FadeAnimation.registerClass("Sys.Extended.UI.Animation.FadeAnimation",$AA.Animation);$AA.registerAnimation("fade",$AA.FadeAnimation);$AA.FadeInAnimation=function(e,d,f,c,b,a){$AA.FadeInAnimation.initializeBase(this,[e,d,f,$AA.FadeEffect.FadeIn,c,b,a])};$AA.FadeInAnimation.prototype={onStart:function(){var a=this;$AA.FadeInAnimation.callBaseMethod(a,d);a._currentTarget&&a.set_startValue($common.getElementOpacity(a._currentTarget))}};$AA.FadeInAnimation.registerClass("Sys.Extended.UI.Animation.FadeInAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeIn",$AA.FadeInAnimation);$AA.FadeOutAnimation=function(e,d,f,c,b,a){$AA.FadeOutAnimation.initializeBase(this,[e,d,f,$AA.FadeEffect.FadeOut,c,b,a])};$AA.FadeOutAnimation.prototype={onStart:function(){var a=this;$AA.FadeOutAnimation.callBaseMethod(a,d);a._currentTarget&&a.set_startValue($common.getElementOpacity(a._currentTarget))}};$AA.FadeOutAnimation.registerClass("Sys.Extended.UI.Animation.FadeOutAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeOut",$AA.FadeOutAnimation);$AA.PulseAnimation=function(d,c,e,i,h,g,f){var b=this;$AA.PulseAnimation.initializeBase(b,[d,c,e,a,i!==undefined?i:3]);b._out=new $AA.FadeOutAnimation(d,c,e,h,g,f);b.add(b._out);b._in=new $AA.FadeInAnimation(d,c,e,h,g,f);b.add(b._in)};$AA.PulseAnimation.prototype={get_minimumOpacity:function(){return this._out.get_minimumOpacity()},set_minimumOpacity:function(b){var a=this;b=a._getFloat(b);a._out.set_minimumOpacity(b);a._in.set_minimumOpacity(b);a.raisePropertyChanged(t)},get_maximumOpacity:function(){return this._out.get_maximumOpacity()},set_maximumOpacity:function(b){var a=this;b=a._getFloat(b);a._out.set_maximumOpacity(b);a._in.set_maximumOpacity(b);a.raisePropertyChanged(u)},get_forceLayoutInIE:function(){return this._out.get_forceLayoutInIE()},set_forceLayoutInIE:function(b){var a=this;b=a._getBoolean(b);a._out.set_forceLayoutInIE(b);a._in.set_forceLayoutInIE(b);a.raisePropertyChanged(v)},set_duration:function(a){var b=this;a=b._getFloat(a);$AA.PulseAnimation.callBaseMethod(b,"set_duration",[a]);b._in.set_duration(a);b._out.set_duration(a)},set_fps:function(a){var b=this;a=b._getInteger(a);$AA.PulseAnimation.callBaseMethod(b,"set_fps",[a]);b._in.set_fps(a);b._out.set_fps(a)}};$AA.PulseAnimation.registerClass("Sys.Extended.UI.Animation.PulseAnimation",$AA.SequenceAnimation);$AA.registerAnimation("pulse",$AA.PulseAnimation);$AA.PropertyAnimation=function(f,d,g,e,c){var b=this;$AA.PropertyAnimation.initializeBase(b,[f,d,g]);b._property=e;b._propertyKey=c;b._currentTarget=a};$AA.PropertyAnimation.prototype={onStart:function(){$AA.PropertyAnimation.callBaseMethod(this,d);this._currentTarget=this.get_target()},setValue:function(c){var a=this,b=a._currentTarget;if(b&&a._property&&a._property.length>0)if(a._propertyKey&&a._propertyKey.length>0&&b[a._property])b[a._property][a._propertyKey]=c;else b[a._property]=c},getValue:function(){var b=this,d=b.get_target();if(d&&b._property&&b._property.length>0){var c=d[b._property];if(c)return b._propertyKey&&b._propertyKey.length>0?c[b._propertyKey]:c}return a},get_property:function(){return this._property},set_property:function(a){if(this._property!=a){this._property=a;this.raisePropertyChanged(y)}},get_propertyKey:function(){return this._propertyKey},set_propertyKey:function(a){if(this._propertyKey!=a){this._propertyKey=a;this.raisePropertyChanged("propertyKey")}}};$AA.PropertyAnimation.registerClass("Sys.Extended.UI.Animation.PropertyAnimation",$AA.Animation);$AA.registerAnimation(y,$AA.PropertyAnimation);$AA.DiscreteAnimation=function(e,c,f,d,b,a){$AA.DiscreteAnimation.initializeBase(this,[e,c,f,d,b]);this._values=a&&a.length?a:[]};$AA.DiscreteAnimation.prototype={getAnimatedValue:function(a){var b=Math.floor(this.interpolate(0,this._values.length-1,a));return this._values[b]},get_values:function(){return this._values},set_values:function(a){if(this._values!=a){this._values=a;this.raisePropertyChanged("values")}}};$AA.DiscreteAnimation.registerClass("Sys.Extended.UI.Animation.DiscreteAnimation",$AA.PropertyAnimation);$AA.registerAnimation("discrete",$AA.DiscreteAnimation);$AA.InterpolatedAnimation=function(f,d,g,a,b,c,e){$AA.InterpolatedAnimation.initializeBase(this,[f,d,g,a!==undefined?a:h,b]);this._startValue=c;this._endValue=e};$AA.InterpolatedAnimation.prototype={get_startValue:function(){return this._startValue},set_startValue:function(b){var a=this;b=a._getFloat(b);if(a._startValue!=b){a._startValue=b;a.raisePropertyChanged(w)}},get_endValue:function(){return this._endValue},set_endValue:function(b){var a=this;b=a._getFloat(b);if(a._endValue!=b){a._endValue=b;a.raisePropertyChanged(x)}}};$AA.InterpolatedAnimation.registerClass("Sys.Extended.UI.Animation.InterpolatedAnimation",$AA.PropertyAnimation);$AA.registerAnimation("interpolated",$AA.InterpolatedAnimation);$AA.ColorAnimation=function(i,f,j,h,d,e,g){var c=this;$AA.ColorAnimation.initializeBase(c,[i,f,j,h,d,e,g]);c._start=a;c._end=a;c._interpolateRed=b;c._interpolateGreen=b;c._interpolateBlue=b};$AA.ColorAnimation.prototype={onStart:function(){var a=this;$AA.ColorAnimation.callBaseMethod(a,d);a._start=$AA.ColorAnimation.getRGB(a.get_startValue());a._end=$AA.ColorAnimation.getRGB(a.get_endValue());a._interpolateRed=a._start.Red!=a._end.Red;a._interpolateGreen=a._start.Green!=a._end.Green;a._interpolateBlue=a._start.Blue!=a._end.Blue},getAnimatedValue:function(b){var a=this,e=a._start.Red,d=a._start.Green,c=a._start.Blue;if(a._interpolateRed)e=Math.round(a.interpolate(e,a._end.Red,b));if(a._interpolateGreen)d=Math.round(a.interpolate(d,a._end.Green,b));if(a._interpolateBlue)c=Math.round(a.interpolate(c,a._end.Blue,b));return $AA.ColorAnimation.toColor(e,d,c)},set_startValue:function(a){if(this._startValue!=a){this._startValue=a;this.raisePropertyChanged(w)}},set_endValue:function(a){if(this._endValue!=a){this._endValue=a;this.raisePropertyChanged(x)}}};$AA.ColorAnimation.getRGB=function(a){if(!a||a.length!=7)throw String.format(Sys.Extended.UI.Resources.Animation_InvalidColor,a);return{Red:parseInt(a.substr(1,2),16),Green:parseInt(a.substr(3,2),16),Blue:parseInt(a.substr(5,2),16)}};$AA.ColorAnimation.toColor=function(f,d,e){var c=f.toString(16),b=d.toString(16),a=e.toString(16);if(c.length==1)c="0"+c;if(b.length==1)b="0"+b;if(a.length==1)a="0"+a;return"#"+c+b+a};$AA.ColorAnimation.registerClass("Sys.Extended.UI.Animation.ColorAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("color",$AA.ColorAnimation);$AA.LengthAnimation=function(h,e,i,g,c,d,f,b){$AA.LengthAnimation.initializeBase(this,[h,e,i,g,c,d,f]);this._unit=b!=a?b:j};$AA.LengthAnimation.prototype={getAnimatedValue:function(b){var a=this,c=a.interpolate(a.get_startValue(),a.get_endValue(),b);return Math.round(c)+a._unit},get_unit:function(){return this._unit},set_unit:function(a){if(this._unit!=a){this._unit=a;this.raisePropertyChanged(k)}}};$AA.LengthAnimation.registerClass("Sys.Extended.UI.Animation.LengthAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("length",$AA.LengthAnimation);$AA.MoveAnimation=function(e,d,f,g,j,i,k){var b=this;$AA.MoveAnimation.initializeBase(b,[e,d,f,a]);b._horizontal=g?g:0;b._vertical=j?j:0;b._relative=i===undefined?c:i;b._horizontalAnimation=new $AA.LengthAnimation(e,d,f,h,"left",a,a,k);b._verticalAnimation=new $AA.LengthAnimation(e,d,f,h,"top",a,a,k);b.add(b._verticalAnimation);b.add(b._horizontalAnimation)};$AA.MoveAnimation.prototype={onStart:function(){var a=this;$AA.MoveAnimation.callBaseMethod(a,d);var b=a.get_target();a._horizontalAnimation.set_startValue(b.offsetLeft);a._horizontalAnimation.set_endValue(a._relative?b.offsetLeft+a._horizontal:a._horizontal);a._verticalAnimation.set_startValue(b.offsetTop);a._verticalAnimation.set_endValue(a._relative?b.offsetTop+a._vertical:a._vertical)},get_horizontal:function(){return this._horizontal},set_horizontal:function(b){var a=this;b=a._getFloat(b);if(a._horizontal!=b){a._horizontal=b;a.raisePropertyChanged("horizontal")}},get_vertical:function(){return this._vertical},set_vertical:function(b){var a=this;b=a._getFloat(b);if(a._vertical!=b){a._vertical=b;a.raisePropertyChanged("vertical")}},get_relative:function(){return this._relative},set_relative:function(b){var a=this;b=a._getBoolean(b);if(a._relative!=b){a._relative=b;a.raisePropertyChanged("relative")}},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(b){var a=this,c=a._horizontalAnimation.get_unit();if(c!=b){a._horizontalAnimation.set_unit(b);a._verticalAnimation.set_unit(b);a.raisePropertyChanged(k)}}};$AA.MoveAnimation.registerClass("Sys.Extended.UI.Animation.MoveAnimation",$AA.ParallelAnimation);$AA.registerAnimation("move",$AA.MoveAnimation);$AA.ResizeAnimation=function(d,c,e,i,g,f){var b=this;$AA.ResizeAnimation.initializeBase(b,[d,c,e,a]);b._width=i;b._height=g;b._horizontalAnimation=new $AA.LengthAnimation(d,c,e,h,p,a,a,f);b._verticalAnimation=new $AA.LengthAnimation(d,c,e,h,q,a,a,f);b.add(b._horizontalAnimation);b.add(b._verticalAnimation)};$AA.ResizeAnimation.prototype={onStart:function(){var b=this;$AA.ResizeAnimation.callBaseMethod(b,d);var c=b.get_target();b._horizontalAnimation.set_startValue(c.offsetWidth);b._verticalAnimation.set_startValue(c.offsetHeight);b._horizontalAnimation.set_endValue(b._width!==a&&b._width!==undefined?b._width:c.offsetWidth);b._verticalAnimation.set_endValue(b._height!==a&&b._height!==undefined?b._height:c.offsetHeight)},get_width:function(){return this._width},set_width:function(b){var a=this;b=a._getFloat(b);if(a._width!=b){a._width=b;a.raisePropertyChanged(p)}},get_height:function(){return this._height},set_height:function(b){var a=this;b=a._getFloat(b);if(a._height!=b){a._height=b;a.raisePropertyChanged(q)}},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(b){var a=this,c=a._horizontalAnimation.get_unit();if(c!=b){a._horizontalAnimation.set_unit(b);a._verticalAnimation.set_unit(b);a.raisePropertyChanged(k)}}};$AA.ResizeAnimation.registerClass("Sys.Extended.UI.Animation.ResizeAnimation",$AA.ParallelAnimation);$AA.registerAnimation("resize",$AA.ResizeAnimation);$AA.ScaleAnimation=function(i,g,k,c,e,h,f,d){var b=this;$AA.ScaleAnimation.initializeBase(b,[i,g,k]);b._scaleFactor=c!==undefined?c:1;b._unit=e!==undefined?e:j;b._center=h;b._scaleFont=f;b._fontUnit=d!==undefined?d:"pt";b._element=a;b._initialHeight=a;b._initialWidth=a;b._initialTop=a;b._initialLeft=a;b._initialFontSize=a};$AA.ScaleAnimation.prototype={getAnimatedValue:function(a){return this.interpolate(1,this._scaleFactor,a)},onStart:function(){var a=this;$AA.ScaleAnimation.callBaseMethod(a,d);a._element=a.get_target();if(a._element){a._initialHeight=a._element.offsetHeight;a._initialWidth=a._element.offsetWidth;if(a._center){a._initialTop=a._element.offsetTop;a._initialLeft=a._element.offsetLeft}if(a._scaleFont)a._initialFontSize=parseFloat($common.getCurrentStyle(a._element,"fontSize"))}},setValue:function(b){var a=this;if(a._element){var e=Math.round(a._initialWidth*b),d=Math.round(a._initialHeight*b);a._element.style.width=e+a._unit;a._element.style.height=d+a._unit;if(a._center){a._element.style.top=a._initialTop+Math.round((a._initialHeight-d)/2)+a._unit;a._element.style.left=a._initialLeft+Math.round((a._initialWidth-e)/2)+a._unit}if(a._scaleFont){var c=a._initialFontSize*b;if(a._fontUnit==j||a._fontUnit=="pt")c=Math.round(c);a._element.style.fontSize=c+a._fontUnit}}},onEnd:function(){var b=this;b._element=a;b._initialHeight=a;b._initialWidth=a;b._initialTop=a;b._initialLeft=a;b._initialFontSize=a;$AA.ScaleAnimation.callBaseMethod(b,g)},get_scaleFactor:function(){return this._scaleFactor},set_scaleFactor:function(b){var a=this;b=a._getFloat(b);if(a._scaleFactor!=b){a._scaleFactor=b;a.raisePropertyChanged("scaleFactor")}},get_unit:function(){return this._unit},set_unit:function(a){if(this._unit!=a){this._unit=a;this.raisePropertyChanged(k)}},get_center:function(){return this._center},set_center:function(b){var a=this;b=a._getBoolean(b);if(a._center!=b){a._center=b;a.raisePropertyChanged("center")}},get_scaleFont:function(){return this._scaleFont},set_scaleFont:function(b){var a=this;b=a._getBoolean(b);if(a._scaleFont!=b){a._scaleFont=b;a.raisePropertyChanged("scaleFont")}},get_fontUnit:function(){return this._fontUnit},set_fontUnit:function(a){if(this._fontUnit!=a){this._fontUnit=a;this.raisePropertyChanged("fontUnit")}}};$AA.ScaleAnimation.registerClass("Sys.Extended.UI.Animation.ScaleAnimation",$AA.Animation);$AA.registerAnimation("scale",$AA.ScaleAnimation);$AA.Action=function(b,a,c){$AA.Action.initializeBase(this,[b,a,c]);a===undefined&&this.set_duration(0)};$AA.Action.prototype={onEnd:function(){this.doAction();$AA.Action.callBaseMethod(this,g)},doAction:function(){throw Error.notImplemented();},getAnimatedValue:function(){},setValue:function(){}};$AA.Action.registerClass("Sys.Extended.UI.Animation.Action",$AA.Animation);$AA.registerAnimation("action",$AA.Action);$AA.EnableAction=function(d,b,e,a){$AA.EnableAction.initializeBase(this,[d,b,e]);this._enabled=a!==undefined?a:c};$AA.EnableAction.prototype={doAction:function(){var a=this.get_target();if(a)a.disabled=!this._enabled},get_enabled:function(){return this._enabled},set_enabled:function(b){var a=this;b=a._getBoolean(b);if(a._enabled!=b){a._enabled=b;a.raisePropertyChanged("enabled")}}};$AA.EnableAction.registerClass("Sys.Extended.UI.Animation.EnableAction",$AA.Action);$AA.registerAnimation("enableAction",$AA.EnableAction);$AA.HideAction=function(c,a,d,b){$AA.HideAction.initializeBase(this,[c,a,d]);this._visible=b};$AA.HideAction.prototype={doAction:function(){var a=this.get_target();a&&$common.setVisible(a,this._visible)},get_visible:function(){return this._visible},set_visible:function(a){if(this._visible!=a){this._visible=a;this.raisePropertyChanged("visible")}}};$AA.HideAction.registerClass("Sys.Extended.UI.Animation.HideAction",$AA.Action);$AA.registerAnimation("hideAction",$AA.HideAction);$AA.StyleAction=function(c,b,e,a,d){$AA.StyleAction.initializeBase(this,[c,b,e]);this._attribute=a;this._value=d};$AA.StyleAction.prototype={doAction:function(){var a=this.get_target();if(a)a.style[this._attribute]=this._value},get_attribute:function(){return this._attribute},set_attribute:function(a){if(this._attribute!=a){this._attribute=a;this.raisePropertyChanged("attribute")}},get_value:function(){return this._value},set_value:function(a){if(this._value!=a){this._value=a;this.raisePropertyChanged("value")}}};$AA.StyleAction.registerClass("Sys.Extended.UI.Animation.StyleAction",$AA.Action);$AA.registerAnimation("styleAction",$AA.StyleAction);$AA.OpacityAction=function(c,a,d,b){$AA.OpacityAction.initializeBase(this,[c,a,d]);this._opacity=b};$AA.OpacityAction.prototype={doAction:function(){var a=this.get_target();a&&$common.setElementOpacity(a,this._opacity)},get_opacity:function(){return this._opacity},set_opacity:function(b){var a=this;b=a._getFloat(b);if(a._opacity!=b){a._opacity=b;a.raisePropertyChanged("opacity")}}};$AA.OpacityAction.registerClass("Sys.Extended.UI.Animation.OpacityAction",$AA.Action);$AA.registerAnimation("opacityAction",$AA.OpacityAction);$AA.ScriptAction=function(c,a,d,b){$AA.ScriptAction.initializeBase(this,[c,a,d]);this._script=b};$AA.ScriptAction.prototype={doAction:function(){try{eval(this._script)}catch(a){}},get_script:function(){return this._script},set_script:function(a){if(this._script!=a){this._script=a;this.raisePropertyChanged("script")}}};$AA.ScriptAction.registerClass("Sys.Extended.UI.Animation.ScriptAction",$AA.Action);$AA.registerAnimation("scriptAction",$AA.ScriptAction)}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedCommon","ExtendedTimer"],a);else a()})();var $AA;
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedBase";function a(){var b="undefined",f="populating",e="populated",d="dispose",c="initialize",a=null,g=this,h=Sys.version;if(!h&&!Sys._versionChecked){Sys._versionChecked=true;throw new Error("AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.");}Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.BehaviorBase=function(c){var b=this;Sys.Extended.UI.BehaviorBase.initializeBase(b,[c]);b._clientStateFieldID=a;b._pageRequestManager=a;b._partialUpdateBeginRequestHandler=a;b._partialUpdateEndRequestHandler=a};Sys.Extended.UI.BehaviorBase.prototype={initialize:function(){Sys.Extended.UI.BehaviorBase.callBaseMethod(this,c)},dispose:function(){var b=this;Sys.Extended.UI.BehaviorBase.callBaseMethod(b,d);if(b._pageRequestManager){if(b._partialUpdateBeginRequestHandler){b._pageRequestManager.remove_beginRequest(b._partialUpdateBeginRequestHandler);b._partialUpdateBeginRequestHandler=a}if(b._partialUpdateEndRequestHandler){b._pageRequestManager.remove_endRequest(b._partialUpdateEndRequestHandler);b._partialUpdateEndRequestHandler=a}b._pageRequestManager=a}},get_ClientStateFieldID:function(){return this._clientStateFieldID},set_ClientStateFieldID:function(a){if(this._clientStateFieldID!=a){this._clientStateFieldID=a;this.raisePropertyChanged("ClientStateFieldID")}},get_ClientState:function(){if(this._clientStateFieldID){var b=document.getElementById(this._clientStateFieldID);if(b)return b.value}return a},set_ClientState:function(b){if(this._clientStateFieldID){var a=document.getElementById(this._clientStateFieldID);if(a)a.value=b}},registerPartialUpdateEvents:function(){var a=this;if(Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager){a._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();if(a._pageRequestManager){a._partialUpdateBeginRequestHandler=Function.createDelegate(a,a._partialUpdateBeginRequest);a._pageRequestManager.add_beginRequest(a._partialUpdateBeginRequestHandler);a._partialUpdateEndRequestHandler=Function.createDelegate(a,a._partialUpdateEndRequest);a._pageRequestManager.add_endRequest(a._partialUpdateEndRequestHandler)}}},_partialUpdateBeginRequest:function(){},_partialUpdateEndRequest:function(){}};Sys.Extended.UI.BehaviorBase.registerClass("Sys.Extended.UI.BehaviorBase",Sys.UI.Behavior);Sys.Extended.UI.DynamicPopulateBehaviorBase=function(c){var b=this;Sys.Extended.UI.DynamicPopulateBehaviorBase.initializeBase(b,[c]);b._DynamicControlID=a;b._DynamicContextKey=a;b._DynamicServicePath=a;b._DynamicServiceMethod=a;b._cacheDynamicResults=false;b._dynamicPopulateBehavior=a;b._populatingHandler=a;b._populatedHandler=a};Sys.Extended.UI.DynamicPopulateBehaviorBase.prototype={initialize:function(){var a=this;Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(a,c);a._populatingHandler=Function.createDelegate(a,a._onPopulating);a._populatedHandler=Function.createDelegate(a,a._onPopulated)},dispose:function(){var b=this;if(b._populatedHandler){b._dynamicPopulateBehavior&&b._dynamicPopulateBehavior.remove_populated(b._populatedHandler);b._populatedHandler=a}if(b._populatingHandler){b._dynamicPopulateBehavior&&b._dynamicPopulateBehavior.remove_populating(b._populatingHandler);b._populatingHandler=a}if(b._dynamicPopulateBehavior){b._dynamicPopulateBehavior.dispose();b._dynamicPopulateBehavior=a}Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(b,d)},populate:function(c){var b=this;if(b._dynamicPopulateBehavior&&b._dynamicPopulateBehavior.get_element()!=$get(b._DynamicControlID)){b._dynamicPopulateBehavior.dispose();b._dynamicPopulateBehavior=a}if(!b._dynamicPopulateBehavior&&b._DynamicControlID&&b._DynamicServiceMethod){b._dynamicPopulateBehavior=$create(Sys.Extended.UI.DynamicPopulateBehavior,{id:b.get_id()+"_DynamicPopulateBehavior",ContextKey:b._DynamicContextKey,ServicePath:b._DynamicServicePath,ServiceMethod:b._DynamicServiceMethod,cacheDynamicResults:b._cacheDynamicResults},a,a,$get(b._DynamicControlID));b._dynamicPopulateBehavior.add_populating(b._populatingHandler);b._dynamicPopulateBehavior.add_populated(b._populatedHandler)}b._dynamicPopulateBehavior&&b._dynamicPopulateBehavior.populate(c?c:b._DynamicContextKey)},_onPopulating:function(b,a){this.raisePopulating(a)},_onPopulated:function(b,a){this.raisePopulated(a)},get_dynamicControlID:function(){return this._DynamicControlID},get_DynamicControlID:g.get_dynamicControlID,set_dynamicControlID:function(b){var a=this;if(a._DynamicControlID!=b){a._DynamicControlID=b;a.raisePropertyChanged("dynamicControlID");a.raisePropertyChanged("DynamicControlID")}},set_DynamicControlID:g.set_dynamicControlID,get_dynamicContextKey:function(){return this._DynamicContextKey},get_DynamicContextKey:g.get_dynamicContextKey,set_dynamicContextKey:function(b){var a=this;if(a._DynamicContextKey!=b){a._DynamicContextKey=b;a.raisePropertyChanged("dynamicContextKey");a.raisePropertyChanged("DynamicContextKey")}},set_DynamicContextKey:g.set_dynamicContextKey,get_dynamicServicePath:function(){return this._DynamicServicePath},get_DynamicServicePath:g.get_dynamicServicePath,set_dynamicServicePath:function(b){var a=this;if(a._DynamicServicePath!=b){a._DynamicServicePath=b;a.raisePropertyChanged("dynamicServicePath");a.raisePropertyChanged("DynamicServicePath")}},set_DynamicServicePath:g.set_dynamicServicePath,get_dynamicServiceMethod:function(){return this._DynamicServiceMethod},get_DynamicServiceMethod:g.get_dynamicServiceMethod,set_dynamicServiceMethod:function(b){var a=this;if(a._DynamicServiceMethod!=b){a._DynamicServiceMethod=b;a.raisePropertyChanged("dynamicServiceMethod");a.raisePropertyChanged("DynamicServiceMethod")}},set_DynamicServiceMethod:g.set_dynamicServiceMethod,get_cacheDynamicResults:function(){return this._cacheDynamicResults},set_cacheDynamicResults:function(a){if(this._cacheDynamicResults!=a){this._cacheDynamicResults=a;this.raisePropertyChanged("cacheDynamicResults")}},add_populated:function(a){this.get_events().addHandler(e,a)},remove_populated:function(a){this.get_events().removeHandler(e,a)},raisePopulated:function(b){var a=this.get_events().getHandler(e);a&&a(this,b)},add_populating:function(a){this.get_events().addHandler(f,a)},remove_populating:function(a){this.get_events().removeHandler(f,a)},raisePopulating:function(b){var a=this.get_events().getHandler(f);a&&a(this,b)}};Sys.Extended.UI.DynamicPopulateBehaviorBase.registerClass("Sys.Extended.UI.DynamicPopulateBehaviorBase",Sys.Extended.UI.BehaviorBase);Sys.Extended.UI.ControlBase=function(c){var b=this;Sys.Extended.UI.ControlBase.initializeBase(b,[c]);b._clientStateField=a;b._callbackTarget=a;b._onsubmit$delegate=Function.createDelegate(b,b._onsubmit);b._oncomplete$delegate=Function.createDelegate(b,b._oncomplete);b._onerror$delegate=Function.createDelegate(b,b._onerror)};Sys.Extended.UI.ControlBase.__doPostBack=function(c,b){if(!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())for(var a=0;a<Sys.Extended.UI.ControlBase.onsubmitCollection.length;a++)Sys.Extended.UI.ControlBase.onsubmitCollection[a]();Function.createDelegate(window,Sys.Extended.UI.ControlBase.__doPostBackSaved)(c,b)};Sys.Extended.UI.ControlBase.prototype={initialize:function(){var d=this;Sys.Extended.UI.ControlBase.callBaseMethod(d,c);d._clientStateField&&d.loadClientState(d._clientStateField.value);if(typeof Sys.WebForms!==b&&typeof Sys.WebForms.PageRequestManager!==b){Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements,d._onsubmit$delegate);if(Sys.Extended.UI.ControlBase.__doPostBackSaved==a||typeof Sys.Extended.UI.ControlBase.__doPostBackSaved==b){Sys.Extended.UI.ControlBase.__doPostBackSaved=window.__doPostBack;window.__doPostBack=Sys.Extended.UI.ControlBase.__doPostBack;Sys.Extended.UI.ControlBase.onsubmitCollection=[]}Array.add(Sys.Extended.UI.ControlBase.onsubmitCollection,d._onsubmit$delegate)}else $addHandler(document.forms[0],"submit",d._onsubmit$delegate)},dispose:function(){var a=this;if(typeof Sys.WebForms!==b&&typeof Sys.WebForms.PageRequestManager!==b){Array.remove(Sys.Extended.UI.ControlBase.onsubmitCollection,a._onsubmit$delegate);Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements,a._onsubmit$delegate)}else $removeHandler(document.forms[0],"submit",a._onsubmit$delegate);Sys.Extended.UI.ControlBase.callBaseMethod(a,d)},findElement:function(a){return $get(this.get_id()+"_"+a.split(":").join("_"))},get_clientStateField:function(){return this._clientStateField},set_clientStateField:function(b){var a=this;if(a.get_isInitialized())throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_CannotSetClientStateField);if(a._clientStateField!=b){a._clientStateField=b;a.raisePropertyChanged("clientStateField")}},loadClientState:function(){},saveClientState:function(){return a},_invoke:function(i,f,j){var c=this;if(!c._callbackTarget)throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_ControlNotRegisteredForCallbacks);if(typeof WebForm_DoCallback===b)throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_PageNotRegisteredForCallbacks);for(var g=[],d=0;d<f.length;d++)g[d]=f[d];var e=c.saveClientState();if(e!=a&&!String.isInstanceOfType(e))throw Error.invalidOperation(Sys.Extended.UI.Resources.ExtenderBase_InvalidClientStateType);var h=Sys.Serialization.JavaScriptSerializer.serialize({name:i,args:g,state:c.saveClientState()});WebForm_DoCallback(c._callbackTarget,h,c._oncomplete$delegate,j,c._onerror$delegate,true)},_oncomplete:function(a,b){a=Sys.Serialization.JavaScriptSerializer.deserialize(a);if(a.error)throw Error.create(a.error);this.loadClientState(a.state);b(a.result)},_onerror:function(a){throw Error.create(a);},_onsubmit:function(){if(this._clientStateField)this._clientStateField.value=this.saveClientState();return true}};Sys.Extended.UI.ControlBase.registerClass("Sys.Extended.UI.ControlBase",Sys.UI.Control)}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ComponentModel","Serialization"],a);else a()})();
Type.registerNamespace('Sys.Extended.UI');Sys.Extended.UI.Resources={"PasswordStrength_InvalidWeightingRatios":"Strength Weighting ratios must have 4 elements","HTMLEditor_toolbar_button_FontSize_defaultValue":"default","HTMLEditor_toolbar_button_DesignMode_title":"Design mode","Animation_ChildrenNotAllowed":"Sys.Extended.UI.Animation.createAnimation cannot add child animations to type \"{0}\" that does not derive from Sys.Extended.UI.Animation.ParentAnimation","PasswordStrength_RemainingSymbols":"{0} symbol characters","HTMLEditor_toolbar_button_FixedForeColor_title":"Foreground color","HTMLEditor_toolbar_popup_LinkProperties_field_URL":"URL","ExtenderBase_CannotSetClientStateField":"clientStateField can only be set before initialization","HTMLEditor_toolbar_button_Bold_title":"Bold","RTE_PreviewHTML":"Preview HTML","HTMLEditor_toolbar_popup_LinkProperties_button_OK":"OK","HTMLEditor_toolbar_button_JustifyRight_title":"Justify Right","RTE_JustifyCenter":"Justify Center","PasswordStrength_RemainingUpperCase":"{0} more upper case characters","HTMLEditor_toolbar_popup_LinkProperties_button_Cancel":"Cancel","Animation_TargetNotFound":"Sys.Extended.UI.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control.  No element or control could be found corresponding to \"{0}\"","AsyncFileUpload_UnhandledException":"Unhandled Exception","RTE_FontColor":"Font Color","RTE_LabelColor":"Label Color","Common_InvalidBorderWidthUnit":"A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth","HTMLEditor_toolbar_button_JustifyFull_title":"Justify","RTE_Heading":"Heading","AsyncFileUpload_ConfirmToSeeErrorPage":"Do you want to see the response page?","Tabs_PropertySetBeforeInitialization":"{0} cannot be changed before initialization","HTMLEditor_toolbar_button_StrikeThrough_title":"Strike through","RTE_OrderedList":"Ordered List","HTMLEditor_toolbar_button_OnPastePlainText":"Plain text pasting is switched on. Just now: {0}","HTMLEditor_toolbar_button_RemoveLink_title":"Remove Link","HTMLEditor_toolbar_button_FontName_defaultValue":"default","HTMLEditor_toolbar_button_FontName_label":"Font","ReorderList_DropWatcherBehavior_NoChild":"Could not find child of list with id \"{0}\"","CascadingDropDown_MethodTimeout":"[Method timeout]","RTE_Columns":"Columns","RTE_InsertImage":"Insert Image","RTE_InsertTable":"Insert Table","RTE_Values":"Values","RTE_OK":"OK","ExtenderBase_PageNotRegisteredForCallbacks":"This Page has not been registered for callbacks","HTMLEditor_toolbar_button_InsertLink_title":"Insert/Edit URL link","Animation_NoDynamicPropertyFound":"Sys.Extended.UI.Animation.createAnimation found no property corresponding to \"{0}\" or \"{1}\"","Animation_InvalidBaseType":"Sys.Extended.UI.Animation.registerAnimation can only register types that inherit from Sys.Extended.UI.Animation.Animation","RTE_UnorderedList":"Unordered List","AsyncFileUpload_UnknownServerError":"Unknown Server error","ResizableControlBehavior_InvalidHandler":"{0} handler not a function, function name, or function text","Animation_InvalidColor":"Color must be a 7-character hex representation (e.g. #246ACF), not \"{0}\"","RTE_CellColor":"Cell Color","PasswordStrength_RemainingMixedCase":"Mixed case characters","HTMLEditor_toolbar_button_HtmlMode_title":"HTML text","RTE_Italic":"Italic","CascadingDropDown_NoParentElement":"Failed to find parent element \"{0}\"","ValidatorCallout_DefaultErrorMessage":"This control is invalid","HTMLEditor_toolbar_button_DecreaseIndent_title":"Decrease Indent","RTE_Indent":"Indent","ReorderList_DropWatcherBehavior_CallbackError":"Reorder failed, see details below.\\r\\n\\r\\n{0}","PopupControl_NoDefaultProperty":"No default property supported for control \"{0}\" of type \"{1}\"","RTE_Normal":"Normal","PopupExtender_NoParentElement":"Couldn\u0027t find parent element \"{0}\"","RTE_ViewValues":"View Values","RTE_Legend":"Legend","RTE_Labels":"Labels","RTE_CellSpacing":"Cell Spacing","PasswordStrength_RemainingNumbers":"{0} more numbers","HTMLEditor_toolbar_popup_LinkProperties_field_Target":"Target","HTMLEditor_toolbar_button_PreviewMode_title":"Preview","RTE_Border":"Border","RTE_Create":"Create","RTE_BackgroundColor":"Background Color","RTE_Cancel":"Cancel","HTMLEditor_toolbar_button_PasteText_title":"Paste Plain Text","RTE_JustifyFull":"Justify Full","RTE_JustifyLeft":"Justify Left","RTE_Cut":"Cut","AsyncFileUpload_UploadingProblem":"The requested file uploading problem.","ResizableControlBehavior_CannotChangeProperty":"Changes to {0} not supported","RTE_ViewSource":"View Source","Common_InvalidPaddingUnit":"A unit type of \"{0}\" is invalid for parsePadding","RTE_Paste":"Paste","ExtenderBase_ControlNotRegisteredForCallbacks":"This Control has not been registered for callbacks","Calendar_Today":"Today: {0}","MultiHandleSlider_CssHeightWidthRequired":"You must specify a CSS width and height for all handle styles as well as the rail.","Common_DateTime_InvalidFormat":"Invalid format","HTMLEditor_toolbar_button_Copy_title":"Copy","ListSearch_DefaultPrompt":"Type to search","CollapsiblePanel_NoControlID":"Failed to find element \"{0}\"","RTE_ViewEditor":"View Editor","HTMLEditor_toolbar_popup_LinkProperties_field_Target_Current":"Current window","RTE_BarColor":"Bar Color","AsyncFileUpload_InternalErrorMessage":"The AsyncFileUpload control has encountered an error with the uploader in this page. Please refresh the page and try again.","HTMLEditor_toolbar_button_Underline_title":"Underline","PasswordStrength_DefaultStrengthDescriptions":"NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!","HTMLEditor_toolbar_button_SuperScript_title":"Super script","HTMLEditor_toolbar_button_Ltr_title":"Left to right direction","HTMLEditor_toolbar_button_RemoveAlignment_title":"Remove Alignment","HTMLEditor_toolbar_button_OrderedList_title":"Ordered List","HTMLEditor_toolbar_popup_LinkProperties_field_Target_New":"New window","HTMLEditor_toolbar_popup_LinkProperties_field_Target_Top":"Top window","HTMLEditor_toolbar_button_JustifyCenter_title":"Justify Center","RTE_Inserttexthere":"Insert text here","Animation_UknownAnimationName":"Sys.Extended.UI.Animation.createAnimation could not find an Animation corresponding to the name \"{0}\"","ExtenderBase_InvalidClientStateType":"saveClientState must return a value of type String","HTMLEditor_toolbar_button_JustifyLeft_title":"Justify Left","Rating_CallbackError":"An unhandled exception has occurred:\\r\\n{0}","HTMLEditor_toolbar_button_Undo_title":"Undo","HTMLEditor_toolbar_button_Redo_title":"Redo","Tabs_OwnerExpected":"owner must be set before initialize","DynamicPopulate_WebServiceTimeout":"Web service call timed out","PasswordStrength_RemainingLowerCase":"{0} more lower case characters","HTMLEditor_toolbar_button_BulletedList_title":"Bulleted List","HTMLEditor_toolbar_button_Paste_title":"Paste","Animation_MissingAnimationName":"Sys.Extended.UI.Animation.createAnimation requires an object with an AnimationName property","HTMLEditor_toolbar_button_PasteWord_title":"Paste from MS Word (with cleanup)","HTMLEditor_toolbar_button_Italic_title":"Italic","RTE_JustifyRight":"Justify Right","Tabs_ActiveTabArgumentOutOfRange":"Argument is not a member of the tabs collection","RTE_CellPadding":"Cell Padding","HTMLEditor_toolbar_button_ForeColorClear_title":"Clear foreground color","RTE_ClearFormatting":"Clear Formatting","AlwaysVisible_ElementRequired":"Sys.Extended.UI.AlwaysVisibleControlBehavior must have an element","HTMLEditor_toolbar_button_SubScript_title":"Sub script","Slider_NoSizeProvided":"Please set valid values for the height and width attributes in the slider\u0027s CSS classes","DynamicPopulate_WebServiceError":"Web Service call failed: {0}","PasswordStrength_StrengthPrompt":"Strength: ","HTMLEditor_toolbar_button_Rtl_title":"Right to left direction","PasswordStrength_RemainingCharacters":"{0} more characters","HTMLEditor_toolbar_button_BackColorClear_title":"Clear background color","PasswordStrength_Satisfied":"Nothing more required","RTE_Hyperlink":"Hyperlink","Animation_NoPropertyFound":"Sys.Extended.UI.Animation.createAnimation found no property corresponding to \"{0}\"","PasswordStrength_InvalidStrengthDescriptionStyles":"Text Strength description style classes must match the number of text descriptions.","HTMLEditor_toolbar_button_Use_verb":"Use {0}","HTMLEditor_toolbar_popup_LinkProperties_field_Target_Parent":"Parent window","PasswordStrength_GetHelpRequirements":"Get help on password requirements","HTMLEditor_toolbar_button_FixedBackColor_title":"Background color","PasswordStrength_InvalidStrengthDescriptions":"Invalid number of text strength descriptions specified","RTE_Underline":"Underline","HTMLEditor_toolbar_button_IncreaseIndent_title":"Increase Indent","AsyncFileUpload_ServerResponseError":"Server Response Error","Tabs_PropertySetAfterInitialization":"{0} cannot be changed after initialization","RTE_Rows":"Rows","RTE_Redo":"Redo","RTE_Size":"Size","RTE_Undo":"Undo","RTE_Bold":"Bold","RTE_Copy":"Copy","RTE_Font":"Font","HTMLEditor_toolbar_button_FontSize_label":"Size","HTMLEditor_toolbar_button_Cut_title":"Cut","CascadingDropDown_MethodError":"[Method error {0}]","HTMLEditor_toolbar_button_InsertLink_message_EmptyURL":"URL can not be empty","RTE_BorderColor":"Border Color","HTMLEditor_toolbar_button_RemoveStyles_title":"Remove styles","RTE_Paragraph":"Paragraph","RTE_InsertHorizontalRule":"Insert Horizontal Rule","HTMLEditor_toolbar_button_Paragraph_title":"Make Paragraph","Common_UnitHasNoDigits":"No digits","RTE_Outdent":"Outdent","Common_DateTime_InvalidTimeSpan":"\"{0}\" is not a valid TimeSpan format","Animation_CannotNestSequence":"Sys.Extended.UI.Animation.SequenceAnimation cannot be nested inside Sys.Extended.UI.Animation.ParallelAnimation","HTMLEditor_toolbar_button_InsertHR_title":"Insert horizontal rule","HTMLEditor_toolbar_button_OnPasteFromMSWord":"Pasting from MS Word is switched on. Just now: {0}","Shared_BrowserSecurityPreventsPaste":"Your browser security settings don\u0027t permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."};
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedCollapsiblePanel";function a(){var q="expandComplete",p="expanded",o="expanding",n="collapseComplete",m="collapsed",l="collapsing",k="TargetWidth",j="TargetHeight",c="auto",g="display",u="ExpandControlID",f="click",t="CollapseControlID",s="mouseout",r="mouseover",i="Collapsed",b="",h="SuppressPostBack",e="px",a=null,d=false;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.CollapsiblePanelExpandDirection=function(){throw Error.invalidOperation();};Sys.Extended.UI.CollapsiblePanelExpandDirection.prototype={Horizontal:0,Vertical:1};Sys.Extended.UI.CollapsiblePanelExpandDirection.registerEnum("Sys.Extended.UI.CollapsiblePanelExpandDirection",d);Sys.Extended.UI.CollapsiblePanelBehavior=function(c){var b=this;Sys.Extended.UI.CollapsiblePanelBehavior.initializeBase(b,[c]);b._collapsedSize=0;b._expandedSize=0;b._scrollContents=a;b._collapsed=d;b._expandControlID=a;b._collapseControlID=a;b._textLabelID=a;b._collapsedText=a;b._expandedText=a;b._imageControlID=a;b._expandedImage=a;b._collapsedImage=a;b._suppressPostBack=a;b._autoExpand=a;b._autoCollapse=a;b._expandDirection=Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical;b._collapseClickHandler=a;b._expandClickHandler=a;b._panelMouseEnterHandler=a;b._panelMouseLeaveHandler=a;b._childDiv=a;b._animation=a};Sys.Extended.UI.CollapsiblePanelBehavior.prototype={initialize:function(){var c=this;Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(c,"initialize");var g=c.get_element();c._animation=new Sys.Extended.UI.Animation.LengthAnimation(g,.25,10,"style",a,0,0,e);if(c._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical)c._animation.set_propertyKey("height");else c._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal&&c._animation.set_propertyKey("width");c._animation.add_ended(Function.createDelegate(c,c._onAnimateComplete));if(c._suppressPostBack==a)if(g.tagName=="INPUT"&&g.type=="checkbox"){c._suppressPostBack=d;c.raisePropertyChanged(h)}else if(g.tagName=="A"){c._suppressPostBack=true;c.raisePropertyChanged(h)}var j=Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(c,"get_ClientState");if(j&&j!=b){var m=Boolean.parse(j);if(c._collapsed!=m){c._collapsed=m;c.raisePropertyChanged(i)}}c._setupChildDiv();if(c._collapsed)c._setTargetSize(c._getCollapsedSize());else c._setTargetSize(c._getExpandedSize());c._setupState(c._collapsed);if(c._collapseControlID==c._expandControlID){c._collapseClickHandler=Function.createDelegate(c,c.togglePanel);c._expandClickHandler=a}else{c._collapseClickHandler=Function.createDelegate(c,c.collapsePanel);c._expandClickHandler=Function.createDelegate(c,c.expandPanel)}if(c._autoExpand){c._panelMouseEnterHandler=Function.createDelegate(c,c._onMouseEnter);$addHandler(g,r,c._panelMouseEnterHandler)}if(c._autoCollapse){c._panelMouseLeaveHandler=Function.createDelegate(c,c._onMouseLeave);$addHandler(g,s,c._panelMouseLeaveHandler)}if(c._collapseControlID){var k=$get(c._collapseControlID);if(!k)throw Error.argument(t,String.format(Sys.Extended.UI.Resources.CollapsiblePanel_NoControlID,c._collapseControlID));else $addHandler(k,f,c._collapseClickHandler)}if(c._expandControlID)if(c._expandClickHandler){var l=$get(c._expandControlID);if(!l)throw Error.argument(u,String.format(Sys.Extended.UI.Resources.CollapsiblePanel_NoControlID,c._expandControlID));else $addHandler(l,f,c._expandClickHandler)}},dispose:function(){var b=this,e=b.get_element();if(b._collapseClickHandler){var c=b._collapseControlID?$get(b._collapseControlID):a;c&&$removeHandler(c,f,b._collapseClickHandler);b._collapseClickHandler=a}if(b._expandClickHandler){var d=b._expandControlID?$get(b._expandControlID):a;d&&$removeHandler(d,f,b._expandClickHandler);b._expandClickHandler=a}b._panelMouseEnterHandler&&$removeHandler(e,r,b._panelMouseEnterHandler);b._panelMouseLeaveHandler&&$removeHandler(e,s,b._panelMouseLeaveHandler);if(b._animation){b._animation.dispose();b._animation=a}Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(b,"dispose")},togglePanel:function(a){this._toggle(a)},expandPanel:function(a){this._doOpen(a)},collapsePanel:function(a){this._doClose(a)},_checkCollapseHide:function(){if(this._collapsed&&this._getTargetSize()==0){var a=this.get_element(),b=$common.getCurrentStyle(a,g);if(!a.oldDisplay&&b!="none"){a.oldDisplay=b;a.style.display="none"}return true}return d},_doClose:function(b){var a=this,c=new Sys.CancelEventArgs;a.raiseCollapsing(c);if(c.get_cancel())return;if(a._animation){a._animation.stop();a._animation.set_startValue(a._getTargetSize());a._animation.set_endValue(a._getCollapsedSize());a._animation.play()}a._setupState(true);if(a._suppressPostBack)if(b&&b.preventDefault)b.preventDefault();else{if(b)b.returnValue=d;return d}},_doOpen:function(e){var b=this,f=new Sys.CancelEventArgs;b.raiseExpanding(f);if(f.get_cancel())return;if(b._animation){b._animation.stop();var c=b.get_element();if(b._checkCollapseHide()&&$common.getCurrentStyle(c,g,c.style.display)){if(c.oldDisplay)c.style.display=c.oldDisplay;else if(c.style.removeAttribute)c.style.removeAttribute(g);else c.style.removeProperty(g);c.oldDisplay=a}b._animation.set_startValue(b._getTargetSize());b._animation.set_endValue(b._getExpandedSize());b._animation.play()}b._setupState(d);if(b._suppressPostBack)if(e&&e.preventDefault)e.preventDefault();else{if(e)e.returnValue=d;return d}},_onAnimateComplete:function(){var a=this,b=a.get_element();if(!a._collapsed&&!a._expandedSize)if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical)if(a._childDiv.offsetHeight<=b.offsetHeight){b.style.height=c;a.raisePropertyChanged(j)}else a._checkCollapseHide();else if(a._childDiv.offsetWidth<=b.offsetWidth){b.style.width=c;a.raisePropertyChanged(k)}else a._checkCollapseHide();else a._checkCollapseHide();if(a._collapsed){a.raiseCollapseComplete();a.raiseCollapsed(Sys.EventArgs.Empty)}else{a.raiseExpandComplete();a.raiseExpanded(new Sys.EventArgs)}},_onMouseEnter:function(a){this._autoExpand&&this.expandPanel(a)},_onMouseLeave:function(a){this._autoCollapse&&this.collapsePanel(a)},_getExpandedSize:function(){var a=this;return a._expandedSize?a._expandedSize:a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical?a._childDiv.offsetHeight:a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal?a._childDiv.offsetWidth:void 0},_getCollapsedSize:function(){return this._collapsedSize?this._collapsedSize:0},_getTargetSize:function(){var b=this,a;if(b._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical)a=b.get_TargetHeight();else if(b._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal)a=b.get_TargetWidth();if(a===undefined)a=0;return a},_setTargetSize:function(b){var a=this,e=a._collapsed||a._expandedSize,d=a.get_element();if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical)if(e||b<d.offsetHeight)a.set_TargetHeight(b);else{d.style.height=c;a.raisePropertyChanged(j)}else if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal)if(e||b<d.offsetWidth)a.set_TargetWidth(b);else{d.style.width=c;a.raisePropertyChanged(k)}a._checkCollapseHide()},_setupChildDiv:function(){var h="hidden",g="scroll",a=this,i=a._getTargetSize(),f=a.get_element();a._childDiv=f.cloneNode(d);f.id=b;a._childDiv.style.visibility="visible";a._childDiv.style.display=b;while(f.hasChildNodes()){var j=f.childNodes[0];j=f.removeChild(j);a._childDiv.appendChild(j)}f.setAttribute("style",b);f.className=b;f.style.border="0px";f.style.margin="0px";f.style.padding="0px";if(a._scrollContents){if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical){f.style.overflowY=g;a._childDiv.style.overflowY=b}else{f.style.overflowX=g;a._childDiv.style.overflowX=b}if(Sys.Browser.agent==Sys.Browser.Safari||Sys.Browser.agent==Sys.Browser.Opera){f.style.overflow=g;a._childDiv.style.overflow=b}}else{if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical){f.style.overflowY=h;a._childDiv.style.overflowY=b}else{f.style.overflowX=h;a._childDiv.style.overflowX=b}if(Sys.Browser.Agent==Sys.Browser.Safari||Sys.Browser.Agent==Sys.Browser.Opera){f.style.overflow=h;a._childDiv.style.overflow=b}}a._childDiv.style.position=b;if(i==a._collapsedSize)if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical)a._childDiv.style.height=c;else if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal)a._childDiv.style.width=c;f.appendChild(a._childDiv);f.style.visibility="visible";f.style.display=b;if(a._collapsed)i=a._getCollapsedSize();else i=a._getExpandedSize();if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical){f.style.height=i+e;if(!a._expandedSize)f.style.height=c;else f.style.height=a._expandedSize+e;a._childDiv.style.height=c}else if(a._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Horizontal){f.style.width=i+e;if(!a._expandedSize)f.style.width=c;else f.style.width=a._expandedSize+e;a._childDiv.style.width=c}},_setupState:function(d){var a=this;if(d){if(a._textLabelID&&a._collapsedText){var c=$get(a._textLabelID);if(c)c.innerHTML=a._collapsedText}if(a._imageControlID&&a._collapsedImage){var b=$get(a._imageControlID);if(b&&b.src){b.src=a._collapsedImage;if(a._expandedText||a._collapsedText)b.title=a._collapsedText}}}else{if(a._textLabelID&&a._expandedText){var c=$get(a._textLabelID);if(c)c.innerHTML=a._expandedText}if(a._imageControlID&&a._expandedImage){var b=$get(a._imageControlID);if(b&&b.src){b.src=a._expandedImage;if(a._expandedText||a._collapsedText)b.title=a._expandedText}}}if(a._collapsed!=d){a._collapsed=d;a.raisePropertyChanged(i)}Sys.Extended.UI.CollapsiblePanelBehavior.callBaseMethod(a,"set_ClientState",[a._collapsed.toString()])},_toggle:function(a){return this.get_Collapsed()?this.expandPanel(a):this.collapsePanel(a)},add_collapsing:function(a){this.get_events().addHandler(l,a)},remove_collapsing:function(a){this.get_events().removeHandler(l,a)},raiseCollapsing:function(b){var a=this.get_events().getHandler(l);a&&a(this,b)},add_collapsed:function(a){this.get_events().addHandler(m,a)},remove_collapsed:function(a){this.get_events().removeHandler(m,a)},raiseCollapsed:function(b){var a=this.get_events().getHandler(m);a&&a(this,b)},add_collapseComplete:function(a){this.get_events().addHandler(n,a)},remove_collapseComplete:function(a){this.get_events().removeHandler(n,a)},raiseCollapseComplete:function(){var a=this.get_events().getHandler(n);a&&a(this,Sys.EventArgs.Empty)},add_expanding:function(a){this.get_events().addHandler(o,a)},remove_expanding:function(a){this.get_events().removeHandler(o,a)},raiseExpanding:function(b){var a=this.get_events().getHandler(o);a&&a(this,b)},add_expanded:function(a){this.get_events().addHandler(p,a)},remove_expanded:function(a){this.get_events().removeHandler(p,a)},raiseExpanded:function(b){var a=this.get_events().getHandler(p);a&&a(this,b)},add_expandComplete:function(a){this.get_events().addHandler(q,a)},remove_expandComplete:function(a){this.get_events().removeHandler(q,a)},raiseExpandComplete:function(){var a=this.get_events().getHandler(q);a&&a(this,Sys.EventArgs.Empty)},get_TargetHeight:function(){return this.get_element().offsetHeight},set_TargetHeight:function(a){this.get_element().style.height=a+e;this.raisePropertyChanged(j)},get_TargetWidth:function(){return this.get_element().offsetWidth},set_TargetWidth:function(a){this.get_element().style.width=a+e;this.raisePropertyChanged(k)},get_Collapsed:function(){return this._collapsed},set_Collapsed:function(b){var a=this;if(a.get_isInitialized()&&a.get_element()&&b!=a.get_Collapsed())a.togglePanel();else{a._collapsed=b;a.raisePropertyChanged(i)}},get_CollapsedSize:function(){return this._collapsedSize},set_CollapsedSize:function(a){if(this._collapsedSize!=a){this._collapsedSize=a;this.raisePropertyChanged("CollapsedSize")}},get_ExpandedSize:function(){return this._expandedSize},set_ExpandedSize:function(a){if(this._expandedSize!=a){this._expandedSize=a;this.raisePropertyChanged("ExpandedSize")}},get_CollapseControlID:function(){return this._collapseControlID},set_CollapseControlID:function(a){if(this._collapseControlID!=a){this._collapseControlID=a;this.raisePropertyChanged(t)}},get_ExpandControlID:function(){return this._expandControlID},set_ExpandControlID:function(a){if(this._expandControlID!=a){this._expandControlID=a;this.raisePropertyChanged(u)}},get_ScrollContents:function(){return this._scrollContents},set_ScrollContents:function(a){if(this._scrollContents!=a){this._scrollContents=a;this.raisePropertyChanged("ScrollContents")}},get_SuppressPostBack:function(){return this._suppressPostBack},set_SuppressPostBack:function(a){if(this._suppressPostBack!=a){this._suppressPostBack=a;this.raisePropertyChanged(h)}},get_TextLabelID:function(){return this._textLabelID},set_TextLabelID:function(a){if(this._textLabelID!=a){this._textLabelID=a;this.raisePropertyChanged("TextLabelID")}},get_ExpandedText:function(){return this._expandedText},set_ExpandedText:function(a){if(this._expandedText!=a){this._expandedText=a;this.raisePropertyChanged("ExpandedText")}},get_CollapsedText:function(){return this._collapsedText},set_CollapsedText:function(a){if(this._collapsedText!=a){this._collapsedText=a;this.raisePropertyChanged("CollapsedText")}},get_ImageControlID:function(){return this._imageControlID},set_ImageControlID:function(a){if(this._imageControlID!=a){this._imageControlID=a;this.raisePropertyChanged("ImageControlID")}},get_ExpandedImage:function(){return this._expandedImage},set_ExpandedImage:function(a){if(this._expandedImage!=a){this._expandedImage=a;this.raisePropertyChanged("ExpandedImage")}},get_CollapsedImage:function(){return this._collapsedImage},set_CollapsedImage:function(a){if(this._collapsedImage!=a){this._collapsedImage=a;this.raisePropertyChanged("CollapsedImage")}},get_AutoExpand:function(){return this._autoExpand},set_AutoExpand:function(a){if(this._autoExpand!=a){this._autoExpand=a;this.raisePropertyChanged("AutoExpand")}},get_AutoCollapse:function(){return this._autoCollapse},set_AutoCollapse:function(a){if(this._autoCollapse!=a){this._autoCollapse=a;this.raisePropertyChanged("AutoCollapse")}},get_ExpandDirection:function(){return this._expandDirection==Sys.Extended.UI.CollapsiblePanelExpandDirection.Vertical},set_ExpandDirection:function(a){if(this._expandDirection!=a){this._expandDirection=a;this.raisePropertyChanged("ExpandDirection")}}};Sys.Extended.UI.CollapsiblePanelBehavior.registerClass("Sys.Extended.UI.CollapsiblePanelBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.CollapsiblePanelBehavior,{name:"collapsiblePanel"})}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedBase","ExtendedCommon","ExtendedAnimations"],a);else a()})();
// Raj Kaimal 
// http://weblogs.asp.net/rajbk/

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

Type.registerNamespace('Flan');

Flan.UpdateProgressOverlayBehavior = function (element) {
    Flan.UpdateProgressOverlayBehavior.initializeBase(this, [element]);

    //Properties    
    this._timerID = null;
    
    //Handlers
    this._pageRequestManager = null;
    this._showDelegate = null;
    this._pageBeginRequestHandler = null;
    this._pageEndRequestHandler = null;
    this._windowResizeHandler = null;
    this._isActive = false;
    
}

Flan.UpdateProgressOverlayBehavior.prototype = {
    initialize: function()
    {
        Flan.UpdateProgressOverlayBehavior.callBaseMethod(this, 'initialize');
        var elt = this.get_element();
        if (elt)
        {
            elt.style.position = 'absolute';
        }
        this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
        this._pageBeginRequestHandler = Function.createDelegate(this, this._onBeginRequest);
        this._pageEndRequestHandler = Function.createDelegate(this, this._onEndRequest);
        this._showDelegate = Function.createDelegate(this, this._onShow);
        if (this._pageRequestManager != null)
        {
            this._pageRequestManager.add_beginRequest(this._pageBeginRequestHandler);
            this._pageRequestManager.add_endRequest(this._pageEndRequestHandler);
        }
        this._windowResizeHandler = Function.createDelegate(this, this._onWindowResize);
        $addHandler(window, 'resize', this._windowResizeHandler);

    },
    dispose: function()
    {
        if (this._pageRequestManager)
        {
            if (this._pageBeginRequestHandler)
            {
                this._pageRequestManager.remove_beginRequest(this._onBeginRequest);
                this._pageEndRequestHandler = null;
            }
            if (this._pageEndRequestHandler)
            {
                this._pageRequestManager.remove_endRequest(this._onEndRequest);
                this._pageEndRequestHandler = null;
            }
            this._pageRequestManager = null;
        }

        if (this._windowResizeHandler)
        {
            $removeHandler(window, 'resize', this._windowResizeHandler);
            this._windowResizeHandler = null;
        }

        Flan.UpdateProgressOverlayBehavior.callBaseMethod(this, 'dispose');
    },
    //
    // Handlers
    //
    _onBeginRequest: function(sender, arg)
    {
        var curElt = arg.get_postBackElement();
        var startTimer = !(this._associatedUpdatePanelID);
        while (!startTimer && curElt)
        {
            if (curElt.id && this._associatedUpdatePanelID === curElt.id)
            {
                startTimer = true;
            }
            curElt = curElt.parentNode;
        }
        if (startTimer)
        {
            this._timerID = window.setTimeout(this._showDelegate, this._displayAfter);
        }
    },
    _onEndRequest: function(sender, arg)
    {
        var elt = this.get_element();
        if (!elt)
        {
            return;
        }

        elt.style.display = 'none';
        Sys.UI.DomElement.setLocation(elt, -50000, -50000);

        var iframe = elt.iframeOverlay;
        if (iframe)
        {
            iframe.style.display = 'none';
            Sys.UI.DomElement.setLocation(iframe, -50000, -50000);
        }
        if (this._timerID)
        {
            window.clearTimeout(this._timerID);
            this._timerID = null;
        }
        this._isActive = false;
    },
    _onWindowResize: function()
    {
        if (this._isActive)
        {
            this._onShow();
        }
    },
    //
    // Private methods
    //
    _onShow: function()
    {
        var controlToOverlay;
        var elt;

        if (this._controlToOverlayID)
        {
            controlToOverlay = $get(this._controlToOverlayID);
            if (!controlToOverlay)
            {
                return;
            }
        }

        elt = this.get_element();
        if (!elt)
        {
            return;
        }

        this._isActive = true;
        var iframe = (this._iframeRequired()) ? this._initializeIframe() : null;

        if (this._targetCssClass)
        {
            Sys.UI.DomElement.addCssClass(elt, this._targetCssClass);
        }

        elt.style.zIndex = 100000;
        elt.style.position = 'absolute';

        var bounds = (this._controlToOverlayID) ?
            this._getElementBounds(controlToOverlay) : this._getBrowserInnerBounds();

        elt.style.width = bounds.width + 'px';
        elt.style.height = bounds.height + 'px';
        Sys.UI.DomElement.setLocation(elt, bounds.x, bounds.y);
        if (this.overrideSetLocation)
            this.overrideSetLocation(elt, bounds);

        if (iframe)
        {
            iframe.style.width = bounds.width + 'px';
            iframe.style.height = bounds.height + 'px';
            iframe.style.display = 'block';
            Sys.UI.DomElement.setLocation(iframe, bounds.x, bounds.y);
        }
    },
    _iframeRequired: function()
    {
        return ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7));
    },
    _initializeIframe: function()
    {
        var elt = this.get_element();
        if (!elt.iframeOverlay)
        {
            var iframeOverlay = document.createElement('iframe');
            iframeOverlay.style.zIndex = 99999;
            iframeOverlay.src = 'javascript:false';
            iframeOverlay.style.position = 'absolute';
            iframeOverlay.style.margin = '0px';
            iframeOverlay.style.padding = '0px';
            iframeOverlay.style.opacity = 0;
            iframeOverlay.style.MozOpacity = 0;
            iframeOverlay.style.KhtmlOpacity = 0;
            iframeOverlay.style.filter = 'alpha(opacity=0)';
            iframeOverlay.style.border = 'none';

            elt.parentNode.insertBefore(iframeOverlay, elt);
            elt.iframeOverlay = iframeOverlay;
        }
        return elt.iframeOverlay;
    },
    _getElementBounds: function(targetElement)
    {
        var bounds = Sys.UI.DomElement.getBounds(targetElement);
        var delta = this._getDeltaLocation();
        bounds.x = bounds.x - delta.x;
        bounds.y = bounds.y - delta.y;
        return bounds;
    },
    _getDeltaLocation: function()
    {  //TODO: Move to common class
        var elt = this.get_element();
        var eltLocation = Sys.UI.DomElement.getLocation(elt);
        var dx = eltLocation.x - elt.offsetLeft;
        var dy = eltLocation.y - elt.offsetTop;

        if (Sys.Browser.agent === Sys.Browser.Safari)
        {
            dx -= document.body.offsetLeft;
            dy -= document.body.offsetTop;
        }

        return new Sys.UI.Point(dx, dy);
    },
    _getBrowserInnerBounds: function()
    {
        var height;
        var width;
        var compatMode = document.compatMode;
        var delta = this._getDeltaLocation();

        if (compatMode == 'CSS1Compat')
        {
            width = Math.max(document.documentElement.clientWidth, document.documentElement.scrollWidth);
            height = Math.max(document.documentElement.clientHeight, document.documentElement.scrollHeight);
        }
        else
        {
            width = (window.innerWidth) ? window.innerWidth : Math.max(document.body.clientWidth, document.body.scrollWidth);
            height = (window.innerHeight) ? window.innerHeight : Math.max(document.body.clientHeight, document.body.scrollHeight);
        }
        return new Sys.UI.Bounds(0, 0, width, height);
    },
    //
    // Properties
    //
    get_controlToOverlayID: function()
    {
        return this._controlToOverlayID;
    },
    set_controlToOverlayID: function(value)
    {
        this._controlToOverlayID = value;
    },

    get_targetCssClass: function()
    {
        return this._targetCssClass;
    },
    set_targetCssClass: function(value)
    {
        this._targetCssClass = value;
    },

    get_displayAfter: function()
    {
        return this._displayAfter;
    },
    set_displayAfter: function(value)
    {
        this._displayAfter = value;
    },

    get_associatedUpdatePanelID: function()
    {
        return this._associatedUpdatePanelID;
    },
    set_associatedUpdatePanelID: function(value)
    {
        this._associatedUpdatePanelID = value;
    }
}

Flan.UpdateProgressOverlayBehavior.registerClass('Flan.UpdateProgressOverlayBehavior', Sys.UI.Behavior);
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedFilteredTextBox";function a(){var c="filtered",b="processKey",d="keypress",a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.FilteredTextBoxBehavior=function(c){var b=this;Sys.Extended.UI.FilteredTextBoxBehavior.initializeBase(b,[c]);b._keypressHandler=a;b._changeHandler=a;b._intervalID=a;b._filterType=Sys.Extended.UI.FilterTypes.Custom;b._filterMode=Sys.Extended.UI.FilterModes.ValidChars;b._validChars=a;b._invalidChars=a;b._filterInterval=250;b.charTypes={};b.charTypes.LowercaseLetters="abcdefghijklmnopqrstuvwxyz";b.charTypes.UppercaseLetters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";b.charTypes.Numbers="0123456789"};Sys.Extended.UI.FilteredTextBoxBehavior.prototype={initialize:function(){var a=this;Sys.Extended.UI.FilteredTextBoxBehavior.callBaseMethod(a,"initialize");var b=a.get_element();a._keypressHandler=Function.createDelegate(a,a._onkeypress);$addHandler(b,d,a._keypressHandler);a._changeHandler=Function.createDelegate(a,a._onchange);$addHandler(b,"change",a._changeHandler);var c=Function.createDelegate(a,a._intervalCallback);a._intervalID=window.setInterval(c,a._filterInterval)},dispose:function(){var b=this,c=b.get_element();$removeHandler(c,d,b._keypressHandler);b._keypressHandler=a;$removeHandler(c,"change",b._changeHandler);b._changeHandler=a;window.clearInterval(b._intervalID);Sys.Extended.UI.FilteredTextBoxBehavior.callBaseMethod(b,"dispose")},_getValidChars:function(){var a=this;if(a._validChars)return a._validChars;a._validChars="";for(type in a.charTypes){var b=Sys.Extended.UI.FilterTypes.toString(a._filterType);if(b.indexOf(type)!=-1)a._validChars+=a.charTypes[type]}return a._validChars},_getInvalidChars:function(){var a=this;if(!a._invalidChars)a._invalidChars=a.charTypes.Custom;return a._invalidChars},_onkeypress:function(a){var b;if((a.rawEvent.charCode==0||a.rawEvent.keyCode==a.rawEvent.which&&a.rawEvent.charCode==undefined)&&(a.rawEvent.keyCode==Sys.UI.Key.pageUp||a.rawEvent.keyCode==Sys.UI.Key.pageDown||a.rawEvent.keyCode==Sys.UI.Key.up||a.rawEvent.keyCode==Sys.UI.Key.down||a.rawEvent.keyCode==Sys.UI.Key.left||a.rawEvent.keyCode==Sys.UI.Key.right||a.rawEvent.keyCode==Sys.UI.Key.home||a.rawEvent.keyCode==Sys.UI.Key.end||a.rawEvent.keyCode==46)||a.ctrlKey)return;if(a.rawEvent.keyIdentifier){if(a.rawEvent.ctrlKey||a.rawEvent.altKey||a.rawEvent.metaKey)return;if(a.rawEvent.keyIdentifier.substring(0,2)!="U+")return;b=a.rawEvent.charCode;if(b==63272)return}else b=a.charCode;if(b&&b>=32){var c=String.fromCharCode(b);!this._processKey(c)&&a.preventDefault()}},_processKey:function(c){var b=this,a="",d=false;if(b._filterMode==Sys.Extended.UI.FilterModes.ValidChars){a=b._getValidChars();d=a&&a.length>0&&a.indexOf(c)==-1}else{a=b._getInvalidChars();d=a&&a.length>0&&a.indexOf(c)>-1}var e=new Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs(c,Sys.Extended.UI.TextBoxWrapper.get_Wrapper(b.get_element()).get_Value(),d);b.raiseProcessKey(e);if(e.get_allowKey())return true;b.raiseFiltered(new Sys.Extended.UI.FilteredTextBoxEventArgs(c));return false},_onchange:function(){for(var b=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()),d=b.get_Value()||"",c=new Sys.StringBuilder,a=0;a<d.length;a++){var e=d.substring(a,a+1);this._processKey(e)&&c.append(e)}b.get_Value()!=c.toString()&&b.set_Value(c.toString())},_intervalCallback:function(){this._changeHandler()},get_ValidChars:function(){return this.charTypes.Custom},set_ValidChars:function(c){var b=this;if(b._validChars!=a||b.charTypes.Custom!=c){b.charTypes.Custom=c;b._validChars=a;b.raisePropertyChanged("ValidChars")}},get_InvalidChars:function(){return this.charTypes.Custom},set_InvalidChars:function(c){var b=this;if(b._invalidChars!=a||b.charTypes.Custom!=c){b.charTypes.Custom=c;b._invalidChars=a;b.raisePropertyChanged("InvalidChars")}},get_FilterType:function(){return this._filterType},set_FilterType:function(c){var b=this;if(b._validChars!=a||b._filterType!=c){b._filterType=c;b._validChars=a;b.raisePropertyChanged("FilterType")}},get_FilterMode:function(){return this._filterMode},set_FilterMode:function(c){var b=this;if(b._validChars!=a||b._invalidChars!=a||b._filterMode!=c){b._filterMode=c;b._validChars=a;b._invalidChars=a;b.raisePropertyChanged("FilterMode")}},get_FilterInterval:function(){return this._filterInterval},set_FilterInterval:function(a){if(this._filterInterval!=a){this._filterInterval=a;this.raisePropertyChanged("FilterInterval")}},add_processKey:function(a){this.get_events().addHandler(b,a)},remove_processKey:function(a){this.get_events().removeHandler(b,a)},raiseProcessKey:function(c){var a=this.get_events().getHandler(b);a&&a(this,c)},add_filtered:function(a){this.get_events().addHandler(c,a)},remove_filtered:function(a){this.get_events().removeHandler(c,a)},raiseFiltered:function(b){var a=this.get_events().getHandler(c);a&&a(this,b)}};Sys.Extended.UI.FilteredTextBoxBehavior.registerClass("Sys.Extended.UI.FilteredTextBoxBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.FilteredTextBoxBehavior,{name:"filteredTextBox"});Sys.Extended.UI.FilterTypes=function(){throw Error.invalidOperation();};Sys.Extended.UI.FilterTypes.prototype={Custom:1,Numbers:2,UppercaseLetters:4,LowercaseLetters:8};Sys.Extended.UI.FilterTypes.registerEnum("Sys.Extended.UI.FilterTypes",true);Sys.Extended.UI.FilterModes=function(){throw Error.invalidOperation();};Sys.Extended.UI.FilterModes.prototype={ValidChars:1,InvalidChars:2};Sys.Extended.UI.FilterModes.registerEnum("Sys.Extended.UI.FilterModes",true);Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs=function(d,c,b){var a=this;Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs.initializeBase(a);a._key=d;a._text=c;a._shouldFilter=b;a._allowKey=!b};Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs.prototype={get_key:function(){return this._key},get_text:function(){return this._text},get_shouldFilter:function(){return this._shouldFilter},get_allowKey:function(){return this._allowKey},set_allowKey:function(a){this._allowKey=a}};Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs.registerClass("Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs",Sys.EventArgs);Sys.Extended.UI.FilteredTextBoxEventArgs=function(a){Sys.Extended.UI.FilteredTextBoxEventArgs.initializeBase(this);this._key=a};Sys.Extended.UI.FilteredTextBoxEventArgs.prototype={get_key:function(){return this._key}};Sys.Extended.UI.FilteredTextBoxEventArgs.registerClass("Sys.Extended.UI.FilteredTextBoxEventArgs",Sys.EventArgs)}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedBase","ExtendedCommon"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedAnimationBehavior";function a(){var c="mouseout",b="mouseover",a=null;Type.registerNamespace("Sys.Extended.UI.Animation");Sys.Extended.UI.Animation.AnimationBehavior=function(c){var b=this;Sys.Extended.UI.Animation.AnimationBehavior.initializeBase(b,[c]);b._onLoad=a;b._onClick=a;b._onMouseOver=a;b._onMouseOut=a;b._onHoverOver=a;b._onHoverOut=a;b._onClickHandler=a;b._onMouseOverHandler=a;b._onMouseOutHandler=a};Sys.Extended.UI.Animation.AnimationBehavior.prototype={initialize:function(){var a=this;Sys.Extended.UI.Animation.AnimationBehavior.callBaseMethod(a,"initialize");var d=a.get_element();if(d){a._onClickHandler=Function.createDelegate(a,a.OnClick);$addHandler(d,"click",a._onClickHandler);a._onMouseOverHandler=Function.createDelegate(a,a.OnMouseOver);$addHandler(d,b,a._onMouseOverHandler);a._onMouseOutHandler=Function.createDelegate(a,a.OnMouseOut);$addHandler(d,c,a._onMouseOutHandler)}},dispose:function(){var d=this,e=d.get_element();if(e){if(d._onClickHandler){$removeHandler(e,"click",d._onClickHandler);d._onClickHandler=a}if(d._onMouseOverHandler){$removeHandler(e,b,d._onMouseOverHandler);d._onMouseOverHandler=a}if(d._onMouseOutHandler){$removeHandler(e,c,d._onMouseOutHandler);d._onMouseOutHandler=a}}d._onLoad=a;d._onClick=a;d._onMouseOver=a;d._onMouseOut=a;d._onHoverOver=a;d._onHoverOut=a;Sys.Extended.UI.Animation.AnimationBehavior.callBaseMethod(d,"dispose")},get_OnLoad:function(){return this._onLoad?this._onLoad.get_json():a},set_OnLoad:function(b){var a=this;if(!a._onLoad){a._onLoad=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onLoad.initialize()}a._onLoad.set_json(b);a.raisePropertyChanged("OnLoad");a._onLoad.play()},get_OnLoadBehavior:function(){return this._onLoad},get_OnClick:function(){return this._onClick?this._onClick.get_json():a},set_OnClick:function(b){var a=this;if(!a._onClick){a._onClick=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onClick.initialize()}a._onClick.set_json(b);a.raisePropertyChanged("OnClick")},get_OnClickBehavior:function(){return this._onClick},OnClick:function(){this._onClick&&this._onClick.play()},get_OnMouseOver:function(){return this._onMouseOver?this._onMouseOver.get_json():a},set_OnMouseOver:function(b){var a=this;if(!a._onMouseOver){a._onMouseOver=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onMouseOver.initialize()}a._onMouseOver.set_json(b);a.raisePropertyChanged("OnMouseOver")},get_OnMouseOverBehavior:function(){return this._onMouseOver},OnMouseOver:function(){var a=this;if(a._mouseHasEntered)return;a._onMouseOver&&a._onMouseOver.play();if(a._onHoverOver){a._onHoverOut&&a._onHoverOut.quit();a._onHoverOver.play()}a._mouseHasEntered=true},get_OnMouseOut:function(){return this._onMouseOut?this._onMouseOut.get_json():a},set_OnMouseOut:function(b){var a=this;if(!a._onMouseOut){a._onMouseOut=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onMouseOut.initialize()}a._onMouseOut.set_json(b);a.raisePropertyChanged("OnMouseOut")},get_OnMouseOutBehavior:function(){return this._onMouseOut},OnMouseOut:function(e){var a=this,d=e.rawEvent,b=a.get_element(),f=e.target;if(f.nodeName!==b.nodeName)return;var c=d.relatedTarget||d.toElement;if(b!=c&&!a._isChild(b,c)){a._mouseHasEntered=false;a._onMouseOut&&a._onMouseOut.play();if(a._onHoverOut){a._onHoverOver&&a._onHoverOver.quit();a._onHoverOut.play()}}},_isChild:function(b,a){var c=document.body;while(a&&b!=a&&c!=a)try{a=a.parentNode}catch(d){return false}return b==a},get_OnHoverOver:function(){return this._onHoverOver?this._onHoverOver.get_json():a},set_OnHoverOver:function(b){var a=this;if(!a._onHoverOver){a._onHoverOver=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onHoverOver.initialize()}a._onHoverOver.set_json(b);a.raisePropertyChanged("OnHoverOver")},get_OnHoverOverBehavior:function(){return this._onHoverOver},get_OnHoverOut:function(){return this._onHoverOut?this._onHoverOut.get_json():a},set_OnHoverOut:function(b){var a=this;if(!a._onHoverOut){a._onHoverOut=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onHoverOut.initialize()}a._onHoverOut.set_json(b);a.raisePropertyChanged("OnHoverOut")},get_OnHoverOutBehavior:function(){return this._onHoverOut}};Sys.Extended.UI.Animation.AnimationBehavior.registerClass("Sys.Extended.UI.Animation.AnimationBehavior",Sys.Extended.UI.BehaviorBase);Sys.Extended.UI.Animation.GenericAnimationBehavior=function(b){Sys.Extended.UI.Animation.GenericAnimationBehavior.initializeBase(this,[b]);this._json=a;this._animation=a};Sys.Extended.UI.Animation.GenericAnimationBehavior.prototype={dispose:function(){this.disposeAnimation();Sys.Extended.UI.Animation.GenericAnimationBehavior.callBaseMethod(this,"dispose")},disposeAnimation:function(){this._animation&&this._animation.dispose();this._animation=a},play:function(){var a=this;if(a._animation&&!a._animation.get_isPlaying()){a.stop();a._animation.play()}},stop:function(){if(this._animation)this._animation.get_isPlaying()&&this._animation.stop(true)},quit:function(){if(this._animation)this._animation.get_isPlaying()&&this._animation.stop(false)},get_json:function(){return this._json},set_json:function(c){var a=this;if(a._json!=c){a._json=c;a.raisePropertyChanged("json");a.disposeAnimation();var b=a.get_element();if(b){a._animation=Sys.Extended.UI.Animation.buildAnimation(a._json,b);a._animation&&a._animation.initialize();a.raisePropertyChanged("animation")}}},get_animation:function(){return this._animation}};Sys.Extended.UI.Animation.GenericAnimationBehavior.registerClass("Sys.Extended.UI.Animation.GenericAnimationBehavior",Sys.Extended.UI.BehaviorBase)}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedAnimations","ExtendedBase"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedPopup";function a(){var g="hidden",f="hiding",e="shown",d="showing",h="absolute",b=false,c=true,a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.PopupBehavior=function(e){var d=this;Sys.Extended.UI.PopupBehavior.initializeBase(d,[e]);d._x=0;d._y=0;d._positioningMode=Sys.Extended.UI.PositioningMode.Absolute;d._parentElement=a;d._parentElementID=a;d._moveHandler=a;d._firstPopup=c;d._originalParent=a;d._visible=b;d._onShow=a;d._onHide=a;d._onShowEndedHandler=Function.createDelegate(d,d._onShowEnded);d._onHideEndedHandler=Function.createDelegate(d,d._onHideEnded)};Sys.Extended.UI.PopupBehavior.prototype={initialize:function(){Sys.Extended.UI.PopupBehavior.callBaseMethod(this,"initialize");this._hidePopup();this.get_element().style.position=h},dispose:function(){var b=this,c=b.get_element();if(c){b._visible&&b.hide();if(b._originalParent){c.parentNode.removeChild(c);b._originalParent.appendChild(c);b._originalParent=a}c._hideWindowedElementsIFrame=a}b._parentElement=a;b._onShow&&b._onShow.get_animation()&&b._onShow.get_animation().remove_ended(b._onShowEndedHandler);b._onShow=a;b._onHide&&b._onHide.get_animation()&&b._onHide.get_animation().remove_ended(b._onHideEndedHandler);b._onHide=a;Sys.Extended.UI.PopupBehavior.callBaseMethod(b,"dispose")},show:function(){var a=this;if(a._visible)return;var d=new Sys.CancelEventArgs;a.raiseShowing(d);if(d.get_cancel())return;a._visible=c;var e=a.get_element();$common.setVisible(e,c);a.setupPopup();if(a._onShow){$common.setVisible(e,b);a.onShow()}else a.raiseShown(Sys.EventArgs.Empty)},hide:function(){var a=this;if(!a._visible)return;var c=new Sys.CancelEventArgs;a.raiseHiding(c);if(c.get_cancel())return;a._visible=b;if(a._onHide)a.onHide();else{a._hidePopup();a._hideCleanup()}},getBounds:function(){var e=this,d=e.get_element(),k=d.offsetParent||document.documentElement,h,a;if(e.get_parentElement()){a=$common.getBounds(e.get_parentElement());var j=$common.getLocation(k);h={x:a.x-j.x,y:a.y-j.y}}else{a=$common.getBounds(k);h={x:0,y:0}}var f=d.offsetWidth-(d.clientLeft?d.clientLeft*2:0),g=d.offsetHeight-(d.clientTop?d.clientTop*2:0);if(e._firstpopup){d.style.width=f+"px";e._firstpopup=b}var i,c;switch(e._positioningMode){case Sys.Extended.UI.PositioningMode.Center:c={x:Math.round(a.width/2-f/2),y:Math.round(a.height/2-g/2),altX:Math.round(a.width/2-f/2),altY:Math.round(a.height/2-g/2)};break;case Sys.Extended.UI.PositioningMode.BottomLeft:c={x:0,y:a.height,altX:a.width-f,altY:0-g};break;case Sys.Extended.UI.PositioningMode.BottomRight:c={x:a.width-f,y:a.height,altX:0,altY:0-g};break;case Sys.Extended.UI.PositioningMode.TopLeft:c={x:0,y:-d.offsetHeight,altX:a.width-f,altY:a.height};break;case Sys.Extended.UI.PositioningMode.TopRight:c={x:a.width-f,y:-d.offsetHeight,altX:0,altY:a.height};break;case Sys.Extended.UI.PositioningMode.Right:c={x:a.width,y:0,altX:-d.offsetWidth,altY:a.height-g};break;case Sys.Extended.UI.PositioningMode.Left:c={x:-d.offsetWidth,y:0,altX:a.width,altY:a.height-g};break;default:c={x:0,y:0,altX:0,altY:0}}c.x+=e._x+h.x;c.altX+=e._x+h.x;c.y+=e._y+h.y;c.altY+=e._y+h.y;i=e._verifyPosition(c,f,g,a);return new Sys.UI.Bounds(i.x,i.y,f,g)},_verifyPosition:function(a,f,e){var c=0,d=0,b=this._getWindowBounds();if(!(a.x+f>b.x+b.width||a.x<b.x))c=a.x;else{c=a.altX;if(a.altX<b.x){if(a.x>a.altX)c=a.x}else if(b.width+b.x-a.altX<f){var g=a.x>a.altX?Math.abs(b.x-a.x):b.x-a.x;if(g<f-b.width-b.x+a.altX)c=a.x}}if(!(a.y+e>b.y+b.height||a.y<b.y))d=a.y;else{d=a.altY;if(a.altY<b.y){if(b.y-a.altY>e-b.height-b.y+a.y)d=a.y}else if(b.height+b.y-a.altY<e)if(b.y-a.y<e-b.height-b.y+a.altY)d=a.y}return{x:c,y:d}},_getWindowBounds:function(){var a=this;return{x:a._getWindowScrollLeft(),y:a._getWindowScrollTop(),width:a._getWindowWidth(),height:a._getWindowHeight()}},_getWindowHeight:function(){var a=0;if(document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;return a},_getWindowWidth:function(){var a=0;if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;return a},_getWindowScrollTop:function(){var a=0;if(typeof window.pageYOffset=="number")a=window.pageYOffset;if(document.body&&document.body.scrollTop)a=document.body.scrollTop;else if(document.documentElement&&document.documentElement.scrollTop)a=document.documentElement.scrollTop;return a},_getWindowScrollLeft:function(){var a=0;if(typeof window.pageXOffset=="number")a=window.pageXOffset;else if(document.body&&document.body.scrollLeft)a=document.body.scrollLeft;else if(document.documentElement&&document.documentElement.scrollLeft)a=document.documentElement.scrollLeft;return a},adjustPopupPosition:function(a){var f=this.get_element();if(!a)a=this.getBounds();var d=$common.getBounds(f),e=b;if(d.x<0){a.x-=d.x;e=c}if(d.y<0){a.y-=d.y;e=c}e&&$common.setLocation(f,a)},addBackgroundIFrame:function(){var c=this,b=c.get_element();if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7){var a=b._hideWindowedElementsIFrame;if(!a){a=document.createElement("iframe");a.src="javascript:'<html></html>';";a.style.position=h;a.style.display="none";a.scrolling="no";a.frameBorder="0";a.tabIndex="-1";a.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";b.parentNode.insertBefore(a,b);b._hideWindowedElementsIFrame=a;c._moveHandler=Function.createDelegate(c,c._onMove);Sys.UI.DomEvent.addHandler(b,"move",c._moveHandler)}$common.setBounds(a,$common.getBounds(b));a.style.left=b.style.left;a.style.top=b.style.top;a.style.display=b.style.display;if(b.currentStyle&&b.currentStyle.zIndex)a.style.zIndex=b.currentStyle.zIndex;else if(b.style.zIndex)a.style.zIndex=b.style.zIndex}},setupPopup:function(){var a=this,b=a.get_element(),c=a.getBounds();$common.setLocation(b,c);a.adjustPopupPosition(c);b.style.zIndex=1e3;a.addBackgroundIFrame()},_hidePopup:function(){var c=this.get_element();$common.setVisible(c,b);if(c.originalWidth){c.style.width=c.originalWidth+"px";c.originalWidth=a}},_hideCleanup:function(){var b=this,d=b.get_element();if(b._moveHandler){Sys.UI.DomEvent.removeHandler(d,"move",b._moveHandler);b._moveHandler=a}if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var c=d._hideWindowedElementsIFrame;if(c)c.style.display="none"}b.raiseHidden(Sys.EventArgs.Empty)},_onMove:function(){var a=this.get_element();if(a._hideWindowedElementsIFrame){a.parentNode.insertBefore(a._hideWindowedElementsIFrame,a);a._hideWindowedElementsIFrame.style.top=a.style.top;a._hideWindowedElementsIFrame.style.left=a.style.left}},get_onShow:function(){return this._onShow?this._onShow.get_json():a},set_onShow:function(c){var a=this;if(!a._onShow){a._onShow=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onShow.initialize()}a._onShow.set_json(c);var b=a._onShow.get_animation();b&&b.add_ended(a._onShowEndedHandler);a.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._onShow},onShow:function(){var a=this;if(a._onShow){a._onHide&&a._onHide.quit();a._onShow.play()}},_onShowEnded:function(){this.adjustPopupPosition();this.addBackgroundIFrame();this.raiseShown(Sys.EventArgs.Empty)},get_onHide:function(){return this._onHide?this._onHide.get_json():a},set_onHide:function(c){var a=this;if(!a._onHide){a._onHide=new Sys.Extended.UI.Animation.GenericAnimationBehavior(a.get_element());a._onHide.initialize()}a._onHide.set_json(c);var b=a._onHide.get_animation();b&&b.add_ended(a._onHideEndedHandler);a.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._onHide},onHide:function(){var a=this;if(a._onHide){a._onShow&&a._onShow.quit();a._onHide.play()}},_onHideEnded:function(){this._hideCleanup()},get_parentElement:function(){var a=this;!a._parentElement&&a._parentElementID&&a.set_parentElement($get(a._parentElementID));return a._parentElement},set_parentElement:function(a){this._parentElement=a;this.raisePropertyChanged("parentElement")},get_parentElementID:function(){return this._parentElement?this._parentElement.id:this._parentElementID},set_parentElementID:function(a){this._parentElementID=a;this.get_isInitialized()&&this.set_parentElement($get(a))},get_positioningMode:function(){return this._positioningMode},set_positioningMode:function(a){this._positioningMode=a;this.raisePropertyChanged("positioningMode")},get_x:function(){return this._x},set_x:function(b){var a=this;if(b!=a._x){a._x=b;a._visible&&a.setupPopup();a.raisePropertyChanged("x")}},get_y:function(){return this._y},set_y:function(b){var a=this;if(b!=a._y){a._y=b;a._visible&&a.setupPopup();a.raisePropertyChanged("y")}},get_visible:function(){return this._visible},add_showing:function(a){this.get_events().addHandler(d,a)},remove_showing:function(a){this.get_events().removeHandler(d,a)},raiseShowing:function(b){var a=this.get_events().getHandler(d);a&&a(this,b)},add_shown:function(a){this.get_events().addHandler(e,a)},remove_shown:function(a){this.get_events().removeHandler(e,a)},raiseShown:function(b){var a=this.get_events().getHandler(e);a&&a(this,b)},add_hiding:function(a){this.get_events().addHandler(f,a)},remove_hiding:function(a){this.get_events().removeHandler(f,a)},raiseHiding:function(b){var a=this.get_events().getHandler(f);a&&a(this,b)},add_hidden:function(a){this.get_events().addHandler(g,a)},remove_hidden:function(a){this.get_events().removeHandler(g,a)},raiseHidden:function(b){var a=this.get_events().getHandler(g);a&&a(this,b)}};Sys.Extended.UI.PopupBehavior.registerClass("Sys.Extended.UI.PopupBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.PopupBehavior,{name:"popup"});Sys.Extended.UI.PositioningMode=function(){throw Error.invalidOperation();};Sys.Extended.UI.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5,Right:6,Left:7};Sys.Extended.UI.PositioningMode.registerEnum("Sys.Extended.UI.PositioningMode")}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedAnimations","ExtendedAnimationBehavior"],a);else a()})();
// (c) 2010 CodePlex Foundation
Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.ValidatorCalloutBehavior=function(c){var b=null,a=this;Sys.Extended.UI.ValidatorCalloutBehavior.initializeBase(a,[c]);a._warningIconImageUrl=b;a._closeImageUrl=b;a._cssClass="ajax__validatorcallout";a._highlightCssClass=b;a._popupPosition=Sys.Extended.UI.ValidatorCalloutPosition.Right;a._width="200px";a._invalid=false;a._originalValidationMethod=b;a._validationMethodOverride=b;a._elementToValidate=b;a._popupTable=b;a._errorMessageCell=b;a._calloutArrowCell=b;a._warningIconImage=b;a._closeImage=b;a._closeCellInnerDiv=b;a._popupBehavior=b;a._onShowJson=b;a._onHideJson=b;a._focusAttached=false;a._isBuilt=false;a._focusHandler=Function.createDelegate(a,a._onfocus);a._closeClickHandler=Function.createDelegate(a,a._oncloseClick)};Sys.Extended.UI.ValidatorCalloutBehavior.prototype={initialize:function(){var a=this;Sys.Extended.UI.ValidatorCalloutBehavior.callBaseMethod(a,"initialize");var b=a.get_element();if(b.evaluationfunction){a._originalValidationMethod=Function.createDelegate(b,b.evaluationfunction);a._validationMethodOverride=Function.createDelegate(a,a._onvalidate);b.evaluationfunction=a._validationMethodOverride}var c=a.get_ClientState();if(null!=c&&""!==c){a._ensureCallout();a._highlightCssClass&&Sys.UI.DomElement.addCssClass(a._elementToValidate,a._highlightCssClass);a.show()}},_ensureCallout:function(){var x="arrowpixel",w="ajax__validatorcallout_innerdiv",g="div",n="td",r="tr",a=this;if(!a._isBuilt){var z=a.get_element(),A=a._elementToValidate=$get(z.controltovalidate),q=document.createElement("tbody"),b=document.createElement(r),o=document.createElement(n),k=document.createElement("table"),v=document.createElement("tbody"),u=document.createElement(r),i=document.createElement(n),h=document.createElement(n),s=a._closeCellInnerDiv=document.createElement(g),e=a._popupTable=document.createElement("table"),c=a._calloutArrowCell=document.createElement(n),t=a._warningIconImage=document.createElement("img"),y=a._closeImage=document.createElement("img"),f=a._errorMessageCell=document.createElement(n);e.id=a.get_id()+"_popupTable";e.cellPadding=0;e.cellSpacing=0;e.border=0;e.width=a.get_width();e.className=a._cssClass+" ajax__validatorcallout_popup_table";b.className="ajax__validatorcallout_popup_table_row";o.className="ajax__validatorcallout_callout_cell";k.cellPadding=0;k.cellSpacing=0;k.border=0;k.className="ajax__validatorcallout_callout_table";u.className="ajax__validatorcallout_callout_table_row";if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft)c.className="ajax__validatorcallout_callout_arrow_cell_bottomleftpos";else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomRight)c.className="ajax__validatorcallout_callout_arrow_cell_bottomrightpos";else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopLeft)c.className="ajax__validatorcallout_callout_arrow_cell_topleftpos";else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopRight)c.className="ajax__validatorcallout_callout_arrow_cell_toprightpos";else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.Left)c.className="ajax__validatorcallout_callout_arrow_cell_leftpos";else c.className="ajax__validatorcallout_callout_arrow_cell";i.className="ajax__validatorcallout_icon_cell";t.border=0;t.src=a.get_warningIconImageUrl();f.className="ajax__validatorcallout_error_message_cell";f.innerHTML=a._getErrorMessage();h.className="ajax__validatorcallout_close_button_cell";s.className=w;y.src=a.get_closeImageUrl();z.parentNode.appendChild(e);e.appendChild(q);q.appendChild(b);b.appendChild(o);o.appendChild(k);k.appendChild(v);v.appendChild(u);u.appendChild(c);b.appendChild(i);i.appendChild(t);b.appendChild(f);b.appendChild(h);s.appendChild(y);h.appendChild(s);if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft||a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomRight){var p=document.createElement(r);q.insertBefore(p,b);c.colSpan=2;p.appendChild(c);b.appendChild(i);b.appendChild(f);b.appendChild(h)}else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopLeft||a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopRight){var p=document.createElement(r);q.appendChild(p);c.colSpan=2;p.appendChild(c);b.appendChild(i);b.appendChild(f);b.appendChild(h)}else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.Left){b.appendChild(i);b.appendChild(f);b.appendChild(h);b.appendChild(o)}else{b.appendChild(o);b.appendChild(i);b.appendChild(f);b.appendChild(h)}var j=document.createElement(g);j.className=w;c.appendChild(j);if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft||a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomRight){var l=document.createElement(g);l.style.width="1px";l.className=x;j.appendChild(l);for(var d=1;d<22;d+=2){var m=document.createElement(g);m.style.width=d.toString()+"px";j.appendChild(m)}}else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopLeft||a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopRight){for(var d=23;d>0;d-=2){var m=document.createElement(g);m.style.width=d.toString()+"px";j.appendChild(m)}var l=document.createElement(g);l.style.width="1px";l.className=x;j.appendChild(l)}else for(var d=14;d>0;d--){var m=document.createElement(g);m.style.width=d.toString()+"px";j.appendChild(m)}a._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{parentElement:A},{},null,a._popupTable);if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopLeft)a._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopLeft);else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.TopRight)a._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.TopRight);else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomLeft)a._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomLeft);else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.BottomRight)a._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.BottomRight);else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.Right)a._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Right);else if(a._popupPosition==Sys.Extended.UI.ValidatorCalloutPosition.Left)a._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Left);else a._popupBehavior.set_positioningMode(Sys.Extended.UI.PositioningMode.Right);a._onShowJson&&a._popupBehavior.set_onShow(a._onShowJson);a._onHideJson&&a._popupBehavior.set_onHide(a._onHideJson);$addHandler(a._closeCellInnerDiv,"click",a._closeClickHandler);a._isBuilt=true}},dispose:function(){var b=null,a=this;if(a._isBuilt){a.hide();if(a._focusAttached){$removeHandler(a._elementToValidate,"focus",a._focusHandler);a._focusAttached=false}$removeHandler(a._closeCellInnerDiv,"click",a._closeClickHandler);a._onShowJson=b;a._onHideJson=b;if(a._popupBehavior){a._popupBehavior.dispose();a._popupBehavior=b}if(a._closeBehavior){a._closeBehavior.dispose();a._closeBehavior=b}if(a._popupTable){a._popupTable.parentNode.removeChild(a._popupTable);a._popupTable=b;a._errorMessageCell=b;a._elementToValidate=b;a._calloutArrowCell=b;a._warningIconImage=b;a._closeImage=b;a._closeCellInnerDiv=b}a._isBuilt=false}Sys.Extended.UI.ValidatorCalloutBehavior.callBaseMethod(a,"dispose")},_getErrorMessage:function(){return this.get_element().errormessage||Sys.Extended.UI.Resources.ValidatorCallout_DefaultErrorMessage},show:function(b){var a=this;if(b||!a.get_isOpen()){b&&Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout&&Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout.hide();if(Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout!=null)return;Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout=a;a._errorMessageCell.innerHTML=a._getErrorMessage();a._popupBehavior.show()}},hide:function(){if(Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout==this)Sys.Extended.UI.ValidatorCalloutBehavior._currentCallout=null;this.get_isOpen()&&this._popupBehavior.hide()},_onfocus:function(){var a=this;if(!a._originalValidationMethod(a.get_element())){a._ensureCallout();a._highlightCssClass&&Sys.UI.DomElement.addCssClass(a._elementToValidate,a._highlightCssClass);a.show(true);return false}else{a.hide();return true}},_oncloseClick:function(){this.hide()},_onvalidate:function(b){var a=this;if(!a._originalValidationMethod(b)){a._ensureCallout();a._highlightCssClass&&Sys.UI.DomElement.addCssClass(a._elementToValidate,a._highlightCssClass);if(!a._focusAttached){$addHandler(a._elementToValidate,"focus",a._focusHandler);a._focusAttached=true}a.show(false);a._invalid=true;return false}else{a._highlightCssClass&&a._invalid&&Sys.UI.DomElement.removeCssClass(a._elementToValidate,a._highlightCssClass);a._invalid=false;a.hide();return true}},get_onShow:function(){return this._popupBehavior?this._popupBehavior.get_onShow():this._onShowJson},set_onShow:function(b){var a=this;if(a._popupBehavior)a._popupBehavior.set_onShow(b);else a._onShowJson=b;a.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onShowBehavior():null},onShow:function(){this._popupBehavior&&this._popupBehavior.onShow()},get_onHide:function(){return this._popupBehavior?this._popupBehavior.get_onHide():this._onHideJson},set_onHide:function(b){var a=this;if(a._popupBehavior)a._popupBehavior.set_onHide(b);else a._onHideJson=b;a.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onHideBehavior():null},onHide:function(){this._popupBehavior&&this._popupBehavior.onHide()},get_warningIconImageUrl:function(){return this._warningIconImageUrl},set_warningIconImageUrl:function(b){var a=this;if(a._warningIconImageUrl!=b){a._warningIconImageUrl=b;if(a.get_isInitialized())a._warningIconImage.src=b;a.raisePropertyChanged("warningIconImageUrl")}},get_closeImageUrl:function(){return this._closeImageUrl},set_closeImageUrl:function(b){var a=this;if(a._closeImageUrl!=b){a._closeImageUrl=b;if(a.get_isInitialized())a._closeImage.src=b;a.raisePropertyChanged("closeImageUrl")}},get_width:function(){return this._width},set_width:function(b){var a=this;if(a._width!=b){a._width=b;if(a.get_isInitialized())a._popupTable.style.width=_width;a.raisePropertyChanged("width")}},get_popupPosition:function(){return this._popupPosition},set_popupPosition:function(a){if(this._popupPosition!=a){this._popupPosition=a;this.raisePropertyChanged("popupPosition")}},get_cssClass:function(){return this._cssClass},set_cssClass:function(a){if(this._cssClass!=a){this._cssClass=a;this.raisePropertyChanged("cssClass")}},get_highlightCssClass:function(){return this._highlightCssClass},set_highlightCssClass:function(a){if(this._highlightCssClass!=a){this._highlightCssClass=a;this.raisePropertyChanged("highlightCssClass")}},get_isOpen:function(){return $common.getVisible(this._popupTable)}};Sys.Extended.UI.ValidatorCalloutBehavior.registerClass("Sys.Extended.UI.ValidatorCalloutBehavior",Sys.Extended.UI.BehaviorBase);Sys.Extended.UI.ValidatorCalloutPosition=function(){throw Error.invalidOperation();};Sys.Extended.UI.ValidatorCalloutPosition.prototype={Right:0,Left:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5};Sys.Extended.UI.ValidatorCalloutPosition.registerEnum("Sys.Extended.UI.ValidatorCalloutPosition");
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedDynamicPopulate";function a(){var d="populated",c="populating",b=false,a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.DynamicPopulateBehavior=function(d){var c=this;Sys.Extended.UI.DynamicPopulateBehavior.initializeBase(c,[d]);c._servicePath=location.pathname;c._serviceMethod=a;c._contextKey=a;c._cacheDynamicResults=b;c._populateTriggerID=a;c._setUpdatingCssClass=a;c._clearDuringUpdate=true;c._customScript=a;c._clickHandler=a;c._callID=0;c._currentCallID=-1;c._populated=b};Sys.Extended.UI.DynamicPopulateBehavior.prototype={initialize:function(){var a=this;Sys.Extended.UI.DynamicPopulateBehavior.callBaseMethod(a,"initialize");$common.prepareHiddenElementForATDeviceUpdate();if(a._populateTriggerID){var b=$get(a._populateTriggerID);if(b){a._clickHandler=Function.createDelegate(a,a._onPopulateTriggerClick);$addHandler(b,"click",a._clickHandler)}}},dispose:function(){var b=this;if(b._populateTriggerID&&b._clickHandler){var c=$get(b._populateTriggerID);c&&$removeHandler(c,"click",b._clickHandler);b._populateTriggerID=a;b._clickHandler=a}Sys.Extended.UI.DynamicPopulateBehavior.callBaseMethod(b,"dispose")},populate:function(c){var a=this;if(a._populated&&a._cacheDynamicResults)return;if(a._currentCallID==-1){var d=new Sys.CancelEventArgs;a.raisePopulating(d);if(d.get_cancel())return;a._setUpdating(true)}if(a._customScript){var e=eval(a._customScript);a._setTargetHtml(e);a._setUpdating(b)}else{a._currentCallID=++a._callID;if(a._servicePath&&a._serviceMethod){Sys.Net.WebServiceProxy.invoke(a._servicePath,a._serviceMethod,b,{contextKey:c?c:a._contextKey},Function.createDelegate(a,a._onMethodComplete),Function.createDelegate(a,a._onMethodError),a._currentCallID);$common.updateFormToRefreshATDeviceBuffer()}}},_onMethodComplete:function(c,a){if(a!=this._currentCallID)return;this._setTargetHtml(c);this._setUpdating(b)},_onMethodError:function(c,d){var a=this;if(d!=a._currentCallID)return;if(c.get_timedOut())a._setTargetHtml(Sys.Extended.UI.Resources.DynamicPopulate_WebServiceTimeout);else a._setTargetHtml(String.format(Sys.Extended.UI.Resources.DynamicPopulate_WebServiceError,c.get_statusCode()));a._setUpdating(b)},_onPopulateTriggerClick:function(){this.populate(this._contextKey)},_setUpdating:function(b){var a=this;a.setStyle(b);if(!b){a._currentCallID=-1;a._populated=true;a.raisePopulated(a,Sys.EventArgs.Empty)}},_setTargetHtml:function(b){var a=this.get_element();if(a)if(a.tagName=="INPUT")a.value=b;else a.innerHTML=b},setStyle:function(d){var b=this,c=b.get_element();if(b._setUpdatingCssClass)if(!d){c.className=b._oldCss;b._oldCss=a}else{b._oldCss=c.className;c.className=b._setUpdatingCssClass}d&&b._clearDuringUpdate&&b._setTargetHtml("")},get_ClearContentsDuringUpdate:function(){return this._clearDuringUpdate},set_ClearContentsDuringUpdate:function(a){if(this._clearDuringUpdate!=a){this._clearDuringUpdate=a;this.raisePropertyChanged("ClearContentsDuringUpdate")}},get_ContextKey:function(){return this._contextKey},set_ContextKey:function(a){if(this._contextKey!=a){this._contextKey=a;this.raisePropertyChanged("ContextKey")}},get_PopulateTriggerID:function(){return this._populateTriggerID},set_PopulateTriggerID:function(a){if(this._populateTriggerID!=a){this._populateTriggerID=a;this.raisePropertyChanged("PopulateTriggerID")}},get_ServicePath:function(){return this._servicePath},set_ServicePath:function(a){if(this._servicePath!=a){this._servicePath=a;this.raisePropertyChanged("ServicePath")}},get_ServiceMethod:function(){return this._serviceMethod},set_ServiceMethod:function(a){if(this._serviceMethod!=a){this._serviceMethod=a;this.raisePropertyChanged("ServiceMethod")}},get_cacheDynamicResults:function(){return this._cacheDynamicResults},set_cacheDynamicResults:function(a){if(this._cacheDynamicResults!=a){this._cacheDynamicResults=a;this.raisePropertyChanged("cacheDynamicResults")}},get_UpdatingCssClass:function(){return this._setUpdatingCssClass},set_UpdatingCssClass:function(a){if(this._setUpdatingCssClass!=a){this._setUpdatingCssClass=a;this.raisePropertyChanged("UpdatingCssClass")}},get_CustomScript:function(){return this._customScript},set_CustomScript:function(a){if(this._customScript!=a){this._customScript=a;this.raisePropertyChanged("CustomScript")}},add_populating:function(a){this.get_events().addHandler(c,a)},remove_populating:function(a){this.get_events().removeHandler(c,a)},raisePopulating:function(b){var a=this.get_events().getHandler(c);a&&a(this,b)},add_populated:function(a){this.get_events().addHandler(d,a)},remove_populated:function(a){this.get_events().removeHandler(d,a)},raisePopulated:function(b){var a=this.get_events().getHandler(d);a&&a(this,b)}};Sys.Extended.UI.DynamicPopulateBehavior.registerClass("Sys.Extended.UI.DynamicPopulateBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.DynamicPopulateBehavior,{name:"dynamicPopulate"})}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedBase","ExtendedCommon","Network"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedDragDrop";function a(){var m="keypress",l="dragleave",k="dragenter",j="dragstart",h="dragover",g="mousemove",f="mouseup",i="initialize",e=false,b=true,d="dragStop",c="dragStart",a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.IDragSource=function(){};Sys.Extended.UI.IDragSource.prototype={get_dragDataType:function(){throw Error.notImplemented();},getDragData:function(){throw Error.notImplemented();},get_dragMode:function(){throw Error.notImplemented();},onDragStart:function(){throw Error.notImplemented();},onDrag:function(){throw Error.notImplemented();},onDragEnd:function(){throw Error.notImplemented();}};Sys.Extended.UI.IDragSource.registerInterface("Sys.Extended.UI.IDragSource");Sys.Extended.UI.IDropTarget=function(){};Sys.Extended.UI.IDropTarget.prototype={get_dropTargetElement:function(){throw Error.notImplemented();},canDrop:function(){throw Error.notImplemented();},drop:function(){throw Error.notImplemented();},onDragEnterTarget:function(){throw Error.notImplemented();},onDragLeaveTarget:function(){throw Error.notImplemented();},onDragInTarget:function(){throw Error.notImplemented();}};Sys.Extended.UI.IDropTarget.registerInterface("Sys.Extended.UI.IDropTarget");Sys.Extended.UI.DragMode=function(){throw Error.invalidOperation();};Sys.Extended.UI.DragMode.prototype={Copy:0,Move:1};Sys.Extended.UI.DragMode.registerEnum("Sys.Extended.UI.DragMode");Sys.Extended.UI.DragDropEventArgs=function(c,a,b){this._dragMode=c;this._dataType=a;this._data=b};Sys.Extended.UI.DragDropEventArgs.prototype={get_dragMode:function(){return this._dragMode||a},get_dragDataType:function(){return this._dataType||a},get_dragData:function(){return this._data||a}};Sys.Extended.UI.DragDropEventArgs.registerClass("Sys.Extended.UI.DragDropEventArgs");Sys.Extended.UI._DragDropManager=function(){this._instance=a;this._events=a};Sys.Extended.UI._DragDropManager.prototype={add_dragStart:function(a){this.get_events().addHandler(c,a)},remove_dragStart:function(a){this.get_events().removeHandler(c,a)},get_events:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},add_dragStop:function(a){this.get_events().addHandler(d,a)},remove_dragStop:function(a){this.get_events().removeHandler(d,a)},_getInstance:function(){var a=this;if(!a._instance){if(Sys.Browser.agent===Sys.Browser.InternetExplorer)a._instance=new Sys.Extended.UI.IEDragDropManager;else a._instance=new Sys.Extended.UI.GenericDragDropManager;a._instance.initialize();a._instance.add_dragStart(Function.createDelegate(a,a._raiseDragStart));a._instance.add_dragStop(Function.createDelegate(a,a._raiseDragStop))}return a._instance},startDragDrop:function(b,c,d,a){this._getInstance().startDragDrop(b,c,d,a)},registerDropTarget:function(a){this._getInstance().registerDropTarget(a)},unregisterDropTarget:function(a){this._getInstance().unregisterDropTarget(a)},dispose:function(){delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},_raiseDragStart:function(d,b){var a=this.get_events().getHandler(c);a&&a(this,b)},_raiseDragStop:function(c,b){var a=this.get_events().getHandler(d);a&&a(this,b)}};Sys.Extended.UI._DragDropManager.registerClass("Sys.Extended.UI._DragDropManager");Sys.Extended.UI.DragDropManager=new Sys.Extended.UI._DragDropManager;Sys.Extended.UI.IEDragDropManager=function(){var c=this;Sys.Extended.UI.IEDragDropManager.initializeBase(c);c._dropTargets=a;c._radius=10;c._useBuiltInDragAndDropFunctions=b;c._activeDragVisual=a;c._activeContext=a;c._activeDragSource=a;c._underlyingTarget=a;c._oldOffset=a;c._potentialTarget=a;c._isDragging=e;c._mouseUpHandler=a;c._documentMouseMoveHandler=a;c._documentDragOverHandler=a;c._dragStartHandler=a;c._mouseMoveHandler=a;c._dragEnterHandler=a;c._dragLeaveHandler=a;c._dragOverHandler=a;c._dropHandler=a};Sys.Extended.UI.IEDragDropManager.prototype={add_dragStart:function(a){this.get_events().addHandler(c,a)},remove_dragStart:function(a){this.get_events().removeHandler(c,a)},add_dragStop:function(a){this.get_events().addHandler(d,a)},remove_dragStop:function(a){this.get_events().removeHandler(d,a)},initialize:function(){var a=this;Sys.Extended.UI.IEDragDropManager.callBaseMethod(a,i);a._mouseUpHandler=Function.createDelegate(a,a._onMouseUp);a._documentMouseMoveHandler=Function.createDelegate(a,a._onDocumentMouseMove);a._documentDragOverHandler=Function.createDelegate(a,a._onDocumentDragOver);a._dragStartHandler=Function.createDelegate(a,a._onDragStart);a._mouseMoveHandler=Function.createDelegate(a,a._onMouseMove);a._dragEnterHandler=Function.createDelegate(a,a._onDragEnter);a._dragLeaveHandler=Function.createDelegate(a,a._onDragLeave);a._dragOverHandler=Function.createDelegate(a,a._onDragOver);a._dropHandler=Function.createDelegate(a,a._onDrop)},dispose:function(){var b=this;if(b._dropTargets){for(var c=0;c<b._dropTargets;c++)b.unregisterDropTarget(b._dropTargets[c]);b._dropTargets=a}Sys.Extended.UI.IEDragDropManager.callBaseMethod(b,"dispose")},startDragDrop:function(f,e,k,i){var d=this,m=window._event;if(d._isDragging)return;d._underlyingTarget=a;d._activeDragSource=f;d._activeDragVisual=e;d._activeContext=k;d._useBuiltInDragAndDropFunctions=typeof i!="undefined"?i:b;var j={x:m.clientX,y:m.clientY};e.originalPosition=e.style.position;e.style.position="absolute";document._lastPosition=j;e.startingPoint=j;var n=d.getScrollOffset(e,b);e.startingPoint=d.addPoints(e.startingPoint,n);var g=parseInt(e.style.left),h=parseInt(e.style.top);if(isNaN(g))g="0";if(isNaN(h))h="0";e.startingPoint=d.subtractPoints(e.startingPoint,{x:g,y:h});d._prepareForDomChanges();f.onDragStart();var o=new Sys.Extended.UI.DragDropEventArgs(f.get_dragMode(),f.get_dragDataType(),f.getDragData(k)),l=d.get_events().getHandler(c);l&&l(d,o);d._recoverFromDomChanges();d._wireEvents();d._drag(b)},_stopDragDrop:function(c){var b=this,g=window._event;if(b._activeDragSource!=a){b._unwireEvents();if(!c)c=b._underlyingTarget==a;!c&&b._underlyingTarget!=a&&b._underlyingTarget.drop(b._activeDragSource.get_dragMode(),b._activeDragSource.get_dragDataType(),b._activeDragSource.getDragData(b._activeContext));b._activeDragSource.onDragEnd(c);var f=b.get_events().getHandler(d);f&&f(b,Sys.EventArgs.Empty);b._activeDragVisual.style.position=b._activeDragVisual.originalPosition;b._activeDragSource=a;b._activeContext=a;b._activeDragVisual=a;b._isDragging=e;b._potentialTarget=a;g.preventDefault()}},_drag:function(h){var c=this,g=window._event,f={x:g.clientX,y:g.clientY};document._lastPosition=f;var i=c.getScrollOffset(c._activeDragVisual,b),d=c.addPoints(c.subtractPoints(f,c._activeDragVisual.startingPoint),i);if(!h&&parseInt(c._activeDragVisual.style.left)==d.x&&parseInt(c._activeDragVisual.style.top)==d.y)return;$common.setLocation(c._activeDragVisual,d);c._prepareForDomChanges();c._activeDragSource.onDrag();c._recoverFromDomChanges();c._potentialTarget=c._findPotentialTarget(c._activeDragSource,c._activeDragVisual);var e=c._potentialTarget!=c._underlyingTarget||c._potentialTarget==a;e&&c._underlyingTarget!=a&&c._leaveTarget(c._activeDragSource,c._underlyingTarget);if(c._potentialTarget!=a)if(e){c._underlyingTarget=c._potentialTarget;c._enterTarget(c._activeDragSource,c._underlyingTarget)}else c._moveInTarget(c._activeDragSource,c._underlyingTarget);else c._underlyingTarget=a},_wireEvents:function(){var a=this;if(a._useBuiltInDragAndDropFunctions){$addHandler(document,f,a._mouseUpHandler);$addHandler(document,g,a._documentMouseMoveHandler);$addHandler(document.body,h,a._documentDragOverHandler);$addHandler(a._activeDragVisual,j,a._dragStartHandler);$addHandler(a._activeDragVisual,"dragend",a._mouseUpHandler);$addHandler(a._activeDragVisual,"drag",a._mouseMoveHandler)}else{$addHandler(document,f,a._mouseUpHandler);$addHandler(document,g,a._mouseMoveHandler)}},_unwireEvents:function(){var a=this;if(a._useBuiltInDragAndDropFunctions){$removeHandler(a._activeDragVisual,"drag",a._mouseMoveHandler);$removeHandler(a._activeDragVisual,"dragend",a._mouseUpHandler);$removeHandler(a._activeDragVisual,j,a._dragStartHandler);$removeHandler(document.body,h,a._documentDragOverHandler);$removeHandler(document,g,a._documentMouseMoveHandler);$removeHandler(document,f,a._mouseUpHandler)}else{$removeHandler(document,g,a._mouseMoveHandler);$removeHandler(document,f,a._mouseUpHandler)}},registerDropTarget:function(c){var b=this;if(b._dropTargets==a)b._dropTargets=[];Array.add(b._dropTargets,c);b._wireDropTargetEvents(c)},unregisterDropTarget:function(a){this._unwireDropTargetEvents(a);this._dropTargets&&Array.remove(this._dropTargets,a)},_wireDropTargetEvents:function(c){var b=this,a=c.get_dropTargetElement();a._dropTarget=c;$addHandler(a,k,b._dragEnterHandler);$addHandler(a,l,b._dragLeaveHandler);$addHandler(a,h,b._dragOverHandler);$addHandler(a,"drop",b._dropHandler)},_unwireDropTargetEvents:function(d){var c=this,b=d.get_dropTargetElement();if(b._dropTarget){b._dropTarget=a;$removeHandler(b,k,c._dragEnterHandler);$removeHandler(b,l,c._dragLeaveHandler);$removeHandler(b,h,c._dragOverHandler);$removeHandler(b,"drop",c._dropHandler)}},_onDragStart:function(e){window._event=e;document.selection.empty();var d=e.dataTransfer;if(!d&&e.rawEvent)d=e.rawEvent.dataTransfer;var c=this._activeDragSource.get_dragDataType().toLowerCase(),b=this._activeDragSource.getDragData(this._activeContext);if(b){if(c!="text"&&c!="url"){c="text";if(b.innerHTML!=a)b=b.innerHTML}d.effectAllowed="move";d.setData(c,b.toString())}},_onMouseUp:function(a){window._event=a;this._stopDragDrop(e)},_onDocumentMouseMove:function(a){window._event=a;this._dragDrop()},_onDocumentDragOver:function(a){window._event=a;this._potentialTarget&&a.preventDefault()},_onMouseMove:function(a){window._event=a;this._drag()},_onDragEnter:function(c){window._event=c;if(this._isDragging)c.preventDefault();else for(var b=Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target)),a=0;a<b.length;a++)this._dropTarget.onDragEnterTarget(Sys.Extended.UI.DragMode.Copy,b[a].type,b[a].value)},_onDragLeave:function(c){window._event=c;if(this._isDragging)c.preventDefault();else for(var b=Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target)),a=0;a<b.length;a++)this._dropTarget.onDragLeaveTarget(Sys.Extended.UI.DragMode.Copy,b[a].type,b[a].value)},_onDragOver:function(c){window._event=c;if(this._isDragging)c.preventDefault();else for(var b=Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target)),a=0;a<b.length;a++)this._dropTarget.onDragInTarget(Sys.Extended.UI.DragMode.Copy,b[a].type,b[a].value)},_onDrop:function(c){window._event=c;if(!this._isDragging)for(var b=Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target)),a=0;a<b.length;a++)this._dropTarget.drop(Sys.Extended.UI.DragMode.Copy,b[a].type,b[a].value);c.preventDefault()},_getDropTarget:function(b){while(b){if(b._dropTarget!=a)return b._dropTarget;b=b.parentNode}return a},_dragDrop:function(){if(this._isDragging)return;this._isDragging=b;this._activeDragVisual.dragDrop();document.selection.empty()},_moveInTarget:function(a,b){this._prepareForDomChanges();b.onDragInTarget(a.get_dragMode(),a.get_dragDataType(),a.getDragData(this._activeContext));this._recoverFromDomChanges()},_enterTarget:function(a,b){this._prepareForDomChanges();b.onDragEnterTarget(a.get_dragMode(),a.get_dragDataType(),a.getDragData(this._activeContext));this._recoverFromDomChanges()},_leaveTarget:function(a,b){this._prepareForDomChanges();b.onDragLeaveTarget(a.get_dragMode(),a.get_dragDataType(),a.getDragData(this._activeContext));this._recoverFromDomChanges()},_findPotentialTarget:function(e){var c=this,h=window._event;if(c._dropTargets==a)return a;for(var l=e.get_dragDataType(),k=e.get_dragMode(),j=e.getDragData(c._activeContext),f=c.getScrollOffset(document.body,b),m=h.clientX+f.x,n=h.clientY+f.y,i={x:m-c._radius,y:n-c._radius,width:c._radius*2,height:c._radius*2},g,d=0;d<c._dropTargets.length;d++){g=$common.getBounds(c._dropTargets[d].get_dropTargetElement());if($common.overlaps(i,g)&&c._dropTargets[d].canDrop(k,l,j))return c._dropTargets[d]}return a},_prepareForDomChanges:function(){this._oldOffset=$common.getLocation(this._activeDragVisual)},_recoverFromDomChanges:function(){var a=this,c=$common.getLocation(a._activeDragVisual);if(a._oldOffset.x!=c.x||a._oldOffset.y!=c.y){a._activeDragVisual.startingPoint=a.subtractPoints(a._activeDragVisual.startingPoint,a.subtractPoints(a._oldOffset,c));scrollOffset=a.getScrollOffset(a._activeDragVisual,b);var d=a.addPoints(a.subtractPoints(document._lastPosition,a._activeDragVisual.startingPoint),scrollOffset);$common.setLocation(a._activeDragVisual,d)}},addPoints:function(a,b){return{x:a.x+b.x,y:a.y+b.y}},subtractPoints:function(a,b){return{x:a.x-b.x,y:a.y-b.y}},getScrollOffset:function(c,f){var d=c.scrollLeft,e=c.scrollTop;if(f){var b=c.parentNode;while(b!=a&&b.scrollLeft!=a){d+=b.scrollLeft;e+=b.scrollTop;if(b==document.body&&(d!=0&&e!=0))break;b=b.parentNode}}return{x:d,y:e}},getBrowserRectangle:function(){var c=window.innerWidth,b=window.innerHeight;if(c==a)c=document.documentElement.clientWidth;if(b==a)b=document.documentElement.clientHeight;return{x:0,y:0,width:c,height:b}},getNextSibling:function(b){for(b=b.nextSibling;b!=a;b=b.nextSibling)if(b.innerHTML!=a)return b;return a},hasParent:function(b){return b.parentNode!=a&&b.parentNode.tagName!=a}};Sys.Extended.UI.IEDragDropManager.registerClass("Sys.Extended.UI.IEDragDropManager",Sys.Component);Sys.Extended.UI.IEDragDropManager._getDataObjectsForDropTarget=function(h){if(h==a)return[];for(var f=window._event,g=[],c=["URL","Text"],d,b=0;b<c.length;b++){var e=f.dataTransfer;if(!e&&f.rawEvent)e=f.rawEvent.dataTransfer;d=e.getData(c[b]);if(h.canDrop(Sys.Extended.UI.DragMode.Copy,c[b],d))d&&Array.add(g,{type:c[b],value:d})}return g};Sys.Extended.UI.GenericDragDropManager=function(){var b=this;Sys.Extended.UI.GenericDragDropManager.initializeBase(b);b._dropTargets=a;b._scrollEdgeConst=40;b._scrollByConst=10;b._scroller=a;b._scrollDeltaX=0;b._scrollDeltaY=0;b._activeDragVisual=a;b._activeContext=a;b._activeDragSource=a;b._oldOffset=a;b._potentialTarget=a;b._mouseUpHandler=a;b._mouseMoveHandler=a;b._keyPressHandler=a;b._scrollerTickHandler=a};Sys.Extended.UI.GenericDragDropManager.prototype={initialize:function(){var a=this;Sys.Extended.UI.GenericDragDropManager.callBaseMethod(a,i);a._mouseUpHandler=Function.createDelegate(a,a._onMouseUp);a._mouseMoveHandler=Function.createDelegate(a,a._onMouseMove);a._keyPressHandler=Function.createDelegate(a,a._onKeyPress);a._scrollerTickHandler=Function.createDelegate(a,a._onScrollerTick);a._scroller=new Sys.Timer;a._scroller.set_interval(10);a._scroller.add_tick(a._scrollerTickHandler)},startDragDrop:function(b,c,d){var a=this;a._activeDragSource=b;a._activeDragVisual=c;a._activeContext=d;Sys.Extended.UI.GenericDragDropManager.callBaseMethod(a,"startDragDrop",[b,c,d])},_stopDragDrop:function(a){this._scroller.set_enabled(e);Sys.Extended.UI.GenericDragDropManager.callBaseMethod(this,"_stopDragDrop",[a])},_drag:function(a){Sys.Extended.UI.GenericDragDropManager.callBaseMethod(this,"_drag",[a]);this._autoScroll()},_wireEvents:function(){$addHandler(document,f,this._mouseUpHandler);$addHandler(document,g,this._mouseMoveHandler);$addHandler(document,m,this._keyPressHandler)},_unwireEvents:function(){$removeHandler(document,m,this._keyPressHandler);$removeHandler(document,g,this._mouseMoveHandler);$removeHandler(document,f,this._mouseUpHandler)},_wireDropTargetEvents:function(){},_unwireDropTargetEvents:function(){},_onMouseUp:function(a){window._event=a;this._stopDragDrop(e)},_onMouseMove:function(a){window._event=a;this._drag()},_onKeyPress:function(a){window._event=a;var c=a.keyCode?a.keyCode:a.rawEvent.keyCode;c==27&&this._stopDragDrop(b)},_autoScroll:function(){var a=this,d=window._event,c=a.getBrowserRectangle();if(c.width>0){a._scrollDeltaX=a._scrollDeltaY=0;if(d.clientX<c.x+a._scrollEdgeConst)a._scrollDeltaX=-a._scrollByConst;else if(d.clientX>c.width-a._scrollEdgeConst)a._scrollDeltaX=a._scrollByConst;if(d.clientY<c.y+a._scrollEdgeConst)a._scrollDeltaY=-a._scrollByConst;else if(d.clientY>c.height-a._scrollEdgeConst)a._scrollDeltaY=a._scrollByConst;if(a._scrollDeltaX!=0||a._scrollDeltaY!=0)a._scroller.set_enabled(b);else a._scroller.set_enabled(e)}},_onScrollerTick:function(){var d=document.body.scrollLeft,f=document.body.scrollTop;window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);var c=document.body.scrollLeft,e=document.body.scrollTop,a=this._activeDragVisual,b={x:parseInt(a.style.left)+(c-d),y:parseInt(a.style.top)+(e-f)};$common.setLocation(a,b)}};Sys.Extended.UI.GenericDragDropManager.registerClass("Sys.Extended.UI.GenericDragDropManager",Sys.Extended.UI.IEDragDropManager)}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedTimer","ExtendedCommon"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedFloating";function a(){Sys.Extended.UI.FloatingBehavior=function(n){var f="_floatingObject",e="location",d="mousedown",b=null,c="move",a=this;Sys.Extended.UI.FloatingBehavior.initializeBase(a,[n]);var h,g,j,l,k,i=Function.createDelegate(a,m);a.add_move=function(a){this.get_events().addHandler(c,a)};a.remove_move=function(a){this.get_events().removeHandler(c,a)};a.get_handle=function(){return h};a.set_handle=function(a){h!=b&&$removeHandler(h,d,i);h=a;$addHandler(h,d,i)};a.get_profileProperty=function(){return l};a.set_profileProperty=function(a){l=a};a.get_profileComponent=function(){return k};a.set_profileComponent=function(a){k=a};a.get_location=function(){return g};a.set_location=function(a){if(g!=a){g=a;this.get_isInitialized()&&$common.setLocation(this.get_element(),g);this.raisePropertyChanged(e)}};a.initialize=function(){Sys.Extended.UI.FloatingBehavior.callBaseMethod(this,"initialize");Sys.Extended.UI.DragDropManager.registerDropTarget(this);var a=this.get_element();if(!g)g=$common.getLocation(a);a.style.position="fixed";$common.setLocation(a,g)};a.dispose=function(){Sys.Extended.UI.DragDropManager.unregisterDropTarget(this);h&&i&&$removeHandler(h,d,i);i=b;Sys.Extended.UI.FloatingBehavior.callBaseMethod(this,"dispose")};a.checkCanDrag=function(a){var d=["input","button","select","textarea","label"],c=a.tagName;return c.toLowerCase()=="a"&&a.href!=b&&a.href.length>0?false:Array.indexOf(d,c.toLowerCase())>-1?false:true};function m(a){window._event=a;var b=this.get_element();if(this.checkCanDrag(a.target)){j=$common.getLocation(b);a.preventDefault();this.startDragDrop(b)}}a.get_dragDataType=function(){return f};a.getDragData=function(){return b};a.get_dragMode=function(){return Sys.Extended.UI.DragMode.Move};a.onDragStart=function(){};a.onDrag=function(){};a.onDragEnd=function(b){var a=this;if(!b){var f=a.get_events().getHandler(c);if(f){var d=new Sys.CancelEventArgs;f(a,d);b=d.get_cancel()}}var h=a.get_element();if(b)$common.setLocation(h,j);else{g=$common.getLocation(h);a.raisePropertyChanged(e)}};a.startDragDrop=function(a){Sys.Extended.UI.DragDropManager.startDragDrop(this,a,b)};a.get_dropTargetElement=function(){return document.body};a.canDrop=function(b,a){return a==f};a.drop=function(){};a.onDragEnterTarget=function(){};a.onDragLeaveTarget=function(){};a.onDragInTarget=function(){}};Sys.Extended.UI.FloatingBehavior.registerClass("Sys.Extended.UI.FloatingBehavior",Sys.Extended.UI.BehaviorBase,Sys.Extended.UI.IDragSource,Sys.Extended.UI.IDropTarget,Sys.IDisposable);Sys.registerComponent(Sys.Extended.UI.FloatingBehavior,{name:"draggable"})}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedBase","ExtendedCommon","ExtendedDragDrop"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedRoundedCorners";function a(){var b=null,a=true;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.BoxCorners=function(){throw Error.invalidOperation();};Sys.Extended.UI.BoxCorners.prototype={None:0,TopLeft:1,TopRight:2,BottomRight:4,BottomLeft:8,Top:1|2,Right:2|4,Bottom:4|8,Left:8|1,All:1|2|4|8};Sys.Extended.UI.BoxCorners.registerEnum("Sys.Extended.UI.BoxCorners",a);Sys.Extended.UI.RoundedCornersBehavior=function(d){var c=this;Sys.Extended.UI.RoundedCornersBehavior.initializeBase(c,[d]);c._corners=Sys.Extended.UI.BoxCorners.All;c._radius=5;c._color=b;c._parentDiv=b;c._originalStyle=b;c._borderColor=b;c._isDirty=a};Sys.Extended.UI.RoundedCornersBehavior.prototype={initialize:function(){Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this,"initialize");this.update()},dispose:function(){this.disposeParentDiv();Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this,"dispose")},update:function(){var d="1px",j="solid",i="none",h="px",c=this,g=c.get_element();if(!g||!c._isDirty||c.get_isUpdating())return;c.disposeParentDiv();var v=c.getBackgroundColor(),q=g.offsetWidth,e=g.cloneNode(false);c.moveChildren(g,e);c._originalStyle=g.style.cssText;g.style.backgroundColor="transparent";g.style.verticalAlign="top";g.style.padding="0";g.style.overflow="";g.style.className="";if(g.style.height&&g.style.height!="auto")g.style.height=parseInt($common.getCurrentStyle(g,"height"))+c._radius*2+h;else if(!g.style.width&&0<q)g.style.width=q+h;e.style.position="";e.style.border="";e.style.margin="";e.style.width="100%";if(e.style.overflow==""&&$common.getCurrentStyle(g,"overflow")=="visible")e.style.overflow="auto";e.id="";e.removeAttribute("control");if(c._borderColor){e.style.borderTopStyle=i;e.style.borderBottomStyle=i;e.style.borderLeftStyle=j;e.style.borderRightStyle=j;e.style.borderLeftColor=c._borderColor;e.style.borderRightColor=c._borderColor;e.style.borderLeftWidth=d;e.style.borderRightWidth=d;if(c._radius==0){e.style.borderTopStyle=j;e.style.borderBottomStyle=j;e.style.borderTopColor=c._borderColor;e.style.borderBottomColor=c._borderColor;e.style.borderTopWidth=d;e.style.borderBottomWidth=d}}else{e.style.borderTopStyle=i;e.style.borderBottomStyle=i;e.style.borderLeftStyle=i;e.style.borderRightStyle=i}for(var m=b,p=c._radius,t=c._radius,r=0,o=t;o>0;o--){var u=Math.acos(o/p),n=p-Math.round(Math.sin(u)*p),f=document.createElement("DIV");f.__roundedDiv=a;f.style.backgroundColor=v;f.style.marginLeft=n+h;f.style.marginRight=n-(c._borderColor?2:0)+h;f.style.height=d;f.style.fontSize=d;f.style.overflow="hidden";if(c._borderColor){f.style.borderLeftStyle=j;f.style.borderRightStyle=j;f.style.borderLeftColor=c._borderColor;f.style.borderRightColor=c._borderColor;var s=Math.max(0,r-n-1);f.style.borderLeftWidth=s+1+h;f.style.borderRightWidth=s+1+h;if(o==t){f.__roundedDivNoBorder=a;f.style.backgroundColor=c._borderColor}}g.insertBefore(f,m);var l=f;f=f.cloneNode(a);f.__roundedDiv=a;g.insertBefore(f,m);var k=f;m=f;r=n;if(!c.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)){l.style.marginLeft="0";if(c._borderColor)l.style.borderLeftWidth=d}if(!c.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)){l.style.marginRight="0";if(c._borderColor){l.style.borderRightWidth=d;l.style.marginRight="-2px"}}if(!c.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)){k.style.marginLeft="0";if(c._borderColor)k.style.borderLeftWidth=d}if(!c.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)){k.style.marginRight="0";if(c._borderColor){k.style.borderRightWidth=d;k.style.marginRight="-2px"}}}g.insertBefore(e,m);c._parentDiv=e;c._isDirty=false},disposeParentDiv:function(){var a=this;if(a._parentDiv){for(var d=a.get_element(),f=d.childNodes,e=f.length-1;e>=0;e--){var c=f[e];if(c){c==a._parentDiv&&a.moveChildren(c,d);try{d.removeChild(c)}catch(d){}}}if(a._originalStyle){d.style.cssText=a._originalStyle;a._originalStyle=b}a._parentDiv=b}},getBackgroundColor:function(){return this._color?this._color:$common.getCurrentStyle(this.get_element(),"backgroundColor")},moveChildren:function(b,d){var c=0;while(b.hasChildNodes()){var a=b.childNodes[0];a=b.removeChild(a);d.appendChild(a);c++}return c},isCornerSet:function(a){return(this._corners&a)!=Sys.Extended.UI.BoxCorners.None},setCorner:function(b,c){var a=this;if(c)a.set_Corners(a._corners|b);else a.set_Corners(a._corners&~b)},get_Color:function(){return this._color},set_Color:function(c){var b=this;if(c!=b._color){b._color=c;b._isDirty=a;b.update();b.raisePropertyChanged("Color")}},get_Radius:function(){return this._radius},set_Radius:function(c){var b=this;if(c!=b._radius){b._radius=c;b._isDirty=a;b.update();b.raisePropertyChanged("Radius")}},get_Corners:function(){return this._corners},set_Corners:function(c){var b=this;if(c!=b._corners){b._corners=c;b._isDirty=a;b.update();b.raisePropertyChanged("Corners")}},get_BorderColor:function(){return this._borderColor},set_BorderColor:function(c){var b=this;if(c!=b._borderColor){b._borderColor=c;b._isDirty=a;b.update();b.raisePropertyChanged("BorderColor")}}};Sys.Extended.UI.RoundedCornersBehavior.registerClass("Sys.Extended.UI.RoundedCornersBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.RoundedCornersBehavior,{name:"rounded"})}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedBase","ExtendedCommon"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedDropShadow";function a(){var b="absolute",a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.DropShadowBehavior=function(c){var b=this;Sys.Extended.UI.DropShadowBehavior.initializeBase(b,[c]);b._opacity=1;b._width=5;b._shadowDiv=a;b._trackPosition=a;b._trackPositionDelay=50;b._timer=a;b._tickHandler=a;b._roundedBehavior=a;b._shadowRoundedBehavior=a;b._rounded=false;b._radius=5;b._lastX=a;b._lastY=a;b._lastW=a;b._lastH=a};Sys.Extended.UI.DropShadowBehavior.prototype={initialize:function(){var a=this;Sys.Extended.UI.DropShadowBehavior.callBaseMethod(a,"initialize");var c=a.get_element();if($common.getCurrentStyle(c,"position",c.style.position)!=b)c.style.position="relative";a._rounded&&a.setupRounded();a._trackPosition&&a.startTimer();a.setShadow()},dispose:function(){this.stopTimer();this.disposeShadowDiv();Sys.Extended.UI.DropShadowBehavior.callBaseMethod(this,"dispose")},buildShadowDiv:function(){var c=this,e=c.get_element();if(!c.get_isInitialized()||!e||!c._width)return;var d=document.createElement("DIV");d.style.backgroundColor="black";d.style.position=b;if(e.id)d.id=e.id+"_DropShadow";c._shadowDiv=d;e.parentNode.appendChild(d);if(c._rounded){c._shadowDiv.style.height=Math.max(0,e.offsetHeight-2*c._radius)+"px";if(!c._shadowRoundedBehavior)c._shadowRoundedBehavior=$create(Sys.Extended.UI.RoundedCornersBehavior,{Radius:c._radius},a,a,c._shadowDiv);else c._shadowRoundedBehavior.set_Radius(c._radius)}else c._shadowRoundedBehavior&&c._shadowRoundedBehavior.set_Radius(0);c._opacity!=1&&c.setupOpacity();c.setShadow(false,true);c.updateZIndex()},disposeShadowDiv:function(){var b=this;if(b._shadowDiv){b._shadowDiv.parentNode&&b._shadowDiv.parentNode.removeChild(b._shadowDiv);b._shadowDiv=a}if(b._shadowRoundedBehavior){b._shadowRoundedBehavior.dispose();b._shadowRoundedBehavior=a}},onTimerTick:function(){this.setShadow()},startTimer:function(){var a=this;if(!a._timer){if(!a._tickHandler)a._tickHandler=Function.createDelegate(a,a.onTimerTick);a._timer=new Sys.Timer;a._timer.set_interval(a._trackPositionDelay);a._timer.add_tick(a._tickHandler);a._timer.set_enabled(true)}},stopTimer:function(){var b=this;if(b._timer){b._timer.remove_tick(b._tickHandler);b._timer.set_enabled(false);b._timer.dispose();b._timer=a}},setShadow:function(f,h){var a=this,c=a.get_element();if(!a.get_isInitialized()||!c||!a._width&&!f)return;var e=a._shadowDiv;!e&&a.buildShadowDiv();var b={x:c.offsetLeft,y:c.offsetTop};if(f||a._lastX!=b.x||a._lastY!=b.y||!e){a._lastX=b.x;a._lastY=b.y;var d=a.get_Width();b.x+=d;b.y+=d;$common.setLocation(a._shadowDiv,b)}var g=c.offsetHeight,d=c.offsetWidth;if(f||g!=a._lastH||d!=a._lastW||!e){a._lastW=d;a._lastH=g;if(!a._rounded||!e||h){a._shadowDiv.style.width=d+"px";a._shadowDiv.style.height=g+"px"}else{a.disposeShadowDiv();a.setShadow()}}if(a._shadowDiv)a._shadowDiv.style.visibility=$common.getCurrentStyle(c,"visibility")},setupOpacity:function(){var a=this;a.get_isInitialized()&&a._shadowDiv&&$common.setElementOpacity(a._shadowDiv,a._opacity)},setupRounded:function(){var b=this;if(!b._roundedBehavior&&b._rounded)b._roundedBehavior=$create(Sys.Extended.UI.RoundedCornersBehavior,a,a,a,b.get_element());b._roundedBehavior&&b._roundedBehavior.set_Radius(b._rounded?b._radius:0)},updateZIndex:function(){var c=this;if(!c._shadowDiv)return;var d=c.get_element(),a=d.style.zIndex,b=c._shadowDiv.style.zIndex;if(b&&a&&a>b)return;else{a=Math.max(2,a);b=a-1}d.style.zIndex=a;c._shadowDiv.style.zIndex=b},updateRoundedCorners:function(){var a=this;if(a.get_isInitialized()){a.setupRounded();a.disposeShadowDiv();a.setShadow()}},get_Opacity:function(){return this._opacity},set_Opacity:function(b){var a=this;if(a._opacity!=b){a._opacity=b;a.setupOpacity();a.raisePropertyChanged("Opacity")}},get_Rounded:function(){return this._rounded},set_Rounded:function(b){var a=this;if(b!=a._rounded){a._rounded=b;a.updateRoundedCorners();a.raisePropertyChanged("Rounded")}},get_Radius:function(){return this._radius},set_Radius:function(b){var a=this;if(b!=a._radius){a._radius=b;a.updateRoundedCorners();a.raisePropertyChanged("Radius")}},get_Width:function(){return this._width},set_Width:function(b){var a=this;if(b!=a._width){a._width=b;a._shadowDiv&&$common.setVisible(a._shadowDiv,b>0);a.setShadow(true);a.raisePropertyChanged("Width")}},get_TrackPositionDelay:function(){return this._trackPositionDelay},set_TrackPositionDelay:function(b){var a=this;if(b!=a._trackPositionDelay){a._trackPositionDelay=b;if(a._trackPosition){a.stopTimer();a.startTimer()}a.raisePropertyChanged("TrackPositionDelay")}},get_TrackPosition:function(){return this._trackPosition},set_TrackPosition:function(b){var a=this;if(b!=a._trackPosition){a._trackPosition=b;if(a.get_element())if(b)a.startTimer();else a.stopTimer();a.raisePropertyChanged("TrackPosition")}}};Sys.Extended.UI.DropShadowBehavior.registerClass("Sys.Extended.UI.DropShadowBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.DropShadowBehavior,{name:"dropShadow"})}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedBase","ExtendedCommon","ExtendedTimer","ExtendedRoundedCorners"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedModalPopup";function a(){var m="hiding",l="shown",k="showing",b="px",g="hidden",j="scroll",i="resize",e="click",d="absolute",n="CSS1Compat",f="none",h="SELECT",c=false,a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.ModalPopupRepositionMode=function(){throw Error.invalidOperation();};Sys.Extended.UI.ModalPopupRepositionMode.prototype={None:0,RepositionOnWindowResize:1,RepositionOnWindowScroll:2,RepositionOnWindowResizeAndScroll:3};Sys.Extended.UI.ModalPopupRepositionMode.registerEnum("Sys.Extended.UI.ModalPopupRepositionMode");Sys.Extended.UI.ModalPopupBehavior=function(d){var b=this;Sys.Extended.UI.ModalPopupBehavior.initializeBase(b,[d]);b._PopupControlID=a;b._PopupDragHandleControlID=a;b._BackgroundCssClass=a;b._DropShadow=c;b._Drag=c;b._OkControlID=a;b._CancelControlID=a;b._OnOkScript=a;b._OnCancelScript=a;b._xCoordinate=-1;b._yCoordinate=-1;b._repositionMode=Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll;b._backgroundElement=a;b._foregroundElement=a;b._relativeOrAbsoluteParentElement=a;b._popupElement=a;b._dragHandleElement=a;b._showHandler=a;b._okHandler=a;b._cancelHandler=a;b._scrollHandler=a;b._resizeHandler=a;b._windowHandlersAttached=c;b._dropShadowBehavior=a;b._dragBehavior=a;b._isIE6=c;b._saveTabIndexes=[];b._saveDesableSelect=[];b._tagWithTabIndex=["A","AREA","BUTTON","INPUT","OBJECT",h,"TEXTAREA","IFRAME"]};Sys.Extended.UI.ModalPopupBehavior.prototype={initialize:function(){var a=this;Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(a,"initialize");a._isIE6=Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7;if(a._PopupDragHandleControlID)a._dragHandleElement=$get(a._PopupDragHandleControlID);a._popupElement=$get(a._PopupControlID);if(a._DropShadow){a._foregroundElement=document.createElement("div");a._foregroundElement.id=a.get_id()+"_foregroundElement";a._popupElement.parentNode.insertBefore(a._foregroundElement,a._popupElement);a._foregroundElement.appendChild(a._popupElement)}else a._foregroundElement=a._popupElement;a._backgroundElement=document.createElement("div");a._backgroundElement.id=a.get_id()+"_backgroundElement";a._backgroundElement.style.display=f;if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&document.compatMode!=n)a._backgroundElement.style.position=d;else a._backgroundElement.style.position="fixed";a._backgroundElement.style.left="0px";a._backgroundElement.style.top="0px";if(a._BackgroundCssClass)a._backgroundElement.className=a._BackgroundCssClass;a._foregroundElement.parentNode.appendChild(a._backgroundElement);a._foregroundElement.style.display=f;a._foregroundElement.style.position="fixed";a._showHandler=Function.createDelegate(a,a._onShow);$addHandler(a.get_element(),e,a._showHandler);if(a._OkControlID){a._okHandler=Function.createDelegate(a,a._onOk);$addHandler($get(a._OkControlID),e,a._okHandler)}if(a._CancelControlID){a._cancelHandler=Function.createDelegate(a,a._onCancel);$addHandler($get(a._CancelControlID),e,a._cancelHandler)}a._scrollHandler=Function.createDelegate(a,a._onLayout);a._resizeHandler=Function.createDelegate(a,a._onLayout);a.registerPartialUpdateEvents()},dispose:function(){var b=this;b._hideImplementation();if(b._foregroundElement&&b._foregroundElement.parentNode){b._backgroundElement.parentNode.removeChild(b._backgroundElement);b._DropShadow&&b._foregroundElement.parentNode.replaceChild(b._popupElement,b._foregroundElement)}b._scrollHandler=a;b._resizeHandler=a;if(b._cancelHandler&&$get(b._CancelControlID)){$removeHandler($get(b._CancelControlID),e,b._cancelHandler);b._cancelHandler=a}if(b._okHandler&&$get(b._OkControlID)){$removeHandler($get(b._OkControlID),e,b._okHandler);b._okHandler=a}if(b._showHandler){$removeHandler(b.get_element(),e,b._showHandler);b._showHandler=a}Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(b,"dispose")},_attachPopup:function(){var b=this;if(b._DropShadow&&!b._dropShadowBehavior)b._dropShadowBehavior=$create(Sys.Extended.UI.DropShadowBehavior,{},a,a,b._popupElement);if(b._dragHandleElement&&!b._dragBehavior)b._dragBehavior=$create(Sys.Extended.UI.FloatingBehavior,{handle:b._dragHandleElement},a,a,b._foregroundElement);$addHandler(window,i,b._resizeHandler);$addHandler(window,j,b._scrollHandler);b._windowHandlersAttached=true},_detachPopup:function(){var b=this;if(b._windowHandlersAttached){b._scrollHandler&&$removeHandler(window,j,b._scrollHandler);b._resizeHandler&&$removeHandler(window,i,b._resizeHandler);b._windowHandlersAttached=c}if(b._dragBehavior){b._dragBehavior.dispose();b._dragBehavior=a}if(b._dropShadowBehavior){b._dropShadowBehavior.dispose();b._dropShadowBehavior=a}},_onShow:function(a){if(!this.get_element().disabled){this.show();a.preventDefault();return c}},_onOk:function(d){var a=this,b=$get(a._OkControlID);if(b&&!b.disabled){a.hide()&&a._OnOkScript&&window.setTimeout(a._OnOkScript,0);d.preventDefault();return c}},_onCancel:function(d){var a=this,b=$get(a._CancelControlID);if(b&&!b.disabled){a.hide()&&a._OnCancelScript&&window.setTimeout(a._OnCancelScript,0);d.preventDefault();return c}},_onLayout:function(c){var b=this,a=b.get_repositionMode();if((a===Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowScroll||a===Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll)&&c.type===j)b._layout();else if((a===Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResize||a===Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll)&&c.type===i)b._layout();else b._layoutBackgroundElement()},show:function(){var a=this,c=new Sys.CancelEventArgs;a.raiseShowing(c);if(c.get_cancel())return;var e=1e4+Sys.Extended.UI.ModalPopupBehavior._openCount++*1e3;a._showing=true;a._backgroundElement.style.zIndex=e;a._foregroundElement.style.zIndex=e+1;a.populate();a._attachPopup();a._backgroundElement.style.display="";a._foregroundElement.style.display="";a._popupElement.style.display="";if(a._isIE6){a._foregroundElement.style.position=d;a._backgroundElement.style.position=d;var b=a._foregroundElement.parentNode;while(b&&b!=document.documentElement)if(b.style.position!="relative"&&b.style.position!=d)b=b.parentNode;else{a._relativeOrAbsoluteParentElement=b;break}}a.disableTab();a._layout();a._layout();a.raiseShown(Sys.EventArgs.Empty)},disableTab:function(){var c=this,d=0,a,f=[];Array.clear(c._saveTabIndexes);for(var e=0;e<c._tagWithTabIndex.length;e++){a=c._foregroundElement.getElementsByTagName(c._tagWithTabIndex[e]);for(var b=0;b<a.length;b++){f[d]=a[b];d++}}d=0;for(var e=0;e<c._tagWithTabIndex.length;e++){a=document.getElementsByTagName(c._tagWithTabIndex[e]);for(var b=0;b<a.length;b++)if(Array.indexOf(f,a[b])==-1){c._saveTabIndexes[d]={tag:a[b],index:a[b].tabIndex};a[b].tabIndex="-1";d++}}d=0;if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7){for(var i=[],e=0;e<c._tagWithTabIndex.length;e++){a=c._foregroundElement.getElementsByTagName(h);for(var b=0;b<a.length;b++){i[d]=a[b];d++}}d=0;Array.clear(c._saveDesableSelect);a=document.getElementsByTagName(h);for(var b=0;b<a.length;b++)if(Array.indexOf(i,a[b])==-1){c._saveDesableSelect[d]={tag:a[b],visib:$common.getCurrentStyle(a[b],"visibility")};a[b].style.visibility=g;d++}}},restoreTab:function(){var a=this;for(var b=0;b<a._saveTabIndexes.length;b++)a._saveTabIndexes[b].tag.tabIndex=a._saveTabIndexes[b].index;Array.clear(a._saveTabIndexes);if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7){for(var c=0;c<a._saveDesableSelect.length;c++)a._saveDesableSelect[c].tag.style.visibility=a._saveDesableSelect[c].visib;Array.clear(a._saveDesableSelect)}},hide:function(){var a=new Sys.CancelEventArgs;this.raiseHiding(a);if(a.get_cancel())return c;this._hideImplementation();this.raiseHidden(Sys.EventArgs.Empty);return true},_hideImplementation:function(){var a=this;if(a._showing){Sys.Extended.UI.ModalPopupBehavior._openCount--;a._backgroundElement.style.display=f;a._foregroundElement.style.display=f;a._popupElement.style.display=f;a._showing=c;a.restoreTab();a._detachPopup()}},_layout:function(){var a=this,f=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,g=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,h=$common.getClientBounds(),l=h.width,k=h.height;a._layoutBackgroundElement();var c=0,e=0;if(a._xCoordinate<0){var j=a._foregroundElement.offsetWidth?a._foregroundElement.offsetWidth:a._foregroundElement.scrollWidth;c=(l-j)/2;if(a._foregroundElement.style.position==d)c+=f;a._foregroundElement.style.left=c+b}else if(a._isIE6){a._foregroundElement.style.left=a._xCoordinate+f+b;c=a._xCoordinate+f}else{a._foregroundElement.style.left=a._xCoordinate+b;c=a._xCoordinate}if(a._yCoordinate<0){var i=a._foregroundElement.offsetHeight?a._foregroundElement.offsetHeight:a._foregroundElement.scrollHeight;e=(k-i)/2;if(a._foregroundElement.style.position==d)e+=g;a._foregroundElement.style.top=e+b}else if(a._isIE6){a._foregroundElement.style.top=a._yCoordinate+g+b;e=a._yCoordinate+g}else{a._foregroundElement.style.top=a._yCoordinate+b;e=a._yCoordinate}a._layoutForegroundElement(c,e);if(a._dropShadowBehavior){a._dropShadowBehavior.setShadow();window.setTimeout(Function.createDelegate(a,a._fixupDropShadowBehavior),0)}a._layoutBackgroundElement()},_layoutForegroundElement:function(e,f){var a=this;if(a._isIE6&&a._relativeOrAbsoluteParentElement){var d=$common.getLocation(a._foregroundElement),c=$common.getLocation(a._relativeOrAbsoluteParentElement),g=d.x;if(g!=e)a._foregroundElement.style.left=e-c.x+b;var h=d.y;if(h!=f)a._foregroundElement.style.top=f-c.y+b}},_layoutBackgroundElement:function(){var a=this;if(a._isIE6){var c=$common.getLocation(a._backgroundElement),d=c.x;if(d!=0)a._backgroundElement.style.left=-d+b;var e=c.y;if(e!=0)a._backgroundElement.style.top=-e+b}var f=$common.getClientBounds(),h=f.width,g=f.height;if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&document.compatMode!=n){a._backgroundElement.style.width=document.body.scrollWidth+b;a._backgroundElement.style.height=document.body.scrollHeight+b}else{a._backgroundElement.style.width=Math.max(Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),h)+b;a._backgroundElement.style.height=Math.max(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),g)+b}},_fixupDropShadowBehavior:function(){this._dropShadowBehavior&&this._dropShadowBehavior.setShadow()},_partialUpdateEndRequest:function(d,b){var a=this;Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(a,"_partialUpdateEndRequest",[d,b]);if(a.get_element()){var c=b.get_dataItems()[a.get_element().id];if("show"==c)a.show();else"hide"==c&&a.hide()}a._layout()},_onPopulated:function(b,a){Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this,"_onPopulated",[b,a]);this._layout()},get_PopupControlID:function(){return this._PopupControlID},set_PopupControlID:function(a){if(this._PopupControlID!=a){this._PopupControlID=a;this.raisePropertyChanged("PopupControlID")}},get_X:function(){return this._xCoordinate},set_X:function(a){if(this._xCoordinate!=a){this._xCoordinate=a;this.raisePropertyChanged("X")}},get_Y:function(){return this._yCoordinate},set_Y:function(a){if(this._yCoordinate!=a){this._yCoordinate=a;this.raisePropertyChanged("Y")}},get_PopupDragHandleControlID:function(){return this._PopupDragHandleControlID},set_PopupDragHandleControlID:function(a){if(this._PopupDragHandleControlID!=a){this._PopupDragHandleControlID=a;this.raisePropertyChanged("PopupDragHandleControlID")}},get_BackgroundCssClass:function(){return this._BackgroundCssClass},set_BackgroundCssClass:function(a){if(this._BackgroundCssClass!=a){this._BackgroundCssClass=a;this.raisePropertyChanged("BackgroundCssClass")}},get_DropShadow:function(){return this._DropShadow},set_DropShadow:function(a){if(this._DropShadow!=a){this._DropShadow=a;this.raisePropertyChanged("DropShadow")}},get_Drag:function(){return this._Drag},set_Drag:function(a){if(this._Drag!=a){this._Drag=a;this.raisePropertyChanged("Drag")}},get_OkControlID:function(){return this._OkControlID},set_OkControlID:function(a){if(this._OkControlID!=a){this._OkControlID=a;this.raisePropertyChanged("OkControlID")}},get_CancelControlID:function(){return this._CancelControlID},set_CancelControlID:function(a){if(this._CancelControlID!=a){this._CancelControlID=a;this.raisePropertyChanged("CancelControlID")}},get_OnOkScript:function(){return this._OnOkScript},set_OnOkScript:function(a){if(this._OnOkScript!=a){this._OnOkScript=a;this.raisePropertyChanged("OnOkScript")}},get_OnCancelScript:function(){return this._OnCancelScript},set_OnCancelScript:function(a){if(this._OnCancelScript!=a){this._OnCancelScript=a;this.raisePropertyChanged("OnCancelScript")}},get_repositionMode:function(){return this._repositionMode},set_repositionMode:function(a){if(this._repositionMode!==a){this._repositionMode=a;this.raisePropertyChanged("RepositionMode")}},add_showing:function(a){this.get_events().addHandler(k,a)},remove_showing:function(a){this.get_events().removeHandler(k,a)},raiseShowing:function(b){var a=this.get_events().getHandler(k);a&&a(this,b)},add_shown:function(a){this.get_events().addHandler(l,a)},remove_shown:function(a){this.get_events().removeHandler(l,a)},raiseShown:function(b){var a=this.get_events().getHandler(l);a&&a(this,b)},add_hiding:function(a){this.get_events().addHandler(m,a)},remove_hiding:function(a){this.get_events().removeHandler(m,a)},raiseHiding:function(b){var a=this.get_events().getHandler(m);a&&a(this,b)},add_hidden:function(a){this.get_events().addHandler(g,a)},remove_hidden:function(a){this.get_events().removeHandler(g,a)},raiseHidden:function(b){var a=this.get_events().getHandler(g);a&&a(this,b)}};Sys.Extended.UI.ModalPopupBehavior.registerClass("Sys.Extended.UI.ModalPopupBehavior",Sys.Extended.UI.DynamicPopulateBehaviorBase);Sys.registerComponent(Sys.Extended.UI.ModalPopupBehavior,{name:"modalPopup"});Sys.Extended.UI.ModalPopupBehavior._openCount=0;Sys.Extended.UI.ModalPopupBehavior.invokeViaServer=function(b,c){var a=$find(b);if(a)if(c)a.show();else a.hide()}}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedDynamicPopulate","ExtendedDropShadow","ExtendedFloating"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedPopupBehavior";function a(){var b="click",c=false,a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.PopupControlBehavior=function(d){var b=this;Sys.Extended.UI.PopupControlBehavior.initializeBase(b,[d]);b._popupControlID=a;b._commitProperty=a;b._commitScript=a;b._position=a;b._offsetX=0;b._offsetY=0;b._extenderControlID=a;b._popupElement=a;b._popupBehavior=a;b._popupVisible=c;b._focusHandler=a;b._popupKeyDownHandler=a;b._popupClickHandler=a;b._bodyClickHandler=a;b._onShowJson=a;b._onHideJson=a};Sys.Extended.UI.PopupControlBehavior.prototype={initialize:function(){var c=this;Sys.Extended.UI.PopupControlBehavior.callBaseMethod(c,"initialize");var d=c.get_element();c._popupElement=$get(c._popupControlID);c._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{id:c.get_id()+"PopupBehavior",parentElement:d},a,a,c._popupElement);c._onShowJson&&c._popupBehavior.set_onShow(c._onShowJson);c._onHideJson&&c._popupBehavior.set_onHide(c._onHideJson);c._focusHandler=Function.createDelegate(c,c._onFocus);c._popupClickHandler=Function.createDelegate(c,c._onPopupClick);c._bodyClickHandler=Function.createDelegate(c,c._onBodyClick);c._popupKeyDownHandler=Function.createDelegate(c,c._onPopupKeyDown);$addHandler(d,"focus",c._focusHandler);$addHandler(d,b,c._focusHandler);$addHandler(document.body,b,c._bodyClickHandler);$addHandler(c._popupElement,b,c._popupClickHandler);$addHandler(c._popupElement,"keydown",c._popupKeyDownHandler);c.registerPartialUpdateEvents();Sys.Extended.UI.PopupControlBehavior.__VisiblePopup&&c.get_id()==Sys.Extended.UI.PopupControlBehavior.__VisiblePopup.get_id()&&c._onFocus(a)},dispose:function(){var c=this,d=c.get_element();c._onShowJson=a;c._onHideJson=a;if(c._popupBehavior){c._popupBehavior.dispose();c._popupBehavior=a}if(c._focusHandler){$removeHandler(d,"focus",c._focusHandler);$removeHandler(d,b,c._focusHandler);c._focusHandler=a}if(c._bodyClickHandler){$removeHandler(document.body,b,c._bodyClickHandler);c._bodyClickHandler=a}if(c._popupClickHandler){$removeHandler(c._popupElement,b,c._popupClickHandler);c._popupClickHandler=a}if(c._popupKeyDownHandler){$removeHandler(c._popupElement,"keydown",c._popupKeyDownHandler);c._popupKeyDownHandler=a}Sys.Extended.UI.PopupControlBehavior.callBaseMethod(c,"dispose")},showPopup:function(){var a=this,b=Sys.Extended.UI.PopupControlBehavior.__VisiblePopup;b&&b._popupBehavior&&b.hidePopup();Sys.Extended.UI.PopupControlBehavior.callBaseMethod(a,"populate");a._popupBehavior.set_x(a._getLeftOffset());a._popupBehavior.set_y(a._getTopOffset());a._popupBehavior.show();a._popupVisible=true;Sys.Extended.UI.PopupControlBehavior.__VisiblePopup=a},hidePopup:function(){this._popupBehavior.hide();this._popupVisible=c;Sys.Extended.UI.PopupControlBehavior.__VisiblePopup=a},_onFocus:function(a){!this._popupVisible&&this.showPopup();a&&a.stopPropagation()},_onPopupKeyDown:function(a){this._popupVisible&&a.keyCode==27&&this.get_element().focus()},_onPopupClick:function(a){a.stopPropagation()},_onBodyClick:function(){this._popupVisible&&this.hidePopup()},_close:function(e){var b=this,d=b.get_element();if(a!=e){if("$$CANCEL$$"!=e){if(b._commitProperty)d[b._commitProperty]=e;else if("text"==d.type)d.value=e;else Sys.Debug.assert(c,String.format(Sys.Extended.UI.Resources.PopupControl_NoDefaultProperty,d.id,d.type));if(b._commitScript)eval(b._commitScript)}b.hidePopup()}},_partialUpdateEndRequest:function(d,c){var a=this;Sys.Extended.UI.PopupControlBehavior.callBaseMethod(a,"_partialUpdateEndRequest",[d,c]);if(a.get_element()){var b=c.get_dataItems()[a.get_element().id];if(undefined===b&&Sys.Extended.UI.PopupControlBehavior.__VisiblePopup&&a.get_id()==Sys.Extended.UI.PopupControlBehavior.__VisiblePopup.get_id())b=c.get_dataItems()._PopupControl_Proxy_ID_;undefined!==b&&a._close(b)}},_onPopulated:function(b,a){Sys.Extended.UI.PopupControlBehavior.callBaseMethod(this,"_onPopulated",[b,a]);this._popupVisible&&this._popupBehavior.show()},_getLeftOffset:function(){var a=this;return Sys.Extended.UI.PopupControlPopupPosition.Left==a._position?-1*a.get_element().offsetWidth+a._offsetX:Sys.Extended.UI.PopupControlPopupPosition.Right==a._position?a.get_element().offsetWidth+a._offsetX:a._offsetX},_getTopOffset:function(){var a=this,b;if(Sys.Extended.UI.PopupControlPopupPosition.Top==a._position)b=-1*a.get_element().offsetHeight+a._offsetY;else if(Sys.Extended.UI.PopupControlPopupPosition.Bottom==a._position)b=a.get_element().offsetHeight+a._offsetY;else b=a._offsetY;return b},get_onShow:function(){return this._popupBehavior?this._popupBehavior.get_onShow():this._onShowJson},set_onShow:function(b){var a=this;if(a._popupBehavior)a._popupBehavior.set_onShow(b);else a._onShowJson=b;a.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onShowBehavior():a},onShow:function(){this._popupBehavior&&this._popupBehavior.onShow()},get_onHide:function(){return this._popupBehavior?this._popupBehavior.get_onHide():this._onHideJson},set_onHide:function(b){var a=this;if(a._popupBehavior)a._popupBehavior.set_onHide(b);else a._onHideJson=b;a.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onHideBehavior():a},onHide:function(){this._popupBehavior&&this._popupBehavior.onHide()},get_PopupControlID:function(){return this._popupControlID},set_PopupControlID:function(a){if(this._popupControlID!=a){this._popupControlID=a;this.raisePropertyChanged("PopupControlID")}},get_CommitProperty:function(){return this._commitProperty},set_CommitProperty:function(a){if(this._commitProperty!=a){this._commitProperty=a;this.raisePropertyChanged("CommitProperty")}},get_CommitScript:function(){return this._commitScript},set_CommitScript:function(a){if(this._commitScript!=a){this._commitScript=a;this.raisePropertyChanged("CommitScript")}},get_Position:function(){return this._position},set_Position:function(a){if(this._position!=a){this._position=a;this.raisePropertyChanged("Position")}},get_ExtenderControlID:function(){return this._extenderControlID},set_ExtenderControlID:function(a){if(this._extenderControlID!=a){this._extenderControlID=a;this.raisePropertyChanged("ExtenderControlID")}},get_OffsetX:function(){return this._offsetX},set_OffsetX:function(a){if(this._offsetX!=a){this._offsetX=a;this.raisePropertyChanged("OffsetX")}},get_OffsetY:function(){return this._offsetY},set_OffsetY:function(a){if(this._offsetY!=a){this._offsetY=a;this.raisePropertyChanged("OffsetY")}},get_PopupVisible:function(){return this._popupVisible},add_showing:function(a){this._popupBehavior&&this._popupBehavior.add_showing(a)},remove_showing:function(a){this._popupBehavior&&this._popupBehavior.remove_showing(a)},raiseShowing:function(a){this._popupBehavior&&this._popupBehavior.raiseShowing(a)},add_shown:function(a){this._popupBehavior&&this._popupBehavior.add_shown(a)},remove_shown:function(a){this._popupBehavior&&this._popupBehavior.remove_shown(a)},raiseShown:function(a){this._popupBehavior&&this._popupBehavior.raiseShown(a)},add_hiding:function(a){this._popupBehavior&&this._popupBehavior.add_hiding(a)},remove_hiding:function(a){this._popupBehavior&&this._popupBehavior.remove_hiding(a)},raiseHiding:function(a){this._popupBehavior&&this._popupBehavior.raiseHiding(a)},add_hidden:function(a){this._popupBehavior&&this._popupBehavior.add_hidden(a)},remove_hidden:function(a){this._popupBehavior&&this._popupBehavior.remove_hidden(a)},raiseHidden:function(a){this._popupBehavior&&this._popupBehavior.raiseHidden(a)}};Sys.Extended.UI.PopupControlBehavior.registerClass("Sys.Extended.UI.PopupControlBehavior",Sys.Extended.UI.DynamicPopulateBehaviorBase);Sys.registerComponent(Sys.Extended.UI.PopupControlBehavior,{name:"popupBehavior"});Sys.Extended.UI.PopupControlBehavior.__VisiblePopup=a;Sys.Extended.UI.PopupControlPopupPosition=function(){throw Error.invalidOperation();};Sys.Extended.UI.PopupControlPopupPosition.prototype={Center:0,Top:1,Left:2,Bottom:3,Right:4};Sys.Extended.UI.PopupControlPopupPosition.registerEnum("Sys.Extended.UI.PopupControlPopupPosition",c)}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedDynamicPopulate","ExtendedPopup","ExtendedAnimationBehavior"],a);else a()})();
// (c) 2010 CodePlex Foundation
(function(){var b="ExtendedWatermark";function a(){var f="WatermarkCssClass",e="WatermarkText",c=true,d="keypress",b=false,a=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.TextBoxWatermarkBehavior=function(c){var b=this;Sys.Extended.UI.TextBoxWatermarkBehavior.initializeBase(b,[c]);b._watermarkText=a;b._watermarkCssClass=a;b._focusHandler=a;b._blurHandler=a;b._keyPressHandler=a;b._propertyChangedHandler=a;b._watermarkChangedHandler=a;b._oldClassName=a;b._clearedForSubmit=a;b._maxLength=a;if(typeof WebForm_OnSubmit=="function"&&!Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit){Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit=WebForm_OnSubmit;WebForm_OnSubmit=Sys.Extended.UI.TextBoxWatermarkBehavior.WebForm_OnSubmit}};Sys.Extended.UI.TextBoxWatermarkBehavior.prototype={initialize:function(){var e=this;Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(e,"initialize");var f=e.get_element(),i=b,g=Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(e,"get_ClientState");if(g!=a&&g!=""){i=g=="Focused";Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(e,"set_ClientState",a)}e._oldClassName=f.className;e._focusHandler=Function.createDelegate(e,e._onFocus);e._blurHandler=Function.createDelegate(e,e._onBlur);e._keyPressHandler=Function.createDelegate(e,e._onKeyPress);$addHandler(f,"focus",e._focusHandler);$addHandler(f,"blur",e._blurHandler);$addHandler(f,d,e._keyPressHandler);e.registerPropertyChanged();var j=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e.get_element()).get_Current(),h=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e.get_element());if(""==j||e._watermarkText==j){h.set_Watermark(e._watermarkText);h.set_IsWatermarked(c)}if(i)e._onFocus();else{f.blur();e._onBlur()}e._clearedForSubmit=b;e.registerPartialUpdateEvents();e._watermarkChangedHandler=Function.createDelegate(e,e._onWatermarkChanged);h.add_WatermarkChanged(e._watermarkChangedHandler)},dispose:function(){var c=this,e=c.get_element();if(c._watermarkChangedHandler){Sys.Extended.UI.TextBoxWrapper.get_Wrapper(c.get_element()).remove_WatermarkChanged(c._watermarkChangedHandler);c._watermarkChangedHandler=a}if(e.control&&c._propertyChangedHandler){e.control.remove_propertyChanged(c._propertyChangedHandler);c._propertyChangedHandler=a}if(c._focusHandler){$removeHandler(e,"focus",c._focusHandler);c._focusHandler=a}if(c._blurHandler){$removeHandler(e,"blur",c._blurHandler);c._blurHandler=a}if(c._keyPressHandler){$removeHandler(e,d,c._keyPressHandler);c._keyPressHandler=a}Sys.Extended.UI.TextBoxWrapper.get_Wrapper(c.get_element()).get_IsWatermarked()&&c.clearText(b);Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(c,"dispose")},_onWatermarkChanged:function(){if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked())this._onBlur();else this._onFocus()},clearText:function(d){var a=this.get_element(),c=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(a);c.set_Value("");c.set_IsWatermarked(b);if(d){a.setAttribute("autocomplete","off");a.select()}},_onFocus:function(f){var d=this,e=d.get_element();Sys.Extended.UI.TextBoxWrapper.get_Wrapper(e).get_IsWatermarked()&&d.clearText(f?c:b);e.className=d._oldClassName;if(d._maxLength>0){d.get_element().maxLength=d._maxLength;d._maxLength=a}},_onBlur:function(){var a=this,b=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(a.get_element());if(""==b.get_Current()||b.get_IsWatermarked()){if(a.get_element().maxLength>0&&a._watermarkText.length>a.get_element().maxLength){a._maxLength=a.get_element().maxLength;a.get_element().maxLength=a._watermarkText.length}a._applyWatermark()}},_applyWatermark:function(){var a=this,b=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(a.get_element());b.set_Watermark(a._watermarkText);b.set_IsWatermarked(c);if(a._watermarkCssClass)a.get_element().className=a._watermarkCssClass},_onKeyPress:function(){Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).set_IsWatermarked(b)},registerPropertyChanged:function(){var a=this,b=a.get_element();if(b.control&&!a._propertyChangedHandler){a._propertyChangedHandler=Function.createDelegate(a,a._onPropertyChanged);b.control.add_propertyChanged(a._propertyChangedHandler)}},_onPropertyChanged:function(b,a){"text"==a.get_propertyName()&&this.set_Text(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Current())},_onSubmit:function(){if(Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked()){this.clearText(b);this._clearedForSubmit=c}},_partialUpdateEndRequest:function(d,c){var a=this;Sys.Extended.UI.TextBoxWatermarkBehavior.callBaseMethod(a,"_partialUpdateEndRequest",[d,c]);if(a.get_element()&&a._clearedForSubmit){a.get_element().blur();a._onBlur();a._clearedForSubmit=b}},get_WatermarkText:function(){return this._watermarkText},set_WatermarkText:function(b){var a=this;if(a._watermarkText!=b){a._watermarkText=b;Sys.Extended.UI.TextBoxWrapper.get_Wrapper(a.get_element()).get_IsWatermarked()&&a._applyWatermark();a.raisePropertyChanged(e)}},get_WatermarkCssClass:function(){return this._watermarkCssClass},set_WatermarkCssClass:function(b){var a=this;if(a._watermarkCssClass!=b){a._watermarkCssClass=b;Sys.Extended.UI.TextBoxWrapper.get_Wrapper(a.get_element()).get_IsWatermarked()&&a._applyWatermark();a.raisePropertyChanged(f)}},get_Text:function(){return Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value()},set_Text:function(b){var a=this;if(""==b){Sys.Extended.UI.TextBoxWrapper.get_Wrapper(a.get_element()).set_Current("");a.get_element().blur();a._onBlur()}else{a._onFocus();Sys.Extended.UI.TextBoxWrapper.get_Wrapper(a.get_element()).set_Current(b)}}};Sys.Extended.UI.TextBoxWatermarkBehavior.registerClass("Sys.Extended.UI.TextBoxWatermarkBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.TextBoxWatermarkBehavior,{name:"watermark",parameters:[{name:e,type:"String"},{name:f,type:"String"}]});Sys.Extended.UI.TextBoxWatermarkBehavior.WebForm_OnSubmit=function(){var d=Sys.Extended.UI.TextBoxWatermarkBehavior._originalWebForm_OnSubmit();if(d)for(var b=Sys.Application.getComponents(),a=0;a<b.length;a++){var c=b[a];Sys.Extended.UI.TextBoxWatermarkBehavior.isInstanceOfType(c)&&c._onSubmit()}return d}}if(window.Sys&&Sys.loader)Sys.loader.registerScript(b,["ExtendedBase","ExtendedCommon"],a);else a()})();
/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var l=this,g,y=l.nextQuery,p=l.$,o=l.nextQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ nextQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ nextQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.nextQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="nextQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.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\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
function ViewPortVars( /* optional */ container)
{
    //Container: The object that has the scroll bars attached to it (e.g. the browser window or a modal popup)
    //    - Defaults to browser window (i.e. the "viewport")
    this.container = container || window;
    this.isModalPopup = this.container != window;
}

ViewPortVars.prototype =
{
    x: function()
    {
        return nextQuery(this.container).scrollLeft();
    },
    y: function()
    {
        return nextQuery(this.container).scrollTop();
    },
    width: function()
    {
        return nextQuery(this.container).width();
    },
    height: function()
    {
        return nextQuery(this.container).height();
    },
    upperLeft: function()
    {
        return { X: this.x(), Y: this.y() };
    },
    upperRight: function()
    {
        return { X: this.x() + this.width(), Y: this.y() };
    },
    lowerLeft: function()
    {
        return { X: this.x(), Y: this.y() + this.height() };
    },
    lowerRight: function()
    {
        return { X: this.x() + this.width(), Y: this.y() + this.height() };
    },
    elementAreaOutsideViewPort: function(element)
    {
        var area = { Right: 0, Left: 0, Top: 0, Bottom: 0 };
        if (element)
        {
            var bounds = null;
            if (this.isModalPopup)
            {
                bounds = {
                    height: nextQuery(element).height(),
                    width: nextQuery(element).width(),
                    x: 0,
                    y: 0
                }
            }
            else
            {
                bounds = {
                    height: nextQuery(element).height(),
                    width: nextQuery(element).width(),
                    x: nextQuery(element).offset().left,
                    y: nextQuery(element).offset().top
                }
            }
            if (bounds.height <= 0 || bounds.width <= 0 || bounds.x < 0 || bounds.y < 0)
                return null;
            if (bounds.x + bounds.width > this.upperRight().X)
                area.Right = bounds.x + bounds.width - this.upperRight().X;
            if (this.upperLeft().X > bounds.x)
                area.Left = this.upperLeft().X - bounds.x;
            if (this.upperLeft().Y > bounds.y)
                area.Top = this.upperLeft().Y - bounds.y;
            if (bounds.y + bounds.height > this.lowerLeft().Y)
                area.Bottom = bounds.y + bounds.height - this.lowerLeft().Y;
        }
        if (area.Left > 0 || area.Right > 0 || area.Top > 0 || area.Bottom > 0)
            return area;
        else
            return null;
    },
    isOutsideViewPort: function(element)
    {
        return this.elementAreaOutsideViewPort(element) != null;
    },
    adjustElementSizeOnce: function(element)
    {
        if (!element)
            return;

        var actualHeight = nextQuery(element).height();
        var actualWidth = nextQuery(element).width();
        var scrollbarPadding = 15; //must allow for scroll bars + extra
        var maxHeight = this.height() - (4 * scrollbarPadding);
        var maxWidth = this.width() - (4 * scrollbarPadding);

        if (element.firstChild.id != "borderDiv")
        {
            var borderDiv = document.createElement("div");
            borderDiv.setAttribute("id", "borderDiv");
            while (element.childNodes.length > 0)
            {
                borderDiv.appendChild(element.firstChild);
            }
            nextQuery(borderDiv).height("100%");
            nextQuery(borderDiv).width("100%");
            nextQuery(borderDiv).css("overflow", "visible");
            element.appendChild(borderDiv);
            nextQuery(element).css("overflow", "auto");
        }

        //Using element.style.minHeight instead of nextQuery(element).css("min-height") because there's not a reliable way to
        //check if the min-height (or width) value has been set when using jquery. Just easier to use the built-in approach.
        if (element.style.minWidth)
        {
            nextQuery(element).width(element.style.minWidth);
            actualWidth = nextQuery(element).width();
        }
        if (element.style.minHeight)
        {
            nextQuery(element).height(element.style.minHeight);
            actualHeight = nextQuery(element).height();
        }

        //If height has room to scroll or is greater than the viewport then we need to adjust the height
        if (actualHeight < element.scrollHeight - scrollbarPadding || actualHeight > maxHeight)
        {
            actualHeight = nextQuery(element).height();
            actualWidth = nextQuery(element).width();
            if (element.scrollHeight > 0 && actualHeight < element.scrollHeight - scrollbarPadding)
            {
                actualHeight = element.scrollHeight;
            }
            if (actualHeight > maxHeight)
            {
                actualHeight = maxHeight;
            }
            if (actualHeight < element.scrollHeight - scrollbarPadding)
            {
                actualWidth += scrollbarPadding;
            }
            else if(nextQuery.browser.safari)
            {
                //Safari bug -- manually have to disable scrollbars when you don't need them...even with overflow=auto
                nextQuery(element).css("overflow-x", "hidden");
            }
            if (actualHeight > 0 && actualWidth > 0)
            {
                nextQuery(element).height(actualHeight);
                nextQuery(element).width(actualWidth);
            }
        }
        //If width has room to scroll or is greater than the viewport then we need to adjust the width
        if (actualWidth < element.scrollWidth - scrollbarPadding || actualWidth > maxWidth)
        {
            actualHeight = nextQuery(element).height();
            actualWidth = nextQuery(element).width();
            if (element.scrollWidth > 0 && actualWidth < element.scrollWidth - scrollbarPadding)
            {
                actualWidth = element.scrollWidth;
            }
            if (actualWidth > maxWidth)
            {
                actualWidth = maxWidth;
            }
            if (actualWidth < element.scrollWidth - scrollbarPadding)
            {
                actualHeight += scrollbarPadding;
            }
            else if(nextQuery.browser.safari)
            {
                //Safari bug -- manually have to disable scrollbars when you don't need them...even with overflow=auto
                nextQuery(element).css("overflow-y", "hidden");
            }
            if (actualHeight > 0 && actualWidth > 0)
            {
                nextQuery(element).height(actualHeight);
                nextQuery(element).width(actualWidth);
            }
        }
        //If height has room to scroll or is greater than the viewport then we need to adjust the height
        if (actualHeight < element.scrollHeight - scrollbarPadding || actualHeight > maxHeight)
        {
            actualHeight = nextQuery(element).height();
            actualWidth = nextQuery(element).width();
            if (element.scrollHeight > 0 && actualHeight < element.scrollHeight - scrollbarPadding)
            {
                actualHeight = element.scrollHeight;
            }
            if (actualHeight > maxHeight)
            {
                actualHeight = maxHeight;
            }
            if (actualHeight < element.scrollHeight - scrollbarPadding)
            {
                actualWidth += scrollbarPadding;
            }
            else if(nextQuery.browser.safari)
            {
                //Safari bug -- manually have to disable scrollbars when you don't need them...even with overflow=auto
                nextQuery(element).css("overflow-x", "hidden");
            }
            if (actualHeight > 0 && actualWidth > 0)
            {
                nextQuery(element).height(actualHeight);
                nextQuery(element).width(actualWidth);
            }
        }
        element.scrollTop = 0;
        element.scrollTop = 0;
    },
    adjustElementSize: function(element)
    {
        this.adjustElementSizeOnce(element);
        this.adjustElementSizeOnce(element);
    },
    attemptReposition: function(element, xPadding, yPadding)
    {
        if(element)
        {
            var outsideArea = this.elementAreaOutsideViewPort(element);
            if(outsideArea)
            {
                var bounds = Sys.UI.DomElement.getBounds(element);
                var x = bounds.x;
                var y = bounds.y;
                if (outsideArea.Left > 0)
                    x += (outsideArea.Left + (2 * xPadding));
                else if (outsideArea.Right > 0)
                    x -= (outsideArea.Right + (2 * xPadding));

                if (outsideArea.Top > 0)
                    y += (outsideArea.Top + (2 * yPadding));
                else if (outsideArea.Bottom > 0)
                    y -= (outsideArea.Bottom + (2 * yPadding));
                    
                x = Math.max(x, 0);
                y = Math.max(y, 0);
                Sys.UI.DomElement.setLocation(element, x, y);                
                bounds = Sys.UI.DomElement.getBounds(element);
                return {intendedPosition: {x: x, y: y},
                        actualPosition:   {x: bounds.x, y: bounds.y}};
            }
        }
        return null;
    },
    positionPopup: function(element)
    {
        if (element)
        {
            this.adjustElementSize(element);
            var originalBounds = Sys.UI.DomElement.getBounds(element);
            var defaultPadding = 15;
            var attempVars = this.attemptReposition(element, defaultPadding, defaultPadding); //attempt with default padding
            if(attempVars)
            {
                //Check if the popup actually went to the position that it was supposed to.
                //Sometimes CSS elements such as the margin for parent elements can cause
                //the popup to reposition to an area that you didn't want it to reposition to.
                //The offset between the intended position and the actual position is usually the 
                //length of the margin, so here we calculate the offset and incorporate that into the repositioning.
                var marginX = Math.max(attempVars.actualPosition.x - attempVars.intendedPosition.x, 0);
                var marginY = Math.max(attempVars.actualPosition.y - attempVars.intendedPosition.y, 0);
                if(marginX > 0 || marginY > 0)
                {
                    //retry accounting for margin
                    Sys.UI.DomElement.setLocation(element, originalBounds.x, originalBounds.y);
                    this.attemptReposition(element, marginX + defaultPadding, marginY + defaultPadding);
                }
            }
        }
    }
}

var viewport = new ViewPortVars();
function ajaxValidatorEvaluate(validator)
{
var value = ValidatorGetValue(validator.controltovalidate);
var ajaxResponse = ajaxSyncCallback(validator.id.replace(/_/g, "\$"), value);
if (ajaxResponse == "True")
    return true;
else
    return false;
}

function checkIfTrue(validator)
{
var checkBox = GetElement(validator.othercontrol1);
var textBox = GetElement(validator.othercontrol2);
 
if (checkBox.checked)
{
    if (textBox.value == validator.customstring1 || isWhitespace(textBox.value))
        return false;
    else
        return true;
}
else
    return true;
}

function validateAddressType(validator) {
var rbBusiness = GetElement(validator.controltovalidate);
var rbResidential = GetElement(validator.othercontrol1);
if (!rbResidential.checked && !rbBusiness.checked) 
    return false;
else 
    return true; 
}

function validateStateCountry(validator)
{
changeValidatorCalloutDynamic();
var state = GetElement(validator.controltovalidate);
var country = GetElement(validator.othercontrol1);
changeState(state,country);
if (validateState(state,country))
    return true;
else
{
    validator.errormessage = "'" + selectText(state) + "' is not a valid State/Province for the Country '" + selectText(country) + "'.";
    if (validator.customstring1 != undefined)
        validator.errormessage = validator.customstring1 + validator.errormessage;
    return false; 
}
}

function validateState(FState, FCountry)
{
    stateValue = selectValue(FState);
    stateFirstSemicolonPos = stateValue.indexOf(";");
    stateLastSemicolonPos = stateValue.lastIndexOf(";");
    countryValue = selectValue(FCountry);
    countryFirstSemicolonPos = countryValue.indexOf(";");
    countryLastSemicolonPos = countryValue.lastIndexOf(";");

    if (stateFirstSemicolonPos == -1)
        stateCountry = "";
    {
        if (stateFirstSemicolonPos == stateLastSemicolonPos)
            stateCountry = stateValue.slice(stateFirstSemicolonPos + 1);
        else
            stateCountry = stateValue.slice(stateFirstSemicolonPos + 1, stateLastSemicolonPos);
    }

    if (countryFirstSemicolonPos == -1)
        countryState = "";
    {
        if (countryFirstSemicolonPos == countryLastSemicolonPos)
            countryState = countryValue.slice(countryFirstSemicolonPos + 1);
        else
            countryState = countryValue.slice(countryFirstSemicolonPos + 1, countryLastSemicolonPos);
    }

    if (stateCountry == "" && countryState == "")
        return false;
    else if (stateCountry == selectText(FCountry))
        return true;
    else if (countryState == selectText(FState))
        return true;
    else
        return false;
}

function conditionalValidateStateCountry(validator)
{
var checkbox = GetElement(validator.othercontrol2);
if (checkbox.checked)
    return validateStateCountry(validator);
else
    return true;
}

function companyNameRequired(validator) 
{
var businessRequired = validator.customstring1;
var companyName = GetElement(validator.controltovalidate);
switch (businessRequired) 
{
case "required":
    if (isWhitespace(companyName.value))
      return false;
    break;
case "requiredb":
    var rbBusiness = GetElement(validator.othercontrol1); 
    if (rbBusiness.checked && isWhitespace(companyName.value))
      return false;
    break;
}                               
return true;
}

function validatePOBox(validator)
{
var addressLine1 = GetElement(validator.controltovalidate);
var addressLine2 = GetElement(validator.othercontrol1);
if (isPOBox(addressLine1, addressLine2))
    return false;
else
    return true;
}

function validateCheckbox(validator)
{
return GetElement(validator.controltovalidate).checked;
}

function otherControl1HasValue(validator)
{
var otherControl1 = GetElement(validator.othercontrol1);
return !isWhitespace(otherControl1.value);
}

function requiredIfChecked(validator) 
{
var requiredField = GetElement(validator.controltovalidate);
var checkbox = GetElement(validator.othercontrol1);
if (checkbox.checked && isWhitespace(requiredField.value))
    return false;
else
    return true;
}

function cardExpired(validator)
{
    curDate = new Date();
    var selectedMonth = GetElement(validator.othercontrol1);                                     
    var selectedYear = GetElement(validator.controltovalidate);                         
    if (selectedMonth.selectedIndex < curDate.getMonth() && selectedYear.selectedIndex == 0)
       return false;
    else
       return true;


}

function validateShipStates(validator)
{
    var shipToServerVarPrefix = validator.customstring1;
    for (var shipToIndex = 0; eval("cartServerVars.ShipName" + shipToIndex) != null; shipToIndex++)
    {
        var locationName = "";
        var restrictedLocation = false;
        var restrictedItems = new Array();
        var restrictedItemsCount = 0;
        for (var prodIndex = 0; eval("cartServerVars.Restricted" + prodIndex) != null; prodIndex++)
        {
            if (eval("cartServerVars.RestrictedShipTo" + prodIndex) == shipToIndex)
            {
                restrictedItems[restrictedItemsCount] = eval("cartServerVars.Restricted" + prodIndex);
                restrictedItemsCount++;
            }
        }
        if (restrictedItemsCount > 0)
        {
            var stateValue = selectValue($get(eval(shipToServerVarPrefix + shipToIndex + "ServerVars.State")));
            var countryValue = selectValue($get(eval(shipToServerVarPrefix + shipToIndex + "ServerVars.Country")));
            if (stateValue == "")
            {
                var countryArray = countryValue.split(";");
                if (countryArray.length == 3 && countryArray[2] == "True")
                {
                    restrictedLocation = true;
                    locationName = selectText($get(eval(shipToServerVarPrefix + shipToIndex + "ServerVars.Country")));
                }
            }
            else
            {
                var stateArray = stateValue.split(";");
                if (stateArray.length == 3 && stateArray[2] == "True")
                {
                    restrictedLocation = true;
                    locationName = selectText($get(eval(shipToServerVarPrefix + shipToIndex + "ServerVars.State")));
                }
            }
        }
        if (restrictedLocation)
        {
            var forText = ""
            if (cartServerVars.MultipleShipTo)
                forText = " for " + eval("cartServerVars.ShipName" + shipToIndex);

            var productText = cartServerVars.ProductSingular.toLowerCase();
            var thisText = "this";
            if (restrictedItemsCount > 1)
            {
                productText = cartServerVars.ProductPlural.toLowerCase();
                thisText = "these";
            }
            validator.errormessage = "The " + productText + " " + arrayAndList(restrictedItems) + " cannot be shipped to " + locationName + ".  Please either remove " + thisText + " " + productText + " from " + cartServerVars.Your.toLowerCase() + " " + cartServerVars.ShoppingCart + ", or select a different Ship To Address" + forText + ".  Thank you.";
            return false;
        }
    }
    return true;
}

function requirePasswordRetype(validator)
{
    var password = nextQuery('#' + validator.customstring1).val();
    var passwordRetype = nextQuery('#' + validator.customstring2).val();
    
    if (isWhitespace(password))
        return true;
    else
    {
        if (isWhitespace(passwordRetype))
            return false;
        else
            return true;
    }
}

function checkForPayment(validator)
{
    if (nextQuery("input[name$='payment']:checked").val())
        return true;
    else
        return false;
}

function changeValidatorCalloutDynamic() {
    if (Sys.Extended.UI.ValidatorCalloutBehavior)
    {
        if (!Sys.Extended.UI.ValidatorCalloutBehavior.prototype.oldShow)
        {
            Sys.Extended.UI.ValidatorCalloutBehavior.prototype.oldShow = Sys.Extended.UI.ValidatorCalloutBehavior.prototype.show;
            Sys.Extended.UI.ValidatorCalloutBehavior.prototype.show = function (force)
            {
                if (force || !this.get_isOpen()) {
                    nextQuery(this._errorMessageCell).html(this._getErrorMessage());
                    this.oldShow(force);
                }
            }
        }
    }
}

function requireAffiliateCategory(validator)
{
     var validationValue = nextQuery('#' + validator.controltovalidate + ' option:selected').text();
     if (isWhitespace(validationValue))
        return false;
    else
        return true;
}





var beginRequestFunctions = new Array();
var endRequestFunctions = new Array();
var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
pageRequestManager.add_beginRequest(suppressUpdateProgress_beginRequest);
pageRequestManager.add_endRequest(suppressUpdateProgress_endRequest);

function suppressUpdateProgress_beginRequest(sender, args)
{
    for (var index = 0; index < beginRequestFunctions.length; index++)
    {
        var func = beginRequestFunctions[index];
        func(sender, args);
    }
}

function suppressUpdateProgress_endRequest(sender, args)
{
    for (var index = 0; index < endRequestFunctions.length; index++)
    {
        var func = endRequestFunctions[index];
        func(sender, args);
    }
}

function SuppressUpdateProgress(subUpdatePanelID, masterUpdatePanelID, masterUpdateProgressID)
{
    this.subUpdatePanelID = subUpdatePanelID;
    this.masterUpdatePanelID = masterUpdatePanelID;
    this.masterUpdateProgressID = masterUpdateProgressID;
    this.suppressPostBackElementID = null;
    this.enabled = true;
    var obj = this;
    beginRequestFunctions.push(function(sender, args) { obj.suppress_beginRequest(sender, args); });
    endRequestFunctions.push(function(sender, args) { obj.suppress_endRequest(sender, args); });
}

SuppressUpdateProgress.prototype.suppress_beginRequest = function(sender, args)
{
    if (!this.enabled)
        return;
    this.suppressPostBackElementID = args.get_postBackElement().id;
    if (this.isSuppressedPostBack())
    {
        $find(this.masterUpdateProgressID).set_associatedUpdatePanelId("non_existant_control_id");
    }
}

SuppressUpdateProgress.prototype.suppress_endRequest = function(sender, args)
{
    if (this.suppressPostBackElementID)
    {
        $find(this.masterUpdateProgressID).set_associatedUpdatePanelId(this.masterUpdatePanelID);
    }
    this.suppressPostBackElementID = null;
}

SuppressUpdateProgress.prototype.isSuppressedPostBack = function()
{
    if ($get(this.subUpdatePanelID) && this.suppressPostBackElementID && recursiveFind($get(this.subUpdatePanelID), this.suppressPostBackElementID))
        return true;
    else
        return false;
}
/// <reference path="./jQuery/jquery.intellisense.js"/>

function browserName()
{
    browserAgent = navigator.userAgent;
    var patternFirefox = /firefox/i;
    var patternNetscape = /netscape/i;
    var patternOpera = /opera/i;
    var patternSafari = /safari/i;
    var patternIE = /msie/i;
    var patternMac = /mac/i;

    if (patternFirefox.test(browserAgent))
	    return "Firefox";
    else if (patternNetscape.test(browserAgent))
	    return "Netscape";
    else if (patternOpera.test(browserAgent))
	    return "Opera";
    else if (patternSafari.test(browserAgent))
	    return "Safari";
    else if (patternIE.test(browserAgent) && patternMac.test(browserAgent))
	    return "MacIE";
    else if (patternIE.test(browserAgent))
	    return "IE";
    else
	    return "Other";
}

function autoChange(FIsPopulated, FRadioCheckbox)
{
    if (!(FRadioCheckbox == null || isWhitespace(FIsPopulated.value)))
        FRadioCheckbox.checked = true;
}

function autoCheck(FCheckboxA, FCheckboxB, FCheckUncheck)
{
    if (FCheckboxB != null)
    {
        if (FCheckUncheck && FCheckboxA.checked)
            FCheckboxB.checked = true;
        else if (!FCheckUncheck && !FCheckboxA.checked)
            FCheckboxB.checked = false;
    }
}

function autoEnableDisable(FCheckbox, FField, FTrueFalse)
{
    if (FField != null)
    {
        if (FCheckbox.checked)
            FField.disabled = !FTrueFalse;
        else
            FField.disabled = FTrueFalse;
    }
}

function requireCompanyName(businessAddressFlag, requiredb)
{
    var businessRequiredLabel = GetElement(requiredb);
switch (businessAddressFlag)
{
  case "0":
    businessRequiredLabel.style.display = '';
   	break;
  case "1":
    businessRequiredLabel.style.display = 'none';	
	break;
}
}

function setElementVisibility(select,cnameString,companyField,requiredbString,baddress,ad1String)
{
   var str= select;
   var ar = str.split(";");
   var name=ar[0];
   
   var cname=document.getElementById(cnameString);
   var adl=document.getElementById(ad1String);
   var requiredb=document.getElementById(requiredbString);	

   if (name.length)
   {
     cname.style.display = '';
	 ad1.style.display='none';

	 if(name=="optional")
	 {
		requiredb.style.display = '';
	 }
	 else if(name=="requiredb")
	 {    
	     if(baddress.checked)
		 {
		   requiredb.style.display = 'none';			  	    	   			   
		 }
		 else
		 {
  		   requiredb.style.display = ''; 
		 }
	 }
     else
     {
        requiredb.style.display = 'none';
	 }
   }
   else
   {
     companyField.value='';
	 cname.style.display = 'none'; 
	 ad1.style.display='';	 
   }

}

function Left(str, n)
{
    if (n <= 0)     
        return "";
    else if (n > String(str).length)   
        return str;                
    else 
        return String(str).substring(0,n);
}


function GetElement(id)
{
    if(document.all)
    {
        return document.all[id];
    }
    else
    {
        return document.getElementById(id);        
    }
    
}

function setSelectValue(selectBox, val) 
{
    var selectValueFound = false;
    for (i = 0; i < selectBox.length; i++) 
    {
        if (selectBox.options[i].value.toString() == val.toString()) 
        {
            selectBox.selectedIndex = i;
            selectValueFound = true;
            break;
        }
    }
    return selectValueFound;
}

function resetSelectBox(FSelectBox)
{
    for (Fi = 0; Fi < FSelectBox.length; Fi++)
    {

        if (FSelectBox.options[Fi].defaultSelected)
        {
            FSelectBox.selectedIndex = Fi;
            break;
        }
    }
}

function selectText(FSelectBox)
{
    textValue = FSelectBox.options[FSelectBox.selectedIndex].text;
    return trim(textValue);
}

function selectValue(selectBox) 
{
    var valueValue = selectBox.options[selectBox.selectedIndex].value;
    return trim(valueValue);
}

function trim(FString)
{
    return FString.replace(/^\s*|\s*$/g, "");
}

function getElementWidth(element) 
{
    var overflow = element.style.overflow;
    element.style.overflow = "hidden";
    var returnVal = element.scrollWidth;
    if (overflow == "") {
        element.style.overflow = "visible";
    }
    else {
        element.style.overflow = overflow
    }
    return returnVal;
}

function getElementHeight(element) 
{
    var overflow = element.style.overflow;
    element.style.overflow = "hidden";
    var returnVal = element.scrollHeight;
    if (overflow == "") {
        element.style.overflow = "visible";
    }
    else {
        element.style.overflow = overflow
    }
    return returnVal;
}

function isInteger(input,allowZero,allowNegative)
{
var pattern;
if (allowNegative)
    pattern = /[^\d\-]|\-{2,}/;
else if (allowZero)
	pattern = /\D/;
else
	pattern = /\D|^0/;

if (pattern.test(input))
    return false;
else
    return true;
}

function ajaxSyncCallback(eventTarget,eventArgument)
{
    var postData = __theFormPostData + "__CALLBACKID=" + WebForm_EncodeCallback(eventTarget) + "&__CALLBACKPARAM=" + WebForm_EncodeCallback(eventArgument);
    if (theForm["__EVENTVALIDATION"])
        postData += "&__EVENTVALIDATION=" + WebForm_EncodeCallback(theForm["__EVENTVALIDATION"].value);
    var xmlRequest,e;
    try
    {
        xmlRequest = new XMLHttpRequest();
    }
    catch(e)
    {
        try
        {
            xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e)
        {
        }
    }
    var setRequestHeaderMethodExists = true;
    try
    {
        setRequestHeaderMethodExists = (xmlRequest && xmlRequest.setRequestHeader);
    }
    catch(e)
    {
    }
    if (setRequestHeaderMethodExists)
    {
        xmlRequest.open("POST",theForm.action,false);
        xmlRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");
        xmlRequest.send(postData);
        var response = xmlRequest.responseText;
        if (response.charAt(0) == "s")
            return response.substring(1);
        else
            return "Error"; 
    }
}

function isPOBox(addressLine1, addressLine2) {
    if (isElement(addressLine1))
        addressLine1 = addressLine1.value;
    else
        addressLine1 = addressLine1;
    if (isElement(addressLine2))
        addressLine2 = addressLine2.value;
    else
        addressLine2 = addressLine2;

    var address1Chars = addressLine1.replace(/\W/g, "");
    var poBoxTest = /^(pobox|pob|postofficebox)\d/i;
    if (poBoxTest.test(address1Chars)) {
        if (isWhitespace(addressLine2))
            return true;
        else {
            var address2Chars = addressLine2.replace(/\W/g, "");
            if (poBoxTest.test(address2Chars))
                return true;
            else
                return false;
        }
    }
    else
        return false;
}

function isElement(object) {
    return (
    typeof HTMLElement === "object" ? object instanceof HTMLElement : //DOM2
    typeof object === "object" && object.nodeType === 1 && typeof object.nodeName === "string"
);
}

function isWhitespace(FValue)
{
    var pattern = /^\s*$/;
    if (pattern.test(FValue))
        return true;
    else
        return false;
}

function recursiveFind(outerElement, innerElementID) 
{
    if (outerElement.id == innerElementID) 
        return outerElement;
    else 
    {
        var index;
        for (index = 0; index < outerElement.childNodes.length; index++) 
        {
            var elem = recursiveFind(outerElement.childNodes[index], innerElementID);
            if (elem)
                return elem;
        }
        return null;
    }
}

Date.prototype.getMessage = function(messageDates)
{
    for (index = 0; index < messageDates.length; index++)
    {
        if (messageDates[index].Date.getMonth() == this.getMonth() && messageDates[index].Date.getDate() == this.getDate() && messageDates[index].Date.getYear() == this.getYear())
            return messageDates[index].Message;
    }
    return null;
}

function setupCalendarTextBox(inputFieldID, disabledDates, messageDates, minDate, maxDate, buttonImagePath, timePeriod)
{
    var yearRangeStr = '';
    var now = new Date();
    switch (timePeriod)
    {
        case 'Future':
            yearRangeStr = now.getFullYear() + ':2030';
            break;
        case 'Past':
            yearRangeStr = '1900:' + now.getFullYear();
            break;
        case 'PastAndFuture':
            yearRangeStr = '1900:2030';
            break;
    }

    nextQuery(document).ready(function()
    {
        nextQuery("#" + inputFieldID).datepicker({
            dateFormat: 'mm/dd/yy',
            showOn: 'button',
            buttonImage: buttonImagePath,
            buttonText: 'Select Date',
            buttonImageOnly: true,
            prevText: '',
            nextText: '',
            minDate: minDate,
            maxDate: maxDate,
            yearRange: yearRangeStr,
            beforeShowDay: function(date)
            {
                if (disabledDates)
                {
                    for (index = 0; index < disabledDates.length; index++)
                    {
                        if (disabledDates[index].getMonth() == date.getMonth() && disabledDates[index].getDate() == date.getDate() && disabledDates[index].getYear() == date.getYear())
                            return [false, 'disabledDays'];
                    }
                }
                if ((minDate && minDate > date) || (maxDate && maxDate < date))
                    return [false, 'disabledDays'];
                else
                    return [true, 'enabledDays'];
            },
            onChangeMonthYear: function(date)
            {
                if (messageDates)
                    addDateMessages(inputFieldID, messageDates);
            },
            onSelect: function() { } //Believe it or not, this is needed. When onSelect is null it conflicts with ASP .NET validators. ummmmm
        });
        if (messageDates)
        {
            nextQuery("#" + inputFieldID).parent().children('img').click(function()
            {
                addDateMessages(inputFieldID, messageDates);
            });
        }
        if (!nextQuery.datepicker.oldAdjustDate)
            nextQuery.datepicker.oldAdjustDate = nextQuery.datepicker._adjustDate;
        nextQuery.datepicker._adjustDate = function(id, offset, period) //overriding a datepicker core function
        {
            this.oldAdjustDate(id, offset, period); //to ensure that the old code still runs
            this._notifyChange(nextQuery.datepicker._curInst); //this ensures that the onChangeMonthYear event is fired correctly
        }
    });
}

function setupCalendarDropDown(inputFieldID, dropdownID, availableDates, messageDates, buttonImagePath)
{
    nextQuery(document).ready(function ()
    {
        var selectedDate = availableDates[0];
        if (nextQuery("#" + inputFieldID).val() && nextQuery("#" + inputFieldID).val() != '')
        {
            selectedDate = nextQuery("#" + inputFieldID).val();
        }
        nextQuery("#" + inputFieldID).datepicker({
            dateFormat: 'm-d-yy', //needs to be in this format in order to select the correct date from the dropdownlist
            onSelect: function (date)
            {
                nextQuery("#" + dropdownID).val(date);
                nextQuery("#" + dropdownID).change(); //fire any attached events
            },
            showOn: 'button',
            buttonImage: buttonImagePath,
            buttonText: 'Select Date',
            buttonImageOnly: true,
            prevText: '',
            nextText: '',
            minDate: availableDates[0],
            maxDate: availableDates[availableDates.length - 1],
            defaultDate: selectedDate,
            beforeShowDay: function (date)
            {
                for (index = 0; index < availableDates.length; index++)
                {
                    if (availableDates[index].getMonth() == date.getMonth() && availableDates[index].getDate() == date.getDate() && availableDates[index].getYear() == date.getYear())
                        return [true, 'enabledDays'];
                }
                return [false, 'disabledDays'];
            },
            onChangeMonthYear: function (date)
            {
                if (messageDates)
                    addDateMessages(inputFieldID, messageDates);
            }
        });
        if (messageDates)
        {
            nextQuery("#" + inputFieldID).parent("td").children('img').click(function ()
            {
                addDateMessages(inputFieldID, messageDates);
            });
        }
        if (!nextQuery.datepicker.oldAdjustDate)
            nextQuery.datepicker.oldAdjustDate = nextQuery.datepicker._adjustDate;
        nextQuery.datepicker._adjustDate = function (id, offset, period) //overriding a datepicker core function
        {
            this.oldAdjustDate(id, offset, period); //to ensure that the old code still runs
            this._notifyChange(nextQuery.datepicker._curInst); //this ensures that the onChangeMonthYear event is fired correctly
        }
    });
}

function addDateMessages(inputFieldID, messageDates)
{
    var target = nextQuery("#" + inputFieldID);
    var inst = nextQuery.data(target[0], "datepicker");
    var month = parseInt(inst.dpDiv.find(".ui-datepicker-one-month .ui-datepicker-header .ui-datepicker-new-month").val());
    var year = parseInt(inst.dpDiv.find(".ui-datepicker-one-month .ui-datepicker-header .ui-datepicker-new-year").val());
    var $weeks = inst.dpDiv.find(".ui-datepicker-one-month .ui-datepicker tbody .ui-datepicker-days-row");
    nextQuery.each($weeks, function()
    {
        var $days = nextQuery(this).children(".ui-datepicker-days-cell");
        nextQuery.each($days, function()
        {
            var day = nextQuery('> a', this).html() || nextQuery(this).html();
            if (day && isInteger(day, false, false))
            {
                day = parseInt(day);
                var currentDate = new Date(year, month, day);
                var message = currentDate.getMessage(messageDates);
                if (message)
                    nextQuery(this).html(nextQuery(this).html() + "<span class=\"labelSubText\">" + message + "</span>");
            }
        });
    });
}

function showObjects(obj)
{
    var properties = "Properties<br>----------<br>";
    var functions = "Functions<br>----------<br>";
    for (var i in obj)
    {
        if (typeof obj[i] == "function")
        {
            var start = obj[i].toString().indexOf('function');
            var stop = obj[i].toString().indexOf(')') + 1;
            functions += i + ": " + obj[i].toString().substring(start, stop) + "<br>";
        }
        else
            properties += i + ": " + obj[i] + "<br>";
    }

    var msg = "<div style='position: absolute; z-index: 300;'>";
    msg += properties + "<br><br>";
    msg += functions + "<br><br>";
    msg += "</div>"
    document.write(msg);
}

function changeStateCountry(txtShipZip, ddlState, ddlCountry)
{
    Nexternal.WebApp.WebServicesCommon.GetStateCountry(txtShipZip.value,
    function(result, eventArgs)
    {
        onChangeStateCountry(result, ddlState, ddlCountry);
    });
}

function onChangeStateCountry(result, ddlState, ddlCountry)
{
    if (result)
    {
        var state = result.split(";")[0];
        var country = result.split(";")[1];
        for (var i = 0; i < ddlState.length; i++)
        {
            if (state == ddlState.options[i].value.split(";")[0])
            {
                ddlState.selectedIndex = i;
                break;
            }
        }
        for (var i = 0; i < ddlCountry.length; i++)
        {
            if (country == ddlCountry.options[i].value.split(";")[0])
            {
                ddlCountry.selectedIndex = i;
                break;
            }
        }
    }
}

function changeState(ddlState, ddlCountry)
{
    var stateValue = selectValue(ddlState);
    var firstSemicolonPos = stateValue.indexOf(";");
    var lastSemicolonPos = stateValue.lastIndexOf(";");
    if (firstSemicolonPos != -1)
    {
        if (firstSemicolonPos == lastSemicolonPos)
            setSelectBox(ddlCountry, stateValue.slice(firstSemicolonPos + 1));
        else
            setSelectBox(ddlCountry, stateValue.slice(firstSemicolonPos + 1, lastSemicolonPos));
    }
}

function changeCountry(ddlCountry, ddlState)
{
    var countryValue = selectValue(ddlCountry);
    var firstSemicolonPos = countryValue.indexOf(";");
    var lastSemicolonPos = countryValue.lastIndexOf(";");
    if (firstSemicolonPos != -1)
    {
        if (firstSemicolonPos == lastSemicolonPos)
            setSelectBox(ddlState, countryValue.slice(firstSemicolonPos + 1));
        else
            setSelectBox(ddlState, countryValue.slice(firstSemicolonPos + 1, lastSemicolonPos));
    }
}

function setSelectBox(ddlSelect, textValue)
{
    var selectTextFound = false;
    for (var i = 0; i < ddlSelect.length; i++)
    {
        if (trim(ddlSelect.options[i].text) == textValue)
        {
            ddlSelect.selectedIndex = i;
            selectTextFound = true;
            break;
        }
    }
    return selectTextFound;
}

function arrayAndList(stringArray)
{
    var returnValue = "";
    for (var index = 0; index < stringArray.length; index++)
    {
        if (index > 0)
        {
            if (index == stringArray.length - 1)
                returnValue += " and ";
            else
                returnValue += ", ";
        }
        returnValue += stringArray[index];
    }
    return returnValue;
}


function getScrollWidth(element)
{
    var oldDisplay = nextQuery(element).css("display");
    nextQuery(element).css("display", "block"); //must be visible in order for "element.scrollWidth" to work
    var scrollWidth = parseInt(element.scrollWidth, 10);
    //return it to the old display
    nextQuery(element).css("display", oldDisplay);
    return scrollWidth;
}

function getScrollHeight(element)
{
    var oldDisplay = nextQuery(element).css("display");
    nextQuery(element).css("display", "block"); //must be visible in order for "element.scrollHeight" to work
    var scrollHeight = parseInt(element.scrollHeight, 10);
    //return it to the old display
    nextQuery(element).css("display", oldDisplay);
    return scrollHeight;
}

function setGIFLocation(container, updateProgressBlock, isModalPopup)
{
    if (container && updateProgressBlock && nextQuery(container).css("display") != "none" && nextQuery(updateProgressBlock).css("display") != "none")
    {
        //if it's a modalpopup treat the coord calculations as if the modal popup was the viewport
        var height, width;
        var area = null;
        var div = updateProgressBlock.getElementsByTagName('div')[0];
        if (div)
        {
            if (isModalPopup)
            {
                var scrollWidth = getScrollWidth(container);
                var scrollHeight = getScrollHeight(container);
                if (scrollWidth > nextQuery(updateProgressBlock).width() || scrollHeight > nextQuery(updateProgressBlock).height())
                {
                    Sys.UI.DomElement.setLocation(updateProgressBlock, 0, 0);
                    nextQuery(updateProgressBlock).width(scrollWidth);
                    nextQuery(updateProgressBlock).height(scrollHeight);
                }
                var modalPopupViewport = new ViewPortVars(container);
                area = modalPopupViewport.elementAreaOutsideViewPort(updateProgressBlock);
                height = nextQuery(updateProgressBlock).height();
                width = nextQuery(updateProgressBlock).width();
            }
            else
            {
                area = viewport.elementAreaOutsideViewPort(container);
                height = nextQuery(container).height();
                width = nextQuery(container).width();
            }
            var visibleTop = 0;
            var visibleLeft = 0;
            var visibleHeight = height;
            var visibleWidth = width;
            var divOffsetX = Math.floor(nextQuery(div).width() / 2);
            var divOffsetY = Math.floor(nextQuery(div).height() / 2);
            if (area)
            {
                visibleTop += area.Top;
                visibleLeft += area.Left;
                visibleHeight -= (area.Top + area.Bottom);
                visibleWidth -= (area.Left + area.Right);
            }
            var x = visibleLeft + Math.floor(visibleWidth / 2) - divOffsetX;
            var y = visibleTop + Math.floor(visibleHeight / 2) - divOffsetY;

            //Now make sure the coords are within the bounds of the container
            x = Math.max(x, 0);
            y = Math.max(y, 0);
            x = Math.min(x, width);
            y = Math.min(y, height);

            //special case adjustments (when the GIF is right on the border of the container)
            if (x - divOffsetX <= 0)
                x = divOffsetX;
            if (y - divOffsetY <= 0)
                y = divOffsetY;
            if (x + divOffsetX >= width)
                x = width - divOffsetX;
            if (y + divOffsetY >= height)
                y = height - divOffsetY;

            Sys.UI.DomElement.setLocation(div, x, y);
        }
    }
}

function setupOverlayAnimatedGIFPosition(container, updateProgressBlock, isModalPopup)
{
    //Set initial location of animated GIF before the scrolling and resizing events occur
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function(sender, args)
    {
        if (container && recursiveFind(container, args.get_postBackElement().id))
        {
            var intID = setInterval(function()
            {
                if (nextQuery(container).css("display") != "none" && nextQuery(updateProgressBlock).css("display") != "none")
                {
                    clearInterval(intID);
                    setGIFLocation(container, updateProgressBlock, isModalPopup);
                }
            }, 250);
        }
    });
    if (isModalPopup)
    {
        nextQuery(document.forms).submit(function()
        {
            if (Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())
            {
                var intervalID = setInterval(function()
                {
                    var scrollWidth = getScrollWidth(container);
                    var scrollHeight = getScrollHeight(container);
                    if (scrollWidth > nextQuery(updateProgressBlock).width() || scrollHeight > nextQuery(updateProgressBlock).height())
                    {
                        clearInterval(intervalID);
                        Sys.UI.DomElement.setLocation(updateProgressBlock, 0, 0);
                        nextQuery(updateProgressBlock).width(scrollWidth);
                        nextQuery(updateProgressBlock).height(scrollHeight);
                        setGIFLocation(container, updateProgressBlock, isModalPopup);
                    }
                }, 250);
            }         
        });
        nextQuery(container).scroll(function() { setGIFLocation(container, updateProgressBlock, isModalPopup); });
    }
    else
    {
        nextQuery(window).resize(function() { setGIFLocation(container, updateProgressBlock, isModalPopup); });
        nextQuery(window).scroll(function() { setGIFLocation(container, updateProgressBlock, isModalPopup); });
    }

}

function setupModalPopupValidatorCallout(behaviorID, modalpopup)
{
    var intID = setInterval(function()
    {
        var callout = $find(behaviorID);
        if (callout)
        {
            clearInterval(intID);
            if (!callout._popupBehavior)
            {
                callout._ensureCallout();
            }
            callout._popupBehavior.add_shown(function()
            {
                var modalViewport = new ViewPortVars(modalpopup);
                //input's left position + width + small buffer = right side of the control
                var x = nextQuery(callout._elementToValidate).scrollLeft() + nextQuery(callout._elementToValidate).width() + 3;
                var y = nextQuery(callout._elementToValidate).scrollTop();
                callout._popupBehavior.set_x(x + modalViewport.x());
                callout._popupBehavior.set_y(y + modalViewport.y());
            });
        }
    }, 250);
}

//Only comes up on the product detail page in firefox when the main image is positioned left
//and the detail style is tabbed. When that happens we call this function to reposition the validator callout
//manually using the style shown below
function reformatFaultyCallout(behaviorID)
{
    var intID = setInterval(function()
    {
        var callout = $find(behaviorID);
        if (callout)
        {
            clearInterval(intID);
            if (!callout._popupBehavior)
            {
                callout._ensureCallout();
            }
            callout._popupBehavior.add_shown(function()
            {
                var controlToValidate = nextQuery(callout._elementToValidate);
                nextQuery(callout._popupTable).css({
                    "position": "absolute",
                    "left": controlToValidate.offset().left + controlToValidate.width() + 5,
                    "top": controlToValidate.offset().top
                });
            });
        }
    }, 250);
}

function modalPopupDisplay() {
    if (Sys.Extended.UI.ModalPopupBehavior)
    {
        if (!Sys.Extended.UI.ModalPopupBehavior.prototype.oldHide)
        {
            Sys.Extended.UI.ModalPopupBehavior.prototype.oldHide = Sys.Extended.UI.ModalPopupBehavior.prototype.hide;
            Sys.Extended.UI.ModalPopupBehavior.prototype.hide = function ()
            {
                var name = "#" + this._PopupControlID;
                nextQuery(name).css({ "display": "none" });
                this.oldHide();
            }
            }
        }
}

function setupDymanicPopup(behaviorID, panelID)
{
    var intID = setInterval(function()
    {
        var dynamicPopulate = $find(behaviorID);
        if (dynamicPopulate)
        {
            clearInterval(intID);
            dynamicPopulate.add_populated(function() { viewport.positionPopup($get(panelID)); });
        }
    }, 250);
}

function isDefined(variable) {
    return (typeof (window[variable]) == "undefined") ? false : true;
}

//Patch Code for AjaxControlToolkit bug - 11/09/2009
//There is a bug in AjaxControlToolkit with Safari 3 that this code below fixes. Certain Modal Popups (Product Review and Product 
//Questions) will not launch correctly. If AjaxControlToolkit and/or Safari 3 are upgraded after 11/09/2009 try commenting this 
//patch code out and testing the bug again:
// 1) Go to product detail
// 2) Click on "Submit a Review"
// If the bug persists then the modal popup won't launch.
Sys.Browser.WebKit = {}; //Safari 3 is considered WebKit
if (navigator.userAgent.indexOf('WebKit/') > -1)
{
    Sys.Browser.agent = Sys.Browser.WebKit;
    Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
    Sys.Browser.name = 'WebKit';
}
//End patch code

function resetDisableButton(submitButton, disabledButton)
{
    nextQuery(submitButton).css('display', 'inline');
    nextQuery(disabledButton).css('display', 'none');
}

function isImage(imageURL)
{
    if (isWhitespace(imageURL))
        return false;
    var dotPos = imageURL.lastIndexOf(".");
    var extension = imageURL.slice(dotPos + 1).toLowerCase();
    if (dotPos == -1)
        return false;
    else if (extension == "gif" || extension == "jpg" || extension == "jpe" || extension == "jpeg" || extension == "png")
        return true;
    else
        return false;
}

function allImagesLoaded()
{
    for (var i = 0; i < document.images.length; i++)
    {
        if (isImage(document.images[i].href) && !document.images[i].complete)
            return false;
    }
    return true;
}
function setSelectValueByAbbreviation(FSelectBox,FValue)
{
if (isWhitespace(FValue))
    FSelectBox.selectedIndex = 0;
else
{
    selectValueFound = false;
    for (Fi=0; Fi < FSelectBox.length; Fi++)
    {
        if (Left(trim(FSelectBox.options[Fi].value.toString()),2) == FValue)
	    {
            FSelectBox.selectedIndex = Fi;
		    selectValueFound = true;
		    break;
	    }
    }
}
return selectValueFound;
}

function addToFavorites(FURL,FName)
{
userBrowser = browserName();
switch(userBrowser)
{
	case "IE":
		window.external.AddFavorite(FURL,FName);
		break;
	case "Firefox":
		window.sidebar.addPanel(FName,FURL,"");
		break;
	default:
		alert("I'm sorry ...\n\n" + userBrowser + " does not support this functionality.");
		break;
}
}

function removeFilter(domElement)
{
if (domElement.style.filter && domElement.style.removeAttribute)
    domElement.style.removeAttribute("filter");
}

function manualCartPostBack()
{
    var hdnManualCartPostBack = $get(cartServerVars.ManualCartPostBackID);
    hdnManualCartPostBack.value = "1";
    __doPostBack(cartServerVars.ManualCartPostBackID, "ValueChanged");
}

var smsDeliveryDates = null;
function addDeliveryDates(shippingMethodSelectClientID, shippingMethodID, surcharge, deliveryDates)
{
    if (!smsDeliveryDates)
        smsDeliveryDates = new Array();
    if (!smsDeliveryDates[shippingMethodSelectClientID])
        smsDeliveryDates[shippingMethodSelectClientID] = new Array();
    smsDeliveryDates[shippingMethodSelectClientID][shippingMethodID] = { SaturdaySurcharge: surcharge, Dates: deliveryDates };
}

//This function just returns the DeliveryDates object from smsDeliveryDates array but checks to see if it's defined before
//returning it to avoid possible errors
function getDeliveryDatesObject(shippingMethodSelectClientID, shippingMethodID)
{
    if (smsDeliveryDates && smsDeliveryDates[shippingMethodSelectClientID] && smsDeliveryDates[shippingMethodSelectClientID][shippingMethodID])
    {
        //returned object has the following properties: { SaturdaySurcharge: surcharge, Dates: deliveryDates }
        return smsDeliveryDates[shippingMethodSelectClientID][shippingMethodID];
    }
    else
    {
        return null;
    }
}

function formatDate(dateValue)
{
    var month = dateValue.getMonth() + 1;
    if (month < 9)
    {
        month = "0" + month; 
    }
    var day = dateValue.getDate();
    if (day < 9)
    {
        day = "0" + day; 
    }
    return month + "-" + day + "-" + dateValue.getFullYear();
}

function getDateDay(dateValue)
{
    var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
    return days[dateValue.getDay()];
}

function getDateMonth(dateValue)
{
    var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    return months[dateValue.getMonth()];
}

function loadPreferredDeliveryDates(shippingMethodSelectClientID, preferredDeliveryDateDropDownClientID, inputFieldID, buttonImagePath, noPreferrenceLabel, selectedDate, preferredRequired)
{
    if (!smsDeliveryDates)
        return;
    var shippingMethodDropDown = nextQuery('#' + shippingMethodSelectClientID);
    var preferredDeliveryDateDropDown = $get(preferredDeliveryDateDropDownClientID);
    var preferredDates = getDeliveryDatesObject(shippingMethodSelectClientID, shippingMethodDropDown.val());
    var messageDates = [];

    if (!preferredDates || !preferredDates.Dates)
        return;

    if (preferredDates.Dates.length == 0)
    {
        nextQuery('#' + preferredDeliveryDateDropDownClientID).parents('tr:first').css('display', 'none');
    }
    else
    {
        nextQuery('#' + preferredDeliveryDateDropDownClientID).parents('tr:first').css('display', '');
    }

    preferredDeliveryDateDropDown.length = 0; //clear options
    if (!preferredRequired && noPreferrenceLabel && noPreferrenceLabel != '')
    {
        var firstOpt = document.createElement('option');
        firstOpt.text = noPreferrenceLabel;
        firstOpt.value = '';
        try
        {
            preferredDeliveryDateDropDown.add(firstOpt, null);
        }
        catch (ex)
        {
            preferredDeliveryDateDropDown.add(firstOpt);
        }
    }
    
    var messageDatesIndex = 0;
    for (index = 0; index < preferredDates.Dates.length; index++)
    {
        var opt = document.createElement('option');
        try
        {
            var dateValue = preferredDates.Dates[index];
            var text = getDateMonth(dateValue) + " " + dateValue.getDate() + ", " + dateValue.getFullYear() + " (" + getDateDay(dateValue);
            if (dateValue.getDay() == 6 && preferredDates.SaturdaySurcharge != "")
            {
                text += ", " + preferredDates.SaturdaySurcharge + " surcharge";
                messageDates[messageDatesIndex] = { Date: dateValue, Message: preferredDates.SaturdaySurcharge + " surcharge" };
                messageDatesIndex++;
            }
            text += ")";
            opt.text = text;
            opt.value = formatDate(dateValue);
        }
        catch (dateEx)
        {
            continue;
        }
        if (opt.value == null || opt.value == '')
        {
            continue;
        }
        try
        {
            preferredDeliveryDateDropDown.add(opt, null);
        }
        catch(ex)
        {
            preferredDeliveryDateDropDown.add(opt);
        }
    }
    var firstDate = nextQuery(preferredDeliveryDateDropDown).val();
    nextQuery('#' + inputFieldID).val(firstDate);
    nextQuery('#' + inputFieldID).datepicker('destroy');
    setupCalendarDropDown(inputFieldID, preferredDeliveryDateDropDownClientID, preferredDates.Dates, messageDates, buttonImagePath);

    if (Date.parse(selectedDate) > 0)
    {
        var dateToSet = new Date(selectedDate);
        nextQuery('#' + preferredDeliveryDateDropDownClientID).val(dateToSet.format("M-d-yyyy"));
        nextQuery('#' + inputFieldID).val(nextQuery('#' + preferredDeliveryDateDropDownClientID).val());
    }
}

function setHeightCSSAll()
{
    var indexCount = 0;
    while (eval("masterServerVars.MainCellClientID" + indexCount))
        indexCount++;
    for (var index = indexCount - 1; index >= 0; index--)
    {
        var checkingPadding = false;
        if (index == 0)
            checkingPadding = true;
        setHeightCSS($get(eval("masterServerVars.MainCellClientID" + index)));
    }
}

function setHeightUntilImagesLoaded()
{
    var intervalID = setInterval(function()
    {
        setHeightCSSAll();
        if (allImagesLoaded())
            clearInterval(intervalID);
    }, 1000);
}

function clearHeightCSSAll()
{
    var index = 0;
    while (eval("masterServerVars.MainCellClientID" + index))
    {
        clearHeightCSS($get(eval("masterServerVars.MainCellClientID" + index)));
        index++;
    }
}

function clearHeightCSS(element)
{
    if (element && nextQuery.browser.msie)
        nextQuery(element).css("height", null);
}

function setHeightCSS(element)
{
    var pageRequestInstance = Sys.WebForms.PageRequestManager.getInstance();
    if (element)
    {
        if (nextQuery.browser.msie)
        {
            var setHeight = function()
            {
                var elementHeight = element.scrollHeight;
                if (parseInt(nextQuery.browser.version) <= 7)
                    elementHeight = element.offsetHeight + 5;
                var pixelPattern = /^\d+px$/;
                var paddingTop = element.currentStyle.paddingTop;
                if (paddingTop.match(pixelPattern) && parseInt(paddingTop) > 1)
                    elementHeight -= parseInt(paddingTop);
                var paddingBottom = element.currentStyle.paddingBottom;
                if (paddingBottom.match(pixelPattern) && parseInt(paddingBottom) > 1)
                    elementHeight -= parseInt(paddingBottom);
                nextQuery(element).css("height", elementHeight); //set to pixel value
            }
            //If it's in the middle of an async postback then we want to wait
            if (pageRequestInstance.get_isInAsyncPostBack())
            {
                //Wait until the async postback is complete and then set the height
                var intervalID = setInterval(function()
                {
                    if (!pageRequestInstance.get_isInAsyncPostBack())
                    {
                        clearInterval(intervalID);
                        setHeight();
                    }
                }, 250);
            }
            else //if it's ready to fire right away then call it
                setHeight();
        }
        else
        {
            nextQuery(element).css("height", "100%");
        }
    }
}

function refreshWithPopup(url, millisecondsNoPopup, millisecondsWithPopup)
{
    setTimeout(function() { executeRefreshWithPopup(url, millisecondsNoPopup, millisecondsWithPopup); }, 500);
}

function executeRefreshWithPopup(url, millisecondsNoPopup, millisecondsWithPopup)
{
    if (popupShown())
        setTimeout("window.location.href=\"" + url + "\";", millisecondsWithPopup);
    else
    {
        if (millisecondsNoPopup == 0)
            window.location.href = url;
        else
            setTimeout("window.location.href=\"" + url + "\";", millisecondsNoPopup);
    }
}

function popupShown()
{
    if (!(cartServerVars.ErrorPopupID == null || $get(cartServerVars.ErrorPopupID) == null))
    {
        if ($get(cartServerVars.ErrorPopupID).style.display != "none")
            return true;
    }
    if (!(cartServerVars.CouponPopupID == null || $get(cartServerVars.CouponPopupID) == null))
    {
        if ($get(cartServerVars.CouponPopupID).style.display != "none")
            return true;
    }
    return false;
}

//Used to start and stop the page redirection on the order confirmation screen
var doStopRedirect = false;
function startRedirect(url, delaytime)
{
    doStopRedirect = false;
    setTimeout(function()
    {
        if (!doStopRedirect)
        {
            window.location.href = url;
        }
    }, delaytime);
}
function stopRedirect()
{
    doStopRedirect = true;
}

function getMainImage()
{
if ($get(productImageServerVars.MainImageLarge) == null)
    return $get(productImageServerVars.MainImageMain);
else
    return $get(productImageServerVars.MainImageLarge);
}

function atcClicked(productID, productIndex, shipToIndex)
{
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm.get_isInAsyncPostBack())
        var listener = setInterval(function() { if (!prm.get_isInAsyncPostBack()) { clearInterval(listener); addToCart(productID,productIndex,shipToIndex,"",true); } }, 250);
    else
        addToCart(productID,productIndex,shipToIndex,"",true);
}

function addToCart(productID,productIndex,shipToIndex,newShipTo,checkInventory)
{
if (isWhitespace(productIndex) && attributeServerVars.SKUID != null)
{
    var addToCartSKUID = $get(attributeServerVars.SKUID);
    if (addToCartSKUID != null)
    {
        var SKUInventory = $get(attributeServerVars.SKUInventory).value;
        if (isWhitespace(addToCartSKUID.value) || parseInt(SKUInventory) <= 0)
        {
            var attributesSelected = "";
            for (var index = 0; eval("attributeServerVars.Attribute" + index) != null; index++)
            {
                if (index != 0)
                    attributesSelected += ", ";
                attributesSelected += selectText($get(eval("attributeServerVars.Attribute" + index)));
            }
            if (checkInventory)
            {
                var attributeLead;
                if (index == 1)
	                attributeLead = "The attribute you have chosen for this product";
                else
	                attributeLead = "The combination of attributes you have chosen";
	            attributeLead += " (" + attributesSelected + ") ";
    		    
	            var depletionStatus = attributeServerVars.DepletionStatus;
	            var alertText = "";
	            var confirmText = "";
	            if (isWhitespace(addToCartSKUID.value))
	                alertText = "is not available";
	            else if (depletionStatus == "Discontinued")
	                alertText = "has been discontinued";
	            else if (depletionStatus == "Sold Out")
	                alertText = "is currently " + cartServerVars.SoldOut.toLowerCase();
	            else if (depletionStatus == "Backordered")
	                confirmText = "is currently " + cartServerVars.BackorderCart.toLowerCase();
	            else if (depletionStatus == "Preordered")
	                confirmText = "is currently " + cartServerVars.PreorderCart.toLowerCase();
                if (!isWhitespace(alertText))
                {
	                alert(attributeLead + alertText + ".\n\nPlease make another selection.  Thank you.");
	                return;
                }
                else if (!isWhitespace(confirmText))
                {
                    if (!confirm(attributeLead + confirmText + ".\n\nWould you still like to add this item to your " + cartServerVars.ShoppingCart.toLowerCase() + "?"))
		                return;
                }
            }
        }
        $get(cartServerVars.SKUID).value = addToCartSKUID.value;
    }
}
if (isWhitespace(productIndex) && attributeServerVars.WriteInID0 != null)
{
    var writeInIDs = "";
    var writeInValues = "";
    var firstWriteIn = true;
    for (var index = 0; eval("attributeServerVars.WriteInID" + index) != null; index++)
    {
        var addToCartWriteInValue = $get(eval("attributeServerVars.WriteInValue" + index));
        var curWriteInValue;
        if (addToCartWriteInValue.type == "checkbox")
        {
            if (addToCartWriteInValue.checked == true)
                curWriteInValue = "Yes";
            else
                curWriteInValue = "No";
        }
        else
            curWriteInValue = addToCartWriteInValue.value;
        if (!isWhitespace(curWriteInValue))
        {
            if (firstWriteIn)
                firstWriteIn = false;
            else
            {
                writeInIDs += masterServerVars.Delimiter;
                writeInValues += masterServerVars.Delimiter;
            }
            writeInIDs += eval("attributeServerVars.WriteInID" + index);
            writeInValues += curWriteInValue;
        }
    }
    $get(cartServerVars.WriteInIDs).value = writeInIDs;
    $get(cartServerVars.WriteInValues).value = writeInValues;
}
if (isWhitespace(shipToIndex) && isWhitespace(newShipTo))
{
    $find("mpeEnterShipTo" + productIndex).show();
    return;
}
else if (!isWhitespace(newShipTo))
    $get(cartServerVars.NewShipTo).value = newShipTo;
else if (!isWhitespace(shipToIndex))
  $get(cartServerVars.ShipTo).value = shipToIndex;

var quantityTextBox = $get(eval("addToCart" + productIndex + "ServerVars.Quantity"));
$get(cartServerVars.Quantity).value = quantityTextBox.value;
if (masterServerVars.ResetQuantity == "true")
    quantityTextBox.value = quantityTextBox.defaultValue;
$get(cartServerVars.ProductID).value = productID;
if (eval("addToCart" + productIndex + "ServerVars.BidPrice") != null)
    $get(cartServerVars.BidPrice).value = $get(eval("addToCart" + productIndex + "ServerVars.BidPrice")).value;

if (isInteger(shipToIndex,true))
{
    try
    {
        setSelectValue($get(addToCartServerVars.ShipTo), shipToIndex);
    }
    catch(err)
    {
    }
    var atcServerVars;
    var continueFor = true;
    try
    {
        atcServerVars = addToCart0ServerVars;
    }
    catch(err)
    {
        continueFor = false;
    }
    var index = 0;
    while (continueFor)
    {
        if (eval("addToCart" + index + "ServerVars.ShipTo") != null && $get(eval("addToCart" + index + "ServerVars.ShipTo")) != null)
            setSelectValue($get(eval("addToCart" + index + "ServerVars.ShipTo")),shipToIndex);
        index++;
        try
        {
            atcServerVars = eval("addToCart" + index + "ServerVars");
        }
        catch(err)
        {
            continueFor = false;
        }
    }
}

__doPostBack(cartServerVars.ProductID, "ValueChanged");
}

function addToCartNewShipTo(productID, productIndex)
{
var newShipToName = $get(eval("newShipTo" + productIndex + "ServerVars.Name")).value;
$get(eval("newShipTo" + productIndex + "ServerVars.Name")).value = "";
if (eval("newShipTo" + productIndex + "ServerVars.GiftMessageCheckbox") != null && $get(eval("newShipTo" + productIndex + "ServerVars.GiftMessageCheckbox")).checked == true)
{
    $get(cartServerVars.GiftMessage).value = $get(eval("newShipTo" + productIndex + "ServerVars.GiftMessage")).value;
    $get(eval("newShipTo" + productIndex + "ServerVars.GiftMessageCheckbox")).checked = false;
    $get(eval("newShipTo" + productIndex + "ServerVars.GiftMessage")).value = "";
}
if (eval("newShipTo" + productIndex + "ServerVars.GiftWrapCheckbox") != null && $get(eval("newShipTo" + productIndex + "ServerVars.GiftWrapCheckbox")).checked == true)
{
    $get(cartServerVars.GiftWrap).value = "True";
    $get(eval("newShipTo" + productIndex + "ServerVars.GiftWrapCheckbox")).checked == false;
}
    
var shipToPrototype = $get(eval("addToCart" + productIndex + "ServerVars.ShipTo"));
var newShipToIndex = 1;
var newShipToPosition = 1;
if (masterServerVars.AddNewPosition == "first")
    newShipToPosition = 2;
while (newShipToPosition < shipToPrototype.length && !isWhitespace(shipToPrototype.options[newShipToPosition].value))
{
    if (masterServerVars.AddressOrder == "alpha" && newShipToName < shipToPrototype.options[newShipToPosition].text)
        break;
    newShipToIndex++;
    newShipToPosition++;
}

try
{
    addNewShipTo($get(addToCartServerVars.ShipTo),newShipToIndex,newShipToPosition,newShipToName);
}
catch(err)
{
}
var atcServerVars;
var continueFor = true;
try
{
    atcServerVars = addToCart0ServerVars;
}
catch(err)
{
    continueFor = false;
}
var index = 0;
while (continueFor)
{
    if (eval("addToCart" + index + "ServerVars.ShipTo") != null && $get(eval("addToCart" + index + "ServerVars.ShipTo")) != null)
        addNewShipTo($get(eval("addToCart" + index + "ServerVars.ShipTo")),newShipToIndex,newShipToPosition,newShipToName);
    index++;
    try
    {
        atcServerVars = eval("addToCart" + index + "ServerVars");
    }
    catch(err)
    {
        continueFor = false;
    }
}

addToCart(productID, productIndex, newShipToIndex, newShipToName, false);
}

function addNewShipTo(shipToSelectBox,newShipToIndex,newShipToPosition,newShipToName)
{
shipToSelectBox.length +=  1;
for (var index = shipToSelectBox.length - 1; index > newShipToPosition; index--)
{
    shipToSelectBox.options[index].text = shipToSelectBox.options[index - 1].text;
    if (isWhitespace(shipToSelectBox.options[index - 1].value))
        shipToSelectBox.options[index].value = shipToSelectBox.options[index - 1].value;
	else
    	shipToSelectBox.options[index].value = parseInt(shipToSelectBox.options[index-1].value) + 1;
}
shipToSelectBox.options[newShipToPosition].value = newShipToIndex;
shipToSelectBox.options[newShipToPosition].text = newShipToName;
}

function simpleATCClicked(productID)
{
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm.get_isInAsyncPostBack())
        var listener = setInterval(function () { if (!prm.get_isInAsyncPostBack()) { clearInterval(listener); addToCartSimple(productID); } }, 250);
    else
        addToCartSimple(productID);
}

function addToCartSimple(productID)
{
    $get(cartServerVars.ProductID).value = productID;
    __doPostBack(cartServerVars.ProductID, "ValueChanged");
}
function cartScrollTo_isUpdatePanelPostBack()
{
    if (cartScrollTo_postBackElementID && $get(cartServerVars.CartUpdatePanelID) && recursiveFind($get(cartServerVars.CartUpdatePanelID), cartScrollTo_postBackElementID))
        return true;
    else
        return false;
}
function cartScrollTo_beginRequest(sender, args)
{
    try
    {
        if (!Page_ClientValidate("CartLineItem"))
            return;
        cartScrollTo_postBackElementID = args.get_postBackElement().id;
        if (cartScrollTo_isUpdatePanelPostBack() && viewport.isOutsideViewPort($get('spnScrollTarget')))
        {
            var target = nextQuery('#spnScrollTarget');
            var position = target.position();
            window.scrollTo(position.left, position.top);
        }
        cartScrollTo_postBackElementID = null;
    }
    catch (err)
    {
    }
}

function editQuantityBlur(txtEditQuantity, editQuantityCellID, displayQuantityCellID, editQuantityButtonCellID, productIndex)
{
    if (Page_ClientValidate("CartLineItem"))
    {
        if (txtEditQuantity.value == txtEditQuantity.defaultValue || txtEditQuantity.value == "")
        {
            if (txtEditQuantity.value == "")
                txtEditQuantity.value = txtEditQuantity.defaultValue;
            var editQuantityCell = document.getElementById(editQuantityCellID);
            var displayQuantityCell = document.getElementById(displayQuantityCellID);
            var editQuantityButtonCell = document.getElementById(editQuantityButtonCellID);

            displayQuantityCell.style.display = masterServerVars.TableCellDisplay;
            editQuantityButtonCell.style.display = masterServerVars.TableCellDisplay;
            editQuantityCell.style.display = "none";
        }
        else if (txtEditQuantity.value == 0)
        {
            if (confirm("A quantity of 0 will cause the product to be removed from the cart.\nAre you sure you would like to do this?"))
            {
                txtEditQuantity.disabled = true;
                removeCartProduct(productIndex); //causes postback
            }
            else
            {
                txtEditQuantity.value = txtEditQuantity.defaultValue;
                txtEditQuantity.focus();
            }
        }
        else
        {
            txtEditQuantity.disabled = true;
            editLineItemQuantity(productIndex, txtEditQuantity.value); //causes postback
        }
    }
}

function editLineItemQuantity(productIndex, newValue)
{
    $get(cartServerVars.EditQuantityNewValueID).value = newValue;
    $get(cartServerVars.EditQuantityCartProductIndexID).value = productIndex;
    __doPostBack(cartServerVars.EditQuantityCartProductIndexID, "ValueChanged");
}

function removeCartProduct(productIndex)
{
    $get(cartServerVars.RemoveCartProductIndexID).value = productIndex;
    __doPostBack(cartServerVars.RemoveCartProductIndexID, "ValueChanged");
}

function editQuantitySenseEnterKey(evt, txtEditQuantity)
{
    evt = (evt) ? evt : ((event) ? event : null);
    var evver = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
    var keynumber = evt.keyCode;
    if (keynumber == 13)
    {
        txtEditQuantity.blur();
    }
}

function showEdit(editQuantityCellID, displayQuantityCellID, editQuantityButtonCellID, editQuantityTextboxID)
{
    if (Page_ClientValidate("CartLineItem"))
    {
        var editQuantityCell = document.getElementById(editQuantityCellID);
        var displayQuantityCell = document.getElementById(displayQuantityCellID);
        var editQuantityButtonCell = document.getElementById(editQuantityButtonCellID);
        var editQuantityTextbox = document.getElementById(editQuantityTextboxID);

        displayQuantityCell.style.display = "none";
        editQuantityButtonCell.style.display = "none";
        editQuantityCell.style.display = masterServerVars.TableCellDisplay;
        editQuantityTextbox.focus();
    }
}
/*
 * jQuery UI Datepicker
 *
 * Copyright (c) 2006, 2007, 2008 Marc Grabanski
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 * 
 * http://docs.jquery.com/UI/Datepicker
 *
 * Depends:
 *	ui.core.js
 *
 * Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au).
 */
   
(function($) { // hide the namespace

var PROP_NAME = 'datepicker';

/* Date picker manager.
   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
   Settings for (groups of) date pickers are maintained in an instance object,
   allowing multiple different settings on the same page. */

function Datepicker() {
	this.debug = false; // Change this to true to start debugging
	this._curInst = null; // The current instance in use
	this._disabledInputs = []; // List of date picker inputs that have been disabled
	this._datepickerShowing = false; // True if the popup picker is showing , false if not
	this._inDialog = false; // True if showing within a "dialog", false if not
	this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
	this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
	this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
	this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
	this._promptClass = 'ui-datepicker-prompt'; // The name of the dialog prompt marker class
	this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
	this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
	this.regional = []; // Available regional settings, indexed by language code
	this.regional[''] = { // Default regional settings
		clearText: 'Clear', // Display text for clear link
		clearStatus: 'Erase the current date', // Status text for clear link
		closeText: 'Close', // Display text for close link
		closeStatus: 'Close without change', // Status text for close link
		prevText: '&#x3c;Prev', // Display text for previous month link
		prevStatus: 'Show the previous month', // Status text for previous month link
		nextText: 'Next&#x3e;', // Display text for next month link
		nextStatus: 'Show the next month', // Status text for next month link
		currentText: 'Today', // Display text for current month link
		currentStatus: 'Show the current month', // Status text for current month link
		monthNames: ['January','February','March','April','May','June',
			'July','August','September','October','November','December'], // Names of months for drop-down and formatting
		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
		monthStatus: 'Show a different month', // Status text for selecting a month
		yearStatus: 'Show a different year', // Status text for selecting a year
		weekHeader: 'Wk', // Header for the week of the year column
		weekStatus: 'Week of the year', // Status text for the week of the year column
		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
		dayStatus: 'Set DD as first week day', // Status text for the day of the week selection
		dateStatus: 'Select DD, M d', // Status text for the date selection
		dateFormat: 'mm/dd/yy', // See format options on parseDate
		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
		initStatus: 'Select a date', // Initial Status text on opening
		isRTL: false // True if right-to-left language, false if left-to-right
	};
	this._defaults = { // Global defaults for all the date picker instances
		showOn: 'focus', // 'focus' for popup on focus,
			// 'button' for trigger button, or 'both' for either
		showAnim: 'show', // Name of jQuery animation for popup
		showOptions: {}, // Options for enhanced animations
		defaultDate: null, // Used when field is blank: actual date,
			// +/-number for offset from today, null for today
		appendText: '', // Display text following the input box, e.g. showing the format
		buttonText: '...', // Text for trigger button
		buttonImage: '', // URL for trigger button image
		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
		closeAtTop: true, // True to have the clear/close at the top,
			// false to have them at the bottom
		mandatory: false, // True to hide the Clear link, false to include it
		hideIfNoPrevNext: false, // True to hide next/previous month links
			// if not applicable, false to just disable them
		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
		gotoCurrent: false, // True if today link goes back to current selection instead
		changeMonth: true, // True if month can be selected directly, false if only prev/next
		changeYear: true, // True if year can be selected directly, false if only prev/next
		yearRange: '-10:+10', // Range of years to display in drop-down,
			// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
		changeFirstDay: true, // True to click on day name to change, false to remain as set
		highlightWeek: false, // True to highlight the selected week
		showOtherMonths: false, // True to show dates in other months, false to leave blank
		showWeeks: false, // True to show week of the year, false to omit
		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
			// takes a Date and returns the number of the week for it
		shortYearCutoff: '+10', // Short year values < this are in the current century,
			// > this are in the previous century, 
			// string value starting with '+' for current year + value
		showStatus: false, // True to show status bar at bottom, false to not show it
		statusForDate: this.dateStatus, // Function to provide status text for a date -
			// takes date and instance as parameters, returns display text
		minDate: null, // The earliest selectable date, or null for no limit
		maxDate: null, // The latest selectable date, or null for no limit
		duration: 'normal', // Duration of display/closure
		beforeShowDay: null, // Function that takes a date and returns an array with
			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', 
			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
		beforeShow: null, // Function that takes an input field and
			// returns a set of custom settings for the date picker
		onSelect: null, // Define a callback function when a date is selected
		onChangeMonthYear: null, // Define a callback function when the month or year is changed
		onClose: null, // Define a callback function when the datepicker is closed
		numberOfMonths: 1, // Number of months to show at a time
		stepMonths: 1, // Number of months to step back/forward
		rangeSelect: false, // Allows for selecting a date range on one date picker
		rangeSeparator: ' - ', // Text between two dates in a range
		altField: '', // Selector for an alternate field to store selected dates into
		altFormat: '' // The date format to use for the alternate field
	};
	$.extend(this._defaults, this.regional['']);
	this.dpDiv = $('<div id="' + this._mainDivId + '" style="display: none;"></div>');
}

$.extend(Datepicker.prototype, {
	/* Class name added to elements to indicate already configured with a date picker. */
	markerClassName: 'hasDatepicker',

	/* Debug logging (if enabled). */
	log: function () {
		if (this.debug)
			console.log.apply('', arguments);
	},
	
	/* Override the default settings for all instances of the date picker. 
	   @param  settings  object - the new settings to use as defaults (anonymous object)
	   @return the manager object */
	setDefaults: function(settings) {
		extendRemove(this._defaults, settings || {});
		return this;
	},

	/* Attach the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span
	   @param  settings  object - the new settings to use for this date picker instance (anonymous) */
	_attachDatepicker: function(target, settings) {
		// check for settings on the control itself - in namespace 'date:'
		var inlineSettings = null;
		for (attrName in this._defaults) {
			var attrValue = target.getAttribute('date:' + attrName);
			if (attrValue) {
				inlineSettings = inlineSettings || {};
				try {
					inlineSettings[attrName] = eval(attrValue);
				} catch (err) {
					inlineSettings[attrName] = attrValue;
				}
			}
		}
		var nodeName = target.nodeName.toLowerCase();
		var inline = (nodeName == 'div' || nodeName == 'span');
		if (!target.id)
			target.id = 'dp' + new Date().getTime();
		var inst = this._newInst($(target), inline);
		inst.settings = $.extend({}, settings || {}, inlineSettings || {}); 
		if (nodeName == 'input') {
			this._connectDatepicker(target, inst);
		} else if (inline) {
			this._inlineDatepicker(target, inst);
		}
	},

	/* Create a new instance object. */
	_newInst: function(target, inline) {
		return {id: target[0].id, input: target, // associated target
			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
			drawMonth: 0, drawYear: 0, // month being drawn
			inline: inline, // is datepicker inline or not
			dpDiv: (!inline ? this.dpDiv : // presentation div
			$('<div class="ui-datepicker-inline"></div>'))};
	},

	/* Attach the date picker to an input field. */
	_connectDatepicker: function(target, inst) {
		var input = $(target);
		if (input.hasClass(this.markerClassName))
			return;
		var appendText = this._get(inst, 'appendText');
		var isRTL = this._get(inst, 'isRTL');
		if (appendText)
			input[isRTL ? 'before' : 'after']('<span class="' + this._appendClass + '">' + appendText + '</span>');
		var showOn = this._get(inst, 'showOn');
		if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
			input.focus(this._showDatepicker);
		if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
			var buttonText = this._get(inst, 'buttonText');
			var buttonImage = this._get(inst, 'buttonImage');
			var trigger = $(this._get(inst, 'buttonImageOnly') ? 
				$('<img/>').addClass(this._triggerClass).
					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
				$('<button type="button"></button>').addClass(this._triggerClass).
					html(buttonImage == '' ? buttonText : $('<img/>').attr(
					{ src:buttonImage, alt:buttonText, title:buttonText })));
			input[isRTL ? 'before' : 'after'](trigger);
			trigger.click(function() {
				if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
					$.datepicker._hideDatepicker();
				else
					$.datepicker._showDatepicker(target);
				return false;
			});
		}
		input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).
			bind("setData.datepicker", function(event, key, value) {
				inst.settings[key] = value;
			}).bind("getData.datepicker", function(event, key) {
				return this._get(inst, key);
			});
		$.data(target, PROP_NAME, inst);
	},

	/* Attach an inline date picker to a div. */
	_inlineDatepicker: function(target, inst) {
		var input = $(target);
		if (input.hasClass(this.markerClassName))
			return;
		input.addClass(this.markerClassName).append(inst.dpDiv).
			bind("setData.datepicker", function(event, key, value){
				inst.settings[key] = value;
			}).bind("getData.datepicker", function(event, key){
				return this._get(inst, key);
			});
		$.data(target, PROP_NAME, inst);
		this._setDate(inst, this._getDefaultDate(inst));
		this._updateDatepicker(inst);
	},

	/* Tidy up after displaying the date picker. */
	_inlineShow: function(inst) {
		var numMonths = this._getNumberOfMonths(inst); // fix width for dynamic number of date pickers
		inst.dpDiv.width(numMonths[1] * $('.ui-datepicker', inst.dpDiv[0]).width());
	}, 

	/* Pop-up the date picker in a "dialog" box.
	   @param  input     element - ignored
	   @param  dateText  string - the initial date to display (in the current format)
	   @param  onSelect  function - the function(dateText) to call when a date is selected
	   @param  settings  object - update the dialog date picker instance's settings (anonymous object)
	   @param  pos       int[2] - coordinates for the dialog's position within the screen or
	                     event - with x/y coordinates or
	                     leave empty for default (screen centre)
	   @return the manager object */
	_dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
		var inst = this._dialogInst; // internal instance
		if (!inst) {
			var id = 'dp' + new Date().getTime();
			this._dialogInput = $('<input type="text" id="' + id +
				'" size="1" style="position: absolute; top: -100px;"/>');
			this._dialogInput.keydown(this._doKeyDown);
			$('body').append(this._dialogInput);
			inst = this._dialogInst = this._newInst(this._dialogInput, false);
			inst.settings = {};
			$.data(this._dialogInput[0], PROP_NAME, inst);
		}
		extendRemove(inst.settings, settings || {});
		this._dialogInput.val(dateText);

		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
		if (!this._pos) {
			var browserWidth = window.innerWidth || document.documentElement.clientWidth ||	document.body.clientWidth;
			var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
			var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
			var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
			this._pos = // should use actual width/height below
				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
		}

		// move input on screen for focus, but hidden behind dialog
		this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
		inst.settings.onSelect = onSelect;
		this._inDialog = true;
		this.dpDiv.addClass(this._dialogClass);
		this._showDatepicker(this._dialogInput[0]);
		if ($.blockUI)
			$.blockUI(this.dpDiv);
		$.data(this._dialogInput[0], PROP_NAME, inst);
		return this;
	},

	/* Detach a datepicker from its control.
	   @param  target    element - the target input field or division or span */
	_destroyDatepicker: function(target) {
		var nodeName = target.nodeName.toLowerCase();
		var $target = $(target);
		$.removeData(target, PROP_NAME);
		if (nodeName == 'input') {
			$target.siblings('.' + this._appendClass).remove().end().
				siblings('.' + this._triggerClass).remove().end().
				removeClass(this.markerClassName).
				unbind('focus', this._showDatepicker).
				unbind('keydown', this._doKeyDown).
				unbind('keypress', this._doKeyPress);
		} else if (nodeName == 'div' || nodeName == 'span')
			$target.removeClass(this.markerClassName).empty();
	},

	/* Enable the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span */
	_enableDatepicker: function(target) {
		target.disabled = false;
		$(target).siblings('button.' + this._triggerClass).each(function() { this.disabled = false; }).end().
			siblings('img.' + this._triggerClass).css({opacity: '1.0', cursor: ''});
		this._disabledInputs = $.map(this._disabledInputs,
			function(value) { return (value == target ? null : value); }); // delete entry
	},

	/* Disable the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span */
	_disableDatepicker: function(target) {
		target.disabled = true;
		$(target).siblings('button.' + this._triggerClass).each(function() { this.disabled = true; }).end().
			siblings('img.' + this._triggerClass).css({opacity: '0.5', cursor: 'default'});
		this._disabledInputs = $.map(this._disabledInputs,
			function(value) { return (value == target ? null : value); }); // delete entry
		this._disabledInputs[this._disabledInputs.length] = target;
	},

	/* Is the first field in a jQuery collection disabled as a datepicker?
	   @param  target    element - the target input field or division or span
	   @return boolean - true if disabled, false if enabled */
	_isDisabledDatepicker: function(target) {
		if (!target)
			return false;
		for (var i = 0; i < this._disabledInputs.length; i++) {
			if (this._disabledInputs[i] == target)
				return true;
		}
		return false;
	},

	/* Update the settings for a date picker attached to an input field or division.
	   @param  target  element - the target input field or division or span
	   @param  name    object - the new settings to update or
	                   string - the name of the setting to change or
	   @param  value   any - the new value for the setting (omit if above is an object) */
	_changeDatepicker: function(target, name, value) {
		var settings = name || {};
		if (typeof name == 'string') {
			settings = {};
			settings[name] = value;
		}
		if (inst = $.data(target, PROP_NAME)) {
			extendRemove(inst.settings, settings);
			this._updateDatepicker(inst);
		}
	},

	/* Set the dates for a jQuery selection.
	   @param  target   element - the target input field or division or span
	   @param  date     Date - the new date
	   @param  endDate  Date - the new end date for a range (optional) */
	_setDateDatepicker: function(target, date, endDate) {
		var inst = $.data(target, PROP_NAME);
		if (inst) {
			this._setDate(inst, date, endDate);
			this._updateDatepicker(inst);
		}
	},

	/* Get the date(s) for the first entry in a jQuery selection.
	   @param  target  element - the target input field or division or span
	   @return Date - the current date or
	           Date[2] - the current dates for a range */
	_getDateDatepicker: function(target) {
		var inst = $.data(target, PROP_NAME);
		if (inst)
			this._setDateFromField(inst); 
		return (inst ? this._getDate(inst) : null);
	},

	/* Handle keystrokes. */
	_doKeyDown: function(e) {
		var inst = $.data(e.target, PROP_NAME);
		var handled = true;
		if ($.datepicker._datepickerShowing)
			switch (e.keyCode) {
				case 9:  $.datepicker._hideDatepicker(null, '');
						break; // hide on tab out
				case 13: $.datepicker._selectDay(e.target, inst.selectedMonth, inst.selectedYear,
							$('td.ui-datepicker-days-cell-over', inst.dpDiv)[0]);
						return false; // don't submit the form
						break; // select the value on enter
				case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
						break; // hide on escape
				case 33: $.datepicker._adjustDate(e.target, (e.ctrlKey ? -1 :
							-$.datepicker._get(inst, 'stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
						break; // previous month/year on page up/+ ctrl
				case 34: $.datepicker._adjustDate(e.target, (e.ctrlKey ? +1 :
							+$.datepicker._get(inst, 'stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
						break; // next month/year on page down/+ ctrl
				case 35: if (e.ctrlKey) $.datepicker._clearDate(e.target);
						break; // clear on ctrl+end
				case 36: if (e.ctrlKey) $.datepicker._gotoToday(e.target);
						break; // current on ctrl+home
				case 37: if (e.ctrlKey) $.datepicker._adjustDate(e.target, -1, 'D');
						break; // -1 day on ctrl+left
				case 38: if (e.ctrlKey) $.datepicker._adjustDate(e.target, -7, 'D');
						break; // -1 week on ctrl+up
				case 39: if (e.ctrlKey) $.datepicker._adjustDate(e.target, +1, 'D');
						break; // +1 day on ctrl+right
				case 40: if (e.ctrlKey) $.datepicker._adjustDate(e.target, +7, 'D');
						break; // +1 week on ctrl+down
				default: handled = false;
			}
		else if (e.keyCode == 36 && e.ctrlKey) // display the date picker on ctrl+home
			$.datepicker._showDatepicker(this);
		else
			handled = false;
		if (handled) {
			e.preventDefault();
			e.stopPropagation();
		}
	},

	/* Filter entered characters - based on date format. */
	_doKeyPress: function(e) {
		var inst = $.data(e.target, PROP_NAME);
		var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
		var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode);
		return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
	},

	/* Pop-up the date picker for a given input field.
	   @param  input  element - the input field attached to the date picker or
	                  event - if triggered by focus */
	_showDatepicker: function(input) {
		input = input.target || input;
		if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
			input = $('input', input.parentNode)[0];
		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
			return;
		var inst = $.data(input, PROP_NAME);
		var beforeShow = $.datepicker._get(inst, 'beforeShow');
		extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
		$.datepicker._hideDatepicker(null, '');
		$.datepicker._lastInput = input;
		$.datepicker._setDateFromField(inst);
		if ($.datepicker._inDialog) // hide cursor
			input.value = '';
		if (!$.datepicker._pos) { // position below input
			$.datepicker._pos = $.datepicker._findPos(input);
			$.datepicker._pos[1] += input.offsetHeight; // add the height
		}
		var isFixed = false;
		$(input).parents().each(function() {
			isFixed |= $(this).css('position') == 'fixed';
			return !isFixed;
		});
		if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
			$.datepicker._pos[0] -= document.documentElement.scrollLeft;
			$.datepicker._pos[1] -= document.documentElement.scrollTop;
		}
		var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
		$.datepicker._pos = null;
		inst.rangeStart = null;
		// determine sizing offscreen
		inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
		$.datepicker._updateDatepicker(inst);
		// fix width for dynamic number of date pickers
		inst.dpDiv.width($.datepicker._getNumberOfMonths(inst)[1] *
			$('.ui-datepicker', inst.dpDiv[0])[0].offsetWidth);
		// and adjust position before showing
		offset = $.datepicker._checkOffset(inst, offset, isFixed);
		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
			'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
			left: offset.left + 'px', top: offset.top + 'px'});
		if (!inst.inline) {
			var showAnim = $.datepicker._get(inst, 'showAnim') || 'show';
			var duration = $.datepicker._get(inst, 'duration');
			var postProcess = function() {
				$.datepicker._datepickerShowing = true;
				if ($.browser.msie && parseInt($.browser.version) < 7) // fix IE < 7 select problems
					$('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4,
						height: inst.dpDiv.height() + 4});
			};
			if ($.effects && $.effects[showAnim])
				inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
			else
				inst.dpDiv[showAnim](duration, postProcess);
			if (duration == '')
				postProcess();
			if (inst.input[0].type != 'hidden')
				inst.input[0].focus();
			$.datepicker._curInst = inst;
		}
	},

	/* Generate the date picker content. */
	_updateDatepicker: function(inst) {
		var dims = {width: inst.dpDiv.width() + 4,
			height: inst.dpDiv.height() + 4};
		inst.dpDiv.empty().append(this._generateDatepicker(inst)).
			find('iframe.ui-datepicker-cover').
			css({width: dims.width, height: dims.height});
		var numMonths = this._getNumberOfMonths(inst);
		inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
			'Class']('ui-datepicker-multi');
		inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
			'Class']('ui-datepicker-rtl');
		if (inst.input && inst.input[0].type != 'hidden')
			$(inst.input[0]).focus();
	},

	/* Check positioning to remain on screen. */
	_checkOffset: function(inst, offset, isFixed) {
		var pos = inst.input ? this._findPos(inst.input[0]) : null;
		var browserWidth = window.innerWidth || document.documentElement.clientWidth;
		var browserHeight = window.innerHeight || document.documentElement.clientHeight;
		var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
		var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
		// reposition date picker horizontally if outside the browser window
		if (this._get(inst, 'isRTL') || (offset.left + inst.dpDiv.width() - scrollX) > browserWidth)
			offset.left = Math.max((isFixed ? 0 : scrollX),
				pos[0] + (inst.input ? inst.input.width() : 0) - (isFixed ? scrollX : 0) - inst.dpDiv.width() -
				(isFixed && $.browser.opera ? document.documentElement.scrollLeft : 0));
		else
			offset.left -= (isFixed ? scrollX : 0);
		// reposition date picker vertically if outside the browser window
		if ((offset.top + inst.dpDiv.height() - scrollY) > browserHeight)
			offset.top = Math.max((isFixed ? 0 : scrollY),
				pos[1] - (isFixed ? scrollY : 0) - (this._inDialog ? 0 : inst.dpDiv.height()) -
				(isFixed && $.browser.opera ? document.documentElement.scrollTop : 0));
		else
			offset.top -= (isFixed ? scrollY : 0);
		return offset;
	},
	
	/* Find an object's position on the screen. */
	_findPos: function(obj) {
        while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
            obj = obj.nextSibling;
        }
        var position = $(obj).offset();
	    return [position.left, position.top];
	},

	/* Hide the date picker from view.
	   @param  input  element - the input field attached to the date picker
	   @param  duration  string - the duration over which to close the date picker */
	_hideDatepicker: function(input, duration) {
		var inst = this._curInst;
		if (!inst)
			return;
		var rangeSelect = this._get(inst, 'rangeSelect');
		if (rangeSelect && this._stayOpen)
			this._selectDate('#' + inst.id, this._formatDate(inst,
				inst.currentDay, inst.currentMonth, inst.currentYear));
		this._stayOpen = false;
		if (this._datepickerShowing) {
			duration = (duration != null ? duration : this._get(inst, 'duration'));
			var showAnim = this._get(inst, 'showAnim');
			var postProcess = function() {
				$.datepicker._tidyDialog(inst);
			};
			if (duration != '' && $.effects && $.effects[showAnim])
				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'),
					duration, postProcess);
			else
				inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' :
					(showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess);
			if (duration == '')
				this._tidyDialog(inst);
			var onClose = this._get(inst, 'onClose');
			if (onClose)
				onClose.apply((inst.input ? inst.input[0] : null),
					[this._getDate(inst), inst]);  // trigger custom callback
			this._datepickerShowing = false;
			this._lastInput = null;
			inst.settings.prompt = null;
			if (this._inDialog) {
				this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
				if ($.blockUI) {
					$.unblockUI();
					$('body').append(this.dpDiv);
				}
			}
			this._inDialog = false;
		}
		this._curInst = null;
	},

	/* Tidy up after a dialog display. */
	_tidyDialog: function(inst) {
		inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker');
		$('.' + this._promptClass, inst.dpDiv).remove();
	},

	/* Close date picker if clicked elsewhere. */
	_checkExternalClick: function(event) {
		if (!$.datepicker._curInst)
			return;
		var $target = $(event.target);
		if (($target.parents('#' + $.datepicker._mainDivId).length == 0) &&
				!$target.hasClass($.datepicker.markerClassName) &&
				!$target.hasClass($.datepicker._triggerClass) &&
				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))
			$.datepicker._hideDatepicker(null, '');
	},

	/* Adjust one of the date sub-fields. */
	_adjustDate: function(id, offset, period) {
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		this._adjustInstDate(inst, offset, period);
		this._updateDatepicker(inst);
	},

	/* Action for current link. */
	_gotoToday: function(id) {
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
			inst.selectedDay = inst.currentDay;
			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
			inst.drawYear = inst.selectedYear = inst.currentYear;
		}
		else {
		var date = new Date();
		inst.selectedDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = date.getFullYear();
		}
		this._adjustDate(target);
		this._notifyChange(inst);
	},

	/* Action for selecting a new month/year. */
	_selectMonthYear: function(id, select, period) {
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		inst._selectingMonthYear = false;
		inst[period == 'M' ? 'drawMonth' : 'drawYear'] =
			select.options[select.selectedIndex].value - 0;
		this._adjustDate(target);
		this._notifyChange(inst);
	},

	/* Restore input focus after not changing month/year. */
	_clickMonthYear: function(id) {
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		if (inst.input && inst._selectingMonthYear && !$.browser.msie)
			inst.input[0].focus();
		inst._selectingMonthYear = !inst._selectingMonthYear;
	},

	/* Action for changing the first week day. */
	_changeFirstDay: function(id, day) {
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		inst.settings.firstDay = day;
		this._updateDatepicker(inst);
	},

	/* Action for selecting a day. */
	_selectDay: function(id, month, year, td) {
		if ($(td).hasClass(this._unselectableClass))
			return;
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		var rangeSelect = this._get(inst, 'rangeSelect');
		if (rangeSelect) {
			this._stayOpen = !this._stayOpen;
			if (this._stayOpen) {
				$('.ui-datepicker td').removeClass(this._currentClass);
				$(td).addClass(this._currentClass);
			} 
		}
		inst.selectedDay = inst.currentDay = $('a', td).html();
		inst.selectedMonth = inst.currentMonth = month;
		inst.selectedYear = inst.currentYear = year;
		if (this._stayOpen) {
			inst.endDay = inst.endMonth = inst.endYear = null;
		}
		else if (rangeSelect) {
			inst.endDay = inst.currentDay;
			inst.endMonth = inst.currentMonth;
			inst.endYear = inst.currentYear;
		}
		this._selectDate(id, this._formatDate(inst,
			inst.currentDay, inst.currentMonth, inst.currentYear));
		if (this._stayOpen) {
			inst.rangeStart = new Date(inst.currentYear, inst.currentMonth, inst.currentDay);
			this._updateDatepicker(inst);
		}
		else if (rangeSelect) {
			inst.selectedDay = inst.currentDay = inst.rangeStart.getDate();
			inst.selectedMonth = inst.currentMonth = inst.rangeStart.getMonth();
			inst.selectedYear = inst.currentYear = inst.rangeStart.getFullYear();
			inst.rangeStart = null;
			if (inst.inline)
				this._updateDatepicker(inst);
		}
	},

	/* Erase the input field and hide the date picker. */
	_clearDate: function(id) {
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		if (this._get(inst, 'mandatory'))
			return;
		this._stayOpen = false;
		inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null;
		this._selectDate(target, '');
	},

	/* Update the input field with the selected date. */
	_selectDate: function(id, dateStr) {
		var target = $(id);
		var inst = $.data(target[0], PROP_NAME);
		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
		if (this._get(inst, 'rangeSelect') && dateStr)
			dateStr = (inst.rangeStart ? this._formatDate(inst, inst.rangeStart) :
				dateStr) + this._get(inst, 'rangeSeparator') + dateStr;
		if (inst.input)
			inst.input.val(dateStr);
		this._updateAlternate(inst);
		var onSelect = this._get(inst, 'onSelect');
		if (onSelect)
			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
		else if (inst.input)
			inst.input.trigger('change'); // fire the change event
		if (inst.inline)
			this._updateDatepicker(inst);
		else if (!this._stayOpen) {
			this._hideDatepicker(null, this._get(inst, 'duration'));
			this._lastInput = inst.input[0];
			if (typeof(inst.input[0]) != 'object')
				inst.input[0].focus(); // restore focus
			this._lastInput = null;
		}
	},
	
	/* Update any alternate field to synchronise with the main field. */
	_updateAlternate: function(inst) {
		var altField = this._get(inst, 'altField');
		if (altField) { // update alternate field too
			var altFormat = this._get(inst, 'altFormat');
			var date = this._getDate(inst);
			dateStr = (isArray(date) ? (!date[0] && !date[1] ? '' :
				this.formatDate(altFormat, date[0], this._getFormatConfig(inst)) +
				this._get(inst, 'rangeSeparator') + this.formatDate(
				altFormat, date[1] || date[0], this._getFormatConfig(inst))) :
				this.formatDate(altFormat, date, this._getFormatConfig(inst)));
			$(altField).each(function() { $(this).val(dateStr); });
		}
	},

	/* Set as beforeShowDay function to prevent selection of weekends.
	   @param  date  Date - the date to customise
	   @return [boolean, string] - is this date selectable?, what is its CSS class? */
	noWeekends: function(date) {
		var day = date.getDay();
		return [(day > 0 && day < 6), ''];
	},
	
	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
	   @param  date  Date - the date to get the week for
	   @return  number - the number of the week within the year that contains this date */
	iso8601Week: function(date) {
		var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), (date.getTimezoneOffset() / -60));
		var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
		var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
		firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
		if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
			checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
			return $.datepicker.iso8601Week(checkDate);
		} else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
			firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
			if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
				checkDate.setDate(checkDate.getDate() + 3); // Generate for next year
				return $.datepicker.iso8601Week(checkDate);
			}
		}
		return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
	},
	
	/* Provide status text for a particular date.
	   @param  date  the date to get the status for
	   @param  inst  the current datepicker instance
	   @return  the status display text for this date */
	dateStatus: function(date, inst) {
		return $.datepicker.formatDate($.datepicker._get(inst, 'dateStatus'),
			date, $.datepicker._getFormatConfig(inst));
	},

	/* Parse a string value into a date object.
	   See formatDate below for the possible formats.

	   @param  format    string - the expected format of the date
	   @param  value     string - the date in the above format
	   @param  settings  Object - attributes include:
	                     shortYearCutoff  number - the cutoff year for determining the century (optional)
	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
	                     dayNames         string[7] - names of the days from Sunday (optional)
	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
	                     monthNames       string[12] - names of the months (optional)
	   @return  Date - the extracted date value or null if value is blank */
	parseDate: function (format, value, settings) {
		if (format == null || value == null)
			throw 'Invalid arguments';
		value = (typeof value == 'object' ? value.toString() : value + '');
		if (value == '')
			return null;
		var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
		var year = -1;
		var month = -1;
		var day = -1;
		var literal = false;
		// Check whether a format character is doubled
		var lookAhead = function(match) {
			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
			if (matches)
				iFormat++;
			return matches;	
		};
		// Extract a number from the string value
		var getNumber = function(match) {
			lookAhead(match);
			var origSize = (match == '@' ? 14 : (match == 'y' ? 4 : 2));
			var size = origSize;
			var num = 0;
			while (size > 0 && iValue < value.length &&
					value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
				num = num * 10 + (value.charAt(iValue++) - 0);
				size--;
			}
			if (size == origSize)
				throw 'Missing number at position ' + iValue;
			return num;
		};
		// Extract a name from the string value and convert to an index
		var getName = function(match, shortNames, longNames) {
			var names = (lookAhead(match) ? longNames : shortNames);
			var size = 0;
			for (var j = 0; j < names.length; j++)
				size = Math.max(size, names[j].length);
			var name = '';
			var iInit = iValue;
			while (size > 0 && iValue < value.length) {
				name += value.charAt(iValue++);
				for (var i = 0; i < names.length; i++)
					if (name == names[i])
						return i + 1;
				size--;
			}
			throw 'Unknown name at position ' + iInit;
		};
		// Confirm that a literal character matches the string value
		var checkLiteral = function() {
			if (value.charAt(iValue) != format.charAt(iFormat))
				throw 'Unexpected literal at position ' + iValue;
			iValue++;
		};
		var iValue = 0;
		for (var iFormat = 0; iFormat < format.length; iFormat++) {
			if (literal)
				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
					literal = false;
				else
					checkLiteral();
			else
				switch (format.charAt(iFormat)) {
					case 'd':
						day = getNumber('d');
						break;
					case 'D': 
						getName('D', dayNamesShort, dayNames);
						break;
					case 'm': 
						month = getNumber('m');
						break;
					case 'M':
						month = getName('M', monthNamesShort, monthNames); 
						break;
					case 'y':
						year = getNumber('y');
						break;
					case '@':
						var date = new Date(getNumber('@'));
						year = date.getFullYear();
						month = date.getMonth() + 1;
						day = date.getDate();
						break;
					case "'":
						if (lookAhead("'"))
							checkLiteral();
						else
							literal = true;
						break;
					default:
						checkLiteral();
				}
		}
		if (year < 100)
			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
				(year <= shortYearCutoff ? 0 : -100);
		var date = new Date(year, month - 1, day);
		if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
			throw 'Invalid date'; // E.g. 31/02/*
		return date;
	},

	/* Standard date formats. */
	ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
	COOKIE: 'D, dd M yy',
	ISO_8601: 'yy-mm-dd',
	RFC_822: 'D, d M y',
	RFC_850: 'DD, dd-M-y',
	RFC_1036: 'D, d M y',
	RFC_1123: 'D, d M yy',
	RFC_2822: 'D, d M yy',
	RSS: 'D, d M y', // RFC 822
	TIMESTAMP: '@',
	W3C: 'yy-mm-dd', // ISO 8601

	/* Format a date object into a string value.
	   The format can be combinations of the following:
	   d  - day of month (no leading zero)
	   dd - day of month (two digit)
	   D  - day name short
	   DD - day name long
	   m  - month of year (no leading zero)
	   mm - month of year (two digit)
	   M  - month name short
	   MM - month name long
	   y  - year (two digit)
	   yy - year (four digit)
	   @ - Unix timestamp (ms since 01/01/1970)
	   '...' - literal text
	   '' - single quote

	   @param  format    string - the desired format of the date
	   @param  date      Date - the date value to format
	   @param  settings  Object - attributes include:
	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
	                     dayNames         string[7] - names of the days from Sunday (optional)
	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
	                     monthNames       string[12] - names of the months (optional)
	   @return  string - the date in the above format */
	formatDate: function (format, date, settings) {
		if (!date)
			return '';
		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
		// Check whether a format character is doubled
		var lookAhead = function(match) {
			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
			if (matches)
				iFormat++;
			return matches;	
		};
		// Format a number, with leading zero if necessary
		var formatNumber = function(match, value) {
			return (lookAhead(match) && value < 10 ? '0' : '') + value;
		};
		// Format a name, short or long as requested
		var formatName = function(match, value, shortNames, longNames) {
			return (lookAhead(match) ? longNames[value] : shortNames[value]);
		};
		var output = '';
		var literal = false;
		if (date)
			for (var iFormat = 0; iFormat < format.length; iFormat++) {
				if (literal)
					if (format.charAt(iFormat) == "'" && !lookAhead("'"))
						literal = false;
					else
						output += format.charAt(iFormat);
				else
					switch (format.charAt(iFormat)) {
						case 'd':
							output += formatNumber('d', date.getDate()); 
							break;
						case 'D': 
							output += formatName('D', date.getDay(), dayNamesShort, dayNames);
							break;
						case 'm': 
							output += formatNumber('m', date.getMonth() + 1); 
							break;
						case 'M':
							output += formatName('M', date.getMonth(), monthNamesShort, monthNames); 
							break;
						case 'y':
							output += (lookAhead('y') ? date.getFullYear() : 
								(date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
							break;
						case '@':
							output += date.getTime(); 
							break;
						case "'":
							if (lookAhead("'"))
								output += "'";
							else
								literal = true;
							break;
						default:
							output += format.charAt(iFormat);
					}
			}
		return output;
	},

	/* Extract all possible characters from the date format. */
	_possibleChars: function (format) {
		var chars = '';
		var literal = false;
		for (var iFormat = 0; iFormat < format.length; iFormat++)
			if (literal)
				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
					literal = false;
				else
					chars += format.charAt(iFormat);
			else
				switch (format.charAt(iFormat)) {
					case 'd': case 'm': case 'y': case '@':
						chars += '0123456789'; 
						break;
					case 'D': case 'M':
						return null; // Accept anything
					case "'":
						if (lookAhead("'"))
							chars += "'";
						else
							literal = true;
						break;
					default:
						chars += format.charAt(iFormat);
				}
		return chars;
	},

	/* Get a setting value, defaulting if necessary. */
	_get: function(inst, name) {
		return inst.settings[name] !== undefined ?
			inst.settings[name] : this._defaults[name];
	},

	/* Parse existing date and initialise date picker. */
	_setDateFromField: function(inst) {
		var dateFormat = this._get(inst, 'dateFormat');
		var dates = inst.input ? inst.input.val().split(this._get(inst, 'rangeSeparator')) : null; 
		inst.endDay = inst.endMonth = inst.endYear = null;
		var date = defaultDate = this._getDefaultDate(inst);
		if (dates.length > 0) {
			var settings = this._getFormatConfig(inst);
			if (dates.length > 1) {
				date = this.parseDate(dateFormat, dates[1], settings) || defaultDate;
				inst.endDay = date.getDate();
				inst.endMonth = date.getMonth();
				inst.endYear = date.getFullYear();
			}
			try {
				date = this.parseDate(dateFormat, dates[0], settings) || defaultDate;
			} catch (e) {
				this.log(e);
				date = defaultDate;
			}
		}
		inst.selectedDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = date.getFullYear();
		inst.currentDay = (dates[0] ? date.getDate() : 0);
		inst.currentMonth = (dates[0] ? date.getMonth() : 0);
		inst.currentYear = (dates[0] ? date.getFullYear() : 0);
		this._adjustInstDate(inst);
	},
	
	/* Retrieve the default date shown on opening. */
	_getDefaultDate: function(inst) {
		var date = this._determineDate(this._get(inst, 'defaultDate'), new Date());
		var minDate = this._getMinMaxDate(inst, 'min', true);
		var maxDate = this._getMinMaxDate(inst, 'max');
		date = (minDate && date < minDate ? minDate : date);
		date = (maxDate && date > maxDate ? maxDate : date);
		return date;
	},

	/* A date may be specified as an exact value or a relative one. */
	_determineDate: function(date, defaultDate) {
		var offsetNumeric = function(offset) {
			var date = new Date();
			date.setUTCDate(date.getUTCDate() + offset);
			return date;
		};
		var offsetString = function(offset, getDaysInMonth) {
			var date = new Date();
			var year = date.getFullYear();
			var month = date.getMonth();
			var day = date.getDate();
			var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
			var matches = pattern.exec(offset);
			while (matches) {
				switch (matches[2] || 'd') {
					case 'd' : case 'D' :
						day += (matches[1] - 0); break;
					case 'w' : case 'W' :
						day += (matches[1] * 7); break;
					case 'm' : case 'M' :
						month += (matches[1] - 0); 
						day = Math.min(day, getDaysInMonth(year, month));
						break;
					case 'y': case 'Y' :
						year += (matches[1] - 0);
						day = Math.min(day, getDaysInMonth(year, month));
						break;
				}
				matches = pattern.exec(offset);
			}
			return new Date(year, month, day);
		};
		return (date == null ? defaultDate :
			(typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
			(typeof date == 'number' ? offsetNumeric(date) : date)));
	},

	/* Set the date(s) directly. */
	_setDate: function(inst, date, endDate) {
		var clear = !(date);
		date = this._determineDate(date, new Date());
		inst.selectedDay = inst.currentDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear();
		if (this._get(inst, 'rangeSelect')) {
			if (endDate) {
				endDate = this._determineDate(endDate, null);
				inst.endDay = endDate.getDate();
				inst.endMonth = endDate.getMonth();
				inst.endYear = endDate.getFullYear();
			} else {
				inst.endDay = inst.currentDay;
				inst.endMonth = inst.currentMonth;
				inst.endYear = inst.currentYear;
			}
		}
		this._adjustInstDate(inst);
		if (inst.input)
			inst.input.val(clear ? '' : this._formatDate(inst) +
				(!this._get(inst, 'rangeSelect') ? '' : this._get(inst, 'rangeSeparator') +
				this._formatDate(inst, inst.endDay, inst.endMonth, inst.endYear)));
	},

	/* Retrieve the date(s) directly. */
	_getDate: function(inst) {
		var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
			new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
		if (this._get(inst, 'rangeSelect')) {
			return [inst.rangeStart || startDate, (!inst.endYear ? null :
				new Date(inst.endYear, inst.endMonth, inst.endDay))];
		} else
			return startDate;
	},

	/* Generate the HTML for the current state of the date picker. */
	_generateDatepicker: function(inst) {
		var today = new Date();
		today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // clear time
		var showStatus = this._get(inst, 'showStatus');
		var isRTL = this._get(inst, 'isRTL');
		// build the date picker HTML
		var clear = (this._get(inst, 'mandatory') ? '' :
			'<div class="ui-datepicker-clear"><a onclick="nextQuery.datepicker._clearDate(\'#' + inst.id + '\');"' +
			(showStatus ? this._addStatus(inst, this._get(inst, 'clearStatus') || '&#xa0;') : '') + '>' +
			this._get(inst, 'clearText') + '</a></div>');
		var controls = '<div class="ui-datepicker-control">' + (isRTL ? '' : clear) +
			'<div class="ui-datepicker-close"><a onclick="nextQuery.datepicker._hideDatepicker();"' +
			(showStatus ? this._addStatus(inst, this._get(inst, 'closeStatus') || '&#xa0;') : '') + '>' +
			this._get(inst, 'closeText') + '</a></div>' + (isRTL ? clear : '')  + '</div>';
		var prompt = this._get(inst, 'prompt');
		var closeAtTop = this._get(inst, 'closeAtTop');
		var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
		var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
		var numMonths = this._getNumberOfMonths(inst);
		var stepMonths = this._get(inst, 'stepMonths');
		var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
		var currentDate = (!inst.currentDay ? new Date(9999, 9, 9) :
			new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
		var minDate = this._getMinMaxDate(inst, 'min', true);
		var maxDate = this._getMinMaxDate(inst, 'max');
		var drawMonth = inst.drawMonth;
		var drawYear = inst.drawYear;
		if (maxDate) {
			var maxDraw = new Date(maxDate.getFullYear(),
				maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate());
			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
			while (new Date(drawYear, drawMonth, 1) > maxDraw) {
				drawMonth--;
				if (drawMonth < 0) {
					drawMonth = 11;
					drawYear--;
				}
			}
		}
		// controls and links
		var prevText = this._get(inst, 'prevText');
		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(
			prevText, new Date(drawYear, drawMonth - stepMonths, 1), this._getFormatConfig(inst)));
		var prev = '<div class="ui-datepicker-prev">' + (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? 
			'<a onclick="nextQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
			(showStatus ? this._addStatus(inst, this._get(inst, 'prevStatus') || '&#xa0;') : '') + '>' + prevText + '</a>' :
			(hideIfNoPrevNext ? '' : '<label>' + prevText + '</label>')) + '</div>';
		var nextText = this._get(inst, 'nextText');
		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(
			nextText, new Date(drawYear, drawMonth + stepMonths, 1), this._getFormatConfig(inst)));
		var next = '<div class="ui-datepicker-next">' + (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
			'<a onclick="nextQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
			(showStatus ? this._addStatus(inst, this._get(inst, 'nextStatus') || '&#xa0;') : '') + '>' + nextText + '</a>' :
			(hideIfNoPrevNext ? '' : '<label>' + nextText + '</label>')) + '</div>';
		var currentText = this._get(inst, 'currentText');
		currentText = (!navigationAsDateFormat ? currentText: this.formatDate(
			currentText, today, this._getFormatConfig(inst)));
		var html = (prompt ? '<div class="' + this._promptClass + '">' + prompt + '</div>' : '') +
			(closeAtTop && !inst.inline ? controls : '') +
			'<div class="ui-datepicker-links">' + (isRTL ? next : prev) +
			(this._isInRange(inst, (this._get(inst, 'gotoCurrent') && inst.currentDay ?
			currentDate : today)) ? '<div class="ui-datepicker-current">' +
			'<a onclick="nextQuery.datepicker._gotoToday(\'#' + inst.id + '\');"' +
			(showStatus ? this._addStatus(inst, this._get(inst, 'currentStatus') || '&#xa0;') : '') + '>' +
			currentText + '</a></div>' : '') + (isRTL ? prev : next) + '</div>';
		var firstDay = this._get(inst, 'firstDay');
		var changeFirstDay = this._get(inst, 'changeFirstDay');
		var dayNames = this._get(inst, 'dayNames');
		var dayNamesShort = this._get(inst, 'dayNamesShort');
		var dayNamesMin = this._get(inst, 'dayNamesMin');
		var monthNames = this._get(inst, 'monthNames');
		var beforeShowDay = this._get(inst, 'beforeShowDay');
		var highlightWeek = this._get(inst, 'highlightWeek');
		var showOtherMonths = this._get(inst, 'showOtherMonths');
		var showWeeks = this._get(inst, 'showWeeks');
		var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
		var status = (showStatus ? this._get(inst, 'dayStatus') || '&#xa0;' : '');
		var dateStatus = this._get(inst, 'statusForDate') || this.dateStatus;
		var endDate = inst.endDay ? new Date(inst.endYear, inst.endMonth, inst.endDay) : currentDate;
		for (var row = 0; row < numMonths[0]; row++)
			for (var col = 0; col < numMonths[1]; col++) {
				var selectedDate = new Date(drawYear, drawMonth, inst.selectedDay);
				html += '<div class="ui-datepicker-one-month' + (col == 0 ? ' ui-datepicker-new-row' : '') + '">' +
					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
					selectedDate, row > 0 || col > 0, showStatus, monthNames) + // draw month headers
					'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead>' + 
					'<tr class="ui-datepicker-title-row">' +
					(showWeeks ? '<td>' + this._get(inst, 'weekHeader') + '</td>' : '');
				for (var dow = 0; dow < 7; dow++) { // days of the week
					var day = (dow + firstDay) % 7;
					var dayStatus = (status.indexOf('DD') > -1 ? status.replace(/DD/, dayNames[day]) :
						status.replace(/D/, dayNamesShort[day]));
					html += '<td' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end-cell"' : '') + '>' +
						(!changeFirstDay ? '<span' :
						'<a onclick="nextQuery.datepicker._changeFirstDay(\'#' + inst.id + '\', ' + day + ');"') + 
						(showStatus ? this._addStatus(inst, dayStatus) : '') + ' title="' + dayNames[day] + '">' +
						dayNamesMin[day] + (changeFirstDay ? '</a>' : '</span>') + '</td>';
				}
				html += '</tr></thead><tbody>';
				var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
				if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
				var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
				var printDate = new Date(drawYear, drawMonth, 1 - leadDays);
				var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
				for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
					html += '<tr class="ui-datepicker-days-row">' +
						(showWeeks ? '<td class="ui-datepicker-week-col">' + calculateWeek(printDate) + '</td>' : '');
					for (var dow = 0; dow < 7; dow++) { // create date picker days
						var daySettings = (beforeShowDay ?
							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
						var otherMonth = (printDate.getMonth() != drawMonth);
						var unselectable = otherMonth || !daySettings[0] ||
							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
						html += '<td class="ui-datepicker-days-cell' +
							((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end-cell' : '') + // highlight weekends
							(otherMonth ? ' ui-datepicker-otherMonth' : '') + // highlight days from other months
							(printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth ?
							' ui-datepicker-days-cell-over' : '') + // highlight selected day
							(unselectable ? ' ' + this._unselectableClass : '') +  // highlight unselectable days
							(otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
							(printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ?  // in current range
							' ' + this._currentClass : '') + // highlight selected day
							(printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
							((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
							(unselectable ? (highlightWeek ? ' onmouseover="nextQuery(this).parent().addClass(\'ui-datepicker-week-over\');"' + // highlight selection week
							' onmouseout="nextQuery(this).parent().removeClass(\'ui-datepicker-week-over\');"' : '') : // unhighlight selection week
							' onmouseover="nextQuery(this).addClass(\'ui-datepicker-days-cell-over\')' + // highlight selection
							(highlightWeek ? '.parent().addClass(\'ui-datepicker-week-over\')' : '') + ';' + // highlight selection week
							(!showStatus || (otherMonth && !showOtherMonths) ? '' : 'nextQuery(\'#ui-datepicker-status-' +
							inst.id + '\').html(\'' + (dateStatus.apply((inst.input ? inst.input[0] : null),
							[printDate, inst]) || '&#xa0;') +'\');') + '"' +
							' onmouseout="nextQuery(this).removeClass(\'ui-datepicker-days-cell-over\')' + // unhighlight selection
							(highlightWeek ? '.parent().removeClass(\'ui-datepicker-week-over\')' : '') + ';' + // unhighlight selection week
							(!showStatus || (otherMonth && !showOtherMonths) ? '' : 'nextQuery(\'#ui-datepicker-status-' +
							inst.id + '\').html(\'&#xa0;\');') + '" onclick="nextQuery.datepicker._selectDay(\'#' +
							inst.id + '\',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions
							(otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
							(unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
						//There's a math error with daylight savings time for November
						//printDate.setUTCDate(printDate.getUTCDate() + 1);
						printDate.setDate(printDate.getDate() + 1); //fixes an error with datepicker
					}
					html += '</tr>';
				}
				drawMonth++;
				if (drawMonth > 11) {
					drawMonth = 0;
					drawYear++;
				}
				html += '</tbody></table></div>';
			}
		html += (showStatus ? '<div style="clear: both;"></div><div id="ui-datepicker-status-' + inst.id + 
			'" class="ui-datepicker-status">' + (this._get(inst, 'initStatus') || '&#xa0;') + '</div>' : '') +
			(!closeAtTop && !inst.inline ? controls : '') +
			'<div style="clear: both;"></div>' + 
			($.browser.msie && parseInt($.browser.version) < 7 && !inst.inline ? 
			'<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>' : '');
		return html;
	},
	
	/* Generate the month and year header. */
	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
			selectedDate, secondary, showStatus, monthNames) {
		minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
		var html = '<div class="ui-datepicker-header">';
		// month selection
		if (secondary || !this._get(inst, 'changeMonth'))
			html += monthNames[drawMonth] + '&#xa0;';
		else {
			var inMinYear = (minDate && minDate.getFullYear() == drawYear);
			var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
			html += '<select class="ui-datepicker-new-month" ' +
				'onchange="nextQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
				'onclick="nextQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
				(showStatus ? this._addStatus(inst, this._get(inst, 'monthStatus') || '&#xa0;') : '') + '>';
			for (var month = 0; month < 12; month++) {
				if ((!inMinYear || month >= minDate.getMonth()) &&
						(!inMaxYear || month <= maxDate.getMonth()))
					html += '<option value="' + month + '"' +
						(month == drawMonth ? ' selected="selected"' : '') +
						'>' + monthNames[month] + '</option>';
			}
			html += '</select>';
		}
		// year selection
		if (secondary || !this._get(inst, 'changeYear'))
			html += drawYear;
		else {
			// determine range of years to display
			var years = this._get(inst, 'yearRange').split(':');
			var year = 0;
			var endYear = 0;
			if (years.length != 2) {
				year = drawYear - 10;
				endYear = drawYear + 10;
			} else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
				year = endYear = new Date().getFullYear();
				year += parseInt(years[0], 10);
				endYear += parseInt(years[1], 10);
			} else {
				year = parseInt(years[0], 10);
				endYear = parseInt(years[1], 10);
			}
			year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
			endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
			html += '<select class="ui-datepicker-new-year" ' +
				'onchange="nextQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
				'onclick="nextQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
				(showStatus ? this._addStatus(inst, this._get(inst, 'yearStatus') || '&#xa0;') : '') + '>';
			for (; year <= endYear; year++) {
				html += '<option value="' + year + '"' +
					(year == drawYear ? ' selected="selected"' : '') +
					'>' + year + '</option>';
			}
			html += '</select>';
		}
		html += '</div>'; // Close datepicker_header
		return html;
	},

	/* Provide code to set and clear the status panel. */
	_addStatus: function(inst, text) {
		return ' onmouseover="nextQuery(\'#ui-datepicker-status-' + inst.id + '\').html(\'' + text + '\');" ' +
			'onmouseout="nextQuery(\'#ui-datepicker-status-' + inst.id + '\').html(\'&#xa0;\');"';
	},

	/* Adjust one of the date sub-fields. */
	_adjustInstDate: function(inst, offset, period) {
		var year = inst.drawYear + (period == 'Y' ? offset : 0);
		var month = inst.drawMonth + (period == 'M' ? offset : 0);
		var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
			(period == 'D' ? offset : 0);
		var date = new Date(year, month, day);
		// ensure it is within the bounds set
		var minDate = this._getMinMaxDate(inst, 'min', true);
		var maxDate = this._getMinMaxDate(inst, 'max');
		date = (minDate && date < minDate ? minDate : date);
		date = (maxDate && date > maxDate ? maxDate : date);
		inst.selectedDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = date.getFullYear();
		if (period == 'M' || period == 'Y')
			this._notifyChange(inst);
	},

	/* Notify change of month/year. */
	_notifyChange: function(inst) {
		var onChange = this._get(inst, 'onChangeMonthYear');
		if (onChange)
			onChange.apply((inst.input ? inst.input[0] : null),
				[new Date(inst.selectedYear, inst.selectedMonth, 1), inst]);
	},
	
	/* Determine the number of months to show. */
	_getNumberOfMonths: function(inst) {
		var numMonths = this._get(inst, 'numberOfMonths');
		return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
	},

	/* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
	_getMinMaxDate: function(inst, minMax, checkRange) {
		var date = this._determineDate(this._get(inst, minMax + 'Date'), null);
		if (date) {
			date.setHours(0);
			date.setMinutes(0);
			date.setSeconds(0);
			date.setMilliseconds(0);
		}
		return (!checkRange || !inst.rangeStart ? date :
			(!date || inst.rangeStart > date ? inst.rangeStart : date));
	},

	/* Find the number of days in a given month. */
	_getDaysInMonth: function(year, month) {
		return 32 - new Date(year, month, 32).getDate();
	},

	/* Find the day of the week of the first of a month. */
	_getFirstDayOfMonth: function(year, month) {
		return new Date(year, month, 1).getDay();
	},

	/* Determines if we should allow a "next/prev" month display change. */
	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
		var numMonths = this._getNumberOfMonths(inst);
		var date = new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1);
		if (offset < 0)
			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
		return this._isInRange(inst, date);
	},

	/* Is the given date in the accepted range? */
	_isInRange: function(inst, date) {
		// during range selection, use minimum of selected date and range start
		var newMinDate = (!inst.rangeStart ? null :
			new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay));
		newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate);
		var minDate = newMinDate || this._getMinMaxDate(inst, 'min');
		var maxDate = this._getMinMaxDate(inst, 'max');
		return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
	},
	
	/* Provide the configuration settings for formatting/parsing. */
	_getFormatConfig: function(inst) {
		var shortYearCutoff = this._get(inst, 'shortYearCutoff');
		shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
		return {shortYearCutoff: shortYearCutoff,
			dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
			monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
	},

	/* Format the given date for display. */
	_formatDate: function(inst, day, month, year) {
		if (!day) {
			inst.currentDay = inst.selectedDay;
			inst.currentMonth = inst.selectedMonth;
			inst.currentYear = inst.selectedYear;
		}
		var date = (day ? (typeof day == 'object' ? day : new Date(year, month, day)) :
			new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
		return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
	}
});

/* jQuery extend now ignores nulls! */
function extendRemove(target, props) {
	$.extend(target, props);
	for (var name in props)
		if (props[name] == null || props[name] == undefined)
			target[name] = props[name];
	return target;
};

/* Determine whether an object is an array. */
function isArray(a) {
	return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
		(a.constructor && a.constructor.toString().match(/\Array\(\)/))));
};

/* Invoke the datepicker functionality.
   @param  options  string - a command, optionally followed by additional parameters or
                    Object - settings for attaching new datepicker functionality
   @return  jQuery object */
$.fn.datepicker = function(options){
	var otherArgs = Array.prototype.slice.call(arguments, 1);
	if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate'))
		return $.datepicker['_' + options + 'Datepicker'].
			apply($.datepicker, [this[0]].concat(otherArgs));
	return this.each(function() {
		typeof options == 'string' ?
			$.datepicker['_' + options + 'Datepicker'].
				apply($.datepicker, [this].concat(otherArgs)) :
			$.datepicker._attachDatepicker(this, options);
	});
};

$.datepicker = new Datepicker(); // singleton instance
	
/* Initialise the date picker. */
$(document).ready(function() {
	$(document.body).append($.datepicker.dpDiv).
		mousedown($.datepicker._checkExternalClick);
});

})(nextQuery);
