/* START MicrosoftAjax.js */
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjax.js
Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c<e;c++)d[c]=arguments[c];d[e]=a;return b.apply(this,d)}return b.call(this,a)}};Function.createDelegate=function(a,b){return function(){return b.apply(a,arguments)}};Function.emptyFunction=Function.emptyMethod=function(){};Function._validateParams=function(e,c){var a;a=Function._validateParameterCount(e,c);if(a){a.popStackFrame();return a}for(var b=0;b<e.length;b++){var d=c[Math.min(b,c.length-1)],f=d.name;if(d.parameterArray)f+="["+(b-c.length+1)+"]";a=Function._validateParameter(e[b],d,f);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(e,a){var c=a.length,d=0;for(var b=0;b<a.length;b++)if(a[b].parameterArray)c=Number.MAX_VALUE;else if(!a[b].optional)d++;if(e.length<d||e.length>c){var f=Error.parameterCount();f.popStackFrame();return f}return null};Function._validateParameter=function(c,a,h){var b,g=a.type,l=!!a.integer,k=!!a.domElement,m=!!a.mayBeNull;b=Function._validateParameterType(c,g,l,k,m,h);if(b){b.popStackFrame();return b}var e=a.elementType,f=!!a.elementMayBeNull;if(g===Array&&typeof c!=="undefined"&&c!==null&&(e||!f)){var j=!!a.elementInteger,i=!!a.elementDomElement;for(var d=0;d<c.length;d++){var n=c[d];b=Function._validateParameterType(n,e,j,i,f,h+"["+d+"]");if(b){b.popStackFrame();return b}}}return null};Function._validateParameterType=function(a,c,n,m,k,d){var b;if(typeof a==="undefined")if(k)return null;else{b=Error.argumentUndefined(d);b.popStackFrame();return b}if(a===null)if(k)return null;else{b=Error.argumentNull(d);b.popStackFrame();return b}if(c&&c.__enum){if(typeof a!=="number"){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(a%1===0){var e=c.prototype;if(!c.__flags||a===0){for(var i in e)if(e[i]===a)return null}else{var l=a;for(var i in e){var f=e[i];if(f===0)continue;if((f&a)===f)l-=f;if(l===0)return null}}}b=Error.argumentOutOfRange(d,a,String.format(Sys.Res.enumInvalidValue,a,c.getName()));b.popStackFrame();return b}if(m){var h;if(typeof a.nodeType!=="number"){var g=a.ownerDocument||a.document||a;if(g!=a){var j=g.defaultView||g.parentWindow;h=j!=a&&!(j.document&&a.document&&j.document===a.document)}else h=typeof g.body==="undefined"}else h=a.nodeType===3;if(h){b=Error.argument(d,Sys.Res.argumentDomElement);b.popStackFrame();return b}}if(c&&!c.isInstanceOfType(a)){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(c===Number&&n)if(a%1!==0){b=Error.argumentOutOfRange(d,a,Sys.Res.argumentInteger);b.popStackFrame();return b}return null};Error.__typeName="Error";Error.__class=true;Error.create=function(d,b){var a=new Error(d);a.message=d;if(b)for(var c in b)a[c]=b[c];a.popStackFrame();return a};Error.argument=function(a,c){var b="Sys.ArgumentException: "+(c?c:Sys.Res.argument);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentException",paramName:a});d.popStackFrame();return d};Error.argumentNull=function(a,c){var b="Sys.ArgumentNullException: "+(c?c:Sys.Res.argumentNull);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentNullException",paramName:a});d.popStackFrame();return d};Error.argumentOutOfRange=function(c,a,d){var b="Sys.ArgumentOutOfRangeException: "+(d?d:Sys.Res.argumentOutOfRange);if(c)b+="\n"+String.format(Sys.Res.paramName,c);if(typeof a!=="undefined"&&a!==null)b+="\n"+String.format(Sys.Res.actualValue,a);var e=Error.create(b,{name:"Sys.ArgumentOutOfRangeException",paramName:c,actualValue:a});e.popStackFrame();return e};Error.argumentType=function(d,c,b,e){var a="Sys.ArgumentTypeException: ";if(e)a+=e;else if(c&&b)a+=String.format(Sys.Res.argumentTypeWithTypes,c.getName(),b.getName());else a+=Sys.Res.argumentType;if(d)a+="\n"+String.format(Sys.Res.paramName,d);var f=Error.create(a,{name:"Sys.ArgumentTypeException",paramName:d,actualType:c,expectedType:b});f.popStackFrame();return f};Error.argumentUndefined=function(a,c){var b="Sys.ArgumentUndefinedException: "+(c?c:Sys.Res.argumentUndefined);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentUndefinedException",paramName:a});d.popStackFrame();return d};Error.format=function(a){var c="Sys.FormatException: "+(a?a:Sys.Res.format),b=Error.create(c,{name:"Sys.FormatException"});b.popStackFrame();return b};Error.invalidOperation=function(a){var c="Sys.InvalidOperationException: "+(a?a:Sys.Res.invalidOperation),b=Error.create(c,{name:"Sys.InvalidOperationException"});b.popStackFrame();return b};Error.notImplemented=function(a){var c="Sys.NotImplementedException: "+(a?a:Sys.Res.notImplemented),b=Error.create(c,{name:"Sys.NotImplementedException"});b.popStackFrame();return b};Error.parameterCount=function(a){var c="Sys.ParameterCountException: "+(a?a:Sys.Res.parameterCount),b=Error.create(c,{name:"Sys.ParameterCountException"});b.popStackFrame();return b};Error.prototype.popStackFrame=function(){if(typeof this.stack==="undefined"||this.stack===null||typeof this.fileName==="undefined"||this.fileName===null||typeof this.lineNumber==="undefined"||this.lineNumber===null)return;var a=this.stack.split("\n"),c=a[0],e=this.fileName+":"+this.lineNumber;while(typeof c!=="undefined"&&c!==null&&c.indexOf(e)===-1){a.shift();c=a[0]}var d=a[1];if(typeof d==="undefined"||d===null)return;var b=d.match(/@(.*):(\d+)$/);if(typeof b==="undefined"||b===null)return;this.fileName=b[1];this.lineNumber=parseInt(b[2]);a.shift();this.stack=a.join("\n")};Object.__typeName="Object";Object.__class=true;Object.getType=function(b){var a=b.constructor;if(!a||typeof a!=="function"||!a.__typeName||a.__typeName==="Object")return Object;return a};Object.getTypeName=function(a){return Object.getType(a).getName()};String.__typeName="String";String.__class=true;String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a};String.prototype.startsWith=function(a){return this.substr(0,a.length)===a};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.trimEnd=function(){return this.replace(/\s+$/,"")};String.prototype.trimStart=function(){return this.replace(/^\s+/,"")};String.format=function(){return String._toFormattedString(false,arguments)};String.localeFormat=function(){return String._toFormattedString(true,arguments)};String._toFormattedString=function(l,j){var c="",e=j[0];for(var a=0;true;){var f=e.indexOf("{",a),d=e.indexOf("}",a);if(f<0&&d<0){c+=e.slice(a);break}if(d>0&&(d<f||f<0)){c+=e.slice(a,d+1);a=d+2;continue}c+=e.slice(a,f);a=f+1;if(e.charAt(a)==="{"){c+="{";a++;continue}if(d<0)break;var h=e.substring(a,d),g=h.indexOf(":"),k=parseInt(g<0?h:h.substring(0,g),10)+1,i=g<0?"":h.substring(g+1),b=j[k];if(typeof b==="undefined"||b===null)b="";if(b.toFormattedString)c+=b.toFormattedString(i);else if(l&&b.localeFormat)c+=b.localeFormat(i);else if(b.format)c+=b.format(i);else c+=b.toString();a=d+1}return c};Boolean.__typeName="Boolean";Boolean.__class=true;Boolean.parse=function(b){var a=b.trim().toLowerCase();if(a==="false")return false;if(a==="true")return true};Date.__typeName="Date";Date.__class=true;Date._appendPreOrPostMatch=function(e,b){var d=0,a=false;for(var c=0,g=e.length;c<g;c++){var f=e.charAt(c);switch(f){case "'":if(a)b.append("'");else d++;a=false;break;case "\\":if(a)b.append("\\");a=!a;break;default:b.append(f);a=false}}return d};Date._expandFormat=function(a,b){if(!b)b="F";if(b.length===1)switch(b){case "d":return a.ShortDatePattern;case "D":return a.LongDatePattern;case "t":return a.ShortTimePattern;case "T":return a.LongTimePattern;case "F":return a.FullDateTimePattern;case "M":case "m":return a.MonthDayPattern;case "s":return a.SortableDateTimePattern;case "Y":case "y":return a.YearMonthPattern;default:throw Error.format(Sys.Res.formatInvalidString)}return b};Date._expandYear=function(c,a){if(a<100){var b=(new Date).getFullYear();a+=b-b%100;if(a>c.Calendar.TwoDigitYearMax)return a-100}return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(g,c,h){var e=false;for(var a=1,i=h.length;a<i;a++){var f=h[a];if(f){e=true;var b=Date._parseExact(g,f,c);if(b)return b}}if(!e){var d=c._getDateTimeFormats();for(var a=0,i=d.length;a<i;a++){var b=Date._parseExact(g,d[a],c);if(b)return b}}return null};Date._parseExact=function(s,y,j){s=s.trim();var m=j.dateTimeFormat,v=Date._getParseRegExp(m,y),x=(new RegExp(v.regExp)).exec(s);if(x===null)return null;var w=v.groups,f=null,c=null,h=null,g=null,d=0,n=0,o=0,e=0,k=null,r=false;for(var p=0,z=w.length;p<z;p++){var a=x[p+1];if(a)switch(w[p]){case "dd":case "d":h=parseInt(a,10);if(h<1||h>31)return null;break;case "MMMM":c=j._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=j._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":var c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":f=Date._expandYear(m,parseInt(a,10));if(f<0||f>9999)return null;break;case "yyyy":f=parseInt(a,10);if(f<0||f>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":n=parseInt(a,10);if(n<0||n>59)return null;break;case "s":case "ss":o=parseInt(a,10);if(o<0||o>59)return null;break;case "tt":case "t":var u=a.toUpperCase();r=u===m.PMDesignator.toUpperCase();if(!r&&u!==m.AMDesignator.toUpperCase())return null;break;case "f":e=parseInt(a,10)*100;if(e<0||e>999)return null;break;case "ff":e=parseInt(a,10)*10;if(e<0||e>999)return null;break;case "fff":e=parseInt(a,10);if(e<0||e>999)return null;break;case "dddd":g=j._getDayIndex(a);if(g<0||g>6)return null;break;case "ddd":g=j._getAbbrDayIndex(a);if(g<0||g>6)return null;break;case "zzz":var q=a.split(/:/);if(q.length!==2)return null;var i=parseInt(q[0],10);if(i<-12||i>13)return null;var l=parseInt(q[1],10);if(l<0||l>59)return null;k=i*60+(a.startsWith("-")?-l:l);break;case "z":case "zz":var i=parseInt(a,10);if(i<-12||i>13)return null;k=i*60}}var b=new Date;if(f===null)f=b.getFullYear();if(c===null)c=b.getMonth();if(h===null)h=b.getDate();b.setFullYear(f,c,h);if(b.getDate()!==h)return null;if(g!==null&&b.getDay()!==g)return null;if(r&&d<12)d+=12;b.setHours(d,n,o,e);if(k!==null){var t=b.getMinutes()-(k+b.getTimezoneOffset());b.setHours(b.getHours()+parseInt(t/60,10),t%60)}return b};Date.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Date.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Date.prototype._toFormattedString=function(e,h){if(!e||e.length===0||e==="i")if(h&&h.name.length>0)return this.toLocaleString();else return this.toString();var d=h.dateTimeFormat;e=Date._expandFormat(d,e);var a=new Sys.StringBuilder,b;function c(a){if(a<10)return "0"+a;return a.toString()}function g(a){if(a<10)return "00"+a;if(a<100)return "0"+a;return a.toString()}var j=0,i=Date._getTokenRegExp();for(;true;){var l=i.lastIndex,f=i.exec(e),k=e.slice(l,f?f.index:e.length);j+=Date._appendPreOrPostMatch(k,a);if(!f)break;if(j%2===1){a.append(f[0]);continue}switch(f[0]){case "dddd":a.append(d.DayNames[this.getDay()]);break;case "ddd":a.append(d.AbbreviatedDayNames[this.getDay()]);break;case "dd":a.append(c(this.getDate()));break;case "d":a.append(this.getDate());break;case "MMMM":a.append(d.MonthNames[this.getMonth()]);break;case "MMM":a.append(d.AbbreviatedMonthNames[this.getMonth()]);break;case "MM":a.append(c(this.getMonth()+1));break;case "M":a.append(this.getMonth()+1);break;case "yyyy":a.append(this.getFullYear());break;case "yy":a.append(c(this.getFullYear()%100));break;case "y":a.append(this.getFullYear()%100);break;case "hh":b=this.getHours()%12;if(b===0)b=12;a.append(c(b));break;case "h":b=this.getHours()%12;if(b===0)b=12;a.append(b);break;case "HH":a.append(c(this.getHours()));break;case "H":a.append(this.getHours());break;case "mm":a.append(c(this.getMinutes()));break;case "m":a.append(this.getMinutes());break;case "ss":a.append(c(this.getSeconds()));break;case "s":a.append(this.getSeconds());break;case "tt":a.append(this.getHours()<12?d.AMDesignator:d.PMDesignator);break;case "t":a.append((this.getHours()<12?d.AMDesignator:d.PMDesignator).charAt(0));break;case "f":a.append(g(this.getMilliseconds()).charAt(0));break;case "ff":a.append(g(this.getMilliseconds()).substr(0,2));break;case "fff":a.append(g(this.getMilliseconds()));break;case "z":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+Math.floor(Math.abs(b)));break;case "zz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b))));break;case "zzz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b)))+d.TimeSeparator+c(Math.abs(this.getTimezoneOffset()%60)))}}return a.toString()};Number.__typeName="Number";Number.__class=true;Number.parseLocale=function(a){return Number._parse(a,Sys.CultureInfo.CurrentCulture)};Number.parseInvariant=function(a){return Number._parse(a,Sys.CultureInfo.InvariantCulture)};Number._parse=function(b,o){b=b.trim();if(b.match(/^[+-]?infinity$/i))return parseFloat(b);if(b.match(/^0x[a-f0-9]+$/i))return parseInt(b);var a=o.numberFormat,g=Number._parseNumberNegativePattern(b,a,a.NumberNegativePattern),h=g[0],e=g[1];if(h===""&&a.NumberNegativePattern!==1){g=Number._parseNumberNegativePattern(b,a,1);h=g[0];e=g[1]}if(h==="")h="+";var j,d,f=e.indexOf("e");if(f<0)f=e.indexOf("E");if(f<0){d=e;j=null}else{d=e.substr(0,f);j=e.substr(f+1)}var c,k,m=d.indexOf(a.NumberDecimalSeparator);if(m<0){c=d;k=null}else{c=d.substr(0,m);k=d.substr(m+a.NumberDecimalSeparator.length)}c=c.split(a.NumberGroupSeparator).join("");var n=a.NumberGroupSeparator.replace(/\u00A0/g," ");if(a.NumberGroupSeparator!==n)c=c.split(n).join("");var l=h+c;if(k!==null)l+="."+k;if(j!==null){var i=Number._parseNumberNegativePattern(j,a,1);if(i[0]==="")i[0]="+";l+="e"+i[0]+i[1]}if(l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))return parseFloat(l);return Number.NaN};Number._parseNumberNegativePattern=function(a,d,e){var b=d.NegativeSign,c=d.PositiveSign;switch(e){case 4:b=" "+b;c=" "+c;case 3:if(a.endsWith(b))return ["-",a.substr(0,a.length-b.length)];else if(a.endsWith(c))return ["+",a.substr(0,a.length-c.length)];break;case 2:b+=" ";c+=" ";case 1:if(a.startsWith(b))return ["-",a.substr(b.length)];else if(a.startsWith(c))return ["+",a.substr(c.length)];break;case 0:if(a.startsWith("(")&&a.endsWith(")"))return ["-",a.substr(1,a.length-2)]}return ["",a]};Number.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Number.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Number.prototype._toFormattedString=function(d,j){if(!d||d.length===0||d==="i")if(j&&j.name.length>0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b<c;b++)a=d?"0"+a:a+"0";return a}function i(j,i,l,n,p){var h=l[0],k=1,o=Math.pow(10,i),m=Math.round(j*o)/o;if(!isFinite(m))m=j;j=m;var b=j.toString(),a="",c,e=b.split(/e/i);b=e[0];c=e.length>1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k<l.length){h=l[k];k++}}return b.slice(0,d+1)+n+f+a}var a=j.numberFormat,e=Math.abs(this);if(!d)d="D";var b=-1;if(d.length>1)b=parseInt(d.slice(1),10);var c;switch(d.charAt(0)){case "d":case "D":c="n";if(b!==-1)e=g(""+e,b,true);if(this<0)e=-e;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;e=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;e=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;e=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=e;break;case "$":f+=a.CurrencySymbol;break;case "-":f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};RegExp.__typeName="RegExp";RegExp.__class=true;Array.__typeName="Array";Array.__class=true;Array.add=Array.enqueue=function(a,b){a[a.length]=b};Array.addRange=function(a,b){a.push.apply(a,b)};Array.clear=function(a){a.length=0};Array.clone=function(a){if(a.length===1)return [a[0]];else return Array.apply(null,a)};Array.contains=function(a,b){return Array.indexOf(a,b)>=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a<f;a++){var c=b[a];if(typeof c!=="undefined")e.call(d,c,a,b)}};Array.indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b<c;b++)if(typeof d[b]!=="undefined"&&d[b]===e)return b}return -1};Array.insert=function(a,b,c){a.splice(b,0,c)};Array.parse=function(value){if(!value)return [];return eval(value)};Array.remove=function(b,c){var a=Array.indexOf(b,c);if(a>=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};if(!window)this.window=this;window.Type=Function;Type.prototype.callBaseMethod=function(a,d,b){var c=this.getBaseMethod(a,d);if(!b)return c.apply(a);else return c.apply(a,b)};Type.prototype.getBaseMethod=function(d,c){var b=this.getBaseType();if(b){var a=b.prototype[c];return a instanceof Function?a:null}return null};Type.prototype.getBaseType=function(){return typeof this.__baseType==="undefined"?null:this.__baseType};Type.prototype.getInterfaces=function(){var a=[],b=this;while(b){var c=b.__interfaces;if(c)for(var d=0,f=c.length;d<f;d++){var e=c[d];if(!Array.contains(a,e))a[a.length]=e}b=b.__baseType}return a};Type.prototype.getName=function(){return typeof this.__typeName==="undefined"?"":this.__typeName};Type.prototype.implementsInterface=function(d){this.resolveInheritance();var c=d.getName(),a=this.__interfaceCache;if(a){var e=a[c];if(typeof e!=="undefined")return e}else a=this.__interfaceCache={};var b=this;while(b){var f=b.__interfaces;if(f)if(Array.indexOf(f,d)!==-1)return a[c]=true;b=b.__baseType}return a[c]=false};Type.prototype.inheritsFrom=function(b){this.resolveInheritance();var a=this.__baseType;while(a){if(a===b)return true;a=a.__baseType}return false};Type.prototype.initializeBase=function(a,b){this.resolveInheritance();if(this.__baseType)if(!b)this.__baseType.apply(a);else this.__baseType.apply(a,b);return a};Type.prototype.isImplementedBy=function(a){if(typeof a==="undefined"||a===null)return false;var b=Object.getType(a);return !!(b.implementsInterface&&b.implementsInterface(this))};Type.prototype.isInstanceOfType=function(b){if(typeof b==="undefined"||b===null)return false;if(b instanceof this)return true;var a=Object.getType(b);return !!(a===this)||a.inheritsFrom&&a.inheritsFrom(this)||a.implementsInterface&&a.implementsInterface(this)};Type.prototype.registerClass=function(c,b,d){this.prototype.constructor=this;this.__typeName=c;this.__class=true;if(b){this.__baseType=b;this.__basePrototypePending=true}Sys.__upperCaseTypes[c.toUpperCase()]=this;if(d){this.__interfaces=[];for(var a=2,f=arguments.length;a<f;a++){var e=arguments[a];this.__interfaces.push(e)}}return this};Type.prototype.registerInterface=function(a){Sys.__upperCaseTypes[a.toUpperCase()]=this;this.prototype.constructor=this;this.__typeName=a;this.__interface=true;return this};Type.prototype.resolveInheritance=function(){if(this.__basePrototypePending){var b=this.__baseType;b.resolveInheritance();for(var a in b.prototype){var c=b.prototype[a];if(!this.prototype[a])this.prototype[a]=c}delete this.__basePrototypePending}};Type.getRootNamespaces=function(){return Array.clone(Sys.__rootNamespaces)};Type.isClass=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__class};Type.isInterface=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__interface};Type.isNamespace=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__namespace};Type.parse=function(typeName,ns){var fn;if(ns){fn=Sys.__upperCaseTypes[ns.getName().toUpperCase()+"."+typeName.toUpperCase()];return fn||null}if(!typeName)return null;if(!Type.__htClasses)Type.__htClasses={};fn=Type.__htClasses[typeName];if(!fn){fn=eval(typeName);Type.__htClasses[typeName]=fn}return fn};Type.registerNamespace=function(f){var d=window,c=f.split(".");for(var b=0;b<c.length;b++){var e=c[b],a=d[e];if(!a){a=d[e]={__namespace:true,__typeName:c.slice(0,b+1).join(".")};if(b===0)Sys.__rootNamespaces[Sys.__rootNamespaces.length]=a;a.getName=function(){return this.__typeName}}d=a}};window.Sys={__namespace:true,__typeName:"Sys",getName:function(){return "Sys"},__upperCaseTypes:{}};Sys.__rootNamespaces=[Sys];Sys.IDisposable=function(){};Sys.IDisposable.prototype={};Sys.IDisposable.registerInterface("Sys.IDisposable");Sys.StringBuilder=function(a){this._parts=typeof a!=="undefined"&&a!==null&&a!==""?[a.toString()]:[];this._value={};this._len=0};Sys.StringBuilder.prototype={append:function(a){this._parts[this._parts.length]=a},appendLine:function(a){this._parts[this._parts.length]=typeof a==="undefined"||a===null||a===""?"\r\n":a+"\r\n"},clear:function(){this._parts=[];this._value={};this._len=0},isEmpty:function(){if(this._parts.length===0)return true;return this.toString()===""},toString:function(a){a=a||"";var b=this._parts;if(this._len!==b.length){this._value={};this._len=b.length}var d=this._value;if(typeof d[a]==="undefined"){if(a!=="")for(var c=0;c<b.length;)if(typeof b[c]==="undefined"||b[c]===""||b[c]===null)b.splice(c,1);else c++;d[a]=this._parts.join(a)}return d[a]}};Sys.StringBuilder.registerClass("Sys.StringBuilder");if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a<c;a++)try{return new ActiveXObject(b[a])}catch(d){}return null};Sys.Browser={};Sys.Browser.InternetExplorer={};Sys.Browser.Firefox={};Sys.Browser.Safari={};Sys.Browser.Opera={};Sys.Browser.agent=null;Sys.Browser.hasDebuggerStatement=false;Sys.Browser.name=navigator.appName;Sys.Browser.version=parseFloat(navigator.appVersion);Sys.Browser.documentMode=0;if(navigator.userAgent.indexOf(" MSIE ")>-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+="    ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e<j;e++)this._traceDump(a[e],"["+e+"]",f,b,d)}else for(g in a){h=a[g];if(!Function.isInstanceOfType(h))this._traceDump(h,g,f,b,d)}}}Array.remove(d,a)}}};Sys._Debug.registerClass("Sys._Debug");Sys.Debug=new Sys._Debug;Sys.Debug.isDebug=false;function Sys$Enum$parse(c,e){var a,b,i;if(e){a=this.__lowerCaseValues;if(!a){this.__lowerCaseValues=a={};var g=this.prototype;for(var f in g)a[f.toLowerCase()]=g[f]}}else a=this.prototype;if(!this.__flags){i=e?c.toLowerCase():c;b=a[i.trim()];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c,this.__typeName));return b}else{var h=(e?c.toLowerCase():c).split(","),j=0;for(var d=h.length-1;d>=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.EventHandlerList=function(){this._list={}};Sys.EventHandlerList.prototype={addHandler:function(b,a){Array.add(this._getEvent(b,true),a)},removeHandler:function(c,b){var a=this._getEvent(c);if(!a)return;Array.remove(a,b)},getHandler:function(b){var a=this._getEvent(b);if(!a||a.length===0)return null;a=Array.clone(a);return function(c,d){for(var b=0,e=a.length;b<e;b++)a[b](c,d)}},_getEvent:function(a,b){if(!this._list[a]){if(!b)return null;this._list[a]=[]}return this._list[a]}};Sys.EventHandlerList.registerClass("Sys.EventHandlerList");Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Sys.INotifyPropertyChange=function(){};Sys.INotifyPropertyChange.prototype={};Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");Sys.PropertyChangedEventArgs=function(a){Sys.PropertyChangedEventArgs.initializeBase(this);this._propertyName=a};Sys.PropertyChangedEventArgs.prototype={get_propertyName:function(){return this._propertyName}};Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs",Sys.EventArgs);Sys.INotifyDisposing=function(){};Sys.INotifyDisposing.prototype={};Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");Sys.Component=function(){if(Sys.Application)Sys.Application.registerDisposableObject(this)};Sys.Component.prototype={_id:null,_initialized:false,_updating:false,get_events:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_id:function(){return this._id},set_id:function(a){this._id=a},get_isInitialized:function(){return this._initialized},get_isUpdating:function(){return this._updating},add_disposing:function(a){this.get_events().addHandler("disposing",a)},remove_disposing:function(a){this.get_events().removeHandler("disposing",a)},add_propertyChanged:function(a){this.get_events().addHandler("propertyChanged",a)},remove_propertyChanged:function(a){this.get_events().removeHandler("propertyChanged",a)},beginUpdate:function(){this._updating=true},dispose:function(){if(this._events){var a=this._events.getHandler("disposing");if(a)a(this,Sys.EventArgs.Empty)}delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},endUpdate:function(){this._updating=false;if(!this._initialized)this.initialize();this.updated()},initialize:function(){this._initialized=true},raisePropertyChanged:function(b){if(!this._events)return;var a=this._events.getHandler("propertyChanged");if(a)a(this,new Sys.PropertyChangedEventArgs(b))},updated:function(){}};Sys.Component.registerClass("Sys.Component",null,Sys.IDisposable,Sys.INotifyPropertyChange,Sys.INotifyDisposing);function Sys$Component$_setProperties(a,i){var d,j=Object.getType(a),e=j===Object||j===Sys.UI.DomElement,h=Sys.Component.isInstanceOfType(a)&&!a.get_isUpdating();if(h)a.beginUpdate();for(var c in i){var b=i[c],f=e?null:a["get_"+c];if(e||typeof f!=="function"){var k=a[c];if(!b||typeof b!=="object"||e&&!k)a[c]=b;else Sys$Component$_setProperties(k,b)}else{var l=a["set_"+c];if(typeof l==="function")l.apply(a,[b]);else if(b instanceof Array){d=f.apply(a);for(var g=0,m=d.length,n=b.length;g<n;g++,m++)d[m]=b[g]}else if(typeof b==="object"&&Object.getType(b)===Object){d=f.apply(a);Sys$Component$_setProperties(d,b)}}}if(h)a.endUpdate()}function Sys$Component$_setReferences(c,b){for(var a in b){var e=c["set_"+a],d=$find(b[a]);e.apply(c,[d])}}var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,b=Sys.Application,i=b.get_isCreatingComponents();a.beginUpdate();if(f)Sys$Component$_setProperties(a,f);if(d)for(var e in d)a["add_"+e](d[e]);if(a.get_id())b.addComponent(a);if(i){b._createdComponents[b._createdComponents.length]=a;if(c)b._addComponentToSecondPass(a,c);else a.endUpdate()}else{if(c)Sys$Component$_setReferences(a,c);a.endUpdate()}return a};Sys.UI.MouseButton=function(){throw Error.notImplemented()};Sys.UI.MouseButton.prototype={leftButton:0,middleButton:1,rightButton:2};Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");Sys.UI.Key=function(){throw Error.notImplemented()};Sys.UI.Key.prototype={backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127};Sys.UI.Key.registerEnum("Sys.UI.Key");Sys.UI.Point=function(a,b){this.x=a;this.y=b};Sys.UI.Point.registerClass("Sys.UI.Point");Sys.UI.Bounds=function(c,d,b,a){this.x=c;this.y=d;this.height=a;this.width=b};Sys.UI.Bounds.registerClass("Sys.UI.Bounds");Sys.UI.DomEvent=function(e){var a=e,b=this.type=a.type.toLowerCase();this.rawEvent=a;this.altKey=a.altKey;if(typeof a.button!=="undefined")this.button=typeof a.which!=="undefined"?a.button:a.button===4?Sys.UI.MouseButton.middleButton:a.button===2?Sys.UI.MouseButton.rightButton:Sys.UI.MouseButton.leftButton;if(b==="keypress")this.charCode=a.charCode||a.keyCode;else if(a.keyCode&&a.keyCode===46)this.keyCode=127;else this.keyCode=a.keyCode;this.clientX=a.clientX;this.clientY=a.clientY;this.ctrlKey=a.ctrlKey;this.target=a.target?a.target:a.srcElement;if(!b.startsWith("key"))if(typeof a.offsetX!=="undefined"&&typeof a.offsetY!=="undefined"){this.offsetX=a.offsetX;this.offsetY=a.offsetY}else if(this.target&&this.target.nodeType!==3&&typeof a.clientX==="number"){var c=Sys.UI.DomElement.getLocation(this.target),d=Sys.UI.DomElement._getWindow(this.target);this.offsetX=(d.pageXOffset||0)+a.clientX-c.x;this.offsetY=(d.pageYOffset||0)+a.clientY-c.y}this.screenX=a.screenX;this.screenY=a.screenY;this.shiftKey=a.shiftKey};Sys.UI.DomEvent.prototype={preventDefault:function(){if(this.rawEvent.preventDefault)this.rawEvent.preventDefault();else if(window.event)this.rawEvent.returnValue=false},stopPropagation:function(){if(this.rawEvent.stopPropagation)this.rawEvent.stopPropagation();else if(window.event)this.rawEvent.cancelBubble=true}};Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");var $addHandler=Sys.UI.DomEvent.addHandler=function(a,d,e){if(!a._events)a._events={};var c=a._events[d];if(!c)a._events[d]=c=[];var b;if(a.addEventListener){b=function(b){return e.call(a,new Sys.UI.DomEvent(b))};a.addEventListener(d,b,false)}else if(a.attachEvent){b=function(){var b={};try{b=Sys.UI.DomElement._getWindow(a).event}catch(c){}return e.call(a,new Sys.UI.DomEvent(b))};a.attachEvent("on"+d,b)}c[c.length]={handler:e,browserHandler:b}},$addHandlers=Sys.UI.DomEvent.addHandlers=function(e,d,c){for(var b in d){var a=d[b];if(c)a=Function.createDelegate(c,a);$addHandler(e,b,a)}},$clearHandlers=Sys.UI.DomEvent.clearHandlers=function(a){if(a._events){var e=a._events;for(var b in e){var d=e[b];for(var c=d.length-1;c>=0;c--)$removeHandler(a,b,d[c].handler)}a._events=null}},$removeHandler=Sys.UI.DomEvent.removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);else if(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)};Sys.UI.DomElement=function(){};Sys.UI.DomElement.registerClass("Sys.UI.DomElement");Sys.UI.DomElement.addCssClass=function(a,b){if(!Sys.UI.DomElement.containsCssClass(a,b))if(a.className==="")a.className=b;else a.className+=" "+b};Sys.UI.DomElement.containsCssClass=function(b,a){return Array.contains(b.className.split(" "),a)};Sys.UI.DomElement.getBounds=function(a){var b=Sys.UI.DomElement.getLocation(a);return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0)};var $get=Sys.UI.DomElement.getElementById=function(f,e){if(!e)return document.getElementById(f);if(e.getElementById)return e.getElementById(f);var c=[],d=e.childNodes;for(var b=0;b<d.length;b++){var a=d[b];if(a.nodeType==1)c[c.length]=a}while(c.length){a=c.shift();if(a.id==f)return a;d=a.childNodes;for(b=0;b<d.length;b++){a=d[b];if(a.nodeType==1)c[c.length]=a}}return null};switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:Sys.UI.DomElement.getLocation=function(a){if(a.self||a.nodeType===9)return new Sys.UI.Point(0,0);var b=a.getBoundingClientRect();if(!b)return new Sys.UI.Point(0,0);var d=a.ownerDocument.documentElement,e=b.left-2+d.scrollLeft,f=b.top-2+d.scrollTop;try{var c=a.ownerDocument.parentWindow.frameElement||null;if(c){var g=c.frameBorder==="0"||c.frameBorder==="no"?2:0;e+=g;f+=g}}catch(h){}return new Sys.UI.Point(e,f)};break;case Sys.Browser.Safari:Sys.UI.DomElement.getLocation=function(c){if(c.window&&c.window===c||c.nodeType===9)return new Sys.UI.Point(0,0);var f=0,g=0,j=null,e=null,b;for(var a=c;a;j=a,(e=b,a=a.offsetParent)){b=Sys.UI.DomElement._getCurrentStyle(a);var d=a.tagName?a.tagName.toUpperCase():null;if((a.offsetLeft||a.offsetTop)&&(d!=="BODY"||(!e||e.position!=="absolute"))){f+=a.offsetLeft;g+=a.offsetTop}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=c.parentNode;a;a=a.parentNode){d=a.tagName?a.tagName.toUpperCase():null;if(d!=="BODY"&&d!=="HTML"&&(a.scrollLeft||a.scrollTop)){f-=a.scrollLeft||0;g-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(f,g)};break;case Sys.Browser.Opera:Sys.UI.DomElement.getLocation=function(b){if(b.window&&b.window===b||b.nodeType===9)return new Sys.UI.Point(0,0);var d=0,e=0,i=null;for(var a=b;a;i=a,a=a.offsetParent){var f=a.tagName;d+=a.offsetLeft||0;e+=a.offsetTop||0}var g=b.style.position,c=g&&g!=="static";for(var a=b.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)&&(c&&(a.style.overflow==="scroll"||a.style.overflow==="auto"))){d-=a.scrollLeft||0;e-=a.scrollTop||0}var h=a&&a.style?a.style.position:null;c=c||h&&h!=="static"}return new Sys.UI.Point(d,e)};break;default:Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,i=null,g=null,b=null;for(var a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)}}Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._sessions=[];this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopSession();this._loading=false;if(this._events)delete this._events;this._sessions=null;this._currentSession=null;this._scriptLoadedDelegate=null},loadScripts:function(d,b,c,a){var e={allScriptsLoadedCallback:b,scriptLoadFailedCallback:c,scriptLoadTimeoutCallback:a,scriptsToLoad:this._scriptsToLoad,scriptTimeout:d};this._scriptsToLoad=null;this._sessions[this._sessions.length]=e;if(!this._loading)this._nextSession()},notifyScriptLoaded:function(){if(!this._loading)return;this._currentTask._notified++;if(Sys.Browser.agent===Sys.Browser.Safari)if(this._currentTask._notified===1)window.setTimeout(Function.createDelegate(this,function(){this._scriptLoadedHandler(this._currentTask.get_scriptElement(),true)}),0)},queueCustomScriptTag:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,a)},queueScriptBlock:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{text:a})},queueScriptReference:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{src:a})},_createScriptElement:function(c){var a=document.createElement("script");a.type="text/javascript";for(var b in c)a[b]=c[b];return a},_loadScriptsInternal:function(){var b=this._currentSession;if(b.scriptsToLoad&&b.scriptsToLoad.length>0){var c=Array.dequeue(b.scriptsToLoad),a=this._createScriptElement(c);if(a.text&&Sys.Browser.agent===Sys.Browser.Safari){a.innerHTML=a.text;delete a.text}if(typeof c.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(a,this._scriptLoadedDelegate);this._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(a);Sys._ScriptLoader._clearScript(a);this._loadScriptsInternal()}}else{this._stopSession();var d=b.allScriptsLoadedCallback;if(d)d(this);this._nextSession()}},_nextSession:function(){if(this._sessions.length===0){this._loading=false;this._currentSession=null;return}this._loading=true;var a=Array.dequeue(this._sessions);this._currentSession=a;if(a.scriptTimeout>0)this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),a.scriptTimeout*1000);this._loadScriptsInternal()},_raiseError:function(a){var c=this._currentSession.scriptLoadFailedCallback,b=this._currentTask.get_scriptElement();this._stopSession();if(c){c(this,b,a);this._nextSession()}else{this._loading=false;throw Sys._ScriptLoader._errorScriptLoadFailed(b.src,a)}},_scriptLoadedHandler:function(a,b){if(b&&this._currentTask._notified)if(this._currentTask._notified>1)this._raiseError(true);else{Array.add(Sys._ScriptLoader._getLoadedScripts(),a.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}else this._raiseError(false)},_scriptLoadTimeoutHandler:function(){var a=this._currentSession.scriptLoadTimeoutCallback;this._stopSession();if(a)a(this);this._nextSession()},_stopSession:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};Sys._ScriptLoader.isScriptLoaded=function(b){var a=document.createElement("script");a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var b=Sys._ScriptLoader._referencedScripts=[],c=document.getElementsByTagName("script");for(i=c.length-1;i>=0;i--){var d=c[i],a=d.src;if(a.length)if(!Array.contains(b,a))Array.add(b,a)}}};Sys._ScriptLoader._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Sys._ScriptLoader._errorScriptLoadFailed=function(b,d){var a;if(d)a=Sys.Res.scriptLoadMultipleCallbacks;else a=Sys.Res.scriptLoadFailed;var e="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(e,{name:"Sys.ScriptLoadFailedException","scriptUrl":b});c.popStackFrame();return c};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a;this._notified=0};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoader._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;var b=this;window.setTimeout(function(){b._completedCallback(a,true)},0)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys.HistoryEventArgs=function(a){Sys.HistoryEventArgs.initializeBase(this);this._state=a};Sys.HistoryEventArgs.prototype={get_state:function(){return this._state}};Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._appLoadHandler=null;this._beginRequestHandler=null;this._clientId=null;this._currentEntry="";this._endRequestHandler=null;this._history=null;this._enableHistory=false;this._historyFrame=null;this._historyInitialized=false;this._historyInitialLength=0;this._historyLength=0;this._historyPointIsNew=false;this._ignoreTimer=false;this._initialState=null;this._state={};this._timerCookie=0;this._timerHandler=null;this._uniqueId=null;this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);this._loadHandlerDelegate=Function.createDelegate(this,this._loadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);Sys.UI.DomEvent.addHandler(window,"load",this._loadHandlerDelegate)};Sys._Application.prototype={_creatingComponents:false,_disposing:false,get_isCreatingComponents:function(){return this._creatingComponents},get_stateString:function(){var a=window.location.hash;if(this._isSafari2()){var b=this._getHistory();if(b)a=b[window.history.length-this._historyInitialLength]}if(a.length>0&&a.charAt(0)==="#")a=a.substring(1);if(Sys.Browser.agent===Sys.Browser.Firefox)a=this._serializeState(this._deserializeState(a,true));return a},get_enableHistory:function(){return this._enableHistory},set_enableHistory:function(a){this._enableHistory=a},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_navigate:function(a){this.get_events().addHandler("navigate",a)},remove_navigate:function(a){this.get_events().removeHandler("navigate",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},addHistoryPoint:function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,e=b.length;a<e;a++)b[a].dispose();Array.clear(this._disposableObjects);Sys.UI.DomEvent.removeHandler(window,"unload",this._unloadHandlerDelegate);if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}var d=Sys._ScriptLoader.getInstance();if(d)d.dispose();Sys._Application.callBaseMethod(this,"dispose")}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a<d;a++){var c=b[a].component;Sys$Component$_setReferences(c,b[a].references);c.endUpdate()}this._secondPassComponents=[];this._creatingComponents=false},findComponent:function(b,a){return a?Sys.IContainer.isInstanceOfType(a)?a.findComponent(b):a[b]||null:Sys.Application._components[b]||null},getComponents:function(){var a=[],b=this._components;for(var c in b)a[a.length]=b[c];return a},initialize:function(){if(!this._initialized&&!this._initializing){this._initializing=true;window.setTimeout(Function.createDelegate(this,this._doInitialize),0)}},notifyScriptLoaded:function(){var a=Sys._ScriptLoader.getInstance();if(a)a.notifyScriptLoaded()},registerDisposableObject:function(a){if(!this._disposing)this._disposableObjects[this._disposableObjects.length]=a},raiseLoad:function(){var b=this.get_events().getHandler("load"),a=new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!this._initializing);if(b)b(this,a);if(window.pageLoad)window.pageLoad(this,a);this._createdComponents=[]},removeComponent:function(b){var a=b.get_id();if(a)delete this._components[a]},setServerId:function(a,b){this._clientId=a;this._uniqueId=b},setServerState:function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)},unregisterDisposableObject:function(a){if(!this._disposing)Array.remove(this._disposableObjects,a)},_addComponentToSecondPass:function(b,a){this._secondPassComponents[this._secondPassComponents.length]={component:b,references:a}},_deserializeState:function(a,i){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2<a.length){e.__s=a.substr(b+2);a=a.substr(0,b)}var g=a.split("&");for(var f=0,k=g.length;f<k;f++){var d=g[f],c=d.indexOf("=");if(c!==-1&&c+1<d.length){var j=d.substr(0,c),h=d.substr(c+1);e[j]=i?h:decodeURIComponent(h)}}return e},_doInitialize:function(){Sys._Application.callBaseMethod(this,"initialize");var b=this.get_events().getHandler("init");if(b){this.beginCreateComponents();b(this,Sys.EventArgs.Empty);this.endCreateComponents()}if(Sys.WebForms){this._beginRequestHandler=Function.createDelegate(this,this._onPageRequestManagerBeginRequest);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);this._endRequestHandler=Function.createDelegate(this,this._onPageRequestManagerEndRequest);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)}var a=this.get_stateString();if(a!==this._currentEntry)this._navigate(a);this.raiseLoad();this._initializing=false},_enableHistoryInScriptManager:function(){this._enableHistory=true},_ensureHistory:function(){if(!this._historyInitialized&&this._enableHistory){if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.documentMode<8){this._historyFrame=document.getElementById("__historyFrame");this._ignoreIFrame=true}if(this._isSafari2()){var a=document.getElementById("__history");this._setHistory([window.location.hash]);this._historyInitialLength=window.history.length}this._timerHandler=Function.createDelegate(this,this._onIdle);this._timerCookie=window.setTimeout(this._timerHandler,100);try{this._initialState=this._deserializeState(this.get_stateString())}catch(b){}this._historyInitialized=true}},_getHistory:function(){var a=document.getElementById("__history");if(!a)return "";var b=a.value;return b?Sys.Serialization.JavaScriptSerializer.deserialize(b,true):""},_isSafari2:function(){return Sys.Browser.agent===Sys.Browser.Safari&&Sys.Browser.version<=419.3},_loadHandler:function(){if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}this.initialize()},_navigate:function(c){this._ensureHistory();var b=this._deserializeState(c);if(this._uniqueId){var d=this._state.__s||"",a=b.__s||"";if(a!==d){this._updateHiddenField(a);__doPostBack(this._uniqueId,a);this._state=b;return}}this._setState(c);this._state=b;this._raiseNavigate()},_onIdle:function(){delete this._timerCookie;var a=this.get_stateString();if(a!==this._currentEntry){if(!this._ignoreTimer){this._historyPointIsNew=false;this._navigate(a);this._historyLength=window.history.length}}else this._ignoreTimer=false;this._timerCookie=window.setTimeout(this._timerHandler,100)},_onIFrameLoad:function(a){this._ensureHistory();if(!this._ignoreIFrame){this._historyPointIsNew=false;this._navigate(a)}this._ignoreIFrame=false},_onPageRequestManagerBeginRequest:function(){this._ignoreTimer=true},_onPageRequestManagerEndRequest:function(e,d){var b=d.get_dataItems()[this._clientId],a=document.getElementById("__EVENTTARGET");if(a&&a.value===this._uniqueId)a.value="";if(typeof b!=="undefined"){this.setServerState(b);this._historyPointIsNew=true}else this._ignoreTimer=false;var c=this._serializeState(this._state);if(c!==this._currentEntry){this._ignoreTimer=true;this._setState(c);this._raiseNavigate()}},_raiseNavigate:function(){var c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var d=new Sys.HistoryEventArgs(b);if(c)c(this,d)},_serializeState:function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")},_setHistory:function(b){var a=document.getElementById("__history");if(a)a.value=Sys.Serialization.JavaScriptSerializer.serialize(b)},_setState:function(a,c){a=a||"";if(a!==this._currentEntry){if(window.theForm){var e=window.theForm.action,f=e.indexOf("#");window.theForm.action=(f!==-1?e.substring(0,f):e)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){this._ignoreIFrame=true;this._historyPointIsNew=false;var d=this._historyFrame.contentWindow.document;d.open("javascript:'<html></html>'");d.write("<html><head><title>"+(c||document.title)+"</title><scri"+'pt type="text/javascript">parent.Sys.Application._onIFrameLoad(\''+a+"');</scri"+"pt></head><body></body></html>");d.close()}this._ignoreTimer=false;var h=this.get_stateString();this._currentEntry=a;if(a!==h){if(this._isSafari2()){var g=this._getHistory();g[window.history.length-this._historyInitialLength+1]=a;this._setHistory(g);this._historyLength=window.history.length+1;var b=document.createElement("form");b.method="get";b.action="#"+a;document.appendChild(b);b.submit();document.removeChild(b)}else window.location.hash=a;if(typeof c!=="undefined"&&c!==null)document.title=c}}},_unloadHandler:function(){this.dispose()},_updateHiddenField:function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Type.registerNamespace("Sys.Net");Sys.Net.WebRequestExecutor=function(){this._webRequest=null;this._resultObject=null};Sys.Net.WebRequestExecutor.prototype={get_webRequest:function(){return this._webRequest},_set_webRequest:function(a){this._webRequest=a},get_started:function(){throw Error.notImplemented()},get_responseAvailable:function(){throw Error.notImplemented()},get_timedOut:function(){throw Error.notImplemented()},get_aborted:function(){throw Error.notImplemented()},get_responseData:function(){throw Error.notImplemented()},get_statusCode:function(){throw Error.notImplemented()},get_statusText:function(){throw Error.notImplemented()},get_xml:function(){throw Error.notImplemented()},get_object:function(){if(!this._resultObject)this._resultObject=Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());return this._resultObject},executeRequest:function(){throw Error.notImplemented()},abort:function(){throw Error.notImplemented()},getResponseHeader:function(){throw Error.notImplemented()},getAllResponseHeaders:function(){throw Error.notImplemented()}};Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");Sys.Net.XMLDOM=function(d){if(!window.DOMParser){var c=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"];for(var b=0,f=c.length;b<f;b++)try{var a=new ActiveXObject(c[b]);a.async=false;a.loadXML(d);a.setProperty("SelectionLanguage","XPath");return a}catch(g){}}else try{var e=new window.DOMParser;return e.parseFromString(d,"text/xml")}catch(g){}return null};Sys.Net.XMLHttpExecutor=function(){Sys.Net.XMLHttpExecutor.initializeBase(this);var a=this;this._xmlHttpRequest=null;this._webRequest=null;this._responseAvailable=false;this._timedOut=false;this._timer=null;this._aborted=false;this._started=false;this._onReadyStateChange=function(){if(a._xmlHttpRequest.readyState===4){try{if(typeof a._xmlHttpRequest.status==="undefined")return}catch(b){return}a._clearTimer();a._responseAvailable=true;try{a._webRequest.completed(Sys.EventArgs.Empty)}finally{if(a._xmlHttpRequest!=null){a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest=null}}}};this._clearTimer=function(){if(a._timer!=null){window.clearTimeout(a._timer);a._timer=null}};this._onTimeout=function(){if(!a._responseAvailable){a._clearTimer();a._timedOut=true;a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest.abort();a._webRequest.completed(Sys.EventArgs.Empty);a._xmlHttpRequest=null}}};Sys.Net.XMLHttpExecutor.prototype={get_timedOut:function(){return this._timedOut},get_started:function(){return this._started},get_responseAvailable:function(){return this._responseAvailable},get_aborted:function(){return this._aborted},executeRequest:function(){this._webRequest=this.get_webRequest();var c=this._webRequest.get_body(),a=this._webRequest.get_headers();this._xmlHttpRequest=new XMLHttpRequest;this._xmlHttpRequest.onreadystatechange=this._onReadyStateChange;var e=this._webRequest.get_httpVerb();this._xmlHttpRequest.open(e,this._webRequest.getResolvedUrl(),true);if(a)for(var b in a){var f=a[b];if(typeof f!=="function")this._xmlHttpRequest.setRequestHeader(b,f)}if(e.toLowerCase()==="post"){if(a===null||!a["Content-Type"])this._xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");if(!c)c=""}var d=this._webRequest.get_timeout();if(d>0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(d,b){if(!b)b=encodeURIComponent;var a=new Sys.StringBuilder,f=0;for(var c in d){var e=d[c];if(typeof e==="function")continue;var g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(f!==0)a.append("&");a.append(c);a.append("=");a.append(b(g));f++}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b){if(!b)return a;var d=Sys.Net.WebRequest._createQueryString(b);if(d.length>0){var c="?";if(a&&a.indexOf("?")!==-1)c="&";return a+c+d}else return a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed},set_defaultFailedCallback:function(a){this._failed=a},get_path:function(){return this._path},set_path:function(a){this._path=a},_invoke:function(d,e,g,f,c,b,a){if(c===null||typeof c==="undefined")c=this.get_defaultSucceededCallback();if(b===null||typeof b==="undefined")b=this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(k,a,j,d,i,c,f,h){var b=new Sys.Net.WebRequest;b.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!d)d={};var g=d;if(!j||!g)g={};b.set_url(Sys.Net.WebRequest._createUrl(k+"/"+encodeURIComponent(a),g));var e=null;if(!j){e=Sys.Serialization.JavaScriptSerializer.serialize(d);if(e==="{}")e=""}b.set_body(e);b.add_completed(l);if(h&&h>0)b.set_timeout(h);b.invoke();function l(d){if(d.get_responseAvailable()){var g=d.get_statusCode(),b=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))b=d.get_object();else if(e.startsWith("text/xml"))b=d.get_xml();else b=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(b)b=new Sys.Net.WebServiceError(false,b.Message,b.StackTrace,b.ExceptionType)}else if(e.startsWith("application/json"))b=b.d;if(g<200||g>=300||h){if(c){if(!b||!h)b=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a),"","");b._statusCode=g;c(b,f,a)}}else if(i)i(b,f,a)}else{var j;if(d.get_timedOut())j=String.format(Sys.Res.webServiceTimedOut,a);else j=String.format(Sys.Res.webServiceFailedNoMsg,a);if(c)c(new Sys.Net.WebServiceError(d.get_timedOut(),j,"",""),f,a)}}return b};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys.Net.WebServiceError=function(c,d,b,a){this._timedOut=c;this._message=d;this._stackTrace=b;this._exceptionType=a;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace},get_exceptionType:function(){return this._exceptionType}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");Sys.Services._ProfileService=function(){Sys.Services._ProfileService.initializeBase(this);this.properties={}};Sys.Services._ProfileService.DefaultWebServicePath="";Sys.Services._ProfileService.prototype={_defaultLoadCompletedCallback:null,_defaultSaveCompletedCallback:null,_path:"",_timeout:0,get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_defaultSaveCompletedCallback:function(){return this._defaultSaveCompletedCallback},set_defaultSaveCompletedCallback:function(a){this._defaultSaveCompletedCallback=a},get_path:function(){return this._path||""},load:function(c,d,e,f){var b,a;if(!c){a="GetAllPropertiesForCurrentUser";b={authenticatedUserOnly:false}}else{a="GetPropertiesForCurrentUser";b={properties:this._clonePropertyNames(c),authenticatedUserOnly:false}}this._invoke(this._get_path(),a,false,b,Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[d,e,f])},save:function(d,b,c,e){var a=this._flattenProperties(d,this.properties);this._invoke(this._get_path(),"SetPropertiesForCurrentUser",false,{values:a.value,authenticatedUserOnly:false},Function.createDelegate(this,this._onSaveComplete),Function.createDelegate(this,this._onSaveFailed),[b,c,e,a.count])},_clonePropertyNames:function(e){var c=[],d={};for(var b=0;b<e.length;b++){var a=e[b];if(!d[a]){Array.add(c,a);d[a]=true}}return c},_flattenProperties:function(a,i,j){var b={},e,d,g=0;if(a&&a.length===0)return {value:b,count:0};for(var c in i){e=i[c];d=j?j+"."+c:c;if(Sys.Services.ProfileGroup.isInstanceOfType(e)){var k=this._flattenProperties(a,e,d),h=k.value;g+=k.count;for(var f in h){var l=h[f];b[f]=l}}else if(!a||Array.indexOf(a,d)!==-1){b[d]=e;g++}}return {value:b,count:g}},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._ProfileService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoadComplete:function(a,e,g){if(typeof a!=="object")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,g,"Object"));var c=this._unflattenProperties(a);for(var b in c)this.properties[b]=c[b];var d=e[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(d){var f=e[2]||this.get_defaultUserContext();d(a.length,f,"Sys.Services.ProfileService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.load")}},_onSaveComplete:function(a,b,f){var c=b[3];if(a!==null)if(a instanceof Array)c-=a.length;else if(typeof a==="number")c=a;else throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));var d=b[0]||this.get_defaultSaveCompletedCallback()||this.get_defaultSucceededCallback();if(d){var e=b[2]||this.get_defaultUserContext();d(c,e,"Sys.Services.ProfileService.save")}},_onSaveFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.save")}},_unflattenProperties:function(e){var c={},d,f,h=0;for(var a in e){h++;f=e[a];d=a.indexOf(".");if(d!==-1){var g=a.substr(0,d);a=a.substr(d+1);var b=c[g];if(!b||!Sys.Services.ProfileGroup.isInstanceOfType(b)){b=new Sys.Services.ProfileGroup;c[g]=b}b[a]=f}else c[a]=f}e.length=h;return c}};Sys.Services._ProfileService.registerClass("Sys.Services._ProfileService",Sys.Net.WebServiceProxy);Sys.Services.ProfileService=new Sys.Services._ProfileService;Sys.Services.ProfileGroup=function(a){if(a)for(var b in a)this[b]=a[b]};Sys.Services.ProfileGroup.registerClass("Sys.Services.ProfileGroup");Sys.Services._AuthenticationService=function(){Sys.Services._AuthenticationService.initializeBase(this)};Sys.Services._AuthenticationService.DefaultWebServicePath="";Sys.Services._AuthenticationService.prototype={_defaultLoginCompletedCallback:null,_defaultLogoutCompletedCallback:null,_path:"",_timeout:0,_authenticated:false,get_defaultLoginCompletedCallback:function(){return this._defaultLoginCompletedCallback},set_defaultLoginCompletedCallback:function(a){this._defaultLoginCompletedCallback=a},get_defaultLogoutCompletedCallback:function(){return this._defaultLogoutCompletedCallback},set_defaultLogoutCompletedCallback:function(a){this._defaultLogoutCompletedCallback=a},get_isLoggedIn:function(){return this._authenticated},get_path:function(){return this._path||""},login:function(c,b,a,h,f,d,e,g){this._invoke(this._get_path(),"Login",false,{userName:c,password:b,createPersistentCookie:a},Function.createDelegate(this,this._onLoginComplete),Function.createDelegate(this,this._onLoginFailed),[c,b,a,h,f,d,e,g])},logout:function(c,a,b,d){this._invoke(this._get_path(),"Logout",false,{},Function.createDelegate(this,this._onLogoutComplete),Function.createDelegate(this,this._onLogoutFailed),[c,a,b,d])},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._AuthenticationService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoginComplete:function(e,c,f){if(typeof e!=="boolean")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Boolean"));var b=c[4],d=c[7]||this.get_defaultUserContext(),a=c[5]||this.get_defaultLoginCompletedCallback()||this.get_defaultSucceededCallback();if(e){this._authenticated=true;if(a)a(true,d,"Sys.Services.AuthenticationService.login");if(typeof b!=="undefined"&&b!==null)window.location.href=b}else if(a)a(false,d,"Sys.Services.AuthenticationService.login")},_onLoginFailed:function(d,b){var a=b[6]||this.get_defaultFailedCallback();if(a){var c=b[7]||this.get_defaultUserContext();a(d,c,"Sys.Services.AuthenticationService.login")}},_onLogoutComplete:function(f,a,e){if(f!==null)throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,e,"null"));var b=a[0],d=a[3]||this.get_defaultUserContext(),c=a[1]||this.get_defaultLogoutCompletedCallback()||this.get_defaultSucceededCallback();this._authenticated=false;if(c)c(null,d,"Sys.Services.AuthenticationService.logout");if(!b)window.location.reload();else window.location.href=b},_onLogoutFailed:function(c,b){var a=b[2]||this.get_defaultFailedCallback();if(a)a(c,b[3],"Sys.Services.AuthenticationService.logout")},_setAuthenticated:function(a){this._authenticated=a}};Sys.Services._AuthenticationService.registerClass("Sys.Services._AuthenticationService",Sys.Net.WebServiceProxy);Sys.Services.AuthenticationService=new Sys.Services._AuthenticationService;Sys.Services._RoleService=function(){Sys.Services._RoleService.initializeBase(this);this._roles=[]};Sys.Services._RoleService.DefaultWebServicePath="";Sys.Services._RoleService.prototype={_defaultLoadCompletedCallback:null,_rolesIndex:null,_timeout:0,_path:"",get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_path:function(){return this._path||""},get_roles:function(){return Array.clone(this._roles)},isUserInRole:function(a){var b=this._get_rolesIndex()[a.trim().toLowerCase()];return !!b},load:function(a,b,c){Sys.Net.WebServiceProxy.invoke(this._get_path(),"GetRolesForCurrentUser",false,{},Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[a,b,c],this.get_timeout())},_get_path:function(){var a=this.get_path();if(!a||!a.length)a=Sys.Services._RoleService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_get_rolesIndex:function(){if(!this._rolesIndex){var b={};for(var a=0;a<this._roles.length;a++)b[this._roles[a].toLowerCase()]=true;this._rolesIndex=b}return this._rolesIndex},_onLoadComplete:function(a,c,f){if(a&&!(a instanceof Array))throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));this._roles=a;this._rolesIndex=null;var b=c[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(b){var e=c[2]||this.get_defaultUserContext(),d=Array.clone(a);b(d,e,"Sys.Services.RoleService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.RoleService.load")}}};Sys.Services._RoleService.registerClass("Sys.Services._RoleService",Sys.Net.WebServiceProxy);Sys.Services.RoleService=new Sys.Services._RoleService;Type.registerNamespace("Sys.Serialization");Sys.Serialization.JavaScriptSerializer=function(){};Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs=[];Sys.Serialization.JavaScriptSerializer._charsToEscape=[];Sys.Serialization.JavaScriptSerializer._dateRegEx=new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars={};Sys.Serialization.JavaScriptSerializer._escapeRegEx=new RegExp('["\\\\\\x00-\\x1F]',"i");Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal=new RegExp('["\\\\\\x00-\\x1F]',"g");Sys.Serialization.JavaScriptSerializer._jsonRegEx=new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]","g");Sys.Serialization.JavaScriptSerializer._jsonStringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"',"g");Sys.Serialization.JavaScriptSerializer._serverTypeFieldName="__type";Sys.Serialization.JavaScriptSerializer._init=function(){var c=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f"];Sys.Serialization.JavaScriptSerializer._charsToEscape[0]="\\";Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"]=new RegExp("\\\\","g");Sys.Serialization.JavaScriptSerializer._escapeChars["\\"]="\\\\";Sys.Serialization.JavaScriptSerializer._charsToEscape[1]='"';Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"']=new RegExp('"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars['"']='\\"';for(var a=0;a<32;a++){var b=String.fromCharCode(a);Sys.Serialization.JavaScriptSerializer._charsToEscape[a+2]=b;Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b]=new RegExp(b,"g");Sys.Serialization.JavaScriptSerializer._escapeChars[b]=c[a]}};Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder=function(b,a){a.append(b.toString())};Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder=function(a,b){if(isFinite(a))b.append(String(a));else throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)};Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder=function(a,c){c.append('"');if(Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)){if(Sys.Serialization.JavaScriptSerializer._charsToEscape.length===0)Sys.Serialization.JavaScriptSerializer._init();if(a.length<128)a=a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal,function(a){return Sys.Serialization.JavaScriptSerializer._escapeChars[a]});else for(var d=0;d<34;d++){var b=Sys.Serialization.JavaScriptSerializer._charsToEscape[d];if(a.indexOf(b)!==-1)if(Sys.Browser.agent===Sys.Browser.Opera||Sys.Browser.agent===Sys.Browser.FireFox)a=a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]);else a=a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b],Sys.Serialization.JavaScriptSerializer._escapeChars[b])}}c.append(a);c.append('"')};Sys.Serialization.JavaScriptSerializer._serializeWithBuilder=function(b,a,i,g){var c;switch(typeof b){case "object":if(b)if(Number.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);else if(Boolean.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);else if(String.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);else if(Array.isInstanceOfType(b)){a.append("[");for(c=0;c<b.length;++c){if(c>0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c<f;c++){var h=b[d[c]];if(typeof h!=="undefined"&&typeof h!=="function"){if(j)a.append(",");else j=true;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c],a,i,g);a.append(":");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h,a,i,g)}}a.append("}")}else a.append("null");break;case "number":Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);break;case "string":Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);break;case "boolean":Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);break;default:a.append("null")}};Sys.Serialization.JavaScriptSerializer.serialize=function(b){var a=new Sys.StringBuilder;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b,a,false);return a.toString()};Sys.Serialization.JavaScriptSerializer.deserialize=function(data,secure){if(data.length===0)throw Error.argument("data",Sys.Res.cannotDeserializeEmptyString);try{var exp=data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx,"$1new Date($2)");if(secure&&Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx,"")))throw null;return eval("("+exp+")")}catch(a){throw Error.argument("data",Sys.Res.cannotDeserializeInvalidJson)}};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getMonthIndex:function(a){if(!this._upperMonths)this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);return Array.indexOf(this._upperMonths,this._toUpper(a))},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths)this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(this._upperAbbrMonths,this._toUpper(a))},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a<d;a++)b[a]=this._toUpper(c[a]);return b},_toUpper:function(a){return a.split("\u00a0").join(" ").toUpperCase()}};Sys.CultureInfo._parse=function(b){var a=Sys.Serialization.JavaScriptSerializer.deserialize(b);return new Sys.CultureInfo(a.name,a.numberFormat,a.dateTimeFormat)};Sys.CultureInfo.registerClass("Sys.CultureInfo");Sys.CultureInfo.InvariantCulture=Sys.CultureInfo._parse('{"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00a4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}');if(typeof __cultureInfo==="undefined")var __cultureInfo='{"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}';Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse(__cultureInfo);delete __cultureInfo;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!=-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");if(this._element){var a=this.get_name();if(a)this._element[a]=null;Array.remove(this._element._behaviors,this);delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b<f;b++)if(e.isInstanceOfType(a[b]))c[c.length]=a[b];return c};Sys.UI.VisibilityMode=function(){throw Error.notImplemented()};Sys.UI.VisibilityMode.prototype={hide:0,collapse:1};Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");Sys.UI.Control=function(a){Sys.UI.Control.initializeBase(this);this._element=a;a.control=this};Sys.UI.Control.prototype={_parent:null,_visibilityMode:Sys.UI.VisibilityMode.hide,get_element:function(){return this._element},get_id:function(){if(!this._element)return "";return this._element.id},set_id:function(){throw Error.invalidOperation(Sys.Res.cantSetId)},get_parent:function(){if(this._parent)return this._parent;if(!this._element)return null;var a=this._element.parentNode;while(a){if(a.control)return a.control;a=a.parentNode}return null},set_parent:function(a){this._parent=a},get_visibilityMode:function(){return Sys.UI.DomElement.getVisibilityMode(this._element)},set_visibilityMode:function(a){Sys.UI.DomElement.setVisibilityMode(this._element,a)},get_visible:function(){return Sys.UI.DomElement.getVisible(this._element)},set_visible:function(a){Sys.UI.DomElement.setVisible(this._element,a)},addCssClass:function(a){Sys.UI.DomElement.addCssClass(this._element,a)},dispose:function(){Sys.UI.Control.callBaseMethod(this,"dispose");if(this._element){this._element.control=undefined;delete this._element}if(this._parent)delete this._parent},onBubbleEvent:function(){return false},raiseBubbleEvent:function(b,c){var a=this.get_parent();while(a){if(a.onBubbleEvent(b,c))return;a=a.get_parent()}},removeCssClass:function(a){Sys.UI.DomElement.removeCssClass(this._element,a)},toggleCssClass:function(a){Sys.UI.DomElement.toggleCssClass(this._element,a)}};Sys.UI.Control.registerClass("Sys.UI.Control",Sys.Component);
Sys.Res={
"argumentInteger":"Value must be an integer.","scriptLoadMultipleCallbacks":"The script \u0027{0}\u0027 contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.","invokeCalledTwice":"Cannot call invoke more than once.","webServiceFailed":"The server method \u0027{0}\u0027 failed with the following error: {1}","webServiceInvalidJsonWrapper":"The server method \u0027{0}\u0027 returned invalid data. The \u0027d\u0027 property is missing from the JSON wrapper.","argumentType":"Object cannot be converted to the required type.","argumentNull":"Value cannot be null.","controlCantSetId":"The id property can\u0027t be set on a control.","formatBadFormatSpecifier":"Format specifier was invalid.","webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.","argumentDomElement":"Value must be a DOM element.","invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.","cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.","actualValue":"Actual value was {0}.","enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.","scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.","parameterCount":"Parameter count mismatch.","cannotDeserializeEmptyString":"Cannot deserialize empty string.","formatInvalidString":"Input string was not in a correct format.","invalidTimeout":"Value must be greater than or equal to zero.","cannotAbortBeforeStart":"Cannot abort when executor has not started.","argument":"Value does not fall within the expected range.","cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.","invalidHttpVerb":"httpVerb cannot be set to an empty or null string.","nullWebRequest":"Cannot call executeRequest with a null webRequest.","eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler method.","cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.","argumentUndefined":"Value cannot be undefined.","webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}","servicePathNotSet":"The path to the web service has not been set.","argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.","cannotCallOnceStarted":"Cannot call {0} once started.","badBaseUrl1":"Base URL does not contain ://.","badBaseUrl2":"Base URL does not contain another /.","badBaseUrl3":"Cannot find last / in base URL.","setExecutorAfterActive":"Cannot set executor after it has become active.","paramName":"Parameter name: {0}","cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.","cannotSerializeObjectWithCycle":"Cannot serialize object with cyclic reference within child properties.","format":"One of the identified items was in an invalid format.","assertFailedCaller":"Assertion Failed: {0}\r\nat {1}","argumentOutOfRange":"Specified argument was out of the range of valid values.","webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.","notImplemented":"The method or operation is not implemented.","assertFailed":"Assertion Failed: {0}","invalidOperation":"Operation is not valid due to the current state of the object.","breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?"};
/* END MicrosoftAjax.js */
/* START Telerik.Web.UI.Common.Core.js */
try{
document.execCommand("BackgroundImageCache",false,true);
}
catch(err){
}
Type.registerNamespace("Telerik.Web.UI");
window.$telerik=window.TelerikCommonScripts=Telerik.Web.CommonScripts={getOuterSize:function(_1){
var _2=$telerik.getSize(_1);
var _3=$telerik.getMarginBox(_1);
return {x:_2.x-_3.left,y:_2.y-_3.top,width:_2.width+_3.left+_3.right,height:_2.height+_3.top+_3.bottom};
},_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],radControls:[],registerControl:function(_4){
if(!Array.contains(this.radControls,_4)){
Array.add(this.radControls,_4);
}
},unregisterControl:function(_5){
Array.remove(this.radControls,_5);
},repaintChildren:function(_6){
var _7=_6.get_element();
for(var i=0,_9=this.radControls.length;i<_9;i++){
var _a=this.radControls[i];
if(_a.repaint&&this.isDescendant(_7,_a.get_element())){
_a.repaint();
}
}
},_borderThickness:function(){
$telerik._borderThicknesses={};
var _b=document.createElement("div");
var _c=document.createElement("div");
_b.style.visibility="hidden";
_b.style.position="absolute";
_b.style.fontSize="1px";
_c.style.height="0px";
_c.style.overflow="hidden";
document.body.appendChild(_b).appendChild(_c);
var _d=_b.offsetHeight;
_c.style.borderTop="solid black";
_c.style.borderTopWidth="thin";
$telerik._borderThicknesses["thin"]=_b.offsetHeight-_d;
_c.style.borderTopWidth="medium";
$telerik._borderThicknesses["medium"]=_b.offsetHeight-_d;
_c.style.borderTopWidth="thick";
$telerik._borderThicknesses["thick"]=_b.offsetHeight-_d;
if(typeof (_b.removeChild)!=="undefined"){
_b.removeChild(_c);
}
document.body.removeChild(_b);
if(!$telerik.isSafari){
_c.outerHTML=null;
}
if(!$telerik.isSafari){
_b.outerHTML=null;
}
_b=null;
_c=null;
},getCurrentStyle:function(_e,_f,_10){
var _11=null;
if(_e){
if(_e.currentStyle){
_11=_e.currentStyle[_f];
}else{
if(document.defaultView&&document.defaultView.getComputedStyle){
var _12=document.defaultView.getComputedStyle(_e,null);
if(_12){
_11=_12[_f];
}
}
}
if(!_11&&_e.style.getPropertyValue){
_11=_e.style.getPropertyValue(_f);
}else{
if(!_11&&_e.style.getAttribute){
_11=_e.style.getAttribute(_f);
}
}
}
if((!_11||_11==""||typeof (_11)==="undefined")){
if(typeof (_10)!="undefined"){
_11=_10;
}else{
_11=null;
}
}
return _11;
},getInheritedBackgroundColor:function(_13){
if(!_13){
return "#FFFFFF";
}
var _14=$telerik.getCurrentStyle(_13,"backgroundColor");
try{
while(!_14||_14==""||_14=="transparent"||_14=="rgba(0, 0, 0, 0)"){
_13=_13.parentNode;
if(!_13){
_14="#FFFFFF";
}else{
_14=$telerik.getCurrentStyle(_13,"backgroundColor");
}
}
}
catch(ex){
_14="#FFFFFF";
}
return _14;
},getLocation:function(_15){
if(_15===document.documentElement){
return new Sys.UI.Point(0,0);
}
if(Sys.Browser.agent==Sys.Browser.InternetExplorer){
if(_15.window===_15||_15.nodeType===9||!_15.getClientRects||!_15.getBoundingClientRect){
return new Sys.UI.Point(0,0);
}
var _16=_15.getClientRects();
if(!_16||!_16.length){
return new Sys.UI.Point(0,0);
}
var _17=_16[0];
var _18=0;
var _19=0;
var _1a=false;
try{
_1a=_15.ownerDocument.parentWindow.frameElement;
}
catch(ex){
_1a=true;
}
if(_1a){
var _1b=_15.getBoundingClientRect();
if(!_1b){
return new Sys.UI.Point(0,0);
}
var _1c=_17.left;
var _1d=_17.top;
for(var i=1;i<_16.length;i++){
var r=_16[i];
if(r.left<_1c){
_1c=r.left;
}
if(r.top<_1d){
_1d=r.top;
}
}
_18=_1c-_1b.left;
_19=_1d-_1b.top;
}
var _20=_15.document.documentElement;
var _21=new Sys.UI.Point(_17.left-2-_18+_20.scrollLeft,_17.top-2-_19+_20.scrollTop);
if($telerik.quirksMode){
_21.x+=document.body.scrollLeft;
_21.y+=document.body.scrollTop;
}
return _21;
}
var _21=Sys.UI.DomElement.getLocation(_15);
if($telerik.isOpera){
var _22=_15.offsetParent;
while(_22&&_22.tagName.toUpperCase()!="BODY"&&_22.tagName.toUpperCase()!="HTML"){
_21.x-=_22.scrollLeft;
_21.y-=_22.scrollTop;
_22=_22.offsetParent;
}
}
if($telerik.isSafari){
var _22=_15.parentNode;
var _23=null;
var _24=null;
while(_22&&_22.tagName.toUpperCase()!="BODY"&&_22.tagName.toUpperCase()!="HTML"){
if($telerik.isSafari3||$telerik.isSafari2){
if(_22.tagName.toUpperCase()=="TD"){
_23=_22;
}else{
if(_22.tagName.toUpperCase()=="TABLE"){
_24=_22;
}
}
if(_23&&_24){
_21.x+=parseInt($telerik.getCurrentStyle(_24,"borderTopWidth"));
_21.y+=parseInt($telerik.getCurrentStyle(_24,"borderLeftWidth"));
if($telerik.getCurrentStyle(_24,"borderCollapse")!="collapse"){
_21.x+=parseInt($telerik.getCurrentStyle(_23,"borderTopWidth"));
_21.y+=parseInt($telerik.getCurrentStyle(_23,"borderLeftWidth"));
}
_23=null;
_24=null;
}else{
if(_24){
if($telerik.getCurrentStyle(_24,"borderCollapse")!="collapse"){
_21.x+=parseInt($telerik.getCurrentStyle(_24,"borderTopWidth"));
_21.y+=parseInt($telerik.getCurrentStyle(_24,"borderLeftWidth"));
}
_24=null;
}
}
}
_22=_22.parentNode;
}
}
if($telerik.isIE&&$telerik.quirksMode){
_21.x+=document.body.scrollLeft;
_21.y+=document.body.scrollTop;
}
return _21;
},setLocation:function(_25,_26){
Sys.UI.DomElement.setLocation(_25,_26.x,_26.y);
},findControl:function(_27,id){
var _29=_27.getElementsByTagName("*");
for(var i=0,l=_29.length;i<l;i++){
var _2c=_29[i].id;
if(_2c&&_2c.endsWith(id)){
return $find(_2c);
}
}
return null;
},findElement:function(_2d,id){
var _2f=_2d.getElementsByTagName("*");
for(var i=0,l=_2f.length;i<l;i++){
var _32=_2f[i].id;
if(_32&&_32.endsWith(id)){
return $get(_32);
}
}
return null;
},getContentSize:function(_33){
if(!_33){
throw Error.argumentNull("element");
}
var _34=$telerik.getSize(_33);
var _35=$telerik.getBorderBox(_33);
var _36=$telerik.getPaddingBox(_33);
return {width:_34.width-_35.horizontal-_36.horizontal,height:_34.height-_35.vertical-_36.vertical};
},getSize:function(_37){
if(!_37){
throw Error.argumentNull("element");
}
return {width:_37.offsetWidth,height:_37.offsetHeight};
},setContentSize:function(_38,_39){
if(!_38){
throw Error.argumentNull("element");
}
if(!_39){
throw Error.argumentNull("size");
}
if($telerik.getCurrentStyle(_38,"MozBoxSizing")=="border-box"||$telerik.getCurrentStyle(_38,"BoxSizing")=="border-box"){
var _3a=$telerik.getBorderBox(_38);
var _3b=$telerik.getPaddingBox(_38);
_39={width:_39.width+_3a.horizontal+_3b.horizontal,height:_39.height+_3a.vertical+_3b.vertical};
}
_38.style.width=_39.width.toString()+"px";
_38.style.height=_39.height.toString()+"px";
},setSize:function(_3c,_3d){
if(!_3c){
throw Error.argumentNull("element");
}
if(!_3d){
throw Error.argumentNull("size");
}
var _3e=$telerik.getBorderBox(_3c);
var _3f=$telerik.getPaddingBox(_3c);
var _40={width:_3d.width-_3e.horizontal-_3f.horizontal,height:_3d.height-_3e.vertical-_3f.vertical};
$telerik.setContentSize(_3c,_40);
},getBounds:function(_41){
var _42=$telerik.getLocation(_41);
return new Sys.UI.Bounds(_42.x,_42.y,_41.offsetWidth||0,_41.offsetHeight||0);
},setBounds:function(_43,_44){
if(!_43){
throw Error.argumentNull("element");
}
if(!_44){
throw Error.argumentNull("bounds");
}
$telerik.setSize(_43,_44);
$telerik.setLocation(_43,_44);
},getClientBounds:function(){
var _45;
var _46;
switch(Sys.Browser.agent){
case Sys.Browser.InternetExplorer:
_45=document.documentElement.clientWidth;
_46=document.documentElement.clientHeight;
if(_45==0&&_46==0){
_45=document.body.clientWidth;
_46=document.body.clientHeight;
}
break;
case Sys.Browser.Safari:
_45=window.innerWidth;
_46=window.innerHeight;
break;
case Sys.Browser.Opera:
_45=Math.min(window.innerWidth,document.body.clientWidth);
_46=Math.min(window.innerHeight,document.body.clientHeight);
break;
default:
_45=Math.min(window.innerWidth,document.documentElement.clientWidth);
_46=Math.min(window.innerHeight,document.documentElement.clientHeight);
break;
}
return new Sys.UI.Bounds(0,0,_45,_46);
},getMarginBox:function(_47){
if(!_47){
throw Error.argumentNull("element");
}
var box={top:$telerik.getMargin(_47,Telerik.Web.BoxSide.Top),right:$telerik.getMargin(_47,Telerik.Web.BoxSide.Right),bottom:$telerik.getMargin(_47,Telerik.Web.BoxSide.Bottom),left:$telerik.getMargin(_47,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},getPaddingBox:function(_49){
if(!_49){
throw Error.argumentNull("element");
}
var box={top:$telerik.getPadding(_49,Telerik.Web.BoxSide.Top),right:$telerik.getPadding(_49,Telerik.Web.BoxSide.Right),bottom:$telerik.getPadding(_49,Telerik.Web.BoxSide.Bottom),left:$telerik.getPadding(_49,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},getBorderBox:function(_4b){
if(!_4b){
throw Error.argumentNull("element");
}
var box={top:$telerik.getBorderWidth(_4b,Telerik.Web.BoxSide.Top),right:$telerik.getBorderWidth(_4b,Telerik.Web.BoxSide.Right),bottom:$telerik.getBorderWidth(_4b,Telerik.Web.BoxSide.Bottom),left:$telerik.getBorderWidth(_4b,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},isBorderVisible:function(_4d,_4e){
if(!_4d){
throw Error.argumentNull("element");
}
if(_4e<Telerik.Web.BoxSide.Top||_4e>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_4e,"Telerik.Web.BoxSide"));
}
var _4f=$telerik._borderStyleNames[_4e];
var _50=$telerik.getCurrentStyle(_4d,_4f);
return _50!="none";
},getMargin:function(_51,_52){
if(!_51){
throw Error.argumentNull("element");
}
if(_52<Telerik.Web.BoxSide.Top||_52>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_52,"Telerik.Web.BoxSide"));
}
var _53=$telerik._marginWidthNames[_52];
var _54=$telerik.getCurrentStyle(_51,_53);
try{
return $telerik.parsePadding(_54);
}
catch(ex){
return 0;
}
},getBorderWidth:function(_55,_56){
if(!_55){
throw Error.argumentNull("element");
}
if(_56<Telerik.Web.BoxSide.Top||_56>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_56,"Telerik.Web.BoxSide"));
}
if(!$telerik.isBorderVisible(_55,_56)){
return 0;
}
var _57=$telerik._borderWidthNames[_56];
var _58=$telerik.getCurrentStyle(_55,_57);
return $telerik.parseBorderWidth(_58);
},getPadding:function(_59,_5a){
if(!_59){
throw Error.argumentNull("element");
}
if(_5a<Telerik.Web.BoxSide.Top||_5a>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_5a,"Telerik.Web.BoxSide"));
}
var _5b=$telerik._paddingWidthNames[_5a];
var _5c=$telerik.getCurrentStyle(_59,_5b);
return $telerik.parsePadding(_5c);
},parseBorderWidth:function(_5d){
if(_5d){
switch(_5d){
case "thin":
case "medium":
case "thick":
return $telerik._borderThicknesses[_5d];
case "inherit":
return 0;
}
var _5e=$telerik.parseUnit(_5d);
return _5e.size;
}
return 0;
},parsePadding:function(_5f){
if(_5f){
if(_5f=="inherit"){
return 0;
}
var _60=$telerik.parseUnit(_5f);
return _60.size;
}
return 0;
},parseUnit:function(_61){
if(!_61){
throw Error.argumentNull("value");
}
_61=_61.trim().toLowerCase();
var l=_61.length;
var s=-1;
for(var i=0;i<l;i++){
var ch=_61.substr(i,1);
if((ch<"0"||ch>"9")&&ch!="-"&&ch!="."&&ch!=","){
break;
}
s=i;
}
if(s==-1){
throw Error.create("No digits");
}
var _66;
var _67;
if(s<(l-1)){
_66=_61.substring(s+1).trim();
}else{
_66="px";
}
_67=parseFloat(_61.substr(0,s+1));
if(_66=="px"){
_67=Math.floor(_67);
}
return {size:_67,type:_66};
},containsPoint:function(_68,x,y){
return x>=_68.x&&x<=(_68.x+_68.width)&&y>=_68.y&&y<=(_68.y+_68.height);
},isDescendant:function(_6b,_6c){
for(var n=_6c.parentNode;n!=null;n=n.parentNode){
if(n==_6b){
return true;
}
}
return false;
},isDescendantOrSelf:function(_6e,_6f){
if(_6e===_6f){
return true;
}
return $telerik.isDescendant(_6e,_6f);
},setOuterHeight:function(_70,_71){
if(_71<=0||_71==""){
_70.style.height="";
}else{
_70.style.height=_71+"px";
var _72=_70.offsetHeight-_71;
var _73=_71-_72;
if(_73>0){
_70.style.height=_73+"px";
}else{
_70.style.height="";
}
}
},setOpacity:function(_74,_75){
if(!_74){
throw Error.argumentNull("element");
}
try{
if(_74.filters){
var _76=_74.filters;
var _77=true;
if(_76.length!==0){
var _78=_76["DXImageTransform.Microsoft.Alpha"];
if(_78){
_77=false;
_78.opacity=_75*100;
}
}
if(_77){
_74.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(_75*100)+")";
}
}else{
_74.style.opacity=_75;
}
}
catch(ex){
}
},getOpacity:function(_79){
if(!_79){
throw Error.argumentNull("element");
}
var _7a=false;
var _7b;
try{
if(_79.filters){
var _7c=_79.filters;
if(_7c.length!==0){
var _7d=_7c["DXImageTransform.Microsoft.Alpha"];
if(_7d){
_7b=_7d.opacity/100;
_7a=true;
}
}
}else{
_7b=$telerik.getCurrentStyle(_79,"opacity",1);
_7a=true;
}
}
catch(ex){
}
if(_7a===false){
return 1;
}
return parseFloat(_7b);
},addCssClasses:function(_7e,_7f){
for(var i=0;i<_7f.length;i++){
Sys.UI.DomElement.addCssClass(_7e,_7f[i]);
}
},removeCssClasses:function(_81,_82){
for(var i=0;i<_82.length;i++){
Sys.UI.DomElement.removeCssClass(_81,_82[i]);
}
},setOuterWidth:function(_84,_85){
if(_85<=0||_85==""){
_84.style.width="";
}else{
_84.style.width=_85+"px";
var _86=_84.offsetWidth-_85;
var _87=_85-_86;
if(_87>0){
_84.style.width=_87+"px";
}else{
_84.style.width="";
}
}
},getScrollOffset:function(_88,_89){
var _8a=0;
var top=0;
var _8c=_88;
while(_8c!=null&&_8c.scrollLeft!=null){
_8a+=_8c.scrollLeft;
top+=_8c.scrollTop;
if(!_89||(_8c==document.body&&(_8c.scrollLeft!=0||_8c.scrollTop!=0))){
break;
}
_8c=_8c.parentNode;
}
return {x:_8a,y:top};
},getElementByClassName:function(_8d,_8e,_8f){
var _90=null;
if(_8f){
_90=_8d.getElementsByTagName(_8f);
}else{
_90=_8d.getElementsByTagName("*");
}
for(var i=0,_92=_90.length;i<_92;i++){
var _93=_90[i];
if(Sys.UI.DomElement.containsCssClass(_93,_8e)){
return _93;
}
}
return null;
},addExternalHandler:function(_94,_95,_96){
if(_94.addEventListener){
_94.addEventListener(_95,_96,false);
}else{
if(_94.attachEvent){
_94.attachEvent("on"+_95,_96);
}
}
},removeExternalHandler:function(_97,_98,_99){
if(_97.addEventListener){
_97.removeEventListener(_98,_99,false);
}else{
if(_97.detachEvent){
_97.detachEvent("on"+_98,_99);
}
}
},cancelRawEvent:function(e){
if(!e){
return false;
}
if(e.preventDefault){
e.preventDefault();
}
if(e.stopPropagation){
e.stopPropagation();
}
e.cancelBubble=true;
e.returnValue=false;
return false;
},getOuterHtml:function(_9b){
if(_9b.outerHTML){
return _9b.outerHTML;
}else{
var _9c=_9b.cloneNode(true);
var _9d=_9b.ownerDocument.createElement("DIV");
_9d.appendChild(_9c);
return _9d.innerHTML;
}
},setVisible:function(e,_9f){
if(!e){
return;
}
if(_9f!=$telerik.getVisible(e)){
if(_9f){
if(e.style.removeAttribute){
e.style.removeAttribute("display");
}else{
e.style.removeProperty("display");
}
}else{
e.style.display="none";
}
e.style.visibility=_9f?"visible":"hidden";
}
},getVisible:function(e){
if(!e){
return false;
}
return (("none"!=$telerik.getCurrentStyle(e,"display"))&&("hidden"!=$telerik.getCurrentStyle(e,"visibility")));
},getViewPortSize:function(){
var _a1=0;
var _a2=0;
var _a3=document.body;
if(!$telerik.quirksMode&&!$telerik.isSafari){
_a3=document.documentElement;
}
if(window.innerWidth){
_a1=window.innerWidth;
_a2=window.innerHeight;
}else{
_a1=_a3.clientWidth;
_a2=_a3.clientHeight;
}
_a1+=_a3.scrollLeft;
_a2+=_a3.scrollTop;
return {width:_a1-6,height:_a2-6};
},elementOverflowsTop:function(_a4){
return $telerik.getLocation(_a4).y<0;
},elementOverflowsLeft:function(_a5){
return $telerik.getLocation(_a5).x<0;
},elementOverflowsBottom:function(_a6,_a7){
var _a8=$telerik.getLocation(_a7).y+_a7.offsetHeight;
return _a8>_a6.height;
},elementOverflowsRight:function(_a9,_aa){
var _ab=$telerik.getLocation(_aa).x+_aa.offsetWidth;
return _ab>_a9.width;
},getDocumentRelativeCursorPosition:function(e){
var _ad=document.documentElement.scrollLeft||document.body.scrollLeft;
var _ae=document.documentElement.scrollTop||document.body.scrollTop;
var _af=e.clientX+_ad;
var top=e.clientY+_ae;
return {left:_af,top:top};
},getFirstChildByTagName:function(_b1,_b2,_b3){
if(!_b1||!_b1.childNodes){
return null;
}
var _b4=_b1.childNodes[_b3]||_b1.firstChild;
while(_b4){
if(_b4.nodeType==1&&_b4.tagName.toLowerCase()==_b2){
return _b4;
}
_b4=_b4.nextSibling;
}
return null;
},getChildByClassName:function(_b5,_b6,_b7){
var _b8=_b5.childNodes[_b7]||_b5.firstChild;
while(_b8){
if(_b8.nodeType==1&&_b8.className.indexOf(_b6)>-1){
return _b8;
}
_b8=_b8.nextSibling;
}
return null;
},getChildrenByTagName:function(_b9,_ba){
var _bb=new Array();
var _bc=_b9.children||_b9.childNodes;
for(var i=0,_be=_bc.length;i<_be;i++){
var _bf=_bc[i];
if(_bf.nodeType==1&&_bf.tagName.toLowerCase()==_ba){
Array.add(_bb,_bf);
}
}
return _bb;
},getChildrenByClassName:function(_c0,_c1){
var _c2=new Array();
var _c3=_c0.children||_c0.childNodes;
for(var i=0,_c5=_c3.length;i<_c5;i++){
var _c6=_c3[i];
if(_c6.nodeType==1&&_c6.className.indexOf(_c1)>-1){
Array.add(_c2,_c6);
}
}
return _c2;
},isMouseOverElement:function(_c7,e){
var _c9=$telerik.getBounds(_c7);
var _ca=$telerik.getDocumentRelativeCursorPosition(e);
return $telerik.containsPoint(_c9,_ca.left,_ca.top);
}};
if(typeof (Sys.Browser.WebKit)=="undefined"){
Sys.Browser.WebKit={};
}
if(typeof (Sys.Browser.Chrome)=="undefined"){
Sys.Browser.Chrome={};
}
if(navigator.userAgent.indexOf("Chrome")>-1){
Sys.Browser.version=parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.agent=Sys.Browser.Chrome;
Sys.Browser.name="Chrome";
}else{
if(navigator.userAgent.indexOf("WebKit/")>-1){
Sys.Browser.version=parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
if(Sys.Browser.version<500){
Sys.Browser.agent=Sys.Browser.Safari;
Sys.Browser.name="Safari";
}else{
Sys.Browser.agent=Sys.Browser.WebKit;
Sys.Browser.name="WebKit";
}
}
}
$telerik.isChrome=Sys.Browser.agent==Sys.Browser.Chrome;
$telerik.isSafari3=Sys.Browser.agent==Sys.Browser.WebKit||Sys.Browser.agent==Sys.Browser.Chrome;
$telerik.isSafari2=Sys.Browser.agent==Sys.Browser.Safari;
$telerik.isSafari=$telerik.isSafari2||$telerik.isSafari3;
$telerik.isIE=Sys.Browser.agent==Sys.Browser.InternetExplorer;
$telerik.isIE7=$telerik.isIE&&Sys.Browser.version==7;
$telerik.isIE6=$telerik.isIE&&Sys.Browser.version<7;
$telerik.isOpera=Sys.Browser.agent==Sys.Browser.Opera;
$telerik.isFirefox=Sys.Browser.agent==Sys.Browser.Firefox;
$telerik.quirksMode=$telerik.isIE&&document.compatMode!="CSS1Compat";
$telerik.standardsMode=!$telerik.quirksMode;
$telerik._borderThickness();
Telerik.Web.UI.Orientation=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.Orientation.prototype={Horizontal:0,Vertical:1};
Telerik.Web.UI.Orientation.registerEnum("Telerik.Web.UI.Orientation",false);
Telerik.Web.UI.RadWebControl=function(_cb){
Telerik.Web.UI.RadWebControl.initializeBase(this,[_cb]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.RadWebControl.prototype={initialize:function(){
Telerik.Web.UI.RadWebControl.callBaseMethod(this,"initialize");
$telerik.registerControl(this);
if(!this.get_clientStateFieldID()){
return;
}
var _cc=$get(this.get_clientStateFieldID());
if(!_cc){
return;
}
_cc.setAttribute("autocomplete","off");
},dispose:function(){
$telerik.unregisterControl(this);
var _cd=this.get_element();
Telerik.Web.UI.RadWebControl.callBaseMethod(this,"dispose");
if(_cd){
_cd.control=null;
_cd._events=null;
}
},raiseEvent:function(_ce,_cf){
var _d0=this.get_events().getHandler(_ce);
if(_d0){
if(!_cf){
_cf=Sys.EventArgs.Empty;
}
_d0(this,_cf);
}
},updateClientState:function(){
this.set_clientState(this.saveClientState());
},saveClientState:function(){
return null;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_d1){
if(this._clientStateFieldID!=_d1){
this._clientStateFieldID=_d1;
this.raisePropertyChanged("ClientStateFieldID");
}
},get_clientState:function(){
if(this._clientStateFieldID){
var _d2=document.getElementById(this._clientStateFieldID);
if(_d2){
return _d2.value;
}
}
return null;
},set_clientState:function(_d3){
if(this._clientStateFieldID){
var _d4=document.getElementById(this._clientStateFieldID);
if(_d4){
_d4.value=_d3;
}
}
},_getChildElement:function(id){
return $get(this.get_id()+"_"+id);
},_findChildControl:function(id){
return $find(this.get_id()+"_"+id);
}};
Telerik.Web.UI.RadWebControl.registerClass("Telerik.Web.UI.RadWebControl",Sys.UI.Control);
Telerik.Web.Timer=function(){
Telerik.Web.Timer.initializeBase(this);
this._interval=1000;
this._enabled=false;
this._timer=null;
this._timerCallbackDelegate=Function.createDelegate(this,this._timerCallback);
};
Telerik.Web.Timer.prototype={get_interval:function(){
return this._interval;
},set_interval:function(_d7){
if(this._interval!==_d7){
this._interval=_d7;
this.raisePropertyChanged("interval");
if(!this.get_isUpdating()&&(this._timer!==null)){
this._stopTimer();
this._startTimer();
}
}
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_d8){
if(_d8!==this.get_enabled()){
this._enabled=_d8;
this.raisePropertyChanged("enabled");
if(!this.get_isUpdating()){
if(_d8){
this._startTimer();
}else{
this._stopTimer();
}
}
}
},add_tick:function(_d9){
this.get_events().addHandler("tick",_d9);
},remove_tick:function(_da){
this.get_events().removeHandler("tick",_da);
},dispose:function(){
this.set_enabled(false);
this._stopTimer();
Telerik.Web.Timer.callBaseMethod(this,"dispose");
},updated:function(){
Telerik.Web.Timer.callBaseMethod(this,"updated");
if(this._enabled){
this._stopTimer();
this._startTimer();
}
},_timerCallback:function(){
var _db=this.get_events().getHandler("tick");
if(_db){
_db(this,Sys.EventArgs.Empty);
}
},_startTimer:function(){
this._timer=window.setInterval(this._timerCallbackDelegate,this._interval);
},_stopTimer:function(){
window.clearInterval(this._timer);
this._timer=null;
}};
Telerik.Web.Timer.registerClass("Telerik.Web.Timer",Sys.Component);
Telerik.Web.BoxSide=function(){
};
Telerik.Web.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};
Telerik.Web.BoxSide.registerEnum("Telerik.Web.BoxSide",false);
if(Sys.CultureInfo.prototype._getAbbrMonthIndex){
try{
Sys.CultureInfo.prototype._getAbbrMonthIndex("");
}
catch(ex){
Sys.CultureInfo.prototype._getAbbrMonthIndex=function(_dc){
if(!this._upperAbbrMonths){
this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
}
return Array.indexOf(this._upperAbbrMonths,this._toUpper(_dc));
};
Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;
Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;
}
}
Type.registerNamespace("Telerik.Web.UI.Dialogs");
Telerik.Web.IParameterConsumer=function(){
};
Telerik.Web.IParameterConsumer.prototype={clientInit:function(_dd){
throw Error.notImplemented();
}};
Telerik.Web.IParameterConsumer.registerInterface("Telerik.Web.IParameterConsumer");
Telerik.Web.UI.Dialogs.CommonDialogScript=function(){
};
Telerik.Web.UI.Dialogs.CommonDialogScript.get_windowReference=function(){
if(window.radWindow){
return window.radWindow;
}
if(window.frameElement&&window.frameElement.radWindow){
return window.frameElement.radWindow;
}
return null;
};
Telerik.Web.UI.Dialogs.CommonDialogScript.registerClass("Telerik.Web.UI.Dialogs.CommonDialogScript",null);
Telerik.Web.UI.WebServiceLoaderEventArgs=function(_de){
Telerik.Web.UI.WebServiceLoaderEventArgs.initializeBase(this);
this._context=_de;
};
Telerik.Web.UI.WebServiceLoaderEventArgs.prototype={get_context:function(){
return this._context;
}};
Telerik.Web.UI.WebServiceLoaderEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderEventArgs",Sys.EventArgs);
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs=function(_df,_e0){
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.initializeBase(this,[_e0]);
this._data=_df;
};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.prototype={get_data:function(){
return this._data;
}};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderSuccessEventArgs",Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoaderErrorEventArgs=function(_e1,_e2){
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.initializeBase(this,[_e2]);
this._message=_e1;
};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.prototype={get_message:function(){
return this._message;
}};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderErrorEventArgs",Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoader=function(_e3){
this._webServiceSettings=_e3;
this._events=null;
this._currentWebRequest=null;
this._onWebServiceSuccessDelegate=Function.createDelegate(this,this._onWebServiceSuccess);
this._onWebServiceErrorDelegate=Function.createDelegate(this,this._onWebServiceError);
};
Telerik.Web.UI.WebServiceLoader.prototype={get_webServiceSettings:function(){
return this._webServiceSettings;
},get_events:function(){
if(!this._events){
this._events=new Sys.EventHandlerList();
}
return this._events;
},loadData:function(_e4,_e5){
var _e6=this.get_webServiceSettings();
if(_e6.get_isEmpty()){
Error.invalidOperation("Please, specify valid web service and method.");
return;
}
var _e7=_e6.get_path();
var _e8=_e6.get_method();
this._raiseEvent("loadingStarted",new Telerik.Web.UI.WebServiceLoaderEventArgs(_e5));
this._currentWebRequest=Sys.Net.WebServiceProxy.invoke(_e7,_e8,false,_e4,this._onWebServiceSuccessDelegate,this._onWebServiceErrorDelegate,_e5);
},add_loadingStarted:function(_e9){
this.get_events().addHandler("loadingStarted",_e9);
},add_loadingError:function(_ea){
this.get_events().addHandler("loadingError",_ea);
},add_loadingSuccess:function(_eb){
this.get_events().addHandler("loadingSuccess",_eb);
},_onWebServiceSuccess:function(_ec,_ed){
var _ee=new Telerik.Web.UI.WebServiceLoaderSuccessEventArgs(_ec,_ed);
this._raiseEvent("loadingSuccess",_ee);
},_onWebServiceError:function(_ef,_f0){
var _f1=new Telerik.Web.UI.WebServiceLoaderErrorEventArgs(_ef.get_message(),_f0);
this._raiseEvent("loadingError",_f1);
},_raiseEvent:function(_f2,_f3){
var _f4=this.get_events().getHandler(_f2);
if(_f4){
if(!_f3){
_f3=Sys.EventArgs.Empty;
}
_f4(this,_f3);
}
}};
Telerik.Web.UI.WebServiceLoader.registerClass("Telerik.Web.UI.WebServiceLoader");
Telerik.Web.UI.WebServiceSettings=function(_f5){
this._path=null;
this._method=null;
if(!_f5){
_f5={};
}
if(typeof (_f5.path)!="undefined"){
this._path=_f5.path;
}
if(typeof (_f5.method)!="undefined"){
this._method=_f5.method;
}
};
Telerik.Web.UI.WebServiceSettings.prototype={get_path:function(){
return this._path;
},set_path:function(_f6){
this._path=_f6;
},get_method:function(){
return this._method;
},set_method:function(_f7){
this._method=_f7;
},get_isEmpty:function(){
var _f8=this.get_path();
var _f9=this.get_method();
return (!(_f8&&_f9));
}};
Telerik.Web.UI.WebServiceSettings.registerClass("Telerik.Web.UI.WebServiceSettings");


/* END Telerik.Web.UI.Common.Core.js */
/* START Telerik.Web.UI.Ajax.Ajax.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxControl=function(_1){
Telerik.Web.UI.RadAjaxControl.initializeBase(this,[_1]);
this._clientEvents={};
this._uniqueID="";
this._enableHistory=false;
this._enableAJAX=true;
this._requestQueueSize=0;
this._requestQueue=[];
this._loadingPanelsToHide=[];
this._initializeRequestHandler=null;
this._endRequestHandler=null;
this._isRequestInProgress=false;
this._links=[];
this._styles=[];
this.Type="Telerik.Web.UI.RadAjaxControl";
this.UniqueID=this._uniqueID;
this.EnableHistory=this._enableHistory;
this.EnableAJAX=this._enableAJAX;
this.Links=this._links;
this.Styles=this._styles;
this._updatePanels="";
};
Telerik.Web.UI.RadAjaxControl.prototype={initialize:function(){
Telerik.Web.UI.RadAjaxControl.callBaseMethod(this,"initialize");
for(var _2 in this._clientEvents){
if(typeof (this._clientEvents[_2])!="string"){
continue;
}
if(this._clientEvents[_2]!=""){
var _3=this._clientEvents[_2];
if(_3.indexOf("(")!=-1){
this[_2]=_3;
}else{
this[_2]=eval(_3);
}
}else{
this[_2]=null;
}
}
var _4=Sys.WebForms.PageRequestManager.getInstance();
this._initializeRequestHandler=Function.createDelegate(this,this._initializeRequest);
_4.add_initializeRequest(this._initializeRequestHandler);
},_getResponseHeader:function(_5,_6){
try{
return _5.getResponseHeader(_6);
}
catch(e){
return null;
}
},_handleAsyncRedirect:function(_7){
var _8=this._getResponseHeader(_7,"Location");
if(_8&&_8!=""){
var _9=document.createElement("a");
_9.style.display="none";
_9.href=_8;
document.body.appendChild(_9);
if(_9.click){
try{
_9.click();
}
catch(e){
}
}else{
window.location.href=_8;
}
document.body.removeChild(_9);
return true;
}
return false;
},_onFormSubmitCompleted:function(_a,_b){
if(_a._xmlHttpRequest!=null){
if(this._handleAsyncRedirect(_a._xmlHttpRequest)){
try{
_a._aborted=true;
}
catch(e){
}
return;
}
}
if(_a._xmlHttpRequest!=null&&!_a.get_timedOut()){
var _c=this.getResponseItems(_a.get_responseData(),"scriptBlock");
for(var i=0,_e=_c.length;i<_e;i++){
var _f=_c[i].content;
if(_f.indexOf(Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(this._uniqueID))!=-1){
var _10=_f.substr(_f.indexOf("\"links\":")+10,_f.indexOf("]",_f.indexOf("\"links\":"))-(_f.indexOf("\"links\":")+10)).replace(/\"/g,"");
if(_10!=""){
this._links=_10.split(",");
this.updateHeadLinks();
}
}
if(_f.indexOf(".axd")==-1&&_c[i].id=="ScriptPath"){
Telerik.Web.UI.RadAjaxControl.IncludeClientScript(_f);
}
}
var _11=this.getResponseItems(_a.get_responseData(),"updatePanel");
Telerik.Web.UI.RadAjaxControl.panelsToClear=[];
for(var i=0,_e=_11.length;i<_e;i++){
var _12=_11[i];
if(!$get(_12.id)){
var _13=document.createElement("div");
_13.id=_12.id;
var _14=$get(_12.id.replace("Panel",""));
if(!_14){
continue;
}
var _15=_14.parentNode;
var _16=_14.nextSibling||Telerik.Web.UI.RadAjaxControl.GetNodeNextSibling(_14);
if(_14.nodeType===1){
if(_14.dispose&&typeof (_14.dispose)==="function"){
_14.dispose();
}else{
if(_14.control&&typeof (_14.control.dispose)==="function"){
_14.control.dispose();
}
}
var _17=Sys.UI.Behavior.getBehaviors(_14);
for(var j=_17.length-1;j>=0;j--){
_17[j].dispose();
}
}
Sys.WebForms.PageRequestManager.getInstance()._destroyTree(_14);
_15.removeChild(_14);
Telerik.Web.UI.RadAjaxControl.InsertAtLocation(_13,_15,_16);
Telerik.Web.UI.RadAjaxControl.panelsToClear[Telerik.Web.UI.RadAjaxControl.panelsToClear.length]=_12;
}
}
}
_a.get_webRequest().remove_completed(this._onFormSubmitCompletedHandler);
},dispose:function(){
this.hideLoadingPanels();
var _19=Sys.WebForms.PageRequestManager.getInstance();
_19.remove_initializeRequest(this._initializeRequestHandler);
$clearHandlers(this.get_element());
this._element.control=null;
Telerik.Web.UI.RadAjaxControl.callBaseMethod(this,"dispose");
},get_enableAJAX:function(){
return this._enableAJAX;
},set_enableAJAX:function(_1a){
if(this._enableAJAX!=_1a){
this._enableAJAX=_1a;
}
},get_enableHistory:function(){
return this._enableHistory;
},set_enableHistory:function(_1b){
if(this._enableHistory!=_1b){
this._enableHistory=_1b;
}
},get_clientEvents:function(){
return this._clientEvents;
},set_clientEvents:function(_1c){
if(this._clientEvents!=_1c){
this._clientEvents=_1c;
}
},get_links:function(){
return this._links;
},set_links:function(_1d){
if(this._links!=_1d){
this._links=_1d;
if(this._links.length>0){
this.updateHeadLinks();
}
}
},get_styles:function(){
return this._styles;
},set_styles:function(_1e){
if(this._styles!=_1e){
this._styles=_1e;
if(this._styles.length>0){
this.updateHeadStyles();
}
}
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_1f){
if(this._uniqueID!=_1f){
this._uniqueID=_1f;
window[Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(this._uniqueID)]=this;
}
},get_requestQueueSize:function(){
return this._requestQueueSize;
},set_requestQueueSize:function(_20){
if(_20>0){
this._requestQueueSize=_20;
this.raisePropertyChanged("requestQueueSize");
}
},isChildOf:function(_21,_22){
while(_21!=null){
if(_21==_22){
return true;
}
_21=_21.parentNode;
}
return false;
},_initializeRequest:function(_23,_24){
var _25=Sys.WebForms.PageRequestManager.getInstance();
if(_25.get_isInAsyncPostBack()&&this._requestQueueSize>0){
this._queueRequest(_23,_24);
}
if(this.Type=="Telerik.Web.UI.RadAjaxManager"){
if(_24.get_postBackElement()!=this.get_element()){
var _26=this._updatePanels.split(",");
if(Array.contains(_26,_24.get_postBackElement().id)){
this._isRequestInProgress=true;
this._attachRequestHandlers(_23,_24,false);
return false;
}else{
var _27=_24.get_postBackElement().parentNode;
var _28=false;
while(_27!=null){
if(_27.id&&Array.contains(_26,_27.id)){
_28=true;
break;
}
_27=_27.parentNode;
}
if(_28){
this._isRequestInProgress=true;
this._attachRequestHandlers(_23,_24,false);
return false;
}
}
if(!this._initiators[_24.get_postBackElement().id]){
var _27=_24.get_postBackElement().parentNode;
var _28=false;
while(_27!=null){
if(_27.id&&this._initiators[_27.id]){
_28=true;
break;
}
_27=_27.parentNode;
}
if(!_28){
this._isRequestInProgress=true;
this._attachRequestHandlers(_23,_24,false);
return false;
}
}
}
}
if(this.Type=="Telerik.Web.UI.RadAjaxPanel"){
var _29=this._getParentAjaxPanel(_24.get_postBackElement());
if(_29&&_29.get_id()!=this.get_id()){
return false;
}
if(!this.isChildOf(_24.get_postBackElement(),this.get_element())){
return false;
}
}
if(this._enableHistory){
if(Telerik.Web.UI.RadAjaxControl.History[""]==null){
Telerik.Web.UI.RadAjaxControl.HandleHistory(_23._uniqueIDToClientID(this._uniqueID),"");
}
Telerik.Web.UI.RadAjaxControl.HandleHistory(_23._uniqueIDToClientID(this._uniqueID),_24.get_request().get_body());
}
if(_23._form["__EVENTTARGET"]&&_23._form["__EVENTTARGET"].value){
this.__EVENTTARGET=_23._form["__EVENTTARGET"].value;
}else{
this.__EVENTTARGET=_24.get_postBackElement().id;
}
if(_24.get_postBackElement().name){
this.__EVENTTARGET=_24.get_postBackElement().name;
}
this.__EVENTARGUMENT=_23._form["__EVENTARGUMENT"].value;
var evt=new Telerik.Web.UI.RadAjaxRequestEventArgs(this.__EVENTTARGET,_23._form["__EVENTARGUMENT"].value,this._enableAJAX);
var _2b=this.fireEvent(this,"OnRequestStart",[evt]);
if(evt.get_cancel()||(typeof (_2b)!="undefined"&&!_2b)){
_24.set_cancel(true);
return;
}
if(!evt._enableAjax||!evt.EnableAjax){
_24.set_cancel(true);
_23._form["__EVENTTARGET"].value=this.__EVENTTARGET;
_23._form["__EVENTARGUMENT"].value=this.__EVENTARGUMENT;
_23._form.submit();
return;
}
this._isRequestInProgress=true;
this._attachRequestHandlers(_23,_24,true);
},_endRequest:function(_2c,_2d){
_2c.remove_endRequest(this._endRequestHandler);
for(var i=0,_2f=Telerik.Web.UI.RadAjaxControl.panelsToClear.length;i<_2f;i++){
var _30=Telerik.Web.UI.RadAjaxControl.panelsToClear[i];
var _31=document.getElementById(_30.id);
var _32=$get(_30.id.replace("Panel",""));
if(!_32){
continue;
}
var _33=_31.parentNode;
var _34=_31.nextSibling||Telerik.Web.UI.RadAjaxControl.GetNodeNextSibling(_31);
Telerik.Web.UI.RadAjaxControl.InsertAtLocation(_32,_33,_34);
_31.parentNode.removeChild(_31);
}
this._isRequestInProgress=false;
this.hideLoadingPanels();
if(typeof (this.__EVENTTARGET)!="undefined"&&typeof (this.__EVENTARGUMENT)!="undefined"){
var evt=new Telerik.Web.UI.RadAjaxRequestEventArgs(this.__EVENTTARGET,this.__EVENTARGUMENT,this._enableAJAX);
this.fireEvent(this,"OnResponseEnd",[evt]);
}
if(this._requestQueue.length>0){
this._executePendingRequest();
}
},_queueRequest:function(_36,_37){
_37.set_cancel(true);
if(this._requestQueue.length>=this._requestQueueSize){
return;
}
var _38=_37.get_postBackElement();
var _39=_38.id;
if(_38.name){
_39=_38.name;
}
if(_36._form["__EVENTTARGET"]&&_36._form["__EVENTTARGET"].value){
_39=_36._form["__EVENTTARGET"].value;
}
var _3a=_36._form["__EVENTARGUMENT"].value;
Array.enqueue(this._requestQueue,[_39,_3a]);
},_executePendingRequest:function(){
var _3b=Array.dequeue(this._requestQueue);
var _3c=_3b[0];
var _3d=_3b[1];
var _3e=Sys.WebForms.PageRequestManager.getInstance();
_3e._doPostBack(_3c,_3d);
},_attachRequestHandlers:function(_3f,_40,_41){
this._endRequestHandler=Function.createDelegate(this,this._endRequest);
_3f.add_endRequest(this._endRequestHandler);
this._onFormSubmitCompletedHandler=Function.createDelegate(this,this._onFormSubmitCompleted);
_40.get_request().add_completed(this._onFormSubmitCompletedHandler);
_40.get_request()._get_eventHandlerList()._list.completed.reverse();
if(_41){
var _42=_40.get_request().get_body();
var _43=(_42.lastIndexOf("&")!=_42.length-1)?"&":"";
_42+=_43+"RadAJAXControlID="+_3f._uniqueIDToClientID(this._uniqueID);
_40.get_request().set_body(_42);
}
},_getParentAjaxPanel:function(_44){
var _45=null;
while(_44!=null){
if(typeof (_44.id)!="undefined"&&$find(_44.id)&&$find(_44.id).Type=="Telerik.Web.UI.RadAjaxPanel"){
_45=$find(_44.id);
break;
}
_44=_44.parentNode;
}
return _45;
},getResponseItems:function(_46,_47,_48){
var _49=Sys.WebForms.PageRequestManager.getInstance();
var _4a=_46;
var _4b,len,_4d,id,_4f;
var _50=0;
var _51=null;
var _52="|";
var _53=[];
while(_50<_4a.length){
_4b=_4a.indexOf(_52,_50);
if(_4b===-1){
_51=_49._findText(_4a,_50);
break;
}
len=parseInt(_4a.substring(_50,_4b),10);
if((len%1)!==0){
_51=_49._findText(_4a,_50);
break;
}
_50=_4b+1;
_4b=_4a.indexOf(_52,_50);
if(_4b===-1){
_51=_49._findText(_4a,_50);
break;
}
_4d=_4a.substring(_50,_4b);
_50=_4b+1;
_4b=_4a.indexOf(_52,_50);
if(_4b===-1){
_51=_49._findText(_4a,_50);
break;
}
id=_4a.substring(_50,_4b);
_50=_4b+1;
if((_50+len)>=_4a.length){
_51=_49._findText(_4a,_4a.length);
break;
}
if(typeof (_49._decodeString)!="undefined"){
_4f=_49._decodeString(_4a.substr(_50,len));
}else{
_4f=_4a.substr(_50,len);
}
_50+=len;
if(_4a.charAt(_50)!==_52){
_51=_49._findText(_4a,_50);
break;
}
_50++;
if(_47!=undefined&&_47!=_4d){
continue;
}
if(_48!=undefined&&_48!=id){
continue;
}
Array.add(_53,{type:_4d,id:id,content:_4f});
}
return _53;
},pageLoading:function(_54,_55){
},pageLoaded:function(_56,_57){
},hideLoadingPanels:function(){
for(var i=0;i<this._loadingPanelsToHide.length;i++){
var _59=this._loadingPanelsToHide[i].Panel;
var _5a=this._loadingPanelsToHide[i].ControlID;
if(_59!=null){
_59.hide(_5a);
Array.remove(this._loadingPanelsToHide,this._loadingPanelsToHide[i]);
i--;
}
}
},fireEvent:function(_5b,_5c,_5d){
var _5e=true;
if(typeof (_5b[_5c])=="string"){
_5e=eval(_5b[_5c]);
}else{
if(typeof (_5b[_5c])=="function"){
if(_5d){
if(typeof (_5d.unshift)!="undefined"){
_5d.unshift(_5b);
_5e=_5b[_5c].apply(_5b,_5d);
}else{
_5e=_5b[_5c].apply(_5b,[_5d]);
}
}else{
_5e=_5b[_5c]();
}
}
}
if(typeof (_5e)!="boolean"){
return true;
}else{
return _5e;
}
},updateHeadLinks:function(){
var _5f=this.getHeadElement();
var _60=_5f.getElementsByTagName("link");
var _61=[];
for(var j=0,_63=_60.length;j<_63;j++){
var _64=_60[j].getAttribute("href");
_61.push(_64);
}
for(var i=0,_66=this._links.length;i<_66;i++){
var _67=this._links[i];
_67=_67.replace(/&amp;amp;t/g,"&t");
_67=_67.replace(/&amp;t/g,"&t");
var _68=Array.contains(_61,_67);
if(!_68){
if(_67==""){
continue;
}
var _69=document.createElement("link");
_69.setAttribute("rel","stylesheet");
_69.setAttribute("href",_67);
_5f.appendChild(_69);
}
}
},updateHeadStyles:function(){
if(document.createStyleSheet!=null){
for(var i=0,_6b=this._styles.length;i<_6b;i++){
var _6c=this._styles[i];
var _6d=null;
try{
_6d=document.createStyleSheet();
}
catch(e){
}
if(_6d==null){
_6d=document.createElement("style");
}
_6d.cssText=_6c;
}
}else{
var _6e=null;
if(document.styleSheets.length==0){
css=document.createElement("style");
css.media="all";
css.type="text/css";
var _6f=this.getHeadElement();
_6f.appendChild(css);
_6e=css;
}
if(document.styleSheets[0]){
_6e=document.styleSheets[0];
}
for(var i=0;i<this._styles.length;i++){
var _6c=this._styles[i];
var _70=_6c.split("}");
for(var j=0;j<_70.length;j++){
if(_70[j].replace(/\s*/,"")==""){
continue;
}
_6e.insertRule(_70[j]+"}",j+1);
}
}
}
},getHeadElement:function(){
var _72=document.getElementsByTagName("head");
if(_72.length>0){
return _72[0];
}
var _73=document.createElement("head");
document.documentElement.appendChild(_73);
return _73;
},ajaxRequest:function(_74){
__doPostBack(this._uniqueID,_74);
},ajaxRequestWithTarget:function(_75,_76){
__doPostBack(_75,_76);
},__doPostBack:function(_77,_78){
var _79=Sys.WebForms.PageRequestManager.getInstance()._form;
if(_79!=null){
if(_79["__EVENTTARGET"]!=null){
_79["__EVENTTARGET"].value=_77;
}
if(_79["__EVENTARGUMENT"]!=null){
_79["__EVENTARGUMENT"].value=_78;
}
_79.submit();
}
}};
Telerik.Web.UI.RadAjaxControl.registerClass("Telerik.Web.UI.RadAjaxControl",Sys.UI.Control);
Telerik.Web.UI.RadAjaxRequestEventArgs=function(_7a,_7b,_7c){
Telerik.Web.UI.RadAjaxRequestEventArgs.initializeBase(this);
this._enableAjax=_7c;
this._eventTarget=_7a;
this._eventArgument=_7b;
this._postbackControlClientID=_7a.replace(/(\$|:)/g,"_");
this._eventTargetElement=$get(this._postbackControlClientID);
this.EnableAjax=this._enableAjax;
this.EventTarget=this._eventTarget;
this.EventArgument=this._eventArgument;
this.EventTargetElement=this._eventTargetElement;
};
Telerik.Web.UI.RadAjaxRequestEventArgs.prototype={get_enableAjax:function(){
return this._enableAjax;
},set_enableAjax:function(_7d){
if(this._enableAjax!=_7d){
this._enableAjax=_7d;
}
},get_eventTarget:function(){
return this._eventTarget;
},get_eventArgument:function(){
return this._eventArgument;
},get_eventTargetElement:function(){
return this._eventTargetElement;
}};
Telerik.Web.UI.RadAjaxRequestEventArgs.registerClass("Telerik.Web.UI.RadAjaxRequestEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadAjaxControl.History={};
Telerik.Web.UI.RadAjaxControl.HandleHistory=function(_7e,_7f){
if(window.netscape){
return;
}
var _80=$get(_7e+"_History");
if(_80==null){
_80=document.createElement("iframe");
_80.id=_7e+"_History";
_80.name=_7e+"_History";
_80.style.width="0px";
_80.style.height="0px";
_80.src="javascript:''";
_80.style.visibility="hidden";
var _81=function(e){
if(!Telerik.Web.UI.RadAjaxControl.ShouldLoadHistory){
Telerik.Web.UI.RadAjaxControl.ShouldLoadHistory=true;
return;
}
var _83="";
var _84="";
var _85=_80.contentWindow.document.getElementById("__DATA");
if(!_85){
return;
}
var _86=_85.value.split("&");
for(var i=0,_88=_86.length;i<_88;i++){
var _89=_86[i].split("=");
if(_89[0]=="__EVENTTARGET"){
_83=_89[1];
}
if(_89[0]=="__EVENTARGUMENT"){
_84=_89[1];
}
var _8a=document.getElementById(Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(_89[0]));
if(_8a!=null){
Telerik.Web.UI.RadAjaxControl.RestorePostData(_8a,Telerik.Web.UI.RadAjaxControl.DecodePostData(_89[1]));
}
}
if(_83!=""){
__doPostBack(Telerik.Web.UI.RadAjaxControl.DecodePostData(_83),Telerik.Web.UI.RadAjaxControl.DecodePostData(_84),_7e);
}
};
$addHandler(_80,"load",_81);
document.body.appendChild(_80);
}
if(Telerik.Web.UI.RadAjaxControl.History[_7f]==null){
Telerik.Web.UI.RadAjaxControl.History[_7f]=true;
Telerik.Web.UI.RadAjaxControl.AddHistoryEntry(_80,_7f);
}
};
Telerik.Web.UI.RadAjaxControl.AddHistoryEntry=function(_8b,_8c){
Telerik.Web.UI.RadAjaxControl.ShouldLoadHistory=false;
_8b.contentWindow.document.open();
_8b.contentWindow.document.write("<input id='__DATA' name='__DATA' type='hidden' value='"+_8c+"' />");
_8b.contentWindow.document.close();
if(window.netscape){
_8b.contentWindow.document.location.hash="#'"+new Date()+"'";
}
};
Telerik.Web.UI.RadAjaxControl.DecodePostData=function(_8d){
if(decodeURIComponent){
return decodeURIComponent(_8d);
}else{
return unescape(_8d);
}
};
Telerik.Web.UI.RadAjaxControl.RestorePostData=function(_8e,_8f){
if(_8e.tagName.toLowerCase()=="select"){
for(var i=0,_91=_8e.options.length;i<_91;i++){
if(_8f.indexOf(_8e.options[i].value)!=-1){
_8e.options[i].selected=true;
}
}
}
if(_8e.tagName.toLowerCase()=="input"&&(_8e.type.toLowerCase()=="text"||_8e.type.toLowerCase()=="hidden")){
_8e.value=_8f;
}
if(_8e.tagName.toLowerCase()=="input"&&(_8e.type.toLowerCase()=="checkbox"||_8e.type.toLowerCase()=="radio")){
_8e.checked=_8f;
}
};
Telerik.Web.UI.RadAjaxControl.GetNodeNextSibling=function(_92){
if(_92!=null&&_92.nextSibling!=null){
return _92.nextSibling;
}
return null;
};
Telerik.Web.UI.RadAjaxControl.InsertAtLocation=function(_93,_94,_95){
if(_95!=null){
return _94.insertBefore(_93,_95);
}else{
return _94.appendChild(_93);
}
};
Telerik.Web.UI.RadAjaxControl.FocusElement=function(_96){
var _97=document.getElementById(_96);
if(_97){
var _98=_97.tagName;
var _99=_97.type;
if(_98.toLowerCase()=="input"&&(_99.toLowerCase()=="checkbox"||_99.toLowerCase()=="radio")){
window.setTimeout(function(){
try{
_97.focus();
}
catch(e){
}
},500);
}else{
try{
Telerik.Web.UI.RadAjaxControl.SetSelectionFocus(_97);
_97.focus();
}
catch(e){
}
}
}
};
Telerik.Web.UI.RadAjaxControl.SetSelectionFocus=function(_9a){
if(_9a.createTextRange==null){
return;
}
var _9b=null;
try{
_9b=_9a.createTextRange();
}
catch(e){
}
if(_9b!=null){
_9b.moveStart("textedit",_9b.text.length);
_9b.collapse(false);
_9b.select();
}
};
Telerik.Web.UI.RadAjaxControl.panelsToClear=[];
Telerik.Web.UI.RadAjaxControl.UpdateElement=function(id,_9d){
var _9e=$get(id);
if(_9e!=null){
_9e.innerHTML=_9d;
var _9f=Telerik.Web.UI.RadAjaxControl.GetScriptsSrc(_9d);
for(var i=0,_a1=_9f.length;i<_a1;i++){
Telerik.Web.UI.RadAjaxControl.IncludeClientScript(_9f[i]);
}
_9f=Telerik.Web.UI.RadAjaxControl.GetTags(_9d,"script");
for(var i=0,_a1=_9f.length;i<_a1;i++){
var _a2=_9f[i];
if(_a2.inner!=""){
Telerik.Web.UI.RadAjaxControl.EvalScriptCode(_a2.inner);
}
}
var _a3=document.getElementsByTagName("head")[0];
var _a4=Telerik.Web.UI.RadAjaxControl.GetLinkHrefs(_9d);
for(var i=0,_a1=_a4.length;i<_a1;i++){
var _a5=_a4[i];
var _a6=document.createElement("link");
_a6.setAttribute("rel","stylesheet");
_a6.setAttribute("href",_a5);
_a3.appendChild(_a6);
}
}
};
Telerik.Web.UI.RadAjaxControl.IncludeClientScript=function(src){
var _a8=(window.XMLHttpRequest)?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
_a8.open("GET",src,false);
_a8.send(null);
if(_a8.status==200){
var _a9=_a8.responseText;
Telerik.Web.UI.RadAjaxControl.EvalScriptCode(_a9);
}
};
Telerik.Web.UI.RadAjaxControl.EvalScriptCode=function(_aa){
if(Telerik.Web.UI.RadAjaxControl.IsSafari()){
_aa=_aa.replace(/^\s*<!--((.|\n)*)-->\s*$/mi,"$1");
}
var _ab=document.createElement("script");
_ab.setAttribute("type","text/javascript");
if(Telerik.Web.UI.RadAjaxControl.IsSafari()){
_ab.appendChild(document.createTextNode(_aa));
}else{
_ab.text=_aa;
}
var _ac=document.getElementsByTagName("head")[0];
_ac.appendChild(_ab);
if(Telerik.Web.UI.RadAjaxControl.IsSafari()){
_ab.innerHTML="";
}else{
_ab.parentNode.removeChild(_ab);
}
};
Telerik.Web.UI.RadAjaxControl.GetTags=function(_ad,_ae){
var _af=[];
var _b0=_ad;
while(1){
var _b1=Telerik.Web.UI.RadAjaxControl.GetTag(_b0,_ae);
if(_b1.index==-1){
break;
}
_af[_af.length]=_b1;
var _b2=_b1.index+_b1.outer.length;
_b0=_b0.substring(_b2,_b0.length);
}
return _af;
};
Telerik.Web.UI.RadAjaxControl.GetTag=function(_b3,_b4,_b5){
if(typeof (_b5)=="undefined"){
_b5="";
}
var _b6=new RegExp("<"+_b4+"[^>]*>((.|\n|\r)*?)</"+_b4+">","i");
var _b7=_b3.match(_b6);
if(_b7!=null&&_b7.length>=2){
return {outer:_b7[0],inner:_b7[1],index:_b7.index};
}else{
return {outer:_b5,inner:_b5,index:-1};
}
};
Telerik.Web.UI.RadAjaxControl.GetLinkHrefs=function(_b8){
var _b9=_b8;
var _ba=[];
while(1){
var _bb=_b9.match(/<link[^>]*href=('|")?([^'"]*)('|")?([^>]*)>.*?(<\/link>)?/i);
if(_bb==null||_bb.length<3){
break;
}
var _bc=_bb[2];
_ba[_ba.length]=_bc;
var _bd=_bb.index+_bc.length;
_b9=_b9.substring(_bd,_b9.length);
}
return _ba;
};
Telerik.Web.UI.RadAjaxControl.GetScriptsSrc=function(_be){
var _bf=_be;
var _c0=[];
while(1){
var _c1=_bf.match(/<script[^>]*src=('|")?([^'"]*)('|")?([^>]*)>.*?(<\/script>)?/i);
if(_c1==null||_c1.length<3){
break;
}
var _c2=_c1[2];
_c0[_c0.length]=_c2;
var _c3=_c1.index+_c2.length;
_bf=_bf.substring(_c3,_bf.length);
}
return _c0;
};
Telerik.Web.UI.RadAjaxControl.IsSafari=function(){
return (navigator.userAgent.match(/safari/i)!=null);
};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxLoadingPanel=function(_c4){
Telerik.Web.UI.RadAjaxLoadingPanel.initializeBase(this,[_c4]);
this._uniqueID="";
this._minDisplayTime=0;
this._initialDelayTime=0;
this._isSticky=false;
this._transparency=0;
this._manager=null;
this._zIndex=90000;
this.UniqueID=this._uniqueID;
this.MinDisplayTime=this._minDisplayTime;
this.InitialDelayTime=this._initialDelayTime;
this.IsSticky=this._isSticky;
this.Transparency=this._transparency;
this.ZIndex=this._zIndex;
};
Telerik.Web.UI.RadAjaxLoadingPanel.prototype={initialize:function(){
Telerik.Web.UI.RadAjaxLoadingPanel.callBaseMethod(this,"initialize");
},dispose:function(){
Telerik.Web.UI.RadAjaxLoadingPanel.callBaseMethod(this,"dispose");
},get_zIndex:function(){
return this._zIndex;
},set_zIndex:function(_c5){
if(this._zIndex!=_c5){
this._zIndex=_c5;
}
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_c6){
if(this._uniqueID!=_c6){
this._uniqueID=_c6;
window[Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(this._uniqueID)]=this;
}
},get_initialDelayTime:function(){
return this._initialDelayTime;
},set_initialDelayTime:function(_c7){
if(this._initialDelayTime!=_c7){
this._initialDelayTime=_c7;
}
},get_isSticky:function(){
return this._isSticky;
},set_isSticky:function(_c8){
if(this._isSticky!=_c8){
this._isSticky=_c8;
}
},get_minDisplayTime:function(){
return this._minDisplayTime;
},set_minDisplayTime:function(_c9){
if(this._minDisplayTime!=_c9){
this._minDisplayTime=_c9;
}
},get_transparency:function(){
return this._transparency;
},set_transparency:function(_ca){
if(this._transparency!=_ca){
this._transparency=_ca;
}
},show:function(_cb){
var _cc=$get(_cb+"_wrapper");
if((typeof (_cc)=="undefined")||(!_cc)){
_cc=$get(_cb);
}
var _cd=this.get_element();
if(!(_cc&&_cd)){
return false;
}
var _ce=this._initialDelayTime;
var _cf=this;
var _d0=(!this._isSticky)?this.cloneLoadingPanel(_cd,_cb):_cd;
if(_ce){
window.setTimeout(function(){
try{
if(_cf._manager!=null&&_cf._manager._isRequestInProgress){
_cf.displayLoadingElement(_d0,_cc);
}
}
catch(e){
}
},_ce);
}else{
this.displayLoadingElement(_d0,_cc);
}
return true;
},hide:function(_d1){
var _d2=$get(_d1);
var _d3=String.format("{0}_wrapper",_d1);
var _d4=$get(_d3);
if(_d4){
_d2=_d4;
}
if(this.get_element()==null){
var el=$get(Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(this._uniqueID));
if(el==null){
return;
}
this._element=el;
}
var _d6=(!this._isSticky)?$get(this.get_element().id+_d1):this.get_element();
var now=new Date();
if(_d6==null){
return;
}
var _d8=now-_d6._startDisplayTime;
var _d9=this._minDisplayTime;
if(this._isSticky){
if(_d9>_d8){
window.setTimeout(function(){
_d6.style.display="none";
},_d9);
}else{
_d6.style.display="none";
}
}else{
if(_d9>_d8){
window.setTimeout(function(){
_d6.parentNode.removeChild(_d6);
if(typeof (_d2)!="undefined"&&(_d2!=null)){
_d2.style.visibility="visible";
}
},_d9);
}else{
_d6.parentNode.removeChild(_d6);
if(typeof (_d2)!="undefined"&&(_d2!=null)){
_d2.style.visibility="visible";
}
}
}
},cloneLoadingPanel:function(_da,_db){
var _dc=_da.cloneNode(false);
_dc.innerHTML=_da.innerHTML;
_dc.id=_da.id+_db;
document.body.insertBefore(_dc,document.body.firstChild);
return _dc;
},displayLoadingElement:function(_dd,_de){
if(!this._isSticky){
if($telerik.isIE6){
this._setDropDownsVisibitily(_de,false);
}
var _df=this.getElementRectangle(_de);
_dd.style.position="absolute";
_dd.style.width=_df.width+"px";
_dd.style.height=_df.height+"px";
_dd.style.left=_df.left+"px";
_dd.style.top=_df.top+"px";
_dd.style.textAlign="center";
_dd.style.zIndex=this._zIndex;
}
_dd.style.display="";
_dd._startDisplayTime=new Date();
var _e0=100-parseInt(this._transparency);
if(parseInt(this._transparency)>0){
if(_dd.style&&_dd.style.MozOpacity!=null){
_dd.style.MozOpacity=_e0/100;
}else{
if(_dd.style&&_dd.style.opacity!=null){
_dd.style.opacity=_e0/100;
}else{
if(_dd.style&&_dd.style.filter!=null){
_dd.style.filter="alpha(opacity="+_e0+");";
_dd.style.zoom=1;
}
}
}
}else{
if(!this._isSticky){
_de.style.visibility="hidden";
}
}
},_setDropDownsVisibitily:function(_e1,_e2){
if(!_e1){
_e1=this;
}
var _e3=_e1.getElementsByTagName("select");
for(var i=0;i<_e3.length;i++){
_e3[i].style.display=(_e2)?"":"none";
}
},getElementRectangle:function(_e5){
if(!_e5){
_e5=this;
}
var _e6=$telerik.getLocation(_e5);
var _e7=_e6.x;
var top=_e6.y;
var _e9=_e5.offsetWidth;
var _ea=_e5.offsetHeight;
return {"left":_e7,"top":top,"width":_e9,"height":_ea};
}};
Telerik.Web.UI.RadAjaxLoadingPanel.registerClass("Telerik.Web.UI.RadAjaxLoadingPanel",Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxManager=function(_eb){
Telerik.Web.UI.RadAjaxManager.initializeBase(this,[_eb]);
this._ajaxSettings=[];
this._defaultLoadingPanelID="";
this._initiators={};
this._loadingPanelsToHide=[];
this._isRequestInProgress=false;
this.Type="Telerik.Web.UI.RadAjaxManager";
this._updatePanelsRenderMode=null;
this.AjaxSettings=this._ajaxSettings;
this.DefaultLoadingPanelID=this._defaultLoadingPanelID;
};
Telerik.Web.UI.RadAjaxManager.prototype={initialize:function(){
Telerik.Web.UI.RadAjaxManager.callBaseMethod(this,"initialize");
var _ec=this.get_element();
if(_ec!=null&&_ec.parentNode!=null&&_ec.parentNode.id==_ec.id+"SU"){
_ec.parentNode.style.display="none";
}
var _ed=this.get_ajaxSettings();
for(var i=0,_ef=_ed.length;i<_ef;i++){
this._initiators[_ed[i].InitControlID]=_ed[i].UpdatedControls;
}
},dispose:function(){
Telerik.Web.UI.RadAjaxManager.callBaseMethod(this,"dispose");
},get_ajaxSettings:function(){
return this._ajaxSettings;
},get_defaultLoadingPanelID:function(){
return this._defaultLoadingPanelID;
},set_defaultLoadingPanelID:function(_f0){
if(this._defaultLoadingPanelID!=_f0){
this._defaultLoadingPanelID=_f0;
}
},get_updatePanelsRenderMode:function(){
return this._updatePanelsRenderMode;
},set_updatePanelsRenderMode:function(_f1){
if(this._updatePanelsRenderMode!=_f1){
this._updatePanelsRenderMode=_f1;
this._applyUpdatePanelsRenderMode(_f1);
}
},_applyUpdatePanelsRenderMode:function(_f2){
var _f3=Sys.WebForms.PageRequestManager.getInstance();
var ids=_f3._updatePanelClientIDs;
for(var i=0;i<ids.length;i++){
var _f6=$get(ids[i]);
if(_f6){
if(_f6.tagName.toLowerCase()=="span"){
continue;
}
_f6.style.display=(_f2==0)?"block":"inline";
}
}
},showLoadingPanels:function(id,_f8){
for(var i=0,_fa=_f8.length;i<_fa;i++){
if(_f8[i].InitControlID==id){
var _fb=_f8[i];
for(var j=0,_fd=_fb.UpdatedControls.length;j<_fd;j++){
var _fe=_fb.UpdatedControls[j];
var _ff=_fe.PanelID;
if(_ff==""){
_ff=this._defaultLoadingPanelID;
}
var _100=_fe.ControlID;
if(_100==this._uniqueID){
continue;
}
var _101=$find(_ff);
if(_101!=null){
_101._manager=this;
if(_101.show(_100)){
var obj={"Panel":_101,"ControlID":_100};
if(!Array.contains(this._loadingPanelsToHide,obj)){
this._loadingPanelsToHide[this._loadingPanelsToHide.length]=obj;
}
}
}
}
}
}
},_initializeRequest:function(_103,args){
Telerik.Web.UI.RadAjaxManager.callBaseMethod(this,"_initializeRequest",[_103,args]);
if(!this._isRequestInProgress){
return;
}
var _105=args.get_postBackElement();
if(_105!=null){
if(this._initiators[_105.id]){
this.showLoadingPanels(_105.id,this.get_ajaxSettings());
}else{
var _106=_105.parentNode;
var _107=false;
while(_106!=null){
if(_106.id&&this._initiators[_106.id]){
_107=true;
break;
}
_106=_106.parentNode;
}
if(_107){
this.showLoadingPanels(_106.id,this.get_ajaxSettings());
}
}
}
},updateElement:function(id,html){
Telerik.Web.UI.RadAjaxControl.UpdateElement(id,html);
}};
Telerik.Web.UI.RadAjaxManager.registerClass("Telerik.Web.UI.RadAjaxManager",Telerik.Web.UI.RadAjaxControl);
Telerik.Web.UI.RadAjaxManager.UpdateElement=function(id,html){
Telerik.Web.UI.RadAjaxControl.UpdateElement(id,html);
};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxPanel=function(_10c){
Telerik.Web.UI.RadAjaxPanel.initializeBase(this,[_10c]);
this._loadingPanelID="";
this._loadingPanelsToHide=[];
this.Type="Telerik.Web.UI.RadAjaxPanel";
this.LoadingPanelID=this._loadingPanelID;
};
Telerik.Web.UI.RadAjaxPanel.prototype={initialize:function(){
var _10d=this.get_element().parentNode;
if(this.get_element().style.height!=""){
_10d.style.height=this.get_element().style.height;
this.get_element().style.height="100%";
}
if(this.get_element().style.width!=""){
_10d.style.width=this.get_element().style.width;
this.get_element().style.width="";
}
Telerik.Web.UI.RadAjaxPanel.callBaseMethod(this,"initialize");
},dispose:function(){
Telerik.Web.UI.RadAjaxPanel.callBaseMethod(this,"dispose");
},_initializeRequest:function(_10e,args){
Telerik.Web.UI.RadAjaxPanel.callBaseMethod(this,"_initializeRequest",[_10e,args]);
if(!this._isRequestInProgress){
return;
}
var _110=args.get_postBackElement();
if(_110!=null&&(_110==this.get_element()||this.isChildOf(_110,this.get_element()))){
var _111=$find(this._loadingPanelID);
if(_111!=null){
_111._manager=this;
if(_111.show(this.get_element().id)){
var obj={"Panel":_111,"ControlID":this.get_element().id};
if(!Array.contains(this._loadingPanelsToHide,obj)){
this._loadingPanelsToHide[this._loadingPanelsToHide.length]=obj;
}
}
}
}
},get_loadingPanelID:function(){
return this._loadingPanelID;
},set_loadingPanelID:function(_113){
if(this._loadingPanelID!=_113){
this._loadingPanelID=_113;
}
}};
Telerik.Web.UI.RadAjaxPanel.registerClass("Telerik.Web.UI.RadAjaxPanel",Telerik.Web.UI.RadAjaxControl);


/* END Telerik.Web.UI.Ajax.Ajax.js */
/* START Telerik.Web.UI.Common.Popup.PopupScripts.js */
Type.registerNamespace("Telerik.Web");
Telerik.Web.BehaviorBase=function(_1){
Telerik.Web.BehaviorBase.initializeBase(this,[_1]);
this._clientStateFieldID=null;
this._pageRequestManager=null;
this._partialUpdateBeginRequestHandler=null;
this._partialUpdateEndRequestHandler=null;
};
Telerik.Web.BehaviorBase.prototype={initialize:function(){
Telerik.Web.BehaviorBase.callBaseMethod(this,"initialize");
},dispose:function(){
var _2=this.get_element();
Telerik.Web.BehaviorBase.callBaseMethod(this,"dispose");
if(_2&&_2._behaviors&&_2._behaviors.length==0){
_2._behaviors=null;
}
_2=null;
if(this._pageRequestManager){
if(this._partialUpdateBeginRequestHandler){
this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateBeginRequestHandler=null;
}
if(this._partialUpdateEndRequestHandler){
this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);
this._partialUpdateEndRequestHandler=null;
}
this._pageRequestManager=null;
}
},get_ClientStateFieldID:function(){
return this._clientStateFieldID;
},set_ClientStateFieldID:function(_3){
if(this._clientStateFieldID!=_3){
this._clientStateFieldID=_3;
this.raisePropertyChanged("ClientStateFieldID");
}
},get_ClientState:function(){
if(this._clientStateFieldID){
var _4=document.getElementById(this._clientStateFieldID);
if(_4){
return _4.value;
}
}
return null;
},set_ClientState:function(_5){
if(this._clientStateFieldID){
var _6=document.getElementById(this._clientStateFieldID);
if(_6){
_6.value=_5;
}
}
},registerPartialUpdateEvents:function(){
if(Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager){
this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();
if(this._pageRequestManager){
this._partialUpdateBeginRequestHandler=Function.createDelegate(this,this._partialUpdateBeginRequest);
this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateEndRequestHandler=Function.createDelegate(this,this._partialUpdateEndRequest);
this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);
}
}
},_partialUpdateBeginRequest:function(_7,_8){
},_partialUpdateEndRequest:function(_9,_a){
}};
Telerik.Web.BehaviorBase.registerClass("Telerik.Web.BehaviorBase",Sys.UI.Behavior);
Type.registerNamespace("Telerik.Web");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ModalExtender=function(_b){
this._windowResizeDelegate=null;
this._windowScrollDelegate=null;
this._xCoordinate=-1;
this._yCoordinate=-1;
this._backgroundElement=null;
this._foregroundElement=_b;
this._saveTabIndexes=new Array();
this._saveDesableSelect=new Array();
this._tagWithTabIndex=new Array("A","AREA","BUTTON","INPUT","OBJECT","SELECT","TEXTAREA","IFRAME");
};
Telerik.Web.UI.ModalExtender.prototype={dispose:function(){
this.hide();
this._backgroundElement=null;
this._foregroundElement=null;
},show:function(){
this._attachWindowHandlers(true);
var _c=this._getModalOverlay();
this._foregroundElement.parentNode.appendChild(_c);
_c.style.zIndex=$telerik.getCurrentStyle(this._foregroundElement,"zIndex",this._foregroundElement.style.zIndex)-1;
_c.style.display="";
this._disableTab();
this._updatePageLayout();
this._updatePageLayout();
},_storeBrowserPosition:function(){
var _d=document.body;
var _e=document.documentElement;
this._browserTop=_d.scrollTop>_e.scrollTop?_d.scrollTop:_e.scrollTop;
this._browserLeft=_d.scrollLeft>_e.scrollLeft?_d.scrollTop:_e.scrollLeft;
},_restoreBrowserPosition:function(_f,top){
try{
if(null==_f){
_f=this._browserLeft;
}
if(null==top){
top=this._browserTop;
}
var _11=document.body;
var _12=document.documentElement;
_11.scrollTop=top;
_11.scrollLeft=_f;
_12.scrollTop=top;
_12.scrollLeft=_f;
}
catch(ex){
}
},hide:function(){
this._backgroundElement.style.display="none";
this._restoreTab();
this._attachWindowHandlers(false);
},_enableScroll:function(_13){
if(_13){
document.body.style.overflow=null!=this._overflow?this._overflow:"";
document.documentElement.style.overflow=null!=this._documentOverflow?this._documentOverflow:"";
document.body.style.marginRight="";
}else{
this._overflow=document.body.style.overflow;
document.body.style.overflow="hidden";
this._documentOverflow=document.documentElement.style.overflow;
document.documentElement.style.overflow="hidden";
document.body.style.marginRight="18px";
}
},_getModalOverlay:function(){
if(!this._backgroundElement){
var div=document.createElement("div");
div.style.display="none";
div.style.position="absolute";
div.style.left="0px";
div.style.top="0px";
div.style.zIndex=10000;
div.style.backgroundColor="#aaaaaa";
div.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)";
div.style.opacity=".5";
div.style.mozOpacity=".5";
div.className="TelerikModalOverlay";
this._backgroundElement=div;
}
return this._backgroundElement;
},_attachWindowHandlers:function(_15){
var _16=window;
if(true==_15){
this._windowResizeDelegate=Function.createDelegate(this,this._updatePageLayout);
$addHandler(_16,"resize",this._windowResizeDelegate);
this._windowScrollDelegate=Function.createDelegate(this,this._updatePageLayout);
$addHandler(_16,"scroll",this._windowScrollDelegate);
}else{
if(this._windowResizeDelegate){
$removeHandler(_16,"resize",this._windowResizeDelegate);
}
this._windowResizeDelegate=null;
if(this._windowScrollDelegate){
$removeHandler(_16,"scroll",this._windowScrollDelegate);
}
this._windowScrollDelegate=null;
}
},_updatePageLayout:function(){
var _17=(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);
var _18=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
var _19=$telerik.getClientBounds();
var _1a=_19.width;
var _1b=_19.height;
var _1c=this._getModalOverlay();
_1c.style.width=Math.max(Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),_1a)+"px";
_1c.style.height=Math.max(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),_1b)+"px";
},_disableTab:function(){
var i=0;
var _1e;
var _1f=new Array();
Array.clear(this._saveTabIndexes);
for(var j=0;j<this._tagWithTabIndex.length;j++){
_1e=this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[j]);
for(var k=0;k<_1e.length;k++){
_1f[i]=_1e[k];
i++;
}
}
i=0;
for(var j=0;j<this._tagWithTabIndex.length;j++){
_1e=document.getElementsByTagName(this._tagWithTabIndex[j]);
for(var k=0;k<_1e.length;k++){
if(Array.indexOf(_1f,_1e[k])==-1){
this._saveTabIndexes[i]={tag:_1e[k],index:_1e[k].tabIndex};
_1e[k].tabIndex="-1";
i++;
}
}
}
i=0;
if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){
var _22=new Array();
for(var j=0;j<this._tagWithTabIndex.length;j++){
_1e=this._foregroundElement.getElementsByTagName("SELECT");
for(var k=0;k<_1e.length;k++){
_22[i]=_1e[k];
i++;
}
}
i=0;
Array.clear(this._saveDesableSelect);
_1e=document.getElementsByTagName("SELECT");
for(var k=0;k<_1e.length;k++){
if(Array.indexOf(_22,_1e[k])==-1){
this._saveDesableSelect[i]={tag:_1e[k],visib:$telerik.getCurrentStyle(_1e[k],"visibility")};
_1e[k].style.visibility="hidden";
i++;
}
}
}
},_restoreTab:function(){
for(var i=0;i<this._saveTabIndexes.length;i++){
this._saveTabIndexes[i].tag.tabIndex=this._saveTabIndexes[i].index;
}
if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){
for(var k=0;k<this._saveDesableSelect.length;k++){
this._saveDesableSelect[k].tag.style.visibility=this._saveDesableSelect[k].visib;
}
}
}};
Telerik.Web.UI.ModalExtender.registerClass("Telerik.Web.UI.ModalExtender",null);
Type.registerNamespace("Telerik.Web");
Telerik.Web.PositioningMode=function(){
throw Error.invalidOperation();
};
Telerik.Web.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5};
Telerik.Web.PositioningMode.registerEnum("Telerik.Web.PositioningMode");
Telerik.Web.PopupBehavior=function(_25){
Telerik.Web.PopupBehavior.initializeBase(this,[_25]);
this._x=0;
this._y=0;
this._positioningMode=Telerik.Web.PositioningMode.Absolute;
this._parentElement=null;
this._parentElementID=null;
this._moveHandler=null;
this._firstPopup=true;
this._originalParent=null;
this._overlay=false;
this._keepInScreenBounds=true;
this._manageVisibility=true;
};
Telerik.Web.PopupBehavior._ie6pinnedList={};
Telerik.Web.PopupBehavior.prototype={getPageOffset:function(){
var _26={x:(document.documentElement.scrollLeft||document.body.scrollLeft),y:(document.documentElement.scrollTop||document.body.scrollTop)};
return _26;
},pin:function(_27){
var _28=this.get_element();
var _29=this.getPageOffset();
if($telerik.isIE6){
var id=this.get_id();
if(_27){
if(Telerik.Web.PopupBehavior._ie6pinnedList[id]){
return;
}
var _2b=$telerik.getBounds(_28);
Telerik.Web.PopupBehavior._ie6pinnedList[id]=window.setInterval(Function.createDelegate(this,function(){
var _2c=this.getPageOffset();
var x=_2b.x-_29.x+_2c.x;
var y=_2b.y-_29.y+_2c.y;
var _2f=this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(x);
this.set_y(y);
this.show();
this.set_parentElement(_2f);
}),130);
}else{
var _30=Telerik.Web.PopupBehavior._ie6pinnedList[id];
if(_30){
window.clearInterval(_30);
}
delete Telerik.Web.PopupBehavior._ie6pinnedList[id];
}
}else{
var _31=_27?"fixed":"absolute";
if(_28.style.position==_31){
return;
}
var _2b=$telerik.getBounds(_28);
if(_27&&(_29.x||_29.y)){
this._x=_2b.x-_29.x;
this._y=_2b.y-_29.y;
$telerik.setLocation(_28,{x:this._x,y:this._y});
}
_28.style.position=_31;
}
},center:function(){
var _32=this.get_element();
if(this._manageVisibility){
$telerik.setVisible(_32,true);
}
var _33=$telerik.getClientBounds();
var _34=$telerik.getBounds(_32);
var x=parseInt((_33.width-_34.width)/2);
var y=parseInt((_33.height-_34.height)/2);
var _37=this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(x);
this.set_y(y);
this.show();
this.set_parentElement(_37);
},get_parentElement:function(){
if(!this._parentElement&&this._parentElementID){
this.set_parentElement($get(this._parentElementID));
Sys.Debug.assert(this._parentElement!=null,String.format("Couldn't find parent element \"{0}\"",this._parentElementID));
}
return this._parentElement;
},set_parentElement:function(_38){
this._parentElement=_38;
},get_parentElementID:function(){
if(this._parentElement){
return this._parentElement.id;
}
return this._parentElementID;
},set_parentElementID:function(_39){
this._parentElementID=_39;
if(this.get_isInitialized()){
this.set_parentElement($get(_39));
}
},get_positioningMode:function(){
return this._positioningMode;
},set_positioningMode:function(_3a){
this._positioningMode=_3a;
},get_x:function(){
return this._x;
},set_x:function(_3b){
if(_3b!=this._x){
this._x=_3b;
if($telerik.getVisible(this.get_element())&&this._manageVisibility){
this.show();
}
}
},get_y:function(){
return this._y;
},set_y:function(_3c){
if(_3c!=this._y){
this._y=_3c;
if($telerik.getVisible(this.get_element())&&this._manageVisibility){
this.show();
}
}
},get_overlay:function(){
return this._overlay;
},set_overlay:function(_3d){
this._overlay=_3d;
this._attachWindowHandlers(false);
if(this._overlay){
this._attachWindowHandlers(true);
}else{
if(!((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7))){
var elt=this.get_element();
var _3f=elt._hideWindowedElementsIFrame;
if(_3f){
_3f.style.display="none";
}
}
}
},get_manageVisibility:function(){
return this._manageVisibility;
},set_manageVisibility:function(_40){
this._manageVisibility=_40;
},get_keepInScreenBounds:function(){
return this._keepInScreenBounds;
},set_keepInScreenBounds:function(_41){
this._keepInScreenBounds=_41;
},hide:function(){
var elt=this.get_element();
if(this._manageVisibility){
$telerik.setVisible(elt,false);
}
if(elt.originalWidth){
elt.style.width=elt.originalWidth+"px";
elt.originalWidth=null;
}
if(Sys.Browser.agent===Sys.Browser.InternetExplorer||this._overlay){
var _43=elt._hideWindowedElementsIFrame;
if(_43){
_43.style.display="none";
}
}
},show:function(){
var elt=this.get_element();
if($telerik.isFirefox){
var doc=document.documentElement;
var _46=$telerik.getCurrentStyle(doc,"overflow");
if("hidden"==_46){
elt.style.left=doc.scrollLeft+"px";
elt.style.top=doc.scrollLeft+"px";
}
}
if(this._manageVisibility){
$telerik.setVisible(elt,true);
}
var _47=elt.offsetParent||document.documentElement;
var _48;
var _49;
if(this._parentElement){
_49=$telerik.getBounds(this._parentElement);
if(_47.tagName.toUpperCase()!="BODY"&&_47.tagName.toUpperCase()!="HTML"){
var _4a=$telerik.getLocation(_47);
_48={x:_49.x-_4a.x+_47.scrollLeft,y:_49.y-_4a.y+_47.scrollTop};
}else{
_48={x:_49.x,y:_49.y};
}
}else{
_49=$telerik.getBounds(_47);
_48={x:0,y:0};
}
var _4b=elt.offsetWidth-(elt.clientLeft?elt.clientLeft*2:0);
var _4c=elt.offsetHeight-(elt.clientTop?elt.clientTop*2:0);
var _4d;
switch(this._positioningMode){
case Telerik.Web.PositioningMode.Center:
_4d={x:Math.round(_49.width/2-_4b/2),y:Math.round(_49.height/2-_4c/2)};
break;
case Telerik.Web.PositioningMode.BottomLeft:
_4d={x:0,y:_49.height};
break;
case Telerik.Web.PositioningMode.BottomRight:
_4d={x:_49.width-_4b,y:_49.height};
break;
case Telerik.Web.PositioningMode.TopLeft:
_4d={x:0,y:-elt.offsetHeight};
break;
case Telerik.Web.PositioningMode.TopRight:
_4d={x:_49.width-_4b,y:-elt.offsetHeight};
break;
default:
_4d={x:0,y:0};
}
_4d.x+=this._x+_48.x;
_4d.y+=this._y+_48.y;
$telerik.setLocation(elt,_4d);
if(this._firstPopup){
elt.style.width=_4b+"px";
}
this._firstPopup=false;
var _4e=$telerik.getBounds(elt);
var _4f=this._getViewportBounds();
if(this._keepInScreenBounds){
var _50=false;
var _51=self.innerWidth?self.innerWidth:document.documentElement.clientWidth;
if(!_51){
_51=document.body.clientWidth;
}
if(_4e.x+_4e.width-_4f.scrollLeft>_51){
_4d.x-=_4e.x+_4e.width-_51+_4f.scrollLeft;
_50=true;
}
if(_4e.x<0){
_4d.x-=_4e.x;
_50=true;
}
if(_4e.y<0){
_4d.y-=_4e.y;
_50=true;
}
if(_4f.height<_4e.y+_4e.height-_4f.scrollTop){
if(_4f.height-_4e.height>0){
_4d.y=_4f.height-_4e.height+_4f.scrollTop;
_50=true;
}
}
if(_50){
$telerik.setLocation(elt,_4d);
_4e=$telerik.getBounds(elt);
}
}
elt.zIndex=1000;
if(((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7))||this._overlay){
var _52=elt._hideWindowedElementsIFrame;
if(!_52){
_52=document.createElement("iframe");
_52.src="javascript:'<html></html>';";
_52.style.position="absolute";
_52.style.display="none";
_52.scrolling="no";
_52.frameBorder="0";
_52.tabIndex="-1";
_52.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
elt.parentNode.insertBefore(_52,elt);
elt._hideWindowedElementsIFrame=_52;
this._moveHandler=Function.createDelegate(this,this._onMove);
Sys.UI.DomEvent.addHandler(elt,"move",this._moveHandler);
}
$telerik.setBounds(_52,_4e);
if(Sys.Browser.agent===Sys.Browser.Firefox){
_52.style.top=parseInt(_4e.y)-_4f.scrollTop+"px";
_52.style.left=parseInt(_4e.x)-_4f.scrollLeft+"px";
_52.style.position="fixed";
}
if($telerik.quirksMode){
return;
}
_52.style.display=elt.style.display;
if(elt.currentStyle&&elt.currentStyle.zIndex){
_52.style.zIndex=elt.currentStyle.zIndex;
}else{
if(elt.style.zIndex){
_52.style.zIndex=elt.style.zIndex;
}
}
}
},_getViewportBounds:function(){
var _53=$telerik.getClientBounds();
var _54=document.documentElement.scrollLeft||document.body.scrollLeft;
var _55=document.documentElement.scrollTop||document.body.scrollTop;
_53.scrollLeft=_54;
_53.scrollTop=_55;
return _53;
},_setCoordinates:function(x,y){
var _58=false;
if(x!=this._x){
this._x=x;
_58=true;
}
if(y!=this._y){
this._y=y;
_58=true;
}
if($telerik.getVisible(this.get_element())&&_58&&this._manageVisibility){
this.show();
}
},initialize:function(){
Telerik.Web.PopupBehavior.callBaseMethod(this,"initialize");
this.hide();
this.get_element().style.position="absolute";
},dispose:function(){
var elt=this.get_element();
if(elt){
if(this._moveHandler){
Sys.UI.DomEvent.removeHandler(elt,"move",this._moveHandler);
this._moveHandler=null;
}
this._attachWindowHandlers(false);
if($telerik.getVisible(elt)&&this._manageVisibility){
this.hide();
}
if(this._originalParent){
elt.parentNode.removeChild(elt);
this._originalParent.appendChild(elt);
this._originalParent=null;
}
var _5a=elt._hideWindowedElementsIFrame;
if(_5a){
_5a.parentNode.removeChild(_5a);
}
}
this._parentElement=null;
Telerik.Web.PopupBehavior.callBaseMethod(this,"dispose");
},_onMove:function(){
var elt=this.get_element();
var _5c=elt._hideWindowedElementsIFrame;
if(_5c){
if(Sys.Browser.agent===Sys.Browser.Firefox){
var _5d=this._getViewportBounds();
_5c.style.top=parseInt(elt.style.top)-_5d.scrollTop+"px";
_5c.style.left=parseInt(elt.style.left)-_5d.scrollLeft+"px";
_5c.style.position="fixed";
}else{
_5c.style.top=elt.style.top;
_5c.style.left=elt.style.left;
}
}
},_handleElementResize:function(){
var elt=this.get_element();
var _5f=elt._hideWindowedElementsIFrame;
if(_5f){
var _60=$telerik.getBounds(elt);
$telerik.setBounds(_5f,_60);
}
},_attachWindowHandlers:function(_61){
if(!Sys.Browser.agent===Sys.Browser.Firefox){
return;
}
var _62=window;
if(true==_61){
this._windowResizeDelegate=Function.createDelegate(this,this._onMove);
$addHandler(_62,"resize",this._windowResizeDelegate);
this._windowScrollDelegate=Function.createDelegate(this,this._onMove);
$addHandler(_62,"scroll",this._windowScrollDelegate);
}else{
if(this._windowResizeDelegate){
$removeHandler(_62,"resize",this._windowResizeDelegate);
}
this._windowResizeDelegate=null;
if(this._windowScrollDelegate){
$removeHandler(_62,"scroll",this._windowScrollDelegate);
}
this._windowScrollDelegate=null;
}
}};
Telerik.Web.PopupBehavior.registerClass("Telerik.Web.PopupBehavior",Telerik.Web.BehaviorBase);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ResizeExtender=function(_63,_64,_65,_66,doc,_68){
this._document=doc?doc:document;
this._documentMouseMoveDelegate=null;
this._documentMouseUpDelegate=null;
this._element=null;
this._tableElement=null;
this._moveCursorType="move";
this._enabled=true;
this._jsOwner=null;
this._hideIframes=true;
this._saveDelegates={};
this.makeResizable(_63,_64,_65,_66,_68);
};
Telerik.Web.UI.ResizeExtender.containsBounds=function(_69,_6a){
if(!_69||!_6a){
return false;
}
var _6b=$telerik.containsPoint(_69,_6a.x,_6a.y);
if(_6b){
var x=_6a.x+_6a.width;
var y=_6a.y+_6a.height;
_6b=$telerik.containsPoint(_69,x,y);
}
return _6b;
};
Telerik.Web.UI.ResizeExtender.prototype={dispose:function(){
this._attachDocumentHandlers(false);
this._configureHandleElements(false);
this._jsOwner=null;
},enable:function(_6e){
this._enabled=_6e;
},set_hideIframes:function(_6f){
this._hideIframes=_6f;
},get_hideIframes:function(){
return this._hideIframes;
},makeResizable:function(_70,_71,_72,_73,_74){
if(!_71){
return;
}
if(this._element){
alert("Element "+_71.getAttribute("id")+" cannot be made resizable, as the resizeExtender already has the element "+this._element.getAttribute("id")+" associated with it. You must create a new extender resizer object");
return;
}
this._jsOwner=_70;
this._element=_71;
this._tableElement=_73;
this._resizeHandles=_72;
if(_74){
this._moveCursorType=_74;
}
this._startX=0;
this._startY=0;
this._cancelResize=true;
this._configureHandleElements(true);
},_raiseDragEvent:function(_75,ev,_77){
if(this._jsOwner&&this._jsOwner["on"+_75]){
var _78=ev;
if(!_78){
_78={};
}
_78.element=this._element;
_78.ownerEvent=_77;
return this._jsOwner["on"+_75](_78);
}
return true;
},_raiseEvent:function(_79,ev){
if(this._jsOwner&&this._jsOwner["on"+_79]){
if(!ev){
ev=new Sys.EventArgs();
}else{
if(_79=="Resize"){
ev=this._resizeDir;
}else{
if(_79=="Resizing"){
ev=this._getProposedBounds(ev);
}
}
}
return this._jsOwner["on"+_79](ev);
}
return true;
},_getProposedBounds:function(b1){
var b2=$telerik.getBounds(this._element);
return {x:b1.x||b2.x,y:b1.y||b2.y,width:b1.width||b2.width,height:b1.height||b2.height};
},_resize:function(e){
if(!this._enabled||this._cancelResize){
return false;
}
var _7e=0;
var _7f=0;
var _80=0;
var _81=0;
var _82=this._originalBounds;
var _83=this._resizeDir.move;
if(_83){
_80=_82.x+(e.clientX-this._startX);
_81=_82.y+(e.clientY-this._startY);
}else{
if(this._resizeDir.east){
_7e=_82.width+(e.clientX-this._startX);
}else{
if(this._resizeDir.west){
_80=e.clientX-this._leftHandleMouseDelta;
_7e=_82.width-(e.clientX-this._startX);
}
}
if(this._resizeDir.south){
_7f=_82.height+(e.clientY-this._startY);
}else{
if(this._resizeDir.north){
_81=_82.y+(e.clientY-this._startY);
_7f=_82.height-(e.clientY-this._startY);
}
}
}
if(this._offsetLocation){
_80-=this._offsetLocation.x;
_81-=this._offsetLocation.y;
}
var _84=new Sys.UI.Bounds(_80,_81,_7e,_7f);
var _85=_83?this._raiseDragEvent("Drag",_84,e):this._raiseEvent("Resizing",_84);
if(false==_85){
return true;
}
if(_83||_84.x>0){
this._element.style.left=_84.x+"px";
}
if(_83||_84.y>0){
this._element.style.top=_84.y+"px";
}
if(_84.width>0){
this._element.style.width=_84.width+"px";
}
if(_84.height>0){
this._element.style.height=_84.height+"px";
}
if(!_83){
this._updateInnerTableSize();
}
return true;
},_storeStartCoords:function(e){
if(!this._enabled){
return;
}
this._cancelResize=false;
this._startX=e.clientX;
this._startY=e.clientY;
var _87=$telerik.getBounds(this._element);
this._originalBounds=_87;
var _88=e.target?e.target:e.srcElement;
if(_88&&_88.type==3){
_88=_88.parentNode;
}
this._resizeType=$telerik.getCurrentStyle(_88,"cursor");
this._resizeDir={north:this._resizeType.match(/n.?-/)?1:0,east:this._resizeType.match(/e-/)?1:0,south:this._resizeType.match(/s.?-/)?1:0,west:this._resizeType.match(/w-/)?1:0,move:new RegExp(this._moveCursorType).test(this._resizeType)?1:0};
this._leftHandleMouseDelta=0;
if(this._resizeDir.west){
this._leftHandleMouseDelta=Math.abs($telerik.getBounds(_88).x-this._startX);
}
var _89=this._resizeDir.move?this._raiseDragEvent("DragStart",null,e):this._raiseEvent("ResizeStart");
this._cancelResize=(_89==false);
var _8a=$telerik.getCurrentStyle(this._element.parentNode,"position");
var _8b=("relative"==_8a)||("absolute"==_8a);
this._offsetLocation=_8b?$telerik.getLocation(this._element.parentNode):null;
if(!this._cancelResize){
this._clearSelection();
this._setIframesVisible(false);
this._attachDocumentHandlers(false);
this._attachDocumentHandlers(true);
}
},_updateInnerTableSize:function(){
var dir=this._resizeDir;
if(dir.south||dir.north){
var _8d=this._element.style.height;
var _8e=this._tableElement;
if(_8e){
_8e.style.height=_8d;
this._fixIeHeight(_8e,_8d);
}
}
},_setIframesVisible:function(_8f){
if(!this._hideIframes){
return;
}
var _90=this._document.getElementsByTagName("IFRAME");
for(var i=0;i<_90.length;i++){
var _92=_90[i];
_92.style.visibility=_8f?"":"hidden";
if($telerik.isIE){
try{
_92.contentWindow.document.body.style.visibility=_8f?"":"hidden";
}
catch(ex){
}
}
}
},_configureHandleElements:function(_93){
var _94=["nw","n","ne","w","e","sw","s","se",this._moveCursorType];
for(var i=0;i<_94.length;i++){
var _96=_94[i];
var _97=this._resizeHandles[_96];
if(_97){
if(_97 instanceof Array){
for(var j=0;j<_97.length;j++){
this._configureHandle("id"+i+"_"+j,_93,_97[j],_96);
}
}else{
this._configureHandle("id"+i,_93,_97,_96);
}
}
}
if(!_93){
this._saveDelegates={};
}
},_configureHandle:function(_99,_9a,_9b,_9c){
if(_9a){
var _9d=Function.createDelegate(this,this._onHandleMouseDown);
$telerik.addExternalHandler(_9b,"mousedown",_9d);
this._saveDelegates[_99]={delegate:_9d,element:_9b};
var _9e=(_9c==this._moveCursorType?this._moveCursorType:_9c+"-resize");
_9b.style.cursor=_9e;
}else{
$telerik.removeExternalHandler(_9b,"mousedown",this._saveDelegates[_99].delegate);
_9b.style.cursor="";
}
},_attachDocumentHandlers:function(_9f){
var _a0=this._document;
if(true==_9f){
this._documentMouseMoveDelegate=Function.createDelegate(this,this._onDocumentMouseMove);
$telerik.addExternalHandler(_a0,"mousemove",this._documentMouseMoveDelegate);
this._documentMouseUpDelegate=Function.createDelegate(this,this._onDocumentMouseUp);
$telerik.addExternalHandler(_a0,"mouseup",this._documentMouseUpDelegate);
}else{
if(this._documentMouseMoveDelegate){
$telerik.removeExternalHandler(_a0,"mousemove",this._documentMouseMoveDelegate);
}
this._documentMouseMoveDelegate=null;
if(this._documentMouseUpDelegate){
$telerik.removeExternalHandler(_a0,"mouseup",this._documentMouseUpDelegate);
}
this._documentMouseUpDelegate=null;
}
},_onDocumentMouseMove:function(e){
var _a2=this._resize(e);
this._autoScroll(e);
if(_a2){
return $telerik.cancelRawEvent(e);
}
},_onDocumentMouseUp:function(e){
var _a4=!this._cancelResize;
this._cancelResize=true;
if(_a4){
this._clearSelection();
this._setIframesVisible(true);
if(this._resizeDir&&this._resizeDir.move){
this._raiseDragEvent("DragEnd",null,e);
}else{
this._raiseEvent("ResizeEnd");
}
this._attachDocumentHandlers(false);
if(this._scroller){
this._scroller.set_enabled(false);
}
}
},_onHandleMouseDown:function(e){
this._storeStartCoords(e);
return $telerik.cancelRawEvent(e);
},_clearSelection:function(){
if(this._document.selection&&this._document.selection.empty){
this._document.selection.empty();
}
},_fixIeHeight:function(_a6,_a7){
if("CSS1Compat"==document.compatMode){
var _a8=(_a6.offsetHeight-parseInt(_a7));
if(_a8>0){
var _a9=(parseInt(_a6.style.height)-_a8);
if(_a9>0){
_a6.style.height=_a9+"px";
}
}
}
},_initializeAutoScroll:function(){
if(this._autoScrollInitialized){
return;
}
this._scrollEdgeConst=40;
this._scrollByConst=10;
this._scroller=null;
this._scrollDeltaX=0;
this._scrollDeltaY=0;
this._scrollerTickHandler=Function.createDelegate(this,this._onScrollerTick);
this._scroller=new Telerik.Web.Timer();
this._scroller.set_interval(10);
this._scroller.add_tick(this._scrollerTickHandler);
this._autoScrollInitialized=true;
},_autoScroll:function(ev){
this._initializeAutoScroll();
var _ab=$telerik.getClientBounds();
if(_ab.width>0){
this._scrollDeltaX=this._scrollDeltaY=0;
if(ev.clientX<_ab.x+this._scrollEdgeConst){
this._scrollDeltaX=-this._scrollByConst;
}else{
if(ev.clientX>_ab.width-this._scrollEdgeConst){
this._scrollDeltaX=this._scrollByConst;
}
}
if(ev.clientY<_ab.y+this._scrollEdgeConst){
this._scrollDeltaY=-this._scrollByConst;
}else{
if(ev.clientY>_ab.height-this._scrollEdgeConst){
this._scrollDeltaY=this._scrollByConst;
}
}
var _ac=this._scroller;
if(this._scrollDeltaX!=0||this._scrollDeltaY!=0){
this._originalStartX=this._startX;
this._originalStartY=this._startY;
_ac.set_enabled(true);
}else{
if(_ac.get_enabled()){
this._startX=this._originalStartX;
this._startY=this._originalStartY;
}
_ac.set_enabled(false);
}
}
},_onScrollerTick:function(){
var _ad=document.documentElement.scrollLeft||document.body.scrollLeft;
var _ae=document.documentElement.scrollTop||document.body.scrollTop;
window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);
var _af=document.documentElement.scrollLeft||document.body.scrollLeft;
var _b0=document.documentElement.scrollTop||document.body.scrollTop;
var _b1=_af-_ad;
var _b2=_b0-_ae;
var _b3=this._element;
var _b4={x:parseInt(_b3.style.left)+_b1,y:parseInt(_b3.style.top)+_b2};
this._startX-=_b1;
this._startY-=_b2;
$telerik.setLocation(_b3,_b4);
}};
Telerik.Web.UI.ResizeExtender.registerClass("Telerik.Web.UI.ResizeExtender",null);


/* END Telerik.Web.UI.Common.Popup.PopupScripts.js */
/* START Telerik.Web.UI.Window.RadWindow.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadWindowControllerClass=function(){
this._activeWindow=null;
this._historyStack=[];
this._registerGlobalBodyEventHandlers();
};
Telerik.Web.UI.RadWindowControllerClass.prototype={getInstance:function(){
return this;
},_registerGlobalBodyEventHandlers:function(){
var _1=Function.createDelegate(null,function(e){
if(e.keyCode==27){
Telerik.Web.UI.RadWindowController.hideCurrentWindowIfNonModal();
}
});
$addHandler(document.documentElement,"keydown",_1);
Sys.Application.add_unload(function(){
$removeHandler(document.documentElement,"keydown",_1);
});
},hideCurrentWindowIfNonModal:function(){
if(this._activeWindow!=null&&this._activeWindow.isModal&&!this._activeWindow.isModal()){
this._activeWindow.close();
}
this._activeWindow=null;
},inactivateCurrentWindow:function(){
if(this._activeWindow!=null){
this._activeWindow.setActive(false);
}
this._activeWindow=null;
},set_activeWindow:function(_3){
if(_3==this._activeWindow){
return;
}
this.inactivateCurrentWindow();
this._activeWindow=_3;
Array.remove(this._historyStack,_3);
Array.add(this._historyStack,_3);
},notifyWindowClosed:function(_4){
if(this._activeWindow==_4){
this._activeWindow=null;
}
Array.remove(this._historyStack,_4);
this._activatePreviousWindow();
},_activatePreviousWindow:function(){
var _5=this._historyStack;
var i=_5.length-1;
for(;i>=0;i--){
var _7=_5[i];
if(!_7){
return;
}
if(_7.isCreated()&&!_7.isClosed()&&!_7.isMinimized()){
_7.setActive(true);
break;
}else{
Array.removeAt(_5,i);
}
}
},get_activeWindow:function(){
return this._activeWindow;
}};
Telerik.Web.UI.RadWindowControllerClass.registerClass("Telerik.Web.UI.RadWindowControllerClass",null);
if(!Telerik.Web.UI.RadWindowController){
Telerik.Web.UI.RadWindowController=new Telerik.Web.UI.RadWindowControllerClass();
}
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.RadWindowUtils");
Telerik.Web.UI.RadWindowUtils.Localization={"Close":"Close","Minimize":"Minimize","Maximize":"Maximize","Reload":"Reload","PinOn":"Pin on","PinOff":"Pin off","Restore":"Restore","OK":"OK","Cancel":"Cancel","Yes":"Yes","No":"No"};
Telerik.Web.UI.RadWindow=function(_8){
Telerik.Web.UI.RadWindow.initializeBase(this,[_8]);
this._eventNames=["resize","activate","dragStart","dragEnd","show","pageLoad","close","command"];
this._openerElement=null;
this._offsetElement=null;
this._popupElement=null;
this._tableElement=null;
this._contentElement=null;
this._contentCell=null;
this._titleElement=null;
this._titleCell=null;
this._titlebarElement=null;
this._statusCell=null;
this._statusMessageElement=null;
this._iframe=null;
this._buttonsElement=null;
this._buttonsArray=[];
this.isIE=($telerik.isIE);
this._openerElementID=null;
this._offsetElementID=null;
this._behaviors=Telerik.Web.UI.WindowBehaviors.Default;
this._initialBehaviors=Telerik.Web.UI.WindowBehaviors.None;
this._navigateUrl=null;
this._left="";
this._top="";
this._formID=null;
this._skin="Default";
this._title="";
this._width="300px";
this._height="300px";
this._minimizeZoneID=null;
this._restrictionZoneID="";
this._clientCallBackFunction=null;
this._reloadOnShow=false;
this._visibleOnPageLoad=false;
this._destroyOnClose=false;
this._visibleTitlebar=true;
this._visibleStatusbar=true;
this._showContentDuringLoad=true;
this._modal=false;
this._overlay=false;
this._keepInScreenBounds=false;
this._iconUrl=null;
this._minimizeIconUrl=null;
this._animation=Telerik.Web.UI.WindowAnimation.None;
this._windowAnimation=null;
this._onMouseDownDelegate=null;
this._onClickDelegate=null;
this._onTitlebarDblclickDelegate=null;
this._onTitlebarClickDelegate=null;
this._onWindowResizeDelegate=null;
this._onIframeLoadDelegate=null;
this._onChildPageUnloadDelegate=null;
this._onChildPageClickDelegate=null;
this._onModalShowHandler=null;
this._onModalCloseHandler=null;
this._loaded=false;
this._isCloned=false;
this._restoreRect=null;
this._popupBehavior=null;
this._popupVisible=false;
this._windowManager;
this.GetWindowManager=this.get_windowManager;
this.BrowserWindow=window;
this.GetContentFrame=this.get_contentFrame;
this.GetLeftPosition=function(){
this.getWindowBounds().x;
};
this.GetTopPosition=function(){
this.getWindowBounds().y;
};
this.GetTitlebar=function(){
return this._titleCell;
};
this.GetStatusbar=function(){
return this._statusCell;
};
this.SetOpenerElementId=this.set_openerElementID;
this.SetStatus=this.set_status;
this.GetStatus=this.get_status;
this.SetModal=this.set_modal;
this.SetWidth=this.set_width;
this.SetHeight=this.set_height;
this.GetWidth=this.get_width;
this.GetHeight=this.get_height;
this.SetOffsetElementId=this.set_offsetElementID;
this.SetTitle=this.set_title;
this.MoveTo=this.moveTo;
this.Center=this.center;
this.SetVisible=this.setVisible;
this.SetSize=this.setSize;
this.Show=this.show;
this.Hide=this.hide;
this.GetUrl=this.get_navigateUrl;
this.SetUrl=this.setUrl;
this.Reload=this.reload;
this.SetActive=this.setActive;
this.Minimize=this.minimize;
this.Restore=this.restore;
this.Maximize=this.maximize;
this.Close=this.close;
this.TogglePin=this.togglePin;
this.IsMaximized=this.isMaximized;
this.IsMinimized=this.isMinimized;
this.IsModal=this.isModal;
this.IsClosed=this.isClosed;
this.IsPinned=this.isPinned;
this.IsVisible=this.isVisible;
this.IsActive=this.isActive;
this.IsBehaviorEnabled=this.isBehaviorEnabled;
};
Telerik.Web.UI.RadWindow.prototype={_getLocalization:function(){
return Telerik.Web.UI.RadWindowUtils.Localization;
},_registerIframeLoadHandler:function(_9){
if(!this._iframe){
return;
}
if(_9){
this._onIframeLoadDelegate=Function.createDelegate(this,this._onIframeLoad);
$addHandler(this._iframe,"load",this._onIframeLoadDelegate);
}else{
if(this._onIframeLoadDelegate){
$removeHandler(this._iframe,"load",this._onIframeLoadDelegate);
this._onIframeLoadDelegate=null;
$clearHandlers(this._iframe);
}
}
},_registerWindowResizeHandler:function(_a){
if(_a){
this._onWindowResizeDelegate=Function.createDelegate(this,this._maintainMaximizedSize);
$addHandler(window,"resize",this._onWindowResizeDelegate);
}else{
if(this._onWindowResizeDelegate){
$removeHandler(window,"resize",this._onWindowResizeDelegate);
this._onWindowResizeDelegate=null;
}
}
},_registerOpenerElementHandler:function(_b,_c){
if(!_b){
return;
}
if(true==_c){
this._onClickDelegate=Function.createDelegate(this,this._onClick);
$addHandler(_b,"click",this._onClickDelegate);
}else{
var _d=$removeHandler(_b,"click",this._onClickDelegate);
this._onClickDelegate=null;
}
},_registerTitlebarHandlers:function(_e){
var _f=this._titleCell;
if(_e){
this._onTitlebarDblclickDelegate=Function.createDelegate(this,function(){
if(this.isMinimized()||this.isMaximized()){
this.restore();
}else{
this.maximize();
}
});
this._onTitlebarClickDelegate=Function.createDelegate(this,function(){
this.setActive(true);
});
$addHandler(_f,"dblclick",this._onTitlebarDblclickDelegate);
$addHandler(_f,"click",this._onTitlebarClickDelegate);
}else{
if(_f){
if(this._onTitlebarDblclickDelegate){
$removeHandler(_f,"dblclick",this._onTitlebarDblclickDelegate);
this._onTitlebarDblclickDelegate=null;
}
if(this._onTitlebarClickDelegate){
$removeHandler(_f,"click",this._onTitlebarClickDelegate);
this._onTitlebarClickDelegate=null;
}
$clearHandlers(_f);
}
}
},_makeModal:function(_10){
if(this._onModalShowHandler){
this.remove_show(this._onModalShowHandler);
this._onModalShowHandler=null;
}
if(this._onModalCloseHandler){
this.remove_close(this._onModalCloseHandler);
this._onModalCloseHandler=null;
}
if(this._modalExtender){
this._modalExtender.dispose();
this._modalExtender=null;
}
if(!_10){
return;
}
if(typeof (Telerik.Web.UI.RadWindowManager)!="undefined"&&Telerik.Web.UI.RadWindowManager.isInstanceOfType(this)){
return;
}
this._onModalShowHandler=function(_11){
if(!_11._modalExtender){
_11._modalExtender=new Telerik.Web.UI.ModalExtender(_11._popupElement);
}
_11._modalExtender.show();
_11.center();
};
this.add_show(this._onModalShowHandler);
this._onModalCloseHandler=function(_12){
window.setTimeout(function(){
if(_12._modalExtender){
_12._modalExtender.hide();
}
},10);
};
this.add_close(this._onModalCloseHandler);
},_enableMoveResize:function(_13){
if(this._resizeExtender){
this._resizeExtender.dispose();
this._resizeExtender=null;
}
if(!_13){
return;
}
if(!this._popupElement){
return;
}
var _14=this._tableElement.rows;
var _15={};
if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Resize)){
_15={nw:_14[0].cells[0],n:this._topResizer,ne:_14[0].cells[2],w:[_14[1].cells[0],_14[2].cells[0]],e:[_14[1].cells[2],_14[2].cells[2]],sw:_14[3].cells[0],s:_14[3].cells[1],se:[_14[3].cells[2],this._bottomResizer]};
}
if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Move)){
_15["move"]=this._titleCell;
}
this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._popupElement,_15,this._tableElement);
},onResizeStart:function(){
if(this.isMaximized()){
return false;
}
this._cachedDragZoneBounds=this._getRestrictionZoneBounds();
},onResizing:function(_16){
if(!this._cachedDragZoneBounds){
return true;
}
return this._checkRestrictionZoneBounds(this._cachedDragZoneBounds,_16);
},onResizeEnd:function(){
this._cachedDragWindowBounds=null;
var _17=this._getCurrentBounds();
this.moveTo(_17.x,_17.y);
if(this._overlay&&$telerik.isFirefox){
this._popupBehavior._onMove();
}
this.raiseEvent("resize",new Sys.EventArgs());
},onDragStart:function(){
this.setActive(true);
if(this.isPinned()||this.isMaximized()){
return false;
}
if(this.isMinimized()&&this.get_minimizeZoneID()){
return false;
}
this._cachedDragZoneBounds=this._getRestrictionZoneBounds();
this._cachedDragWindowBounds=$telerik.getBounds(this._popupElement);
this.raiseEvent("dragStart",new Sys.EventArgs());
return true;
},onDragEnd:function(_18){
this._cachedDragZoneBounds=null;
this._cachedDragWindowBounds=null;
if(this._overlay&&$telerik.isFirefox){
this._popupBehavior._onMove();
}
this.raiseEvent("dragEnd",new Sys.EventArgs());
var _19=this._getCurrentBounds();
this.moveTo(_19.x,_19.y);
this.setActive(true);
},onDrag:function(_1a){
if(!this._cachedDragZoneBounds){
return true;
}
var _1b=this._cachedDragWindowBounds;
var _1c=this._cachedDragZoneBounds;
_1a.width=_1b.width;
_1a.height=_1b.height;
var _1d=this._checkRestrictionZoneBounds(_1c,_1a);
if(!_1d){
if(_1a.x<=_1c.x){
_1a.x=_1c.x;
}else{
if(_1c.x+_1c.width<=_1a.x+_1b.width){
_1a.x=_1c.x+_1c.width-_1b.width;
}
}
if(_1a.y<=_1c.y){
_1a.y=_1c.y;
}else{
if(_1c.y+_1c.height<=_1a.y+_1b.height){
_1a.y=_1c.y+_1c.height-_1b.height;
}
}
_1d=true;
}
return _1d;
},initialize:function(){
Telerik.Web.UI.RadWindow.callBaseMethod(this,"initialize");
if(this._visibleOnPageLoad){
setTimeout(Function.createDelegate(this,function(){
this.show();
}),0);
}
this._registerWindowResizeHandler(true);
},dispose:function(){
var _1e=this.get_windowManager();
if(_1e){
if(_1e.get_preserveClientState()){
_1e.saveWindowState(this);
}
if(this._destroyOnClose){
_1e.removeWindow(this);
}
}
if(this._windowAnimation){
this._windowAnimation.dispose();
}
this._enableMoveResize(false);
this._makeModal(false);
this._registerTitlebarHandlers(false);
this._registerWindowResizeHandler(false);
this._registerIframeLoadHandler(false);
if(this._openerElement){
this._registerOpenerElementHandler(this._openerElement,false);
}
this.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);
var _1f=this._iframe;
if(_1f){
_1f.radWindow=null;
_1f.src="javascript:'<html></html>';";
_1f.name="";
_1f.removeAttribute("name");
_1f.removeAttribute("NAME");
}
if(this._contentElement){
this._contentElement.innerHTML="";
}
var _20=this._popupElement;
if(_20&&_20.parentNode){
_20.parentNode.removeChild(_20);
}
Telerik.Web.UI.RadWindow.callBaseMethod(this,"dispose");
},hide:function(){
this._hide();
return true;
},clone:function(_21,_22){
if(!_21){
alert("Telerik.Web.UI.RadWindow.clone called without providing a name argument");
return;
}
var evs=(_22!=false)?this._getEventsParameter():null;
var _24=this._getPropertiesParameter();
var _25=document.createElement("SPAN");
_25.setAttribute("id",_21);
var wnd=$create(Telerik.Web.UI.RadWindow,_24,evs,null,_25);
wnd.set_name(_21);
wnd._isCloned=true;
return wnd;
},set_contentElement:function(_27){
this._createUI();
if(this._iframe){
this._iframe.style.display="none";
}
if(_27.parentNode&&_27.parentNode.removeChild){
_27.parentNode.removeChild(_27);
}
this._contentCell.appendChild(_27);
_27.style.display="";
this._contentElement=_27;
},get_contentElement:function(){
return this._contentElement;
},isCreated:function(){
return this._popupElement!=null;
},show:function(){
var _28=this.isCreated();
this._createUI();
if(this._navigateUrl&&(!_28||this._reloadOnShow)){
this.setUrl(this._navigateUrl);
}
if(!_28&&(this._initialBehaviors!=Telerik.Web.UI.WindowBehaviors.None)){
this._show();
this._afterShow();
if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Minimize)){
this.minimize();
}
if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Maximize)){
this.maximize();
}
if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Pin)){
this.togglePin();
}
return;
}
if(this._animation==Telerik.Web.UI.WindowAnimation.None){
this._show();
this._afterShow();
}else{
this._playAnimation();
}
},_show:function(){
this.raiseEvent("beforeShow",new Sys.EventArgs());
if(this.get_offsetElementID()&&!this._offsetElement){
var _29=$get(this.get_offsetElementID());
if(_29){
this._offsetElement=_29;
}
}
var _2a=this._popupBehavior.get_parentElement();
if(this._offsetElement&&!this._offsetSet){
this._popupBehavior.set_parentElement(this._offsetElement);
this._offsetSet=true;
}
this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
this._reSetWindowPosition();
if(_2a!=this._popupBehavior.get_parentElement()){
this._popupBehavior.set_parentElement(_2a);
}
this._popupVisible=true;
},_hide:function(){
if(this._windowAnimation){
this._windowAnimation.stop();
}
if(this._windowAnimation){
this._windowAnimation.play(true);
}else{
this._afterHide();
}
},_afterHide:function(){
if(!this._popupBehavior){
return;
}
if(this.isMaximized()){
this.restore();
}
this._popupBehavior.hide(true);
this._popupVisible=false;
this._getWindowController().notifyWindowClosed(this);
},_afterShow:function(){
this.setActive(true);
this._storeBounds();
this.raiseEvent("show",new Sys.EventArgs());
},_playAnimation:function(){
var _2b=function(){
var wnd=this.controller;
var _2d=wnd._getCalculatedPopupBounds();
wnd._setPopupVisible(_2d.x,_2d.y);
var _2e=$telerik.getBounds(wnd._popupElement);
wnd._popupBehavior.hide();
this.set_endBounds(_2e);
};
if(!this._windowAnimation){
if(this._animation==Telerik.Web.UI.WindowAnimation.Fade){
this._windowAnimation=new Telerik.Web.UI.Animations.FadeAnimation(this,0.4,null,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=function(){
this.controller._show();
};
}else{
if(this._animation==Telerik.Web.UI.WindowAnimation.Slide){
this._windowAnimation=new Telerik.Web.UI.Animations.SlideAnimation(this,0.2,null,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=_2b;
}else{
if(this._animation==Telerik.Web.UI.WindowAnimation.FlyIn){
this._windowAnimation=new Telerik.Web.UI.Animations.FlyInAnimation(this,null,null,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=_2b;
}else{
if(this._animation==Telerik.Web.UI.WindowAnimation.Resize){
this._windowAnimation=new Telerik.Web.UI.Animations.ResizeAnimation(this,0.2,50,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=_2b;
}
}
}
}
}
if(this._windowAnimation){
this._windowAnimation.onShowEnd=function(){
this.controller._show();
this.controller._afterShow();
};
this._windowAnimation.onHideEnd=function(){
this.controller._afterHide();
};
this._windowAnimation.play();
}
},_onClick:function(e){
this.show();
return this._cancelEvent(e);
},_cancelEvent:function(e){
if(e){
e.returnValue=false;
e.cancelBubble=true;
e.preventDefault();
e.stopPropagation();
}
return false;
},_getWindowController:function(){
return Telerik.Web.UI.RadWindowController.getInstance();
},_getReloadOnShowUrl:function(_31){
var str="rwndrnd="+Math.random();
if(_31.indexOf("?")>-1){
str="&"+str;
}else{
str="?"+str;
}
_31+=str;
return _31;
},_getPropertiesParameter:function(){
if(!this._propertiesParameter){
var _33={};
for(var _34 in Telerik.Web.UI.RadWindow.prototype){
var _35=this[_34];
if(typeof (_35)=="function"&&_34.indexOf("get_")==0){
var _36=_34.substring(4);
if(null==this["set_"+_36]){
continue;
}
var _37=_35.call(this);
if(null==_37){
continue;
}
_33[_36]=_37;
if(_36=="skin"){
break;
}
}
}
this._propertiesParameter=_33;
}
var _38=this._cloneObject(this._propertiesParameter);
return _38;
},_getEventsParameter:function(){
if(!this._eventsParameter){
var _39={};
var _3a=this.get_events();
var _3b=this._eventNames;
for(var i=0;i<_3b.length;i++){
var _3d=_3b[i];
var _3e=_3a.getHandler(_3d);
if(_3e&&typeof (eval(_3e))=="function"){
_39[_3d]=eval(_3e);
}
}
this._eventsParameter=_39;
}
return this._eventsParameter;
},_cloneObject:function(_3f){
var _40={};
for(var _41 in _3f){
_40[_41]=_3f[_41];
}
return _40;
},getWindowBounds:function(){
return this._getCalculatedPopupBounds();
},toString:function(){
return "[RadWindow id="+this.get_id()+"]";
},center:function(){
var _42=this._getCentralBounds();
this.moveTo(_42.x,_42.y);
},moveTo:function(x,y){
var _45=this._popupElement;
if(_45){
var _46=$telerik.getBounds(_45);
var _47=this._getRestrictionZoneBounds();
if(_47){
var _48=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(x+_47.x,y+_47.y,_46.width,_46.height));
if(!_48){
return false;
}
}
}
x=parseInt(x);
y=parseInt(y);
this._createUI();
this._setPopupVisible(x,y);
this._storeBounds();
return true;
},setSize:function(_49,_4a){
this._firstShow=false;
this.set_width(_49);
this.set_height(_4a);
this._storeBounds();
},_maintainMaximizedSize:function(){
if(!this.isMaximized()){
return;
}
var _4b=this._popupElement;
if(!_4b){
return;
}
var _4c=this._getViewportBounds();
_4b.style.top=(_4c.scrollTop+_4c.y)+"px";
_4b.style.left=(_4c.scrollLeft+_4c.x)+"px";
$telerik.setSize(_4b,{width:_4c.width,height:_4c.height});
var _4d=this._getRestrictionZoneBounds();
if(!_4d){
this._enablePageScrolling(false);
}
var _4e=this._tableElement;
_4c=$telerik.getContentSize(_4b);
var _4f=$telerik.getBorderBox(_4e);
var _50=$telerik.getPaddingBox(_4e);
var _51=_4c.height-_4f.vertical-_50.vertical;
_4e.style.height=_51+"px";
this._fixIeHeight(_4e,_51);
},_enablePageScrolling:function(_52){
var _53=document.body;
var doc=document.documentElement;
if(_52){
if(null!=this._documentOverflow){
doc.style.overflow=this._documentOverflow;
}
if(null!=this._bodyOverflow){
_53.style.overflow=this._bodyOverflow;
}
this._documentOverflow=null;
this._bodyOverflow=null;
}else{
if(null==this._documentOverflow){
this._documentOverflow=doc.style.overflow;
}
if(null==this._bodyOverflow){
this._bodyOverflow=_53.style.overflow;
}
_53.style.overflow="hidden";
doc.style.overflow="hidden";
}
},_getRestrictionZoneBounds:function(){
var _55=null;
if(this.get_restrictionZoneID()){
var _56=$get(this.get_restrictionZoneID());
if(_56){
_55=$telerik.getBounds(_56);
_55.scrollLeft=0;
_55.scrollTop=0;
}
}
return _55;
},_storeBounds:function(){
if(!this.isCreated()){
return;
}
var _57=this._getCurrentBounds();
if(this.isMaximized()){
return false;
}
if(this.isMinimized()){
if(this._restoreRect){
_57.width=this._restoreRect.width;
_57.height=this._restoreRect.height;
}else{
_57.width=this.get_width();
_57.height=this.get_height();
}
}
this._restoreRect=_57;
},_restoreBounds:function(){
if(!this._restoreRect){
return;
}
var _58=this._restoreRect;
this.setSize(_58.width,_58.height);
this.moveTo(_58.x,_58.y);
},_getStoredBounds:function(){
if(this._restoreRect){
return this._restoreRect;
}
},_deleteStoredBounds:function(){
this._restoreRect=null;
},_getCurrentBounds:function(){
var _59=(this._popupElement.style.display=="none")?true:false;
this._popupElement.style.display="";
if(this._firstShow!=true){
this._updateWindowSize(this._height);
this._firstShow=true;
}
var _5a=$telerik.getBounds(this._popupElement);
if(_59){
this._popupElement.style.display="none";
}
var _5b=this._getRestrictionZoneBounds();
if(_5b){
_5a.x-=_5b.x;
_5a.y-=_5b.y;
}
return _5a;
},_getCentralBounds:function(){
var _5c=this._getCurrentBounds();
var _5d=this._getViewportBounds();
var x=parseInt((_5d.width-_5c.width)/2);
var y=parseInt((_5d.height-_5c.height)/2);
_5c.x=x+_5d.scrollLeft;
_5c.y=y+_5d.scrollTop;
return _5c;
},_getViewportBounds:function(){
var _60=this._getRestrictionZoneBounds();
if(_60){
return _60;
}
var _61=$telerik.getClientBounds();
var _62=document.documentElement.scrollLeft||document.body.scrollLeft;
var _63=document.documentElement.scrollTop||document.body.scrollTop;
_61.scrollLeft=_62;
_61.scrollTop=_63;
if(this.isIE){
if(_61.width==0){
_61.width=document.body.clientWidth;
}
if(_61.height==0){
_61.height=document.body.clientHeight;
}
}
return _61;
},_getCalculatedPopupBounds:function(){
var _64=this._getStoredBounds();
if(_64){
return _64;
}
var _65=this._getCurrentBounds();
var _66=this._offsetElement;
if(!this._top&&!this._left&&!_66){
_65=this._getCentralBounds();
}else{
if(_66){
_65.y=0;
_65.x=0;
}else{
var _67=this._getViewportBounds();
_65.x=_67.scrollLeft;
_65.y=_67.scrollTop;
}
var _68=this._left?this._left:0;
_65.x+=_68;
var top=this._top?this._top:0;
_65.y+=top;
}
return _65;
},_checkRestrictionZoneBounds:function(_6a,_6b){
var _6c=_6a;
if(!_6c){
_6c=this._getRestrictionZoneBounds();
if(!_6c){
return true;
}
}
return Telerik.Web.UI.ResizeExtender.containsBounds(_6c,_6b);
},_reSetWindowPosition:function(){
var _6d=this._getCalculatedPopupBounds();
this._setPopupVisible(_6d.x,_6d.y);
},_fixIeHeight:function(_6e,_6f){
if("CSS1Compat"==document.compatMode){
var _70=(_6e.offsetHeight-parseInt(_6f));
if(_70>0){
var _71=(parseInt(_6e.style.height)-_70);
if(_71>0){
_6e.style.height=_71+"px";
}
}
}
},_setPopupVisible:function(x,y){
var _74=this._getRestrictionZoneBounds();
if(_74){
x+=_74.x;
y+=_74.y;
}
this._popupBehavior._setCoordinates(x,y);
this._popupBehavior.show();
if(!this.get_width()){
this._popupElement.style.width="";
}
this._updateTitleWidth();
},_createDefaultTable:function(){
var _75=document.createElement("TABLE");
_75.align="left";
_75.cellSpacing=0;
_75.cellPadding=0;
_75.insertRow(-1);
return _75;
},_createUI:function(){
if(!this._popupElement){
var _76=this.get_id();
var _77="RadWindowWrapper_"+_76;
var _78=document.createElement("DIV");
_78.id=_77;
_78.className=this._getFullSkinName();
_78.style.width=this._width;
_78.style.height=this._height;
_78.setAttribute("unselectable","on");
this._popupElement=_78;
var _79=document.createElement("TABLE");
_79.cellSpacing=0;
_79.cellPadding=0;
this._tableElement=_79;
var _7a=["corner topleft","titlebar","corner topright","corner bodyleft","windowcontent","corner bodyright","corner bodyleft","statusbar","corner bodyright","corner footerleft","footercenter","corner footerright"];
var _7b=["titlerow","contentrow","statusbarrow","footerrow"];
var _7c=0;
for(var i=0;i<4;i++){
var row=_79.insertRow(-1);
row.className=_7b[i];
for(var j=1;j<=3;j++){
var _80=row.insertCell(-1);
_80.innerHTML="&nbsp;";
_80.className=_7a[_7c];
_7c++;
}
}
var _81=_79.rows[0].cells[1];
_81.innerHTML="";
this._titleCell=_81;
var _82=document.createElement("DIV");
_82.className="topresize";
_82.innerHTML="<!-- / -->";
this._topResizer=_82;
this._titleCell.appendChild(this._topResizer);
var _83=this._createDefaultTable();
_83.className="titlebarcontrols";
this._titlebarElement=_83;
this._titleCell.appendChild(this._titlebarElement);
var _84=this._getTitleIcon();
var _85=this._titlebarElement.rows[0].insertCell(-1);
_85.appendChild(_84);
var _86=this._getTitleElement();
var _81=this._titlebarElement.rows[0].insertCell(-1);
_81.appendChild(_86);
this.set_title(this._title);
var _87=this._titlebarElement.rows[0].insertCell(-1);
_87.noWrap=true;
_87.style.whiteSpace="nowrap";
_87.appendChild(this._getTitleCommandButtonsHolder());
var _88=_79.rows[1].cells[1];
_88.vAlign="top";
_88.innerHTML="";
this._contentCell=_88;
var _89=this.get_name();
var _8a=($telerik.isIE)?document.createElement("<iframe name='"+_89+"'>"):document.createElement("iframe");
_8a.name=_89;
_8a.src="javascript:'<html></html>';";
_8a.style.width="100%";
_8a.style.height="100%";
_8a.style.border="0px";
_8a.frameBorder="0";
this._iframe=_8a;
this._contentCell.appendChild(this._iframe);
var _8b=this._createDefaultTable();
_8b.style.width="100%";
this._statusCell=_79.rows[2].cells[1];
this._statusCell.innerHTML="";
this._statusCell.appendChild(_8b);
var _8c=_8b.rows[0].insertCell(-1);
_8c.style.width="100%";
var _8d=this._getStatusMessageElement();
_8c.appendChild(_8d);
var _8e=_8b.rows[0].insertCell(-1);
_8e.style.width="15px";
var _8f=document.createElement("DIV");
_8e.appendChild(_8f);
this._bottomResizer=_8f;
this._createBackReference();
this._popupElement.appendChild(this._tableElement);
this._popupElement.style.display="none";
this._popupElement.style.position="absolute";
this._addWindowToDocument();
this.set_behaviors(this._behaviors);
this._registerTitlebarHandlers(true);
this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
}
if(!this._popupBehavior){
this._popupBehavior=$create(Telerik.Web.PopupBehavior,{"id":(new Date()-100)+"PopupBehavior","parentElement":null,"overlay":this._overlay,"keepInScreenBounds":this._keepInScreenBounds},null,null,this._popupElement);
}
},_getStatusMessageElement:function(){
if(null==this._statusMessageElement){
var el=document.createElement("INPUT");
el.readOnly="readonly";
el.setAttribute("unselectable","on");
this._statusMessageElement=el;
}
return this._statusMessageElement;
},_getTitleCommandButtonsHolder:function(){
if(null==this._buttonsElement){
var ul=document.createElement("UL");
ul.className="controlbuttons";
this._buttonsElement=ul;
}
return this._buttonsElement;
},_getTitleElement:function(){
if(!this._titleElement){
this._titleElement=document.createElement("EM");
this._titleElement.setAttribute("unselectable","on");
}
return this._titleElement;
},_getTitleIcon:function(){
if(null==this._titleIconElement){
var _92=document.createElement("A");
this._titleIconElement=_92;
_92.className="windowicon";
if(this.get_iconUrl()){
_92.style.background="transparent url("+this.get_iconUrl()+") no-repeat scroll 0px 0px";
}
}
return this._titleIconElement;
},_getTitleCommandButton:function(_93){
if(!_93||!this._buttonsArray){
return null;
}
_93=_93.toLowerCase()+"button";
var _94=this._buttonsArray.length;
for(var i=0;i<_94;i++){
var _96=this._buttonsArray[i];
if(_96&&Sys.UI.DomElement.containsCssClass(_96,_93)){
return _96;
}
}
return null;
},_updateTitleWidth:function(){
if(this._visibleTitlebar){
var _97=this._getTitleElement();
if(!_97){
return;
}
var _98=this._getTitleCommandButtonsHolder();
var _99=_98.offsetWidth;
if(_99>0){
var lis=_98.getElementsByTagName("LI");
if(lis[0]&&lis[0].offsetWidth>0){
_99=lis.length*lis[0].offsetWidth;
}
_98.style.width=_99+"px";
}
var _9b=this._getTitleIcon();
var _9c=_9b.offsetWidth;
if(_9c>0&&_9b.parentNode.tagName=="TD"){
_9b.parentNode.style.width=_9c+"px";
}
}
},_addWindowToDocument:function(){
var _9d=document.getElementById(this._formID);
if(!_9d){
_9d=document.forms[0];
}
_9d.insertBefore(this._popupElement,_9d.firstChild);
},_invokeDialogCallBackFunction:function(_9e,_9f){
if(true!=_9f){
this.close();
}
var _a0=this.get_clientCallBackFunction();
if(_a0){
if("string"==typeof (_a0)){
_a0=eval(_a0);
}
if("function"==typeof (_a0)){
_a0(this,_9e);
}
}
},_createBackReference:function(){
var _a1=this;
if(!_a1.Argument){
_a1.Argument={};
}
var _a2=this._iframe;
try{
_a2.radWindow=_a1;
if(_a2.contentWindow!=null){
_a2.contentWindow.radWindow=_a1;
}
}
catch(e){
}
},_getFullSkinName:function(){
return "radwindow radwindow_"+this._skin+" normalwindow transparentwindow";
},_configureMinimizeButton:function(_a3){
var loc=this._getLocalization();
var _a5=(true==_a3)?loc["Restore"]:loc["Minimize"];
var _a6=(true==_a3)?this.restore:this.minimize;
this._registerTitlebarHandlersButton("Minimize",_a5,_a6);
},_configureMaximizeButton:function(_a7){
var loc=this._getLocalization();
var _a9=(true==_a7)?loc["Restore"]:loc["Maximize"];
var _aa=(true==_a7)?this.restore:this.maximize;
this._registerTitlebarHandlersButton("Maximize",_a9,_aa);
},_registerTitlebarHandlersButton:function(_ab,_ac,_ad){
var _ae=this._getTitleCommandButton(_ab);
if(_ae){
var loc=this._getLocalization();
_ae.setAttribute("title",_ac);
_ae.innerHTML=_ac;
$clearHandlers(_ae);
$addHandlers(_ae,{"click":_ad},this);
$addHandler(_ae,"dblclick",this._cancelEvent);
$addHandler(_ae,"mousedown",this._cancelEvent);
}
},isCloned:function(){
return this._isCloned;
},isBehaviorEnabled:function(_b0){
return _b0&this._behaviors?true:false;
},isInitialBehaviorEnabled:function(_b1){
return _b1&this._initialBehaviors?true:false;
},setVisible:function(_b2){
if(this._popupBehavior){
if(_b2){
this._popupBehavior.show();
}else{
this._popupBehavior.hide();
}
}
},isVisible:function(){
return this._popupVisible;
},isModal:function(){
return this._modal;
},isActive:function(){
return (this._popupElement&&!Sys.UI.DomElement.containsCssClass(this._popupElement,"inactivewindow"));
},isPinned:function(){
var _b3=this._getTitleCommandButton("Pin");
return (_b3&&Sys.UI.DomElement.containsCssClass(_b3,"on"));
},isClosed:function(){
return (!this.isVisible());
},isMinimized:function(){
return (this._popupElement&&Sys.UI.DomElement.containsCssClass(this._popupElement,"minimizedwindow"));
},isMaximized:function(){
return (this._popupElement&&Sys.UI.DomElement.containsCssClass(this._popupElement,"maximizedwindow"));
},_moveToMinimizeZone:function(){
var _b4=$get(this.get_minimizeZoneID());
if(_b4){
if(this.isPinned()){
this._isPinned=true;
this.togglePin();
}
var _b5=this._popupElement;
if(_b5.parentNode!=_b4){
_b5.parentNode.removeChild(_b5);
_b4.appendChild(_b5);
this.setVisible(true);
_b5.style.position="static";
if(this.isIE){
_b5.style.display="inline";
}else{
_b5.style.cssFloat="left";
}
}
}
},_moveToDocument:function(){
var _b6=this._popupElement;
_b6.parentNode.removeChild(_b6);
_b6.style.position="absolute";
if(this.isIE){
_b6.style.display="";
}else{
_b6.style.cssFloat="";
}
this._addWindowToDocument();
if(this._isPinned){
this._isPinned=false;
this.togglePin();
}
},minimize:function(){
if(!this.isCreated()){
return;
}
var _b7=this.onCommand("Minimize");
if(!_b7){
return;
}
if(this.isMaximized()){
this._restoreBounds();
}
var _b8=this._popupElement;
$telerik.removeCssClasses(_b8,["normalwindow","maximizedwindow"]);
Sys.UI.DomElement.addCssClass(_b8,"minimizedwindow");
var _b9=_b8._hideWindowedElementsIFrame;
if(_b9){
Sys.UI.DomElement.addCssClass(_b9,"minimizedwindowoverlay_"+this._skin);
}
this._configureMinimizeButton(true);
this._enablePageScrolling(true);
if(this.get_minimizeZoneID()){
this._moveToMinimizeZone();
}
},restore:function(){
if(!this.isCreated()){
return;
}
var _ba=this.onCommand("Restore");
if(!_ba){
return;
}
this._configureMinimizeButton();
this._configureMaximizeButton();
if(this.isMinimized()&&this.get_minimizeZoneID()){
this._moveToDocument();
}
this._normalizeWindowRootCss();
this._enablePageScrolling(true);
this._restoreBounds();
this.setVisible(true);
if(this._restoreZindex){
this._popupElement.style.zIndex=this._restoreZindex;
this._restoreZindex=null;
}
this.setVisible(true);
this.setActive(true);
},maximize:function(){
if(!this.isCreated()){
return;
}
var _bb=this.onCommand("Maximize");
if(!_bb){
return;
}
if(!this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Maximize)){
return;
}
this._storeBounds();
if(this.isMinimized()&&this.get_minimizeZoneID()){
this._moveToDocument();
}
var _bc=this._popupElement;
$telerik.removeCssClasses(_bc,["normalwindow","minimizedwindow"]);
Sys.UI.DomElement.addCssClass(_bc,"maximizedwindow");
this._configureMaximizeButton(true);
this._configureMinimizeButton();
this._maintainMaximizedSize();
this._maintainMaximizedSize();
var _bd=_bc._hideWindowedElementsIFrame;
if(_bd){
$telerik.removeCssClasses(_bd,["minimizedwindowoverlay_"+this._skin]);
this._popupBehavior._handleElementResize();
}
if(!this.isActive()){
this.setActive(true);
}
var _be=_bc.style.zIndex;
if(_be){
this._restoreZindex=_be;
}
_bc.style.zIndex=100000;
},setActive:function(_bf){
var _c0=this._popupElement;
if(!_bf){
Sys.UI.DomElement.addCssClass(_c0,"inactivewindow");
}else{
if(!this.isMaximized()){
var _c1=parseInt(_c0.style.zIndex);
var _c2=Telerik.Web.UI.RadWindowUtils.get_newZindex(_c1);
_c0.style.zIndex=""+_c2;
}
this._getWindowController().set_activeWindow(this);
if(this.isActive()){
return;
}
$telerik.removeCssClasses(_c0,["inactivewindow"]);
this.raiseEvent("activate",new Sys.EventArgs());
}
},togglePin:function(){
if(!this.isCreated()){
return;
}
var _c3=this.onCommand("Pin");
if(!_c3){
return;
}
var _c4=this._getTitleCommandButton("Pin");
var loc=this._getLocalization();
var _c6=this.isPinned();
var _c7=_c6?loc["PinOn"]:loc["PinOff"];
if(_c4){
Sys.UI.DomElement.toggleCssClass(_c4,"on");
}
this._registerTitlebarHandlersButton("Pin",_c7,this.togglePin);
Telerik.Web.UI.RadWindowUtils.setPinned(!_c6,this);
},reload:function(){
if(!this.isCreated()){
return;
}
var _c8=this.onCommand("Reload");
if(!_c8){
return;
}
if(!this._iframe){
return;
}
this._onWindowUrlChanging();
try{
this._iframe.contentWindow.location.reload();
}
catch(e){
this._onWindowUrlChanged();
}
},_normalizeWindowRootCss:function(){
var _c9=this._popupElement;
if(_c9){
$telerik.removeCssClasses(_c9,["minimizedwindow","maximizedwindow"]);
Sys.UI.DomElement.addCssClass(_c9,"normalwindow");
var _ca=_c9._hideWindowedElementsIFrame;
if(_ca){
$telerik.removeCssClasses(_ca,["minimizedwindowoverlay_"+this._skin]);
}
}
},close:function(_cb){
if(this.isClosed()){
return;
}
this.hide();
this.raiseEvent("close",new Sys.EventArgs());
this._enablePageScrolling(true);
this._normalizeWindowRootCss();
if(null!=_cb&&!(_cb instanceof Sys.UI.DomEvent)){
this._invokeDialogCallBackFunction(_cb);
}
if(this._destroyOnClose){
this.dispose();
}
},onCommand:function(_cc){
var _cd=new Sys.CancelEventArgs();
_cd._commandName=_cc;
_cd.get_commandName=function(){
return this._commandName;
};
this.raise_command(_cd);
if(_cd.get_cancel()){
return false;
}
return true;
},setUrl:function(url){
this._createUI();
this._navigateUrl=url;
var _cf=url;
if(this._reloadOnShow){
_cf=this._getReloadOnShowUrl(_cf);
}
this._iframe.src=_cf;
this._onWindowUrlChanging();
if(!this._loaded){
this._registerIframeLoadHandler(true);
}
this._loaded=true;
},_registerChildPageHandlers:function(_d0){
var _d1=null;
try{
_d1=this._iframe.contentWindow.document;
if(_d1.domain!=document.domain){
return;
}
}
catch(e){
return;
}
if(null==_d1){
return;
}
if(_d0){
this._onChildPageUnloadDelegate=Function.createDelegate(this,this._onChildPageUnload);
if(this.isIE){
_d1.onunload=this._onChildPageUnloadDelegate;
}else{
this._iframe.contentWindow.onunload=this._onChildPageUnloadDelegate;
}
this._onChildPageClickDelegate=Function.createDelegate(this,this._onChildPageClick);
$telerik.addExternalHandler(_d1,"click",this._onChildPageClickDelegate);
}else{
if(this._onChildPageClickDelegate){
$telerik.removeExternalHandler(_d1,"click",this._onChildPageClickDelegate);
this._onChildPageClickDelegate=null;
}
}
},_onChildPageUnload:function(e){
this._registerChildPageHandlers(false);
},_onChildPageClick:function(e){
if(!this.isVisible()||this.isClosed()){
return;
}
var src=e.target?e.target:e.srcElement;
if(src){
if(src.tagName=="INPUT"&&src.type=="button"){
return;
}else{
if(src.tagName=="BUTTON"||src.tagName=="A"){
return;
}
}
}
this.setActive(true);
},_onIframeLoad:function(){
this._onWindowUrlChanged();
this._registerChildPageHandlers(true);
this.raiseEvent("pageLoad",new Sys.EventArgs());
},_onWindowUrlChanging:function(){
var _d5=this._getStatusMessageElement();
if(_d5){
Sys.UI.DomElement.addCssClass(_d5,"loading");
}
if(!this._showContentDuringLoad){
this._iframe.style.width="0px";
this._iframe.style.height="0px";
}
},_onWindowUrlChanged:function(){
var _d6=this._getStatusMessageElement();
if(_d6){
Sys.UI.DomElement.removeCssClass(_d6,"loading");
this.set_status(this._navigateUrl);
}
if(!this._showContentDuringLoad){
this._iframe.style.width="100%";
this._iframe.style.height="100%";
}
try{
if(this._iframe.contentWindow.document.title){
this.set_title(this._iframe.contentWindow.document.title);
}
}
catch(e){
}
},_updatePopupZindex:function(){
if(this._popupBehavior){
if(this.isVisible()){
this._popupBehavior.show();
}
}
},get_zindex:function(){
if(this._popupElement){
return this._popupElement.style.zIndex;
}else{
return -1;
}
},get_contentFrame:function(){
return this._iframe;
},get_minimizeZoneID:function(){
return this._minimizeZoneID;
},set_minimizeZoneID:function(_d7){
if(this._minimizeZoneID!=_d7){
this._minimizeZoneID=_d7;
}
},get_restrictionZoneID:function(){
return this._restrictionZoneID;
},set_restrictionZoneID:function(_d8){
if(this._restrictionZoneID!=_d8){
this._restrictionZoneID=_d8;
}
},get_minimizeIconUrl:function(){
return this._minimizeIconUrl;
},set_minimizeIconUrl:function(_d9){
if(this._minimizeIconUrl!=_d9){
this._minimizeIconUrl=_d9;
}
},get_iconUrl:function(){
return this._iconUrl;
},set_iconUrl:function(_da){
if(this._iconUrl!=_da){
this._iconUrl=_da;
}
},get_clientCallBackFunction:function(){
return this._clientCallBackFunction;
},set_clientCallBackFunction:function(_db){
if(this._clientCallBackFunction!=_db){
this._clientCallBackFunction=_db;
}
},get_navigateUrl:function(){
return this._navigateUrl;
},set_navigateUrl:function(_dc){
if(this._navigateUrl!=_dc){
this._navigateUrl=_dc;
}
},get_targetControl:function(){
return this._openerElement;
},set_targetControl:function(_dd){
if(this._openerElement!=_dd){
this._openerElement=_dd;
}
},get_name:function(){
return this._name;
},set_name:function(_de){
if(this._name!=_de){
this._name=_de;
}
},get_formID:function(){
return this._formID;
},set_formID:function(_df){
if(this._formID!=_df){
this._formID=_df;
}
},get_offsetElementID:function(){
return this._offsetElementID;
},set_offsetElementID:function(_e0){
if(this._offsetElementID!=_e0){
this._offsetElementID=_e0;
}
if(this.isVisible()){
this._deleteStoredBounds();
this._offsetSet=false;
this._show();
}
},get_openerElementID:function(){
return this._openerElementID;
},set_openerElementID:function(_e1){
if(this._openerElementID!=_e1){
if(this._openerElement){
this._registerOpenerElementHandler(this._openerElement,false);
this._openerElement=null;
}
this._openerElementID=_e1;
if(this._openerElementID){
this._openerElement=$get(this._openerElementID);
}
if(this._openerElement){
this._registerOpenerElementHandler(this._openerElement,true);
}
}
},get_left:function(){
return this._left;
},set_left:function(_e2){
if(this._left!=_e2){
this._left=parseInt(_e2);
}
},get_top:function(){
return this._top;
},set_top:function(_e3){
if(this._top!=_e3){
this._top=parseInt(_e3);
}
},get_title:function(){
return this._title;
},set_title:function(_e4){
if(this._title!=_e4){
this._title=_e4;
}
if(null==this._titleElement){
return;
}
this._titleElement.innerHTML=this._title;
this._updateTitleWidth();
},get_width:function(){
return parseInt(this._width);
},_fixSizeValue:function(_e5){
_e5=""+_e5;
if(-1==_e5.indexOf("px")){
_e5=parseInt(_e5);
if(!isNaN(_e5)){
_e5=_e5+"px";
}else{
_e5="";
}
}
return _e5;
},set_width:function(_e6){
if(null==_e6){
return false;
}
if(this.isMaximized()){
return false;
}
_e6=this._fixSizeValue(_e6);
var _e7=this._popupElement;
if(_e7){
var _e8=$telerik.getBounds(_e7);
var _e9=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(_e8.x,_e8.y,parseInt(_e6),_e8.height));
if(!_e9){
return false;
}
}
if(this._width!=_e6){
this._width=_e6;
}
if(_e7){
this._deleteStoredBounds();
_e7.style.width=this._width;
this._updatePopupZindex();
}
return true;
},get_height:function(){
return parseInt(this._height);
},set_height:function(_ea){
if(null==_ea){
return false;
}
if(this.isMaximized()){
return false;
}
_ea=this._fixSizeValue(_ea);
var _eb=this._popupElement;
if(_eb){
var _ec=$telerik.getBounds(_eb);
var _ed=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(_ec.x,_ec.y,_ec.width,parseInt(_ea)));
if(!_ed){
return false;
}
}
if(this._height!=_ea){
this._height=_ea;
}
if(_eb){
this._deleteStoredBounds();
this._updateWindowSize(this._height);
this._updatePopupZindex();
}
return true;
},_updateWindowSize:function(_ee,_ef){
var _f0=this._tableElement;
var _f1=_ee?_ee:_f0.style.height;
if(true==_ef){
_f1=_f0.offsetHeight+"px";
}
if(parseInt(_f1)==0){
return;
}
_f0.style.height=_f1;
this._fixIeHeight(_f0,_f1);
_f0.parentNode.style.height=_f1;
},get_initialBehaviors:function(){
return this._initialBehaviors;
},set_initialBehaviors:function(_f2){
if(this._initialBehaviors!=_f2){
this._initialBehaviors=_f2;
}
},get_behaviors:function(){
return this._behaviors;
},set_behaviors:function(_f3){
if(this._behaviors!=_f3){
this._behaviors=_f3;
}
if(null==this._titlebarElement){
return;
}
this._enableMoveResize(false);
this._enableMoveResize(true);
if(this._buttonsArray&&this._buttonsArray.length>0){
var len=this._buttonsArray.length;
for(var i=0;i<len;i++){
var _f6=this._buttonsArray[i];
$clearHandlers(_f6);
}
this._buttonsArray=[];
var _f7=this._getTitleCommandButtonsHolder();
_f7.innerHTML="";
}
if(Telerik.Web.UI.WindowBehaviors.None==this._behaviors){
return;
}else{
var loc=this._getLocalization();
var _f9=Telerik.Web.UI.WindowBehaviors;
var _fa=[[this.isBehaviorEnabled(_f9.Pin),"pinbutton",loc["PinOn"],this.togglePin],[this.isBehaviorEnabled(_f9.Reload),"reloadbutton",loc["Reload"],this.reload],[this.isBehaviorEnabled(_f9.Minimize),"minimizebutton",loc["Minimize"],this.minimize],[this.isBehaviorEnabled(_f9.Maximize),"maximizebutton",loc["Maximize"],this.maximize],[this.isBehaviorEnabled(_f9.Close),"closebutton",loc["Close"],this.close]];
for(var i=0;i<_fa.length;i++){
var _fb=_fa[i];
if(!_fb[0]){
continue;
}
var li=document.createElement("LI");
var _fd=document.createElement("A");
_fd.href="javascript:void(0);";
_fd.className=_fb[1];
_fd.setAttribute("title",_fb[2]);
var _fe=document.createElement("SPAN");
_fe.innerHTML=_fb[2];
_fd.appendChild(_fe);
$addHandlers(_fd,{"click":_fb[3],"dblclick":this._cancelEvent,"mousedown":this._cancelEvent},this);
$addHandler(_fd,"click",this._cancelEvent);
li.appendChild(_fd);
this._buttonsElement.appendChild(li);
this._buttonsArray[this._buttonsArray.length]=_fd;
}
}
},get_modal:function(){
return this._modal;
},set_modal:function(_ff){
if(this._modal!=_ff){
this._modal=_ff;
}
this._makeModal(this._modal);
if(this.isVisible()){
this._afterShow();
}
},get_destroyOnClose:function(){
return this._destroyOnClose;
},set_destroyOnClose:function(_100){
if(this._destroyOnClose!=_100){
this._destroyOnClose=_100;
}
},get_reloadOnShow:function(){
return this._reloadOnShow;
},set_reloadOnShow:function(_101){
if(this._reloadOnShow!=_101){
this._reloadOnShow=_101;
}
},get_showContentDuringLoad:function(){
return this._showContentDuringLoad;
},set_showContentDuringLoad:function(_102){
if(this._showContentDuringLoad!=_102){
this._showContentDuringLoad=_102;
}
},get_visibleOnPageLoad:function(){
return this._visibleOnPageLoad;
},set_visibleOnPageLoad:function(_103){
if(this._visibleOnPageLoad!=_103){
this._visibleOnPageLoad=_103;
}
},get_visibleTitlebar:function(){
return this._visibleTitlebar;
},set_visibleTitlebar:function(_104){
if(this._visibleTitlebar!=_104){
this._visibleTitlebar=_104;
}
if(this._titlebarElement){
this._titlebarElement.style.display=_104?"":"none";
}
},get_visibleStatusbar:function(){
return this._visibleStatusbar;
},set_visibleStatusbar:function(_105){
if(this._visibleStatusbar!=_105){
this._visibleStatusbar=_105;
}
if(this._statusCell){
this._statusCell.parentNode.style.display=_105?"":"none";
}
},get_animation:function(){
return this._animation;
},set_animation:function(_106){
if(this._animation!=_106){
this._animation=_106;
}
},get_overlay:function(){
return this._overlay;
},set_overlay:function(_107){
this._overlay=_107;
if(this._popupBehavior){
this._popupBehavior.set_overlay(this._overlay);
}
if(this.isVisible()){
this._reSetWindowPosition();
}
},get_keepInScreenBounds:function(){
return this._keepInScreenBounds;
},set_keepInScreenBounds:function(_108){
this._keepInScreenBounds=_108;
if(this._popupBehavior){
this._popupBehavior.set_keepInScreenBounds(this._keepInScreenBounds);
}
if(this.isVisible()){
this._reSetWindowPosition();
}
},get_skin:function(){
return this._skin;
},set_skin:function(_109){
if(_109&&this._skin!=_109){
this._skin=_109;
}
},get_popupElement:function(){
return this._popupElement;
},get_windowManager:function(){
return this._windowManager;
},set_windowManager:function(_10a){
this._windowManager=_10a;
},set_status:function(_10b){
var _10c=this._getStatusMessageElement();
if(_10c){
window.setTimeout(function(){
_10c.value=_10b;
},0);
}
},get_status:function(){
var _10d=this._getStatusMessageElement();
if(_10d){
return _10d.value;
}
},add_command:function(_10e){
this.get_events().addHandler("command",_10e);
},remove_command:function(_10f){
this.get_events().removeHandler("command",_10f);
},raise_command:function(args){
this.raiseEvent("command",args);
},add_dragStart:function(_111){
this.get_events().addHandler("dragStart",_111);
},remove_dragStart:function(_112){
this.get_events().removeHandler("dragStart",_112);
},add_dragEnd:function(_113){
this.get_events().addHandler("dragEnd",_113);
},remove_dragEnd:function(_114){
this.get_events().removeHandler("dragEnd",_114);
},add_activate:function(_115){
this.get_events().addHandler("activate",_115);
},remove_activate:function(_116){
this.get_events().removeHandler("activate",_116);
},add_beforeShow:function(_117){
this.get_events().addHandler("beforeShow",_117);
},remove_beforeShow:function(_118){
this.get_events().removeHandler("beforeShow",_118);
},add_show:function(_119){
this.get_events().addHandler("show",_119);
},remove_show:function(_11a){
this.get_events().removeHandler("show",_11a);
},add_pageLoad:function(_11b){
this.get_events().addHandler("pageLoad",_11b);
},remove_pageLoad:function(_11c){
this.get_events().removeHandler("pageLoad",_11c);
},add_close:function(_11d){
this.get_events().addHandler("close",_11d);
},remove_close:function(_11e){
this.get_events().removeHandler("close",_11e);
},add_resize:function(_11f){
this.get_events().addHandler("resize",_11f);
},remove_resize:function(_120){
this.get_events().removeHandler("resize",_120);
},saveClientState:function(){
var _121=["position"];
var _122={};
for(var i=0;i<_121.length;i++){
_122[_121[i]]=this["get_"+_121[i]]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(_122);
}};
Telerik.Web.UI.RadWindow.registerClass("Telerik.Web.UI.RadWindow",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.WindowAnimation=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.WindowAnimation.prototype={None:0,Resize:1,Fade:2,Slide:4,FlyIn:8};
Telerik.Web.UI.WindowAnimation.registerEnum("Telerik.Web.UI.WindowAnimation",false);
Telerik.Web.UI.WindowMinimizeMode=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.WindowMinimizeMode.prototype={SameLocation:1,MinimizeZone:2,Default:1};
Telerik.Web.UI.WindowMinimizeMode.registerEnum("Telerik.Web.UI.WindowMinimizeMode",false);
Telerik.Web.UI.WindowBehaviors=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.WindowBehaviors.prototype={None:0,Resize:1,Minimize:2,Close:4,Pin:8,Maximize:16,Move:32,Reload:64,Default:(1+2+4+8+16+32+64)};
Telerik.Web.UI.WindowBehaviors.registerEnum("Telerik.Web.UI.WindowBehaviors",false);
Telerik.Web.UI.RadWindowUtils._zIndex=3000;
Telerik.Web.UI.RadWindowUtils.get_newZindex=function(_124){
_124=parseInt(_124);
if(null==_124||isNaN(_124)){
_124=0;
}
if(Telerik.Web.UI.RadWindowUtils._zIndex<_124){
Telerik.Web.UI.RadWindowUtils._zIndex=_124;
}
Telerik.Web.UI.RadWindowUtils._zIndex++;
return Telerik.Web.UI.RadWindowUtils._zIndex;
};
Telerik.Web.UI.RadWindowUtils._pinnedList={};
Telerik.Web.UI.RadWindowUtils.setPinned=function(_125,oWnd){
if(_125){
var _127=oWnd._getViewportBounds();
var _128=oWnd._getCurrentBounds();
oWnd.LeftOffset=_128.x-_127.scrollLeft;
oWnd.TopOffset=_128.y-_127.scrollTop;
var _129=window.setInterval(function(){
Telerik.Web.UI.RadWindowUtils._updatePinnedElementPosition(oWnd);
},100);
Telerik.Web.UI.RadWindowUtils._pinnedList[_129]=oWnd;
}else{
var _12a=null;
var _12b=Telerik.Web.UI.RadWindowUtils._pinnedList;
for(var name in _12b){
if(_12b[name]==oWnd){
_12a=name;
break;
}
}
if(null!=_12a){
window.clearInterval(_12a);
Telerik.Web.UI.RadWindowUtils._pinnedList[_12a]=null;
}
oWnd.TopOffset=null;
oWnd.LeftOffset=null;
}
};
Telerik.Web.UI.RadWindowUtils._updatePinnedElementPosition=function(oWnd){
if(oWnd.isMaximized()||!oWnd.isVisible()){
return;
}
var _12e=oWnd._getViewportBounds();
var _12f=oWnd._getCurrentBounds();
var left=(oWnd.LeftOffset!=null)?oWnd.LeftOffset+_12e.scrollLeft:_12f.x;
var top=(oWnd.TopOffset!=null)?oWnd.TopOffset+_12e.scrollTop:_12f.y;
oWnd.moveTo(left,top);
};


/* END Telerik.Web.UI.Window.RadWindow.js */
/* START Telerik.Web.UI.Window.RadWindowManager.js */
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.WindowManager");
function GetRadWindowManager(){
return Telerik.Web.UI.WindowManager.Manager;
}
window.radalert=function(_1,_2,_3,_4){
var _5=GetRadWindowManager();
var _6=_5._getStandardPopup("alert",_1);
if(typeof (_4)!="undefined"){
_6.set_title(_4);
}
_6.setSize(_2?_2:280,_3?_3:200);
_6.show();
_6.center();
return _6;
};
window.radconfirm=function(_7,_8,_9,_a,_b,_c){
var _d=GetRadWindowManager();
var _e=_d._getStandardPopup("confirm",_7);
if(typeof (_c)!="undefined"){
_e.set_title(_c);
}
_e.setSize(_9?_9:280,_a?_a:200);
_e.callBack=function(_f){
if(_8){
_8(_f);
}
_e.close();
_e.callBack=null;
};
_e.show();
_e.center();
return _e;
};
window.radprompt=function(_10,_11,_12,_13,_14,_15,_16){
var _17=GetRadWindowManager();
var _18=_17._getStandardPopup("prompt",_10,_16);
if(typeof (_15)!="undefined"){
_18.set_title(_15);
}
_18.setSize(_12?_12:280,_13?_13:200);
_18.callBack=function(_19){
if(_11){
_11(_19);
}
_18.close();
_18.callBack=null;
};
_18.show();
_18.center();
return _18;
};
window.radopen=function(url,_1b){
var _1c=GetRadWindowManager();
return _1c.open(url,_1b);
};
Telerik.Web.UI.RadWindowManager=function(_1d){
Telerik.Web.UI.RadWindowManager.initializeBase(this,[_1d]);
this._windowIDs=[];
this._windows=[];
this._preserveClientState=false;
this.Open=this.open;
this.GetWindowByName=this.getWindowByName;
this.GetWindowById=this.getWindowById;
this.GetActiveWindow=this.getActiveWindow;
this.GetWindowObjects=this.get_windows;
this.GetWindows=this.get_windows;
this.Cascade=this.cascade;
this.Tile=this.tile;
this.RestoreAll=this.restoreAll;
this.MaximizeAll=this.maximizeAll;
this.MinimizeAll=this.minimizeAll;
this.ShowAll=this.showAll;
this.CloseAll=this.closeAll;
this.CloseActiveWindow=this.closeActiveWindow;
this.MinimizeActiveWindow=this.minimizeActiveWindow;
this.RestoreActiveWindow=this.restoreActiveWindow;
};
Telerik.Web.UI.RadWindowManager.prototype={get_zIndex:function(){
return Telerik.Web.UI.RadWindowUtils._zIndex;
},set_zIndex:function(_1e){
var _1f=parseInt(_1e);
if(isNaN(_1e)){
return;
}
Telerik.Web.UI.RadWindowUtils._zIndex=_1e;
},initialize:function(_20){
try{
var _21=this.get_element().style.zIndex;
if(_21){
this.set_zIndex(_21);
}
}
catch(e){
}
this._initialize();
this._registerAsPageManager();
if(this.get_preserveClientState()){
this.restoreState();
}
},dispose:function(){
var _22=this.get_preserveClientState();
if(_22){
this.saveState();
}
this._disposeWindows();
this._windows=null;
Telerik.Web.UI.RadWindowManager.callBaseMethod(this,"dispose");
},open:function(url,_24){
var _25=this.getWindowByName(_24);
if(!_25){
if(!_24){
_24=this.get_id()+this._getUniqueId();
}
_25=this._createWindow(_24);
}
if(url){
_25.setUrl(url);
}
_25.show();
return _25;
},getActiveWindow:function(){
return Telerik.Web.UI.RadWindowController.get_activeWindow();
},getWindowById:function(id){
var _27=this.get_windows();
for(var i=0;i<_27.length;i++){
var _29=_27[i];
if(id==_29.get_id()){
return _29;
}
}
return null;
},getWindowByName:function(_2a){
var _2b=this.get_windows();
if(!_2b){
return null;
}
for(var i=0;i<_2b.length;i++){
var _2d=_2b[i];
if(_2a==_2d.get_name()){
return _2d;
}
}
return null;
},removeWindow:function(_2e){
if(!_2e){
return;
}
var w=this.getWindowByName(_2e.get_name());
var _30=this.get_windows();
if(w){
Array.remove(_30,w);
}
},_getUniqueId:function(){
return ""+(new Date()-100);
},_initialize:function(){
var _31=this._windowIDs;
for(var i=0;i<_31.length;i++){
var _33=_31[i];
var _34=$find(_33);
if(!_34){
continue;
}
_34.set_windowManager(this);
this._windows[this._windows.length]=_34;
}
},_disposeWindows:function(){
for(var i=0;i<this._windows.length;i++){
var t=this._windows[i];
if(t.isCloned()){
t.dispose();
}
}
this._windows=[];
},_createWindow:function(_37,_38){
var wnd=this.clone(_37,_38);
this._windows[this._windows.length]=wnd;
wnd.set_windowManager(this);
return wnd;
},_replaceLocalization:function(_3a,_3b){
var _3c=/##LOC\[(.*?)\]##/;
while(_3a.match(_3c)){
var _3d=_3b[RegExp.$1]?_3b[RegExp.$1]:"";
_3a=_3a.replace(_3c,_3d);
}
return _3a;
},_getStandardPopup:function(_3e,_3f,_40){
var _41=this._createWindow(_3e+this._getUniqueId(),false);
_41.set_destroyOnClose(true);
_41.set_modal(true);
var div=document.getElementById(this.get_id()+"_"+_3e.toLowerCase()+"template");
var _43=this._stringFormat(div.innerHTML,_41.get_id(),_3f,_40?_40:"");
_43=this._replaceLocalization(_43,Telerik.Web.UI.RadWindowUtils.Localization);
var _44=document.createElement("DIV");
_44.innerHTML=_43;
_41.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
_41.set_visibleStatusbar(false);
_41.set_contentElement(_44);
var _45=_41.get_contentElement().getElementsByTagName("INPUT")[0];
if(!_45){
_45=_41.get_contentElement().getElementsByTagName("A")[0];
}
if(_45&&_45.focus){
window.setTimeout(function(){
if(_45.setActive){
_45.setActive();
}else{
_45.focus();
}
},0);
}
return _41;
},_stringFormat:function(_46){
for(var i=1;i<arguments.length;i++){
_46=_46.replace(new RegExp("\\{"+(i-1)+"\\}","ig"),arguments[i]);
}
return _46;
},_registerAsPageManager:function(){
var _48=Telerik.Web.UI.WindowManager.Manager;
var _49=this.get_id();
if(_48&&_48.get_id()==_49){
_48.dispose();
Telerik.Web.UI.WindowManager.Manager=null;
}
if(_48&&!_48.get_id()){
Telerik.Web.UI.WindowManager.Manager=null;
}
if(!Telerik.Web.UI.WindowManager.Manager){
Telerik.Web.UI.WindowManager.Manager=this;
}
},saveWindowState:function(_4a){
if(!_4a||!_4a.isCreated()){
return;
}
var _4b=_4a.getWindowBounds();
var _4c=(_4a.isVisible()||_4a.isMinimized())+"@"+_4b.width+"@"+_4b.height+"@"+_4b.x+"@"+_4b.y+"@"+_4a.isMinimized();
this._setRadWindowCookie(_4a.get_id(),_4c);
},saveState:function(){
var _4d=this.get_windows();
for(i=0;i<_4d.length;i++){
var _4e=_4d[i];
if(_4e.isCloned()){
this.saveWindowState(_4e);
}
}
},restoreState:function(){
function restoreWindow(_4f,_50){
var _51=_50.split("@");
if(_51.length>1){
if("true"==_51[0]&&!_4f.isVisible()){
_4f.show();
}
window.setTimeout(function(){
if(parseInt(_51[1])>0){
_4f.set_width(_51[1]);
}
if(parseInt(_51[2])>0){
_4f.set_height(_51[2]);
}
if("true"==_51[0]){
_4f.moveTo(parseInt(_51[3]),parseInt(_51[4]));
}
if("true"==_51[5]){
_4f.minimize();
}
},1);
}
}
var _52=this.get_windows();
for(i=0;i<_52.length;i++){
var _53=_52[i];
var _54=this._getRadWindowCookie(_53.get_id());
if(_54){
restoreWindow(_53,_54);
}
}
},_getOnlyCookie:function(){
var _55="RadWindowCookie";
var _56=document.cookie.split("; ");
for(var i=0;i<_56.length;i++){
var _58=_56[i].split("=");
if(_55==_58[0]){
return _58[1];
}
}
return null;
},_setRadWindowCookie:function(_59,_5a){
_59="["+_59+"]";
var _5b=this._getOnlyCookie();
var _5c="";
var _5d="";
if(_5b){
var _5e=_5b.split(_59);
if(_5e&&_5e.length>1){
_5c=_5e[0];
_5d=_5e[1].substr(_5e[1].indexOf("#")+1);
}else{
_5d=_5b;
}
}
var _5f=new Date();
_5f.setFullYear(_5f.getFullYear()+10);
document.cookie="RadWindowCookie"+"="+(_5c+_59+"-"+_5a+"#"+_5d)+";path=/;expires="+_5f.toUTCString()+";";
},_getRadWindowCookie:function(_60){
var _61=this._getOnlyCookie();
if(!_61){
return;
}
var _62=null;
_60="["+_60+"]";
var _63=_61.indexOf(_60);
if(_63>=0){
var _64=_63+_60.length+1;
_62=_61.substring(_64,_61.indexOf("#",_64));
}
return _62;
},cascade:function(){
var _65=40;
var _66=40;
var _67=this._getWindowsSortedByZindex();
for(var i=0;i<_67.length;i++){
var _69=_67[i];
if(!_69.isClosed()&&_69.isVisible()){
var _6a=_69.restore();
_69.moveTo(_65,_66);
_69.setActive(true);
_65+=25;
_66+=25;
}
}
},tile:function(){
var _6b=this._getWindowsSortedByZindex();
var _6c=0;
for(var i=0;i<_6b.length;i++){
var _6e=_6b[i];
if(!_6e.isClosed()&&_6e.isVisible()){
_6c++;
}
}
var _6f=5;
var _70=0;
var _71=1;
if(_6c<=_6f){
_70=_6c;
}else{
var i=2;
while((_6c*i)<(_6f*(i+1))){
i++;
if(i>6){
break;
}
}
_71=i;
_70=Math.ceil(_6c/_71);
}
var _72=$telerik.getClientBounds();
var _73=Math.floor(_72.width/_70);
var _74=Math.floor(_72.height/_71);
var _75=document.documentElement.scrollLeft||document.body.scrollLeft;
var top=document.documentElement.scrollTop||document.body.scrollTop;
var _77=0;
for(var i=0;i<_6b.length;i++){
var _6e=_6b[i];
if(!_6e.isClosed()&&_6e.isVisible()){
_77++;
if((_77-1)%(_70)==0&&_77>_70){
top+=_74;
_75=document.documentElement.scrollLeft||document.body.scrollLeft;
}
_6e.restore();
_6e.moveTo(_75,top);
_6e.setSize(_73,_74);
_75+=_73;
}
}
},closeActiveWindow:function(){
this._executeActiveWindow("close");
},minimizeActiveWindow:function(){
this._executeActiveWindow("minimize");
},restoreActiveWindow:function(){
this._executeActiveWindow("restore");
},closeAll:function(){
this._executeAll("close");
},showAll:function(){
this._executeAll("show");
},minimizeAll:function(){
this._executeAll("minimize");
},maximizeAll:function(){
this._executeAll("maximize");
},restoreAll:function(){
this._executeAll("restore");
},_getWindowsSortedByZindex:function(){
var _78=this._windows.concat([]);
var _79=function(_7a,_7b){
var z1=_7a.get_zindex();
var z2=_7b.get_zindex();
if(z1==z2){
return 0;
}
return (z1<z2?-1:1);
};
return _78.sort(_79);
},_executeAll:function(_7e){
if(!this._windows){
return;
}
var _7f=this._windows.concat([]);
for(var i=0;i<_7f.length;i++){
_7f[i][_7e]();
}
},_executeActiveWindow:function(_81){
var _82=this.getActiveWindow();
if(_82&&"function"==typeof (_82[_81])){
_82[_81]();
}
},get_preserveClientState:function(){
return this._preserveClientState;
},set_preserveClientState:function(_83){
if(this._preserveClientState!=_83){
this._preserveClientState=_83;
}
},set_windowControls:function(_84){
this._windowIDs=eval(_84);
this._disposeWindows();
},get_windowControls:function(){
},get_windows:function(){
return this._windows;
}};
Telerik.Web.UI.RadWindowManager.registerClass("Telerik.Web.UI.RadWindowManager",Telerik.Web.UI.RadWindow);


/* END Telerik.Web.UI.Window.RadWindowManager.js */
/* START Telerik.Web.UI.Common.Scrolling.ScrollingScripts.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ScrollerOrientation=function(){
};
Telerik.Web.UI.ScrollerOrientation.prototype={Vertical:0,Horizontal:1};
Telerik.Web.UI.ScrollerOrientation.registerEnum("Telerik.Web.UI.ScrollerOrientation");
Telerik.Web.UI.ScrollerSpeed=function(){
};
Telerik.Web.UI.ScrollerSpeed.prototype={Invalid:0,Slow:1,Medium:2,Fast:3};
Telerik.Web.UI.ScrollerSpeed.registerEnum("Telerik.Web.UI.ScrollerSpeed");
Telerik.Web.UI.ArrowPosition=function(){
};
Telerik.Web.UI.ArrowPosition.prototype={Top:0,Bottom:1,Left:2,Right:3};
Telerik.Web.UI.ArrowPosition.registerEnum("Telerik.Web.UI.ArrowPosition");
Telerik.Web.UI.Scroller=function(_1,_2,_3){
this._timerInterval=10;
this._scrolledElement=_1;
this._element=_2;
this._orientation=_3;
this._minPosition=0;
this._maxPosition=null;
this._currentPosition=0;
this._speed=Telerik.Web.UI.ScrollerSpeed.Invalid;
this._direction=0;
this._events=null;
this._timer=null;
this._onTickDelegate=null;
};
Telerik.Web.UI.Scroller.prototype={initialize:function(){
this._onTickDelegate=Function.createDelegate(this,this._onTick);
this._timer=new Telerik.Web.Timer();
this._timer.set_interval(this._timerInterval);
this._timer.add_tick(this._onTickDelegate);
},dispose:function(){
if(this._timer){
this._timer.dispose();
}
this._onTickDelegate=null;
this._events=null;
},get_element:function(){
return this._element;
},get_events:function(){
if(!this._events){
this._events=new Sys.EventHandlerList();
}
return this._events;
},add_positionChanged:function(_4){
this.get_events().addHandler("positionChanged",_4);
},remove_positionChanged:function(_5){
this.get_events().removeHandler("positionChanged",_5);
},setScrollingLimits:function(_6,_7){
this._minPosition=Math.max(0,_6);
this._maxPosition=Math.min(this._getElementSize(),_7);
},isAtMinPosition:function(){
return this._currentPosition<=this._minPosition;
},isAtMaxPosition:function(){
return this._currentPosition>=this._maxPosition;
},resetState:function(){
this._resetOverflowStyle();
this._scrollTo(0);
},startScroll:function(_8,_9){
this._speed=_8;
this._direction=_9;
this._timer.set_enabled(true);
},changeScrollSpeed:function(_a){
this._speed=_a;
},stopScroll:function(){
this._speed=Telerik.Web.UI.ScrollerSpeed.Invalid;
this._direction=0;
this._timer.set_enabled(false);
},_onTick:function(){
var _b=this._currentPosition+(this._direction*this._speed);
_b=Math.max(_b,this._minPosition);
_b=Math.min(_b,this._maxPosition);
this._scrollTo(_b);
if(_b==this._minPosition||_b==this._maxPosition){
this.stopScroll();
}
},_scrollTo:function(_c){
var _d="left";
if(this._orientation==Telerik.Web.UI.ScrollerOrientation.Vertical){
_d="top";
}
this._currentPosition=_c;
this._scrolledElement.style[_d]=-_c+"px";
this._raiseEvent("positionChanged",Sys.EventArgs.Empty);
},_resetOverflowStyle:function(){
if($telerik.isIE){
this._element.style.overflow="visible";
if(this._orientation==Telerik.Web.UI.ItemFlow.Vertical){
this._element.style.overflowX="visible";
this._element.style.overflowY="hidden";
}else{
this._element.style.overflowX="hidden";
this._element.style.overflowY="hidden";
}
}else{
this._element.style.overflow="hidden";
}
},_getElementSize:function(){
if(this._orientation==Telerik.Web.UI.ScrollerOrientation.Vertical){
return this._scrolledElement.offsetHeight;
}else{
return this._scrolledElement.offsetWidth;
}
},_raiseEvent:function(_e,_f){
var _10=this.get_events().getHandler(_e);
if(_10){
if(!_f){
_f=Sys.EventArgs.Empty;
}
_10(this,_f);
}
}};
Telerik.Web.UI.Scroller.registerClass("Telerik.Web.UI.Scroller",null,Sys.IDisposable);


/* END Telerik.Web.UI.Common.Scrolling.ScrollingScripts.js */
/* START Telerik.Web.UI.Common.Navigation.NavigationScripts.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.AnimationType=function(){
};
Telerik.Web.UI.AnimationType.prototype={None:0,Linear:1,InQuad:2,OutQuad:3,InOutQuad:4,InCubic:5,OutCubic:6,InOutCubic:7,InQuart:8,OutQuart:9,InOutQuart:10,InQuint:11,OutQuint:12,InOutQuint:13,InSine:14,OutSine:15,InOutSine:16,InExpo:17,OutExpo:18,InOutExpo:19,InBack:20,OutBack:21,InOutBack:22,InBounce:23,OutBounce:24,InOutBounce:25,InElastic:26,OutElastic:27,InOutElastic:28};
Telerik.Web.UI.AnimationType.registerEnum("Telerik.Web.UI.AnimationType");
Telerik.Web.UI.AnimationFunctions=function(){
};
Telerik.Web.UI.AnimationFunctions.CalculateAnimationPoints=function(_1,_2,_3,_4){
if(_2==_3){
return [_3+"px"];
}
var _5=_1.get_duration()/1000;
var _6=Math.round((_5)*_4);
var _7=Telerik.Web.UI.AnimationFunctions[_1.get_type()];
var _8=new Array();
var _9=Math.max(_2,_3)-Math.min(_2,_3);
var _a=_2<_3?1:-1;
var _b=0;
_8[0]=_2+"px";
for(var _c=0;_c<_6;_c++){
var _d=_7(_c/_4,0,_9,_5);
if(_c>0){
var _e=parseInt(_8[_c-1]);
var _f=_a*(Math.round(_d)-Math.round(_b));
_8[_c]=(_e+_f)+"px";
}
_b=_d;
}
_8[_6-1]=_3+"px";
return _8;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.Linear]=function(t,b,c,d){
return c*t/d+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InQuad]=function(t,b,c,d){
return c*(t/=d)*t+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutQuad]=function(t,b,c,d){
return -c*(t/=d)*(t-2)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutQuad]=function(t,b,c,d){
if((t/=d/2)<1){
return c/2*t*t+b;
}
return -c/2*((--t)*(t-2)-1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InCubic]=function(t,b,c,d){
return c*(t/=d)*t*t+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutCubic]=function(t,b,c,d){
return c*((t=t/d-1)*t*t+1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutCubic]=function(t,b,c,d){
if((t/=d/2)<1){
return c/2*t*t*t+b;
}
return c/2*((t-=2)*t*t+2)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InQuart]=function(t,b,c,d){
return c*(t/=d)*t*t*t+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutQuart]=function(t,b,c,d){
return -c*((t=t/d-1)*t*t*t-1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutQuart]=function(t,b,c,d){
if((t/=d/2)<1){
return c/2*t*t*t*t+b;
}
return -c/2*((t-=2)*t*t*t-2)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InQuint]=function(t,b,c,d){
return c*(t/=d)*t*t*t*t+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutQuint]=function(t,b,c,d){
return c*((t=t/d-1)*t*t*t*t+1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutQuint]=function(t,b,c,d){
if((t/=d/2)<1){
return c/2*t*t*t*t*t+b;
}
return c/2*((t-=2)*t*t*t*t+2)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InSine]=function(t,b,c,d){
return -c*Math.cos(t/d*(Math.PI/2))+c+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutSine]=function(t,b,c,d){
return c*Math.sin(t/d*(Math.PI/2))+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutSine]=function(t,b,c,d){
return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InExpo]=function(t,b,c,d){
return (t==0)?b:c*Math.pow(2,10*(t/d-1))+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutExpo]=function(t,b,c,d){
return (t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutExpo]=function(t,b,c,d){
if(t==0){
return b;
}
if(t==d){
return b+c;
}
if((t/=d/2)<1){
return c/2*Math.pow(2,10*(t-1))+b;
}
return c/2*(-Math.pow(2,-10*--t)+2)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InCirc]=function(t,b,c,d){
return -c*(Math.sqrt(1-(t/=d)*t)-1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutCirc]=function(t,b,c,d){
return c*Math.sqrt(1-(t=t/d-1)*t)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutCirc]=function(t,b,c,d){
if((t/=d/2)<1){
return -c/2*(Math.sqrt(1-t*t)-1)+b;
}
return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InElastic]=function(t,b,c,d,a,p){
if(t==0){
return b;
}
if((t/=d)==1){
return b+c;
}
if(!p){
p=d*0.3;
}
if((!a)||a<Math.abs(c)){
a=c;
var s=p/4;
}else{
var s=p/(2*Math.PI)*Math.asin(c/a);
}
return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutElastic]=function(t,b,c,d,a,p){
if(t==0){
return b;
}
if((t/=d)==1){
return b+c;
}
if(!p){
p=d*0.3;
}
if((!a)||a<Math.abs(c)){
a=c;
var s=p/4;
}else{
var s=p/(2*Math.PI)*Math.asin(c/a);
}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutElastic]=function(t,b,c,d,a,p){
if(t==0){
return b;
}
if((t/=d/2)==2){
return b+c;
}
if(!p){
p=d*(0.3*1.5);
}
if((!a)||a<Math.abs(c)){
a=c;
var s=p/4;
}else{
var s=p/(2*Math.PI)*Math.asin(c/a);
}
if(t<1){
return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;
}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InBack]=function(t,b,c,d,s){
if(s==undefined){
s=1.70158;
}
return c*(t/=d)*t*((s+1)*t-s)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutBack]=function(t,b,c,d,s){
if(s==undefined){
s=1.70158;
}
return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutBack]=function(t,b,c,d,s){
if(s==undefined){
s=1.70158;
}
if((t/=d/2)<1){
return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;
}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InBounce]=function(t,b,c,d){
return c-Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutBounce](d-t,0,c,d)+b;
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutBounce]=function(t,b,c,d){
if((t/=d)<(1/2.75)){
return c*(7.5625*t*t)+b;
}else{
if(t<(2/2.75)){
return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;
}else{
if(t<(2.5/2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;
}else{
return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;
}
}
}
};
Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InOutBounce]=function(t,b,c,d){
if(t<d/2){
return Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.InBounce](t*2,0,c,d)*0.5+b;
}
return Telerik.Web.UI.AnimationFunctions[Telerik.Web.UI.AnimationType.OutBounce](t*2-d,0,c,d)*0.5+c*0.5+b;
};
Telerik.Web.UI.AnimationFunctions.registerClass("Telerik.Web.UI.AnimationFunctions");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.AnimationSettings=function(_98){
this._type=Telerik.Web.UI.AnimationType.OutQuart;
this._duration=300;
if(typeof (_98.type)!="undefined"){
this._type=_98.type;
}
if(typeof (_98.duration)!="undefined"){
this._duration=_98.duration;
}
};
Telerik.Web.UI.AnimationSettings.prototype={get_type:function(){
return this._type;
},set_type:function(_99){
this._type=_99;
},get_duration:function(){
return this._duration;
},set_duration:function(_9a){
this._duration=_9a;
}};
Telerik.Web.UI.AnimationSettings.registerClass("Telerik.Web.UI.AnimationSettings");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.AttributeCollection=function(_9b){
this._owner=_9b;
this._data={};
this._keys=[];
};
Telerik.Web.UI.AttributeCollection.prototype={getAttribute:function(key){
return this._data[key];
},setAttribute:function(key,_9e){
this._add(key,_9e);
var _9f={};
_9f[key]=_9e;
this._owner._notifyPropertyChanged("attributes",_9f);
},_add:function(key,_a1){
if(Array.indexOf(this._keys,key)<0){
Array.add(this._keys,key);
}
this._data[key]=_a1;
},removeAttribute:function(key){
Array.remove(this._keys,key);
delete this._data[key];
},_load:function(_a3){
for(var key in _a3){
this._add(key,_a3[key]);
}
},get_count:function(){
return this._keys.length;
}};
Telerik.Web.UI.AttributeCollection.registerClass("Telerik.Web.UI.AttributeCollection");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ChangeLog=function(){
this._opCodeInsert=1;
this._opCodeDelete=2;
this._opCodeClear=3;
this._opCodePropertyChanged=4;
this._logEntries=null;
};
Telerik.Web.UI.ChangeLog.prototype={initialize:function(){
this._logEntries=[];
this._serializedEntries=null;
},logInsert:function(_a5){
var _a6={};
_a6.Type=this._opCodeInsert;
_a6.Index=_a5._getHierarchicalIndex();
_a6.Data=_a5._getData();
Array.add(this._logEntries,_a6);
},logDelete:function(_a7){
var _a8={};
_a8.Type=this._opCodeDelete;
_a8.Index=_a7._getHierarchicalIndex();
Array.add(this._logEntries,_a8);
},logClear:function(_a9){
var _aa={};
_aa.Type=this._opCodeClear;
if(_a9._getHierarchicalIndex){
_aa.Index=_a9._getHierarchicalIndex();
}
Array.add(this._logEntries,_aa);
},logPropertyChanged:function(_ab,_ac,_ad){
var _ae={};
_ae.Type=this._opCodePropertyChanged;
_ae.Index=_ab._getHierarchicalIndex();
_ae.Data={};
_ae.Data[_ac]=_ad;
Array.add(this._logEntries,_ae);
},serialize:function(){
if(this._logEntries.length==0){
if(this._serializedEntries==null){
return "[]";
}
return this._serializedEntries;
}
var _af=Sys.Serialization.JavaScriptSerializer.serialize(this._logEntries);
if(this._serializedEntries==null){
this._serializedEntries=_af;
}else{
this._serializedEntries=this._serializedEntries.substring(0,this._serializedEntries.length-1)+","+_af.substring(1);
}
this._logEntries=[];
return this._serializedEntries;
}};
Telerik.Web.UI.ChangeLog.registerClass("Telerik.Web.UI.ChangeLog");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.PropertyBag=function(_b0){
this._data={};
this._owner=_b0;
};
Telerik.Web.UI.PropertyBag.prototype={getValue:function(_b1,_b2){
var _b3=this._data[_b1];
if(typeof (_b3)==="undefined"){
return _b2;
}
return _b3;
},setValue:function(_b4,_b5,_b6){
this._data[_b4]=_b5;
if(_b6){
this._owner._notifyPropertyChanged(_b4,_b5);
}
},load:function(_b7){
this._data=_b7;
}};
Telerik.Web.UI.ControlItem=function(){
this._element=null;
this._parent=null;
this._text=null;
this._children=null;
this._childControlsCreated=false;
this._itemData=null;
this._control=null;
this._properties=new Telerik.Web.UI.PropertyBag(this);
};
Telerik.Web.UI.ControlItem.prototype={_shouldNavigate:function(){
var _b8=this.get_navigateUrl();
if(!_b8){
return false;
}
return !_b8.endsWith("#");
},_getNavigateUrl:function(){
if(this.get_linkElement()){
return this._properties.getValue("navigateUrl",this.get_linkElement().getAttribute("href",2));
}
return this._properties.getValue("navigateUrl",null);
},_initialize:function(_b9,_ba){
this.set_element(_ba);
this._properties.load(_b9);
if(_b9["attributes"]){
this.get_attributes()._load(_b9["attributes"]);
}
this._itemData=_b9["items"];
},_dispose:function(){
if(this._children){
this._children.forEach(function(_bb){
_bb._dispose();
});
}
if(this._element){
this._element._item=null;
this._element=null;
}
if(this._control){
this._control=null;
}
},_initializeRenderedItem:function(){
var _bc=this._children;
if(!_bc||_bc.get_count()<1){
return;
}
var _bd=this._getChildElements();
Sys.Debug.assert(_bc.get_count()==_bd.length,"Length of elements and child items must be the same!");
for(var i=0,_bf=_bc.get_count();i<_bf;i++){
var _c0=_bc.getItem(i);
if(!_c0.get_element()){
_c0.set_element(_bd[i]);
if(this._shouldInitializeChild(_c0)){
_c0._initializeRenderedItem();
}
}
}
},findControl:function(id){
return $telerik.findControl(this.get_element(),id);
},get_attributes:function(){
if(!this._attributes){
this._attributes=new Telerik.Web.UI.AttributeCollection(this);
}
return this._attributes;
},get_element:function(){
return this._element;
},set_element:function(_c2){
this._element=_c2;
this._element._item=this;
this._element._itemTypeName=Object.getTypeName(this);
},get_parent:function(){
return this._parent;
},set_parent:function(_c3){
this._parent=_c3;
},get_text:function(){
if(this._text!==null){
return this._text;
}
if(this._text=this._properties.getValue("text","")){
return this._text;
}
if(!this.get_element()){
return "";
}
var _c4=this.get_textElement();
if(!_c4){
return "";
}
if(typeof (_c4.innerText)!="undefined"){
this._text=_c4.innerText;
}else{
this._text=_c4.textContent;
}
if($telerik.isSafari2){
this._text=_c4.innerHTML;
}
return this._text;
},set_text:function(_c5){
var _c6=this.get_textElement();
if(_c6){
_c6.innerHTML=_c5;
}
this._text=_c5;
this._properties.setValue("text",_c5,true);
},get_value:function(){
return this._properties.getValue("value",null);
},set_value:function(_c7){
this._properties.setValue("value",_c7,true);
},get_itemData:function(){
return this._itemData;
},get_index:function(){
if(!this.get_parent()){
return -1;
}
return this.get_parent()._getChildren().indexOf(this);
},set_enabled:function(_c8){
this._properties.setValue("enabled",_c8,true);
},get_enabled:function(){
return this._properties.getValue("enabled",true)==true;
},get_isEnabled:function(){
var _c9=this._getControl();
if(_c9){
return _c9.get_enabled()&&this.get_enabled();
}
return this.get_enabled();
},set_visible:function(_ca){
this._properties.setValue("visible",_ca);
},get_visible:function(){
return this._properties.getValue("visible",true);
},get_level:function(){
var _cb=this.get_parent();
var _cc=0;
while(_cb){
if(Telerik.Web.UI.ControlItemContainer.isInstanceOfType(_cb)){
return _cc;
}
_cc++;
_cb=_cb.get_parent();
}
return _cc;
},get_isLast:function(){
return this.get_index()==this.get_parent()._getChildren().get_count()-1;
},get_isFirst:function(){
return this.get_index()==0;
},get_nextSibling:function(){
if(!this.get_parent()){
return null;
}
return this.get_parent()._getChildren().getItem(this.get_index()+1);
},get_previousSibling:function(){
if(!this.get_parent()){
return null;
}
return this.get_parent()._getChildren().getItem(this.get_index()-1);
},_getHierarchicalIndex:function(){
var _cd=[];
var _ce=this;
while(!Telerik.Web.UI.ControlItemContainer.isInstanceOfType(_ce)){
Array.insert(_cd,0,_ce.get_index());
_ce=_ce.get_parent();
}
return _cd.join(":");
},_getChildren:function(){
this._ensureChildControls();
return this._children;
},_ensureChildControls:function(){
if(!this._childControlsCreated){
this._createChildControls();
this._childControlsCreated=true;
}
},_setCssClass:function(_cf,_d0){
if(_cf.className!=_d0){
_cf.className=_d0;
}
},_createChildControls:function(){
this._children=this._createItemCollection();
},_createItemCollection:function(){
},_getControl:function(){
if(!this._control){
var _d1=this.get_parent();
if(_d1){
if(Telerik.Web.UI.ControlItemContainer.isInstanceOfType(_d1)){
this._control=_d1;
}else{
this._control=_d1._getControl();
}
}
}
return this._control;
},_getAllItems:function(){
var _d2=[];
this._getAllItemsRecursive(_d2,this);
return _d2;
},_getAllItemsRecursive:function(_d3,_d4){
var _d5=_d4._getChildren();
for(var i=0;i<_d5.get_count();i++){
var _d7=_d5.getItem(i);
Array.add(_d3,_d7);
this._getAllItemsRecursive(_d3,_d7);
}
},_getData:function(){
var _d8=this._properties._data;
delete _d8.items;
_d8["text"]=this.get_text();
if(this.get_attributes().get_count()>0){
_d8["attributes"]=this.get_attributes()._data;
}
return _d8;
},_notifyPropertyChanged:function(_d9,_da){
var _db=this._getControl();
if(_db){
_db._itemPropertyChanged(this,_d9,_da);
}
},_loadFromDictionary:function(_dc){
if(typeof (_dc.Text)!="undefined"){
this.set_text(_dc.Text);
}
if(typeof (_dc.Value)!="undefined"&&_dc.Value!==""){
this.set_value(_dc.Value);
}
if(typeof (_dc.Enabled)!="undefined"&&_dc.Enabled!==true){
this.set_enabled(_dc.Enabled);
}
var _dd=this.get_attributes();
for(var _de in _dc.Attributes){
_dd.setAttribute(_de,_dc.Attributes[_de]);
}
},_createDomElement:function(){
var _df=document.createElement("ul");
var _e0=[];
this._render(_e0);
_df.innerHTML=_e0.join("");
return _df.firstChild;
}};
Telerik.Web.UI.ControlItem.registerClass("Telerik.Web.UI.ControlItem");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ControlItemCollection=function(_e1){
this._array=new Array();
this._parent=_e1;
this._control=null;
};
Telerik.Web.UI.ControlItemCollection.prototype={add:function(_e2){
var _e3=this._array.length;
this.insert(_e3,_e2);
},insert:function(_e4,_e5){
var _e6=_e5.get_parent();
var _e7=this._parent._getControl();
if(_e6){
_e6._getChildren().remove(_e5);
}
if(_e7){
_e7._childInserting(_e4,_e5,this._parent);
}
Array.insert(this._array,_e4,_e5);
_e5.set_parent(this._parent);
if(_e7){
_e7._childInserted(_e4,_e5,this._parent);
_e7._logInserted(_e5);
}
},remove:function(_e8){
var _e9=this._parent._getControl();
if(_e9){
_e9._childRemoving(_e8);
}
Array.remove(this._array,_e8);
if(_e9){
_e9._childRemoved(_e8,this._parent);
}
_e8.set_parent(null);
_e8._control=null;
},removeAt:function(_ea){
var _eb=this.getItem(_ea);
if(_eb){
this.remove(_eb);
}
},clear:function(){
var _ec=this._parent._getControl();
if(_ec){
_ec._logClearing(this._parent);
_ec._childrenCleared(this._parent);
}
this._array=new Array();
},get_count:function(){
return this._array.length;
},getItem:function(_ed){
return this._array[_ed];
},indexOf:function(_ee){
return Array.indexOf(this._array,_ee);
},forEach:function(_ef){
for(var i=0,_f1=this.get_count();i<_f1;i++){
_ef(this._array[i]);
}
}};
Telerik.Web.UI.ControlItemCollection.registerClass("Telerik.Web.UI.ControlItemCollection");
function WebForm_CallbackComplete(){
for(var i=0;i<__pendingCallbacks.length;i++){
var _f3=__pendingCallbacks[i];
if(_f3&&_f3.xmlRequest&&(_f3.xmlRequest.readyState==4)){
__pendingCallbacks[i]=null;
WebForm_ExecuteCallback(_f3);
if(!_f3.async){
__synchronousCallBackIndex=-1;
}
var _f4="__CALLBACKFRAME"+i;
var _f5=document.getElementById(_f4);
if(_f5){
_f5.parentNode.removeChild(_f5);
}
}
}
}
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ControlItemContainer=function(_f6){
Telerik.Web.UI.ControlItemContainer.initializeBase(this,[_f6]);
this._childControlsCreated=false;
this._enabled=true;
this._log=new Telerik.Web.UI.ChangeLog();
this._enableClientStatePersistence=false;
this._eventMap=new Telerik.Web.UI.EventMap();
this._attributes=new Telerik.Web.UI.AttributeCollection(this);
this._children=null;
};
Telerik.Web.UI.ControlItemContainer.prototype={initialize:function(){
Telerik.Web.UI.ControlItemContainer.callBaseMethod(this,"initialize");
this._ensureChildControls();
this._log.initialize();
this._initializeEventMap();
},dispose:function(){
this._eventMap.dispose();
if(this._childControlsCreated){
for(var i=0;i<this._getChildren().get_count();i++){
this._getChildren().getItem(i)._dispose();
}
}
Telerik.Web.UI.ControlItemContainer.callBaseMethod(this,"dispose");
},trackChanges:function(){
this._enableClientStatePersistence=true;
},set_enabled:function(_f8){
this._enabled=_f8;
},get_enabled:function(){
return this._enabled;
},commitChanges:function(){
this.updateClientState();
this._enableClientStatePersistence=false;
},get_attributes:function(){
return this._attributes;
},set_attributes:function(_f9){
this._attributes._load(_f9);
},_initializeEventMap:function(){
this._eventMap.initialize(this);
},_getChildren:function(){
this._ensureChildControls();
return this._children;
},_extractErrorMessage:function(_fa){
if(_fa.get_message){
return _fa.get_message();
}else{
return _fa.replace(/(\d*\|.*)/,"");
}
},_notifyPropertyChanged:function(_fb,_fc){
},_childInserting:function(_fd,_fe,_ff){
},_childInserted:function(_100,item,_102){
if(!_102._childControlsCreated){
return;
}
if(!_102.get_element()){
return;
}
itemElement=item._createDomElement();
var _103=_102.get_childListElement();
if(!_103){
_103=_102._createChildListElement();
}
var _104=item.get_nextSibling();
var _105=_104?_104.get_element():null;
_102.get_childListElement().insertBefore(itemElement,_105);
if(!item.get_element()){
item.set_element(itemElement);
item._initializeRenderedItem();
}else{
item.set_element(itemElement);
}
},_childrenCleared:function(_106){
for(var i=0;i<_106._getChildren().get_count();i++){
_106._getChildren().getItem(i)._dispose();
}
var _108=_106.get_childListElement();
if(_108){
_108.innerHTML="";
}
},_childRemoving:function(_109){
this._logRemoving(_109);
},_childRemoved:function(item,_10b){
item._dispose();
},_createChildListElement:function(){
throw Error.notImplemeneted();
},_createDomElement:function(){
throw Error.notImplemented();
},_getControl:function(){
return this;
},_logInserted:function(item){
if(!item.get_parent()._childControlsCreated||!this._enableClientStatePersistence){
return;
}
this._log.logInsert(item);
var _10d=item._getAllItems();
for(var i=0;i<_10d.length;i++){
this._log.logInsert(_10d[i]);
}
},_logRemoving:function(item){
if(this._enableClientStatePersistence){
this._log.logDelete(item);
}
},_logClearing:function(item){
if(this._enableClientStatePersistence){
this._log.logClear(item);
}
},_itemPropertyChanged:function(item,_112,_113){
if(this._enableClientStatePersistence){
this._log.logPropertyChanged(item,_112,_113);
}
},_ensureChildControls:function(){
if(!this._childControlsCreated){
this._createChildControls();
this._childControlsCreated=true;
}
},_extractItemFromDomElement:function(_114){
this._ensureChildControls();
while(_114&&_114.nodeType!==9){
if(_114._item&&this._verifyChildType(_114._itemTypeName)){
return _114._item;
}
_114=_114.parentNode;
}
return null;
},_verifyChildType:function(_115){
return _115===this._childTypeName;
},_getAllItems:function(){
var _116=[];
for(var i=0;i<this._getChildren().get_count();i++){
var item=this._getChildren().getItem(i);
Array.add(_116,item);
Array.addRange(_116,item._getAllItems());
}
return _116;
},_findItemByText:function(text){
var _11a=this._getAllItems();
for(var i=0;i<_11a.length;i++){
if(_11a[i].get_text()==text){
return _11a[i];
}
}
return null;
},_findItemByValue:function(_11c){
var _11d=this._getAllItems();
for(var i=0;i<_11d.length;i++){
if(_11d[i].get_value()==_11c){
return _11d[i];
}
}
return null;
},_findItemByAttribute:function(_11f,_120){
var _121=this._getAllItems();
for(var i=0;i<_121.length;i++){
if(_121[i].get_attributes().getAttribute(_11f)==_120){
return _121[i];
}
}
return null;
},_findItemByAbsoluteUrl:function(_123){
var _124=this._getAllItems();
for(var i=0;i<_124.length;i++){
if(_124[i].get_linkElement()&&_124[i].get_linkElement().href==_123){
return _124[i];
}
}
return null;
},_findItemByUrl:function(_126){
var _127=this._getAllItems();
for(var i=0;i<_127.length;i++){
if(_127[i].get_navigateUrl()==_126){
return _127[i];
}
}
return null;
},_findItemByHierarchicalIndex:function(_129){
var _12a=null;
var _12b=this;
var _12c=_129.split(":");
for(var i=0;i<_12c.length;i++){
var _12e=parseInt(_12c[i]);
if(_12b._getChildren().get_count()<=_12e){
return null;
}
_12a=_12b._getChildren().getItem(_12e);
_12b=_12a;
}
return _12a;
}};
Telerik.Web.UI.ControlItemContainer.registerClass("Telerik.Web.UI.ControlItemContainer",Telerik.Web.UI.RadWebControl);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EventMap=function(){
this._owner=null;
this._element=null;
this._eventMap={};
this._onDomEventDelegate=null;
this._browserHandlers={};
};
Telerik.Web.UI.EventMap.prototype={initialize:function(_12f,_130){
this._owner=_12f;
if(!_130){
_130=this._owner.get_element();
}
this._element=_130;
},dispose:function(){
if(this._onDomEventDelegate){
for(var _131 in this._eventMap){
if(this._shouldUseEventCapture(_131)){
var _132=this._browserHandlers[_131];
this._element.removeEventListener(_131,_132,true);
}else{
$removeHandler(this._element,_131,this._onDomEventDelegate);
}
}
this._onDomEventDelegate=null;
this._element._events=null;
}
},addHandlerForClassName:function(_133,_134,_135){
if(typeof (this._eventMap[_133])=="undefined"){
this._eventMap[_133]={};
if(this._shouldUseEventCapture(_133)){
var _136=this._getDomEventDelegate();
var _137=this._element;
var _138=function(e){
return _136.call(_137,new Sys.UI.DomEvent(e));
};
this._browserHandlers[_133]=_138;
_137.addEventListener(_133,_138,true);
}else{
$addHandler(this._element,_133,this._getDomEventDelegate());
}
}
var _13a=this._eventMap[_133];
_13a[_134]=_135;
},_onDomEvent:function(e){
var _13c=this._eventMap[e.type];
if(!_13c){
return;
}
var _13d=e.target;
while(_13d&&_13d.nodeType!==9){
var _13e=_13d.className;
var _13f=_13e.split(" ");
var _140=null;
for(var i=0;i<_13f.length;i++){
_140=_13c[_13f[i]];
if(_140){
break;
}
}
if(_140){
this._fillEventFields(e,_13d);
if(_140.call(this._owner,e)!=true){
if(!_13d.parentNode){
e.stopPropagation();
}
return;
}
}
if(_13d==this._element){
return;
}
_13d=_13d.parentNode;
}
},_fillEventFields:function(e,_143){
e.eventMapTarget=_143;
if(e.rawEvent.relatedTarget){
e.eventMapRelatedTarget=e.rawEvent.relatedTarget;
}else{
if(e.type=="mouseover"){
e.eventMapRelatedTarget=e.rawEvent.fromElement;
}else{
e.eventMapRelatedTarget=e.rawEvent.toElement;
}
}
if(!e.eventMapRelatedTarget){
return;
}
try{
var _144=e.eventMapRelatedTarget.className;
}
catch(ex){
e.eventMapRelatedTarget=this._element;
}
},_shouldUseEventCapture:function(_145){
return (_145=="blur"||_145=="focus")&&$telerik.isFirefox&&Sys.Browser.version>=3;
},_getDomEventDelegate:function(){
if(!this._onDomEventDelegate){
this._onDomEventDelegate=Function.createDelegate(this,this._onDomEvent);
}
return this._onDomEventDelegate;
}};
Telerik.Web.UI.EventMap.registerClass("Telerik.Web.UI.EventMap");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.Overlay=function(_146){
this._targetElement=_146;
this._element=null;
};
Telerik.Web.UI.Overlay.IsSupported=function(){
return $telerik.isIE;
};
Telerik.Web.UI.Overlay.prototype={initialize:function(){
var _147=document.createElement("div");
_147.innerHTML="<iframe>Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>";
this._element=_147.firstChild;
this._element.src="javascript:'';";
this._targetElement.parentNode.insertBefore(this._element,this._targetElement);
if(this._targetElement.style.zIndex>0){
this._element.style.zIndex=this._targetElement.style.zIndex-1;
}
this._element.style.position="absolute";
this._element.style.border="0px";
this._element.frameBorder=0;
this._element.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
this._element.tabIndex=-1;
if(!$telerik.isSafari){
_147.outerHTML=null;
}
this.updatePosition();
},dispose:function(){
if(this._element.parentNode){
this._element.parentNode.removeChild(this._element);
}
this._targetElement=null;
this._element=null;
},get_targetElement:function(){
return this._targetElement;
},set_targetElement:function(_148){
this._targetElement=_148;
},updatePosition:function(){
this._element.style.top=this._toUnit(this._targetElement.style.top);
this._element.style.left=this._toUnit(this._targetElement.style.left);
this._element.style.width=this._targetElement.offsetWidth+"px";
this._element.style.height=this._targetElement.offsetHeight+"px";
},_toUnit:function(_149){
if(!_149){
return "0px";
}
return parseInt(_149)+"px";
}};
Telerik.Web.UI.Overlay.registerClass("Telerik.Web.UI.Overlay",null,Sys.IDisposable);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI._PostbackWrapper=function(){
this._doPostbackReplaced=false;
this._events=new Sys.EventHandlerList();
this._originalDoPostBack=null;
this._onWindowUnloadHandler=null;
this._postbackEventRaised=false;
this._beginRequestHandler=null;
this._onsubmitHandler=null;
this._partialRenderingEnabledChecked=false;
this._partialRenderingEnabled=false;
};
Telerik.Web.UI._PostbackWrapper.prototype={initialize:function(){
this._onWindowUnloadHandler=Function.createDelegate(this,this._onWindowUnload);
Sys.UI.DomEvent.addHandler(window,"unload",this._onWindowUnloadHandler);
},_raiseBeforePostback:function(_14a){
var _14b=this._events.getHandler("beforePostback");
if(_14b){
if(!_14a){
_14a=Sys.EventArgs.Empty;
}
_14b(this,_14a);
}
this._postbackEventRaised=true;
},_doPostback:function(_14c,_14d){
this._raiseBeforePostback(Sys.EventArgs.Empty);
this._originalDoPostBack(_14c,_14d);
},_onSubmit:function(e){
return this._handleNormalSubmit(e);
},_handleNormalSubmit:function(e){
if(!this._postbackEventRaised){
this._raiseBeforePostback(Sys.EventArgs.Empty);
}
return true;
},_endRequest:function(){
this._postbackEventRaised=false;
},_isPartialRenderingEnabled:function(){
if(!this._partialRenderingEnabledChecked){
this._partialRenderingEnabled=true;
if(typeof (Sys)=="undefined"){
this._partialRenderingEnabled=false;
}else{
if(typeof (Sys.WebForms)=="undefined"){
this._partialRenderingEnabled=false;
}else{
if(typeof (Sys.WebForms.PageRequestManager)=="undefined"){
this._partialRenderingEnabled=false;
}else{
if(!Sys.WebForms.PageRequestManager.getInstance()){
this._partialRenderingEnabled=false;
}
}
}
}
this._partialRenderingEnabledChecked=true;
}
return this._partialRenderingEnabled;
},add_beforePostback:function(_150){
if(!this._isPartialRenderingEnabled()){
return;
}
if(!this._onsubmitHandler){
this._onsubmitHandler=Function.createDelegate(this,this._onSubmit);
Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements,this._onsubmitHandler);
}
if(!this._endRequestHandler){
this._endRequestHandler=Function.createDelegate(this,this._endRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler);
}
if(!this._doPostbackReplaced){
this._replaceDoPostback();
}
this._events.addHandler("beforePostback",_150);
},remove_beforePostback:function(_151){
this._events.removeHandler("beforePostback",_151);
},_replaceDoPostback:function(){
if(typeof (Page_IsValid)!="undefined"){
return;
}
this._originalDoPostBack=window.__doPostBack;
if(this._originalDoPostBack){
window.__doPostBack=Function.createDelegate(this,this._doPostback);
}
this._doPostbackReplaced=true;
},_onWindowUnload:function(_152){
this.dispose();
},dispose:function(){
Sys.UI.DomEvent.removeHandler(window,"unload",this._onWindowUnloadHandler);
if(this._endRequestHandler){
Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);
this._endRequestHandler=null;
}
if(this._originalDoPostBack){
window.__doPostBack=this._originalDoPostBack;
this._originalDoPostBack=null;
}
}};
Telerik.Web.UI._PostbackWrapper.registerClass("Telerik.Web.UI._PostbackWrapper");
Telerik.Web.UI.PostbackWrapper=new Telerik.Web.UI._PostbackWrapper();
Telerik.Web.UI.PostbackWrapper.initialize();
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.SlideDirection=function(){
};
Telerik.Web.UI.SlideDirection.prototype={Up:1,Down:2,Left:3,Right:4};
Telerik.Web.UI.SlideDirection.registerEnum("Telerik.Web.UI.SlideDirection");
Telerik.Web.UI.Slide=function(_153,_154,_155,_156){
this._fps=60;
this._animatedElement=_153;
this._element=_153.parentNode;
this._expandAnimation=_154;
this._collapseAnimation=_155;
this._direction=Telerik.Web.UI.SlideDirection.Down;
this._animation=null;
this._expanding=null;
if(_156==null){
this._enableOverlay=true;
}else{
this._enableOverlay=_156;
}
this._events=null;
this._overlay=null;
this._animationEndedDelegate=null;
this._expandAnimationStartedDelegate=null;
this._updateOverlayDelegate=null;
};
Telerik.Web.UI.Slide.prototype={initialize:function(){
if(Telerik.Web.UI.Overlay.IsSupported()&&this._enableOverlay){
var _157=this.get_animatedElement();
this._overlay=new Telerik.Web.UI.Overlay(_157);
this._overlay.initialize();
}
this._animationEndedDelegate=Function.createDelegate(this,this._animationEnded);
this._expandAnimationStartedDelegate=Function.createDelegate(this,this._expandAnimationStarted);
this._updateOverlayDelegate=Function.createDelegate(this,this._updateOverlay);
},dispose:function(){
this._animatedElement=null;
this._events=null;
this._disposeAnimation();
if(this._overlay){
this._overlay.dispose();
this._overlay=null;
}
this._animationEndedDelegate=null;
this._expandAnimationStartedDelegate=null;
this._updateOverlayDelegate=null;
},get_element:function(){
return this._element;
},get_animatedElement:function(){
return this._animatedElement;
},set_animatedElement:function(_158){
this._animatedElement=_158;
if(this._overlay){
this._overlay.set_targetElement(this._animatedElement);
}
},get_direction:function(){
return this._direction;
},set_direction:function(_159){
this._direction=_159;
},get_events:function(){
if(!this._events){
this._events=new Sys.EventHandlerList();
}
return this._events;
},updateSize:function(){
var _15a=this.get_animatedElement();
var _15b=this.get_element();
var top=0;
if(_15a.style.top){
top=Math.max(parseInt(_15a.style.top),0);
}
var left=0;
if(_15a.style.left){
left=Math.max(parseInt(_15a.style.left),0);
}
var _15e=_15a.offsetHeight+top;
if(_15b.style.height!=_15e+"px"){
_15b.style.height=Math.max(_15e,0)+"px";
}
var _15f=_15a.offsetWidth+left;
if(_15b.style.width!=_15f+"px"){
_15b.style.width=Math.max(_15f,0)+"px";
}
if(this._overlay){
this._updateOverlay();
}
},show:function(){
this._showElement();
},expand:function(){
this._expanding=true;
this.get_animatedElement().style.visibility="hidden";
this._resetState(true);
var _160=null;
var _161=null;
switch(this.get_direction()){
case Telerik.Web.UI.SlideDirection.Up:
case Telerik.Web.UI.SlideDirection.Left:
_160=parseInt(this._getSize());
_161=0;
break;
case Telerik.Web.UI.SlideDirection.Down:
case Telerik.Web.UI.SlideDirection.Right:
_160=parseInt(this._getPosition());
_161=0;
break;
}
if(this._animation){
this._animation.stop();
}
if((_160==_161)||(this._expandAnimation.get_type()==Telerik.Web.UI.AnimationType.None)){
this._expandAnimationStarted();
this._setPosition(_161);
this._animationEnded();
this.get_animatedElement().style.visibility="visible";
}else{
this._playAnimation(this._expandAnimation,_160,_161);
}
},collapse:function(){
this._resetState();
this._expanding=false;
var _162=null;
var _163=null;
var size=parseInt(this._getSize());
var _165=parseInt(this._getPosition());
switch(this.get_direction()){
case Telerik.Web.UI.SlideDirection.Up:
case Telerik.Web.UI.SlideDirection.Left:
_162=0;
_163=size;
break;
case Telerik.Web.UI.SlideDirection.Down:
case Telerik.Web.UI.SlideDirection.Right:
_162=0;
_163=_165-size;
break;
}
if(this._animation){
this._animation.stop();
}
if((_162==_163)||(this._collapseAnimation.get_type()==Telerik.Web.UI.AnimationType.None)){
this._setPosition(_163);
this._animationEnded();
}else{
this._playAnimation(this._collapseAnimation,_162,_163);
}
},add_collapseAnimationEnded:function(_166){
this.get_events().addHandler("collapseAnimationEnded",_166);
},remove_collapseAnimationEnded:function(_167){
this.get_events().removeHandler("collapseAnimationEnded",_167);
},add_expandAnimationEnded:function(_168){
this.get_events().addHandler("expandAnimationEnded",_168);
},remove_expandAnimationEnded:function(_169){
this.get_events().removeHandler("expandAnimationEnded",_169);
},add_expandAnimationStarted:function(_16a){
this.get_events().addHandler("expandAnimationStarted",_16a);
},remove_expandAnimationStarted:function(_16b){
this.get_events().removeHandler("expandAnimationStarted",_16b);
},_playAnimation:function(_16c,_16d,_16e){
var _16f=_16c.get_duration();
var _170=this._getAnimatedStyleProperty();
var _171=Telerik.Web.UI.AnimationFunctions.CalculateAnimationPoints(_16c,_16d,_16e,this._fps);
var _172=this.get_animatedElement();
_172.style.visibility="visible";
if(this._animation){
this._animation.set_target(_172);
this._animation.set_duration(_16f/1000);
this._animation.set_propertyKey(_170);
this._animation.set_values(_171);
}else{
this._animation=new $TWA.DiscreteAnimation(_172,_16f/1000,this._fps,"style",_170,_171);
this._animation.add_started(this._expandAnimationStartedDelegate);
this._animation.add_ended(this._animationEndedDelegate);
if(this._overlay){
this._animation.add_onTick(this._updateOverlayDelegate);
}
}
this._animation.play();
},_animationEnded:function(){
if(this._expanding){
this.get_element().style.overflow="visible";
this._raiseEvent("expandAnimationEnded",Sys.EventArgs.Empty);
}else{
this.get_element().style.display="none";
this._raiseEvent("collapseAnimationEnded",Sys.EventArgs.Empty);
}
if(this._overlay){
this._updateOverlay();
}
},_expandAnimationStarted:function(){
this._raiseEvent("expandAnimationStarted",Sys.EventArgs.Empty);
},_updateOverlay:function(){
this._overlay.updatePosition();
},_showElement:function(){
var _173=this.get_animatedElement();
var _174=this.get_element();
if(!_174){
return;
}
if(!_174.style){
return;
}
_174.style.display=(_174.tagName.toUpperCase()!="TABLE")?"block":"";
_173.style.display=(_173.tagName.toUpperCase()!="TABLE")?"block":"";
_174.style.overflow="hidden";
},_resetState:function(_175){
this._stopAnimation();
this._showElement();
if(_175){
var _176=this.get_animatedElement();
switch(this.get_direction()){
case Telerik.Web.UI.SlideDirection.Up:
_176.style.top="0px";
break;
case Telerik.Web.UI.SlideDirection.Down:
_176.style.top=-_176.offsetHeight+"px";
break;
case Telerik.Web.UI.SlideDirection.Left:
_176.style.left=_176.offsetWidth+"px";
break;
case Telerik.Web.UI.SlideDirection.Right:
_176.style.left=-_176.offsetWidth+"px";
break;
default:
Error.argumentOutOfRange("direction",this.get_direction(),"Slide direction is invalid. Use one of the values in the Telerik.Web.UI.SlideDirection enumeration.");
break;
}
}
},_getSize:function(){
var _177=this.get_animatedElement();
switch(this.get_direction()){
case Telerik.Web.UI.SlideDirection.Up:
case Telerik.Web.UI.SlideDirection.Down:
return _177.offsetHeight;
break;
case Telerik.Web.UI.SlideDirection.Left:
case Telerik.Web.UI.SlideDirection.Right:
return _177.offsetWidth;
break;
default:
return 0;
}
},_setPosition:function(_178){
var _179=this.get_animatedElement();
var _17a=this._getAnimatedStyleProperty();
_179.style[_17a]=_178;
},_getPosition:function(){
var _17b=this.get_animatedElement();
var _17c=this._getAnimatedStyleProperty();
return _17b.style[_17c];
},_getAnimatedStyleProperty:function(){
switch(this.get_direction()){
case Telerik.Web.UI.SlideDirection.Up:
case Telerik.Web.UI.SlideDirection.Down:
return "top";
case Telerik.Web.UI.SlideDirection.Left:
case Telerik.Web.UI.SlideDirection.Right:
return "left";
}
},_stopAnimation:function(){
if(this._animation){
this._animation.stop();
}
},_disposeAnimation:function(){
if(this._animation){
this._animation.dispose();
this._animation=null;
}
},_raiseEvent:function(_17d,_17e){
var _17f=this.get_events().getHandler(_17d);
if(_17f){
if(!_17e){
_17e=Sys.EventArgs.Empty;
}
_17f(this,_17e);
}
}};
Telerik.Web.UI.Slide.registerClass("Telerik.Web.UI.Slide",null,Sys.IDisposable);


/* END Telerik.Web.UI.Common.Navigation.NavigationScripts.js */
/* START Telerik.Web.UI.TabStrip.RadTabStripScripts.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadTab=function(){
Telerik.Web.UI.RadTab.initializeBase(this);
this._properties=new Telerik.Web.UI.PropertyBag(this);
};
Telerik.Web.UI.RadTab.prototype={_requiresScrolling:function(){
return this.get_tabStrip()._tabContainerRequiresScrolling(this);
},_createChildControls:function(){
this._children=new Telerik.Web.UI.RadTabCollection(this);
Telerik.Web.UI.RadTabStrip._createChildControls(this,this._children);
},_getChildListIndex:function(){
if(!this.get_tabData()){
return -1;
}
var _1=-1;
var _2=[];
if(this.get_parent()!=this.get_tabStrip()){
var _3=this.get_parent().get_parent()._children;
_3.forEach(function(_4){
Array.addRange(_2,_4._children._array);
});
}else{
_2=this.get_parent()._children._array;
}
var _5=Array.indexOf(_2,this);
for(var i=0;i<=_5;i++){
var _7=_2[i];
if(_7.get_tabData()){
_1++;
}
}
return _1;
},_ensureElements:function(){
if(!this.get_childListElement()){
this._createChildListElement();
}
},_createChildListElement:function(){
var _8=document.createElement("ul");
_8.className="rtsUL";
var _9=this._getListItemsForTheCurrentLevel();
if(!_9){
this.get_parent()._ensureElements();
this.get_tabStrip()._createLevelElement(this.get_level()+2);
_9=this._getListItemsForTheCurrentLevel();
}
this._requireChildList();
this.get_levelElement().insertBefore(_8,_9[this._getChildListIndex()]||null);
Array.insert(_9,this._getChildListIndex(),_8);
return _8;
},_shouldInitializeChild:function(_a){
return true;
},_getListItemsForTheCurrentLevel:function(){
return this.get_tabStrip()._getListElementsForLevel(this._getLevelIndex());
},_getChildElements:function(){
return $telerik.getChildrenByTagName(this.get_childListElement(),"li");
},_requireChildList:function(){
this._itemData=[];
},_doesNotRequireChildList:function(){
this._itemData=null;
},_destroyChildListElement:function(){
this.get_tabStrip()._destroyChildren(this);
this._doesNotRequireChildList();
},_renderSeparator:function(_b){
_b[_b.length]="<li class='rtsLI rtsSeparator'>";
_b[_b.legnth]=this.get_text();
_b[_b.length]="</li>";
},_renderTab:function(_c){
_c[_c.length]="<li class='rtsLI";
if(this.get_isFirst()){
_c[_c.length]=" rtsFirst";
}
if(this.get_isLast()){
_c[_c.length]=" rtsLast";
}
_c[_c.length]="'><a ";
if(this.get_target()){
_c[_c.length]="target='";
_c[_c.length]=this.get_target();
_c[_c.length]="' ";
}
_c[_c.length]="href='";
if(this.get_navigateUrl()){
_c[_c.length]=this.get_navigateUrl();
}else{
_c[_c.length]="#";
}
_c[_c.length]="' class='";
_c[_c.length]=this._determineCssClass(this.get_index());
_c[_c.length]="'><span class='rtsOut'><span class='rtsIn'>";
var _d=this._determineImage();
if(_d){
_c[_c.length]="<img alt='' class='rtsImg' src='";
_c[_c.length]=_d;
_c[_c.length]="' />";
}
_c[_c.length]="<span class='rtsTxt'>";
_c[_c.length]=this.get_text();
_c[_c.length]="</span></span></span></a></li>";
},_determineCssClass:function(_e){
var _f=[];
var _10=this.get_parent().get_selectedIndex();
_f[_f.length]="rtsLink";
if(this.get_cssClass()){
_f[_f.length]=this.get_cssClass();
}
if(_e==_10){
_f[_f.length]="rtsSelected";
if(this.get_selectedCssClass()){
_f[_f.length]=this.get_selectedCssClass();
}
}
if(!this.get_enabled()){
_f[_f.length]="rtsDisabled";
if(this.get_disabledCssClass()){
_f[_f.length]=this.get_disabledCssClass();
}
}
if(_10>-1){
if(_10-1==_e){
_f[_f.length]="rtsBefore";
}
if(_10+1==_e){
_f[_f.length]="rtsAfter";
}
}
return _f.join(" ");
},_render:function(_11){
if(this.get_isSeparator()){
this._renderSeparator(_11);
}else{
this._renderTab(_11);
}
this._updateSiblings();
if(this.get_tabs().get_count()>0){
this._renderChildren();
}
},_getPreviousVisibileTab:function(){
var _12=this.get_parent().get_tabs();
for(var _13=this.get_index()-1;_13>-1;_13--){
var tab=_12.getTab(_13);
if(tab.get_visible()){
return tab;
}
}
return null;
},_getNextVisibleTab:function(){
var _15=this.get_parent().get_tabs();
for(var _16=this.get_index()+1,_17=_15.get_count();_16<_17;_16++){
var tab=_15.getTab(_16);
if(tab.get_visible()){
return tab;
}
}
return null;
},_updateSiblings:function(_19){
var _1a=this._getPreviousVisibileTab();
if(_1a){
_1a._updateAppearance(_19);
}
var _1b=this._getNextVisibleTab();
if(_1b){
_1b._updateAppearance(_19);
}
},_renderChildren:function(){
var _1c=this._createChildListElement();
var _1d=[];
this.get_tabs().forEach(function(tab){
tab._render(_1d);
});
_1c.innerHTML=_1d.join("");
},_cacheDomProperties:function(){
this.get_text();
this.get_navigateUrl();
},_cleanElements:function(){
this._cacheDomProperties();
this.get_tabs().forEach(function(tab){
tab._cacheDomProperties();
tab._cleanElements();
});
this.get_parent().get_childListElement().removeChild(this.get_element());
this._element=null;
if($telerik.getChildrenByTagName(this.get_parent().get_childListElement(),"li")<1){
this.get_parent()._destroyChildListElement();
}
},_getLevelIndex:function(){
if(this.get_tabStrip()._ascendingRendering()){
return this.get_level()+1;
}
return this.get_tabStrip()._getLevelElements().length-this.get_level()-2;
},_getFirstVisibleIndex:function(){
var _20=this.get_parent().get_tabs();
for(var _21=0,_22=_20.get_count();_21<_22;_21++){
if(_20.getTab(_21).get_visible()){
return _21;
}
}
return _20.get_count();
},_getLastVisibleIndex:function(){
var _23=this.get_parent().get_tabs();
for(var _24=_23.get_count()-1;_24>-1;_24--){
if(_23.getTab(_24).get_visible()){
return _24;
}
}
return -1;
},_updateAppearance:function(_25){
if(!this.get_element()){
return;
}
var _26=this.get_index();
if(this.get_linkElement()){
this._setCssClass(this.get_linkElement(),this._determineCssClass(_26));
}
this._updateImage();
if(_25){
return;
}
var _27="rtsLI";
if(_26==this._getFirstVisibleIndex()){
_27+=" rtsFirst";
}
if(_26==this._getLastVisibleIndex()){
_27+=" rtsLast";
}
this._setCssClass(this.get_element(),_27);
},_determineImage:function(){
var _28=this.get_imageUrl();
if(this.get_selected()&&this.get_selectedImageUrl()){
_28=this.get_selectedImageUrl();
}
if(!this.get_enabled()&&this.get_disabledImageUrl()){
_28=this.get_disabledImageUrl();
}
return _28;
},_updateImage:function(){
if(!this.get_element()){
return;
}
var _29=this._determineImage();
if(!_29){
return;
}
if(!this.get_imageElement()){
var _2a=document.createElement("img");
_2a.className="rtsImg";
_2a.alt="";
this.get_innerWrapElement().insertBefore(_2a,this.get_textElement());
}
if(this.get_imageElement().src!=_29){
this.get_imageElement().src=_29;
}
},_setChildListDisplay:function(_2b){
var _2c=this.get_tabStrip();
var _2d=this;
while(_2d){
var _2e=_2d.get_childListElement();
if(_2e){
_2e.style.display=_2b;
if(_2b!="none"&&_2c._align==Telerik.Web.UI.TabStripAlign.Justify){
Telerik.Web.UI.RadTabStrip._justify(_2e,_2c._orientation);
}
}
_2d=_2d.get_selectedTab();
}
},_highlight:function(){
if(this.get_hoveredCssClass()){
Sys.UI.DomElement.addCssClass(this.get_linkElement(),this.get_hoveredCssClass());
}
if(!this.get_enabled()){
return;
}
if(!this.get_hoveredImageUrl()){
return;
}
if(!this.get_imageElement()){
return;
}
if(this.get_imageElement().src!=this.get_hoveredImageUrl()){
this.get_imageElement().src=this.get_hoveredImageUrl();
}
},_unhighlight:function(){
if(this.get_hoveredCssClass()){
Sys.UI.DomElement.removeCssClass(this.get_linkElement(),this.get_hoveredCssClass());
}
this._updateImage();
},_shouldPostBack:function(){
var _2f=this.get_tabStrip();
if(!_2f){
return false;
}
return this.get_postBack()&&_2f._postBackReference!=null;
},_initialize:function(_30,_31){
Telerik.Web.UI.RadTab.callBaseMethod(this,"_initialize",[_30,_31]);
this._perTabScrolling=this._properties.getValue("perTabScrolling",false);
this._scrollChildren=this._properties.getValue("scrollChildren",false);
this._scrollButtonsPosition=this._properties.getValue("scrollButtonsPosition",Telerik.Web.UI.TabStripScrollButtonsPosition.Right);
this._ensureChildControls();
},_dispose:function(){
Telerik.Web.UI.RadTab.callBaseMethod(this,"_dispose");
if(this._scroller){
this._scroller.dispose();
}
},_initScrolling:function(){
if(this.get_selected()&&this._requiresScrolling()){
this.get_tabStrip()._initScrollingForTabContainer(this);
}
},_selectPageView:function(_32){
var _33=this.get_pageView();
if(_33){
_33._select(_32);
}
if(this.get_selectedIndex()>-1){
this.get_selectedTab()._selectPageView(_32);
}
},_getGlobalIndex:function(){
return Array.indexOf(this.get_tabStrip().get_allTabs(),this);
},scrollIntoView:function(){
var _34=this.get_parent();
if(!_34){
return;
}
if(!_34._scroller){
return;
}
_34._scroller._scrollTo(this.get_element().offsetLeft);
var _35=this.get_tabStrip();
_35._updateScrollState(_34,_34._scroller._currentPosition);
},get_nextTab:function(){
return this.get_nextSibling();
},get_previousTab:function(){
return this.get_previousSibling();
},click:function(e){
if(!this.get_isEnabled()){
return false;
}
var _37=this.get_tabStrip();
if(!_37){
return false;
}
if(_37.get_causesValidation()){
if(typeof (Page_ClientValidate)!=="undefined"&&!Page_ClientValidate(_37.get_validationGroup())){
return false;
}
}
if(!this.select(e)){
return false;
}
if(this._shouldNavigate()){
return true;
}
if(this._shouldPostBack()){
_37._postback(this);
}
return false;
},get_pageView:function(){
var _38=this.get_tabStrip().get_multiPage();
if(!_38){
return null;
}
if(this.get_pageViewID()){
return _38.findPageViewByID(this.get_pageViewID());
}
return _38.get_pageViews().getPageView(this._getGlobalIndex());
},get_pageViewID:function(){
return this._properties.getValue("pageViewID",null);
},set_pageViewID:function(_39){
this._properties.setValue("pageViewID",_39);
},get_target:function(){
if(this.get_linkElement()){
return this._properties.getValue("target",this.get_linkElement().target);
}
return this._properties.getValue("target",null);
},set_target:function(_3a){
this._properties.setValue("target",_3a,true);
if(this.get_linkElement()){
this.get_linkElement().target=_3a;
}
},get_navigateUrl:function(){
return this._getNavigateUrl();
},set_navigateUrl:function(_3b){
this._properties.setValue("navigateUrl",_3b,true);
if(this.get_linkElement()){
this.get_linkElement().href=_3b;
}
},get_postBack:function(){
return this._properties.getValue("postback",true);
},set_postBack:function(_3c){
this._properties.setValue("postback",_3c,true);
},get_selected:function(){
if(!this.get_parent()){
return false;
}
return this.get_index()==this.get_parent().get_selectedIndex();
},set_selected:function(_3d){
if(_3d){
this.select();
}else{
this.unselect();
}
},selectParents:function(){
var _3e=[];
var _3f=this;
while(_3f!=this.get_tabStrip()){
_3e[_3e.length]=_3f;
_3f=_3f.get_parent();
}
var i=_3e.length;
while(i--){
_3e[i].select();
}
},select:function(e){
var _42=this.get_parent();
if(!_42){
this._cachedSelected=true;
return true;
}
var _43=this._shouldNavigate();
var _44=_42.get_selectedTab();
var _45=this.get_tabStrip();
if(!_43&&_44==this&&!_45.get_clickSelectedTab()){
return false;
}
if(_45._raiseCancelEvent("tabSelecting",this,e)){
return false;
}
var _46=this._shouldPostBack()||(_43&&(!this.get_target()||this.get_target()=="_self"));
if(!e){
_46=false;
}
if(_44&&_44!=this){
_44.unselect(_46,e);
}
_42._setSelectedIndex(this.get_index());
_45._registerSelectedTab(this);
if(!_46){
this._updateAppearance(true);
this._updateSiblings(true);
this._setChildListDisplay("");
if(this._scroller){
this._scroller._showArrows();
}else{
_45._scrollInitInProgress=true;
this._initScrolling();
_45._scrollInitInProgress=false;
}
if(_45._reorderTabsOnSelect){
Telerik.Web.UI.RadTabStrip._reorderTabs(_42.get_childListElement(),this.get_element());
}
}
if(_45.get_multiPage()){
this._selectPageView(_46);
}
_45._raiseEvent("tabSelected",this,e);
return true;
},unselect:function(_47,e){
var _49=this.get_parent();
if(!_49){
return;
}
if(!this.get_selected()){
return;
}
_49._setSelectedIndex(-1);
var _4a=this.get_tabStrip();
_4a._unregisterSelectedTab(this);
if(!_47){
this._setChildListDisplay("none");
if(this._scroller){
this._scroller._hideArrows();
}
this._updateAppearance(true);
this._updateSiblings(true);
}
var _4b=this.get_selectedTab();
if(_4a.get_unselectChildren()&&_4b){
_4b.unselect(_47);
}
_4a._raiseEvent("tabUnSelected",this,e);
},get_selectedIndex:function(){
return this._properties.getValue("selectedIndex",-1);
},_setSelectedIndex:function(_4c){
this._properties.setValue("selectedIndex",_4c);
},set_selectedIndex:function(_4d){
if(_4d>-1){
var tab=this.get_tabs().getTab(_4d);
if(tab){
tab.select();
}
}else{
var _4f=this.get_selectedTab();
if(_4f){
_4f.unselect();
}
}
},get_selectedTab:function(){
return this.get_tabs().getTab(this.get_selectedIndex())||null;
},get_tabStrip:function(){
return this._getControl();
},get_isSeparator:function(){
return this._properties.getValue("isSeparator",false);
},set_isSeparator:function(_50){
this._properties.setValue("isSeparator",_50);
},get_tabData:function(){
return this.get_itemData();
},get_levelElement:function(){
if(!this._levelElement){
this._levelElement=this._getControl()._getLevelElements()[this._getLevelIndex()]||null;
}
return this._levelElement;
},get_textElement:function(){
if(this.get_isSeparator()){
return this.get_element();
}
if(!this.get_innerWrapElement()){
return null;
}
if(!this._textElement){
this._textElement=$telerik.getChildByClassName(this.get_innerWrapElement(),"rtsTxt");
}
return this._textElement;
},get_linkElement:function(){
if(!this.get_element()){
return null;
}
if(!this._linkElement){
this._linkElement=$telerik.getChildByClassName(this.get_element(),"rtsLink");
}
return this._linkElement;
},get_imageElement:function(){
if(!this.get_innerWrapElement()){
return null;
}
if(!this._imageElement){
this._imageElement=$telerik.getChildByClassName(this.get_innerWrapElement(),"rtsImg");
}
return this._imageElement;
},get_outerWrapElement:function(){
if(!this.get_linkElement()){
return null;
}
if(!this._outerWrapElement){
this._outerWrapElement=$telerik.getChildByClassName(this.get_linkElement(),"rtsOut");
}
return this._outerWrapElement;
},get_innerWrapElement:function(){
if(!this.get_outerWrapElement()){
return null;
}
if(!this._innerWrapElement){
this._innerWrapElement=$telerik.getChildByClassName(this.get_outerWrapElement(),"rtsIn");
}
return this._innerWrapElement;
},get_childListElement:function(){
if(!this._childListElement){
var _51=this._getListItemsForTheCurrentLevel();
if(!_51){
return null;
}
this._childListElement=_51[this._getChildListIndex()]||null;
}
return this._childListElement;
},get_tabs:function(){
return this._getChildren();
},enable:function(){
this.set_enabled(true);
},disable:function(){
this.set_enabled(false);
},set_visible:function(_52){
Telerik.Web.UI.RadTab.callBaseMethod(this,"set_visible",[_52]);
if(_52){
this.show();
}else{
this.hide();
}
},show:function(){
this.get_element().style.display="";
this._updateSiblings();
},hide:function(){
this.get_element().style.display="none";
this._updateSiblings();
this.unselect();
},set_enabled:function(_53){
Telerik.Web.UI.RadTab.callBaseMethod(this,"set_enabled",[_53]);
this._updateAppearance();
},get_disabledCssClass:function(){
return this._properties.getValue("disabledCssClass",null);
},set_disabledCssClass:function(_54){
this._properties.setValue("disabledCssClass",_54,true);
this._updateAppearance();
},get_selectedCssClass:function(){
return this._properties.getValue("selectedCssClass",null);
},set_selectedCssClass:function(_55){
this._properties.setValue("selectedCssClass",_55,true);
this._updateAppearance();
},get_hoveredCssClass:function(){
return this._properties.getValue("hoveredCssClass",null);
},set_hoveredCssClass:function(_56){
this._properties.setValue("hoveredCssClass",_56,true);
},get_cssClass:function(){
return this._properties.getValue("cssClass",null);
},set_cssClass:function(_57){
this._properties.setValue("cssClass",_57,true);
this._updateAppearance();
},get_imageUrl:function(){
return this._properties.getValue("imageUrl",null);
},set_imageUrl:function(_58){
this._properties.setValue("imageUrl",_58,true);
this._updateImage();
},get_selectedImageUrl:function(){
return this._properties.getValue("selectedImageUrl",null);
},set_selectedImageUrl:function(_59){
this._properties.setValue("selectedImageUrl",_59,true);
this._updateImage();
},get_disabledImageUrl:function(){
return this._properties.getValue("disabledImageUrl",null);
},set_disabledImageUrl:function(_5a){
this._properties.setValue("disabledImageUrl",_5a,true);
this._updateImage();
},get_hoveredImageUrl:function(){
return this._properties.getValue("hoveredImageUrl",null);
},set_hoveredImageUrl:function(_5b){
this._properties.setValue("hoveredImageUrl",_5b,true);
},get_isBreak:function(){
return this._properties.getValue("isBreak",false);
},set_isBreak:function(_5c){
this._properties.setValue("isBreak",_5c,true);
}};
Telerik.Web.UI.RadTab.registerClass("Telerik.Web.UI.RadTab",Telerik.Web.UI.ControlItem);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadTabCollection=function(_5d){
Telerik.Web.UI.RadTabCollection.initializeBase(this,[_5d]);
};
Telerik.Web.UI.RadTabCollection.prototype={getTab:function(_5e){
return this.getItem(_5e);
}};
Telerik.Web.UI.RadTabCollection.registerClass("Telerik.Web.UI.RadTabCollection",Telerik.Web.UI.ControlItemCollection);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.TabStripOrientation=function(){
};
Telerik.Web.UI.TabStripOrientation.prototype={HorizontalTop:0,HorizontalBottom:1,VerticalRight:2,VerticalLeft:3};
Telerik.Web.UI.TabStripOrientation.isHorizontal=function(_5f){
return _5f==Telerik.Web.UI.TabStripOrientation.HorizontalTop||_5f==Telerik.Web.UI.TabStripOrientation.HorizontalBottom;
};
Telerik.Web.UI.TabStripOrientation.isVertical=function(_60){
return !Telerik.Web.UI.TabStripOrientation.isHorizontal(_60);
};
Telerik.Web.UI.TabStripOrientation.registerEnum("Telerik.Web.UI.TabStripOrientation");
Telerik.Web.UI.TabStripAlign=function(){
};
Telerik.Web.UI.TabStripAlign.prototype={Left:0,Center:1,Right:2,Justify:3};
Telerik.Web.UI.TabStripAlign.registerEnum("Telerik.Web.UI.TabStripAlign");
Telerik.Web.UI.TabStripScrollButtonsPosition=function(){
};
Telerik.Web.UI.TabStripScrollButtonsPosition.prototype={Left:0,Middle:1,Right:2};
Telerik.Web.UI.TabStripScrollButtonsPosition.registerEnum("Telerik.Web.UI.TabStripScrollButtonsPosition");
Telerik.Web.UI.RadTabStripCancelEventArgs=function(tab,_62){
Telerik.Web.UI.RadTabStripCancelEventArgs.initializeBase(this);
this._tab=tab;
this._domEvent=_62;
};
Telerik.Web.UI.RadTabStripCancelEventArgs.prototype={get_tab:function(){
return this._tab;
},get_domEvent:function(){
return this._domEvent;
}};
Telerik.Web.UI.RadTabStripCancelEventArgs.registerClass("Telerik.Web.UI.RadTabStripCancelEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadTabStripEventArgs=function(tab,_64){
Telerik.Web.UI.RadTabStripEventArgs.initializeBase(this);
this._tab=tab;
this._domEvent=_64;
};
Telerik.Web.UI.RadTabStripEventArgs.prototype={get_tab:function(){
return this._tab;
},get_domEvent:function(){
return this._domEvent;
}};
Telerik.Web.UI.RadTabStripEventArgs.registerClass("Telerik.Web.UI.RadTabStripEventArgs",Sys.EventArgs);
Telerik.Web.UI.RadTabStrip=function(_65){
Telerik.Web.UI.RadTabStrip.initializeBase(this,[_65]);
this._childTypeName="Telerik.Web.UI.RadTab";
this._orientation=Telerik.Web.UI.TabStripOrientation.HorizontalTop;
this._align=Telerik.Web.UI.TabStripAlign.Left;
this._selectedIndex=-1;
this._selectedIndexes=[];
this._selectedIndexesJson="[]";
this._logEntriesJson="[]";
this._scrollState={};
this._scrollStateJson="{}";
this._multiPageID=null;
this._causesValidation=true;
this._validationGroup="";
this._postBackReference=null;
this._scrollChildren=false;
this._scrollButtonsPosition=Telerik.Web.UI.TabStripScrollButtonsPosition.Right;
this._perTabScrolling=false;
this._reorderTabsOnSelect=false;
this._skin=null;
};
Telerik.Web.UI.RadTabStrip._getTabGroups=function(_66,_67){
var _68=[];
var _69=[];
_69.size=0;
Array.add(_68,_69);
var _6a=$telerik.getChildrenByTagName(_66,"li");
for(var i=0;i<_6a.length;i++){
if(_6a[i].className=="rtsBreak"){
_69=[];
_69.size=0;
Array.add(_68,_69);
continue;
}
_69.size+=_6a[i][_67];
Array.add(_69,_6a[i]);
}
return _68;
};
Telerik.Web.UI.RadTabStrip._reorder=function(_6c,_6d){
var _6e=$get(_6c);
if(!_6e){
return;
}
var _6f=$telerik.getChildByClassName(_6e,"rtsLevel1");
if(!_6f){
return;
}
var _70=$telerik.getFirstChildByTagName(_6f,"ul");
if(!_70){
return;
}
var _71=$telerik.getChildrenByClassName(_70,"rtsLI");
var _72=_71[_6d];
if(!_72){
return;
}
Telerik.Web.UI.RadTabStrip._reorderTabs(_70,_72);
};
Telerik.Web.UI.RadTabStrip._reorderTabs=function(_73,_74){
var _75=Telerik.Web.UI.RadTabStrip._getTabGroups(_73);
if(_75.length<2){
return;
}
var _76=_75[_75.length-1];
var _77=null;
for(var i=0;i<_75.length;i++){
if(Array.indexOf(_75[i],_74)>-1){
_77=_75[i];
break;
}
}
if(!_77||_77==_76){
return;
}
for(var i=0;i<_76.length;i++){
_73.insertBefore(_76[i],_77[0]);
}
for(var i=0;i<_77.length;i++){
_73.appendChild(_77[i]);
}
};
Telerik.Web.UI.RadTabStrip._align=function(_79,_7a,_7b){
var _7c=$get(_79);
if(_7a!=Telerik.Web.UI.TabStripAlign.Justify&&Telerik.Web.UI.TabStripOrientation.isHorizontal(_7b)){
return;
}
if(_7a==Telerik.Web.UI.TabStripAlign.Left||_7c._aligned){
return;
}
if(_7a==Telerik.Web.UI.TabStripAlign.Justify){
Telerik.Web.UI.RadTabStrip._justifyTabStrip(_7c,_7b);
return;
}
Telerik.Web.UI.RadTabStrip._verticalAlign(_7c,_7a,_7b);
};
Telerik.Web.UI.RadTabStrip._justifyTabStrip=function(_7d,_7e){
var _7f=$telerik.getChildrenByTagName(_7d,"div");
if(_7f.length<1){
return;
}
for(var _80=0;_80<_7f.length;_80++){
var _81=_7f[_80];
var _82=$telerik.getChildrenByTagName(_81,"ul");
if(_82.length<1){
return;
}
for(var i=0;i<_82.length;i++){
Telerik.Web.UI.RadTabStrip._justify(_82[i],_7e);
}
}
};
Telerik.Web.UI.RadTabStrip._justify=function(_84,_85){
var _86="offsetWidth";
var _87=function(_88,_89){
_88.style.width=_89+"px";
};
if(Telerik.Web.UI.TabStripOrientation.isVertical(_85)){
_86="offsetHeight";
_87=function(_8a,_8b){
_8a.firstChild.firstChild.firstChild.style.height=_8b+"px";
var _8c=_8a.offsetHeight-_8b;
if(_8c>0){
_8a.firstChild.firstChild.firstChild.style.height=_8b-_8c+"px";
}
};
}
Telerik.Web.UI.RadTabStrip._justifyListElement(_84,_86,_87);
};
Telerik.Web.UI.RadTabStrip._justifyListElement=function(_8d,_8e,_8f){
var _90=_8d.parentNode[_8e];
if(_90<=0){
return;
}
var _91=Telerik.Web.UI.RadTabStrip._getTabGroups(_8d,_8e);
for(var _92=0;_92<_91.length;_92++){
var _93=_91[_92];
if(_93.size<=0){
continue;
}
var _94=[];
for(var i=0;i<_93.length;i++){
_94[i]=_93[i][_8e]/_93.size;
}
var _96=0;
var i=0;
for(;i<_93.length-1;i++){
var _97=Math.round(_90*_94[i]);
_8f(_93[i],_97);
_96+=_97;
}
_8f(_93[i],_90-_96);
}
};
Telerik.Web.UI.RadTabStrip._verticalAlign=function(_98,_99,_9a){
var _9b=$telerik.getChildByClassName(_98,"rtsLevel1");
if(!_9b){
return;
}
var _9c=$telerik.getChildByClassName(_9b,"rtsUL");
if(!_9c){
return;
}
var _9d=0;
if(_99==Telerik.Web.UI.TabStripAlign.Center){
_9d=(_9b.offsetHeight-_9c.offsetHeight)/2;
}
if(_99==Telerik.Web.UI.TabStripAlign.Right){
_9d=_9b.offsetHeight-_9c.offsetHeight;
}
if(_9d>0){
_9c.style.marginTop=_9d+"px";
_98._aligned=true;
}
};
Telerik.Web.UI.RadTabStrip._createChildControls=function(_9e,_9f){
var _a0=_9e.get_tabData();
if(!_a0){
return;
}
var _a1=$telerik.getChildrenByClassName(_9e.get_childListElement(),"rtsLI");
for(var i=0;i<_a0.length;i++){
var tab=new Telerik.Web.UI.RadTab();
_9f.add(tab);
var _a4=i;
if(typeof (_a0[i].index)!=="undefined"){
_a4=_a0[i].index;
}
tab._initialize(_a0[i],_a1[_a4]);
}
};
Telerik.Web.UI.RadTabStrip.prototype={_initScrolling:function(){
var _a5=this;
while(_a5){
if(this._tabContainerRequiresScrolling(_a5)){
if(_a5._scroller){
_a5._scroller._showArrows();
var _a6=this._getScrollableSize(_a5);
var _a7=_a6-_a5._scroller._currentPosition;
if(_a7<0){
_a5._scroller._scrollTo(_a6);
}
_a5._scroller.setScrollingLimits(0,_a6);
}else{
this._initScrollingForTabContainer(_a5);
}
}else{
if(_a5._scroller){
_a5._scroller._hideArrows();
_a5._scroller._scrollTo(0);
}
}
_a5=_a5.get_selectedTab();
}
this.updateClientState();
},_initScrollingForTabContainer:function(_a8){
var _a9=Telerik.Web.UI.ScrollerOrientation.Horizontal;
var _aa=0;
if(_a8.get_childListElement().style.marginLeft){
_aa=parseInt(_a8.get_childListElement().style.marginLeft);
}
if(this._orientation==Telerik.Web.UI.TabStripOrientation.VerticalRight||this._orientation==Telerik.Web.UI.TabStripOrientation.VerticalLeft){
_a9=Telerik.Web.UI.ScrollerOrientation.Vertical;
_aa=0;
if(_a8.get_childListElement().style.marginTop){
_aa=parseInt(_a8.get_childListElement().style.marginTop);
}
}
_a8._scroller=new Telerik.Web.UI.TabScroller(_a8,_a9);
_a8._scroller.initialize();
_a8._scroller.setScrollingLimits(0,this._getScrollableSize(_a8));
_a8._scroller._currentPosition=-_aa;
_a8._scroller._calculateInitialTab();
_a8._scroller._updateArrows();
},_getScrollableSize:function(_ab){
if(this._orientation==Telerik.Web.UI.TabStripOrientation.VerticalRight||this._orientation==Telerik.Web.UI.TabStripOrientation.VerticalLeft){
return this._getTabsSize(_ab,"offsetHeight")-_ab.get_levelElement().offsetHeight;
}
return this._getTabsSize(_ab,"offsetWidth")-_ab.get_levelElement().offsetWidth;
},_getTabsSize:function(_ac,_ad){
var _ae=Telerik.Web.UI.RadTabStrip._getTabGroups(_ac.get_childListElement(),_ad);
var _af=0;
for(var i=0;i<_ae.length;i++){
if(_af<_ae[i].size){
_af=_ae[i].size;
}
}
return _af;
},_tabContainerRequiresScrolling:function(_b1){
if(!_b1._scrollChildren){
return false;
}
var _b2=_b1.get_levelElement();
if(!_b2){
return false;
}
var _b3=_b2.offsetWidth;
if(this._orientation==Telerik.Web.UI.TabStripOrientation.VerticalRight||this._orientation==Telerik.Web.UI.TabStripOrientation.VerticalLeft){
return _b2.offsetHeight<this._getTabsSize(this,"offsetHeight");
}
return _b2.offsetWidth<this._getTabsSize(_b1,"offsetWidth");
},_createChildControls:function(){
this._children=new Telerik.Web.UI.RadTabCollection(this);
Telerik.Web.UI.RadTabStrip._createChildControls(this,this._children);
},_getLevelElements:function(){
if(!this._levelElements){
this._levelElements=$telerik.getChildrenByTagName(this.get_element(),"div");
}
return this._levelElements;
},_getListElementsForLevel:function(_b4){
return this._listElementsPerLevel[_b4];
},_childInserting:function(_b5,tab,_b7){
if(!_b7._childControlsCreated){
return;
}
this._cachedSelectedTab=_b7.get_selectedTab();
},_childInserted:function(_b8,tab,_ba){
this._allTabs=null;
if(this._cachedSelectedTab){
_ba._setSelectedIndex(this._cachedSelectedTab.get_index());
this._cachedSelectedTab=null;
}
if(tab._cachedSelected){
_ba._setSelectedIndex(_b8);
tab._cachedSelected=false;
}
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"_childInserted",[_b8,tab,_ba]);
if(tab.get_isBreak()){
var _bb=document.createElement("li");
_bb.className="rtsBreak";
_ba.get_childListElement().insertBefore(_bb,tab.get_element().nextSibling);
}
},_childRemoving:function(tab){
if(tab.get_selected()){
tab.unselect();
}
tab._cleanElements();
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"_childRemoving",[tab]);
},_childRemoved:function(tab,_be){
this._allTabs=null;
var _bf=_be.get_tabs().getTab(0);
if(_bf){
_bf._updateAppearance();
}
var _c0=_be.get_tabs().getTab(_be.get_tabs().get_count()-1);
if(_c0){
_c0._updateAppearance();
}
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"_childRemoved",[tab,_be]);
},_childrenCleared:function(_c1){
this._allTabs=null;
_c1.get_tabs().forEach(function(tab){
tab._cleanElements();
});
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"_childrenCleared",[_c1]);
},_destroyChildren:function(_c3){
_c3.get_levelElement().removeChild(_c3.get_childListElement());
Array.remove(this._listElementsPerLevel[_c3._getLevelIndex()],_c3.get_childListElement());
if(this._listElementsPerLevel[_c3._getLevelIndex()].length<1){
Array.removeAt(this._listElementsPerLevel,_c3._getLevelIndex());
Array.remove(this._levelElements,_c3.get_levelElement());
this.get_element().removeChild(_c3.get_levelElement());
_c3._levelElement=null;
}
_c3._childListElement=null;
},_destroyChildListElement:function(){
this._destroyChildren(this);
},_ensureElements:function(){
if(!this.get_childListElement()){
this._createChildListElement();
}
},_createLevelElement:function(_c4){
var _c5=document.createElement("div");
var _c6="rtsLevel";
if(this._align==Telerik.Web.UI.TabStripAlign.Center){
_c6+=" rtsCenter";
}
if(this._align==Telerik.Web.UI.TabStripAlign.Right){
_c6+=" rtsRight";
}
_c5.className=_c6+" rtsLevel"+_c4;
if(this._ascendingRendering()){
Array.add(this._listElementsPerLevel,[]);
Array.add(this._levelElements,_c5);
this.get_element().appendChild(_c5);
}else{
Array.insert(this._listElementsPerLevel,0,[]);
Array.insert(this._levelElements,0,_c5);
this.get_element().insertBefore(_c5,this.get_element().firstChild);
}
return _c5;
},_createChildListElement:function(){
var _c7=document.createElement("ul");
_c7.className="rtsUL";
var _c8=this._createLevelElement(1);
_c8.appendChild(_c7);
Array.add(this._listElementsPerLevel[this._getLevelIndex()],_c7);
return _c7;
},_initLevelElements:function(){
this._listElementsPerLevel=[];
var _c9=this._getLevelElements();
for(var i=0;i<_c9.length;i++){
Array.add(this._listElementsPerLevel,$telerik.getChildrenByTagName(_c9[i],"ul"));
}
},_ascendingRendering:function(){
return this._orientation!=Telerik.Web.UI.TabStripOrientation.HorizontalBottom;
},_getLevelIndex:function(){
if(this._ascendingRendering()){
return 0;
}
return this._getLevelElements().length-1;
},_unregisterSelectedTab:function(tab){
Array.remove(this._selectedIndexes,tab._getHierarchicalIndex());
this._updateSelectedState();
},_registerSelectedTab:function(tab){
Array.add(this._selectedIndexes,tab._getHierarchicalIndex());
this._updateSelectedState();
},_updateSelectedState:function(){
this._selectedIndexesJson=Sys.Serialization.JavaScriptSerializer.serialize(this._selectedIndexes);
this.updateClientState();
},_getHierarchicalIndex:function(){
return "-1";
},_updateScrollState:function(_cd,_ce){
this._scrollState[_cd._getHierarchicalIndex()]=-_ce;
this._scrollStateJson=Sys.Serialization.JavaScriptSerializer.serialize(this._scrollState);
this.updateClientState();
},_postback:function(tab){
if(!this._postBackReference){
return;
}
eval(String.format(this._postBackReference,tab._getHierarchicalIndex()));
},_raiseCancelEvent:function(_d0,tab,_d2){
var _d3=new Telerik.Web.UI.RadTabStripCancelEventArgs(tab,_d2);
this.raiseEvent(_d0,_d3);
return _d3.get_cancel();
},_raiseEvent:function(_d4,tab,_d6){
this.raiseEvent(_d4,new Telerik.Web.UI.RadTabStripEventArgs(tab,_d6));
},_resize:function(e){
if(!this._scrollInitInProgress){
this._initScrolling();
}
this.get_element()._aligned=null;
Telerik.Web.UI.RadTabStrip._align(this.get_id(),this._align,this._orientation);
},_doubleClick:function(e){
var tab=this._extractItemFromDomElement(e.eventMapTarget);
this._raiseEvent("doubleClick",tab,e);
},_mouseOver:function(e){
var tab=this._extractItemFromDomElement(e.eventMapTarget);
if(this._highlightedTab==tab){
return;
}
if(this._highlightedTab){
this._highlightedTab._unhighlight();
}
tab._highlight();
this._highlightedTab=tab;
this._raiseEvent("mouseOver",tab,e);
},_mouseOut:function(e){
if(!this._highlightedTab){
return;
}
if(!e.eventMapRelatedTarget){
return;
}
if($telerik.isDescendant(this._highlightedTab.get_element(),e.eventMapRelatedTarget)){
return;
}
this._highlightedTab._unhighlight();
this._raiseEvent("mouseOut",this._highlightedTab,e);
this._highlightedTab=null;
},_contextMenu:function(e){
var tab=this._extractItemFromDomElement(e.eventMapTarget);
this._raiseEvent("contextMenu",tab,e);
},_click:function(e){
var tab=this._extractItemFromDomElement(e.eventMapTarget);
if(!tab.click(e)){
e.preventDefault();
}
},_activate:function(e){
if(!e.altKey){
return;
}
var tab=this._extractItemFromDomElement(e.eventMapTarget);
tab.click();
},_requiresRtl:function(){
var _e3=this.get_element();
if(_e3.className.indexOf("RadTabStrip_rtl")>-1){
return false;
}
return $telerik.getCurrentStyle(_e3,"direction","ltr")=="rtl";
},_applyRtl:function(){
this.get_element().className=String.format("{0} RadTabStrip_rtl RadTabStrip_{1}_rtl",this.get_element().className,this._skin);
},initialize:function(){
this._initLevelElements();
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"initialize");
Telerik.Web.UI.RadTabStrip._align(this.get_id(),this._align,this._orientation);
this._updateSelectedState();
this._eventMap.addHandlerForClassName("click","rtsLI",this._click);
this._eventMap.addHandlerForClassName("mouseover","rtsLI",this._mouseOver);
this._eventMap.addHandlerForClassName("mouseout","rtsLI",this._mouseOut);
this._eventMap.addHandlerForClassName("contextmenu","rtsLI",this._contextMenu);
this._eventMap.addHandlerForClassName("dblclick","rtsLI",this._doubleClick);
if($telerik.isIE){
this._eventMap.addHandlerForClassName("activate","rtsLI",this._activate);
}
this._resizeDelegate=Function.createDelegate(this,this._resize);
$addHandler(window,"resize",this._resizeDelegate);
if(this._requiresRtl()){
this._applyRtl();
}
this._initScrolling();
this.raiseEvent("load");
},repaint:function(){
this._resize();
},dispose:function(){
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"dispose");
$removeHandler(window,"resize",this._resizeDelegate);
if(this._scroller){
this._scroller.dispose();
}
},commitChanges:function(){
this._logEntriesJson=this._log.serialize();
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"commitChanges");
},enable:function(){
this.set_enabled(true);
},disable:function(){
this.set_enabled(false);
},set_enabled:function(_e4){
Telerik.Web.UI.RadTabStrip.callBaseMethod(this,"set_enabled",[_e4]);
if(!this.get_isInitialized()){
return;
}
this.get_element().disabled=!_e4;
var _e5=String.format("RadTabStrip_{0}_disabled",this._skin);
this.toggleCssClass(_e5);
},get_causesValidation:function(){
return this._causesValidation;
},set_causesValidation:function(_e6){
this._causesValidation=_e6;
},get_validationGroup:function(){
return this._validationGroup;
},set_validationGroup:function(_e7){
this._validationGroup=_e7;
},get_unselectChildren:function(){
return this._unselectChildren==true;
},set_unselectChildren:function(_e8){
this._unselectChildren=_e8;
},get_selectedIndexes:function(){
return this._selectedIndexes;
},set_selectedIndexes:function(_e9){
this._selectedIndexes=_e9;
},saveClientState:function(){
return "{\"selectedIndexes\":"+this._selectedIndexesJson+",\"logEntries\":"+this._logEntriesJson+",\"scrollState\":"+this._scrollStateJson+"}";
},get_selectedTab:function(){
return this.get_tabs().getTab(this.get_selectedIndex())||null;
},get_selectedIndex:function(){
return this._selectedIndex;
},set_selectedIndex:function(_ea){
if(_ea>-1){
var tab=this.get_tabs().getTab(_ea);
if(tab){
tab.select();
}
}else{
var _ec=this.get_selectedTab();
if(_ec){
_ec.unselect();
}
}
},_setSelectedIndex:function(_ed){
this._selectedIndex=_ed;
},get_levelElement:function(){
if(!this._levelElement){
this._levelElement=this._getLevelElements()[this._getLevelIndex()]||null;
}
return this._levelElement;
},get_childListElement:function(){
if(!this.get_levelElement()){
return null;
}
if(!this._childListElement){
this._childListElement=$telerik.getChildByClassName(this.get_levelElement(),"rtsUL");
}
return this._childListElement;
},get_tabData:function(){
return this._tabData;
},set_tabData:function(_ee){
this._tabData=_ee;
},get_tabs:function(){
return this._getChildren();
},get_clickSelectedTab:function(){
return this._clickSelectedTab==true;
},set_clickSelectedTab:function(_ef){
this._clickSelectedTab=_ef;
},findTabByText:function(_f0){
return this._findItemByText(_f0);
},findTabByValue:function(_f1){
return this._findItemByValue(_f1);
},findTabByAttribute:function(_f2,_f3){
return this._findItemByAttribute(_f2,_f3);
},findTabByUrl:function(_f4){
return this._findItemByUrl(_f4);
},findTabByAbsoluteUrl:function(_f5){
return this._findItemByAbsoluteUrl(_f5);
},get_allTabs:function(){
if(!this._allTabs){
this._allTabs=this._getAllItems();
}
return this._allTabs;
},get_multiPage:function(){
if(!this.get_multiPageID()){
return null;
}
return $find(this.get_multiPageID());
},set_multiPageID:function(_f6){
this._multiPageID=_f6;
},get_multiPageID:function(){
return this._multiPageID;
},add_tabSelecting:function(_f7){
this.get_events().addHandler("tabSelecting",_f7);
},remove_tabSelecting:function(_f8){
this.get_events().removeHandler("tabSelecting",_f8);
},add_tabSelected:function(_f9){
this.get_events().addHandler("tabSelected",_f9);
},remove_tabSelected:function(_fa){
this.get_events().removeHandler("tabSelected",_fa);
},add_tabUnSelected:function(_fb){
this.get_events().addHandler("tabUnSelected",_fb);
},remove_tabUnSelected:function(_fc){
this.get_events().removeHandler("tabUnSelected",_fc);
},add_load:function(_fd){
this.get_events().addHandler("load",_fd);
},remove_load:function(_fe){
this.get_events().removeHandler("load",_fe);
},add_mouseOver:function(_ff){
this.get_events().addHandler("mouseOver",_ff);
},remove_mouseOver:function(_100){
this.get_events().removeHandler("mouseOver",_100);
},add_mouseOut:function(_101){
this.get_events().addHandler("mouseOut",_101);
},remove_mouseOut:function(_102){
this.get_events().removeHandler("mouseOut",_102);
},add_contextMenu:function(_103){
this.get_events().addHandler("contextMenu",_103);
},remove_contextMenu:function(_104){
this.get_events().removeHandler("contextMenu",_104);
},add_doubleClick:function(_105){
this.get_events().addHandler("doubleClick",_105);
},remove_doubleClick:function(_106){
this.get_events().removeHandler("doubleClick",_106);
}};
Telerik.Web.UI.RadTabStrip.registerClass("Telerik.Web.UI.RadTabStrip",Telerik.Web.UI.ControlItemContainer);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.TabScroller=function(_107,_108){
this._owner=_107;
Telerik.Web.UI.TabScroller.initializeBase(this,[_107.get_childListElement(),_107.get_levelElement(),_108]);
};
Telerik.Web.UI.TabScroller.prototype={_scrollTo:function(_109){
var _10a="marginLeft";
if(this._orientation==Telerik.Web.UI.ScrollerOrientation.Vertical){
_10a="marginTop";
}
this._currentPosition=_109;
this._scrolledElement.style[_10a]=-_109+"px";
this._raiseEvent("positionChanged",Sys.EventArgs.Empty);
},_createArrow:function(_10b){
var _10c=document.createElement("a");
_10c.className=_10b;
_10c.href="#";
_10c.innerHTML="&nbsp;";
if(!$telerik.isIE){
_10c.style.position="relative";
}
return _10c;
},_applyFloat:function(_10d,_10e){
if($telerik.isIE){
_10d.style.styleFloat=_10e;
}else{
_10d.style.cssFloat=_10e;
}
},_preventDefault:function(e){
e.preventDefault();
},_scrollForward:function(e){
if(this._owner._perTabScrolling){
this._scrollToTab(1);
}else{
this.startScroll(Telerik.Web.UI.ScrollerSpeed.Fast,2);
}
},_stopScroll:function(e){
this.stopScroll();
this._owner._getControl()._updateScrollState(this._owner,this._currentPosition);
},_scrollBackward:function(e){
if(this._owner._perTabScrolling){
this._scrollToTab(-1);
}else{
this.startScroll(Telerik.Web.UI.ScrollerSpeed.Fast,-2);
}
},_positionChanged:function(){
this._updateArrows();
},_updateArrows:function(){
var _113="rtsPrevArrow";
if(this.isAtMinPosition()){
_113="rtsPrevArrowDisabled";
}
if(this._previousArrow.className!=_113){
this._previousArrow.className=_113;
}
_113="rtsNextArrow";
if(this.isAtMaxPosition()){
_113="rtsNextArrowDisabled";
}
if(this._nextArrow.className!=_113){
this._nextArrow.className=_113;
}
},_positionArrowsHorizontally:function(_114){
if(!$telerik.isIE){
this._nextArrow.style.position="absolute";
this._previousArrow.style.position="absolute";
this._previousArrow.style.top="0";
this._nextArrow.style.top="0";
}else{
this._nextArrow.style.marginTop=this._previousArrow.style.marginTop=-this._element.offsetHeight+"px";
}
if(_114==Telerik.Web.UI.TabStripScrollButtonsPosition.Right){
this._applyFloat(this._nextArrow,"right");
this._applyFloat(this._previousArrow,"right");
this._element.appendChild(this._nextArrow);
this._element.appendChild(this._previousArrow);
if(!$telerik.isIE){
this._nextArrow.style.right="0";
this._previousArrow.style.right=this._nextArrow.offsetWidth+"px";
}
}else{
if(_114==Telerik.Web.UI.TabStripScrollButtonsPosition.Left){
this._applyFloat(this._nextArrow,"left");
this._applyFloat(this._previousArrow,"left");
this._element.appendChild(this._previousArrow);
this._element.appendChild(this._nextArrow);
if(!$telerik.isIE){
this._previousArrow.style.left="0";
this._nextArrow.style.left=this._previousArrow.offsetWidth+"px";
}
}else{
this._applyFloat(this._nextArrow,"right");
this._applyFloat(this._previousArrow,"left");
this._element.appendChild(this._previousArrow);
this._element.appendChild(this._nextArrow);
if(!$telerik.isIE){
this._previousArrow.style.left="0";
this._nextArrow.style.right="0";
}
}
}
},_positionArrowsVertically:function(_115){
this._element.style.position="relative";
this._nextArrow.style.position="absolute";
this._previousArrow.style.position="absolute";
this._nextArrow.style.left="0";
this._previousArrow.style.left="0";
this._element.appendChild(this._previousArrow);
this._element.appendChild(this._nextArrow);
if(_115==Telerik.Web.UI.TabStripScrollButtonsPosition.Right){
this._nextArrow.style.bottom="0";
this._previousArrow.style.bottom=this._nextArrow.offsetHeight+"px";
}else{
if(_115==Telerik.Web.UI.TabStripScrollButtonsPosition.Left){
this._previousArrow.style.top="0";
this._nextArrow.style.top=this._previousArrow.offsetHeight+"px";
}else{
this._previousArrow.style.top="0";
this._nextArrow.style.bottom="0";
}
}
},_positionArrows:function(_116){
if(this._orientation==Telerik.Web.UI.ScrollerOrientation.Horizontal){
this._positionArrowsHorizontally(_116);
}else{
this._positionArrowsVertically(_116);
}
},_hideArrows:function(){
this._nextArrow.style.display="none";
this._previousArrow.style.display="none";
},_showArrows:function(){
this._nextArrow.style.display="";
this._previousArrow.style.display="";
},_nextScrollPosition:function(_117){
var tabs=this._owner.get_tabs();
var _119="offsetWidth";
if(this._orientation==Telerik.Web.UI.ScrollerOrientation.Vertical){
_119="offsetHeight";
}
var _11a=_117<0?tabs.getTab(this._currentTabIndex+_117).get_element():tabs.getTab(this._currentTabIndex).get_element();
if(_11a){
return this._currentPosition+_117*_11a[_119];
}
return this._currentPosition;
},setScrollingLimits:function(min,max){
if(!this._owner._perTabScrolling){
var _11d="offsetWidth";
if(this._orientation==Telerik.Web.UI.ScrollerOrientation.Vertical){
_11d="offsetHeight";
}
max+=this._getScrollImageSize(_11d);
}
Telerik.Web.UI.TabScroller.callBaseMethod(this,"setScrollingLimits",[min,max]);
},_getScrollImageSize:function(_11e){
if(this._owner._scrollButtonsPosition==Telerik.Web.UI.TabStripScrollButtonsPosition.Right){
return this._nextArrow[_11e]+this._previousArrow[_11e];
}
if(this._owner._scrollButtonsPosition==Telerik.Web.UI.TabStripScrollButtonsPosition.Middle){
return this._nextArrow[_11e];
}
return 0;
},_scrollToTab:function(_11f){
if(_11f>0&&this.isAtMaxPosition()){
return;
}
if(_11f<0&&this.isAtMinPosition()){
return;
}
var _120=this._nextScrollPosition(_11f);
if(_120==this._currentPosition){
return;
}
this._scrollTo(_120);
this._currentTabIndex+=_11f;
},_calculateInitialTab:function(){
if(!this._owner._perTabScrolling){
return;
}
var size=0;
var tabs=this._owner.get_tabs();
var _123="offsetWidth";
if(this._orientation==Telerik.Web.UI.ScrollerOrientation.Vertical){
_123="offsetHeight";
}
while(size<this._currentPosition){
size+=tabs.getTab(this._currentTabIndex).get_element()[_123];
this._currentTabIndex++;
}
},initialize:function(){
Telerik.Web.UI.TabScroller.callBaseMethod(this,"initialize");
if(this._owner._perTabScrolling){
this._currentTabIndex=0;
}
this._positionChangedDelegate=Function.createDelegate(this,this._positionChanged);
this.add_positionChanged(this._positionChangedDelegate);
this._nextArrow=this._createArrow("rtsNextArrow");
this._previousArrow=this._createArrow("rtsPrevArrow");
this._positionArrows(this._owner._scrollButtonsPosition);
this._nextArrowClickDelegate=Function.createDelegate(this,this._preventDefault);
this._scrollForwardDelegate=Function.createDelegate(this,this._scrollForward);
this._nextArrowMouseUpDelegate=Function.createDelegate(this,this._stopScroll);
$addHandler(this._nextArrow,"click",this._nextArrowClickDelegate);
$addHandler(this._nextArrow,"mousedown",this._scrollForwardDelegate);
$addHandler(this._nextArrow,"mouseup",this._nextArrowMouseUpDelegate);
this._previousArrowClickDelegate=Function.createDelegate(this,this._preventDefault);
this._scrollBackwardDelegate=Function.createDelegate(this,this._scrollBackward);
this._previousArrowMouseUpDelegate=Function.createDelegate(this,this._stopScroll);
$addHandler(this._previousArrow,"click",this._previousArrowClickDelegate);
$addHandler(this._previousArrow,"mousedown",this._scrollBackwardDelegate);
$addHandler(this._previousArrow,"mouseup",this._previousArrowMouseUpDelegate);
},dispose:function(){
Telerik.Web.UI.TabScroller.callBaseMethod(this,"dispose");
$removeHandler(this._nextArrow,"click",this._nextArrowClickDelegate);
$removeHandler(this._nextArrow,"mousedown",this._scrollForwardDelegate);
$removeHandler(this._nextArrow,"mouseup",this._nextArrowMouseUpDelegate);
$removeHandler(this._previousArrow,"click",this._previousArrowClickDelegate);
$removeHandler(this._previousArrow,"mousedown",this._scrollBackwardDelegate);
$removeHandler(this._previousArrow,"mouseup",this._previousArrowMouseUpDelegate);
this._nextArrow=null;
this._previousArrow=null;
}};
Telerik.Web.UI.TabScroller.registerClass("Telerik.Web.UI.TabScroller",Telerik.Web.UI.Scroller);


/* END Telerik.Web.UI.TabStrip.RadTabStripScripts.js */
/* START AjaxControlToolkit.Compat.Timer.Timer.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />


///////////////////////////////////////////////////////////////////////////////
// Sys.Timer

Sys.Timer = function() {
    Sys.Timer.initializeBase(this);
    
    this._interval = 1000;
    this._enabled = false;
    this._timer = null;
}

Sys.Timer.prototype = {
    get_interval: function() {
        
        return this._interval;
    },
    set_interval: function(value) {
        
        if (this._interval !== value) {
            this._interval = value;
            this.raisePropertyChanged('interval');
            
            if (!this.get_isUpdating() && (this._timer !== null)) {
                this._stopTimer();
                this._startTimer();
            }
        }
    },
    
    get_enabled: function() {
        
        return this._enabled;
    },
    set_enabled: function(value) {
        
        if (value !== this.get_enabled()) {
            this._enabled = value;
            this.raisePropertyChanged('enabled');
            if (!this.get_isUpdating()) {
                if (value) {
                    this._startTimer();
                }
                else {
                    this._stopTimer();
                }
            }
        }
    },

    
    add_tick: function(handler) {
        
        
        this.get_events().addHandler("tick", handler);
    },

    remove_tick: function(handler) {
        
        
        this.get_events().removeHandler("tick", handler);
    },

    dispose: function() {
        this.set_enabled(false);
        this._stopTimer();
        
        Sys.Timer.callBaseMethod(this, 'dispose');
    },
    
    updated: function() {
        Sys.Timer.callBaseMethod(this, 'updated');

        if (this._enabled) {
            this._stopTimer();
            this._startTimer();
        }
    },

    _timerCallback: function() {
        var handler = this.get_events().getHandler("tick");
        if (handler) {
            handler(this, Sys.EventArgs.Empty);
        }
    },

    _startTimer: function() {
        this._timer = window.setInterval(Function.createDelegate(this, this._timerCallback), this._interval);
    },

    _stopTimer: function() {
        window.clearInterval(this._timer);
        this._timer = null;
    }
}

Sys.Timer.descriptor = {
    properties: [   {name: 'interval', type: Number},
                    {name: 'enabled', type: Boolean} ],
    events: [ {name: 'tick'} ]
}

Sys.Timer.registerClass('Sys.Timer', Sys.Component);

/* END AjaxControlToolkit.Compat.Timer.Timer.js */
/* START AjaxControlToolkit.Common.Common.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />


// Add common toolkit scripts here.  To consume the scripts on a control add
// 
//      [RequiredScript(typeof(CommonToolkitScripts))] 
//      public class SomeExtender : ...
// 
// to the controls extender class declaration.


Type.registerNamespace('AjaxControlToolkit');


AjaxControlToolkit.BoxSide = function() {
    /// <summary>
    /// The BoxSide enumeration describes the sides of a DOM element
    /// </summary>
    /// <field name="Top" type="Number" integer="true" static="true" />
    /// <field name="Right" type="Number" integer="true" static="true" />
    /// <field name="Bottom" type="Number" integer="true" static="true" />
    /// <field name="Left" type="Number" integer="true" static="true" />
}
AjaxControlToolkit.BoxSide.prototype = {
    Top : 0,
    Right : 1,
    Bottom : 2,
    Left : 3
}
AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide", false);


AjaxControlToolkit._CommonToolkitScripts = function() {
    /// <summary>
    /// The _CommonToolkitScripts class contains functionality utilized across a number
    /// of controls (but not universally)
    /// </summary>
    /// <remarks>
    /// You should not create new instances of _CommonToolkitScripts.  Instead you should use the shared instance CommonToolkitScripts (or AjaxControlToolkit.CommonToolkitScripts).
    /// </remarks>
}
AjaxControlToolkit._CommonToolkitScripts.prototype = {
    // The order of these lookup tables is directly linked to the BoxSide enum defined above
    _borderStyleNames : ["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],
    _borderWidthNames : ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
    _paddingWidthNames : ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
    _marginWidthNames : ["marginTop", "marginRight", "marginBottom", "marginLeft"],

    getCurrentStyle : function(element, attribute, defaultValue) {
        /// <summary>
        /// CommonToolkitScripts.getCurrentStyle is used to compute the value of a style attribute on an
        /// element that is currently being displayed.  This is especially useful for scenarios where
        /// several CSS classes and style attributes are merged, or when you need information about the
        /// size of an element (such as its padding or margins) that is not exposed in any other fashion.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Live DOM element to check style of
        /// </param>
        /// <param name="attribute" type="String">
        /// The style attribute's name is expected to be in a camel-cased form that you would use when
        /// accessing a JavaScript property instead of the hyphenated form you would use in a CSS
        /// stylesheet (i.e. it should be "backgroundColor" and not "background-color").
        /// </param>
        /// <param name="defaultValue" type="Object" mayBeNull="true" optional="true">
        /// In the event of a problem (i.e. a null element or an attribute that cannot be found) we
        /// return this object (or null if none if not specified).
        /// </param>
        /// <returns type="Object">
        /// Current style of the element's attribute
        /// </returns>

        var currentValue = null;
        if (element) {
            if (element.currentStyle) {
                currentValue = element.currentStyle[attribute];
            } else if (document.defaultView && document.defaultView.getComputedStyle) {
                var style = document.defaultView.getComputedStyle(element, null);
                if (style) {
                    currentValue = style[attribute];
                }
            }
            
            if (!currentValue && element.style.getPropertyValue) {
                currentValue = element.style.getPropertyValue(attribute);
            }
            else if (!currentValue && element.style.getAttribute) {
                currentValue = element.style.getAttribute(attribute);
            }       
        }
        
        if ((!currentValue || currentValue == "" || typeof(currentValue) === 'undefined')) {
            if (typeof(defaultValue) != 'undefined') {
                currentValue = defaultValue;
            }
            else {
                currentValue = null;
            }
        }   
        return currentValue;  
    },

    getInheritedBackgroundColor : function(element) {
        /// <summary>
        /// CommonToolkitScripts.getInheritedBackgroundColor provides the ability to get the displayed
        /// background-color of an element.  In most cases calling CommonToolkitScripts.getCurrentStyle
        /// won't do the job because it will return "transparent" unless the element has been given a
        /// specific background color.  This function will walk up the element's parents until it finds
        /// a non-transparent color.  If we get all the way to the top of the document or have any other
        /// problem finding a color, we will return the default value '#FFFFFF'.  This function is
        /// especially important when we're using opacity in IE (because ClearType will make text look
        /// horrendous if you fade it with a transparent background color).
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Live DOM element to get the background color of
        /// </param>
        /// <returns type="String">
        /// Background color of the element
        /// </returns>
        
        if (!element) return '#FFFFFF';
        var background = this.getCurrentStyle(element, 'backgroundColor');
        try {
            while (!background || background == '' || background == 'transparent' || background == 'rgba(0, 0, 0, 0)') {
                element = element.parentNode;
                if (!element) {
                    background = '#FFFFFF';
                } else {
                    background = this.getCurrentStyle(element, 'backgroundColor');
                }
            }
        } catch(ex) {
            background = '#FFFFFF';
        }
        return background;
    },

    getLocation : function(element) {
    /// <summary>Gets the coordinates of a DOM element.</summary>
    /// <param name="element" domElement="true"/>
    /// <returns type="Sys.UI.Point">
    ///   A Point object with two fields, x and y, which contain the pixel coordinates of the element.
    /// </returns>

    // workaround for an issue in getLocation where it will compute the location of the document element.
    // this will return an offset if scrolled.
    //
    if (element === document.documentElement) {
        return new Sys.UI.Point(0,0);
    }

    // Workaround for IE6 bug in getLocation (also required patching getBounds - remove that fix when this is removed)
    if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) {
        if (element.window === element || element.nodeType === 9 || !element.getClientRects || !element.getBoundingClientRect) return new Sys.UI.Point(0,0);

        // Get the first bounding rectangle in screen coordinates
        var screenRects = element.getClientRects();
        if (!screenRects || !screenRects.length) {
            return new Sys.UI.Point(0,0);
        }
        var first = screenRects[0];

        // Delta between client coords and screen coords
        var dLeft = 0;
        var dTop = 0;

        var inFrame = false;
        try {
            inFrame = element.ownerDocument.parentWindow.frameElement;
        } catch(ex) {
            // If accessing the frameElement fails, a frame is probably in a different
            // domain than its parent - and we still want to do the calculation below
            inFrame = true;
        }

        // If we're in a frame, get client coordinates too so we can compute the delta
        if (inFrame) {
            // Get the bounding rectangle in client coords
            var clientRect = element.getBoundingClientRect();
            if (!clientRect) {
                return new Sys.UI.Point(0,0);
            }

            // Find the minima in screen coords
            var minLeft = first.left;
            var minTop = first.top;
            for (var i = 1; i < screenRects.length; i++) {
                var r = screenRects[i];
                if (r.left < minLeft) {
                    minLeft = r.left;
                }
                if (r.top < minTop) {
                    minTop = r.top;
                }
            }

            // Compute the delta between screen and client coords
            dLeft = minLeft - clientRect.left;
            dTop = minTop - clientRect.top;
        }

        // Subtract 2px, the border of the viewport (It can be changed in IE6 by applying a border style to the HTML element,
        // but this is not supported by ASP.NET AJAX, and it cannot be changed in IE7.), and also subtract the delta between
        // screen coords and client coords
        var ownerDocument = element.document.documentElement;
        return new Sys.UI.Point(first.left - 2 - dLeft + ownerDocument.scrollLeft, first.top - 2 - dTop + ownerDocument.scrollTop);
    }

    return Sys.UI.DomElement.getLocation(element);
},

    setLocation : function(element, point) {
        /// <summary>
        /// Sets the current location for an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="point" type="Object">
        /// Point object (of the form {x,y})
        /// </param>
        /// <remarks>
        /// This method does not attempt to set the positioning mode of an element.
        /// The position is relative from the elements nearest position:relative or
        /// position:absolute element.
        /// </remarks>
        Sys.UI.DomElement.setLocation(element, point.x, point.y);
    },
    
    getContentSize : function(element) {
        /// <summary>
        /// Gets the "content-box" size of an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Size of the element (in the form {width,height})
        /// </returns>
        /// <remarks>
        /// The "content-box" is the size of the content area *inside* of the borders and
        /// padding of an element. The "content-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        var size = this.getSize(element);
        var borderBox = this.getBorderBox(element);
        var paddingBox = this.getPaddingBox(element);
        return {
            width :  size.width - borderBox.horizontal - paddingBox.horizontal,
            height : size.height - borderBox.vertical - paddingBox.vertical
        }
    },

    getSize : function(element) {
        /// <summary>
        /// Gets the "border-box" size of an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Size of the element (in the form {width,height})
        /// </returns>
        /// <remarks>
        /// The "border-box" is the size of the content area *outside* of the borders and
        /// padding of an element.  The "border-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        return {
            width:  element.offsetWidth,
            height: element.offsetHeight
        };
    },
    
    setContentSize : function(element, size) {
        /// <summary>
        /// Sets the "content-box" size of an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="size" type="Object">
        /// Size of the element (in the form {width,height})
        /// </param>
        /// <remarks>
        /// The "content-box" is the size of the content area *inside* of the borders and
        /// padding of an element. The "content-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if (!size) {
            throw Error.argumentNull('size');
        }
        // FF respects -moz-box-sizing css extension, so adjust the box size for the border-box
        if(this.getCurrentStyle(element, 'MozBoxSizing') == 'border-box' || this.getCurrentStyle(element, 'BoxSizing') == 'border-box') {
            var borderBox = this.getBorderBox(element);
            var paddingBox = this.getPaddingBox(element);
            size = {
                width: size.width + borderBox.horizontal + paddingBox.horizontal,
                height: size.height + borderBox.vertical + paddingBox.vertical
            };
        }
        element.style.width = size.width.toString() + 'px';
        element.style.height = size.height.toString() + 'px';
    },
    
    setSize : function(element, size) {
        /// <summary>
        /// Sets the "border-box" size of an element.
        /// </summary>
        /// <remarks>
        /// The "border-box" is the size of the content area *outside* of the borders and 
        /// padding of an element.  The "border-box" size does not include the margins around
        /// the element.
        /// </remarks>
        /// <param name="element" type="Sys.UI.DomElement">DOM element</param>
        /// <param name="size" type="Object">Size of the element (in the form {width,height})</param>
        /// <returns />
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if (!size) {
            throw Error.argumentNull('size');
        }
        var borderBox = this.getBorderBox(element);
        var paddingBox = this.getPaddingBox(element);
        var contentSize = {
            width:  size.width - borderBox.horizontal - paddingBox.horizontal,
            height: size.height - borderBox.vertical - paddingBox.vertical
        };
        this.setContentSize(element, contentSize);
    },
    
    getBounds : function(element) {
        /// <summary>Gets the coordinates, width and height of an element.</summary>
        /// <param name="element" domElement="true"/>
        /// <returns type="Sys.UI.Bounds">
        ///   A Bounds object with four fields, x, y, width and height, which contain the pixel coordinates,
        ///   width and height of the element.
        /// </returns>
        /// <remarks>
        ///   Use the CommonToolkitScripts version of getLocation to handle the workaround for IE6.  We can
        ///   remove the below implementation and just call Sys.UI.DomElement.getBounds when the other bug
        ///   is fixed.
        /// </remarks>
        
        var offset = $common.getLocation(element);
        return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);
    }, 
    
    setBounds : function(element, bounds) {
        /// <summary>
        /// Sets the "border-box" bounds of an element
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="bounds" type="Object">
        /// Bounds of the element (of the form {x,y,width,height})
        /// </param>
        /// <remarks>
        /// The "border-box" is the size of the content area *outside* of the borders and
        /// padding of an element.  The "border-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if (!bounds) {
            throw Error.argumentNull('bounds');
        }
        this.setSize(element, bounds);
        $common.setLocation(element, bounds);
    },
    
    getClientBounds : function() {
        /// <summary>
        /// Gets the width and height of the browser client window (excluding scrollbars)
        /// </summary>
        /// <returns type="Sys.UI.Bounds">
        /// Browser's client width and height
        /// </returns>

        var clientWidth;
        var clientHeight;
        switch(Sys.Browser.agent) {
            case Sys.Browser.InternetExplorer:
                clientWidth = document.documentElement.clientWidth;
                clientHeight = document.documentElement.clientHeight;
                break;
            case Sys.Browser.Safari:
                clientWidth = window.innerWidth;
                clientHeight = window.innerHeight;
                break;
            case Sys.Browser.Opera:
                clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
                clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
                break;
            default:  // Sys.Browser.Firefox, etc.
                clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
                clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
                break;
        }
        return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
    },
   
    getMarginBox : function(element) {
        /// <summary>
        /// Gets the entire margin box sizes.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Element's margin box sizes (of the form {top,left,bottom,right,horizontal,vertical})
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        var box = {
            top: this.getMargin(element, AjaxControlToolkit.BoxSide.Top),
            right: this.getMargin(element, AjaxControlToolkit.BoxSide.Right),
            bottom: this.getMargin(element, AjaxControlToolkit.BoxSide.Bottom),
            left: this.getMargin(element, AjaxControlToolkit.BoxSide.Left)
        };
        box.horizontal = box.left + box.right;
        box.vertical = box.top + box.bottom;
        return box;
    },
    
    getBorderBox : function(element) {
        /// <summary>
        /// Gets the entire border box sizes.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Element's border box sizes (of the form {top,left,bottom,right,horizontal,vertical})
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        var box = {
            top: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Top),
            right: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Right),
            bottom: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Bottom),
            left: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Left)
        };
        box.horizontal = box.left + box.right;
        box.vertical = box.top + box.bottom;
        return box;
    },
    
    getPaddingBox : function(element) {
        /// <summary>
        /// Gets the entire padding box sizes.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Element's padding box sizes (of the form {top,left,bottom,right,horizontal,vertical})
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        var box = {
            top: this.getPadding(element, AjaxControlToolkit.BoxSide.Top),
            right: this.getPadding(element, AjaxControlToolkit.BoxSide.Right),
            bottom: this.getPadding(element, AjaxControlToolkit.BoxSide.Bottom),
            left: this.getPadding(element, AjaxControlToolkit.BoxSide.Left)
        };
        box.horizontal = box.left + box.right;
        box.vertical = box.top + box.bottom;
        return box;
    },
    
    isBorderVisible : function(element, boxSide) {
        /// <summary>
        /// Gets whether the current border style for an element on a specific boxSide is not 'none'.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="boxSide" type="AjaxControlToolkit.BoxSide">
        /// Side of the element
        /// </param>
        /// <returns type="Boolean">
        /// Whether the current border style for an element on a specific boxSide is not 'none'.
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
            throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
        }
        var styleName = this._borderStyleNames[boxSide];
        var styleValue = this.getCurrentStyle(element, styleName);
        return styleValue != "none";
    },
    
    getMargin : function(element, boxSide) {
        /// <summary>
        /// Gets the margin thickness of an element on a specific boxSide.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="boxSide" type="AjaxControlToolkit.BoxSide">
        /// Side of the element
        /// </param>
        /// <returns type="Number" integer="true">
        /// Margin thickness on the element's specified side
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
            throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
        }
        var styleName = this._marginWidthNames[boxSide];
        var styleValue = this.getCurrentStyle(element, styleName);
        try { return this.parsePadding(styleValue); } catch(ex) { return 0; }
    },

    getBorderWidth : function(element, boxSide) {
        /// <summary>
        /// Gets the border thickness of an element on a specific boxSide.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="boxSide" type="AjaxControlToolkit.BoxSide">
        /// Side of the element
        /// </param>
        /// <returns type="Number" integer="true">
        /// Border thickness on the element's specified side
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
            throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
        }
        if(!this.isBorderVisible(element, boxSide)) {
            return 0;
        }        
        var styleName = this._borderWidthNames[boxSide];    
        var styleValue = this.getCurrentStyle(element, styleName);
        return this.parseBorderWidth(styleValue);
    },
    
    getPadding : function(element, boxSide) {
        /// <summary>
        /// Gets the padding thickness of an element on a specific boxSide.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="boxSide" type="AjaxControlToolkit.BoxSide">
        /// Side of the element
        /// </param>
        /// <returns type="Number" integer="true">
        /// Padding on the element's specified side
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
            throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
        }
        var styleName = this._paddingWidthNames[boxSide];
        var styleValue = this.getCurrentStyle(element, styleName);
        return this.parsePadding(styleValue);
    },
    
    parseBorderWidth : function(borderWidth) {
        /// <summary>
        /// Parses a border-width string into a pixel size
        /// </summary>
        /// <param name="borderWidth" type="String" mayBeNull="true">
        /// Type of border ('thin','medium','thick','inherit',px unit,null,'')
        /// </param>
        /// <returns type="Number" integer="true">
        /// Number of pixels in the border-width
        /// </returns>
        if (!this._borderThicknesses) {
            
            // Populate the borderThicknesses lookup table
            var borderThicknesses = { };
            var div0 = document.createElement('div');
            div0.style.visibility = 'hidden';
            div0.style.position = 'absolute';
            div0.style.fontSize = '1px';
            document.body.appendChild(div0)
            var div1 = document.createElement('div');
            div1.style.height = '0px';
            div1.style.overflow = 'hidden';
            div0.appendChild(div1);
            var base = div0.offsetHeight;
            div1.style.borderTop = 'solid black';
            div1.style.borderTopWidth = 'thin';
            borderThicknesses['thin'] = div0.offsetHeight - base;
            div1.style.borderTopWidth = 'medium';
            borderThicknesses['medium'] = div0.offsetHeight - base;
            div1.style.borderTopWidth = 'thick';
            borderThicknesses['thick'] = div0.offsetHeight - base;
            div0.removeChild(div1);
            document.body.removeChild(div0);
            this._borderThicknesses = borderThicknesses;
        }
        
        if (borderWidth) {
            switch(borderWidth) {
                case 'thin':
                case 'medium':
                case 'thick':
                    return this._borderThicknesses[borderWidth];
                case 'inherit':
                    return 0;
            }
            var unit = this.parseUnit(borderWidth);
            Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit, unit.type));
            return unit.size;
        }
        return 0;
    },
    
    parsePadding : function(padding) {
        /// <summary>
        /// Parses a padding string into a pixel size
        /// </summary>
        /// <param name="padding" type="String" mayBeNull="true">
        /// Padding to parse ('inherit',px unit,null,'')
        /// </param>
        /// <returns type="Number" integer="true">
        /// Number of pixels in the padding
        /// </returns>
        
        if(padding) {
            if(padding == 'inherit') {
                return 0;
            }
            var unit = this.parseUnit(padding);
            Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit, unit.type));
            return unit.size;
        }
        return 0;
    },
    
    parseUnit : function(value) {
        /// <summary>
        /// Parses a unit string into a unit object
        /// </summary>
        /// <param name="value" type="String" mayBeNull="true">
        /// Value to parse (of the form px unit,% unit,em unit,...)
        /// </param>
        /// <returns type="Object">
        /// Parsed unit (of the form {size,type})
        /// </returns>
        
        if (!value) {
            throw Error.argumentNull('value');
        }
        
        value = value.trim().toLowerCase();
        var l = value.length;
        var s = -1;
        for(var i = 0; i < l; i++) {
            var ch = value.substr(i, 1);
            if((ch < '0' || ch > '9') && ch != '-' && ch != '.' && ch != ',') {
                break;
            }
            s = i;
        }
        if(s == -1) {
            throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);
        }
        var type;
        var size;
        if(s < (l - 1)) {
            type = value.substring(s + 1).trim();
        } else {
            type = 'px';
        }
        size = parseFloat(value.substr(0, s + 1));
        if(type == 'px') {
            size = Math.floor(size);
        }
        return { 
            size: size,
            type: type
        };
    },
    
    getElementOpacity : function(element) {
        /// <summary>
        /// Get the element's opacity
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <returns type="Number">
        /// Opacity of the element
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        
        var hasOpacity = false;
        var opacity;
        
        if (element.filters) {
            var filters = element.filters;
            if (filters.length !== 0) {
                var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
                if (alphaFilter) {
                    opacity = alphaFilter.opacity / 100.0;
                    hasOpacity = true;
                }
            }
        }
        else {
            opacity = this.getCurrentStyle(element, 'opacity', 1);
            hasOpacity = true;
        }
        
        if (hasOpacity === false) {
            return 1.0;
        }
        return parseFloat(opacity);
    },

    setElementOpacity : function(element, value) {
        /// <summary>
        /// Set the element's opacity
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <param name="value" type="Number">
        /// Opacity of the element
        /// </param>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        
        if (element.filters) {
            var filters = element.filters;
            var createFilter = true;
            if (filters.length !== 0) {
                var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
                if (alphaFilter) {
                    createFilter = false;
                    alphaFilter.opacity = value * 100;
                }
            }
            if (createFilter) {
                element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';
            }
        }
        else {
            element.style.opacity = value;
        }
    },
    
    getVisible : function(element) {
        /// <summary>
        /// Check if an element is visible
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <returns type="Boolean" mayBeNull="false">
        /// True if the element is visible, false otherwise
        /// </returns>
        
        // Note: reference to CommonToolkitScripts must be left intact (i.e. don't
        // replace with 'this') because this function will be aliased
        
        return (element &&
                ("none" != $common.getCurrentStyle(element, "display")) &&
                ("hidden" != $common.getCurrentStyle(element, "visibility")));
    },
    
    setVisible : function(element, value) {
        /// <summary>
        /// Check if an element is visible
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <param name="value" type="Boolean" mayBeNull="false">
        /// True to make the element visible, false to hide it
        /// </param>
        
        // Note: reference to CommonToolkitScripts must be left intact (i.e. don't
        // replace with 'this') because this function will be aliased
        
        if (element && value != $common.getVisible(element)) {
            if (value) {
                if (element.style.removeAttribute) {
                    element.style.removeAttribute("display");
                } else {
                   element.style.removeProperty("display");
                }
            } else {
                element.style.display = 'none';
            }
            element.style.visibility = value ? 'visible' : 'hidden';
        }
    },
    
    resolveFunction : function(value) {
        /// <summary>
        /// Returns a function reference that corresponds to the provided value
        /// </summary>
        /// <param name="value" type="Object">
        /// The value can either be a Function, the name of a function (that can be found using window['name']),
        /// or an expression that evaluates to a function.
        /// </param>
        /// <returns type="Function">
        /// Reference to the function, or null if not found
        /// </returns>
        
        if (value) {
            if (value instanceof Function) {
                return value;
            } else if (String.isInstanceOfType(value) && value.length > 0) {
                var func;
                if ((func = window[value]) instanceof Function) {
                    return func;
                } else if ((func = eval(value)) instanceof Function) {
                    return func;
                }
            }
        }
        return null;
    },

    addCssClasses : function(element, classNames) {
        /// <summary>
        /// Adds multiple css classes to a DomElement
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="classNames" type="Array">The class names to add</param>
        
        for(var i = 0; i < classNames.length; i++) {
            Sys.UI.DomElement.addCssClass(element, classNames[i]);
        }
    },
    removeCssClasses : function(element, classNames) {
        /// <summary>
        /// Removes multiple css classes to a DomElement
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="classNames" type="Array">The class names to remove</param>
        
        for(var i = 0; i < classNames.length; i++) {
            Sys.UI.DomElement.removeCssClass(element, classNames[i]);
        }
    },
    setStyle : function(element, style) {
        /// <summary>
        /// Sets the style of the element using the supplied style template object
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="style" type="Object">The template</param>

        $common.applyProperties(element.style, style);
    },
    removeHandlers : function(element, events) {
        /// <summary>
        /// Removes a set of event handlers from an element
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="events" type="Object">The template object that contains event names and delegates</param>
        /// <remarks>
        /// This is NOT the same as $clearHandlers which removes all delegates from a DomElement.  This rather removes select delegates 
        /// from a specified element and has a matching signature as $addHandlers
        /// </remarks>
        for (var name in events) {
            $removeHandler(element, name, events[name]);
        }
    },
    
    overlaps : function(r1, r2) {
        /// <summary>
        /// Determine if two rectangles overlap
        /// </summary>
        /// <param name="r1" type="Object">
        /// Rectangle
        /// </param>
        /// <param name="r2" type="Object">
        /// Rectangle
        /// </param>
        /// <returns type="Boolean">
        /// True if the rectangles overlap, false otherwise
        /// </returns>
        
         return r1.x < (r2.x + r2.width)
                && r2.x < (r1.x + r1.width)
                && r1.y < (r2.y + r2.height)
                && r2.y < (r1.y + r1.height);
    },
    
    containsPoint : function(rect, x, y) {
        /// <summary>
        /// Tests whether a point (x,y) is contained within a rectangle
        /// </summary>
        /// <param name="rect" type="Object">The rectangle</param>
        /// <param name="x" type="Number">The x coordinate of the point</param>
        /// <param name="y" type="Number">The y coordinate of the point</param>
        
        return x >= rect.x && x < (rect.x + rect.width) && y >= rect.y && y < (rect.y + rect.height);
    },

    isKeyDigit : function(keyCode) { 
        /// <summary>
        /// Gets whether the supplied key-code is a digit
        /// </summary>
        /// <param name="keyCode" type="Number" integer="true">The key code of the event (from Sys.UI.DomEvent)</param>
        /// <returns type="Boolean" />

        return (0x30 <= keyCode && keyCode <= 0x39); 
    },
    
    isKeyNavigation : function(keyCode) { 
        /// <summary>
        /// Gets whether the supplied key-code is a navigation key
        /// </summary>
        /// <param name="keyCode" type="Number" integer="true">The key code of the event (from Sys.UI.DomEvent)</param>
        /// <returns type="Boolean" />

        return (Sys.UI.Key.left <= keyCode && keyCode <= Sys.UI.Key.down); 
    },
    
    padLeft : function(text, size, ch, truncate) { 
        /// <summary>
        /// Pads the left hand side of the supplied text with the specified pad character up to the requested size
        /// </summary>
        /// <param name="text" type="String">The text to pad</param>
        /// <param name="size" type="Number" integer="true" optional="true">The size to pad the text (default is 2)</param>
        /// <param name="ch" type="String" optional="true">The single character to use as the pad character (default is ' ')</param>
        /// <param name="truncate" type="Boolean" optional="true">Whether to truncate the text to size (default is false)</param>
        
        return $common._pad(text, size || 2, ch || ' ', 'l', truncate || false); 
    },
    
    padRight : function(text, size, ch, truncate) { 
        /// <summary>
        /// Pads the right hand side of the supplied text with the specified pad character up to the requested size
        /// </summary>
        /// <param name="text" type="String">The text to pad</param>
        /// <param name="size" type="Number" integer="true" optional="true">The size to pad the text (default is 2)</param>
        /// <param name="ch" type="String" optional="true">The single character to use as the pad character (default is ' ')</param>
        /// <param name="truncate" type="Boolean" optional="true">Whether to truncate the text to size (default is false)</param>

        return $common._pad(text, size || 2, ch || ' ', 'r', truncate || false); 
    },
    
    _pad : function(text, size, ch, side, truncate) {
        /// <summary>
        /// Pads supplied text with the specified pad character up to the requested size
        /// </summary>
        /// <param name="text" type="String">The text to pad</param>
        /// <param name="size" type="Number" integer="true">The size to pad the text</param>
        /// <param name="ch" type="String">The single character to use as the pad character</param>
        /// <param name="side" type="String">Either 'l' or 'r' to siginfy whether to pad the Left or Right side respectively</param>
        /// <param name="truncate" type="Boolean">Whether to truncate the text to size</param>

        text = text.toString();
        var length = text.length;
        var builder = new Sys.StringBuilder();
        if (side == 'r') {
            builder.append(text);
        } 
        while (length < size) {
            builder.append(ch);
            length++;
        }
        if (side == 'l') {
            builder.append(text);
        }
        var result = builder.toString();
        if (truncate && result.length > size) {
            if (side == 'l') {
                result = result.substr(result.length - size, size);
            } else {
                result = result.substr(0, size);
            }
        }
        return result;
    },
    
    __DOMEvents : {
        focusin : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focusin", true, false, window, 1); } },
        focusout : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focusout", true, false, window, 1); } },
        activate : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("activate", true, true, window, 1); } },
        focus : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focus", false, false, window, 1); } },
        blur : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("blur", false, false, window, 1); } },
        click : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("click", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
        dblclick : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("click", true, true, window, 2, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
        mousedown : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousedown", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
        mouseup : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mouseup", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
        mouseover : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mouseover", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
        mousemove : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
        mouseout : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
        load : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("load", false, false); } },
        unload : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("unload", false, false); } },
        select : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("select", true, false); } },
        change : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("change", true, false); } },
        submit : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("submit", true, true); } },
        reset : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("reset", true, false); } },
        resize : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("resize", true, false); } },
        scroll : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("scroll", true, false); } }
    },
    
    tryFireRawEvent : function(element, rawEvent) {
        /// <summary>
        /// Attempts to fire a raw DOM event on an element
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to fire the event</param>
        /// <param name="rawEvent" type="Object">The raw DOM event object to fire. Must not be Sys.UI.DomEvent</param>
        /// <returns type="Boolean">True if the event was successfully fired, otherwise false</returns>
        
        try {
            if (element.fireEvent) {
                element.fireEvent("on" + rawEvent.type, rawEvent);
                return true;
            } else if (element.dispatchEvent) {
                element.dispatchEvent(rawEvent);
                return true;
            }
        } catch (e) {
        }
        return false;
    },    

    tryFireEvent : function(element, eventName, properties) {
        /// <summary>
        /// Attempts to fire a DOM event on an element
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to fire the event</param>
        /// <param name="eventName" type="String">The name of the event to fire (without an 'on' prefix)</param>
        /// <param name="properties" type="Object">Properties to add to the event</param>
        /// <returns type="Boolean">True if the event was successfully fired, otherwise false</returns>
        
        try {
            if (document.createEventObject) {
                var e = document.createEventObject();
                $common.applyProperties(e, properties || {});
                element.fireEvent("on" + eventName, e);
                return true;
            } else if (document.createEvent) {
                var def = $common.__DOMEvents[eventName];
                if (def) {
                    var e = document.createEvent(def.eventGroup);
                    def.init(e, properties || {});
                    element.dispatchEvent(e);
                    return true;
                }
            }
        } catch (e) {
        }
        return false;
    },

    wrapElement : function(innerElement, newOuterElement, newInnerParentElement) {
        /// <summary>
        /// Wraps an inner element with a new outer element at the same DOM location as the inner element
        /// </summary>
        /// <param name="innerElement" type="Sys.UI.DomElement">The element to be wrapped</param>
        /// <param name="newOuterElement" type="Sys.UI.DomElement">The new parent for the element</param>
        /// <returns />
        
        var parent = innerElement.parentNode;
        parent.replaceChild(newOuterElement, innerElement);        
        (newInnerParentElement || newOuterElement).appendChild(innerElement);
    },

    unwrapElement : function(innerElement, oldOuterElement) {
        /// <summary>
        /// Unwraps an inner element from an outer element at the same DOM location as the outer element
        /// </summary>
        /// <param name="innerElement" type="Sys.UI.DomElement">The element to be wrapped</param>
        /// <param name="newOuterElement" type="Sys.UI.DomElement">The new parent for the element</param>
        /// <returns />

        var parent = oldOuterElement.parentNode;
        if (parent != null) {
            $common.removeElement(innerElement);
            parent.replaceChild(innerElement, oldOuterElement);
        }
    },
    
    removeElement : function(element) {
        /// <summary>
        /// Removes an element from the DOM tree
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to be removed</param>
        /// <returns />

        var parent = element.parentNode;
        if (parent != null) {
            parent.removeChild(element);
        }
    },
 
    applyProperties : function(target, properties) {
        /// <summary>
        /// Quick utility method to copy properties from a template object to a target object
        /// </summary>
        /// <param name="target" type="Object">The object to apply to</param>
        /// <param name="properties" type="Object">The template to copy values from</param>
        
        for (var p in properties) {
            var pv = properties[p];
            if (pv != null && Object.getType(pv)===Object) {
                var tv = target[p];
                $common.applyProperties(tv, pv);
            } else {
                target[p] = pv;
            }
        }
    },
        
    createElementFromTemplate : function(template, appendToParent, nameTable) {
        /// <summary>
        /// Creates an element for the current document based on a template object
        /// </summary>
        /// <param name="template" type="Object">The template from which to create the element</param>
        /// <param name="appendToParent" type="Sys.UI.DomElement" optional="true" mayBeNull="true">A DomElement under which to append this element</param>
        /// <param name="nameTable" type="Object" optional="true" mayBeNull="true">An object to use as the storage for the element using template.name as the key</param>
        /// <returns type="Sys.UI.DomElement" />
        /// <remarks>
        /// This method is useful if you find yourself using the same or similar DomElement constructions throughout a class.  You can even set the templates
        /// as static properties for a type to cut down on overhead.  This method is often called with a JSON style template:
        /// <code>
        /// var elt = $common.createElementFromTemplate({
        ///     nodeName : "div",
        ///     properties : {
        ///         style : {
        ///             height : "100px",
        ///             width : "100px",
        ///             backgroundColor : "white"
        ///         },
        ///         expandoAttribute : "foo"
        ///     },
        ///     events : {
        ///         click : function() { alert("foo"); },
        ///         mouseover : function() { elt.backgroundColor = "silver"; },
        ///         mouseout : function() { elt.backgroundColor = "white"; }
        ///     },
        ///     cssClasses : [ "class0", "class1" ],
        ///     visible : true,
        ///     opacity : .5
        /// }, someParent);
        /// </code>
        /// </remarks>
        
        // if we wish to override the name table we do so here
        if (typeof(template.nameTable)!='undefined') {
            var newNameTable = template.nameTable;
            if (String.isInstanceOfType(newNameTable)) {
                newNameTable = nameTable[newNameTable];
            }
            if (newNameTable != null) {
                nameTable = newNameTable;
            }
        }
        
        // get a name for the element in the nameTable
        var elementName = null;
        if (typeof(template.name)!=='undefined') {
            elementName = template.name;
        }
        
        // create or acquire the element
        var elt = document.createElement(template.nodeName);
        
        // if our element is named, add it to the name table
        if (typeof(template.name)!=='undefined' && nameTable) {
            nameTable[template.name] = elt;
        }
        
        // if we wish to supply a default parent we do so here
        if (typeof(template.parent)!=='undefined' && appendToParent == null) {
            var newParent = template.parent;
            if (String.isInstanceOfType(newParent)) {
                newParent = nameTable[newParent];
            }
            if (newParent != null) {
                appendToParent = newParent;
            }
        }
        
        // properties are applied as expando values to the element
        if (typeof(template.properties)!=='undefined' && template.properties != null) {
            $common.applyProperties(elt, template.properties);
        }
        
        // css classes are added to the element's className property
        if (typeof(template.cssClasses)!=='undefined' && template.cssClasses != null) {
            $common.addCssClasses(elt, template.cssClasses);
        }
        
        // events are added to the dom element using $addHandlers
        if (typeof(template.events)!=='undefined' && template.events != null) {
            $addHandlers(elt, template.events);
        }
        
        // if the element is visible or not its visibility is set
        if (typeof(template.visible)!=='undefined' && template.visible != null) {
            this.setVisible(elt, template.visible);
        }
        
        // if we have an appendToParent we will now append to it
        if (appendToParent) {
            appendToParent.appendChild(elt);
        }

        // if we have opacity, apply it
        if (typeof(template.opacity)!=='undefined' && template.opacity != null) {
            $common.setElementOpacity(elt, template.opacity);
        }
        
        // if we have child templates, process them
        if (typeof(template.children)!=='undefined' && template.children != null) {
            for (var i = 0; i < template.children.length; i++) {
                var subtemplate = template.children[i];
                $common.createElementFromTemplate(subtemplate, elt, nameTable);
            }
        }
        
        // if we have a content presenter for the element get it (the element itself is the default presenter for content)
        var contentPresenter = elt;
        if (typeof(template.contentPresenter)!=='undefined' && template.contentPresenter != null) {
            contentPresenter = nameTable[contentPresenter];
        }
        
        // if we have content, add it
        if (typeof(template.content)!=='undefined' && template.content != null) {
            var content = template.content;
            if (String.isInstanceOfType(content)) {
                content = nameTable[content];
            }
            if (content.parentNode) {
                $common.wrapElement(content, elt, contentPresenter);
            } else {
                contentPresenter.appendChild(content);
            }
        }
        
        // return the created element
        return elt;
    },
    
    prepareHiddenElementForATDeviceUpdate : function () {
        /// <summary>
        /// JAWS, an Assistive Technology device responds to updates to form elements 
        /// and refreshes its document buffer to what is showing live
        /// in the browser. To ensure that Toolkit controls that make XmlHttpRequests to
        /// retrieve content are useful to users with visual disabilities, we update a
        /// hidden form element to ensure that JAWS conveys what is in
        /// the browser. See this article for more details: 
        /// http://juicystudio.com/article/improving-ajax-applications-for-jaws-users.php
        /// This method creates a hidden input on the screen for any page that uses a Toolkit
        /// control that will perform an XmlHttpRequest.
        /// </summary>   
        var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');
        if (!objHidden) {
            var objHidden = document.createElement('input');
            objHidden.setAttribute('type', 'hidden');
            objHidden.setAttribute('value', '1');
            objHidden.setAttribute('id', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');
            objHidden.setAttribute('name', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');
            if ( document.forms[0] ) {
                document.forms[0].appendChild(objHidden);
            }
        }
    },
    
    updateFormToRefreshATDeviceBuffer : function () {
        /// <summary>
        /// Updates the hidden buffer to ensure that the latest document stream is picked up
        /// by the screen reader.
        /// </summary>
        var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');

        if (objHidden) {
            if (objHidden.getAttribute('value') == '1') {
                objHidden.setAttribute('value', '0');
            } else {
                objHidden.setAttribute('value', '1');
            }
        }
    }
}

// Create the singleton instance of the CommonToolkitScripts
var CommonToolkitScripts = AjaxControlToolkit.CommonToolkitScripts = new AjaxControlToolkit._CommonToolkitScripts();
var $common = CommonToolkitScripts;

// Alias functions that were moved from BlockingScripts into Common
Sys.UI.DomElement.getVisible = $common.getVisible;
Sys.UI.DomElement.setVisible = $common.setVisible;
Sys.UI.Control.overlaps = $common.overlaps;

AjaxControlToolkit._DomUtility = function() {
    /// <summary>
    /// Utility functions for manipulating the DOM
    /// </summary>
}
AjaxControlToolkit._DomUtility.prototype = {
    isDescendant : function(ancestor, descendant) {
        /// <summary>
        /// Whether the specified element is a descendant of the ancestor
        /// </summary>
        /// <param name="ancestor" type="Sys.UI.DomElement">Ancestor node</param>
        /// <param name="descendant" type="Sys.UI.DomElement">Possible descendant node</param>
        /// <returns type="Boolean" />
        
        for (var n = descendant.parentNode; n != null; n = n.parentNode) {
            if (n == ancestor) return true;
        }
        return false;
    },
    isDescendantOrSelf : function(ancestor, descendant) {
        /// <summary>
        /// Whether the specified element is a descendant of the ancestor or the same as the ancestor
        /// </summary>
        /// <param name="ancestor" type="Sys.UI.DomElement">Ancestor node</param>
        /// <param name="descendant" type="Sys.UI.DomElement">Possible descendant node</param>
        /// <returns type="Boolean" />

        if (ancestor === descendant) 
            return true;
        return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
    },
    isAncestor : function(descendant, ancestor) {
        /// <summary>
        /// Whether the specified element is an ancestor of the descendant
        /// </summary>
        /// <param name="descendant" type="Sys.UI.DomElement">Descendant node</param>
        /// <param name="ancestor" type="Sys.UI.DomElement">Possible ancestor node</param>
        /// <returns type="Boolean" />

        return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
    },
    isAncestorOrSelf : function(descendant, ancestor) {
        /// <summary>
        /// Whether the specified element is an ancestor of the descendant or the same as the descendant
        /// </summary>
        /// <param name="descendant" type="Sys.UI.DomElement">Descendant node</param>
        /// <param name="ancestor" type="Sys.UI.DomElement">Possible ancestor node</param>
        /// <returns type="Boolean" />
        
        if (descendant === ancestor)
            return true;
            
        return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
    },
    isSibling : function(self, sibling) {
        /// <summary>
        /// Whether the specified element is a sibling of the self element
        /// </summary>
        /// <param name="self" type="Sys.UI.DomElement">Self node</param>
        /// <param name="sibling" type="Sys.UI.DomElement">Possible sibling node</param>
        /// <returns type="Boolean" />
        
        var parent = self.parentNode;
        for (var i = 0; i < parent.childNodes.length; i++) {
            if (parent.childNodes[i] == sibling) return true;
        }
        return false;
    }
}
AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");
AjaxControlToolkit.DomUtility = new AjaxControlToolkit._DomUtility();


AjaxControlToolkit.TextBoxWrapper = function(element) {
    /// <summary>
    /// Class that wraps a TextBox (INPUT type="text") to abstract-out the
    /// presence of a watermark (which may be visible to the user but which
    /// should never be read by script.
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// The DOM element the behavior is associated with
    /// </param>
    AjaxControlToolkit.TextBoxWrapper.initializeBase(this, [element]);
    this._current = element.value;
    this._watermark = null;
    this._isWatermarked = false;
}

AjaxControlToolkit.TextBoxWrapper.prototype = {

    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        this.get_element().AjaxControlToolkitTextBoxWrapper = null;
        AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this, 'dispose');
    },

    get_Current : function() {
        /// <value type="String">
        /// Current value actually in the TextBox (i.e., TextBox.value)
        /// </value>
        this._current = this.get_element().value;
        return this._current;
    },
    set_Current : function(value) {
        this._current = value;
        this._updateElement();
    },

    get_Value : function() {
        /// <value type="String">
        /// Conceptual "value" of the TextBox - its contents if no watermark is present
        /// or "" if one is
        /// </value>
        if (this.get_IsWatermarked()) {
            return "";
        } else {
            return this.get_Current();
        }
    },
    set_Value : function(text) {
        this.set_Current(text);
        if (!text || (0 == text.length)) {
            if (null != this._watermark) {
                this.set_IsWatermarked(true);
            }
        } else {
            this.set_IsWatermarked(false);
        }
    },

    get_Watermark : function() {
        /// <value type="String">
        /// Text of the watermark for the TextBox
        /// </value>
        return this._watermark;
    },
    set_Watermark : function(value) {
        this._watermark = value;
        this._updateElement();
    },

    get_IsWatermarked : function() {
        /// <value type="Boolean">
        /// true iff the TextBox is watermarked
        /// </value>
        return this._isWatermarked;
    },
    set_IsWatermarked : function(isWatermarked) {
        if (this._isWatermarked != isWatermarked) {
            this._isWatermarked = isWatermarked;
            this._updateElement();
            this._raiseWatermarkChanged();
        }
    },

    _updateElement : function() {
        /// <summary>
        /// Updates the actual contents of the TextBox according to what should be there
        /// </summary>
        var element = this.get_element();
        if (this._isWatermarked) {
            if (element.value != this._watermark) {
                element.value = this._watermark;
            }
        } else {
            if (element.value != this._current) {
                element.value = this._current;
            }
        }
    },

    add_WatermarkChanged : function(handler) {
        /// <summary>
        /// Adds a handler for the WatermarkChanged event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().addHandler("WatermarkChanged", handler);
    },
    remove_WatermarkChanged : function(handler) {
        /// <summary>
        /// Removes a handler for the WatermarkChanged event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().removeHandler("WatermarkChanged", handler);
    },
    _raiseWatermarkChanged : function() {
        /// <summary>
        /// Raises the WatermarkChanged event
        /// </summary>
        var onWatermarkChangedHandler = this.get_events().getHandler("WatermarkChanged");
        if (onWatermarkChangedHandler) {
            onWatermarkChangedHandler(this, Sys.EventArgs.Empty);
        }
    }
}
AjaxControlToolkit.TextBoxWrapper.get_Wrapper = function(element) {
    /// <summary>
    /// Gets (creating one if necessary) the TextBoxWrapper for the specified TextBox
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// TextBox for which to get the wrapper
    /// </param>
    /// <returns type="AjaxControlToolkit.TextBoxWrapper">
    /// TextBoxWrapper instance
    /// </returns>
    if (null == element.AjaxControlToolkitTextBoxWrapper) {
        element.AjaxControlToolkitTextBoxWrapper = new AjaxControlToolkit.TextBoxWrapper(element);
    }
    return element.AjaxControlToolkitTextBoxWrapper;
}
AjaxControlToolkit.TextBoxWrapper.registerClass('AjaxControlToolkit.TextBoxWrapper', Sys.UI.Behavior);

AjaxControlToolkit.TextBoxWrapper.validatorGetValue = function(id) {
    /// <summary>
    /// Wrapper for ASP.NET's validatorGetValue to return the value from the wrapper if present
    /// </summary>
    /// <param name="id" type="String">
    /// id of the element
    /// </param>
    /// <returns type="Object">
    /// Value from the wrapper or result of original ValidatorGetValue
    /// </returns>
    var control = $get(id);
    if (control && control.AjaxControlToolkitTextBoxWrapper) {
        return control.AjaxControlToolkitTextBoxWrapper.get_Value();
    }
    return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(id);
}

// Wrap ASP.NET's ValidatorGetValue with AjaxControlToolkit.TextBoxWrapper.validatorGetValue
// to make validators work properly with watermarked TextBoxes
if (typeof(ValidatorGetValue) == 'function') {
    AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue = ValidatorGetValue;
    ValidatorGetValue = AjaxControlToolkit.TextBoxWrapper.validatorGetValue;
}


// Temporary fix null reference bug in Sys.CultureInfo._getAbbrMonthIndex
if (Sys.CultureInfo.prototype._getAbbrMonthIndex) {
    try {
        Sys.CultureInfo.prototype._getAbbrMonthIndex('');
    } catch(ex) {
        Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) {
            if (!this._upperAbbrMonths) {
                this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
            }
            return Array.indexOf(this._upperAbbrMonths, this._toUpper(value));
        }
        Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;
        Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;
    }
}

/* END AjaxControlToolkit.Common.Common.js */
/* START AjaxControlToolkit.Animation.Animations.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />
/// <reference path="../Compat/Timer/Timer.js" />
/// <reference path="../Common/Common.js" />


Type.registerNamespace('AjaxControlToolkit.Animation');

// Create an alias for the namespace to save 25 chars each time it's used since
// this is a very long script and will take awhile to download
var $AA = AjaxControlToolkit.Animation;

$AA.registerAnimation = function(name, type) {
    /// <summary>
    /// Register an animation with the AJAX Control Toolkit animation framework. This serves a dual purpose:
    /// 1) to add standard utility methods to the animation type (such as a <code>play</code> method that creates
    /// an animation, plays it, and disposes it when the animation is over), and 2) to associate a name with the
    /// type that will be used when creating animations from a JSON description.  This method can also be called
    /// by other animation libraries to seamlessly interoperate with the AJAX Control Toolkit's animation
    /// framework.
    /// </summary>
    /// <param name="name" type="String">
    /// Name of the animation that will be used as the XML tag name in the XML animation description.  It
    /// should be a valid XML tag (i.e. an alpha-numeric sequence with no spaces, special characters, etc.).
    /// </param>
    /// <param name="type" type="Type">
    /// The type of the new animation must inherit from <see cref="AjaxControlToolkit.Animation.Animation" />.
    /// </param>
    /// <returns />

    // Make sure the type inherits from AjaxControlToolkit.Animation.Animation
    if (type && ((type === $AA.Animation) || (type.inheritsFrom && type.inheritsFrom($AA.Animation)))) {
        // We'll store the animation name/type mapping in a "static" object off of
        // AjaxControlToolkit.Animation.  If this __animations object hasn't been
        // created yet, demand create it on the first registration.
        if (!$AA.__animations) {
            $AA.__animations = { };
        }
        
        // Add the current type to the collection of animations
        $AA.__animations[name.toLowerCase()] = type;
        
        // Add a play function that will make it very easy to create, play, and
        // dispose of an animation.  This is effectively a "static" function on
        // each animation and will take the same parameters as that animation's
        // constructor.
        type.play = function() {
            /// <summary>
            /// Create an animation, play it immediately, and dispose it when finished.
            /// </summary>
            /// <param parameterArray="true" elementType="Object">
            /// The play function takes the same parameters as the type's constructor
            /// </param>
            /// <returns />
        
            // Create and initialize a new animation of the right type and pass in
            // any arguments given to the play function
            var animation = new type();
            type.apply(animation, arguments);
            animation.initialize();
            
            // Add an event handler to dispose the animation when it's finished
            var handler = Function.createDelegate(animation,
                function() {
                    /// <summary>
                    /// Dispose the animation after playing
                    /// </summary>
                    /// <returns />
                    animation.remove_ended(handler);
                    handler = null;
                    animation.dispose();
                });
            animation.add_ended(handler);
            
            // Once the animation has been created and initialized, play it and
            // dispose it as soon as it's finished
            animation.play();            
        }
    } else {
        // Raise an error if someone registers an animation that doesn't inherit
        // from our base Animation class
        throw Error.argumentType('type', type, $AA.Animation, AjaxControlToolkit.Resources.Animation_InvalidBaseType);
    }
}

$AA.buildAnimation = function(json, defaultTarget) {
    /// <summary>
    /// The <code>buildAnimation</code> function is used to turn a JSON animation description
    /// into an actual animation object that can be played.
    /// </summary>
    /// <param name="json" type="String" mayBeNull="true">
    /// JSON description of the animation in the format expected by createAnimation
    /// </param>
    /// <param name="defaultTarget" type="Sys.UI.DomElement" mayBeNull="true" domElement="true">
    /// Target of the animation if none is specified in the JSON description.  The semantics of
    /// target assignment are provided in more detail in createAnimation.
    /// </param>
    /// <returns type="AjaxControlToolkit.Animation.Animation" mayBeNull="true">
    /// Animation created from the JSON description
    /// </returns>
    
    // Ensure we have a description to create an animation with
    if (!json || json === '') {
        return null;
    }

    // "Parse" the JSON so we can easily manipulate it
    // (we don't wrap it in a try/catch when debugging to raise any errors)
    var obj;
    json = '(' + json + ')';
    if (! Sys.Debug.isDebug) {
        try { obj = Sys.Serialization.JavaScriptSerializer.deserialize(json); } catch (ex) { } 
    } else {
        obj = Sys.Serialization.JavaScriptSerializer.deserialize(json);
    }
    
    // Create a new instance of the animation
    return $AA.createAnimation(obj, defaultTarget);    
}

$AA.createAnimation = function(obj, defaultTarget) {
    /// <summary>
    /// The <code>createAnimation</code> function builds a new
    /// <see cref="AjaxControlToolkit.Animation.Animation" /> instance from an object
    /// that describes it.
    /// </summary>
    /// <param name="obj" type="Object">
    /// The object provides a description of the animation to be be generated in
    /// a very specific format. It has two special properties: <code>AnimationName</code>
    /// and <code>AnimationChildren</code>.  The <code>AnimationName</code> is required
    /// and used to find the type of animation to create (this name should map to
    /// one of the animation names supplied to <code>registerAnimation</code>).  The
    /// <code>AnimationChildren</code> property supplies an optional array for
    /// animations that use child animations (such as
    /// <see cref="AjaxControlToolkit.Animation.ParallelAnimation" /> and
    /// <see cref="AjaxControlToolkit.Animation.SequenceAnimation" />). The elements of
    /// the <code>AnimationChildren</code> array are valid
    /// <see cref="AjaxControlToolkit.Animation.Animation" /> objects that meet these same
    /// requirements.  In order for an animation to support child animations, it must
    /// derive from the <see cref="AjaxControlToolkit.Animation.ParentAnimation" /> class
    /// which provides common methods like <code>add</code>, <code>clear</code>, etc. The
    /// remaining properties of the object are used to set parameters specific to the type
    /// of animation being created (e.g. <code>duration</code>, <code>minimumOpacity</code>,
    /// <code>startValue</code>, etc.) and should have a corresponding property on the
    /// animation.  You can also assign an arbitrary JavaScript expression to any property
    /// by adding 'Script' to the end of its name (i.e., Height="70" can be replaced by
    /// HeightScript="$get('myElement').offsetHeight") and have the property set to the
    /// result of evaluating the expression before the animation is played each time.
    /// </param>
    /// <param name="defaultTarget" type="Sys.UI.DomElement" mayBeNull="true" domElement="true">
    /// The function also takes a <code>defaultTarget</code> parameter that is used as the
    /// target of the animation if the object does not specify one.  This parameter should be
    /// an instance of <see cref="Sys.UI.DomElement" /> and not just the name of an element.
    /// </param>
    /// <returns type="AjaxControlToolkit.Animation.Animation">
    /// <see cref="AjaxControlToolkit.Animation.Animation" /> created from the description
    /// </returns>
    /// <remarks>
    /// Exceptions are thrown when the <code>AnimationName</code> cannot be found.  Also,
    /// any exceptions raised by setting properties or providing properties with invalid
    /// names will only be raised when debugging.
    /// </remarks>

    // Create a default instance of the animation by looking up the AnimationName
    // in the global __animations object.
    if (!obj || !obj.AnimationName) {
        throw Error.argument('obj', AjaxControlToolkit.Resources.Animation_MissingAnimationName);
    }
    var type = $AA.__animations[obj.AnimationName.toLowerCase()];
    if (!type) {
        throw Error.argument('type', String.format(AjaxControlToolkit.Resources.Animation_UknownAnimationName, obj.AnimationName));
    }
    var animation = new type();
    
    // Set the animation's target if provided via defaultTarget (note that setting
    // it via AnimationTarget will happen during the regular property setting phase)
    if (defaultTarget) {
        animation.set_target(defaultTarget);
    }
    
    // If there is an AnimationChildren array and the animation inherits from
    // ParentAnimation, then we will recusively build the child animations.  It is
    // important that we create the child animations before setting the animation's
    // properties or initializing (because some properties and initialization may be
    // propogated down from parent to child).
    if (obj.AnimationChildren && obj.AnimationChildren.length) {
        if ($AA.ParentAnimation.isInstanceOfType(animation)) {
            for (var i = 0; i < obj.AnimationChildren.length; i++) {
                var child = $AA.createAnimation(obj.AnimationChildren[i]);
                if (child) {
                    animation.add(child);
                }
            }
        } else {
            throw Error.argument('obj', String.format(AjaxControlToolkit.Resources.Animation_ChildrenNotAllowed, type.getName()));
        }
    }
    
    // Get the list of all properties available to set on the current animation's
    // type.  We create a mapping from the property's lowercase friendly name
    // (i.e., "duration") to the name of its setter (i.e., "set_duration").  This is
    // essentialy in setting properties so we only copy over valid values.
    var properties = type.__animationProperties;
    if (!properties) {
        // Get the properties for this type by walking its prototype - by doing
        // this we'll effectively ignore anything not defined in the prototype
        type.__animationProperties = { };
        type.resolveInheritance();
        for (var name in type.prototype) {
            if (name.startsWith('set_')) {
                type.__animationProperties[name.substr(4).toLowerCase()] = name;
            }
        }
        
        // Remove the 'id' property as it shouldn't be set by the animation
        // (NOTE: the 'target' proeprty shouldn't be set to a string value, but it
        // isn't removed because it can be used as a valid dynamic property - i.e.
        // Target="myElement" *DOES NOT WORK*, but it's OKAY to use
        // TargetScript="$get('myElement')".  Validation for this scenario will be
        // handled automatically by _validateParams when debugging as Target is required
        // to be a dom element.)
        delete type.__animationProperties['id'];
        properties = type.__animationProperties;
    }
    
    // Loop through each of the properties in the object and check if it's in the list
    // of valid property names.  We will check the type of the propertyName to make sure
    // it's a String (as other types can be added by the ASP.NET AJAX compatability
    // layers to all objects and cause errors if you don't exclude them).  We will first
    // try to set a property with the same name if it exists.  If we can't find one but
    // the name of the property ends in 'script', then we will try to set a corresponding
    // dynamic property.  If no matches can be found at all, we'll raise an error when
    // debugging.
    for (var property in obj) {
        // Ignore the special properties in the object that don't correspond
        // to any actual properties on the animation
        var prop = property.toLowerCase();
        if (prop == 'animationname' || prop == 'animationchildren') {
            continue;
        }
        
        var value = obj[property];
        
        // Try to directly set the value of this property
        var setter = properties[prop];
        if (setter && String.isInstanceOfType(setter) && animation[setter]) {
            // Ignore any exceptions raised by setting the property
            // unless we're debugging
            if (! Sys.Debug.isDebug) {
                try { animation[setter](value); } catch (ex) { }
            } else {
                animation[setter](value);
            }
        } else {
            // Try to set the value of a dynamic property
            if (prop.endsWith('script')) {
                setter = properties[prop.substr(0, property.length - 6)];
                if (setter && String.isInstanceOfType(setter) && animation[setter]) {
                    animation.DynamicProperties[setter] = value;
                } else if ( Sys.Debug.isDebug) {
                    // Raise an error when debugging if we could not find a matching property
                    throw Error.argument('obj', String.format(AjaxControlToolkit.Resources.Animation_NoDynamicPropertyFound, property, property.substr(0, property.length - 5)));
                }
            } else if ( Sys.Debug.isDebug) {
                // Raise an error when debugging if we could not find a matching property
                throw Error.argument('obj', String.format(AjaxControlToolkit.Resources.Animation_NoPropertyFound, property));
            }
        }
    }
    
    return animation;
}


// In the Xml comments for each of the animations below, there is a special <animation /> tag
// that describes how the animation is referenced from a generic XML animation description


$AA.Animation = function(target, duration, fps) {
    /// <summary>
    /// <code>Animation</code> is an abstract base class used as a starting point for all the other animations.
    /// It provides the basic mechanics for the animation (playing, pausing, stopping, timing, etc.)
    /// and leaves the actual animation to be done in the abstract methods <code>getAnimatedValue</code>
    /// and <code>setValue</code>.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <field name="DynamicProperties" type="Object">
    /// The DynamicProperties collection is used to associate JavaScript expressions with
    /// properties.  The expressions are evaluated just before the animation is played
    /// everytime (in the base onStart method).  The object itself maps strings with the
    /// names of property setters (like "set_verticalOffset") to JavaScript expressions
    /// (like "$find('MyBehavior').get_element().offsetHeight").  Note specifically that
    /// the dynamic properties are JavaScript expressions and not abitrary statements (i.e.
    /// you can't include things like "return foo;"), although you can include anything
    /// inside an anonymous function definition that you immediately invoke (i.e.,
    /// "(function() { return foo; })()").  A dynamic property can be set in the generic
    /// XML animation description by appending Script onto any legitimate property name
    /// (for example, instead of Height="70" we could use
    /// HeightScript="$find('MyBehavior').get_element().offsetHeight").  Any exceptions
    /// raised when setting dynamic properties (including both JavaScript evaluation errors
    /// and other exceptions raised by property setters) will only be propogated when
    /// debugging.
    /// </field>
    /// <remarks>
    /// Animations need to be as fast as possible - even in debug mode.  Don't add validation code to
    /// methods involved in every step of the animation.
    /// </remarks>
    /// <animation>Animation</animation>
    $AA.Animation.initializeBase(this);
    
    // Length of the animation in seconds
    this._duration = 1;
    
    // Number of steps per second
    this._fps = 25;
    
    // Target Sys.UI.DomElement of the animation
    this._target = null;
    
    // Tick event handler
    this._tickHandler = null;
    
    // Animation timer
    this._timer = null;
    
    // Percentage of the animation already played
    this._percentComplete = 0;
    
    // Percentage of the animation to play on each step
    this._percentDelta = null;
    
    // Reference to the animation that owns this animation (currently only set in 
    // ParallelAnimation.add).  This concept of ownership allows an entire animation
    // subtree to be driven off a single timer so all the operations are properly
    // synchronized.
    this._owner = null;
    
    // Reference to the animation that contains this as a child (this is set
    // in ParentAnimation.add).  The primary use of the parent animation is in
    // resolving the animation target when one isn't specified.
    this._parentAnimation = null;
    
    // The DynamicProperties collection is used to associate JavaScript expressions with
    // properties.  The expressions are evaluated just before the animation is played
    // everytime (in the base onStart method).  See the additional information in the
    // XML <field> comment above.
    this.DynamicProperties = { };
    
    // Set the target, duration, and fps if they were provided in the constructor
    if (target) {
        this.set_target(target);
    }
    if (duration) {
        this.set_duration(duration);
    }
    if (fps) { 
        this.set_fps(fps);
    }
}
$AA.Animation.prototype = {
    dispose : function() {
        /// <summary>
        /// Dispose the animation
        /// </summary>
        /// <returns />
        
        if (this._timer) {
            this._timer.dispose();
            this._timer = null;
        }
        
        this._tickHandler = null;
        this._target = null;
        
        $AA.Animation.callBaseMethod(this, 'dispose');
    },
    
    play : function() {
        /// <summary>
        /// Play the animation from the beginning or where it was left off when paused.
        /// </summary>
        /// <returns />
        /// <remarks>
        /// If this animation is the child of another, you must call <code>play</code> on its parent instead.
        /// </remarks>
        
        // If ownership of this animation has been claimed, then we'll require the parent to
        // handle playing the animation (this is very important because then the entire animation
        // tree runs on the same timer and updates consistently)
        if (!this._owner) {
            var resume = true;
            if (!this._timer) {
                resume = false;
                
                if (!this._tickHandler) {
                    this._tickHandler = Function.createDelegate(this, this._onTimerTick);
                }

                this._timer = new Sys.Timer();
                this._timer.add_tick(this._tickHandler);
               
                this.onStart();
                
                this._timer.set_interval(1000 / this._fps);
                this._percentDelta = 100 / (this._duration * this._fps);
                this._updatePercentComplete(0, true);
            }

            this._timer.set_enabled(true);
            
            this.raisePropertyChanged('isPlaying');
            if (!resume) {
                this.raisePropertyChanged('isActive');
            }
        }
    },
    
    pause : function() {
        /// <summary>
        /// Pause the animation if it is playing.  Calling <code>play</code> will resume where
        /// the animation left off.
        /// </summary>
        /// <returns />
        /// <remarks>
        /// If this animation is the child of another, you must call <code>pause</code> on its parent instead.
        /// </remarks>
        
        if (!this._owner) {
            if (this._timer) {
                this._timer.set_enabled(false);
                
                this.raisePropertyChanged('isPlaying');
            }
        }
    },
    
    stop : function(finish) {
        /// <summary>
        /// Stop playing the animation.
        /// </summary>
        /// <param name="finish" type="Boolean" mayBeNull="true" optional="true">
        /// Whether or not stopping the animation should leave the target element in a state
        /// consistent with the animation playing completely by performing the last step.
        /// The default value is true.
        /// </param>
        /// <returns />
        /// <remarks>
        /// If this animation is the child of another, you must call <code>stop</code> on
        /// its parent instead.
        /// </remarks>
        
        if (!this._owner) {
            var t = this._timer;
            this._timer = null;
            if (t) {
                t.dispose();
                
                if (this._percentComplete !== 100) {
                    this._percentComplete = 100;
                    this.raisePropertyChanged('percentComplete');
                    if (finish || finish === undefined) {
                        this.onStep(100);
                    }
                }
                this.onEnd();
                
                this.raisePropertyChanged('isPlaying');
                this.raisePropertyChanged('isActive');
            }
        }
    },
    
    onStart : function() {
        /// <summary>
        /// The <code>onStart</code> method is called just before the animation is played each time.
        /// </summary>
        /// <returns />
        
        this.raiseStarted();
        
        // Initialize any dynamic properties
        for (var property in this.DynamicProperties) {
            try {
                // Invoke the property's setter on the evaluated expression
                this[property](eval(this.DynamicProperties[property]));
            } catch(ex) {
                // Propogate any exceptions if we're debugging, otherwise eat them
                if ( Sys.Debug.isDebug) {
                    throw ex;
                }
            }
        }
    },
    
    onStep : function(percentage) {
        /// <summary>
        /// The <code>onStep</code> method is called repeatedly to progress the animation through each frame
        /// </summary>
        /// <param name="percentage" type="Number">Percentage of the animation already complete</param>
        /// <returns />
        
        this.setValue(this.getAnimatedValue(percentage));
    },
    
    onEnd : function() {
        /// <summary>
        /// The <code>onEnd</code> method is called just after the animation is played each time.
        /// </summary>
        /// <returns />
        
        this.raiseEnded();
    },
    
    getAnimatedValue : function(percentage) {
        /// <summary>
        /// Determine the state of the animation after the given percentage of its duration has elapsed
        /// </summary>
        /// <param name="percentage" type="Number">Percentage of the animation already complete</param>
        /// <returns type="Object">
        /// State of the animation after the given percentage of its duration has elapsed that will
        /// be passed to <code>setValue</code>
        /// </returns>
        throw Error.notImplemented();
    },
    
    setValue : function(value) {
        /// <summary>
        /// Set the current state of the animation
        /// </summary>
        /// <param name="value" type="Object">Current state of the animation (as retreived from <code>getAnimatedValue</code>)</param>
        /// <returns />
        throw Error.notImplemented();
    },
    
    interpolate : function(start, end, percentage) {
        /// <summary>
        /// The <code>interpolate</code> function is used to find the appropriate value between starting and
        /// ending values given the current percentage.
        /// </summary>
        /// <param name="start" type="Number">
        /// Start of the range to interpolate
        /// </param>
        /// <param name="end" type="Number">
        /// End of the range to interpolate
        /// </param>
        /// <param name="percentage" type="Number">
        /// Percentage completed in the range to interpolate
        /// </param>
        /// <returns type="Number">
        /// Value the desired percentage between the start and end values
        /// </returns>
        /// <remarks>
        /// In the future, we hope to make several implementations of this available so we can dynamically
        /// change the apparent speed of the animations, although it may make more sense to modify the
        /// <code>_updatePercentComplete</code> function instead.
        /// </remarks>
        return start + (end - start) * (percentage / 100);
    },
    
    _onTimerTick : function() {
        /// <summary>
        /// Handler for the tick event to move the animation along through its duration
        /// </summary>
        /// <returns />
        this._updatePercentComplete(this._percentComplete + this._percentDelta, true);
    },
    
    _updatePercentComplete : function(percentComplete, animate) {
        /// <summary>
        /// Update the animation and its target given the current percentage of its duration that
        /// has already elapsed
        /// </summary>
        /// <param name="percentComplete" type="Number">
        /// Percentage of the animation duration that has already elapsed
        /// </param>
        /// <param name="animate" type="Boolean" mayBeNull="true" optional="true">
        /// Whether or not updating the animation should visually modify the animation's target
        /// </param>
        /// <returns />
        
        if (percentComplete > 100) {
            percentComplete = 100;
        }
        
        this._percentComplete = percentComplete;
        this.raisePropertyChanged('percentComplete');
        
        if (animate) {
            this.onStep(percentComplete);
        }
        
        if (percentComplete === 100) {
            this.stop(false);
        }
    },
    
    setOwner : function(owner) {
        /// <summary>
        /// Make this animation the child of another animation
        /// </summary>
        /// <param name="owner" type="AjaxControlToolkit.Animation.Animation">
        /// Parent animation
        /// </param>
        /// <returns />
        this._owner = owner;
    },
    
    raiseStarted : function() {
        /// <summary>
        /// Raise the <code>started</code> event
        /// </summary>
        /// <returns />
        var handlers = this.get_events().getHandler('started');
        if (handlers) {
            handlers(this, Sys.EventArgs.Empty);
        }
    },
    
    add_started : function(handler) {
        /// <summary>
        /// Adds an event handler for the <code>started</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to add to the event.
        /// </param>
        /// <returns />
        this.get_events().addHandler("started", handler);
    },
    
    remove_started : function(handler) {
        /// <summary>
        /// Removes an event handler for the <code>started</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to remove from the event.
        /// </param>
        /// <returns />
        this.get_events().removeHandler("started", handler);
    },
    
    raiseEnded : function() {
        /// <summary>
        /// Raise the <code>ended</code> event
        /// </summary>
        /// <returns />
        var handlers = this.get_events().getHandler('ended');
        if (handlers) {
            handlers(this, Sys.EventArgs.Empty);
        }
    },
    
    add_ended : function(handler) {
        /// <summary>
        /// Adds an event handler for the <code>ended</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to add to the event.
        /// </param>
        /// <returns />
        this.get_events().addHandler("ended", handler);
    },
    
    remove_ended : function(handler) {
        /// <summary>
        /// Removes an event handler for the <code>ended</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to remove from the event.
        /// </param>
        /// <returns />
        this.get_events().removeHandler("ended", handler);
    },
    
    get_target : function() {
        /// <value type="Sys.UI.DomElement" domElement="true" mayBeNull="true">
        /// Target of the animation.  If the target of this animation is null and
        /// the animation has a parent, then it will recursively use the target of
        /// the parent animation instead.
        /// </value>
        /// <remarks>
        /// Do not set this property in a generic Xml animation description. It should be set
        /// using either the extender's TargetControlID or the AnimationTarget property (the latter
        /// maps to AjaxControlToolkit.Animation.set_animationTarget).  The only valid way to
        /// set this property in the generic Xml animation description is to use the dynamic
        /// property TargetScript="$get('myElement')".
        /// <remarks>
        if (!this._target && this._parentAnimation) {
            return this._parentAnimation.get_target();
        }
        return this._target;
    },
    set_target : function(value) {
        if (this._target != value) {
            this._target = value;
            this.raisePropertyChanged('target');
        }
    },
    
    set_animationTarget : function(id) {
        /// <value type="string" mayBeNull="false">
        /// ID of a Sys.UI.DomElement or Sys.UI.Control to use as the target of the animation
        /// </value>
        /// <remarks>
        /// If no Sys.UI.DomElement or Sys.UI.Control can be found for the given ID, an
        /// argument exception will be thrown.
        /// <remarks>
        
        // Try to find a Sys.UI.DomElement
        var target = null;
        var element = $get(id);
        if (element) {
            target = element;
        } else {
            // Try to find the control in the AJAX controls collection
            var ctrl = $find(id);
            if (ctrl) {
                element = ctrl.get_element();
                if (element) {
                    target = element;
                }
            }
        }
        
        // Use the new target if we have one, or raise an error if not
        if (target) { 
            this.set_target(target);
        } else {
            throw Error.argument('id', String.format(AjaxControlToolkit.Resources.Animation_TargetNotFound, id));
        }
    },
    
    get_duration : function() {
        /// <value type="Number">
        /// Length of the animation in seconds.  The default is 1.
        /// </value>
        return this._duration;
    },
    set_duration : function(value) {
        value = this._getFloat(value);
        if (this._duration != value) {
            this._duration = value;
            this.raisePropertyChanged('duration');
        }
    },
    
    get_fps : function() {
        /// <value type="Number" integer="true">
        /// Number of steps per second.  The default is 25.
        /// </value>
        return this._fps;
    },
    set_fps : function(value) {
        value = this._getInteger(value);
        if (this.fps != value) {
            this._fps = value;
            this.raisePropertyChanged('fps');
        }
    },
    
    get_isActive : function() {
        /// <value type="Boolean">
        /// <code>true</code> if animation is active, <code>false</code> if not.
        /// </value>
        return (this._timer !== null);
    },
    
    get_isPlaying : function() {
        /// <value type="Boolean">
        /// <code>true</code> if animation is playing, <code>false</code> if not.
        /// </value>
        return (this._timer !== null) && this._timer.get_enabled();
    },
    
    get_percentComplete : function() {
        /// <value type="Number">
        /// Percentage of the animation already played.
        /// </value>
        return this._percentComplete;
    },
    
    _getBoolean : function(value) {
        /// <summary>
        /// Helper to convert strings to booleans for property setters
        /// </summary>
        /// <param name="value" type="Object">
        /// Value to convert if it's a string
        /// </param>
        /// <returns type="Object">
        /// Value that has been converted if it was a string
        /// </returns>
        if (String.isInstanceOfType(value)) {
            return Boolean.parse(value);
        }
        return value;
    },
    
    _getInteger : function(value) {
        /// <summary>
        /// Helper to convert strings to integers for property setters
        /// </summary>
        /// <param name="value" type="Object">Value to convert if it's a string</param>
        /// <returns type="Object">Value that has been converted if it was a string</returns>
        if (String.isInstanceOfType(value)) {
            return parseInt(value);
        }
        return value;
    },
    
    _getFloat : function(value) {
        /// <summary>
        /// Helper to convert strings to floats for property setters
        /// </summary>
        /// <param name="value" type="Object">Value to convert if it's a string</param>
        /// <returns type="Object">Value that has been converted if it was a string</returns>
        if (String.isInstanceOfType(value)) {
            return parseFloat(value);
        }
        return value;
    },
    
    _getEnum : function(value, type) {
        /// <summary>
        /// Helper to convert strings to enum values for property setters
        /// </summary>
        /// <param name="value" type="Object">Value to convert if it's a string</param>
        /// <param name="type" type="Type">Type of the enum to convert to</param>
        /// <returns type="Object">Value that has been converted if it was a string</returns>
        if (String.isInstanceOfType(value) && type && type.parse) {
            return type.parse(value);
        }
        return value;
    }
}
$AA.Animation.registerClass('AjaxControlToolkit.Animation.Animation', Sys.Component);
$AA.registerAnimation('animation', $AA.Animation);


$AA.ParentAnimation = function(target, duration, fps, animations) {
    /// <summary>
    /// The <code>ParentAnimation</code> serves as a base class for all animations that contain children (such as
    /// <see cref="AjaxControlToolkit.Animation.ParallelAnimation" />, <see cref="AjaxControlToolkit.SequenceAnimation" />,
    /// etc.).  It does not actually play the animations, so any classes that inherit from it must do so.  Any animation
    /// that requires nested child animations must inherit from this class, although it will likely want to inherit off of
    /// <see cref="AjaxControlToolkit.Animation.ParallelAnimation" /> or <see cref="AjaxControlToolkit.SequenceAnimation" />
    /// which will actually play their child animations.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="animations" mayBeNull="true" optional="true" parameterArray="true" elementType="AjaxControlToolkit.Animation.Animation">
    /// Array of child animations to be played
    /// </param>
    /// <animation>Parent</animation>
    $AA.ParentAnimation.initializeBase(this, [target, duration, fps]);
    
    // Array of child animations (there are no assumptions placed on order because
    // it will matter for some derived animations like SequenceAnimation, but not
    // for others like ParallelAnimation) that is demand created in add
    this._animations = [];
    
    // Add any child animations passed into the constructor
    if (animations && animations.length) {
        for (var i = 0; i < animations.length; i++) {
            this.add(animations[i]);
        }
    }
}
$AA.ParentAnimation.prototype = {
    initialize : function() {
    	/// <summary>
        /// Initialize the parent along with any child animations that have not yet been initialized themselves
    	/// </summary>
    	/// <returns />
        $AA.ParentAnimation.callBaseMethod(this, 'initialize');
        
        // Initialize all the uninitialized child animations
        if (this._animations) {
            for (var i = 0; i < this._animations.length; i++) {
                var animation = this._animations[i];
                if (animation && !animation.get_isInitialized) {
                    animation.initialize();
                }
            }
        }
    },
    
    dispose : function() {
    	/// <summary>
        /// Dispose of the child animations
    	/// </summary>
    	/// <returns />

        this.clear();
        this._animations = null;
        $AA.ParentAnimation.callBaseMethod(this, 'dispose');
    },
    
    get_animations : function() {
    	/// <value elementType="AjaxControlToolkit.Animation.Animation">
        /// Array of child animations to be played (there are no assumptions placed on order because it will matter for some
        /// derived animations like <see cref="AjaxControlToolkit.Animation.SequenceAnimation" />, but not for
        /// others like <see cref="AjaxControlToolkit.Animation.ParallelAnimation" />).  To manipulate the child
        /// animations, use the functions <code>add</code>, <code>clear</code>, <code>remove</code>, and <code>removeAt</code>.
    	/// </value>
        return this._animations;
    },
    
    add : function(animation) {
    	/// <summary>
        /// Add an animation as a child of this animation.
    	/// </summary>
    	/// <param name="animation" type="AjaxControlToolkit.Animation.Animation">Child animation to add</param>
    	/// <returns />

        if (this._animations) {
            if (animation) {
                animation._parentAnimation = this;
            }
            Array.add(this._animations, animation);
            this.raisePropertyChanged('animations');
        }
    },
    
    remove : function(animation) {
        /// <summary>
        /// Remove the animation from the array of child animations.
        /// </summary>
        /// <param name="animation" type="AjaxControlToolkit.Animation.Animation">
        /// Child animation to remove
        /// </param>
        /// <returns />
        /// <remarks>
        /// This will dispose the removed animation.
        /// </remarks>

        if (this._animations) {
            if (animation) {
                animation.dispose();
            }
            Array.remove(this._animations, animation);
            this.raisePropertyChanged('animations');
        }
    },
    
    removeAt : function(index) {
        /// <summary>
        /// Remove the animation at a given index from the array of child animations.
        /// </summary>
        /// <param name="index" type="Number" integer="true">
        /// Index of the child animation to remove
        /// </param>
        /// <returns />
        
        if (this._animations) {
            var animation = this._animations[index];
            if (animation) {
                animation.dispose();
            }
            Array.removeAt(this._animations, index);
            this.raisePropertyChanged('animations');
        }
    },
    
    clear : function() {
    	/// <summary>
        /// Clear the array of child animations.
    	/// </summary>
    	/// <remarks>
    	/// This will dispose the cleared child animations.
    	/// </remarks>
    	/// <returns />

        if (this._animations) {
            for (var i = this._animations.length - 1; i >= 0; i--) {
                this._animations[i].dispose();
                this._animations[i] = null;
            }
            Array.clear(this._animations);
            this._animations = [];
            this.raisePropertyChanged('animations');
        }
    }
}
$AA.ParentAnimation.registerClass('AjaxControlToolkit.Animation.ParentAnimation', $AA.Animation);
$AA.registerAnimation('parent', $AA.ParentAnimation);


$AA.ParallelAnimation = function(target, duration, fps, animations) {
    /// <summary>
    /// The <code>ParallelAnimation</code> plays several animations simultaneously.  It inherits from
    /// <see cref="AjaxControlToolkit.Animation.ParentAnimation" />, but makes itself the owner of all
    /// its child animations to allow the use a single timer and syncrhonization mechanisms shared with
    /// all the children (in other words, the <code>duration</code> properties of any child animations
    /// are ignored in favor of the parent's <code>duration</code>).  It is very useful in creating
    /// sophisticated effects through combination of simpler animations.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="animations" mayBeNull="true" optional="true" parameterArray="true" elementType="AjaxControlToolkit.Animation.Animation">
    /// Array of child animations
    /// </param>
    /// <animation>Parallel</animation>
    $AA.ParallelAnimation.initializeBase(this, [target, duration, fps, animations]);
}
$AA.ParallelAnimation.prototype = {
    add : function(animation) {
    	/// <summary>
        /// Add an animation as a child of this animation and make ourselves its owner.
    	/// </summary>
    	/// <param name="animation" type="AjaxControlToolkit.Animation.Animation">Child animation to add</param>
    	/// <returns />
        $AA.ParallelAnimation.callBaseMethod(this, 'add', [animation]);
        animation.setOwner(this);
    },
    
    onStart : function() {
        /// <summary>
        /// Get the child animations ready to play
        /// </summary>
        /// <returns />

        $AA.ParallelAnimation.callBaseMethod(this, 'onStart');
        var animations = this.get_animations();
        for (var i = 0; i < animations.length; i++) {
            animations[i].onStart();
        }
    },
    
    onStep : function(percentage) {
        /// <summary>
        /// Progress the child animations through each frame
        /// </summary>
        /// <param name="percentage" type="Number">
        /// Percentage of the animation already complete
        /// </param>
        /// <returns />

        var animations = this.get_animations();
        for (var i = 0; i < animations.length; i++) {
            animations[i].onStep(percentage);
        }
    },
    
    onEnd : function() {
        /// <summary>
        /// Finish playing all of the child animations
        /// </summary>
        /// <returns />

        var animations = this.get_animations();
        for (var i = 0; i < animations.length; i++) {
            animations[i].onEnd();
        }
        $AA.ParallelAnimation.callBaseMethod(this, 'onEnd');
    }
}
$AA.ParallelAnimation.registerClass('AjaxControlToolkit.Animation.ParallelAnimation', $AA.ParentAnimation);
$AA.registerAnimation('parallel', $AA.ParallelAnimation);


$AA.SequenceAnimation = function(target, duration, fps, animations, iterations) {
    /// <summary>
    /// The <code>SequenceAnimation</code> runs several animations one after the other.  It can also
    /// repeat the sequence of animations for a specified number of iterations (which defaults to a
    /// single iteration, but will repeat forever if you specify zero or less iterations).  Also, the
    /// <code>SequenceAnimation</code> cannot be a child of a <see cref="AjaxControlToolkit.Animation.ParallelAnimation" />
    /// (or any animation inheriting from it).
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="animations" mayBeNull="true" optional="true" parameterArray="true" elementType="AjaxControlToolkit.Animation.Animation">
    /// Array of child animations
    /// </param>
    /// <param name="iterations" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of times to repeatedly play the sequence.  If zero or less iterations are specified, the sequence
    /// will repeat forever.  The default value is 1 iteration.
    /// </param>
    /// <remarks>
    /// The <code>SequenceAnimation</code> ignores the <code>duration</code> and <code>fps</code>
    /// properties, and will let each of its child animations use any settings they please.
    /// </remarks>
    /// <animation>Sequence</animation>
    $AA.SequenceAnimation.initializeBase(this, [target, duration, fps, animations]);

    // Handler used to determine when an animation has finished
    this._handler = null;
    
    // Flags to note whether we're playing, paused, or stopped
    this._paused = false;
    this._playing = false;
    
    // Index of the currently executing animation in the sequence
    this._index = 0;
    
    // Counter used when playing the animation to determine the remaining number of times to play the entire sequence
    this._remainingIterations = 0;
    
    // Number of iterations
    this._iterations = (iterations !== undefined) ? iterations : 1;
}
$AA.SequenceAnimation.prototype = {
    dispose : function() {
    	/// <summary>
        /// Dispose the animation
        /// </summary>
        /// <returns />
        this._handler = null;
        $AA.SequenceAnimation.callBaseMethod(this, 'dispose');
    },
    
    stop : function() {
        /// <summary>
        /// Stop playing the entire sequence of animations
        /// </summary>
        /// <returns />
        /// <remarks>
        /// Stopping this animation will perform the last step of each child animation, thereby leaving their
        /// target elements in a state consistent with the animation playing completely. If this animation is
        /// the child of another, you must call <code>stop</code> on its parent instead.
        /// </remarks>

        if (this._playing) {
            var animations = this.get_animations();
            if (this._index < animations.length) {
                // Remove the handler from the currently running animation
                animations[this._index].remove_ended(this._handler);
                // Call stop on all remaining animations to ensure their
                // effects will be seen
                for (var i = this._index; i < animations.length; i++) {
                    animations[i].stop();
                }
            }
            this._playing = false;
            this._paused = false;
            this.raisePropertyChanged('isPlaying');
            this.onEnd();
        }
    },
    
    pause : function() {
        /// <summary>
        /// Pause the animation if it is playing.  Calling <code>play</code> will resume where
        /// the animation left off.
        /// </summary>
        /// <returns />
        /// <remarks>
        /// If this animation is the child of another, you must call <code>pause</code> on its parent instead.
        /// </remarks>

        if (this.get_isPlaying()) {
            var current = this.get_animations()[this._index];
            if (current != null) {
                current.pause();
            }
            this._paused = true;
            this.raisePropertyChanged('isPlaying');
        }
    },
    
    play : function() {
        /// <summary>
        /// Play the sequence of animations from the beginning or where it was left off when paused
        /// </summary>
        /// <returns />
        /// <remarks>
        /// If this animation is the child of another, you must call <code>play</code> on its parent instead
        /// </remarks>

        var animations = this.get_animations();
        if (!this._playing) {
            this._playing = true;
            if (this._paused) {
                this._paused = false;
                var current = animations[this._index];
                if (current != null) {
                    current.play();
                    this.raisePropertyChanged('isPlaying');
                }
            } else {
                this.onStart();
                // Reset the index and attach the handler to the first
                this._index = 0;
                var first = animations[this._index];
                if (first) {
                    first.add_ended(this._handler);
                    first.play();
                    this.raisePropertyChanged('isPlaying');
                } else {
                    this.stop();
                }
            }
        }
    },
    
    onStart : function() {
        /// <summary>
        /// The <code>onStart</code> method is called just before the animation is played each time
        /// </summary>
        /// <returns />
        $AA.SequenceAnimation.callBaseMethod(this, 'onStart');
        this._remainingIterations = this._iterations - 1;
        
        // Create the handler we attach to each animation as it plays to determine when we've finished with it
        if (!this._handler) {
            this._handler = Function.createDelegate(this, this._onEndAnimation);
        }
    },
    
    _onEndAnimation : function() {
    	/// <summary>
        /// Wait for the end of each animation, and then continue by playing the other animations remaining
        /// in the sequence.  Stop when it reaches the last animation and there are no remaining iterations.
    	/// </summary>
    	/// <returns />

        // Remove the handler from the current animation
        var animations = this.get_animations();
        var current = animations[this._index++];
        if (current) {
            current.remove_ended(this._handler);
        }
        
        // Keep running animations and stop when we're out
        if (this._index < animations.length) {
            var next = animations[this._index];
            next.add_ended(this._handler);
            next.play();
        } else if (this._remainingIterations >= 1 || this._iterations <= 0) {
            this._remainingIterations--;
            this._index = 0;
            var first = animations[0];
            first.add_ended(this._handler);
            first.play();
        } else {
            this.stop();
        }
    },
    
    onStep : function(percentage) {
        /// <summary>
        /// Raises an invalid operation exception because this will only be called if a <code>SequenceAnimation</code>
        /// has been nested inside an <see cref="AjaxControlToolkit.Animation.ParallelAnimation" /> (or a derived type).
        /// </summary>
        /// <param name="percentage" type="Number">Percentage of the animation already complete</param>
        /// <returns />
        throw Error.invalidOperation(AjaxControlToolkit.Resources.Animation_CannotNestSequence);
    },
    
    onEnd : function() {
        /// <summary>
        /// The <code>onEnd</code> method is called just after the animation is played each time.
        /// </summary>
        /// <returns />
        this._remainingIterations = 0;
        $AA.SequenceAnimation.callBaseMethod(this, 'onEnd');
    },
    
    get_isActive : function() {
    	/// <value type="Boolean">
        /// <code>true</code> if animation is active, <code>false</code> if not.
        /// </value>
        return true;
    },
    
    get_isPlaying : function() {
    	/// <value type="Boolean">
        /// <code>true</code> if animation is playing, <code>false</code> if not.
        /// </value>
        return this._playing && !this._paused;
    },
    
    get_iterations : function() {
        /// <value type="Number" integer="true">
        /// Number of times to repeatedly play the sequence.  If zero or less iterations are specified, the sequence
        /// will repeat forever.  The default value is 1 iteration.
        /// </value>
        return this._iterations;
    },
    set_iterations : function(value) {
        value = this._getInteger(value);
        if (this._iterations != value) {
            this._iterations = value;
            this.raisePropertyChanged('iterations');
        }
    },
    
    get_isInfinite : function() {
    	/// <value type="Boolean">
        /// <code>true</code> if this animation will repeat forever, <code>false</code> otherwise.
    	/// </value>
        return this._iterations <= 0;
    }
}
$AA.SequenceAnimation.registerClass('AjaxControlToolkit.Animation.SequenceAnimation', $AA.ParentAnimation);
$AA.registerAnimation('sequence', $AA.SequenceAnimation);


$AA.SelectionAnimation = function(target, duration, fps, animations) {
    /// <summary>
    /// The <code>SelectionAnimation</code> will run a single animation chosen from of its child animations. It is
    /// important to note that the <code>SelectionAnimation</code> ignores the <code>duration</code> and <code>fps</code>
    /// properties, and will let each of its child animations use any settings they please.  This is a base class with no
    /// functional implementation, so consider using <see cref="AjaxControlToolkit.Animation.ConditionAnimation" /> or
    /// <see cref="AjaxControlToolkit.Animation.CaseAnimation" /> instead.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="animations" mayBeNull="true" optional="true" parameterArray="true" elementType="AjaxControlToolkit.Animation.Animation">
    /// Array of child animations
    /// </param>
    /// <animation>Selection</animation>
    $AA.SelectionAnimation.initializeBase(this, [target, duration, fps, animations]);
    
    // Index of the animation selected to play
    this._selectedIndex = -1;
    
    // Reference to the animation selected to play
    this._selected = null;
}
$AA.SelectionAnimation.prototype = {    
    getSelectedIndex : function() {
        /// <summary>
        /// Get the index of the animation that is selected to be played.  If this returns an index outside the bounds of
        /// the child animations array, then nothing is played.
        /// </summary>
        /// <returns type="Number" integer="true">
        /// Index of the selected child animation to play
        /// </returns>
        throw Error.notImplemented();
    },
    
    onStart : function() {
    	/// <summary>
        /// The <code>onStart</code> method is called just before the animation is played each time.
        /// </summary>
        /// <returns />
	    $AA.SelectionAnimation.callBaseMethod(this, 'onStart');
	    
	    var animations = this.get_animations();
	    this._selectedIndex = this.getSelectedIndex();
	    if (this._selectedIndex >= 0 && this._selectedIndex < animations.length) {
	        this._selected = animations[this._selectedIndex];
	        if (this._selected) {
	            this._selected.setOwner(this);
	            this._selected.onStart();
	        }
	    }
    },
    
    onStep : function(percentage) {
    	/// <summary>
        /// The <code>onStep</code> method is called repeatedly to progress the animation through each frame
        /// </summary>
        /// <param name="percentage" type="Number">Percentage of the animation already complete</param>
        /// <returns />

        if (this._selected) {
    	    this._selected.onStep(percentage);
    	}
    },
    
    onEnd : function() {
    	/// <summary>
        /// The <code>onEnd</code> method is called just after the animation is played each time.
        /// </summary>
        /// <returns />

        if (this._selected) {
    	    this._selected.onEnd();
    	    this._selected.setOwner(null);
    	}
    	this._selected = null;
    	this._selectedIndex = null;
	    $AA.SelectionAnimation.callBaseMethod(this, 'onEnd');
    }
}
$AA.SelectionAnimation.registerClass('AjaxControlToolkit.Animation.SelectionAnimation', $AA.ParentAnimation);
$AA.registerAnimation('selection', $AA.SelectionAnimation);


$AA.ConditionAnimation = function(target, duration, fps, animations, conditionScript) {
    /// <summary>
    /// The <code>ConditionAnimation</code> is used as a control structure to play a specific child animation
    /// depending on the result of executing the <code>conditionScript</code>.  If the <code>conditionScript</code>
    /// evaluates to <code>true</code>, the first child animation is played.  If it evaluates to <code>false</code>,
    /// the second child animation is played (although nothing is played if a second animation is not present).
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="animations" mayBeNull="true" optional="true" parameterArray="true" elementType="AjaxControlToolkit.Animation.Animation">
    /// Array of child animations
    /// </param>
    /// <param name="conditionScript" type="String" mayBeNull="true" optional="true">
    /// JavaScript that should evaluate to <code>true</code> or <code>false</code> to determine which child
    /// animation to play.
    /// </param>
    /// <animation>Condition</animation>
    $AA.ConditionAnimation.initializeBase(this, [target, duration, fps, animations]);
    
    // Condition to determine which index we will play
    this._conditionScript = conditionScript;   
}
$AA.ConditionAnimation.prototype = {    
   getSelectedIndex : function() {
       /// <summary>
       /// Get the index of the animation that is selected to be played.  If this returns an index outside the bounds of
       /// the child animations array, then nothing is played.
       /// </summary>
       /// <returns type="Number" integer="true">
       /// Index of the selected child animation to play
       /// </returns>

        var selected = -1;
        if (this._conditionScript && this._conditionScript.length > 0) {
            try {
                selected = eval(this._conditionScript) ? 0 : 1;
            } catch(ex) {
            }
        }
        return selected;
    },
    
    get_conditionScript : function() {
    	/// <value type="String">
        /// JavaScript that should evaluate to <code>true</code> or <code>false</code> to determine which
        /// child animation to play.
    	/// </value>
        return this._conditionScript;
    },
    set_conditionScript : function(value) {
        if (this._conditionScript != value) {
            this._conditionScript = value;
            this.raisePropertyChanged('conditionScript');
        }
    }
}
$AA.ConditionAnimation.registerClass('AjaxControlToolkit.Animation.ConditionAnimation', $AA.SelectionAnimation);
$AA.registerAnimation('condition', $AA.ConditionAnimation);


$AA.CaseAnimation = function(target, duration, fps, animations, selectScript) {
    /// <summary>
    /// The <code>CaseAnimation</code> is used as a control structure to play a specific child animation depending on
    /// the result of executing the <code>selectScript</code>, which should return the index of the child animation to
    /// play (this is similar to the <code>case</code> or <code>select</code> statements in C#/VB, etc.).  If the provided
    /// index is outside the bounds of the child animations array (or if nothing was returned) then we will not play anything.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="animations" mayBeNull="true" optional="true" parameterArray="true" elementType="AjaxControlToolkit.Animation.Animation">
    /// Array of child animations
    /// </param>
    /// <param name="selectScript" type="String" mayBeNull="true" optional="true">
    /// JavaScript that should evaluate to the index of the appropriate child animation to play.  If this returns an index outside the bounds of the child animations array, then nothing is played.
    /// </param>
    /// <animation>Case</animation>
    $AA.CaseAnimation.initializeBase(this, [target, duration, fps, animations]);

    // Condition to determine which index we will play
    this._selectScript = selectScript;
}
$AA.CaseAnimation.prototype = {
    getSelectedIndex : function() {
        /// <summary>
        /// Get the index of the animation that is selected to be played.  If this returns an index outside the bounds of
        /// the child animations array, then nothing is played.
        /// </summary>
        /// <returns type="Number" integer="true">
        /// Index of the selected child animation to play
        /// </returns>

        var selected = -1;
        if (this._selectScript && this._selectScript.length > 0) {
            try {
                var result = eval(this._selectScript)
                if (result !== undefined)
                    selected = result;
            } catch (ex) {
            }
        }
        return selected;
    },
    
    get_selectScript : function() {
        /// <value type="String">
        /// JavaScript that should evaluate to the index of the appropriate child animation to play.  If this returns an index outside the bounds of the child animations array, then nothing is played.
        /// </value>
        return this._selectScript;
    },
    set_selectScript : function(value) {
        if (this._selectScript != value) {
            this._selectScript = value;
            this.raisePropertyChanged('selectScript');
        }
    }
}
$AA.CaseAnimation.registerClass('AjaxControlToolkit.Animation.CaseAnimation', $AA.SelectionAnimation);
$AA.registerAnimation('case', $AA.CaseAnimation);


$AA.FadeEffect = function() {
    /// <summary>
    /// The FadeEffect enumeration determines whether a fade animation is used to fade in or fade out.
    /// </summary>
    /// <field name="FadeIn" type="Number" integer="true" />
    /// <field name="FadeOut" type="Number" integer="true" />
    throw Error.invalidOperation();
}
$AA.FadeEffect.prototype = {
    FadeIn : 0,
    FadeOut : 1
}
$AA.FadeEffect.registerEnum("AjaxControlToolkit.Animation.FadeEffect", false);


$AA.FadeAnimation = function(target, duration, fps, effect, minimumOpacity, maximumOpacity, forceLayoutInIE) {
    /// <summary>
    /// The <code>FadeAnimation</code> is used to fade an element in or out of view, depending on the
    /// provided <see cref="AjaxControlToolkit.Animation.FadeEffect" />, by settings its opacity.
    /// The minimum and maximum opacity values can be specified to precisely control the fade.
    /// You may also consider using <see cref="AjaxControlToolkit.Animation.FadeInAnimation" /> or
    /// <see cref="AjaxControlToolkit.Animation.FadeOutAnimation" /> if you know the only direction you
    /// are fading.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="effect" type="AjaxControlToolkit.Animation.FadeEffect" mayBeNull="true" optional="true">
    /// Determine whether to fade the element in or fade the element out.  The possible values are <code>FadeIn</code>
    /// and <code>FadeOut</code>.  The default value is <code>FadeOut</code>.
    /// </param>
    /// <param name="minimumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
    /// </param>
    /// <param name="maximumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
    /// </param>
    /// <param name="forceLayoutInIE" type="Boolean" mayBeNull="true" optional="true">
    /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
    /// background color (the latter is required in case the user has ClearType enabled). The default value is <code>true</code>.
    /// This is obviously ignored when working in other browsers.
    /// </param>
    /// <animation>Fade</animation>
    $AA.FadeAnimation.initializeBase(this, [target, duration, fps]);

    // The effect determines whether or not we fade in or out
    this._effect = (effect !== undefined) ? effect : $AA.FadeEffect.FadeIn;
    
    // Maximum and minimum opacities default to 100% and 0%
    this._max = (maximumOpacity !== undefined) ? maximumOpacity : 1;
    this._min = (minimumOpacity !== undefined) ? minimumOpacity : 0;
    
    // Starting and ending opacities
    this._start = this._min;
    this._end = this._max;
    
    // Whether the a layout has already been created (to work around IE problems)
    this._layoutCreated = false;

    // Whether or not we should force a layout to be created for IE by giving it a width
    // and setting its background color (the latter is required in case the user has ClearType enabled).
    // http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/alpha.asp
    this._forceLayoutInIE = (forceLayoutInIE === undefined || forceLayoutInIE === null) ? true : forceLayoutInIE;
    
    // Current target of the animation that is cached before the animation plays (since looking up
    // the target could mean walking all the way up to the root of the animation's tree, which we don't
    // want to do for every step of the animation)
    this._currentTarget = null;
    
    // Properly set up the min/max values provided by the constructor
    this._resetOpacities();
}
$AA.FadeAnimation.prototype = {
    _resetOpacities : function() {
    	/// <summary>
        /// Set the starting and ending opacity values based on the effect (i.e. when we're fading
        /// in we go from <code>_min</code> to <code>_max</code>, but we go <code>_max</code> to
        /// <code>_min</code> when fading out)
    	/// </summary>
    	/// <returns />

        if (this._effect == $AA.FadeEffect.FadeIn) {
            this._start = this._min;
            this._end = this._max;
        } else {
            this._start = this._max;
            this._end = this._min;
        }
    },
    
    _createLayout : function() {
    	/// <summary>
        /// Create a layout when using Internet Explorer (which entails setting a width and also
        /// a background color if it currently has neither)
    	/// </summary>
    	/// <returns />

        var element = this._currentTarget;
        if (element) {
            // Get the original width/height/back color
            var originalWidth = $common.getCurrentStyle(element, 'width');
            var originalHeight = $common.getCurrentStyle(element, 'height');
            var originalBackColor = $common.getCurrentStyle(element, 'backgroundColor');

            // Set the width which will force the creation of a layout
            if ((!originalWidth || originalWidth == '' || originalWidth == 'auto') &&
                (!originalHeight || originalHeight == '' || originalHeight == 'auto')) {
                element.style.width = element.offsetWidth + 'px';
            }
            
            // Set the back color to avoid ClearType problems
            if (!originalBackColor || originalBackColor == '' || originalBackColor == 'transparent' || originalBackColor == 'rgba(0, 0, 0, 0)') {
                element.style.backgroundColor = $common.getInheritedBackgroundColor(element);
            }
            
            // Mark that we've created the layout so we only do it once
            this._layoutCreated = true;
        }
    },
    
    onStart : function() {
    	/// <summary>
        /// The <code>onStart</code> method is called just before the animation is played each time.
        /// </summary>
        /// <returns />       
        $AA.FadeAnimation.callBaseMethod(this, 'onStart');
        
        this._currentTarget = this.get_target();
        this.setValue(this._start);
        
        // Force the creation of a layout in IE if we're supposed to and the current browser is Internet Explorer
        if (this._forceLayoutInIE && !this._layoutCreated && Sys.Browser.agent == Sys.Browser.InternetExplorer) {
            this._createLayout();
        }
    },
    
    getAnimatedValue : function(percentage) {
    	/// <summary>
        /// Determine the current opacity after the given percentage of its duration has elapsed
        /// </summary>
        /// <param name="percentage" type="Number">Percentage of the animation already complete</param>
        /// <returns type="Number">
        /// Current opacity after the given percentage of its duration has elapsed that will
        /// be passed to <code>setValue</code>
        /// </returns>
        return this.interpolate(this._start, this._end, percentage);
    },
    
    setValue : function(value) {
        /// <summary>
        /// Set the current opacity of the element.
        /// </summary>
        /// <param name="value" type="Number">
        /// Current opacity (as retreived from <code>getAnimatedValue</code>)
        /// </param>
        /// <returns />
        /// <remarks>
        /// This method will be replaced by a dynamically generated function that requires no logic
        /// to determine whether it should use filters or the style's opacity.
        /// </remarks>
        if (this._currentTarget) {
            $common.setElementOpacity(this._currentTarget, value);
        }
    },
    
//    set_target : function(value) {
//        /// <value type="Sys.UI.DomElement">
//        /// Override the <code>target</code> property to dynamically create the setValue function.
//        /// </value>
//        /// <remarks>
//        /// Do not set this property in a generic Xml animation description. It will be set automatically
//        /// using either the extender's TargetControlID or the AnimationTarget property.
//        /// <remarks>
//        $AA.FadeAnimation.callBaseMethod(this, 'set_target', [value]);
//        
//        var element = value;
//        if (element) {
//            var filters = element.filters;
//            if (filters) {
//                var alphaFilter = null;
//                if (filters.length !== 0) {
//                    alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
//                }
//                if (!alphaFilter) {
//                    element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (this._start * 100) + ')';
//                    alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
//                }
//                if (alphaFilter) {
//                    this.setValue = function(val) { alphaFilter.opacity = val * 100; }
//                } else {
//                    this.setValue = function(val) {
//                        element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (val * 100) + ')';
//                    };
//                }
//            }
//            else {
//                this.setValue = function(val) { element.style.opacity = val; };
//            }
//        }
//    },
    
    get_effect : function() {
    	/// <value type="AjaxControlToolkit.Animation.FadeEffect">
        /// Determine whether to fade the element in or fade the element out.  The possible values are
        /// <code>FadeIn</code> and <code>FadeOut</code>.  The default value is <code>FadeOut</code>.
    	/// </value>
        return this._effect;
    },
    set_effect : function(value) {
        value = this._getEnum(value, $AA.FadeEffect);
        if (this._effect != value) {
            this._effect = value;
            this._resetOpacities();
            this.raisePropertyChanged('effect');
        }
    },
    
    get_minimumOpacity : function() {
        /// <value type="Number">
        /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1.
        /// The default value is 0.
        /// </value>
	    return this._min;
    },
    set_minimumOpacity : function(value) {
        value = this._getFloat(value);
        if (this._min != value) {
            this._min = value;
            this._resetOpacities();
            this.raisePropertyChanged('minimumOpacity');
        }
    },
    
    get_maximumOpacity : function() {
        /// <value type="Number">
        /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1.
        /// The default value is 1.
        /// </value>
        return this._max;
    },
    set_maximumOpacity : function(value) {
        value = this._getFloat(value);
        if (this._max != value) {
            this._max = value;
            this._resetOpacities();
            this.raisePropertyChanged('maximumOpacity');
        }
    },
    
    get_forceLayoutInIE : function() {
        /// <value type="Boolean">
        /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
        /// background color (the latter is required in case the user has ClearType enabled). The default value is <code>true</code>.
        /// This is obviously ignored when working in other browsers.
        /// </value>
        return this._forceLayoutInIE;
    },
    set_forceLayoutInIE : function(value) {
        value = this._getBoolean(value);
        if (this._forceLayoutInIE != value) {
            this._forceLayoutInIE = value;
            this.raisePropertyChanged('forceLayoutInIE');
        }
    },
    
    set_startValue : function(value) {
        /// <value type="Number">
        /// Set the start value (so that child animations can set the current opacity as the start value when fading in or out)
        /// </value>
        value = this._getFloat(value);
        this._start = value;
    }
}
$AA.FadeAnimation.registerClass('AjaxControlToolkit.Animation.FadeAnimation', $AA.Animation);
$AA.registerAnimation('fade', $AA.FadeAnimation);


$AA.FadeInAnimation = function(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) {
    /// <summary>
    /// The <code>FadeInAnimation</code> will fade the target in by moving from hidden to visible.
    /// It starts the animation the target's current opacity.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="minimumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
    /// </param>
    /// <param name="maximumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
    /// </param>
    /// <param name="forceLayoutInIE" type="Boolean" mayBeNull="true" optional="true">
    /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
    /// background color (the latter is required in case the user has ClearType enabled). The default value is <code>true</code>.
    /// This is obviously ignored when working in other browsers.
    /// </param>
    /// <animation>FadeIn</animation>
    $AA.FadeInAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeIn, minimumOpacity, maximumOpacity, forceLayoutInIE]);
}
$AA.FadeInAnimation.prototype = {
    onStart : function() {
    	/// <summary>
        /// The <code>onStart</code> method is called just before the animation is played each time.
        /// </summary>
        /// <returns />
        $AA.FadeInAnimation.callBaseMethod(this, 'onStart');
        
        if (this._currentTarget) {
            this.set_startValue($common.getElementOpacity(this._currentTarget));
        }
    }
}
$AA.FadeInAnimation.registerClass('AjaxControlToolkit.Animation.FadeInAnimation', $AA.FadeAnimation);
$AA.registerAnimation('fadeIn', $AA.FadeInAnimation);


$AA.FadeOutAnimation = function(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) {
    /// <summary>
    /// The FadeInAnimation will fade the element out by moving from visible to hidden. It starts the animation
    /// at the element's current opacity.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="minimumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
    /// </param>
    /// <param name="maximumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
    /// </param>
    /// <param name="forceLayoutInIE" type="Boolean" mayBeNull="true" optional="true">
    /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
    /// background color (the latter is required in case the user has ClearType enabled). The default value is <code>true</code>.
    /// This is obviously ignored when working in other browsers.
    /// </param>
    /// <animation>FadeOut</animation>
    $AA.FadeOutAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeOut, minimumOpacity, maximumOpacity, forceLayoutInIE]);
}
$AA.FadeOutAnimation.prototype = {
    onStart : function() {
    	/// <summary>
        /// The <code>onStart</code> method is called just before the animation is played each time.
        /// </summary>
        /// <returns />
        $AA.FadeOutAnimation.callBaseMethod(this, 'onStart');

        if (this._currentTarget) {
            this.set_startValue($common.getElementOpacity(this._currentTarget));
        }
    }
}
$AA.FadeOutAnimation.registerClass('AjaxControlToolkit.Animation.FadeOutAnimation', $AA.FadeAnimation);
$AA.registerAnimation('fadeOut', $AA.FadeOutAnimation);


$AA.PulseAnimation = function(target, duration, fps, iterations, minimumOpacity, maximumOpacity, forceLayoutInIE) {
    /// <summary>
    /// The PulseAnimation fades an element in and our repeatedly to create a pulsating
    /// effect.  The iterations determines how many pulses there will be (which defaults
    /// to three, but it will repeat infinitely if given zero or less).  The duration
    /// property defines the duration of each fade in or fade out, not the duration of
    /// the animation as a whole.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="iterations" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of times to repeatedly play the sequence.  If zero or less iterations are specified, the sequence
    /// will repeat forever.  The default value is 1 iteration.
    /// </param>
    /// <param name="minimumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
    /// </param>
    /// <param name="maximumOpacity" type="Number" mayBeNull="true" optional="true">
    /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
    /// </param>
    /// <param name="forceLayoutInIE" type="Boolean" mayBeNull="true" optional="true">
    /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
    /// background color (the latter is required in case the user has ClearType enabled). The default value is <code>true</code>.
    /// This is obviously ignored when working in other browsers.
    /// </param>
    /// <animation>Pulse</animation>
    $AA.PulseAnimation.initializeBase(this, [target, duration, fps, null, ((iterations !== undefined) ? iterations : 3)]);

    // Create the FadeOutAnimation
    this._out = new $AA.FadeOutAnimation(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE);
    this.add(this._out);
    
    // Create the FadeInAnimation
    this._in = new $AA.FadeInAnimation(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE);
    this.add(this._in);
}
$AA.PulseAnimation.prototype = {
   
    get_minimumOpacity : function() {
        /// <value type="Number">
        /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
        /// </value>
        return this._out.get_minimumOpacity();
    },
    set_minimumOpacity : function(value) {
        value = this._getFloat(value);
        this._out.set_minimumOpacity(value);
        this._in.set_minimumOpacity(value);
        this.raisePropertyChanged('minimumOpacity');
    },
    
    get_maximumOpacity : function() {
        /// <value type="Number">
        /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
        /// </value>
        return this._out.get_maximumOpacity();
    },
    set_maximumOpacity : function(value) {
        value = this._getFloat(value);
        this._out.set_maximumOpacity(value);
        this._in.set_maximumOpacity(value);
        this.raisePropertyChanged('maximumOpacity');
    },
    
    get_forceLayoutInIE : function() {
        /// <value type="Boolean">
        /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
        /// background color (the latter is required in case the user has ClearType enabled). The default value is <code>true</code>.
        /// This is obviously ignored when working in other browsers.
        /// </value>
        return this._out.get_forceLayoutInIE();
    },
    set_forceLayoutInIE : function(value) {
        value = this._getBoolean(value);
        this._out.set_forceLayoutInIE(value);
        this._in.set_forceLayoutInIE(value);
        this.raisePropertyChanged('forceLayoutInIE');
    },
    
    set_duration : function(value) {
        /// <value type="Number">
        /// Override the <code>duration</code> property
        /// </value>
        value = this._getFloat(value);
        $AA.PulseAnimation.callBaseMethod(this, 'set_duration', [value]);
        this._in.set_duration(value);
        this._out.set_duration(value);
    },
    
    set_fps : function(value) {
        /// <value type="Number" integer="true">
        /// Override the <code>fps</code> property
        /// </value>
        value = this._getInteger(value);
        $AA.PulseAnimation.callBaseMethod(this, 'set_fps', [value]);
        this._in.set_fps(value);
        this._out.set_fps(value);
    }
    
}
$AA.PulseAnimation.registerClass('AjaxControlToolkit.Animation.PulseAnimation', $AA.SequenceAnimation);
$AA.registerAnimation('pulse', $AA.PulseAnimation);


$AA.PropertyAnimation = function(target, duration, fps, property, propertyKey) {
    /// <summary>
    /// The <code>PropertyAnimation</code> is a useful base animation that will assign the value from
    /// <code>getAnimatedValue</code> to a specified <code>property</code>. You can provide the name of
    /// a <code>property</code> alongside an optional <code>propertyKey</code> (which indicates the value
    /// <code>property[propertyKey]</code>, like <code>style['backgroundColor']</code>).
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="property" type="String" mayBeNull="true" optional="true">
    /// Property of the <code>target</code> element to set when animating
    /// </param>
    /// <param name="propertyKey" type="String" mayBeNull="true" optional="true">
    /// Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
    /// </param>
    /// <animation>Property</animation>
    $AA.PropertyAnimation.initializeBase(this, [target, duration, fps]);

    // Name of the property to set
    this._property = property;
    
    // Optional Key of the property to set (i.e., if the property were "style" then
    // this might be "backgroundColor")
    this._propertyKey = propertyKey;
    
    // Current target of the animation that is cached before the animation plays (since looking up
    // the target could mean walking all the way up to the root of the animation's tree, which we don't
    // want to do for every step of the animation)
    this._currentTarget = null;
}
$AA.PropertyAnimation.prototype = {
    onStart : function() {
    	/// <summary>
        /// The <code>onStart</code> method is called just before the animation is played each time.
        /// </summary>
        /// <returns />
        $AA.PropertyAnimation.callBaseMethod(this, 'onStart');

        this._currentTarget = this.get_target();
    },

    setValue : function(value) {
        /// <summary>
        /// Set the current value of the property
        /// </summary>
        /// <param name="value" type="Object" mayBeNull="true">
        /// Value to assign
        /// </param>
        /// <returns />

        var element = this._currentTarget;
        if (element && this._property && this._property.length > 0) { 
            if (this._propertyKey && this._propertyKey.length > 0 && element[this._property]) {
                element[this._property][this._propertyKey] = value;
            } else {
                element[this._property] = value;
            }
        }
        // Sys.TypeDescriptor.setProperty(this.get_target(), this._property, value, this._propertyKey);
    },
    
    getValue : function() {
        /// <summary>
        /// Get the current value from the property
        /// </summary>
        /// <returns type="Object" mayBeNull="true">
        /// Current value of the property
        /// </returns>

        var element = this.get_target();
        if (element && this._property && this._property.length > 0) { 
            var property = element[this._property];
            if (property) {
                if (this._propertyKey && this._propertyKey.length > 0) {
                    return property[this._propertyKey];
                }
                return property;
            }
        }
        return null;
        // return Sys.TypeDescriptor.getProperty(this.get_target(), this._property, this._propertyKey);
    },
    
    get_property : function() {
        /// <value type="String">
        /// Property of the <code>target</code> element to set when animating
        /// </value>
        return this._property;
    },
    set_property : function(value) {
        if (this._property != value) {
            this._property = value;
            this.raisePropertyChanged('property');
        }
    },
    
    get_propertyKey : function() {
        /// <value type="String" mayBeNull="true" optional="true">
        /// Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
        /// </value>
        return this._propertyKey;
    },
    set_propertyKey : function(value) {
        if (this._propertyKey != value) {
            this._propertyKey = value;
            this.raisePropertyChanged('propertyKey');
        }
    }
}
$AA.PropertyAnimation.registerClass('AjaxControlToolkit.Animation.PropertyAnimation', $AA.Animation);
$AA.registerAnimation('property', $AA.PropertyAnimation);


$AA.DiscreteAnimation = function(target, duration, fps, property, propertyKey, values) {
    /// <summary>
    /// The <code>DiscreteAnimation</code> inherits from <see cref="AjaxControlToolkit.Animation.PropertyAnimation" />
    /// and sets the value of the <code>property</code> to the elements in a provided array of <code>values</code>.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="property" type="String" mayBeNull="true" optional="true">
    /// Property of the <code>target</code> element to set when animating
    /// </param>
    /// <param name="propertyKey" type="String" mayBeNull="true" optional="true">
    /// Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
    /// </param>
    /// <param name="values" mayBeNull="true" optional="true" parameterArray="true" elementType="Object">
    /// Array of possible values of the property that will be iterated over as the animation is played
    /// </param>
    /// <animation>Discrete</animation>
    $AA.DiscreteAnimation.initializeBase(this, [target, duration, fps, property, propertyKey]);

    // Values to assign to the property
    this._values = (values && values.length) ? values : [];
}
$AA.DiscreteAnimation.prototype = {
    getAnimatedValue : function(percentage) {
        /// <summary>
        /// Assign the value whose index corresponds to the current percentage
        /// </summary>
        /// <param name="percentage" type="Number">
        /// Percentage of the animation already complete
        /// </param>
        /// <returns type="Object">
        /// State of the animation after the given percentage of its duration has elapsed that will
        /// be passed to <code>setValue</code>
        /// </returns>
        var index = Math.floor(this.interpolate(0, this._values.length - 1, percentage));
        return this._values[index];
    },
    
    get_values : function() {
        /// <value parameterArray="true" elementType="Object">
        /// Array of possible values of the property that will be iterated over as the animation is played
        /// </value>
        return this._values;
    },
    set_values : function(value) {
        if (this._values != value) {
            this._values = value;
            this.raisePropertyChanged('values');
        }
    }
}
$AA.DiscreteAnimation.registerClass('AjaxControlToolkit.Animation.DiscreteAnimation', $AA.PropertyAnimation);
$AA.registerAnimation('discrete', $AA.DiscreteAnimation);


$AA.InterpolatedAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue) {
    /// <summary>
    /// The <code>InterpolatedAnimation</code> assigns a range of values between <code>startValue</code>
    /// and <code>endValue</code> to the designated property.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="property" type="String" mayBeNull="true" optional="true">
    /// Property of the <code>target</code> element to set when animating.  The default value is 'style'.
    /// </param>
    /// <param name="propertyKey" type="String" mayBeNull="true" optional="true">
    /// Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
    /// </param>
    /// <param name="startValue" type="Number" mayBeNull="true" optional="true">
    /// Start of the range of values
    /// </param>
    /// <param name="endValue" type="Number" mayBeNull="true" optional="true">
    /// End of the range of values
    /// </param>
    /// <animation>Interpolated</animation>
    $AA.InterpolatedAnimation.initializeBase(this, [target, duration, fps, ((property !== undefined) ? property : 'style'), propertyKey]);

    // Start and end values
    this._startValue = startValue;
    this._endValue = endValue;
}
$AA.InterpolatedAnimation.prototype = {
    get_startValue : function() {
        /// <value type="Number">
        /// Start of the range of values
        /// </value>
        return this._startValue;
    },
    set_startValue : function(value) {
        value = this._getFloat(value);
        if (this._startValue != value) {
            this._startValue = value;
            this.raisePropertyChanged('startValue');
        }
    },
    
    get_endValue : function() {
        /// <value type="Number">
        /// End of the range of values
        /// </value>
        return this._endValue;
    },
    set_endValue : function(value) {
        value = this._getFloat(value);
        if (this._endValue != value) {
            this._endValue = value;
            this.raisePropertyChanged('endValue');
        }
    }   
}
$AA.InterpolatedAnimation.registerClass('AjaxControlToolkit.Animation.InterpolatedAnimation', $AA.PropertyAnimation);
$AA.registerAnimation('interpolated', $AA.InterpolatedAnimation);


$AA.ColorAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue) {
    /// <summary>
    /// The <code>ColorAnimation</code> transitions the value of the <code>property</code> between
    /// two colors (although it does ignore the alpha channel). The colors must be 7-character hex strings
    /// (like <code>#246ACF</code>).
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="property" type="String" mayBeNull="true" optional="true">
    /// Property of the <code>target</code> element to set when animating.  The default value is 'style'.
    /// </param>
    /// <param name="propertyKey" type="String" mayBeNull="true" optional="true">
    /// Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
    /// </param>
    /// <param name="startValue" type="String" mayBeNull="true" optional="true">
    /// Start of the range of colors
    /// </param>
    /// <param name="endValue" type="String" mayBeNull="true" optional="true">
    /// End of the range of colors
    /// </param>
    /// <animation>Color</animation>
    $AA.ColorAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]);
    
    // Cached start/end RBG triplets
    this._start = null;
    this._end = null;
    
    // Flags indicating whether each dimension of color will be interpolated
    this._interpolateRed = false;
    this._interpolateGreen = false;
    this._interpolateBlue = false;
}
$AA.ColorAnimation.prototype = {
    onStart : function() {
        /// <summary>
        /// Determine which dimensions of color will be animated
        /// </summary>
        /// <returns />
        $AA.ColorAnimation.callBaseMethod(this, 'onStart');
       
        this._start = $AA.ColorAnimation.getRGB(this.get_startValue());
        this._end = $AA.ColorAnimation.getRGB(this.get_endValue());
        
        this._interpolateRed = (this._start.Red != this._end.Red);
        this._interpolateGreen = (this._start.Green != this._end.Green);
        this._interpolateBlue = (this._start.Blue != this._end.Blue);
    },
    
    getAnimatedValue : function(percentage) {
        /// <summary>
        /// Get the interpolated color values
        /// </summary>
        /// <param name="percentage" type="Number">
        /// Percentage of the animation already complete
        /// </param>
        /// <returns type="String">
        /// Current color formatted as a 7-character hex string (like <code>#246ACF</code>).
        /// </returns>

        var r = this._start.Red;
        var g = this._start.Green;
        var b = this._start.Blue;
        
        if (this._interpolateRed)
            r = Math.round(this.interpolate(r, this._end.Red, percentage));
        
        if (this._interpolateGreen)
            g = Math.round(this.interpolate(g, this._end.Green, percentage));
        
        if (this._interpolateBlue)
            b = Math.round(this.interpolate(b, this._end.Blue, percentage));
        
        return $AA.ColorAnimation.toColor(r, g, b);
    },
    
    set_startValue : function(value) {
        /// <value type="String">
        /// Starting color of the transition formatted as a 7-character hex string (like <code>#246ACF</code>).
        /// </value>

        if (this._startValue != value) {
            this._startValue = value;
            this.raisePropertyChanged('startValue');
        }
    },
    
    set_endValue : function(value) {
        /// <value type="String">
        /// Ending color of the transition formatted as a 7-character hex string (like <code>#246ACF</code>).
        /// </value>

        if (this._endValue != value) {
            this._endValue = value;
            this.raisePropertyChanged('endValue');
        }
    }   
}
$AA.ColorAnimation.getRGB = function(color) {
    /// <summary>
    /// Convert the color to an RGB triplet
    /// </summary>
    /// <param name="color" type="String">
    /// Color formatted as a 7-character hex string (like <code>#246ACF</code>)
    /// </param>
    /// <returns type="Object">
    /// Object representing the color with <code>Red</code>, <code>Green</code>, and <code>Blue</code> properties.
    /// </returns>

    if (!color || color.length != 7) {
        throw String.format(AjaxControlToolkit.Resources.Animation_InvalidColor, color);
    }
    return { 'Red': parseInt(color.substr(1,2), 16),
             'Green': parseInt(color.substr(3,2), 16),
             'Blue': parseInt(color.substr(5,2), 16) };
}
$AA.ColorAnimation.toColor = function(red, green, blue) {
    /// <summary>
    /// Convert an RBG triplet into a 7-character hex string (like <code>#246ACF</code>)
    /// </summary>
    /// <param name="red" type="Number" integer="true">
    /// Value of the color's red dimension
    /// </param>
    /// <param name="green" type="Number" integer="true">
    /// Value of the color's green dimension
    /// </param>
    /// <param name="blue" type="Number" integer="true">
    /// Value of the color's blue dimension
    /// </param>
    /// <returns type="String">
    /// Color as a 7-character hex string (like <code>#246ACF</code>)
    /// </returns>

    var r = red.toString(16);
    var g = green.toString(16);
    var b = blue.toString(16);
    if (r.length == 1) r = '0' + r;
    if (g.length == 1) g = '0' + g;
    if (b.length == 1) b = '0' + b;
    return '#' + r + g + b;
}
$AA.ColorAnimation.registerClass('AjaxControlToolkit.Animation.ColorAnimation', $AA.InterpolatedAnimation);
$AA.registerAnimation('color', $AA.ColorAnimation);


$AA.LengthAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue, unit) {
    /// <summary>
    /// The <code>LengthAnimation</code> is identical to <see cref="AjaxControlToolkit.Animation.InterpolatedAnimation" />
    /// except it adds a <code>unit</code> to the value before assigning it to the <code>property</code>.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="property" type="String" mayBeNull="true" optional="true">
    /// Property of the <code>target</code> element to set when animating.  The default value is 'style'.
    /// </param>
    /// <param name="propertyKey" type="String" mayBeNull="true" optional="true">
    /// Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
    /// </param>
    /// <param name="startValue" type="Number" mayBeNull="true" optional="true">
    /// Start of the range of values
    /// </param>
    /// <param name="endValue" type="Number" mayBeNull="true" optional="true">
    /// End of the range of values
    /// </param>
    /// <param name="unit" type="String" mayBeNull="true" optional="true">
    /// Unit of the interpolated values.  The default value is <code>'px'</code>.
    /// </param>
    /// <animation>Length</animation>
    $AA.LengthAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]);
    
    // Unit of length (which defaults to px)
    this._unit = (unit != null) ? unit : 'px';
}
$AA.LengthAnimation.prototype = {

    getAnimatedValue : function(percentage) {
        /// <summary>
        /// Get the interpolated length value
        /// </summary>
        /// <param name="percentage" type="Number">
        /// Percentage of the animation already complete
        /// </param>
        /// <returns type="String">
        /// Interpolated length
        /// </returns>

        var value = this.interpolate(this.get_startValue(), this.get_endValue(), percentage);
        return Math.round(value) + this._unit;
    },
    
    get_unit : function() {
        /// <value type="String">
        /// Unit of the interpolated values.  The default value is <code>'px'</code>.
        /// </value>
        return this._unit;
    },
    set_unit : function(value) {
        if (this._unit != value) {
            this._unit = value;
            this.raisePropertyChanged('unit');
        }
    }
}
$AA.LengthAnimation.registerClass('AjaxControlToolkit.Animation.LengthAnimation', $AA.InterpolatedAnimation);
$AA.registerAnimation('length', $AA.LengthAnimation);


$AA.MoveAnimation = function(target, duration, fps, horizontal, vertical, relative, unit) {
    /// <summary>
    /// The <code>MoveAnimation</code> is used to move the <code>target</code> element. If the
    /// <code>relative</code> flag is set to <code>true</code>, then it treats the <code>horizontal</code>
    /// and <code>vertical</code> properties as offsets to move the element. If the <code>relative</code>
    /// flag is <code>false</code>, then it will treat the <code>horizontal</code> and <code>vertical</code>
    /// properties as coordinates on the page where the <code>target</code> element should be moved. It is
    /// important to note that the <code>target</code> must be positioned (i.e. <code>absolutely</code>) so
    /// that settings its <code>top</code>/<code>left<code> style attributes will change its location.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="horizontal" type="Number" mayBeNull="true" optional="true">
    /// If <code>relative</code>  is <code>true</code>, this is the offset to move horizontally. Otherwise this is the x
    /// coordinate on the page where the <code>target</code> should be moved.
    /// </param>
    /// <param name="vertical" type="Number" mayBeNull="true" optional="true">
    /// If <code>relative</code> is <code>true</code>, this is the offset to move vertically. Otherwise this is the y
    /// coordinate on the page where the <code>target</code> should be moved.
    /// </param>
    /// <param name="relative" type="Boolean" mayBeNull="true" optional="true">
    /// <code>true</code> if we are moving relative to the current position, <code>false</code> if we are moving absolutely
    /// </param>
    /// <param name="unit" type="String" mayBeNull="true" optional="true">
    /// Length unit for the size of the <code>target</code>. The default value is <code>'px'</code>.
    /// </param>
    /// <animation>Move</animation>
    $AA.MoveAnimation.initializeBase(this, [target, duration, fps, null]);

    // Distance to move horizontally and vertically
    this._horizontal = horizontal ? horizontal : 0;
    this._vertical = vertical ? vertical : 0;
    this._relative = (relative === undefined) ? true : relative;
    
    // Length animations representing the movememnts
    this._horizontalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'left', null, null, unit);
    this._verticalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'top', null, null, unit);
    this.add(this._verticalAnimation);
    this.add(this._horizontalAnimation);
}
$AA.MoveAnimation.prototype = {
    
    onStart : function() {
        /// <summary>
        /// Use the <code>target</code>'s current position as the starting point for the animation
        /// </summary>
        /// <returns />
        $AA.MoveAnimation.callBaseMethod(this, 'onStart');
        
        // Set the start and end values of the animations by getting
        // the element's current position and applying the offsets
        var element = this.get_target();
        this._horizontalAnimation.set_startValue(element.offsetLeft);
        this._horizontalAnimation.set_endValue(this._relative ? element.offsetLeft + this._horizontal : this._horizontal);
        this._verticalAnimation.set_startValue(element.offsetTop); 
        this._verticalAnimation.set_endValue(this._relative ? element.offsetTop + this._vertical : this._vertical);
    },
    
    get_horizontal : function() {
        /// <value type="Number">
        /// If <code>relative</code>  is <code>true</code>, this is the offset to move horizontally. Otherwise this is the x
        /// coordinate on the page where the <code>target</code> should be moved.
        /// </value>
        return this._horizontal;
    },
    set_horizontal : function(value) {
        value = this._getFloat(value);
        if (this._horizontal != value) {
            this._horizontal = value;
            this.raisePropertyChanged('horizontal');
        }
    },
    
    get_vertical : function() {
        /// <value type="Number">
        /// If <code>relative</code> is <code>true</code>, this is the offset to move vertically. Otherwise this is the y
        /// coordinate on the page where the <code>target</code> should be moved.
        /// </value>
        return this._vertical;
    },
    set_vertical : function(value) {
        value = this._getFloat(value);
        if (this._vertical != value) {
            this._vertical = value;
            this.raisePropertyChanged('vertical');
        }
    },
    
    get_relative : function() {
        /// <value type="Boolean">
        /// <code>true</code> if we are moving relative to the current position, <code>false</code> if we are moving absolutely
        /// </value>
        return this._relative;
    },
    set_relative : function(value) {
        value = this._getBoolean(value);
        if (this._relative != value) {
            this._relative = value;
            this.raisePropertyChanged('relative');
        }
    },
    
    get_unit : function() {
        /// <value type="String" mayBeNull="true">
        /// Length unit for the size of the <code>target</code>. The default value is <code>'px'</code>.
        /// </value>
        this._horizontalAnimation.get_unit();
    },
    set_unit : function(value) {
        var unit = this._horizontalAnimation.get_unit();
        if (unit != value) {
            this._horizontalAnimation.set_unit(value);
            this._verticalAnimation.set_unit(value);
            this.raisePropertyChanged('unit');
        }
    }
}
$AA.MoveAnimation.registerClass('AjaxControlToolkit.Animation.MoveAnimation', $AA.ParallelAnimation);
$AA.registerAnimation('move', $AA.MoveAnimation);


$AA.ResizeAnimation = function(target, duration, fps, width, height, unit) {
    /// <summary>
    /// The <code>ResizeAnimation</code> changes the size of the <code>target</code> from its
    /// current value to the specified <code>width</code> and <code>height</code>.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="width" type="Number" mayBeNull="true" optional="true">
    /// New width of the <code>target</code>
    /// </param>
    /// <param name="height" type="Number" mayBeNull="true" optional="true">
    /// New height of the <code>target</code>
    /// </param>
    /// <param name="unit" type="String" mayBeNull="true" optional="true">
    /// Length unit for the size of the <code>target</code>. The default value is <code>'px'</code>.
    /// </param>
    /// <animation>Resize</animation>
    $AA.ResizeAnimation.initializeBase(this, [target, duration, fps, null]);

    // New size of the element
    this._width = width;
    this._height = height;
    
    // Animations to set the size across both dimensions
    this._horizontalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'width', null, null, unit);
    this._verticalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'height', null, null, unit);
    this.add(this._horizontalAnimation);
    this.add(this._verticalAnimation);
}
$AA.ResizeAnimation.prototype = {
    
    onStart : function() {
        /// <summary>
        /// Use the <code>target</code>'s current size as the starting point for the animation
        /// </summary>
        /// <returns />

        $AA.ResizeAnimation.callBaseMethod(this, 'onStart');
        
        // Set the start and end values of the animations by getting
        // the element's current width and height
        var element = this.get_target();
        this._horizontalAnimation.set_startValue(element.offsetWidth);
        this._verticalAnimation.set_startValue(element.offsetHeight);
        this._horizontalAnimation.set_endValue((this._width !== null && this._width !== undefined) ?
            this._width : element.offsetWidth);
        this._verticalAnimation.set_endValue((this._height !== null && this._height !== undefined) ?
            this._height : element.offsetHeight);
    },
    
    get_width : function() {
        /// <value type="Number">
        /// New width of the <code>target</code>
        /// </value>

        return this._width;
    },
    set_width : function(value) {
        value = this._getFloat(value);
        if (this._width != value) {
            this._width = value;
            this.raisePropertyChanged('width');
        }
    },
    
    get_height : function() {
        /// <value type="Number">
        /// New height of the <code>target</code>
        /// </value>

        return this._height;
    },
    set_height : function(value) {
        value = this._getFloat(value);
        if (this._height != value) {
            this._height = value;   
            this.raisePropertyChanged('height');
        }
    },
    
    get_unit : function() {
        /// <value type="String">
        /// Length unit for the size of the <code>target</code>. The default value is <code>'px'</code>.
        /// </value>

        this._horizontalAnimation.get_unit();
    },
    set_unit : function(value) {
        var unit = this._horizontalAnimation.get_unit();
        if (unit != value) {
            this._horizontalAnimation.set_unit(value);
            this._verticalAnimation.set_unit(value);
            this.raisePropertyChanged('unit');
        }
    }
}
$AA.ResizeAnimation.registerClass('AjaxControlToolkit.Animation.ResizeAnimation', $AA.ParallelAnimation);
$AA.registerAnimation('resize', $AA.ResizeAnimation);









$AA.ScaleAnimation = function(target, duration, fps, scaleFactor, unit, center, scaleFont, fontUnit) {
    /// <summary>
    /// The <code>ScaleAnimation</code> scales the size of the <code>target</code> element by the given <code>scaleFactor</code>
    /// (i.e. a <code>scaleFactor</code> of <code>.5</code> will shrink it in half and a <code>scaleFactor</code> of <code>2.0</code>
    /// will double it).  If <code>scaleFont</code> is <code>true</code>, the size of the font will also scale with the element.  If
    /// <code>center</code> is <code>true</code>, then the element's center will not move as it is scaled.  It is important to note that
    /// the target must be positioned (i.e. absolutely) so that setting its <code>top</code>/<code>left</code> properties will change
    /// its location in order for <code>center</code> to have an effect.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 1.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="scaleFactor" type="Number" mayBeNull="true" optional="true">
    /// The amount to scale the <code>target</code> (a <code>scaleFactor</code> of <code>.5</code> will
    /// shrink it in half and a <code>scaleFactor</code> of <code>2.0</code> will double it). The default value is
    /// <code>1</code>, which does no scaling.
    /// </param>
    /// <param name="unit" type="String" mayBeNull="true" optional="true">
    /// Length unit for the size of the <code>target</code>.  The default value is <code>'px'</code>.
    /// </param>
    /// <param name="center" type="Boolean" mayBeNull="true" optional="true">
    /// Whether the <code>target</code> should stay centered while scaling
    /// </param>
    /// <param name="scaleFont" type="Boolean" mayBeNull="true" optional="true">
    /// Whether the font should be scaled along with the size
    /// </param>
    /// <param name="fontUnit" type="String" mayBeNull="true" optional="true">
    /// Unit of the font, which is only used if <code>scaleFont</code> is <code>true</code>.
    /// The default value is <code>'pt'</code>.
    /// </param>
    /// <animation>Scale</animation>
    $AA.ScaleAnimation.initializeBase(this, [target, duration, fps]);

    // Percentage to scale
    this._scaleFactor = (scaleFactor !== undefined) ? scaleFactor : 1;
    this._unit = (unit !== undefined) ? unit : 'px';
    
    // Center the content while scaling
    this._center = center;
    
    // Scale the font size as well
    this._scaleFont = scaleFont;
    this._fontUnit = (fontUnit !== undefined) ? fontUnit : 'pt';
    
    // Initial values
    this._element = null;
    this._initialHeight = null;
    this._initialWidth = null;
    this._initialTop = null;
    this._initialLeft = null;
    this._initialFontSize = null;
}
$AA.ScaleAnimation.prototype = {    
    getAnimatedValue : function(percentage) {
        /// <summary>
        /// Get the amount to scale the <code>target</code>
        /// </summary>
        /// <param name="percentage" type="Number">
        /// Percentage of the animation already complete
        /// </param>
        /// <returns type="Number">
        /// Percentage to scale the <code>target</code>
        /// </returns>
        return this.interpolate(1.0, this._scaleFactor, percentage);
    },
    
    onStart : function() {
        /// <summary>
        /// Cache the initial size because it will be used to determine how much to scale the element at each step of the animation
        /// </summary>
        /// <returns />
        $AA.ScaleAnimation.callBaseMethod(this, 'onStart');
        
        this._element = this.get_target();
        if (this._element) {
            this._initialHeight = this._element.offsetHeight;
            this._initialWidth = this._element.offsetWidth;
            if (this._center) {
                this._initialTop = this._element.offsetTop;
                this._initialLeft = this._element.offsetLeft;
            }
            if (this._scaleFont) {
                // Note: we're assuming this is in the same units as fontUnit
                this._initialFontSize = parseFloat(
                    $common.getCurrentStyle(this._element, 'fontSize'));
            }
        }
    },
    
    setValue : function(scale) {
        /// <summary>
        /// Scale the <code>target</code> by the given percentage
        /// </summary>
        /// <param name="scale" type="Number">
        /// Percentage to scale the <code>target</code>
        /// </param>
        /// <returns />

        if (this._element) {
            var width = Math.round(this._initialWidth * scale);
            var height = Math.round(this._initialHeight * scale);
            this._element.style.width = width + this._unit; 
            this._element.style.height = height + this._unit;
            
            if (this._center) {
                this._element.style.top = (this._initialTop +
                    Math.round((this._initialHeight - height) / 2)) + this._unit;
                this._element.style.left = (this._initialLeft +
                    Math.round((this._initialWidth - width) / 2)) + this._unit;
            }
            
            if (this._scaleFont) {
                var size = this._initialFontSize * scale;
                if (this._fontUnit == 'px' || this._fontUnit == 'pt') {
                    size = Math.round(size);
                }
                this._element.style.fontSize = size + this._fontUnit;
            }
        }
    },
    
    onEnd : function() {
        /// <summary>
        /// Wipe the cached values after the animation completes
        /// </summary>
        /// <returns />

        this._element = null;
        this._initialHeight = null;
        this._initialWidth = null;
        this._initialTop = null;
        this._initialLeft = null;
        this._initialFontSize = null;
        $AA.ScaleAnimation.callBaseMethod(this, 'onEnd');
    },
    
    get_scaleFactor : function() {
        /// <value type="Number">
        /// The amount to scale the <code>target</code> (a <code>scaleFactor</code> of <code>.5</code> will
        /// shrink it in half and a <code>scaleFactor</code> of <code>2.0</code> will double it). The default value is
        /// <code>1</code>, which does no scaling.
        /// </value>

        return this._scaleFactor;
    },
    set_scaleFactor : function(value) {
        value = this._getFloat(value);
        if (this._scaleFactor != value) {
            this._scaleFactor = value;
            this.raisePropertyChanged('scaleFactor');
        }
    },
    
    get_unit : function() {
        /// <value type="String">
        /// Length unit for the size of the <code>target</code>.  The default value is <code>'px'</code>.
        /// </value>
        return this._unit;
    },
    set_unit : function(value) {
        if (this._unit != value) {
            this._unit = value;
            this.raisePropertyChanged('unit');
        }
    },
    
    get_center : function() {
        /// <value type="Boolean">
        /// Whether the <code>target</code> should stay centered while scaling
        /// </value>
        return this._center;
    },
    set_center : function(value) {
        value = this._getBoolean(value);
        if (this._center != value) {
            this._center = value;
            this.raisePropertyChanged('center');
        }
    },
    
    get_scaleFont : function() {
        /// <value type="Boolean">
        /// Whether the font should be scaled along with the size
        /// </value>
        return this._scaleFont;
    },
    set_scaleFont : function(value) {
        value = this._getBoolean(value);
        if (this._scaleFont != value) {
            this._scaleFont = value;
            this.raisePropertyChanged('scaleFont');
        }
    },
    
    get_fontUnit : function() {
        /// <value type="String">
        /// Unit of the font, which is only used if <code>scaleFont</code> is <code>true</code>.
        /// The default value is <code>'pt'</code>.
        /// </value>
        return this._fontUnit;
    },
    set_fontUnit : function(value) {
        if (this._fontUnit != value) { 
            this._fontUnit = value; 
            this.raisePropertyChanged('fontUnit');
        }
    }
}
$AA.ScaleAnimation.registerClass('AjaxControlToolkit.Animation.ScaleAnimation', $AA.Animation);
$AA.registerAnimation('scale', $AA.ScaleAnimation);


$AA.Action = function(target, duration, fps) {
    /// <summary>
    /// <code>Action</code> is a base class for all "non-animating" animations that provides empty implementations
    /// for abstract methods and adds a <code>doAction</code> method that will be called to perform the action's
    /// operation.  While regular animations perform an operation in a sequence of small steps spread over an interval,
    /// the actions perform a single operation instantaneously.  By default, all actions have a <code>duration</code>
    /// of zero.  The actions are very useful for defining complex animations.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 0.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <animation>Action</animation>
    $AA.Action.initializeBase(this, [target, duration, fps]);

    // Set the duration to 0 if it wasn't specified
    if (duration === undefined) {
        this.set_duration(0);
    }
}
$AA.Action.prototype = {
    
    onEnd : function() {
        /// <summary>
        /// Call the <code>doAction</code> method when the animation completes
        /// </summary>
        /// <returns />
        this.doAction();
        $AA.Action.callBaseMethod(this, 'onEnd');
    },
    
    doAction : function() {
        /// <summary>
        /// The <code>doAction</code> method must be implemented by all actions
        /// </summary>
        /// <returns />
        throw Error.notImplemented();
    },
    
    getAnimatedValue : function() {
        /// <summary>
        /// Empty implementation of required abstract method
        /// </summary>
    },
    setValue : function() {
        /// <summary>
        /// Empty implementation of required abstract method
        /// </summary>
    }
}
$AA.Action.registerClass('AjaxControlToolkit.Animation.Action', $AA.Animation);
$AA.registerAnimation('action', $AA.Action);


$AA.EnableAction = function(target, duration, fps, enabled) {
    /// <summary>
    /// The <code>EnableAction</code> changes whether or not the <code>target</code> is disabled.
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 0.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="enabled" type="Boolean" mayBeNull="true" optional="true">
    /// Whether or not the <code>target</code> is disabled. The default value is <code>true</code>.
    /// </param>
    /// <animation>EnableAction</animation>
    $AA.EnableAction.initializeBase(this, [target, duration, fps]);

    // Whether to enable or disable
    this._enabled = (enabled !== undefined) ? enabled : true;
}
$AA.EnableAction.prototype = {
    doAction : function() {
    	/// <summary>
        /// Set the enabled property of the <code>target</code>
    	/// </summary>
    	/// <returns />
    	
        var element = this.get_target();
        if (element) {
            element.disabled = !this._enabled;
        }
    },
    
    get_enabled : function() {
        /// <value type="Boolean">
        /// Whether or not the <code>target</code> is disabled. The default value is <code>true</code>.
        /// </value>
        return this._enabled;
    },
    set_enabled : function(value) {
        value = this._getBoolean(value);
        if (this._enabled != value) {
            this._enabled = value;
            this.raisePropertyChanged('enabled');
        }
    }
}
$AA.EnableAction.registerClass('AjaxControlToolkit.Animation.EnableAction', $AA.Action);
$AA.registerAnimation('enableAction', $AA.EnableAction);


$AA.HideAction = function(target, duration, fps, visible) {
    /// <summary>
    /// The <code>HideAction</code> simply hides the <code>target</code> from view
    /// (by setting its style's <code>display</code> attribute to <code>'none'</code>)
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 0.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="visible" type="Boolean" mayBeNull="False">
    /// True to show the target, false to hide it.  The default value is false.
    /// </param>
    /// <animation>HideAction</animation>
    $AA.HideAction.initializeBase(this, [target, duration, fps]);

    this._visible = visible;
}
$AA.HideAction.prototype = {
    doAction : function() {
        /// <summary>
        /// Hide the <code>target</code>
        /// </summary>
        /// <returns />
        var element = this.get_target();
        if (element) {
            $common.setVisible(element, this._visible);
        }
    },
    
    get_visible : function() {
        /// <value type="Boolean" mayBeNull="False">
        /// True to show the target, false to hide it.  The default value is false.
        /// </value>
        return this._visible;
    },
    set_visible : function(value) {
        if (this._visible != value) {
            this._visible = value;
            this.raisePropertyChanged('visible');
        }
    }
}
$AA.HideAction.registerClass('AjaxControlToolkit.Animation.HideAction', $AA.Action);
$AA.registerAnimation('hideAction', $AA.HideAction);


$AA.StyleAction = function(target, duration, fps, attribute, value) {
    /// <summary>
    /// The <code>StyleAction<code> is used to set a particular <code>attribute</code> of the <code>target</code>'s style
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 0.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="attribute" type="String" mayBeNull="true" optional="true">
    /// Style attribute to set (this must be in a JavaScript friendly format, i.e. <code>backgroundColor</code>
    /// instead of <code>background-color</code>)
    /// </param>
    /// <param name="value" type="String" mayBeNull="true" optional="true">
    /// Value to set the <code>attribute</code>
    /// </param>
    /// <animation>StyleAction</animation>
    $AA.StyleAction.initializeBase(this, [target, duration, fps]);

    // Style attribute (like "backgroundColor" or "borderWidth"
    this._attribute = attribute;
    
    // Value to assign to the style attribute
    this._value = value;
    
}
$AA.StyleAction.prototype = {
    doAction : function() {
    	/// <summary>
        /// Assign the <code>value</code> to the style's <code>attribute</code>
    	/// </summary>
    	/// <returns />
        var element = this.get_target();
        if (element) {
            element.style[this._attribute] = this._value;
        }
    },
    
    get_attribute : function() {
        /// <value type="String">
        /// Style attribute to set (this must be in a JavaScript friendly format, i.e. <code>backgroundColor</code>
        /// instead of <code>background-color</code>)
        /// </value>
        return this._attribute;
    },
    set_attribute : function(value) {
        if (this._attribute != value) {
            this._attribute = value;
            this.raisePropertyChanged('attribute');
        }
    },
    
    get_value : function() {
        /// <value type="String">
        /// Value to set the <code>attribute</code>
        /// </value>
        return this._value;
    },
    set_value : function(value) {
        if (this._value != value) {
            this._value = value;
            this.raisePropertyChanged('value');
        }
    }
}
$AA.StyleAction.registerClass('AjaxControlToolkit.Animation.StyleAction', $AA.Action);
$AA.registerAnimation('styleAction', $AA.StyleAction);


$AA.OpacityAction = function(target, duration, fps, opacity) {
    /// <summary>
    /// <code>OpacityAction</code> allows you to set the <code>opacity</code> of the <code>target</code>
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 0.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="opacity" type="Number" mayBeNull="true" optional="true">
    /// Opacity to set the <code>target</code>
    /// </param>
    /// <animation>OpacityAction</animation>
    $AA.OpacityAction.initializeBase(this, [target, duration, fps]);
    
    // Opacity
    this._opacity = opacity;
}
$AA.OpacityAction.prototype = {
    doAction : function() {
    	/// <summary>
        /// Set the opacity
    	/// </summary>
    	/// <returns />
        var element = this.get_target();
        if (element) {
            $common.setElementOpacity(element, this._opacity);
        }
    },
    
    get_opacity : function() {
        /// <value type="Number">
        /// Opacity to set the <code>target</code>
        /// </value>
        return this._opacity;
    },
    set_opacity : function(value) {
        value = this._getFloat(value);
        if (this._opacity != value) {
            this._opacity = value;
            this.raisePropertyChanged('opacity');
        }
    }
}
$AA.OpacityAction.registerClass('AjaxControlToolkit.Animation.OpacityAction', $AA.Action);
$AA.registerAnimation('opacityAction', $AA.OpacityAction);


$AA.ScriptAction = function(target, duration, fps, script) {
    /// <summary>
    /// The <code>ScriptAction</code> is used to execute arbitrary JavaScript
    /// </summary>
    /// <param name="target" type="Sys.UI.DomElement" mayBeNull="true" optional="true" domElement="true">
    /// Target of the animation
    /// </param>
    /// <param name="duration" type="Number" mayBeNull="true" optional="true">
    /// Length of the animation in seconds.  The default is 0.
    /// </param>
    /// <param name="fps" type="Number" mayBeNull="true" optional="true" integer="true">
    /// Number of steps per second.  The default is 25.
    /// </param>
    /// <param name="script" type="String" mayBeNull="true" optional="true">
    /// JavaScript to execute
    /// </param>
    /// <animation>ScriptAction</animation>
    $AA.ScriptAction.initializeBase(this, [target, duration, fps]);

    // Script to execute
    this._script = script;
}
$AA.ScriptAction.prototype = {
    doAction : function() {
    	/// <summary>
        /// Execute the script
    	/// </summary>
    	/// <returns />
        try {
            eval(this._script);
        } catch (ex) {
        }
    },
    
    get_script : function() {
        /// <value type="String">
        /// JavaScript to execute
        /// </value>
        return this._script;
    },
    set_script : function(value) {
        if (this._script != value) {
            this._script = value;
            this.raisePropertyChanged('script');
        }
    }
}
$AA.ScriptAction.registerClass('AjaxControlToolkit.Animation.ScriptAction', $AA.Action);
$AA.registerAnimation('scriptAction', $AA.ScriptAction);

/* END AjaxControlToolkit.Animation.Animations.js */
/* START AjaxControlToolkit.ExtenderBase.BaseScripts.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />


Type.registerNamespace('AjaxControlToolkit');

// This is the base behavior for all extender behaviors
AjaxControlToolkit.BehaviorBase = function(element) {
    /// <summary>
    /// Base behavior for all extender behaviors
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// Element the behavior is associated with
    /// </param>
    AjaxControlToolkit.BehaviorBase.initializeBase(this,[element]);
    
    this._clientStateFieldID = null;
    this._pageRequestManager = null;
    this._partialUpdateBeginRequestHandler = null;
    this._partialUpdateEndRequestHandler = null;
}
AjaxControlToolkit.BehaviorBase.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>

        // TODO: Evaluate necessity
        AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'initialize');
    },

    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'dispose');

        if (this._pageRequestManager) {
            if (this._partialUpdateBeginRequestHandler) {
                this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);
                this._partialUpdateBeginRequestHandler = null;
            }
            if (this._partialUpdateEndRequestHandler) {
                this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);
                this._partialUpdateEndRequestHandler = null;
            }
            this._pageRequestManager = null;
        }
    },

    get_ClientStateFieldID : function() {
        /// <value type="String">
        /// ID of the hidden field used to store client state
        /// </value>
        return this._clientStateFieldID;
    },
    set_ClientStateFieldID : function(value) {
        if (this._clientStateFieldID != value) {
            this._clientStateFieldID = value;
            this.raisePropertyChanged('ClientStateFieldID');
        }
    },

    get_ClientState : function() {
        /// <value type="String">
        /// Client state
        /// </value>
        if (this._clientStateFieldID) {
            var input = document.getElementById(this._clientStateFieldID);
            if (input) {
                return input.value;
            }
        }
        return null;
    },
    set_ClientState : function(value) {
        if (this._clientStateFieldID) {
            var input = document.getElementById(this._clientStateFieldID);
            if (input) {
                input.value = value;
            }
        }
    },

    registerPartialUpdateEvents : function() {
        /// <summary>
        /// Register for beginRequest and endRequest events on the PageRequestManager,
        /// (which cause _partialUpdateBeginRequest and _partialUpdateEndRequest to be
        /// called when an UpdatePanel refreshes)
        /// </summary>

        if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager){
            this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
            if (this._pageRequestManager) {
                this._partialUpdateBeginRequestHandler = Function.createDelegate(this, this._partialUpdateBeginRequest);
                this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);
                this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest);
                this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);
            }
        }
    },

    _partialUpdateBeginRequest : function(sender, beginRequestEventArgs) {
        /// <summary>
        /// Method that will be called when a partial update (via an UpdatePanel) begins,
        /// if registerPartialUpdateEvents() has been called.
        /// </summary>
        /// <param name="sender" type="Object">
        /// Sender
        /// </param>
        /// <param name="beginRequestEventArgs" type="Sys.WebForms.BeginRequestEventArgs">
        /// Event arguments
        /// </param>

        // Nothing done here; override this method in a child class
    },
    
    _partialUpdateEndRequest : function(sender, endRequestEventArgs) {
        /// <summary>
        /// Method that will be called when a partial update (via an UpdatePanel) finishes,
        /// if registerPartialUpdateEvents() has been called.
        /// </summary>
        /// <param name="sender" type="Object">
        /// Sender
        /// </param>
        /// <param name="endRequestEventArgs" type="Sys.WebForms.EndRequestEventArgs">
        /// Event arguments
        /// </param>

        // Nothing done here; override this method in a child class
    }
}
AjaxControlToolkit.BehaviorBase.registerClass('AjaxControlToolkit.BehaviorBase', Sys.UI.Behavior);


// Dynamically populates content when the populate method is called
AjaxControlToolkit.DynamicPopulateBehaviorBase = function(element) {
    /// <summary>
    /// DynamicPopulateBehaviorBase is used to add DynamicPopulateBehavior funcitonality
    /// to other extenders.  It will dynamically populate the contents of the target element
    /// when its populate method is called.
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// DOM Element the behavior is associated with
    /// </param>
    AjaxControlToolkit.DynamicPopulateBehaviorBase.initializeBase(this, [element]);
    
    this._DynamicControlID = null;
    this._DynamicContextKey = null;
    this._DynamicServicePath = null;
    this._DynamicServiceMethod = null;
    this._cacheDynamicResults = false;
    this._dynamicPopulateBehavior = null;
    this._populatingHandler = null;
    this._populatedHandler = null;
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>

        AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'initialize');

        // Create event handlers
        this._populatingHandler = Function.createDelegate(this, this._onPopulating);
        this._populatedHandler = Function.createDelegate(this, this._onPopulated);
    },

    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>

        // Dispose of event handlers
        if (this._populatedHandler) {
            if (this._dynamicPopulateBehavior) {
                this._dynamicPopulateBehavior.remove_populated(this._populatedHandler);
            }
            this._populatedHandler = null;
        }
        if (this._populatingHandler) {
            if (this._dynamicPopulateBehavior) {
                this._dynamicPopulateBehavior.remove_populating(this._populatingHandler);
            }
            this._populatingHandler = null;
        }

        // Dispose of the placeholder control and behavior
        if (this._dynamicPopulateBehavior) {
            this._dynamicPopulateBehavior.dispose();
            this._dynamicPopulateBehavior = null;
        }
        AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'dispose');
    },

    populate : function(contextKeyOverride) {
        /// <summary>
        /// Demand-create the DynamicPopulateBehavior and use it to populate the target element
        /// </summary>
        /// <param name="contextKeyOverride" type="String" mayBeNull="true" optional="true">
        /// An arbitrary string value to be passed to the web method. For example, if the element to be populated is within a data-bound repeater, this could be the ID of the current row.
        /// </param>

        // If the DynamicPopulateBehavior's element is out of date, dispose of it
        if (this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != $get(this._DynamicControlID))) {
            this._dynamicPopulateBehavior.dispose();
            this._dynamicPopulateBehavior = null;
        }
        
        // If a DynamicPopulateBehavior is not available and the necessary information is, create one
        if (!this._dynamicPopulateBehavior && this._DynamicControlID && this._DynamicServiceMethod) {
            this._dynamicPopulateBehavior = $create(AjaxControlToolkit.DynamicPopulateBehavior,
                {
                    "id" : this.get_id() + "_DynamicPopulateBehavior",
                    "ContextKey" : this._DynamicContextKey,
                    "ServicePath" : this._DynamicServicePath,
                    "ServiceMethod" : this._DynamicServiceMethod,
                    "cacheDynamicResults" : this._cacheDynamicResults
                }, null, null, $get(this._DynamicControlID));

            // Attach event handlers
            this._dynamicPopulateBehavior.add_populating(this._populatingHandler);
            this._dynamicPopulateBehavior.add_populated(this._populatedHandler);
        }
        
        // If a DynamicPopulateBehavior is available, use it to populate the dynamic content
        if (this._dynamicPopulateBehavior) {
            this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._DynamicContextKey);
        }
    },

    _onPopulating : function(sender, eventArgs) {
        /// <summary>
        /// Handler for DynamicPopulate behavior's Populating event
        /// </summary>
        /// <param name="sender" type="Object">
        /// DynamicPopulate behavior
        /// </param>
        /// <param name="eventArgs" type="Sys.CancelEventArgs" mayBeNull="false">
        /// Event args
        /// </param>
        this.raisePopulating(eventArgs);
    },

    _onPopulated : function(sender, eventArgs) {
        /// <summary>
        /// Handler for DynamicPopulate behavior's Populated event
        /// </summary>
        /// <param name="sender" type="Object">
        /// DynamicPopulate behavior
        /// </param>
        /// <param name="eventArgs" type="Sys.EventArgs" mayBeNull="false">
        /// Event args
        /// </param>
        this.raisePopulated(eventArgs);
    },

    get_dynamicControlID : function() {
        /// <value type="String">
        /// ID of the element to populate with dynamic content
        /// </value>
        return this._DynamicControlID;
    },
    get_DynamicControlID : this.get_dynamicControlID,
    set_dynamicControlID : function(value) {
        if (this._DynamicControlID != value) {
            this._DynamicControlID = value;
            this.raisePropertyChanged('dynamicControlID');
            this.raisePropertyChanged('DynamicControlID');
        }
    },
    set_DynamicControlID : this.set_dynamicControlID,

    get_dynamicContextKey : function() {
        /// <value type="String">
        /// An arbitrary string value to be passed to the web method.
        /// For example, if the element to be populated is within a
        /// data-bound repeater, this could be the ID of the current row.
        /// </value>
        return this._DynamicContextKey;
    },
    get_DynamicContextKey : this.get_dynamicContextKey,
    set_dynamicContextKey : function(value) {
        if (this._DynamicContextKey != value) {
            this._DynamicContextKey = value;
            this.raisePropertyChanged('dynamicContextKey');
            this.raisePropertyChanged('DynamicContextKey');
        }
    },
    set_DynamicContextKey : this.set_dynamicContextKey,

    get_dynamicServicePath : function() {
        /// <value type="String" mayBeNull="true" optional="true">
        /// The URL of the web service to call.  If the ServicePath is not defined, then we will invoke a PageMethod instead of a web service.
        /// </value>
        return this._DynamicServicePath;
    },
    get_DynamicServicePath : this.get_dynamicServicePath,
    set_dynamicServicePath : function(value) {
        if (this._DynamicServicePath != value) {
            this._DynamicServicePath = value;
            this.raisePropertyChanged('dynamicServicePath');
            this.raisePropertyChanged('DynamicServicePath');
        }
    },
    set_DynamicServicePath : this.set_dynamicServicePath,

    get_dynamicServiceMethod : function() {
        /// <value type="String">
        /// The name of the method to call on the page or web service
        /// </value>
        /// <remarks>
        /// The signature of the method must exactly match the following:
        ///     [WebMethod]
        ///     string DynamicPopulateMethod(string contextKey)
        ///     {
        ///         ...
        ///     }
        /// </remarks>
        return this._DynamicServiceMethod;
    },
    get_DynamicServiceMethod : this.get_dynamicServiceMethod,
    set_dynamicServiceMethod : function(value) {
        if (this._DynamicServiceMethod != value) {
            this._DynamicServiceMethod = value;
            this.raisePropertyChanged('dynamicServiceMethod');
            this.raisePropertyChanged('DynamicServiceMethod');
        }
    },
    set_DynamicServiceMethod : this.set_dynamicServiceMethod,
    
    get_cacheDynamicResults : function() {
        /// <value type="Boolean" mayBeNull="false">
        /// Whether the results of the dynamic population should be cached and
        /// not fetched again after the first load
        /// </value>
        return this._cacheDynamicResults;
    },
    set_cacheDynamicResults : function(value) {
        if (this._cacheDynamicResults != value) {
            this._cacheDynamicResults = value;
            this.raisePropertyChanged('cacheDynamicResults');
        }
    },
    
    add_populated : function(handler) {
        /// <summary>
        /// Add a handler on the populated event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().addHandler("populated", handler);
    },
    remove_populated : function(handler) {
        /// <summary>
        /// Remove a handler from the populated event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().removeHandler("populated", handler);
    },
    raisePopulated : function(arg) {
        /// <summary>
        /// Raise the populated event
        /// </summary>
        /// <param name="arg" type="Sys.EventArgs">
        /// Event arguments
        /// </param>
        var handler = this.get_events().getHandler("populated");  
        if (handler) handler(this, arg);
    },
    
    add_populating : function(handler) {
        /// <summary>
        /// Add an event handler for the populating event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('populating', handler);
    },
    remove_populating : function(handler) {
        /// <summary>
        /// Remove an event handler from the populating event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('populating', handler);
    },
    raisePopulating : function(eventArgs) {
        /// <summary>
        /// Raise the populating event
        /// </summary>
        /// <param name="eventArgs" type="Sys.CancelEventArgs" mayBeNull="false">
        /// Event arguments for the populating event
        /// </param>
        /// <returns />
        
        var handler = this.get_events().getHandler('populating');
        if (handler) {
            handler(this, eventArgs);
        }
    }
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.registerClass('AjaxControlToolkit.DynamicPopulateBehaviorBase', AjaxControlToolkit.BehaviorBase);


AjaxControlToolkit.ControlBase = function(element) {
    AjaxControlToolkit.ControlBase.initializeBase(this, [element]);
    this._clientStateField = null;
    this._callbackTarget = null;
    this._onsubmit$delegate = Function.createDelegate(this, this._onsubmit);
    this._oncomplete$delegate = Function.createDelegate(this, this._oncomplete);
    this._onerror$delegate = Function.createDelegate(this, this._onerror);
}
AjaxControlToolkit.ControlBase.prototype = {
    initialize : function() {
        AjaxControlToolkit.ControlBase.callBaseMethod(this, "initialize");
        // load the client state if possible
        if (this._clientStateField) {
            this.loadClientState(this._clientStateField.value);
        }
        // attach an event to save the client state before a postback or updatepanel partial postback
        if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
            Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);
        } else {
            $addHandler(document.forms[0], "submit", this._onsubmit$delegate);
        }
    },
    dispose : function() {
        if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
            Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);
        } else {
            $removeHandler(document.forms[0], "submit", this._onsubmit$delegate);
        }
        AjaxControlToolkit.ControlBase.callBaseMethod(this, "dispose");
    },
    findElement : function(id) {
        // <summary>Finds an element within this control (ScriptControl/ScriptUserControl are NamingContainers);
        return $get(this.get_id() + '_' + id.split(':').join('_'));
    },
    get_clientStateField : function() {
        return this._clientStateField;
    },
    set_clientStateField : function(value) {
        if (this.get_isInitialized()) throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_CannotSetClientStateField);
        if (this._clientStateField != value) {
            this._clientStateField = value;
            this.raisePropertyChanged('clientStateField');
        }
    },
    loadClientState : function(value) {
        /// <remarks>override this method to intercept client state loading after a callback</remarks>
    },
    saveClientState : function() {
        /// <remarks>override this method to intercept client state acquisition before a callback</remarks>
        return null;
    },
    _invoke : function(name, args, cb) {
        /// <summary>invokes a callback method on the server control</summary>        
        if (!this._callbackTarget) {
            throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_ControlNotRegisteredForCallbacks);
        }
        if (typeof(WebForm_DoCallback)==="undefined") {
            throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_PageNotRegisteredForCallbacks);
        }
        var ar = [];
        for (var i = 0; i < args.length; i++) 
            ar[i] = args[i];
        var clientState = this.saveClientState();
        if (clientState != null && !String.isInstanceOfType(clientState)) {
            throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_InvalidClientStateType);
        }
        var payload = Sys.Serialization.JavaScriptSerializer.serialize({name:name,args:ar,state:this.saveClientState()});
        WebForm_DoCallback(this._callbackTarget, payload, this._oncomplete$delegate, cb, this._onerror$delegate, true);
    },
    _oncomplete : function(result, context) {
        result = Sys.Serialization.JavaScriptSerializer.deserialize(result);
        if (result.error) {
            throw Error.create(result.error);
        }
        this.loadClientState(result.state);
        context(result.result);
    },
    _onerror : function(message, context) {
        throw Error.create(message);
    },
    _onsubmit : function() {
        if (this._clientStateField) {
            this._clientStateField.value = this.saveClientState();
        }
        return true;
    }    
   
}
AjaxControlToolkit.ControlBase.registerClass("AjaxControlToolkit.ControlBase", Sys.UI.Control);

AjaxControlToolkit.Resources={
"PasswordStrength_InvalidWeightingRatios":"Strength Weighting ratios must have 4 elements","Animation_ChildrenNotAllowed":"AjaxControlToolkit.Animation.createAnimation cannot add child animations to type \"{0}\" that does not derive from AjaxControlToolkit.Animation.ParentAnimation","PasswordStrength_RemainingSymbols":"{0} symbol characters","ExtenderBase_CannotSetClientStateField":"clientStateField can only be set before initialization","RTE_PreviewHTML":"Preview HTML","RTE_JustifyCenter":"Justify Center","PasswordStrength_RemainingUpperCase":"{0} more upper case characters","Animation_TargetNotFound":"AjaxControlToolkit.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}\"","RTE_FontColor":"Font Color","RTE_LabelColor":"Label Color","Common_InvalidBorderWidthUnit":"A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth","RTE_Heading":"Heading","Tabs_PropertySetBeforeInitialization":"{0} cannot be changed before initialization","RTE_OrderedList":"Ordered List","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","Animation_NoDynamicPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\" or \"{1}\"","Animation_InvalidBaseType":"AjaxControlToolkit.Animation.registerAnimation can only register types that inherit from AjaxControlToolkit.Animation.Animation","RTE_UnorderedList":"Unordered List","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","RTE_Italic":"Italic","CascadingDropDown_NoParentElement":"Failed to find parent element \"{0}\"","ValidatorCallout_DefaultErrorMessage":"This control is invalid","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","RTE_Border":"Border","RTE_Create":"Create","RTE_BackgroundColor":"Background Color","RTE_Cancel":"Cancel","RTE_JustifyFull":"Justify Full","RTE_JustifyLeft":"Justify Left","RTE_Cut":"Cut","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}","Common_DateTime_InvalidFormat":"Invalid format","ListSearch_DefaultPrompt":"Type to search","CollapsiblePanel_NoControlID":"Failed to find element \"{0}\"","RTE_ViewEditor":"View Editor","RTE_BarColor":"Bar Color","PasswordStrength_DefaultStrengthDescriptions":"NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!","RTE_Inserttexthere":"Insert text here","Animation_UknownAnimationName":"AjaxControlToolkit.Animation.createAnimation could not find an Animation corresponding to the name \"{0}\"","ExtenderBase_InvalidClientStateType":"saveClientState must return a value of type String","Rating_CallbackError":"An unhandled exception has occurred:\\r\\n{0}","Tabs_OwnerExpected":"owner must be set before initialize","DynamicPopulate_WebServiceTimeout":"Web service call timed out","PasswordStrength_RemainingLowerCase":"{0} more lower case characters","Animation_MissingAnimationName":"AjaxControlToolkit.Animation.createAnimation requires an object with an AnimationName property","RTE_JustifyRight":"Justify Right","Tabs_ActiveTabArgumentOutOfRange":"Argument is not a member of the tabs collection","RTE_CellPadding":"Cell Padding","RTE_ClearFormatting":"Clear Formatting","AlwaysVisible_ElementRequired":"AjaxControlToolkit.AlwaysVisibleControlBehavior must have an element","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: ","PasswordStrength_RemainingCharacters":"{0} more characters","PasswordStrength_Satisfied":"Nothing more required","RTE_Hyperlink":"Hyperlink","Animation_NoPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\"","PasswordStrength_InvalidStrengthDescriptionStyles":"Text Strength description style classes must match the number of text descriptions.","PasswordStrength_GetHelpRequirements":"Get help on password requirements","PasswordStrength_InvalidStrengthDescriptions":"Invalid number of text strength descriptions specified","RTE_Underline":"Underline","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","CascadingDropDown_MethodError":"[Method error {0}]","RTE_BorderColor":"Border Color","RTE_Paragraph":"Paragraph","RTE_InsertHorizontalRule":"Insert Horizontal Rule","Common_UnitHasNoDigits":"No digits","RTE_Outdent":"Outdent","Common_DateTime_InvalidTimeSpan":"\"{0}\" is not a valid TimeSpan format","Animation_CannotNestSequence":"AjaxControlToolkit.Animation.SequenceAnimation cannot be nested inside AjaxControlToolkit.Animation.ParallelAnimation","Shared_BrowserSecurityPreventsPaste":"Your browser security settings don\u0027t permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."};
/* END AjaxControlToolkit.ExtenderBase.BaseScripts.js */
/* START AjaxControlToolkit.CollapsiblePanel.CollapsiblePanelBehavior.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />
/// <reference path="../ExtenderBase/BaseScripts.js" />
/// <reference path="../Common/Common.js" />
/// <reference path="../Compat/Timer/Timer.js" />
/// <reference path="../Animation/Animations.js" />


Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.CollapsiblePanelExpandDirection = function() {
    /// <summary>
    /// The CollapsiblePanelExpandDirection enumeration describes whether the panel is opened vertically or horizontally
    /// </summary>
    /// <field name="Horizontal" type="Number" integer="true" />
    /// <field name="Vertical" type="Number" integer="true" />
    throw Error.invalidOperation();
}
AjaxControlToolkit.CollapsiblePanelExpandDirection.prototype = {
    Horizontal : 0,
    Vertical: 1
}
AjaxControlToolkit.CollapsiblePanelExpandDirection.registerEnum("AjaxControlToolkit.CollapsiblePanelExpandDirection", false);


AjaxControlToolkit.CollapsiblePanelBehavior = function(element) {
    /// <summary>
    /// The CollapsiblePanelBehavior allows you to add collapsible sections to your page
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// Element to associate the behavior with
    /// </param>
    AjaxControlToolkit.CollapsiblePanelBehavior.initializeBase(this, [element]);
    
    // property values
    this._collapsedSize = 0;
    this._expandedSize = 0;
    this._scrollContents = null;    
    this._collapsed = false;    
    this._expandControlID = null;
    this._collapseControlID = null;
    this._textLabelID = null;    
    this._collapsedText = null;
    this._expandedText = null;
    this._imageControlID = null;
    this._expandedImage = null;
    this._collapsedImage = null;
    this._suppressPostBack = null;
    this._autoExpand = null;
    this._autoCollapse = null;
    this._expandDirection = AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical;
    
    // handler delegates
    this._collapseClickHandler = null;
    this._expandClickHandler = null;    
    this._panelMouseEnterHandler = null;    
    this._panelMouseLeaveHandler = null;
    
    // the div we wrap around the panel contents
    this._childDiv = null;
    
    // Animation used to open/close the panel
    this._animation = null;
}
AjaxControlToolkit.CollapsiblePanelBehavior.prototype = {    
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>
        AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this, 'initialize');
        
        var element = this.get_element();
        this._animation = new AjaxControlToolkit.Animation.LengthAnimation(element, .25, 10, 'style', null, 0, 0, 'px');
        if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
            this._animation.set_propertyKey('height');
        } else if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal) {
           this._animation.set_propertyKey('width');
        }
        this._animation.add_ended(Function.createDelegate(this, this._onAnimateComplete));
        
        // for checkboxes, we don't want to suppress the posback (e.g. return false)
        // because that stops them from toggling their state.
        //           
        if (this._suppressPostBack == null) {
            if (element.tagName == "INPUT" && element.type == "checkbox") {
                this._suppressPostBack = false;
                this.raisePropertyChanged('SuppressPostBack');
            }                    
            else if (element.tagName == "A") {
                this._suppressPostBack = true;
                this.raisePropertyChanged('SuppressPostBack');
            }
        }
        
        
        // Check our client state.  If it's present,
        // that means this is a postback, so we restore the state.
        //
        var lastState = AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this, 'get_ClientState');                
        if (lastState && lastState != "") {
            var wasCollapsed = Boolean.parse(lastState);  
            if (this._collapsed != wasCollapsed) {
                this._collapsed = wasCollapsed;
                this.raisePropertyChanged('Collapsed');       
            }
        }
        
        this._setupChildDiv();        
        
        // setup the initial size and state
        //
        if (this._collapsed) {
            this._setTargetSize(this._getCollapsedSize());            
        } else {            
            this._setTargetSize(this._getExpandedSize());
        } 
        
        this._setupState(this._collapsed);
        
        // setup all of our handlers.
        if (this._collapseControlID == this._expandControlID) {
            this._collapseClickHandler = Function.createDelegate(this, this.togglePanel);
            this._expandClickHandler = null; // we don't need both if we're toggling.
        } else {
            this._collapseClickHandler = Function.createDelegate(this, this.collapsePanel);
            this._expandClickHandler = Function.createDelegate(this, this.expandPanel);       
        }
        
        if (this._autoExpand) {
            this._panelMouseEnterHandler = Function.createDelegate(this, this._onMouseEnter);
            $addHandler(element, 'mouseover', this._panelMouseEnterHandler);
        }       
        if (this._autoCollapse) {
            this._panelMouseLeaveHandler = Function.createDelegate(this, this._onMouseLeave);
            $addHandler(element, 'mouseout', this._panelMouseLeaveHandler);
        }
        
        // attach the click handlers
        //
        if (this._collapseControlID) {
            var collapseElement = $get(this._collapseControlID);
            if (!collapseElement) {
                throw Error.argument('CollapseControlID', String.format(AjaxControlToolkit.Resources.CollapsiblePanel_NoControlID, this._collapseControlID));
            } else {
                $addHandler(collapseElement, 'click', this._collapseClickHandler);
            }
        }
        
        if (this._expandControlID) {
            if (this._expandClickHandler) { // if it's a toggle don't set up again
                var expandElement = $get(this._expandControlID);
                if (!expandElement) {
                    throw Error.argument('ExpandControlID', String.format(AjaxControlToolkit.Resources.CollapsiblePanel_NoControlID, this._expandControlID));
                } else {
                    $addHandler(expandElement, 'click', this._expandClickHandler);
                }
               
            }
        }
    },
    
    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        
        var element = this.get_element();
        
        if (this._collapseClickHandler) {
            var collapseElement = (this._collapseControlID ? $get(this._collapseControlID) : null);
            if (collapseElement) {
                $removeHandler(collapseElement, 'click', this._collapseClickHandler);
            }
            this._collapseClickHandler = null;
        }
        
        if (this._expandClickHandler) {
            var expandElement = (this._expandControlID ? $get(this._expandControlID) : null);
            if (expandElement) {
                $removeHandler(expandElement, 'click', this._expandClickHandler);
            }
            this._expandClickHandler = null;
        }
        
        if (this._panelMouseEnterHandler) {
            $removeHandler(element, 'mouseover', this._panelMouseEnterHandler);
        }
                
        if (this._panelMouseLeaveHandler) {
            $removeHandler(element, 'mouseout', this._panelMouseLeaveHandler);
        }
                
        if (this._animation) {
            this._animation.dispose();
            this._animation = null;
        }
        
        AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this, 'dispose');
    },

    togglePanel : function(eventObj) {
        /// <summary>
        /// Event handler to epxand or collapse the panel (based on its current state)
        /// This is the public function that should be called instead of _toggle if
        /// you wish to programmatically open and close the collapsible panel.
        /// </summary>
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true" optional="true">
        /// Event Info
        /// </param>

        this._toggle(eventObj);
    },    
    
    expandPanel : function(eventObj) {
        /// <summary>
        /// Open the panel. Public function that users should call if they
        /// wish to operate the collapsible panel programmatically.
        /// _doOpen should be treated as private since it has an underscore 
        /// to begin the function name.
        /// </summary>    
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true" optional="true">
        /// Event Info
        /// </param>
        
        this._doOpen(eventObj);    
    },
    
    collapsePanel : function(eventObj) {
        /// <summary>
        /// Collapse the panel. Public function that users should call if they
        /// wish to operate the collapsible panel programmatically.
        /// _doClose should be treated as private since it has an underscore 
        /// to begin the function name.
        /// </summary>    
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true" optional="true">
        /// Event Info
        /// </param>
        
        this._doClose(eventObj);
    },
    
    _checkCollapseHide : function() {
        /// <summary>
        /// Check if a control is collapsed and hidden
        /// (and set its display to none if it is supposed to be hidden)
        /// </summary>
        /// <returns type="Boolean">
        /// Whether the control is collapsed and hidden
        /// </returns>

        if (this._collapsed && this._getTargetSize() == 0) {
            var e = this.get_element();
            var display = $common.getCurrentStyle(e, 'display');
            if (!e.oldDisplay && display != "none") {
                e.oldDisplay = display;
                e.style.display = "none";
            }
            return true;
        }
        return false;
    },
    
    _doClose : function(eventObj) {
        /// <summary>
        /// Collapse the panel. Internal function, to close call "collapsePanel".
        /// </summary>
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true" optional="true">
        /// Event Info
        /// </param>
        
        var eventArgs = new Sys.CancelEventArgs();
        this.raiseCollapsing(eventArgs);
        if (eventArgs.get_cancel()) {
            return;
        }
    
        if (this._animation) {
            // stop any running animation.
            this._animation.stop();        
            
            // setup the animation state
            this._animation.set_startValue(this._getTargetSize());
            this._animation.set_endValue(this._getCollapsedSize());
            
            // do it!
            this._animation.play();
        }
        
        this._setupState(true);
                
        // stop postback if necessary.
        if (this._suppressPostBack) {
            if (eventObj && eventObj.preventDefault) {
                eventObj.preventDefault();
            } else {
                if (event) {
                    event.returnValue = false;
                }
                return false;
            }
        }
    },
    
    _doOpen : function(eventObj) {
        /// <summary>
        /// Expand the Panel. Internal function, to close call "expandPanel".
        /// </summary>
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true" optional="true">
        /// Event Info
        /// </param>
    
        var eventArgs = new Sys.CancelEventArgs();
        this.raiseExpanding(eventArgs);
        if (eventArgs.get_cancel()) {
            return;
        }
        
        // stop any existing animation
        if (this._animation) {
            this._animation.stop();
            var e = this.get_element();
            
            if (this._checkCollapseHide() && $common.getCurrentStyle(e, 'display', e.style.display)) {
                if (e.oldDisplay) {
                    e.style.display = e.oldDisplay;
                } else {
                    // IE isn't compliant on this one
                    if (e.style.removeAttribute) {
                        e.style.removeAttribute("display");
                    } else {
                       e.style.removeProperty("display");
                    }
                }
                e.oldDisplay = null;
            }
            
            // setup the animation state
            this._animation.set_startValue(this._getTargetSize());
            this._animation.set_endValue(this._getExpandedSize());
            
            // do it!
            this._animation.play();
        }
        
        // relect our state changes
        this._setupState(false);
        
        // stop the postback if necessary.
        //
        if (this._suppressPostBack) {
            if (eventObj && eventObj.preventDefault) {
                eventObj.preventDefault();
            } else {
                if (event) {
                    event.returnValue = false;
                }
                return false;
            }
        }
    },
    
    _onAnimateComplete : function() {
        /// <summary>
        /// Handler to listen for the end of the expand/collapse animation
        /// </summary>
    
        var e = this.get_element();
    
        // if we're fully expanded and the inner pannel is still smaller
        // than the size we've expanded to, fall back to auto
        //    
        if (!this._collapsed && !this._expandedSize)
        {
            if(this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
                if(this._childDiv.offsetHeight <= e.offsetHeight) {
                   e.style.height = "auto";
                   this.raisePropertyChanged('TargetHeight');
                } 
                else {
                    this._checkCollapseHide();
                }
            }
            else // horizontal
            {
                if( this._childDiv.offsetWidth <= e.offsetWidth) {
                   e.style.width = "auto";
                   this.raisePropertyChanged('TargetWidth');
                }
                else {
                    this._checkCollapseHide();
                }
            }
        }
        else {
            this._checkCollapseHide();
        }
        
        if (this._collapsed) {
            this.raiseCollapseComplete();
            this.raiseCollapsed(Sys.EventArgs.Empty);
        } else {
            this.raiseExpandComplete()
            this.raiseExpanded(new Sys.EventArgs());
        }
    },
    
    _onMouseEnter : function(eventObj) {
        /// <summary>
        /// OnMouseOver Handler
        /// </summary>
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true">
        /// Event Info
        /// </param>       
        if (this._autoExpand) {
            this.expandPanel(eventObj);
        }
    },
    
    _onMouseLeave : function(eventObj) {
        /// <summary>
        /// OnMouseOut Handler
        /// </summary>
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true">
        /// Event Info
        /// </param>      
        if (this._autoCollapse) {
           this.collapsePanel(eventObj);
        }
    },
    
    _getExpandedSize : function() {
        /// <summary>
        /// Get the size of the panel when fully expanded
        /// </summary>
        /// <returns type="Number" integer="true">
        /// Size of the panel when fully expanded
        /// </returns>
    
        if (this._expandedSize) {
            return this._expandedSize;
        }                
        
        if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
            return this._childDiv.offsetHeight;
        } else if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal) {
            return this._childDiv.offsetWidth;
        }
    },
    
    _getCollapsedSize : function() {
        /// <summary>
        /// Get the size of the panel when fully collapsed
        /// </summary>
        /// <returns type="Number" integer="true">
        /// Size of the panel when fully collapsed
        /// </returns>

        if (this._collapsedSize) {
            return this._collapsedSize;
        }
        
        return 0;
    },
    
     _getTargetSize : function() {
         /// <summary>
         /// Get the target size of the Panel
         /// </summary>
         /// <returns type="Number" integer="true">
         /// Target size of the Panel
         /// </returns>

        var value;
        if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
           value = this.get_TargetHeight();
        } else if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal) {
           value = this.get_TargetWidth();
        }       
        
        // Safari returns undefined if display is 'none'
        //
        if (value === undefined) {
            value = 0;
        }
        return value;
    },
    
    _setTargetSize : function(value) {
        /// <summary>
        /// Set the target size of the panel
        /// </summary>
        /// <param name="value" type="Number" integer="true">
        /// Target size of the panel
        /// </param>

        // we don't always want to set the target size here.
        // if we don't have an expanded size, and we're not collapsed,
        // and we're at (or past) our "maximum" size
        //
        var useSize = this._collapsed || this._expandedSize;
        var e = this.get_element();
        if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
            if (useSize || value < e.offsetHeight) {
                this.set_TargetHeight(value);
            } else {
                // if we're at our maximum size, flip to auto 
                // so that nested collapsible panels will
                // work properly.
                //
                e.style.height = "auto";
                this.raisePropertyChanged('TargetHeight');
            }
        } else if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal) {
            if (useSize || value < e.offsetWidth) {
                this.set_TargetWidth(value);
            }
            else {
                e.style.width = "auto";
                this.raisePropertyChanged('TargetWidth');
            }            
        }
        this._checkCollapseHide();
    },
    
    _setupChildDiv : function() {
        /// <summary>
        /// Set up a child div to host our panel contents
        /// and then push the panel's children into it.
        /// </summary>

        
        var startSize = this._getTargetSize();
        
        var e = this.get_element();
                
        this._childDiv = e.cloneNode(false);
        this._childDiv.id = '';
        
        // move all children into the div.
        //
        while (e.hasChildNodes()) {            
            var child = e.childNodes[0];
            child = e.removeChild(child);
            this._childDiv.appendChild(child);                
        }

        //On Parent
        e.style.padding = "";
        e.style.border = "";

        // Setup scrolling on the child div and parent by only altering the scrolling 
        // for the expand direction letting the other fall into place naturally.
        if (this._scrollContents) {
            if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
                e.style.overflowY = "scroll";
                this._childDiv.style.overflowY = ""; 
            } else {
                e.style.overflowX = "scroll";
                this._childDiv.style.overflowX = ""; 
            }
            // safari and opera do not recognize overflowX and overflowY
            if (Sys.Browser.agent == Sys.Browser.Safari || Sys.Browser.agent == Sys.Browser.Opera) {
                e.style.overflow = "scroll";
                this._childDiv.style.overflow = "";
            }
            
         }
         else {
            if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
                e.style.overflowY = "hidden";
                this._childDiv.style.overflowY = ""; 
            } else {
                e.style.overflowX = "hidden";
                this._childDiv.style.overflowX = ""; 
            }
            // safari and opera do not recognize overflowX and overflowY
            if (Sys.Browser.Agent == Sys.Browser.Safari || Sys.Browser.Agent == Sys.Browser.Opera) {
                e.style.overflow = "hidden";
                this._childDiv.style.overflow = "";
            }            
         }

        //Delete some style after cloneNode
        //On Clone
        this._childDiv.style.position = ""; 
        this._childDiv.style.margin   = ""; 
        
        // we optimize for the case where the original size is the collapsed size.
        // if that's the case, we go ahead and set the inner panel to auto so you 
        // can still expand it but not see it expanded by default when the page loads.
        //
        if (startSize == this._collapsedSize) {
            if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
                this._childDiv.style.height = "auto"; 
            } else if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal) {
                this._childDiv.style.width = "auto"; 
            }
        }
        
        e.appendChild(this._childDiv);
        
        if (this._collapsed) {
            startSize = this._getCollapsedSize();
        }
        else {
            startSize = this._getExpandedSize();
        }
            
        // set up our initial size
        //    
        if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical) {
            e.style.height = startSize + "px";
            
            if (!this._expandedSize) {
                e.style.height = "auto";
            }
            else {
               e.style.height = this._expandedSize + "px";
            }
            this._childDiv.style.height = "auto";

        } else if (this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal) {
            e.style.width = startSize + "px";
            
            if (!this._expandedSize) {
                e.style.width = "auto";
            }
            else {
               e.style.width = this._expandedSize + "px";
            }
            this._childDiv.style.width = "auto";
        }    
    },
    
    _setupState : function(isCollapsed) {
        /// <summary>
        /// Get all the state set consistently when we change modes
        /// </summary>
        /// <param name="isCollapsed" type="Boolean">
        /// True to setup the state as if we're collapsed, false to setup the state as if we're expanded
        /// </param>

    
        if (isCollapsed) {           
        
            // change the text label ID if we have one.
            //
            if (this._textLabelID && this._collapsedText) {
                var e = $get(this._textLabelID);
                
                if (e) {
                    e.innerHTML = this._collapsedText;
                }
            }
            
            // Change the image if we have one
            if (this._imageControlID && this._collapsedImage) {
                var i = $get(this._imageControlID);
                if (i && i.src) {
                    i.src = this._collapsedImage;
                    if (this._expandedText || this._collapsedText) {
                        i.title = this._collapsedText;
                    }
                }
            }            
        }
        else {  
            if (this._textLabelID && this._expandedText) {
                var e = $get(this._textLabelID);
                
                if (e) {
                    e.innerHTML = this._expandedText;
                }
            }
            
            // Change the image if we have one
            if (this._imageControlID && this._expandedImage) {
                var i = $get(this._imageControlID);
                if (i && i.src) {
                    i.src = this._expandedImage;
                    if (this._expandedText || this._collapsedText) {
                            i.title = this._expandedText;
                    }
                }
            }        
        } 
        
        // set our member variable and set the client state to reflect it
        // 
        if (this._collapsed != isCollapsed) {
            this._collapsed = isCollapsed;        
            this.raisePropertyChanged('Collapsed');
        }
        AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this, 'set_ClientState', [this._collapsed.toString()]);                        
    },
    
    _toggle : function(eventObj) {
        /// <summary>
        /// Event handler to epxand or collapse the panel (based on its current state)
        /// Internal function. Please use "togglePanel(eventObj)" to get same functionality.
        /// </summary>
        /// <param name="eventObj" type="Sys.UI.DomEvent" mayBeNull="true" optional="true">
        /// Event Info
        /// </param>

        if (this.get_Collapsed()) {
            return this.expandPanel(eventObj);
        } else {
            return this.collapsePanel(eventObj);
        }
    },
    
    add_collapsing : function(handler) {
        /// <summary>
        /// Add an event handler for the collapsing event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('collapsing', handler);
    },
    remove_collapsing : function(handler) {
        /// <summary>
        /// Remove an event handler from the collapsing event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('collapsing', handler);
    },
    raiseCollapsing : function(eventArgs) {
        /// <summary>
        /// Raise the collapsing event
        /// </summary>
        /// <param name="eventArgs" type="Sys.CancelEventArgs" mayBeNull="false">
        /// Event arguments for the collapsing event
        /// </param>
        /// <returns />
        
        var handler = this.get_events().getHandler('collapsing');
        if (handler) {
            handler(this, eventArgs);
        }
    },
    
    add_collapsed : function(handler) {
        /// <summary>
        /// Add an event handler for the collapsed event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('collapsed', handler);
    },
    remove_collapsed : function(handler) {
        /// <summary>
        /// Remove an event handler from the collapsed event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('collapsed', handler);
    },
    raiseCollapsed : function(eventArgs) {
        /// <summary>
        /// Raise the collapsed event
        /// </summary>
        /// <param name="eventArgs" type="Sys.EventArgs" mayBeNull="false">
        /// Event arguments for the collapsed event
        /// </param>
        /// <returns />
        
        var handler = this.get_events().getHandler('collapsed');
        if (handler) {
            handler(this, eventArgs);
        }
    },

    add_collapseComplete : function(handler) {
        /// <summary>
        /// Add a handler to the collapseComplete event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        /// <obsolete>Use the collapsed event instead</obsolete>
    	this.get_events().addHandler('collapseComplete', handler);
    },
    remove_collapseComplete : function(handler) {
        /// <summary>
        /// Remove a handler from the collapseComplete event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        /// <obsolete>Use the collapsed event instead</obsolete>
    	this.get_events().removeHandler('collapseComplete', handler);
    },
    raiseCollapseComplete : function() {
        /// <summary>
        /// Raise the collapseComplete event
        /// </summary>
        /// <obsolete>Use the collapsed event instead</obsolete>
    	var handlers = this.get_events().getHandler('collapseComplete');
    	if (handlers) {
    		handlers(this, Sys.EventArgs.Empty);
    	}
    },
    
    add_expanding : function(handler) {
        /// <summary>
        /// Add an event handler for the expanding event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('expanding', handler);
    },
    remove_expanding : function(handler) {
        /// <summary>
        /// Remove an event handler from the expanding event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('expanding', handler);
    },
    raiseExpanding : function(eventArgs) {
        /// <summary>
        /// Raise the expanding event
        /// </summary>
        /// <param name="eventArgs" type="Sys.CancelEventArgs" mayBeNull="false">
        /// Event arguments for the expanding event
        /// </param>
        /// <returns />
        
        var handler = this.get_events().getHandler('expanding');
        if (handler) {
            handler(this, eventArgs);
        }
    },
    
    add_expanded : function(handler) {
        /// <summary>
        /// Add an event handler for the expanded event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('expanded', handler);
    },
    remove_expanded : function(handler) {
        /// <summary>
        /// Remove an event handler from the expanded event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('expanded', handler);
    },
    raiseExpanded : function(eventArgs) {
        /// <summary>
        /// Raise the expanded event
        /// </summary>
        /// <param name="eventArgs" type="Sys.EventArgs" mayBeNull="false">
        /// Event arguments for the expanded event
        /// </param>
        /// <returns />
        
        var handler = this.get_events().getHandler('expanded');
        if (handler) {
            handler(this, eventArgs);
        }
    },
    
    add_expandComplete : function(handler) {
        /// <summary>
        /// Add a handler to the expandComplete event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        /// <obsolete>Use the expanded event instead</obsolete>
    	this.get_events().addHandler('expandComplete', handler);
    },
    remove_expandComplete : function(handler) {
        /// <summary>
        /// Remove a handler from the expandComplete event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        /// <obsolete>Use the expanded event instead</obsolete>
    	this.get_events().removeHandler('expandComplete', handler);
    },
    raiseExpandComplete : function() {
        /// <summary>
        /// Raise the expandComplete event
        /// </summary>
        /// <obsolete>Use the expanded event instead</obsolete>
    	var handlers = this.get_events().getHandler('expandComplete');
    	if (handlers) {
    		handlers(this, Sys.EventArgs.Empty);
    	}
    },

    get_TargetHeight : function() {
        /// <value type="Number" integer="true">
        /// Wrap the height of the panel
        /// </value>
        return this.get_element().offsetHeight;        
    },
    set_TargetHeight : function(value) {        
        this.get_element().style.height = value + "px";        
        this.raisePropertyChanged('TargetHeight');
    },
    
    get_TargetWidth : function() {
        /// <value type="Number" integer="true">
        /// Wrap the width of the panel
        /// </value>
        return this.get_element().offsetWidth;        
    },
    set_TargetWidth : function(value) {
        this.get_element().style.width = value + "px"        
        this.raisePropertyChanged('TargetWidth');
    },
        
    get_Collapsed : function() {
        /// <value type="Boolean">
        /// Whether or not the panel is collapsed
        /// </value>
        return this._collapsed;        
    },    
    set_Collapsed : function(value) {
        // if we're changing values, and we're live, togglePanel.
        if (this.get_isInitialized() && this.get_element() && value != this.get_Collapsed()) {
            this.togglePanel();
        }
        else {
            this._collapsed = value;
            this.raisePropertyChanged('Collapsed');
        }
    },
    
    get_CollapsedSize : function() {
        /// <value type="Number" integer="true">
        /// The size of the target, in pixels, when it is in the collapsed state
        /// </value>
        return this._collapsedSize;
    },
    set_CollapsedSize : function(value) {
        if (this._collapsedSize != value) {
            this._collapsedSize = value;
            this.raisePropertyChanged('CollapsedSize');
        }
    },
    
    get_ExpandedSize : function() {
        /// <value type="Number" integer="true">
        /// The size of the target, in pixels, when it is in the expanded state
        /// </value>
        return this._expandedSize;
    },
    set_ExpandedSize : function(value) {
        if (this._expandedSize != value) {
            this._expandedSize = value;
            this.raisePropertyChanged('ExpandedSize');
        }
    },
    
    get_CollapseControlID : function() {
        /// <value type="String">
        /// ID of the control used to collapse the target when clicked
        /// </value>
        return this._collapseControlID;
    },
    set_CollapseControlID : function(value) {
        if (this._collapseControlID != value) {
            this._collapseControlID = value;
            this.raisePropertyChanged('CollapseControlID');
        }
    },
    
    get_ExpandControlID : function() {
        /// <value type="String">
        /// ID of the control used to expand the target when clicked
        /// </value>
        return this._expandControlID;
    },    
    set_ExpandControlID : function(value) {
        if (this._expandControlID != value) {
            this._expandControlID = value;
            this.raisePropertyChanged('ExpandControlID');
        }
    },
    
    get_ScrollContents : function() {
        /// <value type="Boolean">
        /// Whether to add a scrollbar when the contents are larger than the target (the contents will be clipped if false)
        /// </value>
        return this._scrollContents;
    },
    set_ScrollContents : function(value) {
        if (this._scrollContents != value) {
            this._scrollContents = value;
            this.raisePropertyChanged('ScrollContents');
        }
    },
    
    get_SuppressPostBack : function() {
        /// <value type="Boolean">
        /// Whether or not to suppress postbacks generated when the CollapseControlID or ExpandControlID elements are clicked
        /// </value>
        return this._suppressPostBack;
    },
    set_SuppressPostBack : function(value) {
        if (this._suppressPostBack != value) {
            this._suppressPostBack = value;
            this.raisePropertyChanged('SuppressPostBack');
        }
    },
    
    get_TextLabelID : function() {
        /// <value type="String">
        /// ID of the element where the "status text" for the target will be placed
        /// </value>
        return this._textLabelID;
    },
    set_TextLabelID : function(value) {
        if (this._textLabelID != value) {
            this._textLabelID = value;
            this.raisePropertyChanged('TextLabelID');
        }
    },
    
    get_ExpandedText : function() {
        /// <value type="String">
        /// Text to show in the element specified by TextLabelID when the target is expanded.  This text is also used as the alternate text of the image if ImageControlID has been provided.
        /// </value>
        return this._expandedText;
    },
    set_ExpandedText : function(value) {
        if (this._expandedText != value) {
            this._expandedText = value;
            this.raisePropertyChanged('ExpandedText');
        }
    },
    
    get_CollapsedText : function() {
        /// <value type="String">
        /// Text to show in the element specified by TextLabelID when the target is collapsed.  This text is also used as the alternate text of the image if ImageControlID has been provided.
        /// </value>
        return this._collapsedText;
    },
    set_CollapsedText : function(value) {
        if (this._collapsedText != value) {
            this._collapsedText = value;
            this.raisePropertyChanged('CollapsedText');
        }
    },
    
    get_ImageControlID : function() {
        /// <value type="String">
        /// ID of the <img> element where an icon indicating the collapsed status of the target will be placed
        /// </value>
        return this._imageControlID;
    },
    set_ImageControlID : function(value) {
        if (this._imageControlID != value) {
            this._imageControlID = value;
            this.raisePropertyChanged('ImageControlID');
        }
    },
    
    get_ExpandedImage : function() {
        /// <value type="String">
        /// Path to an image to show in the element specified by ImageControlID when the target is expanded
        /// </value>
        return this._expandedImage;
    },
    set_ExpandedImage : function(value) {
        if (this._expandedImage != value) {
            this._expandedImage = value;
            this.raisePropertyChanged('ExpandedImage');
        }
    },
    
    get_CollapsedImage : function() {
        /// <value type="String">
        /// Path to an image to show in the element specified by ImageControlID when the target is collapsed
        /// </value>
        return this._collapsedImage;
    },
    set_CollapsedImage : function(value) {
        if (this._collapsedImage != value) {
            this._collapsedImage = value;
            this.raisePropertyChanged('CollapsedImage');
        }
    },
    
    get_AutoExpand : function() {
        /// <value type="Boolean">
        /// Whether to automatically expand the target when the mouse is moved over it
        /// </value>
        return this._autoExpand;
    },
    set_AutoExpand : function(value) {
        if (this._autoExpand != value) {
            this._autoExpand = value;
            this.raisePropertyChanged('AutoExpand');
        }
    },
    
    get_AutoCollapse : function() {
        /// <value type="Boolean">
        /// Whether to automatically collapse the target when the mouse is moved off of it
        /// </value>
        return this._autoCollapse;
    },
    set_AutoCollapse : function(value) {
        if (this._autoCollapse != value) {
            this._autoCollapse = value;
            this.raisePropertyChanged('AutoCollapse');
        }
    },    
    
    get_ExpandDirection : function() {
        /// <value type="AjaxControlToolkit.CollapsiblePanelExpandDirection">
        /// Direction the panel will expand and collapse (can be either "Vertical" or "Horizontal")
        /// </value>
        return this._expandDirection == AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical;
    },      
    set_ExpandDirection : function(value) {
        if (this._expandDirection != value) {
            this._expandDirection = value;
            this.raisePropertyChanged('ExpandDirection');
        }
    }
}
AjaxControlToolkit.CollapsiblePanelBehavior.registerClass('AjaxControlToolkit.CollapsiblePanelBehavior', AjaxControlToolkit.BehaviorBase);
//    getDescriptor : function() {
//        var td = AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this, 'getDescriptor');
//        
//        // lots of properties to add here
//        //
//        td.addProperty('CollapsedSize', Number);        
//        td.addProperty('ExpandedSize', Number);        
//        td.addProperty('CollapseControlID', String);        
//        td.addProperty('ExpandControlID', String);        
//        td.addProperty('Collapsed', Boolean);
//        td.addProperty('ScrollContents', Boolean);
//        td.addProperty('SuppressPostBack', Boolean);
//        td.addProperty('AutoExpand', Boolean);        
//        td.addProperty('AutoCollapse', Boolean);        
//        td.addProperty('CollapsedText', String);
//        td.addProperty('ExpandedText', String);
//        td.addProperty('TextLabelID', String);
//        td.addProperty('CollapsedImage', String);
//        td.addProperty('ExpandedImage', String);
//        td.addProperty('ImageControlID', String);
//        td.addProperty('ExpandDirection', AjaxControlToolkit.CollapsiblePanelExpandDirection);
//        
//        // these are for internal use
//        //
//        td.addProperty('TargetHeight', Number);
//        td.addProperty('TargetWidth', Number);
//        
//        // events
//        //
//        td.addEvent('collapseComplete', true);
//        td.addEvent('expandComplete', true);
//        
//        return td;
//    },

/* END AjaxControlToolkit.CollapsiblePanel.CollapsiblePanelBehavior.js */
/* START AjaxControlToolkit.Accordion.AccordionBehavior.js */
// (c) Copyright Microsoft Corporation.
// this source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />
/// <reference path="../ExtenderBase/BaseScripts.js" />
/// <reference path="../Common/Common.js" />
/// <reference path="../Compat/Timer/Timer.js" />
/// <reference path="../Animation/Animations.js" />


// Some of the techniques used in this.script were adapted with permission from Bertrand
// LeRoy's MIX06 Demo (http://weblogs.asp.net/bleroy/archive/2006/03/28/441343.aspx)

Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.AutoSize = function() {
    /// <summary>
    /// The AutoSize enumeration is used to specify how the AccordionBehavior limits
    /// the growth of the accordion when panes are expanded and collapsed.  It must
    /// correspond to the AutoSize CLR enumeration in AutoSize.cs.
    /// </summary>
    /// <field name="None" type="Number" integer="true">
    /// Allow the accordion to expand/collapse without restriction.
    /// </field>
    /// <field name="Fill" type="Number" integer="true">
    /// Keep the accordion the same size as its specified size.  If any
    /// panes are larger or smaller than the available space, grow or shrink
    /// them to the available space.
    /// </field>
    /// <field name="Limit" type="Number" integer="true">
    /// Prevent the accordion from growing any larger than its specified size.
    /// If the content of a pane is too large to fit, grow it to fill the
    /// remaining space.
    /// </field>
    throw Error.invalidOperation();
}
AjaxControlToolkit.AutoSize.prototype = {
    None : 0,
    Fill : 1,
    Limit : 2
}
AjaxControlToolkit.AutoSize.registerEnum("AjaxControlToolkit.AutoSize", false);


AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs = function(oldIndex, selectedIndex) {
    /// <summary>
    /// Event arguments used to provide notification when an accordion's selected
    /// index is changed.  The same event argument type is used for both the
    /// selectedIndexChanging event and the selectedIndexChanged events.  If you set
    /// the cancel property to true during the selectedIndexChanging event, the
    /// accordion will not change panes.  The cancel property has no effect during
    /// the selectedIndexChanged event.
    /// </summary>
    /// <param name="oldIndex" type="Number" integer="true" mayBeNull="false">
    /// Last selected index
    /// </param>
    /// <param name="selectedIndex" type="Number" integer="true" mayBeNull="false">
    /// New selected index
    /// </param>
    AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs.initializeBase(this);

    this._oldIndex = oldIndex;
    this._selectedIndex = selectedIndex;
}
AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs.prototype = {
    get_oldIndex : function() {
        /// <value type="Number" integer="true" mayBeNull="false">
        /// Last selected index
        /// </value>
        return this._oldIndex;
    },
    set_oldIndex : function(value) {
        this._oldIndex = value;
    },
    
    get_selectedIndex : function() {
        /// <value type="Number" integer="true" mayBeNull="false">
        /// New selected index
        /// </value>
        return this._selectedIndex;
    },
    set_selectedIndex : function(value) {
        this._selectedIndex = value;
    }
}
AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs.registerClass('AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs', Sys.CancelEventArgs);



// The Accordion layout is slightly complex because we support several AutoSize modes
// that are applied to an element collection across multiple events and animations.
// To make the code a little easier to understand, we'll provide a brief description
// of the element format, the control flow for laying out the elements, and an informal
// "correctness proof" of our algorithm.
//
// The Accordion server control will create a collection of panes which it will dump
// out as a sequence of <div>s where the (2i)th <div> is the ith header and the
// (2i+1)th <div> is the ith content section:
// 
//      <div id="Accordion" ... >
//          ...
//          <div id="2i" ... >Ith Header</div>
//          <div id="2i+1" ... >Ith Content</div>
//          ...
//      </div>
// 
// Because the <div>s may have padding, borders, or margins (we'll refer to these
// additional pixels as the "gutter"), we cannot collapse them all the way during
// animation (i.e. myDiv.style.height = '0px' will still show myDiv's padding,
// borders, and margins).  To work around this, we wrap all of the content section
// <div>s in wrappers that have no "gutter" style to end up with a tree of DOM
// elements that looks like:
// 
//      <div id="Accordion" ... >
//          ...
//          <div id="2i" ... >Ith Header</div>
//          <div id="2i+1 Wrapper">
//              <div id="2i+1 Original" ... >Ith Content</div>
//          </div>
//          ...
//      </div>
// 
// We automatically wrap the content section when it is passed to the addPane
// function.  From here on out, we'll refer to the behavior's target element (the
// root <div>) as the accordion, the dynamically created <div> as a wrapper, and
// the content section <div> as the original <div>.
//
// The primary purpose of the accordion is to expand and collapse its panes so that
// at most only one pane is open at a time.  We want to do this using animations for
// a polished effect, but we must also respect the AutoSize modes (where None allows
// the accordion to grow unrestrained, Limit provides a maximum height for the
// accordion, and Fill forces the accordion to always be the specified size).  Given
// the structure of an accordion, original <div>s, and wrapper <div>s, we accomplish
// the layout requirements using the following CSS properties:
//      Accordion root <div>:
//          height
//          overflow
//      Wrapper <div>:
//          height
//          opacity
//          overflow
//          display
//      Original content section <div>:
//          height
//          maxHeight
//          overflow
// 
// The large table below precisely defines the expected value of the properties at
// any given point in time.  Each of the columns 1 through 8 represents a possible
// state of the accordion.  Most of the time the accordion will be in states 1 and 5
// until the user clicks a header section and triggers a series of changes.  The rows
// of the table represent the properties of elements in a particular AutoSize mode.
// For example, a closed wrapper <div> with the Limit AutoSize mode should have a value
// of '0px' for its height.  Most of the properties in the the table are literal values
// like 'auto', 'hidden', '0px', etc.  The value Current for a property is used to
// indicate that a height set to 'auto' should be assigned its explicit value (i.e.
// element.offsetHeight) so that it will not be able to grow/shrink during an animation.
// The value Remaining for a height property refers specifically to the available space
// remaining after all the header sections of the accordion have been taken into
// consideration (this is used specifically for setting the size of the open content
// section when working in Limit or Fill AutoSize modes).  It's important to note that
// the Remaining value, retrieved by calling _getRemainingHeight, is slightly different
// for a wrapper <div> compared to a an original <div> because it must also consider the
// "gutter" offsets for an original <div>.  Finally, the animations (columns 3 and 7)
// are represented as transformations that take one property value to another when played.
//
//    ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+
//                            |  +---                         Closing an open pane                                    |                              Opening a closed pane                          <--+  |
//        AutoSize Mode       |  |        1.              2.                  3.                  4.                  |       5.              6.                  7.                  8.               |  |
//            Element         |  +-->     Opened   ->     Before Closing  ->  Closing      ->     After Closing     --+->     Closed    ->    Before Opening  ->  Opening     ->      After Opening ---+  |
//                Property    |           Pane            Animation           Animation           Animation           |       Pane            Animation           Animation           Animation           |
//    ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+
//        None:               |                                                                                       |                                                                                   |
//            Accordion:      |                                                                                       |                                                                                   |
//                height:     |           'auto'          .                   .                   .                   |       'auto'          .                   .                   .                   |
//                overflow:   |           'auto'          .                   .                   'auto'              |       'auto'          .                   .                   'auto'              |
//            Wrapper:        |                                                                                       |                                                                                   |
//                height:     |           'auto'          .                   Current -> '0px'    .                   |       '0px'           .                   '0px' -> Current    'auto'              |
//                opacity:    |           1.0             .                   1.0 -> 0.0          .                   |       0.0             .                   0.0 -> 1.0          .                   |
//                overflow:   |           'auto'          'hidden'            .                   .                   |       'hidden'        .                   .                   'auto'              |
//                display:    |           'block'         .                   .                   'none'              |       'none'          'block'             .                   .                   |
//            Original:       |                                                                                       |                                                                                   |
//                height:     |           'auto'          .                   .                   .                   |       'auto'          .                   .                   .                   |
//                maxHeight:  |           ''              .                   .                   .                   |       ''              .                   .                   .                   |
//                overflow:   |           'auto'          'hidden'            .                   .                   |       'hidden'        .                   .                   'auto'              |
//    ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+
//        Limit:              |                                                                                       |                                                                                   |
//            Accordion:      |                                                                                       |                                                                                   |
//                height:     |           Current         .                   .                   .                   |       Current         .                   .                   .                   |
//                overflow:   |           'hidden'        .                   .                   .                   |       'hidden'        .                   .                   .                   |
//            Wrapper:        |                                                                                       |                                                                                   |
//                height:     |           'auto'          Remaining           Remaining -> '0px'  .                   |       '0px'           .                   '0px' -> Remaining  'auto'              |
//                opacity:    |           1.0             .                   1.0 -> 0.0          .                   |       0.0             .                   0.0 -> 1.0          .                   |
//                overflow:   |           'auto'          'hidden'            .                   .                   |       'hidden'        .                   .                   'auto'              |
//                display:    |           'block'         .                   .                   'none'              |       'none'          'block'             .                   .                   |
//            Original:       |                                                                                       |                                                                                   |
//                height:     |           'auto'          .                   .                   .                   |       'auto'          .                   .                   .                   |
//                maxHeight:  |           Remaining       'auto'              .                   .                   |       'auto'          .                   .                   Remaining           |
//                overflow:   |           'auto'          'hidden'            .                   .                   |       'hidden'        .                   .                   'auto'              |
//    ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+
//        Fill:               |                                                                                       |                                                                                   |
//            Accordion:      |                                                                                       |                                                                                   |
//                height:     |           Current         .                   .                   .                   |       Current         .                   .                   .                   |
//                overflow:   |           'hidden'        .                   .                   .                   |       'hidden'        .                   .                   .                   |
//            Wrapper:        |                                                                                       |                                                                                   |
//                height:     |           'auto'          .                   .                   .                   |       'auto'          .                   .                   .                   |
//                opacity:    |           1.0             .                   1.0 -> 0.0          .                   |       0.0             .                   0.0 -> 1.0          .                   |
//                overflow:   |           'auto'          'hidden'            .                   .                   |       'hidden'        .                   .                   'auto'              |
//                display:    |           'block'         .                   .                   'none'              |       'none'          'block'             .                   .                   |
//            Original:       |                                                                                       |                                                                                   |
//                height:     |           Remaining       .                   Remaining -> '0px'  .                   |       '0px'           .                   '0px' -> Remaining  .                   |
//                maxHeight:  |           ''              .                   .                   .                   |       ''              .                   .                   .                   |
//                overflow:   |           'auto'          'hidden'            .                   .                   |       'hidden'        .                   .                   'auto'              |
//    ------------------------+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+
//
// Although this table is rather large, it's extremely useful because it allows
// us to present an informal argument for the correctness of our layout algorithm.
// It's easy to verify that if an accordion starts in state 1 and proceeds through
// steps 2, 3, and 4 when closing, it will arrive properly in state 5.  Similarly
// an accordion starting in state 5 that is opened will progress through steps 6, 7,
// and 8 to arrive back at step 1.  Clearly then any accordion starting in a valid
// state of 1 or 5 can be opened or closed repeatedly and return to a proper state.
// It's also worth pointing out that this layout algorithm can operate on one or two
// panes at a time (i.e. if all panes were closed and one were clicked, it would
// open a single pane...  but if one pane were already open and another were clicked,
// it would have to close one while opening the other).
//
// States 1 and 5 from the above table are implemented in the _intiailizeLayout and
// _initializePane functions.  States 2 and 6 are handled by the _startPaneChange
// function while states 4 and 8 are handled by the _endPaneChange function.  Finally,
// states 3 and 7 are intialized and played in the _changePanes function.



AjaxControlToolkit.AccordionBehavior = function(element) {
    /// <summary>
    /// The AccordionBehavior is used to turn properly structured XHTML into an
    /// Accordion with panes that can expand one at a time.
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// The DOM element the behavior is associated with.  It should contain an
    /// even number of child divs (such that ith pane has a header at div 2i and
    /// has content at div 2i+1).
    /// </param>
    AjaxControlToolkit.AccordionBehavior.initializeBase(this, [element]);
    
    // The _selectedIndex variable is used to track the currently visible content
    // pane.  It is persisted via ClientState so that it can be restored on PostBack.
    // If 0 <= _selectedIndex < _panes.Length is not true, then no pane is selected
    // (and they all appear collapsed).  While any index outside the bounds of the
    // _panes array indicates that no pane is selected, we don't automatically set
    // the value to a sentinel like -1 (especially on the server) because it's
    // possible for additional panes to be added at any time.  We abstract this
    // problem using the get_Pane() function which returns the selected pane when
    // it's called with no arguments (and returns null when the current selected
    // index is invalid).
    this._selectedIndex = 0;
    
    // The _panes array represents the collection of Accordion panes.  Each element of
    // the array is an object of the form {header, content, animation} corresponding
    // to that pane's header section, content section, and the animation used to open
    // and close its content section.  The content element is a new div that has been
    // created to wrap the original div (so we can completely collapse it - even if it
    // has padding, margins, etc.) which is pointed to by a dynamic _original property.
    // The header element has a dynamic _index property indicating its position in the
    // Accordion's pane collection (used primarily by the headers' shared click handler).
    // Furthermore, the animation will either be an instance of LengthAnimation or
    // ParallelAnimation (in the latter case, it will have two children which are a
    // LengthAnimation and a FadeAnimation).  There will be two dynamic properties
    // _length and _fade pointing to each of these children (to easily set the length
    // and fadeEffect properties).  There is also a dynamic _ended property which is
    // an event handler to be fired when the animation is complete, a dynamic _opening
    // property to indicate whether the animation was opening or closing the pane, and
    // a dynamic _pane property to provide a reference to the pane that was being
    // animated.
    this._panes = [];
    
    // The this._fadeTransitions flag determines whether or not we enable a simple fade
    // animation effect on top of the opening and closing effect
    this._fadeTransitions = false;
    
    // The this._duration represents the transition duration of the animations in seconds
    this._duration = 0.25;
    
    // framesPerSecond is used to tune the animation to perform well depending on
    // the the type of effect being used an the number of accordion panes, etc.
    this._framesPerSecond = 30;
    
    // Determine how growth of the Accordion will be controlled.  If it is set to
    // None, then the Accordion can grow as large or as small as necessary.  If it is
    // set to Limit, then the Accordion will always be less than or equal to its
    // available space.  If it is set to Fill, then it will always be equal to its
    // available space.
    this._autoSize = AjaxControlToolkit.AutoSize.None;
    
    // Whether or not clicking the header will close the currently opened pane (which
    // leaves all the Accordion's panes closed)
    this._requireOpenedPane = true;
    
    // Whether or not we suppress the client-side click handlers of any elements
    // (including server controls like Button or HTML elements like anchor) in the header
    // sections of the Accordion
    this._suppressHeaderPostbacks = false;
    
    // Size of all the headers
    this._headersSize = 0;

    // The _headerClickHandler is a reference to the event handler that all the header
    // elements of our panes will be wired up to
    this._headerClickHandler = null;
    
    // The _headerSelectedCssClass is the css class applied to the selected header.    
    this._headerCssClass = '';
    
    // The _headerSelectedCssClass is the css class applied to the selected header.    
    this._headerSelectedCssClass = '';
    
    // The _headerSelectedCssClass is the css class applied to the selected header.    
    this._contentCssClass = '';
        
    // The _resizeHandler is a reference to the global event handler used to patch
    // up the accordion when the window is resized
    this._resizeHandler = null;
}
AjaxControlToolkit.AccordionBehavior.prototype = {
    initialize : function() {
        /// <summary>
        /// The initialize function is responsible for getting the selected index from
        /// the ClientState mechanism and walking the children of the behavior's target
        /// to find all of the accordion's child panes.  It builds up a collection of the
        /// panes from the headers and content sections.  Then we hide all the content
        /// sections that aren't selected and initialize the layout.
        /// </summary>
        /// <returns />
        AjaxControlToolkit.AccordionBehavior.callBaseMethod(this, 'initialize');
        
        // Create the onclick handler used by the accordion's headers
        this._headerClickHandler = Function.createDelegate(this, this._onHeaderClick);
        
        // Get the selected index from ClientState
        var state = this.get_ClientState();
        if (state !== null && state !== '') {
            this._changeSelectedIndex(parseInt(state), false, true);
        }
        
        // Walk the children of the target control to obtain the accordion's child panes.
        // We are expecting a hierarchy of divs that looks like:
        //   <div id="accordion">         this.element
        //     ...
        //     <div id="header_i"></div>   this.element.childNodes[2i]
        //     <div id="content_i"></div>  this.element.childNodes[2i+1]
        //     ...
        //   </div>
        // We'll turn this hierarchy of divs into objects filling the _panes collection.
        // See the comment above the _panes array for more details on the structure of
        // these objects.  It's also worth pointing out that we effectively "box" the
        // index so it can be passed by reference to the _getNextDiv function
        var nodes = this.get_element().childNodes;
        var index = { };
        for (index.value = 0; index.value < nodes.length; index.value++) {
            var header = this._getNextDiv(nodes, index);
            if (!header) {
                break;
            }
            var content = this._getNextDiv(nodes, index);
            if (content) {
                // Add the pane once we've found both a header and a content section
                // (but bump the loop index back so we don't skip an element when the
                // loop increments)
                this.addPane(header, content);
                index.value--;
            }
        }
        
        // Ensure we have an opened pane if we're required to (and use the first
        // pane if we don't have a valid selected index)
        if (this._requireOpenedPane && !this.get_Pane() && this._panes.length > 0) {
            this._changeSelectedIndex(0, false, true);
        }
        
        // Setup the layout for the given AutoSize mode
        this._initializeLayout();
    },
    
    _getNextDiv : function(nodes, index) {
        /// <summary>
        /// Get the next div in a sequence of child nodes starting at the
        /// given index
        /// </summary>
        /// <param name="nodes" type="Array" mayBeNull="false" elementMayBeNull="true"
        ///   elementType="Sys.UI.DomElement" elementDomElement="true">
        /// Array of child nodes (i.e. element.childNodes)
        /// </param>
        /// <param name="index" type="Object" mayBeNull="false">
        /// The index is an object of the form { value } where index.value represents
        /// the current index in the collection of nodes.  We wrap the index in an object
        /// to perform the .NET equivalent of boxing so it can be passed by reference.
        /// </param>
        /// <returns type="Sys.UI.DomElement" DomElement="true" mayBeNull="true">
        /// The next DOM element representing a div tag, starting at the provided index.
        /// </returns>
        
        var div = null;
        while (index.value < nodes.length && (div = nodes[index.value++])) {
            if (div.tagName && (div.tagName.toLowerCase() === 'div')) {
                break;
            }
        }
        return div;
    },
    
    addPane : function(header, content) {
        /// <summary>
        /// Create a new Accordion pane given references to its header and content divs
        /// and add it to the _panes collection.  We also wrap the content div in a new
        /// container div, add a click handler to the header div, etc.
        /// </summary>
        /// <param name="header" type="Sys.UI.DomElement" domElement="true" mayBeNull="false">
        /// Header element of the new Accordion pane
        /// </param>
        /// <param name="content" type="Sys.UI.DomElement" domElement="true" mayBeNull="false">
        /// Content element of the new Accordion pane
        /// </param>
        /// <returns type="Object" mayBeNull="false">
        /// New pane object added to the end of the Accordion's pane collection.  The pane
        /// is an object of the form {header, content, animation} corresponding to that
        /// pane's header section, content section, and the animation used to open and
        /// close its content section.  The content element is a new div that has been
        /// created to wrap the original div (so we can completely collapse it - even if it
        /// has padding, margins, etc.) which is pointed to by a dynamic _original property.
        /// The header element has a dynamic _index property indicating its position in the
        /// Accordion's pane collection (used primarily by the headers' shared click handler).
        /// Furthermore, the animation will either be an instance of LengthAnimation or
        /// ParallelAnimation (in the latter case, it will have two children which are a
        /// LengthAnimation and a FadeAnimation).  There will be two dynamic properties
        /// _length and _fade pointing to each of these children (to easily set the length
        /// and fadeEffect properties).  There is also a dynamic _ended property which is
        /// an event handler to be fired when the animation is complete, a dynamic _opening
        /// property to indicate whether the animation was opening or closing the pane, and
        /// a dynamic _pane property to provide a reference to the pane that was being
        /// animated.
        /// </returns>
    
        // Create the new pane object
        var pane = { };
        pane.animation = null;
        
        // Initialize the header
        pane.header = header;
        header._index = this._panes.length;
        $addHandler(header, "click", this._headerClickHandler);
        
        // Wrap the content in a new element
        var accordion = this.get_element();
        var wrapper = document.createElement('div');
        accordion.insertBefore(wrapper, content);
        wrapper.appendChild(content);
        wrapper._original = content;
        pane.content = wrapper;
    
        // Remove any style facets (possibly) automatically applied by
        // CSS selectors so they don't interfere with UI/layout
        wrapper.style.border = '';
        wrapper.style.margin = '';
        wrapper.style.padding = '';

        // Add the new pane at the bottom of the accordion
        Array.add(this._panes, pane);
        
        // Setup the layout attributes for the pane so that it will be in a proper opened or
        // closed state (we don't bother setting the opacity of the wrapper with
        // $common.setElementOpacity(wrapper, selected ? 1 : 0); because it will
        // be taken care of by the animation)
        this._initializePane(header._index);
        
        // Since the content section of the accordion panes will be sent down from the server
        // with display: none (so the content sections aren't shown before they're wrapped in
        // new divs) we'll turn them back on once they've been wrapped in hidden divs
        content.style.display = 'block';
        
        return pane;
    },
    
    _getAnimation : function(pane) {
        /// <summary>
        /// Get the animation for the specified accordion section or demand create
        /// the animation if it doesn't already exist.
        /// </summary>
        /// <param name="pane" type="Object" mayBeNull="false">
        /// The pane is an object of the form {header, content, animation} corresponding to
        /// that pane's header section, content section, and the animation used to open and
        /// close its content section.  The content element is a new div that has been created
        /// to wrap the original div (so we can completely collapse it - even if it has
        /// padding, margins, etc.) which is pointed to by a dynamic _original property. The
        /// header element has a dynamic _index property indicating its position in the
        /// Accordion's pane collection (used primarily by the headers' shared click
        /// handler). Furthermore, the animation will either be an instance of
        /// LengthAnimation or ParallelAnimation (in the latter case, it will have two
        /// children which are a LengthAnimation and a FadeAnimation).  There will be two
        /// dynamic properties _length and _fade pointing to each of these children (to
        /// easily set the length and fadeEffect properties).  There is also a dynamic _ended
        /// property which is an event handler to be fired when the animation is complete,
        /// a dynamic _opening property to indicate whether the animation was opening or
        /// closing the pane, and a dynamic _pane property to provide a reference to the pane
        /// that was being animated.
        /// </param>
        /// <returns type="AjaxControlToolkit.Animation.Animation">
        /// Animation for the desired section
        /// </returns>
        
        var animation = pane.animation;
        if (!animation) {
            // Determine whether or not to just use the length animation or build a
            // composite effect with fading transitions (note that only the parent
            // animation has the duration/fps specfied)
            var length = null;
            var fade = null;
            if (!this._fadeTransitions) {
                animation = length = new AjaxControlToolkit.Animation.LengthAnimation(pane.content, this._duration, this._framesPerSecond, "style", "height", 0, 0, "px");
            } else {
                length = new AjaxControlToolkit.Animation.LengthAnimation(null, null, null, "style", "height", 0, 0, "px");
                fade = new AjaxControlToolkit.Animation.FadeAnimation(null, null, null, AjaxControlToolkit.Animation.FadeEffect.FadeOut, 0, 1, false);
                animation = new AjaxControlToolkit.Animation.ParallelAnimation(pane.content, this._duration, this._framesPerSecond, [fade, length]);
            }
            
            // Create references to the length and fade animations so we can easily
            // set the length and fadeEffect properties when animating without having
            // to reach into the composite animation.
            pane.animation = animation;
            animation._length = length;
            animation._fade = fade;
            animation._pane = pane;
            animation._opening = true;
            animation._behavior = this;
            animation._ended = Function.createDelegate(pane.animation, this._onAnimationFinished);
            animation.add_ended(pane.animation._ended);
            
            animation.initialize();
        }
        return animation;
    },
    
    _onAnimationFinished : function() {
        /// <summary>
        /// _onAnimationFinished is an event handler played after an animation (to open/
        /// close an accordion pane) has completed.  The delegate for this function should
        /// have associated it with an animation (so the this references below are expecting
        /// to reach expando fields declared on the animation).  It invokes _endPaneChange
        /// for the current pane.
        /// </summary>
        /// <returns />
        this._behavior._endPaneChange(this._pane, this._opening);
    },
    
    _initializeLayout : function() {
        /// <summary>
        /// Setup the layout of the accordion (either when the behavior is created or when the
        /// AutoSize mode is changed).
        /// </summary>
        /// <returns />
        
        // Stop any animations that are still playing (i.e. that haven't finished opening
        // or closing from changing previous panes) in case the user changed the AutoSize
        // mode while an animation was playing.
         for (var i = 0; i < this._panes.length; i++) {
            var animation = this._panes[i].animation;
            if (animation && animation.get_isPlaying()) {
                animation.stop();
            }
        }
        
        // Cache the initial size of the accordion
        var accordion = this.get_element();
        this._initialHeight = accordion.offsetHeight;
        var style = accordion.style;
        
        
        // Initialize the accordion itself
        if (this._autoSize === AjaxControlToolkit.AutoSize.None) {
            // Remove the window resizing handler
            this._disposeResizeHandler();
            
            // IE7 appears to have a rendering quirk where it will hide the
            // accordion if we change height or overflow from the empty string
            // to auto when it's contained in a fixed size div.  We'll just not
            // change the value if that's the case.
            var isIE7 = (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version >= 7)
            if (!isIE7 || (isIE7 && style.height && style.height.length > 0)) {
                style.height = 'auto';
            }
            if (!isIE7 || (isIE7 && style.overflow && style.overflow.length > 0)) { 
                style.overflow = 'auto';
            }
        } else {
            // Add the window's resizing handler
            this._addResizeHandler();
            
            style.height = accordion.offsetHeight + 'px';
            style.overflow = 'hidden';
        }
        
        // Setup the layout attributes for the pane so that it will be in a proper opened
        // or closed state
        for (var i = 0; i < this._panes.length; i++) {
            this._initializePane(i);
        }
        
        // Resize the selected pane so (depending on the AutoSize mode) it will fill the
        // available remaining space after the headers have been laid out.
        this._resizeSelectedPane();
    },
    
    
    _initializePane : function(index) {
        /// <summary>
        /// Setup the layout attributes for the pane so that it will be in a proper opened or
        /// closed.  This will be called when adding a new pane for the first time or when
        /// changing the AutoSize mode.
        /// </summary>
        /// <param name="index" type="Number" integer="true">
        /// Index of the pane to initialize
        /// </param>
        /// <returns />
        
        var pane = this.get_Pane(index);
        if (!pane) {
            return;
        }
        var wrapper = pane.content;
        var original = wrapper._original;
        
        var opened = (index === this._selectedIndex);
        wrapper.style.height = (opened || (this._autoSize === AjaxControlToolkit.AutoSize.Fill)) ? 'auto' : '0px';
        wrapper.style.overflow = opened ? 'auto' : 'hidden';
        wrapper.style.display = opened ? 'block' : 'none';
        original.style.height = 'auto';
        original.style.maxHeight = ''; 
        original.style.overflow = opened ? 'auto' : 'hidden';
                
        var opacity = (opened || !this._fadeTransitions) ? 1 : 0;
        if (this._autoSize === AjaxControlToolkit.AutoSize.Fill) {
            if ($common.getElementOpacity(original) != opacity) {
                $common.setElementOpacity(original, opacity);
            }
            if ($common.getElementOpacity(wrapper) != 1) {
                $common.setElementOpacity(wrapper, 1);
            }
        } else {
            if ($common.getElementOpacity(wrapper) != opacity) {
                $common.setElementOpacity(wrapper, opacity);
            }
            if ($common.getElementOpacity(original) != 1) {
                $common.setElementOpacity(original, 1);
            }
        }
    },
    
    _addResizeHandler : function() {
        /// <summary>
        /// Attach the resize handler
        /// </summary>
        /// <returns />
        /// <remarks>
        /// This has been pulled out into its own method since we need to selectively wire
        /// up the resize handler depending on the AutoSize mode.
        /// </remarks>
        
        if (!this._resizeHandler) {
            this._resizeHandler = Function.createDelegate(this, this._resizeSelectedPane);
            $addHandler(window, "resize", this._resizeHandler);
        }
    },
    
    dispose : function() {
        /// <summary>
        /// Dispose of the AccordionBehavior
        /// </summary>
        /// <returns />
        
        // Remove the window resizing handler
        this._disposeResizeHandler();
        
        // Wipe all the animations
        this._disposeAnimations();
        
        // Wipe the _panes collection.  We're careful to wipe any expando properties
        // which could cause memory leaks in IE6.
        for (var i = this._panes.length - 1; i >= 0; i--) {
            var pane = this._panes[i];
            if (pane) {
                if (pane.header) {
                    pane.header._index = null;
                    $removeHandler(pane.header, "click", this._headerClickHandler);
                    pane.header = null;
                }
                if (pane.content) {
                    pane.content._original = null;
                    pane.content = null;
                }
                this._panes[i] = null;
                delete this._panes[i];
            }
        }
        this._panes = null;
        this._headerClickHandler = null;
        
        AjaxControlToolkit.AccordionBehavior.callBaseMethod(this, 'dispose');
    },
    
    _disposeResizeHandler : function() {
        /// <summary>
        /// Remove the resize handler
        /// </summary>
        /// <returns />
        /// <remarks>
        /// This has been pulled out into its own method since we need to selectively wire
        /// up the resize handler depending on the AutoSize mode.
        /// </remarks>
        
        if (this._resizeHandler) {
            $removeHandler(window, "resize", this._resizeHandler);
            this._resizeHandler = null;
        }
    },
    
    _disposeAnimations : function() {
        /// <summary>
        /// Dispose all the animations.  This method was pulled out of dispose so we could
        /// allow the user to change the FadeTransitions property after the behavior was
        /// already initialized.  We can merge it back into dispose once we support generic
        /// animations on the Accordion.
        /// </summary>
        /// <returns />
        
        for (var i = 0; i < this._panes.length; i++) {
            var animation = this._panes[i].animation;
            if (animation) {
                // Stop the animation if it was still playing
                if (animation.get_isPlaying()) {
                    animation.stop();
                }
                
                // Remove the event handler that runs after the animation completes
                if (animation._ended) {
                    animation.remove_ended(animation._ended);
                    animation._ended = null;
                }
                
                // Dispose the animation's resources (timer, etc.)
                animation.dispose();
                
                // Wipe expando properties to prevent leaks in IE6
                animation._length = null;
                animation._fade = null;
                animation._pane = null;
                animation._opening = null;
                animation._behavior = null;
                this._panes[i].animation = null;
            }
        }
    },
    
    _resizeSelectedPane : function() {
        /// <summary>
        /// Adjust the size of the currently selected pane (upon initialization,
        /// resizing the window, etc.)
        /// </summary>
        /// <returns />

        var pane = this.get_Pane();
        if (!pane) {
            return;
        }
        
        // Cache the header size so it only gets looked up when the window resizes
        this._headersSize = this._getHeadersSize().height;
        
        var original = pane.content._original;
        switch (this._autoSize) {
            case AjaxControlToolkit.AutoSize.None :
                original.style.height = 'auto';
                original.style.maxHeight = '';
                break;
            case AjaxControlToolkit.AutoSize.Limit :
                var remaining = this._getRemainingHeight(false);
                original.style.height = 'auto';
                original.style.maxHeight = remaining + 'px';
                break;
            case AjaxControlToolkit.AutoSize.Fill :
                var remaining = this._getRemainingHeight(true);
                original.style.height = remaining + 'px';
                original.style.maxHeight = '';
                break;
        }    
    },

    _onHeaderClick : function(evt) {
        /// <summary>
        /// OnClick handler to open the desired pane
        /// </summary>
        /// <param name="evt" type="Sys.UI.DomEvent" mayBeNull="false">Event info</param>
        /// <returns />
        
        // Get the header that raised the event (by walking up the event target's
        // control hierarchy until we find an element just below the root of the accordion)
        var header = evt.target;
        var accordion = this.get_element();
        while (header && (header.parentNode !== accordion)) {
            header = header.parentNode;
        }
        
        // Stop the event from bubbling out of the header pane and prevent any
        // action from happening unless we clicked a control inside the header
        evt.stopPropagation();
        if (this._suppressHeaderPostbacks) {
            evt.preventDefault();
        }
        
        // Select this pane (which saves it to ClientState and initiates an animation
        // to show the content pane).  If the user clicked the currently open pane and
        // we're not required to keep one pane open, then we'll set the selected index
        // to -1 which will close it (which means all panes will be collapsed).
        var index = header._index;
        if ((index === this._selectedIndex) && !this._requireOpenedPane) {
            index = -1;
        }
        this._changeSelectedIndex(index, true);
    },
    
    _changeSelectedIndex : function(index, animate, force) {
        /// <summary>
        /// Change the accordion's selected pane to a new index (and optionally show the change).
        /// </summary>
        /// <param name="index" type="Number" integer="true" mayBeNull="false">
        /// Index of the new selected pane
        /// </param>
        /// <param name="animate" type="Boolean" mayBeNull="false">
        /// Whether or not to show the pane change (this is primarily intended to support
        /// restoring _selectedIndex in initialize before any panes have been added)
        /// </param>
        /// <param name="force" type="Boolean" mayBeNull="true" optional="true">
        /// We perform no action (i.e. raising events, animating, etc.) if the two indices represent
        /// the same pane (including the case when we have two different "no pane selected values"
        /// like -1 and -500).  The force flag is used during initialization to skip this check since
        /// we aren't able to determine invalid values yet.
        /// </param>
        /// <returns />
        
        // Don't bother doing anything if the index didn't change (we actually check the
        // panes so any invalid indices will match because get_Pane() will return null for
        // both of them)
        var lastIndex = this._selectedIndex;
        var currentPane=this.get_Pane(index);
        var lastPane=this.get_Pane(lastIndex);
        if (!force && (currentPane == lastPane)) {
            return;
        }
        
        // Raise the selectedIndexChanging event but don't change the selected index
        // if the handler set the cancel property to true
        var eventArgs = new AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs(lastIndex, index);
        this.raiseSelectedIndexChanging(eventArgs);
        if (eventArgs.get_cancel()) {
            return;
        }
       
        //This sets the header CSS class to the non-selected case.
        if(lastPane)
        {
            lastPane.header.className = this._headerCssClass;
        }
        
        //This sets the selected header CSS class if available.
        if(currentPane)
        {
            currentPane.header.className = (this._headerSelectedCssClass == '') ? 
                this._headerCssClass : this._headerSelectedCssClass;
        }
       
        this._selectedIndex = index;
        
        // Save the selected pane to preserve on postbacks
        this.set_ClientState(this._selectedIndex);
        
        // Animate the pane changes if required
        if (animate) {
            this._changePanes(lastIndex);
        }
        
        // Raise the selectedIndexChanged event and the propertyChanged event.  We include
        // both events because many users have expressed that the propertyChanged event is
        // not discoverable.
        this.raiseSelectedIndexChanged(new AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs(lastIndex, index));
        this.raisePropertyChanged('SelectedIndex');
    },
    
    _changePanes : function(lastIndex) {
        /// <summary>
        /// The _changePanes function is used to animate the change between two panes when
        /// the selected index changes.  We will loop through each pane and get its
        /// animation (or demand create it if it doesn't have one yet), stop playing it if
        /// it's currently playing, change its parameters to either open or close, and then
        /// animate it.  Because we have an animation for each pane and we stop them if they
        /// were already playing, the Accordion has the ability to nicely change panes
        /// again before the animation is finished.
        /// </summary>
        /// <param name="lastIndex" type="Number" integer="true" mayBeNull="false">
        /// Index of the last selected Accordion pane
        /// </param>
        /// <returns />
        
        if (!this.get_isInitialized()) {
            return;
        }
        
        var open = null;
        var close = null;
        for (var i = 0; i < this._panes.length; i++) {
            // Get the animation for each pane (creating it on demand if it doesn't
            // already exist)
            var pane = this._panes[i];
            var animation = this._getAnimation(pane);

            // Stop any animations that are still playing (i.e. that haven't finished
            // opening or closing from changing previous panes)
            if (animation.get_isPlaying()) {
                animation.stop();
            }

            // If we're not opening or closing the current pane, then restart the loop.
            // We set the _opening flag so we don't have to keep checking if we're opening
            // or closing.  If opening, we also set the display style of the pane's content
            // so it will be visible for the animation
            if (i == this._selectedIndex) {
                animation._opening = true;
                open = animation;
            } else if (i == lastIndex) {
                animation._opening = false;
                close = animation;
            } else {
                continue;
            }
            
            // Get the pane ready to be animated by setting 
            this._startPaneChange(pane, animation._opening);
            
         
            // Setup the fade effect if we are using it
            if (this._fadeTransitions) {
                animation._fade.set_effect(animation._opening ? AjaxControlToolkit.Animation.FadeEffect.FadeIn : AjaxControlToolkit.Animation.FadeEffect.FadeOut );
            }
            
            // Set the length animation to either open or close depending on whether or
            // not this is the selected pane.  We also change the target to be the wrapper
            // or the original pane depending on whether the AutoSize mode is set to Fill
            // (because we need the background color, etc., to grow with the animation
            // which means changing the size of the original, not the wrapper, should grow).
            // We would prefer to animate the wrapper because it can collapse all the way to
            // 0px while the original can only collapse it's content size to 0px (leaving any
            // padding, margins, borders, etc.) which is why we need to factor in the size of
            // the original div's gutter pixels.  Animating the original content will also
            // cause the animation to jump slightly at the end when it collapses smoothly down
            // to the gutter pixels but then sets display: none and disappears.
            if (this._autoSize === AjaxControlToolkit.AutoSize.Fill) {
                animation.set_target(pane.content._original);
                animation._length.set_startValue($common.getContentSize(pane.content._original).height);
                animation._length.set_endValue(animation._opening ? this._getRemainingHeight(true) : 0);
            } else {
                animation.set_target(pane.content);
                animation._length.set_startValue(pane.content.offsetHeight);
                animation._length.set_endValue(animation._opening ? this._getRemainingHeight(false) : 0);
            }
        }
        
        // Play the animations to open the selected pane/close any other panes.  Note that we
        // pulled playing the animations out of the loop so that we could always play the
        // closing animation first.  If you play the opening animation first, in some cases the
        // accordion will always grow slightly larger (shifting the rest of the page down) and
        // then shrink again because the animations are running on different timers (and
        // unifying them into a single animation would be a lot messier than the current
        // implementation since they won't both play when we're closing the currently open pane).
        if (close) {
            close.play();
        }
        if (open) {
            open.play();
        }
        
        // TODO: Someday get both animations to run on the same timer because it makes an obvious
        // difference in IE6 and Safari
    },
    
    _startPaneChange : function(pane, opening) {
        /// <summary>
        /// Setup the pane before it is animated.
        /// </summary>
        /// <param name="pane" type="Object" mayBeNull="false">
        /// Pane that is being animated
        /// </param>
        /// <param name="opening" type="Boolean" mayBeNull="false">
        /// Whether or not the pane is being opened or closed
        /// </param>
        /// <returns />
        
        var wrapper = pane.content;
        var original = wrapper._original;
        
        if (opening) {
            // Make the hidden panes visible so we can see them animate
            wrapper.style.display = 'block';
        } else {
            // Hide any overflow because we'll be shrinking the wrapper div down to 0px and
            // we don't want content leaking out the bottom
            wrapper.style.overflow = 'hidden';
            
            // Turn off overflow on the original div because it's content doesn't grow during
            // the animation and leaving it on slows the animation down
            original.style.overflow = 'hidden';
            
            // Remove any explicit height off the original content section but manually set
            // the wrapper to the initial height (since it will be shrunk from this height
            // to zero)
            if (this._autoSize === AjaxControlToolkit.AutoSize.Limit) {
                wrapper.style.height = this._getTotalSize(original).height + 'px';
                original.style.maxHeight = '';
            }
        }
    },
    
    _endPaneChange : function(pane, opening) {
        /// <summary>
        /// Clean the pane up after it's been animated.
        /// </summary>
        /// <param name="pane" type="Object" mayBeNull="false">
        /// Pane that is being animated
        /// </param>
        /// <param name="opening" type="Boolean" mayBeNull="false">
        /// Whether or not the pane is being opened or closed
        /// </param>
        /// <returns />

        var wrapper = pane.content;
        var original = wrapper._original;
        
        if (opening) {
            // Depending on the mode, move the explicit height value from the original
            // content div to the wrapper div.  This is necessary because we moved the
            // explicit height value to the wrapper before the animation started since
            // it was the target.
            if (this._autoSize === AjaxControlToolkit.AutoSize.Limit) {
                var remaining = this._getRemainingHeight(true);
                original.style.maxHeight = remaining + 'px';
            }
            
            // Turn overflow back on so the original div's content can grow accordingly
            original.style.overflow = 'auto';
            
            // Remove an explicit height from the wrapper div so that it will
            // automatically grow and shrink with the original content div
            wrapper.style.height = 'auto';
            wrapper.style.overflow = 'auto';
        } else {
            // If we finished a close animation, completely hide the pane so that
            // it's content cannot be tabbed into
            wrapper.style.display = 'none';
        }
    },
    
    _getHeadersSize : function() {
        /// <summary>
        /// Compute the size of all the header sections
        /// </summary>
        /// <returns type="Object" mayBeNull="false">
        /// Size of all header sections (of the form {width, height}).
        /// </returns>
        
        // Compute the amount of space used by all the headers
        var total = { width: 0, height: 0 };
        for (var i = 0; i < this._panes.length; i++) {
            var size = this._getTotalSize(this._panes[i].header);
            total.width = Math.max(total.width, size.width);
            total.height += size.height;
        }
        return total;
    },
    
    _getRemainingHeight : function(includeGutter) {
        /// <summary>
        /// Determine how much remaining height we have to fill with the currently selected
        /// pane's content section after taking into account all the headers.  This is primarily
        /// used for the Limit and Fill AutoSize modes.
        /// </summary>
        /// <param name="includeGutter" type="Boolean" mayBeNull="false">
        /// Whether or not we should include the gutter (padding, borders, margins) of the
        /// selected pane's original content section.  This should be true whenever we're
        /// getting the remaining height for the original content section and false whenever
        /// we're getting the remaining height for its wrapper.
        /// </param>
        /// <returns type="Number" integer="true">
        /// Remaining height after all the headers have been accounted for
        /// </returns>    
        
        var height = 0;
        var pane = this.get_Pane();
        
        if (this._autoSize === AjaxControlToolkit.AutoSize.None) {
            // If the AutoSize mode is "None", then we use the size of the pane
            if (pane) { 
                height = this._getTotalSize(pane.content._original).height;
            }
        } else {
            // Compute the amount of space used
            height = this._headersSize;
            if (includeGutter && pane) {
                height += this._getGutterSize(pane.content._original).height;
            }
            
            // Determine how much of the remaining space to use
            // (if AutoSize is "Fill", use the rest of the available space)
            var accordion = this.get_element();
            height = Math.max(accordion.offsetHeight - height, 0);
            
            // If AutoSize is "Limit", then the size of the pane should be either its
            // actual size, or the rest of the available space.
            if (pane && (this._autoSize === AjaxControlToolkit.AutoSize.Limit)) {
                var required = this._getTotalSize(pane.content._original).height;
                // Ensure we return a number greater than or equal to zero
                if (required > 0) {
                    height = Math.min(height, required);
                }
            }
        }
        
        return height;
    },
    
    _getTotalSize : function(element) {
        /// <summary>
        /// Get the total size of an element, including its margins
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <returns type="Object">
        /// Total size of the element (in the form {width, height})
        /// </returns>
        
        var size = $common.getSize(element);
        var box = $common.getMarginBox(element);
        size.width += box.horizontal;
        size.height += box.vertical;
        return size;
    },
    
    _getGutterSize : function(element) {
        /// <summary>
        /// Get the extra "gutter" size around an element made up of its padding,
        /// borders, and margins.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <returns type="Object">
        /// Size of the extra space (in the form of {height, width})
        /// </returns>
        
        var gutter = { width: 0, height: 0 };
        
        try {
            var box = $common.getPaddingBox(element);
            gutter.width += box.horizontal;
            gutter.height += box.vertical;
        } catch(ex) { }
        
        try {
            var box = $common.getBorderBox(element);
            gutter.width += box.horizontal;
            gutter.height += box.vertical;
        } catch(ex) { }
        
        var box = $common.getMarginBox(element);
        gutter.width += box.horizontal;
        gutter.height += box.vertical;
        
        return gutter;
    },
    
    add_selectedIndexChanging : function(handler) {
        /// <summary>
        /// Add an event handler for the selectedIndexChanging event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('selectedIndexChanging', handler);
    },
    remove_selectedIndexChanging : function(handler) {
        /// <summary>
        /// Add an event handler for the selectedIndexChanging event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('selectedIndexChanging', handler);
    },
    raiseSelectedIndexChanging : function(eventArgs) {
        /// <summary>
        /// Raise the selectedIndexChanging event
        /// </summary>
        /// <param name="eventArgs" type="AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs" mayBeNull="false">
        /// Event arguments for the selectedIndexChanging event
        /// </param>
        /// <returns />
        
        var handler = this.get_events().getHandler('selectedIndexChanging');
        if (handler) {
            handler(this, eventArgs);
        }
    },
    
    add_selectedIndexChanged : function(handler) {
        /// <summary>
        /// Add an event handler for the selectedIndexChanged event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().addHandler('selectedIndexChanged', handler);
    },
    remove_selectedIndexChanged : function(handler) {
        /// <summary>
        /// Add an event handler for the selectedIndexChanged event
        /// </summary>
        /// <param name="handler" type="Function" mayBeNull="false">
        /// Event handler
        /// </param>
        /// <returns />
        this.get_events().removeHandler('selectedIndexChanged', handler);
    },
    raiseSelectedIndexChanged : function(eventArgs) {
        /// <summary>
        /// Raise the selectedIndexChanged event
        /// </summary>
        /// <param name="eventArgs" type="AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs" mayBeNull="false">
        /// Event arguments for the selectedIndexChanged event
        /// </param>
        /// <returns />
        
        var handler = this.get_events().getHandler('selectedIndexChanged');
        if (handler) {
            handler(this, eventArgs);
        }
    },
    
    get_Pane : function(index) {
        /// <summary>
        /// Get a specific Accordion pane given its index.  If no index is provided, get
        /// the currently selected pane.
        /// </summary>
        /// <param name="index" type="Number" integer="true" mayBeNull="true">
        /// Index of the desired Accordion pane.  If the index is not provided, we use
        /// the currently selected index.  In the event the provided index (or the currently
        /// selected index) is outside the bounds of the panes collection, we return null.
        /// </param>
        /// <returns type="Object" mayBeNull="true">
        /// The desired pane object, or null if outside the the bounds of the _panes array.
        /// The pane is an object of the form {header, content, animation} corresponding to
        /// that pane's header section, content section, and the animation used to open and
        /// close its content section.  The content element is a new div that has been
        /// created to wrap the original div (so we can completely collapse it - even if it
        /// has padding, margins, etc.) which is pointed to by a dynamic _original property.
        /// The header element has a dynamic _index property indicating its position in the
        /// Accordion's pane collection (used primarily by the headers' shared click handler).
        /// Furthermore, the animation will either be an instance of LengthAnimation or
        /// ParallelAnimation (in the latter case, it will have two children which are a
        /// LengthAnimation and a FadeAnimation).  There will be two dynamic properties
        /// _length and _fade pointing to each of these children (to easily set the length
        /// and fadeEffect properties).  There is also a dynamic _ended property which is an
        /// event handler to be fired when the animation is complete, a dynamic _opening
        /// property to indicate whether the animation was opening or closing the pane, and
        /// a dynamic _pane property to provide a reference to the pane that was being
        /// animated.
        /// </returns>
        
        if (index === undefined || index === null) {
            index = this._selectedIndex;
        }
        return (this._panes && index >= 0 && index < this._panes.length) ? this._panes[index] : null;
    },    
    
    get_Count : function() {
        /// <value type="Number" integer="true" mayBeNull="false">
        /// Number of Accordion panes
        /// </summary>
        return this._panes ? this._panes.length : 0;
    },
    
    get_TransitionDuration : function() {
        /// <value type="Number">
        /// Length of time to transition between Accordion sections in
        /// milleseconds.  The default value is 250ms.
        /// </value>
        return this._duration * 1000;
    },
    set_TransitionDuration : function(value) {
        if (this._duration != (value / 1000)) {
            this._duration = value / 1000;
            for (var i = 0; i < this._panes.length; i++) {
                var animation = this._panes[i].animation;
                if (animation) {
                    animation.set_duration(this._duration);
                }
            }
            this.raisePropertyChanged('TransitionDuration');
        }
    },
    
    get_FramesPerSecond : function() {
        /// <value type="Number" integer="true">
        /// Number of steps per second in the transition animations.
        /// The default value is 30 frames per second.
        /// </value>
        return this._framesPerSecond;
    },
    set_FramesPerSecond : function(value) {
        if (this._framesPerSecond != value) {
            this._framesPerSecond = value;
            for (var i = 0; i < this._panes.length; i++) {
                var animation = this._panes[i].animation;
                if (animation) {
                    animation.set_fps(this._framesPerSecond);
                }
            }
            this.raisePropertyChanged('FramesPerSecond');
        }
    },
    
    get_FadeTransitions : function() {
        /// <value type="Boolean">
        /// Whether or not to fade the accordion panes when transitioning
        /// </value>
        return this._fadeTransitions;
    },
    set_FadeTransitions : function(value) {
        if (this._fadeTransitions != value) {
            this._fadeTransitions = value;
            
            // Whenever we toggle FadeTransitions we dispose the entire list of
            // animations because it's not easy to selectively play just one of a
            // ParallelAnimation's children...  This is of course just a temporary
            // workaround until we enable generic animations and remove the
            // FadeTransitions property.
            this._disposeAnimations();
            
            // Set all the content sections to 100% opacity in case they had been
            // faded out when a pane was changed but not faded back in yet
            if (!this._fadeTransitions) {
                for (var i = 0; i < this._panes.length; i++) {
                    if ($common.getElementOpacity(this._panes[i].content) != 1) {
                        $common.setElementOpacity(this._panes[i].content, 1);
                    }
                    if ($common.getElementOpacity(this._panes[i].content._original) != 1) {
                        $common.setElementOpacity(this._panes[i].content._original, 1);
                    }
                }
            }
            this.raisePropertyChanged('FadeTransitions');
        }
    },
    
    get_HeaderCssClass: function() {
        /// <summary>
        /// This is the CSS class applied to each header.
        /// </summary>
        return this._headerCssClass;
    },
    
    set_HeaderCssClass: function(value) {
        this._headerCssClass = value;
        this.raisePropertyChanged('HeaderCssClass');
    },
    
    get_HeaderSelectedCssClass: function() {
        /// <summary>
        /// This is the CSS class applied to the selected header.
        /// </summary>
        return this._headerSelectedCssClass;
    },
    
    set_HeaderSelectedCssClass: function(value) {
        this._headerSelectedCssClass = value;
        this.raisePropertyChanged('HeaderSelectedCssClass');
    }, 
    
    get_ContentCssClass: function() {
        /// <summary>
        /// This is the CSS class applied to each content section.
        /// </summary>
        return this._contentCssClass;
    },
    
    set_ContentCssClass: function(value) {
        this._contentCssClass = value;
        this.raisePropertyChanged('ContentCssClass');
    }, 
    
    get_AutoSize : function() {
        /// <value type="AjaxControlToolkit.AutoSize">
        /// AutoSize mode
        /// </value>
        return this._autoSize;
    },
    set_AutoSize : function(value) {
        // In IE, treat AutoSize.Limit exactly the same as AutoSize.Fill.  Since IE does not
        // support the max-height CSS property, we can't achieve the Limit auto-size behavior
        // without fixing the exact size of the pane (which means it can't grow/shrink in response
        // to dynamic content changes).  Since Fill has most of the same UI characteristics, it's
        // a safer and cleaner workaround for this one browser.
        if (Sys.Browser.agent === Sys.Browser.InternetExplorer && value === AjaxControlToolkit.AutoSize.Limit) {
            value = AjaxControlToolkit.AutoSize.Fill;
        }
    
        if (this._autoSize != value) {
            this._autoSize = value;
            this._initializeLayout();
            this.raisePropertyChanged('AutoSize');
        }
    },

    get_SelectedIndex : function() {
        /// <value type="Number" integer="true">
        /// Index of the currently selected Accordion section
        /// </value>
        return this._selectedIndex;
    },
    set_SelectedIndex : function(value) {
        this._changeSelectedIndex(value, true);
    },
    
    get_requireOpenedPane : function() {
        /// <value type="Boolean">
        /// Whether or not clicking the header will close the currently opened pane
        /// (which leaves all the Accordion's panes closed)
        /// </value>
        return this._requireOpenedPane;
    },
    set_requireOpenedPane : function(value) {
        if (this._requireOpenedPane != value) {
            this._requireOpenedPane = value;
            this.raisePropertyChanged('requireOpenedPane');
        }
    },
    
    get_suppressHeaderPostbacks : function() {
        /// <value type="Boolean">
        /// Whether or not we suppress the client-side click handlers of any elements
        /// (including server controls like Button or HTML elements like anchor) in the
        /// header sections of the Accordion.
        /// </value>
        return this._suppressHeaderPostbacks;
    },
    set_suppressHeaderPostbacks : function(value) {
        if (this._suppressHeaderPostbacks != value) {
            this._suppressHeaderPostbacks = value;
            this.raisePropertyChanged('suppressHeaderPostbacks');
        }
    }
}
AjaxControlToolkit.AccordionBehavior.registerClass('AjaxControlToolkit.AccordionBehavior', AjaxControlToolkit.BehaviorBase);

/* END AjaxControlToolkit.Accordion.AccordionBehavior.js */
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {$get('ctl00_MainScriptManager_HiddenField').value += ';;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-US:1247b7d8-6b6c-419f-a45f-8ff264c90734:52817a7d;Telerik.Web.UI, Version=2008.2.1001.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-US:7b5a5491-9617-4b47-9ead-900fae7a2533:393f5085:34f9d57d:526d426:80c4ad6d:527acb41:a9723048:a3f85c94:39249aa4;AjaxControlToolkit, Version=3.0.20229.31345, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-US:a18cb17b-d4e8-4503-9be8-887366480094:9ea3f0e2:e2e86ef9:9e8e87e9:1df13a87:80f47b59:9758eba';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
