Skip to content

Instantly share code, notes, and snippets.

@kmmbvnr
Created March 1, 2011 11:37
Show Gist options
  • Save kmmbvnr/849012 to your computer and use it in GitHub Desktop.
Save kmmbvnr/849012 to your computer and use it in GitHub Desktop.
ASP.NET MVC3 Project Template
*.suo
*.user
App_Data/
bin/
obj/
packages/
packages.config
ASP.NET MVC3 Project Template
=============================
Attempt to create reusable project for ASP.NET MVC3 development
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace website.account
{
public class AccountAreaRegistration : AreaRegistration
{
public override string AreaName
{
get { return "Account"; }
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute("Account", "Account/{action}", new { controller = "Account" });
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using website.account.Models;
using System.Web.Routing;
using System.Web.Security;
namespace website.account.Controllers
{
public class AccountController : Controller
{
public IFormsAuthenticationService FormsService { get; set; }
public IMembershipService MembershipService { get; set; }
protected override void Initialize(RequestContext requestContext)
{
if (FormsService == null) { FormsService = new FormsAuthenticationService(); }
if (MembershipService == null) { MembershipService = new AccountMembershipService(); }
base.Initialize(requestContext);
}
public ActionResult LogOn()
{
return View();
}
[HttpPost]
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (ModelState.IsValid)
{
if (MembershipService.ValidateUser(model.UserName, model.Password))
{
FormsService.SignIn(model.UserName, model.RememberMe);
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction("Index", "Home", new { area = "" });
}
}
else
{
ModelState.AddModelError("", "The user name or password provided is incorrect.");
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
public ActionResult LogOff()
{
FormsService.SignOut();
return RedirectToAction("Index", "Home", new { area = "" });
}
public ActionResult Register()
{
ViewBag.PasswordLength = MembershipService.MinPasswordLength;
return View();
}
[HttpPost]
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
// Attempt to register the user
MembershipCreateStatus createStatus = MembershipService.CreateUser(model.UserName, model.Password, model.Email);
if (createStatus == MembershipCreateStatus.Success)
{
FormsService.SignIn(model.UserName, false /* createPersistentCookie */);
return RedirectToAction("Index", "Home", new { area = "" });
}
else
{
ModelState.AddModelError("", AccountValidation.ErrorCodeToString(createStatus));
}
}
// If we got this far, something failed, redisplay form
ViewBag.PasswordLength = MembershipService.MinPasswordLength;
return View(model);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.Globalization;
using Autofac.Integration.Mvc;
namespace website.account.Models
{
#region Models
public class ChangePasswordModel
{
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[ValidatePasswordLength]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match")]
public string ConfirmPassword { get; set; }
}
public class LogOnModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name="Password")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
public class RegisterModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email Address")]
public string Email { get; set; }
[Required]
[ValidatePasswordLength]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match")]
public string ConfirmPassword { get; set; }
}
#endregion
#region Services
public interface IMembershipService
{
int MinPasswordLength { get; }
bool ValidateUser(string userName, string password);
MembershipCreateStatus CreateUser(string userName, string password, string email);
bool ChangePassword(string userName, string oldPassword, string newPassword);
}
[ModelBinderType(typeof(IMembershipService))]
public class AccountMembershipService : IMembershipService
{
private readonly MembershipProvider _provider;
public AccountMembershipService()
: this(null)
{
}
public AccountMembershipService(MembershipProvider provider)
{
_provider = provider ?? Membership.Provider;
}
public int MinPasswordLength
{
get
{
return _provider.MinRequiredPasswordLength;
}
}
public bool ValidateUser(string userName, string password)
{
if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");
if (String.IsNullOrEmpty(password)) throw new ArgumentException("Value cannot be null or empty.", "password");
return _provider.ValidateUser(userName, password);
}
public MembershipCreateStatus CreateUser(string userName, string password, string email)
{
if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");
if (String.IsNullOrEmpty(password)) throw new ArgumentException("Value cannot be null or empty.", "password");
if (String.IsNullOrEmpty(email)) throw new ArgumentException("Value cannot be null or empty.", "email");
MembershipCreateStatus status;
_provider.CreateUser(userName, password, email, null, null, true, null, out status);
return status;
}
public bool ChangePassword(string userName, string oldPassword, string newPassword)
{
if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");
if (String.IsNullOrEmpty(oldPassword)) throw new ArgumentException("Value cannot be null or empty.", "oldPassword");
if (String.IsNullOrEmpty(newPassword)) throw new ArgumentException("Value cannot be null or empty.", "newPassword");
// The underlying ChangePassword() will throw an exception rather
// than return false in certain failure scenarios.
try
{
MembershipUser currentUser = _provider.GetUser(userName, true /* userIsOnline */);
return currentUser.ChangePassword(oldPassword, newPassword);
}
catch (ArgumentException)
{
return false;
}
catch (MembershipPasswordException)
{
return false;
}
}
}
public interface IFormsAuthenticationService
{
void SignIn(string userName, bool createPersistentCookie);
void SignOut();
}
[ModelBinderType(typeof(IFormsAuthenticationService))]
public class FormsAuthenticationService : IFormsAuthenticationService
{
public void SignIn(string userName, bool createPersistentCookie)
{
if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");
FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
}
public void SignOut()
{
FormsAuthentication.SignOut();
}
}
#endregion
#region Validation
public static class AccountValidation
{
public static string ErrorCodeToString(MembershipCreateStatus createStatus)
{
// See http://go.microsoft.com/fwlink/?LinkID=177550 for
// a full list of status codes.
switch (createStatus)
{
case MembershipCreateStatus.DuplicateUserName:
return "Username already exists. Please enter a different user name.";
case MembershipCreateStatus.DuplicateEmail:
return "A username for that e-mail address already exists. Please enter a different e-mail address.";
case MembershipCreateStatus.InvalidPassword:
return "The password provided is invalid. Please enter a valid password value.";
case MembershipCreateStatus.InvalidEmail:
return "The e-mail address provided is invalid. Please check the value and try again.";
case MembershipCreateStatus.InvalidAnswer:
return "The password retrieval answer provided is invalid. Please check the value and try again.";
case MembershipCreateStatus.InvalidQuestion:
return "The password retrieval question provided is invalid. Please check the value and try again.";
case MembershipCreateStatus.InvalidUserName:
return "The user name provided is invalid. Please check the value and try again.";
case MembershipCreateStatus.ProviderError:
return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
case MembershipCreateStatus.UserRejected:
return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
default:
return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
}
}
}
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class ValidatePasswordLengthAttribute : ValidationAttribute, IClientValidatable
{
private const string _defaultErrorMessage = "'{0}' must be at least {1} characters long.";
private readonly int _minCharacters = Membership.Provider.MinRequiredPasswordLength;
public ValidatePasswordLengthAttribute()
: base(_defaultErrorMessage)
{
}
public override string FormatErrorMessage(string name)
{
return String.Format(CultureInfo.CurrentCulture, ErrorMessageString, name, _minCharacters);
}
public override bool IsValid(object value)
{
string valueAsString = value as string;
return (valueAsString != null && valueAsString.Length >= _minCharacters);
}
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
{
return new[]{
new ModelClientValidationStringLengthRule(FormatErrorMessage(metadata.GetDisplayName()), _minCharacters, int.MaxValue)
};
}
}
#endregion
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// общие сведения об этой сборке.
[assembly: AssemblyTitle("website.account")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("website.account")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False в параметре ComVisible делает типы в этой сборке невидимыми
// для COM-компонентов. Если необходим доступ к типу в этой сборке из
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
[assembly: ComVisible(false)]
// Указанный ниже идентификатор GUID предназначен для идентификации библиотеки типов, если этот проект будет видимым для COM-объектов
[assembly: Guid("451ed9ce-8a56-44e4-b599-62914e7b88db")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номер построения и номер редакции по умолчанию,
// используя "*", как показано ниже:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("website")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("website")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4a0ea14e-ae64-4014-8109-fec60d4f4648")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<%@ Application Codebehind="Global.asax.cs" Inherits="website.MvcApplication" Language="C#" %>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Autofac;
using Autofac.Integration.Mvc;
using System.Reflection;
namespace website
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
protected void Application_Start()
{
DependencyResolver.SetResolver(CreateDependencyResolver());
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}
protected IDependencyResolver CreateDependencyResolver()
{
var builder = new ContainerBuilder();
/*
* Controllers
*/
builder.RegisterControllers(Assembly.GetExecutingAssembly());
/*
* Models
*/
builder.RegisterModelBinders(Assembly.GetExecutingAssembly());
builder.RegisterModelBinderProvider();
/*
* HTTP request lifetime scoped registrations for the HTTP abstraction classes
*/
builder.RegisterModule(new AutofacWebTypesModule());
return new AutofacDependencyResolver(builder.Build());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace website.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
return View();
}
public ActionResult About()
{
return View();
}
}
}
/*
* This file has been commented to support Visual Studio Intellisense.
* You should not use this file at runtime inside the browser--it is only
* intended to be used only for design-time IntelliSense. Please use the
* standard jQuery library for all production use.
*
* Comment version: 1.4.4a
*/
/*!
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
*
* Date: Thu Nov 11 19:04:53 2010 -0500
*/
(function( window, undefined ) {
// Use the correct document accordingly with window argument (sandbox)
var document = window.document;
var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
/// <summary>
/// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements.
/// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML.
/// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s).
/// 4: $(callback) - A shorthand for $(document).ready().
/// 5: $() - As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned.
/// </summary>
/// <param name="selector" type="String">
/// 1: expression - An expression to search with.
/// 2: html - A string of HTML to create on the fly.
/// 3: elements - DOM element(s) to be encapsulated by a jQuery object.
/// 4: callback - The function to execute when the DOM is ready.
/// </param>
/// <param name="context" type="jQuery">
/// 1: context - A DOM Element, Document or jQuery to use as context.
/// </param>
/// <returns type="jQuery" />
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// A central reference to the root jQuery(document)
rootjQuery,
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
rwhite = /\s/,
// Used for trimming whitespace
trimLeft = /^\s+/,
trimRight = /\s+$/,
// Check for non-word characters
rnonword = /\W/,
// Check for digits
rdigit = /\d/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
// Useragent RegExp
rwebkit = /(webkit)[ \/]([\w.]+)/,
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
rmsie = /(msie) ([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
// For matching the engine and version of the browser
browserMatch,
// Has the ready events already been bound?
readyBound = false,
// The functions to execute on DOM ready
readyList = [],
// The ready event handler
DOMContentLoaded,
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
trim = String.prototype.trim,
indexOf = Array.prototype.indexOf,
// [[Class]] -> type pairs
class2type = {};
jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
// The body element only exists once, optimize finding it
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = "body";
this.length = 1;
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
match = quickExpr.exec( selector );
// Verify a match, and that no context was specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
doc = (context ? context.ownerDocument || context : document);
// If a single string is passed in and it's a single tag
// just do a createElement and skip the rest
ret = rsingleTag.exec( selector );
if ( ret ) {
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
} else {
selector = [ doc.createElement( ret[1] ) ];
}
} else {
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}
return jQuery.merge( this, selector );
// HANDLE: $("#id")
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $("TAG")
} else if ( !context && !rnonword.test( selector ) ) {
this.selector = selector;
this.context = document;
selector = document.getElementsByTagName( selector );
return jQuery.merge( this, selector );
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return jQuery( context ).find( selector );
}
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if (selector.selector !== undefined) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The current version of jQuery being used
jquery: "1.4.4",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
/// <summary>
/// The number of elements currently matched.
/// Part of Core
/// </summary>
/// <returns type="Number" />
return this.length;
},
toArray: function() {
/// <summary>
/// Retrieve all the DOM elements contained in the jQuery set, as an array.
/// </summary>
/// <returns type="Array" />
return slice.call( this, 0 );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
/// <summary>
/// Access a single matched element. num is used to access the
/// Nth element matched.
/// Part of Core
/// </summary>
/// <returns type="Element" />
/// <param name="num" type="Number">
/// Access the element in the Nth position.
/// </param>
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
/// <summary>
/// Set the jQuery object to an array of elements, while maintaining
/// the stack.
/// Part of Core
/// </summary>
/// <returns type="jQuery" />
/// <param name="elems" type="Elements">
/// An array of elements
/// </param>
// Build a new jQuery matched element set
var ret = jQuery();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
} else {
jQuery.merge( ret, elems );
}
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
if ( name === "find" ) {
ret.selector = this.selector + (this.selector ? " " : "") + selector;
} else if ( name ) {
ret.selector = this.selector + "." + name + "(" + selector + ")";
}
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
/// <summary>
/// Execute a function within the context of every matched element.
/// This means that every time the passed-in function is executed
/// (which is once for every element matched) the 'this' keyword
/// points to the specific element.
/// Additionally, the function, when executed, is passed a single
/// argument representing the position of the element in the matched
/// set.
/// Part of Core
/// </summary>
/// <returns type="jQuery" />
/// <param name="callback" type="Function">
/// A function to execute
/// </param>
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
/// <summary>
/// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated.
/// </summary>
/// <param name="fn" type="Function">The function to be executed when the DOM is ready.</param>
// Attach the listeners
jQuery.bindReady();
// If the DOM is already ready
if ( jQuery.isReady ) {
// Execute the function immediately
fn.call( document, jQuery );
// Otherwise, remember the function for later
} else if ( readyList ) {
// Add the function to the wait list
readyList.push( fn );
}
return this;
},
eq: function( i ) {
/// <summary>
/// Reduce the set of matched elements to a single element.
/// The position of the element in the set of matched elements
/// starts at 0 and goes to length - 1.
/// Part of Core
/// </summary>
/// <returns type="jQuery" />
/// <param name="num" type="Number">
/// pos The index of the element that you wish to limit to.
/// </param>
return i === -1 ?
this.slice( i ) :
this.slice( i, +i + 1 );
},
first: function() {
/// <summary>
/// Reduce the set of matched elements to the first in the set.
/// </summary>
/// <returns type="jQuery" />
return this.eq( 0 );
},
last: function() {
/// <summary>
/// Reduce the set of matched elements to the final one in the set.
/// </summary>
/// <returns type="jQuery" />
return this.eq( -1 );
},
slice: function() {
/// <summary>
/// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method.
/// </summary>
/// <param name="start" type="Number" integer="true">Where to start the subset (0-based).</param>
/// <param name="end" optional="true" type="Number" integer="true">Where to end the subset (not including the end element itself).
/// If omitted, ends at the end of the selection</param>
/// <returns type="jQuery">The sliced elements</returns>
return this.pushStack( slice.apply( this, arguments ),
"slice", slice.call(arguments).join(",") );
},
map: function( callback ) {
/// <summary>
/// This member is internal.
/// </summary>
/// <private />
/// <returns type="jQuery" />
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
/// <summary>
/// End the most recent 'destructive' operation, reverting the list of matched elements
/// back to its previous state. After an end operation, the list of matched elements will
/// revert to the last state of matched elements.
/// If there was no destructive operation before, an empty set is returned.
/// Part of DOM/Traversing
/// </summary>
/// <returns type="jQuery" />
return this.prevObject || jQuery(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
/// <summary>
/// Extend one object with one or more others, returning the original,
/// modified, object. This is a great utility for simple inheritance.
/// jQuery.extend(settings, options);
/// var settings = jQuery.extend({}, defaults, options);
/// Part of JavaScript
/// </summary>
/// <param name="target" type="Object">
/// The object to extend
/// </param>
/// <param name="prop1" type="Object">
/// The object that will be merged into the first.
/// </param>
/// <param name="propN" type="Object" optional="true" parameterArray="true">
/// (optional) More objects to merge into the first
/// </param>
/// <returns type="Object" />
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
/// <summary>
/// Run this function to give control of the $ variable back
/// to whichever library first implemented it. This helps to make
/// sure that jQuery doesn't conflict with the $ object
/// of other libraries.
/// By using this function, you will only be able to access jQuery
/// using the 'jQuery' variable. For example, where you used to do
/// $(&quot;div p&quot;), you now must do jQuery(&quot;div p&quot;).
/// Part of Core
/// </summary>
/// <returns type="undefined" />
window.$ = _$;
if ( deep ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Handle when the DOM is ready
ready: function( wait ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
// A third-party is pushing the ready event forwards
if ( wait === true ) {
jQuery.readyWait--;
}
// Make sure that the DOM is not already loaded
if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
if ( readyList ) {
// Execute all of them
var fn,
i = 0,
ready = readyList;
// Reset the list of functions
readyList = null;
while ( (fn = ready[ i++ ]) ) {
fn.call( document, jQuery );
}
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( "ready" ).unbind( "ready" );
}
}
}
},
bindReady: function() {
if ( readyBound ) {
return;
}
readyBound = true;
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout( jQuery.ready, 1 );
}
// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent("onreadystatechange", DOMContentLoaded);
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// If IE and not a frame
// continually check to see if the document is ready
var toplevel = false;
try {
toplevel = window.frameElement == null;
} catch(e) {}
if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
}
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
/// <summary>
/// Determines if the parameter passed is a function.
/// </summary>
/// <param name="obj" type="Object">The object to check</param>
/// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns>
return jQuery.type(obj) === "function";
},
isArray: Array.isArray || function( obj ) {
/// <summary>
/// Determine if the parameter passed is an array.
/// </summary>
/// <param name="obj" type="Object">Object to test whether or not it is an array.</param>
/// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns>
return jQuery.type(obj) === "array";
},
// A crude way of determining if an object is a window
isWindow: function( obj ) {
return obj && typeof obj === "object" && "setInterval" in obj;
},
isNaN: function( obj ) {
return obj == null || !rdigit.test( obj ) || isNaN( obj );
},
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ toString.call(obj) ] || "object";
},
isPlainObject: function( obj ) {
/// <summary>
/// Check to see if an object is a plain object (created using "{}" or "new Object").
/// </summary>
/// <param name="obj" type="Object">
/// The object that will be checked to see if it's a plain object.
/// </param>
/// <returns type="Boolean" />
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
// Not own constructor property must be Object
if ( obj.constructor &&
!hasOwn.call(obj, "constructor") &&
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
/// <summary>
/// Check to see if an object is empty (contains no properties).
/// </summary>
/// <param name="obj" type="Object">
/// The object that will be checked to see if it's empty.
/// </param>
/// <returns type="Boolean" />
for ( var name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw msg;
},
parseJSON: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test(data.replace(rvalidescape, "@")
.replace(rvalidtokens, "]")
.replace(rvalidbraces, "")) ) {
// Try to use the native JSON parser first
return window.JSON && window.JSON.parse ?
window.JSON.parse( data ) :
(new Function("return " + data))();
} else {
jQuery.error( "Invalid JSON: " + data );
}
},
noop: function() {
/// <summary>
/// An empty function.
/// </summary>
/// <returns type="Function" />
},
// Evalulates a script in a global context
globalEval: function( data ) {
/// <summary>
/// Internally evaluates a script in a global context.
/// </summary>
/// <private />
if ( data && rnotwhite.test(data) ) {
// Inspired by code by Andrea Giammarchi
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
var head = document.getElementsByTagName("head")[0] || document.documentElement,
script = document.createElement("script");
script.type = "text/javascript";
if ( jQuery.support.scriptEval ) {
script.appendChild( document.createTextNode( data ) );
} else {
script.text = data;
}
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709).
head.insertBefore( script, head.firstChild );
head.removeChild( script );
}
},
nodeName: function( elem, name ) {
/// <summary>
/// Checks whether the specified element has the specified DOM node name.
/// </summary>
/// <param name="elem" type="Element">The element to examine</param>
/// <param name="name" type="String">The node name to check</param>
/// <returns type="Boolean">True if the specified node name matches the node's DOM node name; otherwise false</returns>
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
},
// args is for internal usage only
each: function( object, callback, args ) {
/// <summary>
/// A generic iterator function, which can be used to seemlessly
/// iterate over both objects and arrays. This function is not the same
/// as $().each() - which is used to iterate, exclusively, over a jQuery
/// object. This function can be used to iterate over anything.
/// The callback has two arguments:the key (objects) or index (arrays) as first
/// the first, and the value as the second.
/// Part of JavaScript
/// </summary>
/// <param name="obj" type="Object">
/// The object, or array, to iterate over.
/// </param>
/// <param name="fn" type="Function">
/// The function that will be executed on every object.
/// </param>
/// <returns type="Object" />
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction(object);
if ( args ) {
if ( isObj ) {
for ( name in object ) {
if ( callback.apply( object[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.apply( object[ i++ ], args ) === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
for ( name in object ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
break;
}
}
} else {
for ( var value = object[0];
i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
}
}
return object;
},
// Use native String.trim function wherever possible
trim: trim ?
function( text ) {
return text == null ?
"" :
trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
},
// results is for internal usage only
makeArray: function( array, results ) {
/// <summary>
/// Turns anything into a true array. This is an internal method.
/// </summary>
/// <param name="array" type="Object">Anything to turn into an actual Array</param>
/// <returns type="Array" />
/// <private />
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// The extra typeof function check is to prevent crashes
// in Safari 2 (See: #3039)
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
var type = jQuery.type(array);
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
push.call( ret, array );
} else {
jQuery.merge( ret, array );
}
}
return ret;
},
inArray: function( elem, array ) {
if ( array.indexOf ) {
return array.indexOf( elem );
}
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( array[ i ] === elem ) {
return i;
}
}
return -1;
},
merge: function( first, second ) {
/// <summary>
/// Merge two arrays together, removing all duplicates.
/// The new array is: All the results from the first array, followed
/// by the unique results from the second array.
/// Part of JavaScript
/// </summary>
/// <returns type="Array" />
/// <param name="first" type="Array">
/// The first array to merge.
/// </param>
/// <param name="second" type="Array">
/// The second array to merge.
/// </param>
var i = first.length,
j = 0;
if ( typeof second.length === "number" ) {
for ( var l = second.length; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
/// <summary>
/// Filter items out of an array, by using a filter function.
/// The specified function will be passed two arguments: The
/// current array item and the index of the item in the array. The
/// function must return 'true' to keep the item in the array,
/// false to remove it.
/// });
/// Part of JavaScript
/// </summary>
/// <returns type="Array" />
/// <param name="elems" type="Array">
/// array The Array to find items in.
/// </param>
/// <param name="fn" type="Function">
/// The function to process each item against.
/// </param>
/// <param name="inv" type="Boolean">
/// Invert the selection - select the opposite of the function.
/// </param>
var ret = [], retVal;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
/// <summary>
/// Translate all items in an array to another array of items.
/// The translation function that is provided to this method is
/// called for each item in the array and is passed one argument:
/// The item to be translated.
/// The function can then return the translated value, 'null'
/// (to remove the item), or an array of values - which will
/// be flattened into the full array.
/// Part of JavaScript
/// </summary>
/// <returns type="Array" />
/// <param name="elems" type="Array">
/// array The Array to translate.
/// </param>
/// <param name="fn" type="Function">
/// The function to process each item against.
/// </param>
var ret = [], value;
// Go through the array, translating each of the items to their
// new value (or values).
for ( var i = 0, length = elems.length; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
return ret.concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
proxy: function( fn, proxy, thisObject ) {
/// <summary>
/// Takes a function and returns a new one that will always have a particular scope.
/// </summary>
/// <param name="fn" type="Function">
/// The function whose scope will be changed.
/// </param>
/// <param name="proxy" type="Object">
/// The object to which the scope of the function should be set.
/// </param>
/// <returns type="Function" />
if ( arguments.length === 2 ) {
if ( typeof proxy === "string" ) {
thisObject = fn;
fn = thisObject[ proxy ];
proxy = undefined;
} else if ( proxy && !jQuery.isFunction( proxy ) ) {
thisObject = proxy;
proxy = undefined;
}
}
if ( !proxy && fn ) {
proxy = function() {
return fn.apply( thisObject || this, arguments );
};
}
// Set the guid of unique handler to the same of original handler, so it can be removed
if ( fn ) {
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
}
// So proxy can be declared as an argument
return proxy;
},
// Mutifunctional method to get and set values to a collection
// The value/s can be optionally by executed if its a function
access: function( elems, key, value, exec, fn, pass ) {
var length = elems.length;
// Setting many attributes
if ( typeof key === "object" ) {
for ( var k in key ) {
jQuery.access( elems, k, key[k], exec, fn, value );
}
return elems;
}
// Setting one attribute
if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
exec = !pass && exec && jQuery.isFunction(value);
for ( var i = 0; i < length; i++ ) {
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
}
return elems;
}
// Getting an attribute
return length ? fn( elems[0], key ) : undefined;
},
now: function() {
return (new Date()).getTime();
},
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
uaMatch: function( ua ) {
ua = ua.toLowerCase();
var match = rwebkit.exec( ua ) ||
ropera.exec( ua ) ||
rmsie.exec( ua ) ||
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
[];
return { browser: match[1] || "", version: match[2] || "0" };
},
browser: {}
});
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] = true;
jQuery.browser.version = browserMatch.version;
}
// Deprecated, use jQuery.browser.webkit instead
if ( jQuery.browser.webkit ) {
jQuery.browser.safari = true;
}
if ( indexOf ) {
jQuery.inArray = function( elem, array ) {
/// <summary>
/// Determines the index of the first parameter in the array.
/// </summary>
/// <param name="elem">The value to see if it exists in the array.</param>
/// <param name="array" type="Array">The array to look through for the value</param>
/// <returns type="Number" integer="true">The 0-based index of the item if it was found, otherwise -1.</returns>
return indexOf.call( array, elem );
};
}
// Verify that \s matches non-breaking spaces
// (IE fails on this test)
if ( !rwhite.test( "\xA0" ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// Cleanup functions for the document ready method
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
};
} else if ( document.attachEvent ) {
DOMContentLoaded = function() {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( document.readyState === "complete" ) {
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
};
}
// The DOM ready check for Internet Explorer
function doScrollCheck() {
if ( jQuery.isReady ) {
return;
}
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}
// and execute any waiting functions
jQuery.ready();
}
// Expose jQuery to the global object
return (window.jQuery = window.$ = jQuery);
})();
// [vsdoc] The following function has been modified for IntelliSense.
// [vsdoc] Stubbing support properties to "false" for IntelliSense compat.
(function() {
jQuery.support = {};
// var root = document.documentElement,
// script = document.createElement("script"),
// div = document.createElement("div"),
// id = "script" + jQuery.now();
// div.style.display = "none";
// div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
// var all = div.getElementsByTagName("*"),
// a = div.getElementsByTagName("a")[0],
// select = document.createElement("select"),
// opt = select.appendChild( document.createElement("option") );
// // Can't get basic test support
// if ( !all || !all.length || !a ) {
// return;
// }
jQuery.support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: false,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: false,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: false,
// Get the style information from getAttribute
// (IE uses .cssText insted)
style: false,
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: false,
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: false,
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: false,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
checkOn: false,
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: false,
// Will be defined later
deleteExpando: false,
optDisabled: false,
checkClone: false,
scriptEval: false,
noCloneEvent: false,
boxModel: false,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableHiddenOffsets: true
};
// // Make sure that the options inside disabled selects aren't marked as disabled
// // (WebKit marks them as diabled)
// select.disabled = true;
// jQuery.support.optDisabled = !opt.disabled;
// script.type = "text/javascript";
// try {
// script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
// } catch(e) {}
// root.insertBefore( script, root.firstChild );
// // Make sure that the execution of code works by injecting a script
// // tag with appendChild/createTextNode
// // (IE doesn't support this, fails, and uses .text instead)
// if ( window[ id ] ) {
// jQuery.support.scriptEval = true;
// delete window[ id ];
// }
// // Test to see if it's possible to delete an expando from an element
// // Fails in Internet Explorer
// try {
// delete script.test;
// } catch(e) {
// jQuery.support.deleteExpando = false;
// }
// root.removeChild( script );
// if ( div.attachEvent && div.fireEvent ) {
// div.attachEvent("onclick", function click() {
// // Cloning a node shouldn't copy over any
// // bound event handlers (IE does this)
// jQuery.support.noCloneEvent = false;
// div.detachEvent("onclick", click);
// });
// div.cloneNode(true).fireEvent("onclick");
// }
// div = document.createElement("div");
// div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
// var fragment = document.createDocumentFragment();
// fragment.appendChild( div.firstChild );
// // WebKit doesn't clone checked state correctly in fragments
// jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
// // Figure out if the W3C box model works as expected
// // document.body must exist before we can do this
// jQuery(function() {
// var div = document.createElement("div");
// div.style.width = div.style.paddingLeft = "1px";
// document.body.appendChild( div );
// jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
// if ( "zoom" in div.style ) {
// // Check if natively block-level elements act like inline-block
// // elements when setting their display to 'inline' and giving
// // them layout
// // (IE < 8 does this)
// div.style.display = "inline";
// div.style.zoom = 1;
// jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
// // Check if elements with layout shrink-wrap their children
// // (IE 6 does this)
// div.style.display = "";
// div.innerHTML = "<div style='width:4px;'></div>";
// jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
// }
// div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
// var tds = div.getElementsByTagName("td");
// // Check if table cells still have offsetWidth/Height when they are set
// // to display:none and there are still other visible table cells in a
// // table row; if so, offsetWidth/Height are not reliable for use when
// // determining if an element has been hidden directly using
// // display:none (it is still safe to use offsets if a parent element is
// // hidden; don safety goggles and see bug #4512 for more information).
// // (only IE 8 fails this test)
// jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
// tds[0].style.display = "";
// tds[1].style.display = "none";
// // Check if empty table cells still have offsetWidth/Height
// // (IE < 8 fail this test)
// jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
// div.innerHTML = "";
// document.body.removeChild( div ).style.display = "none";
// div = tds = null;
// });
// // Technique from Juriy Zaytsev
// // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
// var eventSupported = function( eventName ) {
// var el = document.createElement("div");
// eventName = "on" + eventName;
// var isSupported = (eventName in el);
// if ( !isSupported ) {
// el.setAttribute(eventName, "return;");
// isSupported = typeof el[eventName] === "function";
// }
// el = null;
// return isSupported;
// };
jQuery.support.submitBubbles = false;
jQuery.support.changeBubbles = false;
// // release memory in IE
// root = script = div = all = a = null;
})();
var windowData = {},
rbrace = /^(?:\{.*\}|\[.*\])$/;
jQuery.extend({
cache: {},
// Please use with caution
uuid: 0,
// Unique for each copy of jQuery on the page
expando: "jQuery" + jQuery.now(),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
data: function( elem, name, data ) {
/// <summary>
/// Store arbitrary data associated with the specified element.
/// </summary>
/// <param name="elem" type="Element">
/// The DOM element to associate with the data.
/// </param>
/// <param name="name" type="String">
/// A string naming the piece of data to set.
/// </param>
/// <param name="value" type="Object">
/// The new data value.
/// </param>
/// <returns type="jQuery" />
if ( !jQuery.acceptData( elem ) ) {
return;
}
elem = elem == window ?
windowData :
elem;
var isNode = elem.nodeType,
id = isNode ? elem[ jQuery.expando ] : null,
cache = jQuery.cache, thisCache;
if ( isNode && !id && typeof name === "string" && data === undefined ) {
return;
}
// Get the data from the object directly
if ( !isNode ) {
cache = elem;
// Compute a unique ID for the element
} else if ( !id ) {
elem[ jQuery.expando ] = id = ++jQuery.uuid;
}
// Avoid generating a new cache unless none exists and we
// want to manipulate it.
if ( typeof name === "object" ) {
if ( isNode ) {
cache[ id ] = jQuery.extend(cache[ id ], name);
} else {
jQuery.extend( cache, name );
}
} else if ( isNode && !cache[ id ] ) {
cache[ id ] = {};
}
thisCache = isNode ? cache[ id ] : cache;
// Prevent overriding the named cache with undefined values
if ( data !== undefined ) {
thisCache[ name ] = data;
}
return typeof name === "string" ? thisCache[ name ] : thisCache;
},
removeData: function( elem, name ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
elem = elem == window ?
windowData :
elem;
var isNode = elem.nodeType,
id = isNode ? elem[ jQuery.expando ] : elem,
cache = jQuery.cache,
thisCache = isNode ? cache[ id ] : id;
// If we want to remove a specific section of the element's data
if ( name ) {
if ( thisCache ) {
// Remove the section of cache data
delete thisCache[ name ];
// If we've removed all the data, remove the element's cache
if ( isNode && jQuery.isEmptyObject(thisCache) ) {
jQuery.removeData( elem );
}
}
// Otherwise, we want to remove all of the element's data
} else {
if ( isNode && jQuery.support.deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
// Completely remove the data cache
} else if ( isNode ) {
delete cache[ id ];
// Remove all fields from the object
} else {
for ( var n in elem ) {
delete elem[ n ];
}
}
}
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
if ( elem.nodeName ) {
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
if ( match ) {
return !(match === true || elem.getAttribute("classid") !== match);
}
}
return true;
}
});
jQuery.fn.extend({
data: function( key, value ) {
/// <summary>
/// Store arbitrary data associated with the matched elements.
/// </summary>
/// <param name="key" type="String">
/// A string naming the piece of data to set.
/// </param>
/// <param name="value" type="Object">
/// The new data value.
/// </param>
/// <returns type="jQuery" />
var data = null;
if ( typeof key === "undefined" ) {
if ( this.length ) {
var attr = this[0].attributes, name;
data = jQuery.data( this[0] );
for ( var i = 0, l = attr.length; i < l; i++ ) {
name = attr[i].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = name.substr( 5 );
dataAttr( this[0], name, data[ name ] );
}
}
}
return data;
} else if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
var parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";
if ( value === undefined ) {
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
// Try to fetch any internally stored data first
if ( data === undefined && this.length ) {
data = jQuery.data( this[0], key );
data = dataAttr( this[0], key, data );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
} else {
return this.each(function() {
var $this = jQuery( this ),
args = [ parts[0], value ];
$this.triggerHandler( "setData" + parts[1] + "!", args );
jQuery.data( this, key, value );
$this.triggerHandler( "changeData" + parts[1] + "!", args );
});
}
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
data = elem.getAttribute( "data-" + key );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
!jQuery.isNaN( data ) ? parseFloat( data ) :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
jQuery.extend({
queue: function( elem, type, data ) {
if ( !elem ) {
return;
}
type = (type || "fx") + "queue";
var q = jQuery.data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( !data ) {
return q || [];
}
if ( !q || jQuery.isArray(data) ) {
q = jQuery.data( elem, type, jQuery.makeArray(data) );
} else {
q.push( data );
}
return q;
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
fn = queue.shift();
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift("inprogress");
}
fn.call(elem, function() {
jQuery.dequeue(elem, type);
});
}
}
});
jQuery.fn.extend({
queue: function( type, data ) {
/// <summary>
/// 1: queue() - Returns a reference to the first element's queue (which is an array of functions).
/// 2: queue(callback) - Adds a new function, to be executed, onto the end of the queue of all matched elements.
/// 3: queue(queue) - Replaces the queue of all matched element with this new queue (the array of functions).
/// </summary>
/// <param name="type" type="Function">The function to add to the queue.</param>
/// <returns type="jQuery" />
if ( typeof type !== "string" ) {
data = type;
type = "fx";
}
if ( data === undefined ) {
return jQuery.queue( this[0], type );
}
return this.each(function( i ) {
var queue = jQuery.queue( this, type, data );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
/// <summary>
/// Removes a queued function from the front of the queue and executes it.
/// </summary>
/// <param name="type" type="String" optional="true">The type of queue to access.</param>
/// <returns type="jQuery" />
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
/// <summary>
/// Set a timer to delay execution of subsequent items in the queue.
/// </summary>
/// <param name="time" type="Number">
/// An integer indicating the number of milliseconds to delay execution of the next item in the queue.
/// </param>
/// <param name="type" type="String">
/// A string containing the name of the queue. Defaults to fx, the standard effects queue.
/// </param>
/// <returns type="jQuery" />
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
type = type || "fx";
return this.queue( type, function() {
var elem = this;
setTimeout(function() {
jQuery.dequeue( elem, type );
}, time );
});
},
clearQueue: function( type ) {
/// <summary>
/// Remove from the queue all items that have not yet been run.
/// </summary>
/// <param name="type" type="String" optional="true">
/// A string containing the name of the queue. Defaults to fx, the standard effects queue.
/// </param>
/// <returns type="jQuery" />
return this.queue( type || "fx", [] );
}
});
var rclass = /[\n\t]/g,
rspaces = /\s+/,
rreturn = /\r/g,
rspecialurl = /^(?:href|src|style)$/,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
rradiocheck = /^(?:radio|checkbox)$/i;
jQuery.props = {
"for": "htmlFor",
"class": "className",
readonly: "readOnly",
maxlength: "maxLength",
cellspacing: "cellSpacing",
rowspan: "rowSpan",
colspan: "colSpan",
tabindex: "tabIndex",
usemap: "useMap",
frameborder: "frameBorder"
};
jQuery.fn.extend({
attr: function( name, value ) {
/// <summary>
/// Set a single property to a computed value, on all matched elements.
/// Instead of a value, a function is provided, that computes the value.
/// Part of DOM/Attributes
/// </summary>
/// <returns type="jQuery" />
/// <param name="name" type="String">
/// The name of the property to set.
/// </param>
/// <param name="value" type="Function">
/// A function returning the value to set.
/// </param>
return jQuery.access( this, name, value, true, jQuery.attr );
},
removeAttr: function( name, fn ) {
/// <summary>
/// Remove an attribute from each of the matched elements.
/// Part of DOM/Attributes
/// </summary>
/// <param name="name" type="String">
/// An attribute to remove.
/// </param>
/// <returns type="jQuery" />
return this.each(function(){
jQuery.attr( this, name, "" );
if ( this.nodeType === 1 ) {
this.removeAttribute( name );
}
});
},
addClass: function( value ) {
/// <summary>
/// Adds the specified class(es) to each of the set of matched elements.
/// Part of DOM/Attributes
/// </summary>
/// <param name="value" type="String">
/// One or more class names to be added to the class attribute of each matched element.
/// </param>
/// <returns type="jQuery" />
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
self.addClass( value.call(this, i, self.attr("class")) );
});
}
if ( value && typeof value === "string" ) {
var classNames = (value || "").split( rspaces );
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
if ( elem.nodeType === 1 ) {
if ( !elem.className ) {
elem.className = value;
} else {
var className = " " + elem.className + " ",
setClass = elem.className;
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
setClass += " " + classNames[c];
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
/// <summary>
/// Removes all or the specified class(es) from the set of matched elements.
/// Part of DOM/Attributes
/// </summary>
/// <param name="value" type="String" optional="true">
/// (Optional) A class name to be removed from the class attribute of each matched element.
/// </param>
/// <returns type="jQuery" />
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
self.removeClass( value.call(this, i, self.attr("class")) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
var classNames = (value || "").split( rspaces );
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
var className = (" " + elem.className + " ").replace(rclass, " ");
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[c] + " ", " ");
}
elem.className = jQuery.trim( className );
} else {
elem.className = "";
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
/// <summary>
/// Add or remove a class from each element in the set of matched elements, depending
/// on either the class's presence or the value of the switch argument.
/// </summary>
/// <param name="value" type="Object">
/// A class name to be toggled for each element in the matched set.
/// </param>
/// <param name="stateVal" type="Object">
/// A boolean value to determine whether the class should be added or removed.
/// </param>
/// <returns type="jQuery" />
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this);
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.split( rspaces );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery.data( this, "__className__", this.className );
}
// toggle whole className
this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
/// <summary>
/// Checks the current selection against a class and returns whether at least one selection has a given class.
/// </summary>
/// <param name="selector" type="String">The class to check against</param>
/// <returns type="Boolean">True if at least one element in the selection has the class, otherwise false.</returns>
var className = " " + selector + " ";
for ( var i = 0, l = this.length; i < l; i++ ) {
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
return true;
}
}
return false;
},
val: function( value ) {
/// <summary>
/// Set the value of every matched element.
/// Part of DOM/Attributes
/// </summary>
/// <returns type="jQuery" />
/// <param name="value" type="String">
/// A string of text or an array of strings to set as the value property of each
/// matched element.
/// </param>
if ( !arguments.length ) {
var elem = this[0];
if ( elem ) {
if ( jQuery.nodeName( elem, "option" ) ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
// We need to handle select boxes special
if ( jQuery.nodeName( elem, "select" ) ) {
var index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
// Nothing was selected
if ( index < 0 ) {
return null;
}
// Loop through all the selected options
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery(option).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
}
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
return elem.getAttribute("value") === null ? "on" : elem.value;
}
// Everything else, we just grab the value
return (elem.value || "").replace(rreturn, "");
}
return undefined;
}
var isFunction = jQuery.isFunction(value);
return this.each(function(i) {
var self = jQuery(this), val = value;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call(this, i, self.val());
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray(val) ) {
val = jQuery.map(val, function (value) {
return value == null ? "" : value + "";
});
}
if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
this.checked = jQuery.inArray( self.val(), val ) >= 0;
} else if ( jQuery.nodeName( this, "select" ) ) {
var values = jQuery.makeArray(val);
jQuery( "option", this ).each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
this.selectedIndex = -1;
}
} else {
this.value = val;
}
});
}
});
jQuery.extend({
attrFn: {
val: true,
css: true,
html: true,
text: true,
data: true,
width: true,
height: true,
offset: true
},
attr: function( elem, name, value, pass ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
// don't set attributes on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
if ( pass && name in jQuery.attrFn ) {
return jQuery(elem)[name](value);
}
var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
// Whether we are setting (or getting)
set = value !== undefined;
// Try to normalize/fix the name
name = notxml && jQuery.props[ name ] || name;
// These attributes require special treatment
var special = rspecialurl.test( name );
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( name === "selected" && !jQuery.support.optSelected ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
}
// If applicable, access the attribute via the DOM 0 way
// 'in' checks fail in Blackberry 4.7 #6931
if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
if ( set ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error( "type property can't be changed" );
}
if ( value === null ) {
if ( elem.nodeType === 1 ) {
elem.removeAttribute( name );
}
} else {
elem[ name ] = value;
}
}
// browsers index elements by id/name on forms, give priority to attributes.
if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
return elem.getAttributeNode( name ).nodeValue;
}
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
if ( name === "tabIndex" ) {
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified ?
attributeNode.value :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
return elem[ name ];
}
if ( !jQuery.support.style && notxml && name === "style" ) {
if ( set ) {
elem.style.cssText = "" + value;
}
return elem.style.cssText;
}
if ( set ) {
// convert the value to a string (all browsers do this but IE) see #1070
elem.setAttribute( name, "" + value );
}
// Ensure that missing attributes return undefined
// Blackberry 4.7 returns "" from getAttribute #6938
if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
return undefined;
}
var attr = !jQuery.support.hrefNormalized && notxml && special ?
// Some attributes require a special call on IE
elem.getAttribute( name, 2 ) :
elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return attr === null ? undefined : attr;
}
});
var rnamespaces = /\.(.*)$/,
rformElems = /^(?:textarea|input|select)$/i,
rperiod = /\./g,
rspace = / /g,
rescape = /[^\w\s.|`]/g,
fcleanup = function( nm ) {
return nm.replace(rescape, "\\$&");
},
focusCounts = { focusin: 0, focusout: 0 };
/*
* A number of helper functions used for managing events.
* Many of the ideas behind this code originated from
* Dean Edwards' addEvent library.
*/
jQuery.event = {
// Bind an event to an element
// Original by Dean Edwards
add: function( elem, types, handler, data ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
elem = window;
}
if ( handler === false ) {
handler = returnFalse;
} else if ( !handler ) {
// Fixes bug #7229. Fix recommended by jdalton
return;
}
var handleObjIn, handleObj;
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
}
// Make sure that the function being executed has a unique ID
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure
var elemData = jQuery.data( elem );
// If no elemData is found then we must be trying to bind to one of the
// banned noData elements
if ( !elemData ) {
return;
}
// Use a key less likely to result in collisions for plain JS objects.
// Fixes bug #7150.
var eventKey = elem.nodeType ? "events" : "__events__",
events = elemData[ eventKey ],
eventHandle = elemData.handle;
if ( typeof events === "function" ) {
// On plain objects events is a fn that holds the the data
// which prevents this data from being JSON serialized
// the function does not need to be called, it just contains the data
eventHandle = events.handle;
events = events.events;
} else if ( !events ) {
if ( !elem.nodeType ) {
// On plain objects, create a fn that acts as the holder
// of the values to avoid JSON serialization of event data
elemData[ eventKey ] = elemData = function(){};
}
elemData.events = events = {};
}
if ( !eventHandle ) {
elemData.handle = eventHandle = function() {
// Handle the second event of a trigger and when
// an event is called after a page has unloaded
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
undefined;
};
}
// Add elem as a property of the handle function
// This is to prevent a memory leak with non-native events in IE.
eventHandle.elem = elem;
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = types.split(" ");
var type, i = 0, namespaces;
while ( (type = types[ i++ ]) ) {
handleObj = handleObjIn ?
jQuery.extend({}, handleObjIn) :
{ handler: handler, data: data };
// Namespaced event handlers
if ( type.indexOf(".") > -1 ) {
namespaces = type.split(".");
type = namespaces.shift();
handleObj.namespace = namespaces.slice(0).sort().join(".");
} else {
namespaces = [];
handleObj.namespace = "";
}
handleObj.type = type;
if ( !handleObj.guid ) {
handleObj.guid = handler.guid;
}
// Get the current list of functions bound to this event
var handlers = events[ type ],
special = jQuery.event.special[ type ] || {};
// Init the event handler queue
if ( !handlers ) {
handlers = events[ type ] = [];
// Check for a special event handler
// Only use addEventListener/attachEvent if the special
// events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add the function to the element's handler list
handlers.push( handleObj );
// Keep track of which events have been used, for global triggering
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
global: {},
// Detach an event or set of events from an element
remove: function( elem, types, handler ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
// don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
if ( handler === false ) {
handler = returnFalse;
}
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
eventKey = elem.nodeType ? "events" : "__events__",
elemData = jQuery.data( elem ),
events = elemData && elemData[ eventKey ];
if ( !elemData || !events ) {
return;
}
if ( typeof events === "function" ) {
elemData = events;
events = events.events;
}
// types is actually an event object here
if ( types && types.type ) {
handler = types.handler;
types = types.type;
}
// Unbind all events for the element
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
types = types || "";
for ( type in events ) {
jQuery.event.remove( elem, type + types );
}
return;
}
// Handle multiple events separated by a space
// jQuery(...).unbind("mouseover mouseout", fn);
types = types.split(" ");
while ( (type = types[ i++ ]) ) {
origType = type;
handleObj = null;
all = type.indexOf(".") < 0;
namespaces = [];
if ( !all ) {
// Namespaced event handlers
namespaces = type.split(".");
type = namespaces.shift();
namespace = new RegExp("(^|\\.)" +
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
}
eventType = events[ type ];
if ( !eventType ) {
continue;
}
if ( !handler ) {
for ( j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( all || namespace.test( handleObj.namespace ) ) {
jQuery.event.remove( elem, origType, handleObj.handler, j );
eventType.splice( j--, 1 );
}
}
continue;
}
special = jQuery.event.special[ type ] || {};
for ( j = pos || 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( handler.guid === handleObj.guid ) {
// remove the given handler for the given type
if ( all || namespace.test( handleObj.namespace ) ) {
if ( pos == null ) {
eventType.splice( j--, 1 );
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
if ( pos != null ) {
break;
}
}
}
// remove generic event handler if no more handlers exist
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
ret = null;
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
var handle = elemData.handle;
if ( handle ) {
handle.elem = null;
}
delete elemData.events;
delete elemData.handle;
if ( typeof elemData === "function" ) {
jQuery.removeData( elem, eventKey );
} else if ( jQuery.isEmptyObject( elemData ) ) {
jQuery.removeData( elem );
}
}
},
// bubbling is internal
trigger: function( event, data, elem /*, bubbling */ ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
// Event object or event type
var type = event.type || event,
bubbling = arguments[3];
if ( !bubbling ) {
event = typeof event === "object" ?
// jQuery.Event object
event[ jQuery.expando ] ? event :
// Object literal
jQuery.extend( jQuery.Event(type), event ) :
// Just the event type (string)
jQuery.Event(type);
if ( type.indexOf("!") >= 0 ) {
event.type = type = type.slice(0, -1);
event.exclusive = true;
}
// Handle a global trigger
if ( !elem ) {
// Don't bubble custom events when global (to avoid too much overhead)
event.stopPropagation();
// Only trigger if we've ever bound an event for it
if ( jQuery.event.global[ type ] ) {
jQuery.each( jQuery.cache, function() {
if ( this.events && this.events[type] ) {
jQuery.event.trigger( event, data, this.handle.elem );
}
});
}
}
// Handle triggering a single element
// don't do events on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
// Clean up in case it is reused
event.result = undefined;
event.target = elem;
// Clone the incoming data, if any
data = jQuery.makeArray( data );
data.unshift( event );
}
event.currentTarget = elem;
// Trigger the event, it is assumed that "handle" is a function
var handle = elem.nodeType ?
jQuery.data( elem, "handle" ) :
(jQuery.data( elem, "__events__" ) || {}).handle;
if ( handle ) {
handle.apply( elem, data );
}
var parent = elem.parentNode || elem.ownerDocument;
// Trigger an inline bound script
try {
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
event.result = false;
event.preventDefault();
}
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (inlineError) {}
if ( !event.isPropagationStopped() && parent ) {
jQuery.event.trigger( event, data, parent, true );
} else if ( !event.isDefaultPrevented() ) {
var old,
target = event.target,
targetType = type.replace( rnamespaces, "" ),
isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
special = jQuery.event.special[ targetType ] || {};
if ( (!special._default || special._default.call( elem, event ) === false) &&
!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
try {
if ( target[ targetType ] ) {
// Make sure that we don't accidentally re-trigger the onFOO events
old = target[ "on" + targetType ];
if ( old ) {
target[ "on" + targetType ] = null;
}
jQuery.event.triggered = true;
target[ targetType ]();
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (triggerError) {}
if ( old ) {
target[ "on" + targetType ] = old;
}
jQuery.event.triggered = false;
}
}
},
handle: function( event ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
var all, handlers, namespaces, namespace_re, events,
namespace_sort = [],
args = jQuery.makeArray( arguments );
event = args[0] = jQuery.event.fix( event || window.event );
event.currentTarget = this;
// Namespaced event handlers
all = event.type.indexOf(".") < 0 && !event.exclusive;
if ( !all ) {
namespaces = event.type.split(".");
event.type = namespaces.shift();
namespace_sort = namespaces.slice(0).sort();
namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
}
event.namespace = event.namespace || namespace_sort.join(".");
events = jQuery.data(this, this.nodeType ? "events" : "__events__");
if ( typeof events === "function" ) {
events = events.events;
}
handlers = (events || {})[ event.type ];
if ( events && handlers ) {
// Clone the handlers to prevent manipulation
handlers = handlers.slice(0);
for ( var j = 0, l = handlers.length; j < l; j++ ) {
var handleObj = handlers[ j ];
// Filter the functions by class
if ( all || namespace_re.test( handleObj.namespace ) ) {
// Pass in a reference to the handler function itself
// So that we can later remove it
event.handler = handleObj.handler;
event.data = handleObj.data;
event.handleObj = handleObj;
var ret = handleObj.handler.apply( this, args );
if ( ret !== undefined ) {
event.result = ret;
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
}
return event.result;
},
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix: function( event ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
if ( event[ jQuery.expando ] ) {
return event;
}
// store a copy of the original event object
// and "clone" to set read-only properties
var originalEvent = event;
event = jQuery.Event( originalEvent );
for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary
if ( !event.target ) {
// Fixes #1925 where srcElement might not be defined either
event.target = event.srcElement || document;
}
// check if target is a textnode (safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && event.fromElement ) {
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
}
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && event.clientX != null ) {
var doc = document.documentElement,
body = document.body;
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
}
// Add which for key events
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
event.which = event.charCode != null ? event.charCode : event.keyCode;
}
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
if ( !event.metaKey && event.ctrlKey ) {
event.metaKey = event.ctrlKey;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && event.button !== undefined ) {
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
}
return event;
},
// Deprecated, use jQuery.guid instead
guid: 1E8,
// Deprecated, use jQuery.proxy instead
proxy: jQuery.proxy,
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady,
teardown: jQuery.noop
},
live: {
add: function( handleObj ) {
jQuery.event.add( this,
liveConvert( handleObj.origType, handleObj.selector ),
jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
},
remove: function( handleObj ) {
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
}
},
beforeunload: {
setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( jQuery.isWindow( this ) ) {
this.onbeforeunload = eventHandle;
}
},
teardown: function( namespaces, eventHandle ) {
if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
}
}
};
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
if ( elem.detachEvent ) {
elem.detachEvent( "on" + type, handle );
}
};
jQuery.Event = function( src ) {
// Allow instantiation without the 'new' keyword
if ( !this.preventDefault ) {
return new jQuery.Event( src );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Event type
} else {
this.type = src;
}
// timeStamp is buggy for some events on Firefox(#3843)
// So we won't rely on the native value
this.timeStamp = jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// otherwise set the returnValue property of the original event to false (IE)
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if stopPropagation exists run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// otherwise set the cancelBubble property of the original event to true (IE)
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function( event ) {
// Check if mouse(over|out) are still within the same parent element
var parent = event.relatedTarget;
// Firefox sometimes assigns relatedTarget a XUL element
// which we cannot access the parentNode property of
try {
// Traverse up the tree
while ( parent && parent !== this ) {
parent = parent.parentNode;
}
if ( parent !== this ) {
// set the correct event type
event.type = event.data;
// handle event if we actually just moused on to a non sub-element
jQuery.event.handle.apply( this, arguments );
}
// assuming we've left the element since we most likely mousedover a xul element
} catch(e) { }
},
// In case of event delegation, we only need to rename the event.type,
// liveHandler will take care of the rest.
delegate = function( event ) {
event.type = event.data;
jQuery.event.handle.apply( this, arguments );
};
// Create mouseenter and mouseleave events
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
setup: function( data ) {
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
},
teardown: function( data ) {
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
}
};
});
// submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( this.nodeName.toLowerCase() !== "form" ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target,
type = elem.type;
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
e.liveFired = undefined;
return trigger( "submit", this, arguments );
}
});
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target,
type = elem.type;
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
e.liveFired = undefined;
return trigger( "submit", this, arguments );
}
});
} else {
return false;
}
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialSubmit" );
}
};
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
var changeFilters,
getVal = function( elem ) {
var type = elem.type, val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;
} else if ( type === "select-multiple" ) {
val = elem.selectedIndex > -1 ?
jQuery.map( elem.options, function( elem ) {
return elem.selected;
}).join("-") :
"";
} else if ( elem.nodeName.toLowerCase() === "select" ) {
val = elem.selectedIndex;
}
return val;
},
testChange = function testChange( e ) {
var elem = e.target, data, val;
if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
return;
}
data = jQuery.data( elem, "_change_data" );
val = getVal(elem);
// the current data will be also retrieved by beforeactivate
if ( e.type !== "focusout" || elem.type !== "radio" ) {
jQuery.data( elem, "_change_data", val );
}
if ( data === undefined || val === data ) {
return;
}
if ( data != null || val ) {
e.type = "change";
e.liveFired = undefined;
return jQuery.event.trigger( e, arguments[1], elem );
}
};
jQuery.event.special.change = {
filters: {
focusout: testChange,
beforedeactivate: testChange,
click: function( e ) {
var elem = e.target, type = elem.type;
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
return testChange.call( this, e );
}
},
// Change has to be called before submit
// Keydown will be called before keypress, which is used in submit-event delegation
keydown: function( e ) {
var elem = e.target, type = elem.type;
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
type === "select-multiple" ) {
return testChange.call( this, e );
}
},
// Beforeactivate happens also before the previous element is blurred
// with this event you can't trigger a change event, but you can store
// information
beforeactivate: function( e ) {
var elem = e.target;
jQuery.data( elem, "_change_data", getVal(elem) );
}
},
setup: function( data, namespaces ) {
if ( this.type === "file" ) {
return false;
}
for ( var type in changeFilters ) {
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
}
return rformElems.test( this.nodeName );
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialChange" );
return rformElems.test( this.nodeName );
}
};
changeFilters = jQuery.event.special.change.filters;
// Handle when the input is .focus()'d
changeFilters.focus = changeFilters.beforeactivate;
}
function trigger( type, elem, args ) {
args[0].type = type;
return jQuery.event.handle.apply( elem, args );
}
// Create "bubbling" focus and blur events
if ( document.addEventListener ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
jQuery.event.special[ fix ] = {
setup: function() {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
if ( focusCounts[fix]++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
if ( --focusCounts[fix] === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
function handler( e ) {
e = jQuery.event.fix( e );
e.type = fix;
return jQuery.event.trigger( e, null, e.target );
}
});
}
// jQuery.each(["bind", "one"], function( i, name ) {
// jQuery.fn[ name ] = function( type, data, fn ) {
// // Handle object literals
// if ( typeof type === "object" ) {
// for ( var key in type ) {
// this[ name ](key, data, type[key], fn);
// }
// return this;
// }
// if ( jQuery.isFunction( data ) || data === false ) {
// fn = data;
// data = undefined;
// }
// var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
// jQuery( this ).unbind( event, handler );
// return fn.apply( this, arguments );
// }) : fn;
// if ( type === "unload" && name !== "one" ) {
// this.one( type, data, fn );
// } else {
// for ( var i = 0, l = this.length; i < l; i++ ) {
// jQuery.event.add( this[i], type, handler, data );
// }
// }
// return this;
// };
// });
jQuery.fn[ "bind" ] = function( type, data, fn ) {
/// <summary>
/// Binds a handler to one or more events for each matched element. Can also bind custom events.
/// </summary>
/// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param>
/// <param name="data" optional="true" type="Object">Additional data passed to the event handler as event.data</param>
/// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param>
// Handle object literals
if ( typeof type === "object" ) {
for ( var key in type ) {
this[ "bind" ](key, data, type[key], fn);
}
return this;
}
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
var handler = "bind" === "one" ? jQuery.proxy( fn, function( event ) {
jQuery( this ).unbind( event, handler );
return fn.apply( this, arguments );
}) : fn;
return type === "unload" && "bind" !== "one" ?
this.one( type, data, fn ) :
this.each(function() {
jQuery.event.add( this, type, handler, data );
});
};
jQuery.fn[ "one" ] = function( type, data, fn ) {
/// <summary>
/// Binds a handler to one or more events to be executed exactly once for each matched element.
/// </summary>
/// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param>
/// <param name="data" optional="true" type="Object">Additional data passed to the event handler as event.data</param>
/// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param>
// Handle object literals
if ( typeof type === "object" ) {
for ( var key in type ) {
this[ "one" ](key, data, type[key], fn);
}
return this;
}
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
var handler = "one" === "one" ? jQuery.proxy( fn, function( event ) {
jQuery( this ).unbind( event, handler );
return fn.apply( this, arguments );
}) : fn;
return type === "unload" && "one" !== "one" ?
this.one( type, data, fn ) :
this.each(function() {
jQuery.event.add( this, type, handler, data );
});
};
jQuery.fn.extend({
unbind: function( type, fn ) {
/// <summary>
/// Unbinds a handler from one or more events for each matched element.
/// </summary>
/// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param>
/// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param>
// Handle object literals
if ( typeof type === "object" && !type.preventDefault ) {
for ( var key in type ) {
this.unbind(key, type[key]);
}
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.remove( this[i], type, fn );
}
}
return this;
},
delegate: function( selector, types, data, fn ) {
return this.live( types, data, fn, selector );
},
undelegate: function( selector, types, fn ) {
if ( arguments.length === 0 ) {
return this.unbind( "live" );
} else {
return this.die( types, null, fn, selector );
}
},
trigger: function( type, data ) {
/// <summary>
/// Triggers a type of event on every matched element.
/// </summary>
/// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param>
/// <param name="data" optional="true" type="Array">Additional data passed to the event handler as additional arguments.</param>
/// <param name="fn" type="Function">This parameter is undocumented.</param>
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
/// <summary>
/// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions.
/// </summary>
/// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param>
/// <param name="data" optional="true" type="Array">Additional data passed to the event handler as additional arguments.</param>
/// <param name="fn" type="Function">This parameter is undocumented.</param>
if ( this[0] ) {
var event = jQuery.Event( type );
event.preventDefault();
event.stopPropagation();
jQuery.event.trigger( event, data, this[0] );
return event.result;
}
},
toggle: function( fn ) {
/// <summary>
/// Toggles among two or more function calls every other click.
/// </summary>
/// <param name="fn" type="Function">The functions among which to toggle execution</param>
// Save reference to arguments for access in closure
var args = arguments,
i = 1;
// link all the functions, so any of them can unbind this click handler
while ( i < args.length ) {
jQuery.proxy( fn, args[ i++ ] );
}
return this.click( jQuery.proxy( fn, function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
return args[ lastToggle ].apply( this, arguments ) || false;
}));
},
hover: function( fnOver, fnOut ) {
/// <summary>
/// Simulates hovering (moving the mouse on or off of an object).
/// </summary>
/// <param name="fnOver" type="Function">The function to fire when the mouse is moved over a matched element.</param>
/// <param name="fnOut" type="Function">The function to fire when the mouse is moved off of a matched element.</param>
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
var liveMap = {
focus: "focusin",
blur: "focusout",
mouseenter: "mouseover",
mouseleave: "mouseout"
};
// jQuery.each(["live", "die"], function( i, name ) {
// jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
// var type, i = 0, match, namespaces, preType,
// selector = origSelector || this.selector,
// context = origSelector ? this : jQuery( this.context );
// if ( typeof types === "object" && !types.preventDefault ) {
// for ( var key in types ) {
// context[ name ]( key, data, types[key], selector );
// }
// return this;
// }
// if ( jQuery.isFunction( data ) ) {
// fn = data;
// data = undefined;
// }
// types = (types || "").split(" ");
// while ( (type = types[ i++ ]) != null ) {
// match = rnamespaces.exec( type );
// namespaces = "";
// if ( match ) {
// namespaces = match[0];
// type = type.replace( rnamespaces, "" );
// }
// if ( type === "hover" ) {
// types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
// continue;
// }
// preType = type;
// if ( type === "focus" || type === "blur" ) {
// types.push( liveMap[ type ] + namespaces );
// type = type + namespaces;
// } else {
// type = (liveMap[ type ] || type) + namespaces;
// }
// if ( name === "live" ) {
// // bind live handler
// for ( var j = 0, l = context.length; j < l; j++ ) {
// jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
// { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
// }
// } else {
// // unbind live handler
// context.unbind( "live." + liveConvert( type, selector ), fn );
// }
// }
// return this;
// };
// });
jQuery.fn[ "live" ] = function( types, data, fn ) {
/// <summary>
/// Attach a handler to the event for all elements which match the current selector, now or
/// in the future.
/// </summary>
/// <param name="types" type="String">
/// A string containing a JavaScript event type, such as "click" or "keydown".
/// </param>
/// <param name="data" type="Object">
/// A map of data that will be passed to the event handler.
/// </param>
/// <param name="fn" type="Function">
/// A function to execute at the time the event is triggered.
/// </param>
/// <returns type="jQuery" />
var type, i = 0;
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
types = (types || "").split( /\s+/ );
while ( (type = types[ i++ ]) != null ) {
type = type === "focus" ? "focusin" : // focus --> focusin
type === "blur" ? "focusout" : // blur --> focusout
type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support
type;
if ( "live" === "live" ) {
// bind live handler
jQuery( this.context ).bind( liveConvert( type, this.selector ), {
data: data, selector: this.selector, live: type
}, fn );
} else {
// unbind live handler
jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
}
}
return this;
}
jQuery.fn[ "die" ] = function( types, data, fn ) {
/// <summary>
/// Remove all event handlers previously attached using .live() from the elements.
/// </summary>
/// <param name="types" type="String">
/// A string containing a JavaScript event type, such as click or keydown.
/// </param>
/// <param name="data" type="Object">
/// The function that is to be no longer executed.
/// </param>
/// <returns type="jQuery" />
var type, i = 0;
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
types = (types || "").split( /\s+/ );
while ( (type = types[ i++ ]) != null ) {
type = type === "focus" ? "focusin" : // focus --> focusin
type === "blur" ? "focusout" : // blur --> focusout
type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support
type;
if ( "die" === "live" ) {
// bind live handler
jQuery( this.context ).bind( liveConvert( type, this.selector ), {
data: data, selector: this.selector, live: type
}, fn );
} else {
// unbind live handler
jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
}
}
return this;
}
function liveHandler( event ) {
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
elems = [],
selectors = [],
events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
if ( typeof events === "function" ) {
events = events.events;
}
// Make sure we avoid non-left-click bubbling in Firefox (#3861)
if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
return;
}
if ( event.namespace ) {
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
}
event.liveFired = this;
var live = events.live.slice(0);
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
selectors.push( handleObj.selector );
} else {
live.splice( j--, 1 );
}
}
match = jQuery( event.target ).closest( selectors, event.currentTarget );
for ( i = 0, l = match.length; i < l; i++ ) {
close = match[i];
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
elem = close.elem;
related = null;
// Those two events require additional checking
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
event.type = handleObj.preType;
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
}
if ( !related || related !== elem ) {
elems.push({ elem: elem, handleObj: handleObj, level: close.level });
}
}
}
}
for ( i = 0, l = elems.length; i < l; i++ ) {
match = elems[i];
if ( maxLevel && match.level > maxLevel ) {
break;
}
event.currentTarget = match.elem;
event.data = match.handleObj.data;
event.handleObj = match.handleObj;
ret = match.handleObj.origHandler.apply( match.elem, arguments );
if ( ret === false || event.isPropagationStopped() ) {
maxLevel = match.level;
if ( ret === false ) {
stop = false;
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
return stop;
}
function liveConvert( type, selector ) {
return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
}
// jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
// "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
// "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
// // Handle event binding
// jQuery.fn[ name ] = function( data, fn ) {
// if ( fn == null ) {
// fn = data;
// data = null;
// }
// return arguments.length > 0 ?
// this.bind( name, data, fn ) :
// this.trigger( name );
// };
// if ( jQuery.attrFn ) {
// jQuery.attrFn[ name ] = true;
// }
// });
jQuery.fn[ "blur" ] = function( fn ) {
/// <summary>
/// 1: blur() - Triggers the blur event of each matched element.
/// 2: blur(fn) - Binds a function to the blur event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "blur", fn ) : this.trigger( "blur" );
};
jQuery.fn[ "focus" ] = function( fn ) {
/// <summary>
/// 1: focus() - Triggers the focus event of each matched element.
/// 2: focus(fn) - Binds a function to the focus event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "focus", fn ) : this.trigger( "focus" );
};
jQuery.fn[ "focusin" ] = function( fn ) {
/// <summary>
/// Bind an event handler to the "focusin" JavaScript event.
/// </summary>
/// <param name="fn" type="Function">
/// A function to execute each time the event is triggered.
/// </param>
/// <returns type="jQuery" />
return fn ? this.bind( "focusin", fn ) : this.trigger( "focusin" );
};
jQuery.fn[ "focusout" ] = function( fn ) {
/// <summary>
/// Bind an event handler to the "focusout" JavaScript event.
/// </summary>
/// <param name="fn" type="Function">
/// A function to execute each time the event is triggered.
/// </param>
/// <returns type="jQuery" />
return fn ? this.bind( "focusout", fn ) : this.trigger( "focusout" );
};
jQuery.fn[ "load" ] = function( fn ) {
/// <summary>
/// 1: load() - Triggers the load event of each matched element.
/// 2: load(fn) - Binds a function to the load event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "load", fn ) : this.trigger( "load" );
};
jQuery.fn[ "resize" ] = function( fn ) {
/// <summary>
/// 1: resize() - Triggers the resize event of each matched element.
/// 2: resize(fn) - Binds a function to the resize event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "resize", fn ) : this.trigger( "resize" );
};
jQuery.fn[ "scroll" ] = function( fn ) {
/// <summary>
/// 1: scroll() - Triggers the scroll event of each matched element.
/// 2: scroll(fn) - Binds a function to the scroll event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "scroll", fn ) : this.trigger( "scroll" );
};
jQuery.fn[ "unload" ] = function( fn ) {
/// <summary>
/// 1: unload() - Triggers the unload event of each matched element.
/// 2: unload(fn) - Binds a function to the unload event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "unload", fn ) : this.trigger( "unload" );
};
jQuery.fn[ "click" ] = function( fn ) {
/// <summary>
/// 1: click() - Triggers the click event of each matched element.
/// 2: click(fn) - Binds a function to the click event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "click", fn ) : this.trigger( "click" );
};
jQuery.fn[ "dblclick" ] = function( fn ) {
/// <summary>
/// 1: dblclick() - Triggers the dblclick event of each matched element.
/// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "dblclick", fn ) : this.trigger( "dblclick" );
};
jQuery.fn[ "mousedown" ] = function( fn ) {
/// <summary>
/// Binds a function to the mousedown event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "mousedown", fn ) : this.trigger( "mousedown" );
};
jQuery.fn[ "mouseup" ] = function( fn ) {
/// <summary>
/// Bind a function to the mouseup event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "mouseup", fn ) : this.trigger( "mouseup" );
};
jQuery.fn[ "mousemove" ] = function( fn ) {
/// <summary>
/// Bind a function to the mousemove event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "mousemove", fn ) : this.trigger( "mousemove" );
};
jQuery.fn[ "mouseover" ] = function( fn ) {
/// <summary>
/// Bind a function to the mouseover event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "mouseover", fn ) : this.trigger( "mouseover" );
};
jQuery.fn[ "mouseout" ] = function( fn ) {
/// <summary>
/// Bind a function to the mouseout event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "mouseout", fn ) : this.trigger( "mouseout" );
};
jQuery.fn[ "mouseenter" ] = function( fn ) {
/// <summary>
/// Bind a function to the mouseenter event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "mouseenter", fn ) : this.trigger( "mouseenter" );
};
jQuery.fn[ "mouseleave" ] = function( fn ) {
/// <summary>
/// Bind a function to the mouseleave event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "mouseleave", fn ) : this.trigger( "mouseleave" );
};
jQuery.fn[ "change" ] = function( fn ) {
/// <summary>
/// 1: change() - Triggers the change event of each matched element.
/// 2: change(fn) - Binds a function to the change event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "change", fn ) : this.trigger( "change" );
};
jQuery.fn[ "select" ] = function( fn ) {
/// <summary>
/// 1: select() - Triggers the select event of each matched element.
/// 2: select(fn) - Binds a function to the select event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "select", fn ) : this.trigger( "select" );
};
jQuery.fn[ "submit" ] = function( fn ) {
/// <summary>
/// 1: submit() - Triggers the submit event of each matched element.
/// 2: submit(fn) - Binds a function to the submit event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "submit", fn ) : this.trigger( "submit" );
};
jQuery.fn[ "keydown" ] = function( fn ) {
/// <summary>
/// 1: keydown() - Triggers the keydown event of each matched element.
/// 2: keydown(fn) - Binds a function to the keydown event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "keydown", fn ) : this.trigger( "keydown" );
};
jQuery.fn[ "keypress" ] = function( fn ) {
/// <summary>
/// 1: keypress() - Triggers the keypress event of each matched element.
/// 2: keypress(fn) - Binds a function to the keypress event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "keypress", fn ) : this.trigger( "keypress" );
};
jQuery.fn[ "keyup" ] = function( fn ) {
/// <summary>
/// 1: keyup() - Triggers the keyup event of each matched element.
/// 2: keyup(fn) - Binds a function to the keyup event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "keyup", fn ) : this.trigger( "keyup" );
};
jQuery.fn[ "error" ] = function( fn ) {
/// <summary>
/// 1: error() - Triggers the error event of each matched element.
/// 2: error(fn) - Binds a function to the error event of each matched element.
/// </summary>
/// <param name="fn" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return fn ? this.bind( "error", fn ) : this.trigger( "error" );
};
// Prevent memory leaks in IE
// Window isn't included so as not to unbind existing unload events
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) {
jQuery(window).bind("unload", function() {
for ( var id in jQuery.cache ) {
if ( jQuery.cache[ id ].handle ) {
// Try/Catch is to handle iframes being unloaded, see #4280
try {
jQuery.event.remove( jQuery.cache[ id ].handle.elem );
} catch(e) {}
}
}
});
}
(function(){
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
done = 0,
toString = Object.prototype.toString,
hasDuplicate = false,
baseHasDuplicate = true;
// Here we check if the JavaScript engine is using some sort of
// optimization where it does not always call our comparision
// function. If that is the case, discard the hasDuplicate value.
// Thus far that includes Google Chrome.
[0, 0].sort(function() {
baseHasDuplicate = false;
return 0;
});
var Sizzle = function( selector, context, results, seed ) {
results = results || [];
context = context || document;
var origContext = context;
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
return [];
}
if ( !selector || typeof selector !== "string" ) {
return results;
}
var m, set, checkSet, extra, ret, cur, pop, i,
prune = true,
contextXML = Sizzle.isXML( context ),
parts = [],
soFar = selector;
// Reset the position of the chunker regexp (start from head)
do {
chunker.exec( "" );
m = chunker.exec( soFar );
if ( m ) {
soFar = m[3];
parts.push( m[1] );
if ( m[2] ) {
extra = m[3];
break;
}
}
} while ( m );
if ( parts.length > 1 && origPOS.exec( selector ) ) {
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
set = posProcess( parts[0] + parts[1], context );
} else {
set = Expr.relative[ parts[0] ] ?
[ context ] :
Sizzle( parts.shift(), context );
while ( parts.length ) {
selector = parts.shift();
if ( Expr.relative[ selector ] ) {
selector += parts.shift();
}
set = posProcess( selector, set );
}
}
} else {
// Take a shortcut and set the context if the root selector is an ID
// (but not if it'll be faster if the inner selector is an ID)
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
ret = Sizzle.find( parts.shift(), context, contextXML );
context = ret.expr ?
Sizzle.filter( ret.expr, ret.set )[0] :
ret.set[0];
}
if ( context ) {
ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
set = ret.expr ?
Sizzle.filter( ret.expr, ret.set ) :
ret.set;
if ( parts.length > 0 ) {
checkSet = makeArray( set );
} else {
prune = false;
}
while ( parts.length ) {
cur = parts.pop();
pop = cur;
if ( !Expr.relative[ cur ] ) {
cur = "";
} else {
pop = parts.pop();
}
if ( pop == null ) {
pop = context;
}
Expr.relative[ cur ]( checkSet, pop, contextXML );
}
} else {
checkSet = parts = [];
}
}
if ( !checkSet ) {
checkSet = set;
}
if ( !checkSet ) {
Sizzle.error( cur || selector );
}
if ( toString.call(checkSet) === "[object Array]" ) {
if ( !prune ) {
results.push.apply( results, checkSet );
} else if ( context && context.nodeType === 1 ) {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
results.push( set[i] );
}
}
} else {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
results.push( set[i] );
}
}
}
} else {
makeArray( checkSet, results );
}
if ( extra ) {
Sizzle( extra, origContext, results, seed );
Sizzle.uniqueSort( results );
}
return results;
};
Sizzle.uniqueSort = function( results ) {
/// <summary>
/// Removes all duplicate elements from an array of elements.
/// </summary>
/// <param name="array" type="Array&lt;Element&gt;">The array to translate</param>
/// <returns type="Array&lt;Element&gt;">The array after translation.</returns>
if ( sortOrder ) {
hasDuplicate = baseHasDuplicate;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( var i = 1; i < results.length; i++ ) {
if ( results[i] === results[ i - 1 ] ) {
results.splice( i--, 1 );
}
}
}
}
return results;
};
Sizzle.matches = function( expr, set ) {
return Sizzle( expr, null, null, set );
};
Sizzle.matchesSelector = function( node, expr ) {
return Sizzle( expr, null, null, [node] ).length > 0;
};
Sizzle.find = function( expr, context, isXML ) {
var set;
if ( !expr ) {
return [];
}
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
var match,
type = Expr.order[i];
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
var left = match[1];
match.splice( 1, 1 );
if ( left.substr( left.length - 1 ) !== "\\" ) {
match[1] = (match[1] || "").replace(/\\/g, "");
set = Expr.find[ type ]( match, context, isXML );
if ( set != null ) {
expr = expr.replace( Expr.match[ type ], "" );
break;
}
}
}
}
if ( !set ) {
set = context.getElementsByTagName( "*" );
}
return { set: set, expr: expr };
};
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
old = expr,
result = [],
curLoop = set,
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
while ( expr && set.length ) {
for ( var type in Expr.filter ) {
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
var found, item,
filter = Expr.filter[ type ],
left = match[1];
anyFound = false;
match.splice(1,1);
if ( left.substr( left.length - 1 ) === "\\" ) {
continue;
}
if ( curLoop === result ) {
result = [];
}
if ( Expr.preFilter[ type ] ) {
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
}
if ( match ) {
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
if ( inplace && found != null ) {
if ( pass ) {
anyFound = true;
} else {
curLoop[i] = false;
}
} else if ( pass ) {
result.push( item );
anyFound = true;
}
}
}
}
if ( found !== undefined ) {
if ( !inplace ) {
curLoop = result;
}
expr = expr.replace( Expr.match[ type ], "" );
if ( !anyFound ) {
return [];
}
break;
}
}
}
// Improper expression
if ( expr === old ) {
if ( anyFound == null ) {
Sizzle.error( expr );
} else {
break;
}
}
old = expr;
}
return curLoop;
};
Sizzle.error = function( msg ) {
throw "Syntax error, unrecognized expression: " + msg;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function( elem ) {
return elem.getAttribute( "href" );
}
},
relative: {
"+": function(checkSet, part){
var isPartStr = typeof part === "string",
isTag = isPartStr && !/\W/.test( part ),
isPartStrNotTag = isPartStr && !isTag;
if ( isTag ) {
part = part.toLowerCase();
}
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
if ( (elem = checkSet[i]) ) {
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
elem || false :
elem === part;
}
}
if ( isPartStrNotTag ) {
Sizzle.filter( part, checkSet, true );
}
},
">": function( checkSet, part ) {
var elem,
isPartStr = typeof part === "string",
i = 0,
l = checkSet.length;
if ( isPartStr && !/\W/.test( part ) ) {
part = part.toLowerCase();
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
var parent = elem.parentNode;
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
}
}
} else {
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
checkSet[i] = isPartStr ?
elem.parentNode :
elem.parentNode === part;
}
}
if ( isPartStr ) {
Sizzle.filter( part, checkSet, true );
}
}
},
"": function(checkSet, part, isXML){
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !/\W/.test(part) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
},
"~": function( checkSet, part, isXML ) {
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !/\W/.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
}
},
find: {
ID: function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
},
NAME: function( match, context ) {
if ( typeof context.getElementsByName !== "undefined" ) {
var ret = [],
results = context.getElementsByName( match[1] );
for ( var i = 0, l = results.length; i < l; i++ ) {
if ( results[i].getAttribute("name") === match[1] ) {
ret.push( results[i] );
}
}
return ret.length === 0 ? null : ret;
}
},
TAG: function( match, context ) {
return context.getElementsByTagName( match[1] );
}
},
preFilter: {
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
match = " " + match[1].replace(/\\/g, "") + " ";
if ( isXML ) {
return match;
}
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
if ( elem ) {
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
if ( !inplace ) {
result.push( elem );
}
} else if ( inplace ) {
curLoop[i] = false;
}
}
}
return false;
},
ID: function( match ) {
return match[1].replace(/\\/g, "");
},
TAG: function( match, curLoop ) {
return match[1].toLowerCase();
},
CHILD: function( match ) {
if ( match[1] === "nth" ) {
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
// calculate the numbers (first)n+(last) including if they are negative
match[2] = (test[1] + (test[2] || 1)) - 0;
match[3] = test[3] - 0;
}
// TODO: Move to normal caching system
match[0] = done++;
return match;
},
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
var name = match[1].replace(/\\/g, "");
if ( !isXML && Expr.attrMap[name] ) {
match[1] = Expr.attrMap[name];
}
if ( match[2] === "~=" ) {
match[4] = " " + match[4] + " ";
}
return match;
},
PSEUDO: function( match, curLoop, inplace, result, not ) {
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
if ( !inplace ) {
result.push.apply( result, ret );
}
return false;
}
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
return true;
}
return match;
},
POS: function( match ) {
match.unshift( true );
return match;
}
},
filters: {
enabled: function( elem ) {
return elem.disabled === false && elem.type !== "hidden";
},
disabled: function( elem ) {
return elem.disabled === true;
},
checked: function( elem ) {
return elem.checked === true;
},
selected: function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
elem.parentNode.selectedIndex;
return elem.selected === true;
},
parent: function( elem ) {
return !!elem.firstChild;
},
empty: function( elem ) {
return !elem.firstChild;
},
has: function( elem, i, match ) {
/// <summary>
/// Internal use only; use hasClass('class')
/// </summary>
/// <private />
return !!Sizzle( match[3], elem ).length;
},
header: function( elem ) {
return (/h\d/i).test( elem.nodeName );
},
text: function( elem ) {
return "text" === elem.type;
},
radio: function( elem ) {
return "radio" === elem.type;
},
checkbox: function( elem ) {
return "checkbox" === elem.type;
},
file: function( elem ) {
return "file" === elem.type;
},
password: function( elem ) {
return "password" === elem.type;
},
submit: function( elem ) {
return "submit" === elem.type;
},
image: function( elem ) {
return "image" === elem.type;
},
reset: function( elem ) {
return "reset" === elem.type;
},
button: function( elem ) {
return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
},
input: function( elem ) {
return (/input|select|textarea|button/i).test( elem.nodeName );
}
},
setFilters: {
first: function( elem, i ) {
return i === 0;
},
last: function( elem, i, match, array ) {
return i === array.length - 1;
},
even: function( elem, i ) {
return i % 2 === 0;
},
odd: function( elem, i ) {
return i % 2 === 1;
},
lt: function( elem, i, match ) {
return i < match[3] - 0;
},
gt: function( elem, i, match ) {
return i > match[3] - 0;
},
nth: function( elem, i, match ) {
return match[3] - 0 === i;
},
eq: function( elem, i, match ) {
return match[3] - 0 === i;
}
},
filter: {
PSEUDO: function( elem, match, i, array ) {
var name = match[1],
filter = Expr.filters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
} else if ( name === "contains" ) {
return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
} else if ( name === "not" ) {
var not = match[3];
for ( var j = 0, l = not.length; j < l; j++ ) {
if ( not[j] === elem ) {
return false;
}
}
return true;
} else {
Sizzle.error( "Syntax error, unrecognized expression: " + name );
}
},
CHILD: function( elem, match ) {
var type = match[1],
node = elem;
switch ( type ) {
case "only":
case "first":
while ( (node = node.previousSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
if ( type === "first" ) {
return true;
}
node = elem;
case "last":
while ( (node = node.nextSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
return true;
case "nth":
var first = match[2],
last = match[3];
if ( first === 1 && last === 0 ) {
return true;
}
var doneName = match[0],
parent = elem.parentNode;
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
var count = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
node.nodeIndex = ++count;
}
}
parent.sizcache = doneName;
}
var diff = elem.nodeIndex - last;
if ( first === 0 ) {
return diff === 0;
} else {
return ( diff % first === 0 && diff / first >= 0 );
}
}
},
ID: function( elem, match ) {
return elem.nodeType === 1 && elem.getAttribute("id") === match;
},
TAG: function( elem, match ) {
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
},
CLASS: function( elem, match ) {
return (" " + (elem.className || elem.getAttribute("class")) + " ")
.indexOf( match ) > -1;
},
ATTR: function( elem, match ) {
var name = match[1],
result = Expr.attrHandle[ name ] ?
Expr.attrHandle[ name ]( elem ) :
elem[ name ] != null ?
elem[ name ] :
elem.getAttribute( name ),
value = result + "",
type = match[2],
check = match[4];
return result == null ?
type === "!=" :
type === "=" ?
value === check :
type === "*=" ?
value.indexOf(check) >= 0 :
type === "~=" ?
(" " + value + " ").indexOf(check) >= 0 :
!check ?
value && result !== false :
type === "!=" ?
value !== check :
type === "^=" ?
value.indexOf(check) === 0 :
type === "$=" ?
value.substr(value.length - check.length) === check :
type === "|=" ?
value === check || value.substr(0, check.length + 1) === check + "-" :
false;
},
POS: function( elem, match, i, array ) {
var name = match[2],
filter = Expr.setFilters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
}
}
}
};
var origPOS = Expr.match.POS,
fescape = function(all, num){
return "\\" + (num - 0 + 1);
};
for ( var type in Expr.match ) {
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
}
var makeArray = function( array, results ) {
array = Array.prototype.slice.call( array, 0 );
if ( results ) {
results.push.apply( results, array );
return results;
}
return array;
};
// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
// Also verifies that the returned array holds DOM nodes
// (which is not the case in the Blackberry browser)
try {
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
// Provide a fallback method if it does not work
} catch( e ) {
makeArray = function( array, results ) {
var i = 0,
ret = results || [];
if ( toString.call(array) === "[object Array]" ) {
Array.prototype.push.apply( ret, array );
} else {
if ( typeof array.length === "number" ) {
for ( var l = array.length; i < l; i++ ) {
ret.push( array[i] );
}
} else {
for ( ; array[i]; i++ ) {
ret.push( array[i] );
}
}
}
return ret;
};
}
var sortOrder, siblingCheck;
if ( document.documentElement.compareDocumentPosition ) {
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
return a.compareDocumentPosition ? -1 : 1;
}
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
};
} else {
sortOrder = function( a, b ) {
var al, bl,
ap = [],
bp = [],
aup = a.parentNode,
bup = b.parentNode,
cur = aup;
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
return 0;
// If the nodes are siblings (or identical) we can do a quick check
} else if ( aup === bup ) {
return siblingCheck( a, b );
// If no parents were found then the nodes are disconnected
} else if ( !aup ) {
return -1;
} else if ( !bup ) {
return 1;
}
// Otherwise they're somewhere else in the tree so we need
// to build up a full list of the parentNodes for comparison
while ( cur ) {
ap.unshift( cur );
cur = cur.parentNode;
}
cur = bup;
while ( cur ) {
bp.unshift( cur );
cur = cur.parentNode;
}
al = ap.length;
bl = bp.length;
// Start walking down the tree looking for a discrepancy
for ( var i = 0; i < al && i < bl; i++ ) {
if ( ap[i] !== bp[i] ) {
return siblingCheck( ap[i], bp[i] );
}
}
// We ended someplace up the tree so do a sibling check
return i === al ?
siblingCheck( a, bp[i], -1 ) :
siblingCheck( ap[i], b, 1 );
};
siblingCheck = function( a, b, ret ) {
if ( a === b ) {
return ret;
}
var cur = a.nextSibling;
while ( cur ) {
if ( cur === b ) {
return -1;
}
cur = cur.nextSibling;
}
return 1;
};
}
// Utility function for retreiving the text value of an array of DOM nodes
Sizzle.getText = function( elems ) {
var ret = "", elem;
for ( var i = 0; elems[i]; i++ ) {
elem = elems[i];
// Get the text from text nodes and CDATA nodes
if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
ret += elem.nodeValue;
// Traverse everything else, except comment nodes
} else if ( elem.nodeType !== 8 ) {
ret += Sizzle.getText( elem.childNodes );
}
}
return ret;
};
// [vsdoc] The following function has been modified for IntelliSense.
// Check to see if the browser returns elements by name when
// querying by getElementById (and provide a workaround)
(function(){
// We're going to inject a fake input element with a specified name
// var form = document.createElement("div"),
// id = "script" + (new Date()).getTime(),
// root = document.documentElement;
// form.innerHTML = "<a name='" + id + "'/>";
// // Inject it into the root element, check its status, and remove it quickly
// root.insertBefore( form, root.firstChild );
// // The workaround has to do additional checks after a getElementById
// // Which slows things down for other browsers (hence the branching)
// if ( document.getElementById( id ) ) {
Expr.find.ID = function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
return m ?
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
[m] :
undefined :
[];
}
};
Expr.filter.ID = function( elem, match ) {
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
return elem.nodeType === 1 && node && node.nodeValue === match;
};
// }
// root.removeChild( form );
// release memory in IE
root = form = null;
})();
// [vsdoc] The following function has been modified for IntelliSense.
(function(){
// Check to see if the browser returns only elements
// when doing getElementsByTagName("*")
// Create a fake element
// var div = document.createElement("div");
// div.appendChild( document.createComment("") );
// Make sure no comments are found
// if ( div.getElementsByTagName("*").length > 0 ) {
Expr.find.TAG = function( match, context ) {
var results = context.getElementsByTagName( match[1] );
// Filter out possible comments
if ( match[1] === "*" ) {
var tmp = [];
for ( var i = 0; results[i]; i++ ) {
if ( results[i].nodeType === 1 ) {
tmp.push( results[i] );
}
}
results = tmp;
}
return results;
};
// }
// Check to see if an attribute returns normalized href attributes
// div.innerHTML = "<a href='#'></a>";
// if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
// div.firstChild.getAttribute("href") !== "#" ) {
// Expr.attrHandle.href = function( elem ) {
// return elem.getAttribute( "href", 2 );
// };
// }
// release memory in IE
div = null;
})();
if ( document.querySelectorAll ) {
(function(){
var oldSizzle = Sizzle,
div = document.createElement("div"),
id = "__sizzle__";
div.innerHTML = "<p class='TEST'></p>";
// Safari can't handle uppercase or unicode characters when
// in quirks mode.
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
return;
}
Sizzle = function( query, context, extra, seed ) {
context = context || document;
// Make sure that attribute selectors are quoted
query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
// Only use querySelectorAll on non-XML documents
// (ID selectors don't work in non-HTML documents)
if ( !seed && !Sizzle.isXML(context) ) {
if ( context.nodeType === 9 ) {
try {
return makeArray( context.querySelectorAll(query), extra );
} catch(qsaError) {}
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
// and working up from there (Thanks to Andrew Dupont for the technique)
// IE 8 doesn't work on object elements
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
var old = context.getAttribute( "id" ),
nid = old || id;
if ( !old ) {
context.setAttribute( "id", nid );
}
try {
return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra );
} catch(pseudoError) {
} finally {
if ( !old ) {
context.removeAttribute( "id" );
}
}
}
}
return oldSizzle(query, context, extra, seed);
};
for ( var prop in oldSizzle ) {
Sizzle[ prop ] = oldSizzle[ prop ];
}
// release memory in IE
div = null;
})();
}
(function(){
var html = document.documentElement,
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
pseudoWorks = false;
try {
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( document.documentElement, "[test!='']:sizzle" );
} catch( pseudoError ) {
pseudoWorks = true;
}
if ( matches ) {
Sizzle.matchesSelector = function( node, expr ) {
// Make sure that attribute selectors are quoted
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
if ( !Sizzle.isXML( node ) ) {
try {
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
return matches.call( node, expr );
}
} catch(e) {}
}
return Sizzle(expr, null, null, [node]).length > 0;
};
}
})();
(function(){
var div = document.createElement("div");
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
// Opera can't find a second classname (in 9.6)
// Also, make sure that getElementsByClassName actually exists
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
return;
}
// Safari caches class attributes, doesn't catch changes (in 3.2)
div.lastChild.className = "e";
if ( div.getElementsByClassName("e").length === 1 ) {
return;
}
Expr.order.splice(1, 0, "CLASS");
Expr.find.CLASS = function( match, context, isXML ) {
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
return context.getElementsByClassName(match[1]);
}
};
// release memory in IE
div = null;
})();
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 && !isXML ){
elem.sizcache = doneName;
elem.sizset = i;
}
if ( elem.nodeName.toLowerCase() === cur ) {
match = elem;
break;
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 ) {
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
match = elem;
break;
}
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
if ( document.documentElement.contains ) {
Sizzle.contains = function( a, b ) {
/// <summary>
/// Check to see if a DOM node is within another DOM node.
/// </summary>
/// <param name="a" type="Object">
/// The DOM element that may contain the other element.
/// </param>
/// <param name="b" type="Object">
/// The DOM node that may be contained by the other element.
/// </param>
/// <returns type="Boolean" />
return a !== b && (a.contains ? a.contains(b) : true);
};
} else if ( document.documentElement.compareDocumentPosition ) {
Sizzle.contains = function( a, b ) {
/// <summary>
/// Check to see if a DOM node is within another DOM node.
/// </summary>
/// <param name="a" type="Object">
/// The DOM element that may contain the other element.
/// </param>
/// <param name="b" type="Object">
/// The DOM node that may be contained by the other element.
/// </param>
/// <returns type="Boolean" />
return !!(a.compareDocumentPosition(b) & 16);
};
} else {
Sizzle.contains = function() {
return false;
};
}
Sizzle.isXML = function( elem ) {
/// <summary>
/// Determines if the parameter passed is an XML document.
/// </summary>
/// <param name="elem" type="Object">The object to test</param>
/// <returns type="Boolean">True if the parameter is an XML document; otherwise false.</returns>
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
var posProcess = function( selector, context ) {
var match,
tmpSet = [],
later = "",
root = context.nodeType ? [context] : context;
// Position selectors must be done after the filter
// And so must :not(positional) so we move all PSEUDOs to the end
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
later += match[0];
selector = selector.replace( Expr.match.PSEUDO, "" );
}
selector = Expr.relative[selector] ? selector + "*" : selector;
for ( var i = 0, l = root.length; i < l; i++ ) {
Sizzle( selector, root[i], tmpSet );
}
return Sizzle.filter( later, tmpSet );
};
// EXPOSE
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})();
var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
POS = jQuery.expr.match.POS;
jQuery.fn.extend({
find: function( selector ) {
/// <summary>
/// Searches for all elements that match the specified expression.
/// This method is a good way to find additional descendant
/// elements with which to process.
/// All searching is done using a jQuery expression. The expression can be
/// written using CSS 1-3 Selector syntax, or basic XPath.
/// Part of DOM/Traversing
/// </summary>
/// <returns type="jQuery" />
/// <param name="selector" type="String">
/// An expression to search with.
/// </param>
/// <returns type="jQuery" />
var ret = this.pushStack( "", "find", selector ),
length = 0;
for ( var i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
jQuery.find( selector, this[i], ret );
if ( i > 0 ) {
// Make sure that the results are unique
for ( var n = length; n < ret.length; n++ ) {
for ( var r = 0; r < length; r++ ) {
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
}
}
}
}
return ret;
},
has: function( target ) {
/// <summary>
/// Reduce the set of matched elements to those that have a descendant that matches the
/// selector or DOM element.
/// </summary>
/// <param name="target" type="String">
/// A string containing a selector expression to match elements against.
/// </param>
/// <returns type="jQuery" />
var targets = jQuery( target );
return this.filter(function() {
for ( var i = 0, l = targets.length; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
/// <summary>
/// Removes any elements inside the array of elements from the set
/// of matched elements. This method is used to remove one or more
/// elements from a jQuery object.
/// Part of DOM/Traversing
/// </summary>
/// <param name="selector" type="jQuery">
/// A set of elements to remove from the jQuery set of matched elements.
/// </param>
/// <returns type="jQuery" />
return this.pushStack( winnow(this, selector, false), "not", selector);
},
filter: function( selector ) {
/// <summary>
/// Removes all elements from the set of matched elements that do not
/// pass the specified filter. This method is used to narrow down
/// the results of a search.
/// })
/// Part of DOM/Traversing
/// </summary>
/// <returns type="jQuery" />
/// <param name="selector" type="Function">
/// A function to use for filtering
/// </param>
/// <returns type="jQuery" />
return this.pushStack( winnow(this, selector, true), "filter", selector );
},
is: function( selector ) {
/// <summary>
/// Checks the current selection against an expression and returns true,
/// if at least one element of the selection fits the given expression.
/// Does return false, if no element fits or the expression is not valid.
/// filter(String) is used internally, therefore all rules that apply there
/// apply here, too.
/// Part of DOM/Traversing
/// </summary>
/// <returns type="Boolean" />
/// <param name="expr" type="String">
/// The expression with which to filter
/// </param>
return !!selector && jQuery.filter( selector, this ).length > 0;
},
closest: function( selectors, context ) {
/// <summary>
/// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included.
/// </summary>
/// <param name="selectors" type="String">
/// A string containing a selector expression to match elements against.
/// </param>
/// <param name="context" type="Element">
/// A DOM element within which a matching element may be found. If no context is passed
/// in then the context of the jQuery set will be used instead.
/// </param>
/// <returns type="jQuery" />
var ret = [], i, l, cur = this[0];
if ( jQuery.isArray( selectors ) ) {
var match, selector,
matches = {},
level = 1;
if ( cur && selectors.length ) {
for ( i = 0, l = selectors.length; i < l; i++ ) {
selector = selectors[i];
if ( !matches[selector] ) {
matches[selector] = jQuery.expr.match.POS.test( selector ) ?
jQuery( selector, context || this.context ) :
selector;
}
}
while ( cur && cur.ownerDocument && cur !== context ) {
for ( selector in matches ) {
match = matches[selector];
if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
ret.push({ selector: selector, elem: cur, level: level });
}
}
cur = cur.parentNode;
level++;
}
}
return ret;
}
var pos = POS.test( selectors ) ?
jQuery( selectors, context || this.context ) : null;
for ( i = 0, l = this.length; i < l; i++ ) {
cur = this[i];
while ( cur ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
} else {
cur = cur.parentNode;
if ( !cur || !cur.ownerDocument || cur === context ) {
break;
}
}
}
}
ret = ret.length > 1 ? jQuery.unique(ret) : ret;
return this.pushStack( ret, "closest", selectors );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
/// <summary>
/// Searches every matched element for the object and returns
/// the index of the element, if found, starting with zero.
/// Returns -1 if the object wasn't found.
/// Part of Core
/// </summary>
/// <returns type="Number" />
/// <param name="elem" type="Element">
/// Object to search for
/// </param>
if ( !elem || typeof elem === "string" ) {
return jQuery.inArray( this[0],
// If it receives a string, the selector is used
// If it receives nothing, the siblings are used
elem ? jQuery( elem ) : this.parent().children() );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
/// <summary>
/// Adds one or more Elements to the set of matched elements.
/// Part of DOM/Traversing
/// </summary>
/// <param name="selector" type="String">
/// A string containing a selector expression to match additional elements against.
/// </param>
/// <param name="context" type="Element">
/// Add some elements rooted against the specified context.
/// </param>
/// <returns type="jQuery" />
var set = typeof selector === "string" ?
jQuery( selector, context || this.context ) :
jQuery.makeArray( selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
all :
jQuery.unique( all ) );
},
andSelf: function() {
/// <summary>
/// Adds the previous selection to the current selection.
/// </summary>
/// <returns type="jQuery" />
return this.add( this.prevObject );
}
});
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
/// <summary>
/// Get the ancestors of each element in the current set of matched elements, up to but not
/// including the element matched by the selector.
/// </summary>
/// <param name="until" type="String">
/// A string containing a selector expression to indicate where to stop matching ancestor
/// elements.
/// </param>
/// <returns type="jQuery" />
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return jQuery.nth( elem, 2, "nextSibling" );
},
prev: function( elem ) {
return jQuery.nth( elem, 2, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
/// <summary>
/// Get all following siblings of each element up to but not including the element matched
/// by the selector.
/// </summary>
/// <param name="until" type="String">
/// A string containing a selector expression to indicate where to stop matching following
/// sibling elements.
/// </param>
/// <returns type="jQuery" />
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
/// <summary>
/// Get all preceding siblings of each element up to but not including the element matched
/// by the selector.
/// </summary>
/// <param name="until" type="String">
/// A string containing a selector expression to indicate where to stop matching preceding
/// sibling elements.
/// </param>
/// <returns type="jQuery" />
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( elem.parentNode.firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.makeArray( elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 ? jQuery.unique( ret ) : ret;
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret, name, slice.call(arguments).join(",") );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
/// <summary>
/// This member is internal only.
/// </summary>
/// <private />
var matched = [],
cur = elem[ dir ];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
nth: function( cur, result, dir, elem ) {
/// <summary>
/// This member is internal only.
/// </summary>
/// <private />
result = result || 1;
var num = 0;
for ( ; cur; cur = cur[dir] ) {
if ( cur.nodeType === 1 && ++num === result ) {
break;
}
}
return cur;
},
sibling: function( n, elem ) {
/// <summary>
/// This member is internal only.
/// </summary>
/// <private />
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return (elem === qualifier) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem, i ) {
return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
});
}
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnocache = /<(?:script|object|embed|option|style)/i,
// checked="checked" or checked (html5)
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
raction = /\=([^="'>\s]+\/)>/g,
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ]
};
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
// IE can't serialize <link> and <script> tags normally
if ( !jQuery.support.htmlSerialize ) {
wrapMap._default = [ 1, "div<div>", "</div>" ];
}
jQuery.fn.extend({
text: function( text ) {
/// <summary>
/// Set the text contents of all matched elements.
/// Similar to html(), but escapes HTML (replace &quot;&lt;&quot; and &quot;&gt;&quot; with their
/// HTML entities).
/// Part of DOM/Attributes
/// </summary>
/// <returns type="jQuery" />
/// <param name="text" type="String">
/// The text value to set the contents of the element to.
/// </param>
if ( jQuery.isFunction(text) ) {
return this.each(function(i) {
var self = jQuery( this );
self.text( text.call(this, i, self.text()) );
});
}
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
return jQuery.text( this );
},
wrapAll: function( html ) {
/// <summary>
/// Wrap all matched elements with a structure of other elements.
/// This wrapping process is most useful for injecting additional
/// stucture into a document, without ruining the original semantic
/// qualities of a document.
/// This works by going through the first element
/// provided and finding the deepest ancestor element within its
/// structure - it is that element that will en-wrap everything else.
/// This does not work with elements that contain text. Any necessary text
/// must be added after the wrapping is done.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
/// <param name="html" type="Element">
/// A DOM element that will be wrapped around the target.
/// </param>
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append(this);
}
return this;
},
wrapInner: function( html ) {
/// <summary>
/// Wraps the inner child contents of each matched elemenht (including text nodes) with an HTML structure.
/// </summary>
/// <param name="html" type="String">
/// A string of HTML or a DOM element that will be wrapped around the target contents.
/// </param>
/// <returns type="jQuery" />
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ),
contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
});
},
wrap: function( html ) {
/// <summary>
/// Wrap all matched elements with a structure of other elements.
/// This wrapping process is most useful for injecting additional
/// stucture into a document, without ruining the original semantic
/// qualities of a document.
/// This works by going through the first element
/// provided and finding the deepest ancestor element within its
/// structure - it is that element that will en-wrap everything else.
/// This does not work with elements that contain text. Any necessary text
/// must be added after the wrapping is done.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
/// <param name="html" type="Element">
/// A DOM element that will be wrapped around the target.
/// </param>
return this.each(function() {
jQuery( this ).wrapAll( html );
});
},
unwrap: function() {
/// <summary>
/// Remove the parents of the set of matched elements from the DOM, leaving the matched
/// elements in their place.
/// </summary>
/// <returns type="jQuery" />
return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
}).end();
},
append: function() {
/// <summary>
/// Append content to the inside of every matched element.
/// This operation is similar to doing an appendChild to all the
/// specified elements, adding them into the document.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
/// <summary>
/// Prepend content to the inside of every matched element.
/// This operation is the best way to insert elements
/// inside, at the beginning, of all matched elements.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
/// <summary>
/// Insert content before each of the matched elements.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this );
});
} else if ( arguments.length ) {
var set = jQuery(arguments[0]);
set.push.apply( set, this.toArray() );
return this.pushStack( set, "before", arguments );
}
},
after: function() {
/// <summary>
/// Insert content after each of the matched elements.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
} else if ( arguments.length ) {
var set = this.pushStack( this, "after", arguments );
set.push.apply( set, jQuery(arguments[0]).toArray() );
return set;
}
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
jQuery.cleanData( [ elem ] );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
}
return this;
},
clone: function( events ) {
/// <summary>
/// Clone matched DOM Elements and select the clones.
/// This is useful for moving copies of the elements to another
/// location in the DOM.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
/// <param name="deep" type="Boolean" optional="true">
/// (Optional) Set to false if you don't want to clone all descendant nodes, in addition to the element itself.
/// </param>
// Do the clone
var ret = this.map(function() {
if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
// IE copies events bound via attachEvent when
// using cloneNode. Calling detachEvent on the
// clone will also remove the events from the orignal
// In order to get around this, we use innerHTML.
// Unfortunately, this means some modifications to
// attributes in IE that are actually only stored
// as properties will not be copied (such as the
// the name attribute on an input).
var html = this.outerHTML,
ownerDocument = this.ownerDocument;
if ( !html ) {
var div = ownerDocument.createElement("div");
div.appendChild( this.cloneNode(true) );
html = div.innerHTML;
}
return jQuery.clean([html.replace(rinlinejQuery, "")
// Handle the case in IE 8 where action=/test/> self-closes a tag
.replace(raction, '="$1">')
.replace(rleadingWhitespace, "")], ownerDocument)[0];
} else {
return this.cloneNode(true);
}
});
// Copy the events from the original to the clone
if ( events === true ) {
cloneCopyEvent( this, ret );
cloneCopyEvent( this.find("*"), ret.find("*") );
}
// Return the cloned set
return ret;
},
html: function( value ) {
/// <summary>
/// Set the html contents of every matched element.
/// This property is not available on XML documents.
/// Part of DOM/Attributes
/// </summary>
/// <returns type="jQuery" />
/// <param name="value" type="String">
/// A string of HTML to set as the content of each matched element.
/// </param>
if ( value === undefined ) {
return this[0] && this[0].nodeType === 1 ?
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
// See if we can take a shortcut and just use innerHTML
} else if ( typeof value === "string" && !rnocache.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
value = value.replace(rxhtmlTag, "<$1></$2>");
try {
for ( var i = 0, l = this.length; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
if ( this[i].nodeType === 1 ) {
jQuery.cleanData( this[i].getElementsByTagName("*") );
this[i].innerHTML = value;
}
}
// If using innerHTML throws an exception, use the fallback method
} catch(e) {
this.empty().append( value );
}
} else if ( jQuery.isFunction( value ) ) {
this.each(function(i){
var self = jQuery( this );
self.html( value.call(this, i, self.html()) );
});
} else {
this.empty().append( value );
}
return this;
},
replaceWith: function( value ) {
/// <summary>
/// Replaces all matched element with the specified HTML or DOM elements.
/// </summary>
/// <param name="value" type="Object">
/// The content to insert. May be an HTML string, DOM element, or jQuery object.
/// </param>
/// <returns type="jQuery">The element that was just replaced.</returns>
if ( this[0] && this[0].parentNode ) {
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this), old = self.html();
self.replaceWith( value.call( this, i, old ) );
});
}
if ( typeof value !== "string" ) {
value = jQuery( value ).detach();
}
return this.each(function() {
var next = this.nextSibling,
parent = this.parentNode;
jQuery( this ).remove();
if ( next ) {
jQuery(next).before( value );
} else {
jQuery(parent).append( value );
}
});
} else {
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
}
},
detach: function( selector ) {
/// <summary>
/// Remove the set of matched elements from the DOM.
/// </summary>
/// <param name="selector" type="String">
/// A selector expression that filters the set of matched elements to be removed.
/// </param>
/// <returns type="jQuery" />
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
/// <param name="args" type="Array">
/// Args
/// </param>
/// <param name="table" type="Boolean">
/// Insert TBODY in TABLEs if one is not found.
/// </param>
/// <param name="dir" type="Number">
/// If dir&lt;0, process args in reverse order.
/// </param>
/// <param name="fn" type="Function">
/// The function doing the DOM manipulation.
/// </param>
/// <returns type="jQuery" />
/// <summary>
/// Part of Core
/// </summary>
var results, first, fragment, parent,
value = args[0],
scripts = [];
// We can't cloneNode fragments that contain checked, in WebKit
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
return this.each(function() {
jQuery(this).domManip( args, table, callback, true );
});
}
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
args[0] = value.call(this, i, table ? self.html() : undefined);
self.domManip( args, table, callback );
});
}
if ( this[0] ) {
parent = value && value.parentNode;
// If we're in a fragment, just use that instead of building a new one
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
results = { fragment: parent };
} else {
results = jQuery.buildFragment( args, this, scripts );
}
fragment = results.fragment;
if ( fragment.childNodes.length === 1 ) {
first = fragment = fragment.firstChild;
} else {
first = fragment.firstChild;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
for ( var i = 0, l = this.length; i < l; i++ ) {
callback.call(
table ?
root(this[i], first) :
this[i],
i > 0 || results.cacheable || this.length > 1 ?
fragment.cloneNode(true) :
fragment
);
}
}
if ( scripts.length ) {
jQuery.each( scripts, evalScript );
}
}
return this;
}
});
function root( elem, cur ) {
return jQuery.nodeName(elem, "table") ?
(elem.getElementsByTagName("tbody")[0] ||
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
elem;
}
function cloneCopyEvent(orig, ret) {
var i = 0;
ret.each(function() {
if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
return;
}
var oldData = jQuery.data( orig[i++] ),
curData = jQuery.data( this, oldData ),
events = oldData && oldData.events;
if ( events ) {
delete curData.handle;
curData.events = {};
for ( var type in events ) {
for ( var handler in events[ type ] ) {
jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
}
}
}
});
}
jQuery.buildFragment = function( args, nodes, scripts ) {
var fragment, cacheable, cacheresults,
doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
// Only cache "small" (1/2 KB) strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
cacheable = true;
cacheresults = jQuery.fragments[ args[0] ];
if ( cacheresults ) {
if ( cacheresults !== 1 ) {
fragment = cacheresults;
}
}
}
if ( !fragment ) {
fragment = doc.createDocumentFragment();
jQuery.clean( args, doc, fragment, scripts );
}
if ( cacheable ) {
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
}
return { fragment: fragment, cacheable: cacheable };
};
jQuery.fragments = {};
// jQuery.each({
// appendTo: "append",
// prependTo: "prepend",
// insertBefore: "before",
// insertAfter: "after",
// replaceAll: "replaceWith"
// }, function( name, original ) {
// jQuery.fn[ name ] = function( selector ) {
// var ret = [],
// insert = jQuery( selector ),
// parent = this.length === 1 && this[0].parentNode;
// if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
// insert[ original ]( this[0] );
// return this;
// } else {
// for ( var i = 0, l = insert.length; i < l; i++ ) {
// var elems = (i > 0 ? this.clone(true) : this).get();
// jQuery( insert[i] )[ original ]( elems );
// ret = ret.concat( elems );
// }
//
// return this.pushStack( ret, name, insert.selector );
// }
// };
// });
jQuery.fn[ "appendTo" ] = function( selector ) {
/// <summary>
/// Append all of the matched elements to another, specified, set of elements.
/// As of jQuery 1.3.2, returns all of the inserted elements.
/// This operation is, essentially, the reverse of doing a regular
/// $(A).append(B), in that instead of appending B to A, you're appending
/// A to B.
/// </summary>
/// <param name="selector" type="Selector">
/// target to which the content will be appended.
/// </param>
/// <returns type="jQuery" />
var ret = [], insert = jQuery( selector );
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery.fn[ "append" ].apply( jQuery(insert[i]), elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, "appendTo", insert.selector );
};
jQuery.fn[ "prependTo" ] = function( selector ) {
/// <summary>
/// Prepend all of the matched elements to another, specified, set of elements.
/// As of jQuery 1.3.2, returns all of the inserted elements.
/// This operation is, essentially, the reverse of doing a regular
/// $(A).prepend(B), in that instead of prepending B to A, you're prepending
/// A to B.
/// </summary>
/// <param name="selector" type="Selector">
/// target to which the content will be appended.
/// </param>
/// <returns type="jQuery" />
var ret = [], insert = jQuery( selector );
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery.fn[ "prepend" ].apply( jQuery(insert[i]), elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, "prependTo", insert.selector );
};
jQuery.fn[ "insertBefore" ] = function( selector ) {
/// <summary>
/// Insert all of the matched elements before another, specified, set of elements.
/// As of jQuery 1.3.2, returns all of the inserted elements.
/// This operation is, essentially, the reverse of doing a regular
/// $(A).before(B), in that instead of inserting B before A, you're inserting
/// A before B.
/// </summary>
/// <param name="content" type="String">
/// Content after which the selected element(s) is inserted.
/// </param>
/// <returns type="jQuery" />
var ret = [], insert = jQuery( selector );
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery.fn[ "before" ].apply( jQuery(insert[i]), elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, "insertBefore", insert.selector );
};
jQuery.fn[ "insertAfter" ] = function( selector ) {
/// <summary>
/// Insert all of the matched elements after another, specified, set of elements.
/// As of jQuery 1.3.2, returns all of the inserted elements.
/// This operation is, essentially, the reverse of doing a regular
/// $(A).after(B), in that instead of inserting B after A, you're inserting
/// A after B.
/// </summary>
/// <param name="content" type="String">
/// Content after which the selected element(s) is inserted.
/// </param>
/// <returns type="jQuery" />
var ret = [], insert = jQuery( selector );
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery.fn[ "after" ].apply( jQuery(insert[i]), elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, "insertAfter", insert.selector );
};
jQuery.fn[ "replaceAll" ] = function( selector ) {
/// <summary>
/// Replaces the elements matched by the specified selector with the matched elements.
/// As of jQuery 1.3.2, returns all of the inserted elements.
/// </summary>
/// <param name="selector" type="Selector">The elements to find and replace the matched elements with.</param>
/// <returns type="jQuery" />
var ret = [], insert = jQuery( selector );
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery.fn[ "replaceWith" ].apply( jQuery(insert[i]), elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, "replaceAll", insert.selector );
};
jQuery.each({
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
if ( !keepData && this.nodeType === 1 ) {
jQuery.cleanData( this.getElementsByTagName("*") );
jQuery.cleanData( [ this ] );
}
if ( this.parentNode ) {
this.parentNode.removeChild( this );
}
}
},
empty: function() {
/// <summary>
/// Removes all child nodes from the set of matched elements.
/// Part of DOM/Manipulation
/// </summary>
/// <returns type="jQuery" />
// Remove element nodes and prevent memory leaks
if ( this.nodeType === 1 ) {
jQuery.cleanData( this.getElementsByTagName("*") );
}
// Remove any remaining nodes
while ( this.firstChild ) {
this.removeChild( this.firstChild );
}
}
}, function( name, fn ) {
jQuery.fn[ name ] = function() {
return this.each( fn, arguments );
};
});
jQuery.extend({
clean: function( elems, context, fragment, scripts ) {
/// <summary>
/// This method is internal only.
/// </summary>
/// <private />
context = context || document;
// !context.createElement fails in IE with an error but returns typeof 'object'
if ( typeof context.createElement === "undefined" ) {
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
var ret = [];
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
}
if ( !elem ) {
continue;
}
// Convert html string into DOM nodes
if ( typeof elem === "string" && !rhtml.test( elem ) ) {
elem = context.createTextNode( elem );
} else if ( typeof elem === "string" ) {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(rxhtmlTag, "<$1></$2>");
// Trim whitespace, otherwise indexOf won't work as expected
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
wrap = wrapMap[ tag ] || wrapMap._default,
depth = wrap[0],
div = context.createElement("div");
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + elem + wrap[2];
// Move to the right depth
while ( depth-- ) {
div = div.lastChild;
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
var hasBody = rtbody.test(elem),
tbody = tag === "table" && !hasBody ?
div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !hasBody ?
div.childNodes :
[];
for ( var j = tbody.length - 1; j >= 0 ; --j ) {
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
}
}
// IE completely kills leading whitespace when innerHTML is used
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
}
elem = div.childNodes;
}
if ( elem.nodeType ) {
ret.push( elem );
} else {
ret = jQuery.merge( ret, elem );
}
}
if ( fragment ) {
for ( i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
} else {
if ( ret[i].nodeType === 1 ) {
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
}
fragment.appendChild( ret[i] );
}
}
}
return ret;
},
cleanData: function( elems ) {
var data, id, cache = jQuery.cache,
special = jQuery.event.special,
deleteExpando = jQuery.support.deleteExpando;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
continue;
}
id = elem[ jQuery.expando ];
if ( id ) {
data = cache[ id ];
if ( data && data.events ) {
for ( var type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
}
if ( deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
}
delete cache[ id ];
}
}
}
});
function evalScript( i, elem ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
if ( elem.src ) {
jQuery.ajax({
url: elem.src,
async: false,
dataType: "script"
});
} else {
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
var ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity=([^)]*)/,
rdashAlpha = /-([a-z])/ig,
rupper = /([A-Z])/g,
rnumpx = /^-?\d+(?:px)?$/i,
rnum = /^-?\d/,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssWidth = [ "Left", "Right" ],
cssHeight = [ "Top", "Bottom" ],
curCSS,
getComputedStyle,
currentStyle,
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
};
jQuery.fn.css = function( name, value ) {
/// <summary>
/// Set a single style property to a value, on all matched elements.
/// If a number is provided, it is automatically converted into a pixel value.
/// Part of CSS
/// </summary>
/// <returns type="jQuery" />
/// <param name="name" type="String">
/// A CSS property name.
/// </param>
/// <param name="value" type="String">
/// A value to set for the property.
/// </param>
// Setting 'undefined' is a no-op
if ( arguments.length === 2 && value === undefined ) {
return this;
}
return jQuery.access( this, name, value, true, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
});
};
jQuery.extend({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity", "opacity" );
return ret === "" ? "1" : ret;
} else {
return elem.style.opacity;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"zIndex": true,
"fontWeight": true,
"opacity": true,
"zoom": true,
"lineHeight": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
// normalize float css property
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, origName = jQuery.camelCase( name ),
style = elem.style, hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
// Check if we're setting a value
if ( value !== undefined ) {
// Make sure that NaN and null values aren't set. See: #7116
if ( typeof value === "number" && isNaN( value ) || value == null ) {
return;
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
value += "px";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
style[ name ] = value;
} catch(e) {}
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra ) {
/// <summary>
/// This method is internal only.
/// </summary>
/// <private />
// Make sure that we're working with the right name
var ret, origName = jQuery.camelCase( name ),
hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
return ret;
// Otherwise, if a way to get the computed value exists, use that
} else if ( curCSS ) {
return curCSS( elem, name, origName );
}
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback ) {
/// <summary>
/// Swap in/out style options.
/// </summary>
var old = {};
// Remember the old values, and insert the new ones
for ( var name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
callback.call( elem );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
},
camelCase: function( string ) {
return string.replace( rdashAlpha, fcamelCase );
}
});
// DEPRECATED, Use jQuery.css() instead
jQuery.curCSS = jQuery.css;
jQuery.each(["height", "width"], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
var val;
if ( computed ) {
if ( elem.offsetWidth !== 0 ) {
val = getWH( elem, name, extra );
} else {
jQuery.swap( elem, cssShow, function() {
val = getWH( elem, name, extra );
});
}
if ( val <= 0 ) {
val = curCSS( elem, name, name );
if ( val === "0px" && currentStyle ) {
val = currentStyle( elem, name, name );
}
if ( val != null ) {
// Should return "auto" instead of 0, use 0 for
// temporary backwards-compat
return val === "" || val === "auto" ? "0px" : val;
}
}
if ( val < 0 || val == null ) {
val = elem.style[ name ];
// Should return "auto" instead of 0, use 0 for
// temporary backwards-compat
return val === "" || val === "auto" ? "0px" : val;
}
return typeof val === "string" ? val : val + "px";
}
},
set: function( elem, value ) {
if ( rnumpx.test( value ) ) {
// ignore negative width and height values #1599
value = parseFloat(value);
if ( value >= 0 ) {
return value + "px";
}
} else {
return value;
}
}
};
});
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
(parseFloat(RegExp.$1) / 100) + "" :
computed ? "1" : "";
},
set: function( elem, value ) {
var style = elem.style;
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// Set the alpha filter to set the opacity
var opacity = jQuery.isNaN(value) ?
"" :
"alpha(opacity=" + value * 100 + ")",
filter = style.filter || "";
style.filter = ralpha.test(filter) ?
filter.replace(ralpha, opacity) :
style.filter + ' ' + opacity;
}
};
}
if ( document.defaultView && document.defaultView.getComputedStyle ) {
getComputedStyle = function( elem, newName, name ) {
var ret, defaultView, computedStyle;
name = name.replace( rupper, "-$1" ).toLowerCase();
if ( !(defaultView = elem.ownerDocument.defaultView) ) {
return undefined;
}
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
ret = computedStyle.getPropertyValue( name );
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
ret = jQuery.style( elem, name );
}
}
return ret;
};
}
if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
var left, rsLeft,
ret = elem.currentStyle && elem.currentStyle[ name ],
style = elem.style;
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
// Remember the original values
left = style.left;
rsLeft = elem.runtimeStyle.left;
// Put in the new values to get a computed value out
elem.runtimeStyle.left = elem.currentStyle.left;
style.left = name === "fontSize" ? "1em" : (ret || 0);
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
elem.runtimeStyle.left = rsLeft;
}
return ret === "" ? "auto" : ret;
};
}
curCSS = getComputedStyle || currentStyle;
function getWH( elem, name, extra ) {
var which = name === "width" ? cssWidth : cssHeight,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
if ( extra === "border" ) {
return val;
}
jQuery.each( which, function() {
if ( !extra ) {
val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
}
if ( extra === "margin" ) {
val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
} else {
val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
}
});
return val;
}
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
var width = elem.offsetWidth,
height = elem.offsetHeight;
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
var jsc = jQuery.now(),
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
rselectTextarea = /^(?:select|textarea)/i,
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
rnoContent = /^(?:GET|HEAD)$/,
rbracket = /\[\]$/,
jsre = /\=\?(&|$)/,
rquery = /\?/,
rts = /([?&])_=[^&]*/,
rurl = /^(\w+:)?\/\/([^\/?#]+)/,
r20 = /%20/g,
rhash = /#.*$/,
// Keep a copy of the old load method
_load = jQuery.fn.load;
jQuery.fn.extend({
load: function( url, params, callback ) {
/// <summary>
/// Loads HTML from a remote file and injects it into the DOM. By default performs a GET request, but if parameters are included
/// then a POST will be performed.
/// </summary>
/// <param name="url" type="String">The URL of the HTML page to load.</param>
/// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param>
/// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus, XMLHttpRequest) such that this maps the injected DOM element.</param>
/// <returns type="jQuery" />
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
// Don't do a request if no elements are being requested
} else if ( !this.length ) {
return this;
}
var off = url.indexOf(" ");
if ( off >= 0 ) {
var selector = url.slice(off, url.length);
url = url.slice(0, off);
}
// Default to a GET request
var type = "GET";
// If the second parameter was provided
if ( params ) {
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = null;
// Otherwise, build a param string
} else if ( typeof params === "object" ) {
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
type = "POST";
}
}
var self = this;
// Request the remote document
jQuery.ajax({
url: url,
type: type,
dataType: "html",
data: params,
complete: function( res, status ) {
// If successful, inject the HTML into all the matched elements
if ( status === "success" || status === "notmodified" ) {
// See if a selector was specified
self.html( selector ?
// Create a dummy div to hold the results
jQuery("<div>")
// inject the contents of the document in, removing the scripts
// to avoid any 'Permission Denied' errors in IE
.append(res.responseText.replace(rscript, ""))
// Locate the specified elements
.find(selector) :
// If not, just inject the full result
res.responseText );
}
if ( callback ) {
self.each( callback, [res.responseText, status, res] );
}
}
});
return this;
},
serialize: function() {
/// <summary>
/// Serializes a set of input elements into a string of data.
/// </summary>
/// <returns type="String">The serialized result</returns>
return jQuery.param(this.serializeArray());
},
serializeArray: function() {
/// <summary>
/// Serializes all forms and form elements but returns a JSON data structure.
/// </summary>
/// <returns type="String">A JSON data structure representing the serialized items.</returns>
return this.map(function() {
return this.elements ? jQuery.makeArray(this.elements) : this;
})
.filter(function() {
return this.name && !this.disabled &&
(this.checked || rselectTextarea.test(this.nodeName) ||
rinput.test(this.type));
})
.map(function( i, elem ) {
var val = jQuery(this).val();
return val == null ?
null :
jQuery.isArray(val) ?
jQuery.map( val, function( val, i ) {
return { name: elem.name, value: val };
}) :
{ name: elem.name, value: val };
}).get();
}
});
// Attach a bunch of functions for handling common AJAX events
// jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
// jQuery.fn[o] = function( f ) {
// return this.bind(o, f);
// };
// });
jQuery.fn["ajaxStart"] = function( f ) {
/// <summary>
/// Attach a function to be executed whenever an AJAX request begins and there is none already active. This is an Ajax Event.
/// </summary>
/// <param name="f" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return this.bind("ajaxStart", f);
};
jQuery.fn["ajaxStop"] = function( f ) {
/// <summary>
/// Attach a function to be executed whenever all AJAX requests have ended. This is an Ajax Event.
/// </summary>
/// <param name="f" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return this.bind("ajaxStop", f);
};
jQuery.fn["ajaxComplete"] = function( f ) {
/// <summary>
/// Attach a function to be executed whenever an AJAX request completes. This is an Ajax Event.
/// </summary>
/// <param name="f" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return this.bind("ajaxComplete", f);
};
jQuery.fn["ajaxError"] = function( f ) {
/// <summary>
/// Attach a function to be executed whenever an AJAX request fails. This is an Ajax Event.
/// </summary>
/// <param name="f" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return this.bind("ajaxError", f);
};
jQuery.fn["ajaxSuccess"] = function( f ) {
/// <summary>
/// Attach a function to be executed whenever an AJAX request completes successfully. This is an Ajax Event.
/// </summary>
/// <param name="f" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return this.bind("ajaxSuccess", f);
};
jQuery.fn["ajaxSend"] = function( f ) {
/// <summary>
/// Attach a function to be executed before an AJAX request is sent. This is an Ajax Event.
/// </summary>
/// <param name="f" type="Function">The function to execute.</param>
/// <returns type="jQuery" />
return this.bind("ajaxSend", f);
};
jQuery.extend({
get: function( url, data, callback, type ) {
/// <summary>
/// Loads a remote page using an HTTP GET request.
/// </summary>
/// <param name="url" type="String">The URL of the HTML page to load.</param>
/// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param>
/// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus) such that this maps the options for this AJAX request.</param>
/// <param name="type" optional="true" type="String">Type of data to be returned to callback function. Valid valiues are xml, html, script, json, text, _default.</param>
/// <returns type="XMLHttpRequest" />
// shift arguments if data argument was omited
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = null;
}
return jQuery.ajax({
type: "GET",
url: url,
data: data,
success: callback,
dataType: type
});
},
getScript: function( url, callback ) {
/// <summary>
/// Loads and executes a local JavaScript file using an HTTP GET request.
/// </summary>
/// <param name="url" type="String">The URL of the script to load.</param>
/// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(data, textStatus) such that this maps the options for the AJAX request.</param>
/// <returns type="XMLHttpRequest" />
return jQuery.get(url, null, callback, "script");
},
getJSON: function( url, data, callback ) {
/// <summary>
/// Loads JSON data using an HTTP GET request.
/// </summary>
/// <param name="url" type="String">The URL of the JSON data to load.</param>
/// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param>
/// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete if the data is loaded successfully. It should map function(data, textStatus) such that this maps the options for this AJAX request.</param>
/// <returns type="XMLHttpRequest" />
return jQuery.get(url, data, callback, "json");
},
post: function( url, data, callback, type ) {
/// <summary>
/// Loads a remote page using an HTTP POST request.
/// </summary>
/// <param name="url" type="String">The URL of the HTML page to load.</param>
/// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param>
/// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus) such that this maps the options for this AJAX request.</param>
/// <param name="type" optional="true" type="String">Type of data to be returned to callback function. Valid valiues are xml, html, script, json, text, _default.</param>
/// <returns type="XMLHttpRequest" />
// shift arguments if data argument was omited
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = {};
}
return jQuery.ajax({
type: "POST",
url: url,
data: data,
success: callback,
dataType: type
});
},
ajaxSetup: function( settings ) {
/// <summary>
/// Sets up global settings for AJAX requests.
/// </summary>
/// <param name="settings" type="Options">A set of key/value pairs that configure the default Ajax request.</param>
jQuery.extend( jQuery.ajaxSettings, settings );
},
ajaxSettings: {
url: location.href,
global: true,
type: "GET",
contentType: "application/x-www-form-urlencoded",
processData: true,
async: true,
/*
timeout: 0,
data: null,
username: null,
password: null,
traditional: false,
*/
// This function can be overriden by calling jQuery.ajaxSetup
xhr: function() {
return new window.XMLHttpRequest();
},
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
script: "text/javascript, application/javascript",
json: "application/json, text/javascript",
text: "text/plain",
_default: "*/*"
}
},
ajax: function( origSettings ) {
/// <summary>
/// Load a remote page using an HTTP request.
/// </summary>
/// <private />
var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
s.url = s.url.replace( rhash, "" );
// Use original (not extended) context object if it was provided
s.context = origSettings && origSettings.context != null ? origSettings.context : s;
// convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Handle JSONP Parameter Callbacks
if ( s.dataType === "jsonp" ) {
if ( type === "GET" ) {
if ( !jsre.test( s.url ) ) {
s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
}
} else if ( !s.data || !jsre.test(s.data) ) {
s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
}
s.dataType = "json";
}
// Build temporary JSONP function
if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
jsonp = s.jsonpCallback || ("jsonp" + jsc++);
// Replace the =? sequence both in the query string and the data
if ( s.data ) {
s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
}
s.url = s.url.replace(jsre, "=" + jsonp + "$1");
// We need to make sure
// that a JSONP style response is executed properly
s.dataType = "script";
// Handle JSONP-style loading
var customJsonp = window[ jsonp ];
window[ jsonp ] = function( tmp ) {
if ( jQuery.isFunction( customJsonp ) ) {
customJsonp( tmp );
} else {
// Garbage collect
window[ jsonp ] = undefined;
try {
delete window[ jsonp ];
} catch( jsonpError ) {}
}
data = tmp;
jQuery.handleSuccess( s, xhr, status, data );
jQuery.handleComplete( s, xhr, status, data );
if ( head ) {
head.removeChild( script );
}
};
}
if ( s.dataType === "script" && s.cache === null ) {
s.cache = false;
}
if ( s.cache === false && noContent ) {
var ts = jQuery.now();
// try replacing _= if it is there
var ret = s.url.replace(rts, "$1_=" + ts);
// if nothing was replaced, add timestamp to the end
s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
}
// If data is available, append data to url for GET/HEAD requests
if ( s.data && noContent ) {
s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
}
// Watch for a new set of requests
if ( s.global && jQuery.active++ === 0 ) {
jQuery.event.trigger( "ajaxStart" );
}
// Matches an absolute URL, and saves the domain
var parts = rurl.exec( s.url ),
remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
// If we're requesting a remote document
// and trying to load JSON or Script with a GET
if ( s.dataType === "script" && type === "GET" && remote ) {
var head = document.getElementsByTagName("head")[0] || document.documentElement;
var script = document.createElement("script");
if ( s.scriptCharset ) {
script.charset = s.scriptCharset;
}
script.src = s.url;
// Handle Script loading
if ( !jsonp ) {
var done = false;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function() {
if ( !done && (!this.readyState ||
this.readyState === "loaded" || this.readyState === "complete") ) {
done = true;
jQuery.handleSuccess( s, xhr, status, data );
jQuery.handleComplete( s, xhr, status, data );
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
if ( head && script.parentNode ) {
head.removeChild( script );
}
}
};
}
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709 and #4378).
head.insertBefore( script, head.firstChild );
// We handle everything using the script element injection
return undefined;
}
var requestDone = false;
// Create the request object
var xhr = s.xhr();
if ( !xhr ) {
return;
}
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open(type, s.url, s.async, s.username, s.password);
} else {
xhr.open(type, s.url, s.async);
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
// Set content-type if data specified and content-body is valid for this type
if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) {
xhr.setRequestHeader("Content-Type", s.contentType);
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( jQuery.lastModified[s.url] ) {
xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
}
if ( jQuery.etag[s.url] ) {
xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
}
}
// Set header so the called script knows that it's an XMLHttpRequest
// Only send the header if it's not a remote XHR
if ( !remote ) {
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
}
// Set the Accepts header for the server, depending on the dataType
xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
s.accepts[ s.dataType ] + ", */*; q=0.01" :
s.accepts._default );
} catch( headerError ) {}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) {
// Handle the global AJAX counter
if ( s.global && jQuery.active-- === 1 ) {
jQuery.event.trigger( "ajaxStop" );
}
// close opended socket
xhr.abort();
return false;
}
if ( s.global ) {
jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] );
}
// Wait for a response to come back
var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
// The request was aborted
if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
// Opera doesn't call onreadystatechange before this point
// so we simulate the call
if ( !requestDone ) {
jQuery.handleComplete( s, xhr, status, data );
}
requestDone = true;
if ( xhr ) {
xhr.onreadystatechange = jQuery.noop;
}
// The transfer is complete and the data is available, or the request timed out
} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
requestDone = true;
xhr.onreadystatechange = jQuery.noop;
status = isTimeout === "timeout" ?
"timeout" :
!jQuery.httpSuccess( xhr ) ?
"error" :
s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
"notmodified" :
"success";
var errMsg;
if ( status === "success" ) {
// Watch for, and catch, XML document parse errors
try {
// process the data (runs the xml through httpData regardless of callback)
data = jQuery.httpData( xhr, s.dataType, s );
} catch( parserError ) {
status = "parsererror";
errMsg = parserError;
}
}
// Make sure that the request was successful or notmodified
if ( status === "success" || status === "notmodified" ) {
// JSONP handles its own success callback
if ( !jsonp ) {
jQuery.handleSuccess( s, xhr, status, data );
}
} else {
jQuery.handleError( s, xhr, status, errMsg );
}
// Fire the complete handlers
if ( !jsonp ) {
jQuery.handleComplete( s, xhr, status, data );
}
if ( isTimeout === "timeout" ) {
xhr.abort();
}
// Stop memory leaks
if ( s.async ) {
xhr = null;
}
}
};
// Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
// Opera doesn't fire onreadystatechange at all on abort
try {
var oldAbort = xhr.abort;
xhr.abort = function() {
if ( xhr ) {
// oldAbort has no call property in IE7 so
// just do it this way, which works in all
// browsers
Function.prototype.call.call( oldAbort, xhr );
}
onreadystatechange( "abort" );
};
} catch( abortError ) {}
// Timeout checker
if ( s.async && s.timeout > 0 ) {
setTimeout(function() {
// Check to see if the request is still happening
if ( xhr && !requestDone ) {
onreadystatechange( "timeout" );
}
}, s.timeout);
}
// Send the data
try {
xhr.send( noContent || s.data == null ? null : s.data );
} catch( sendError ) {
jQuery.handleError( s, xhr, null, sendError );
// Fire the complete handlers
jQuery.handleComplete( s, xhr, status, data );
}
// firefox 1.5 doesn't fire statechange for sync requests
if ( !s.async ) {
onreadystatechange();
}
// return XMLHttpRequest to allow aborting the request etc.
return xhr;
},
// Serialize an array of form elements or a set of
// key/values into a query string
param: function( a, traditional ) {
/// <summary>
/// Create a serialized representation of an array or object, suitable for use in a URL
/// query string or Ajax request.
/// </summary>
/// <param name="a" type="Object">
/// An array or object to serialize.
/// </param>
/// <param name="traditional" type="Boolean">
/// A Boolean indicating whether to perform a traditional "shallow" serialization.
/// </param>
/// <returns type="String" />
var s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction(value) ? value() : value;
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray(a) || a.jquery ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( var prefix in a ) {
buildParams( prefix, a[prefix], traditional, add );
}
}
// Return the resulting serialization
return s.join("&").replace(r20, "+");
}
});
function buildParams( prefix, obj, traditional, add ) {
if ( jQuery.isArray(obj) && obj.length ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// If array item is non-scalar (array or object), encode its
// numeric index to resolve deserialization ambiguity issues.
// Note that rack (as of 1.0.0) can't currently deserialize
// nested arrays properly, and attempting to do so may cause
// a server error. Possible fixes are to modify rack's
// deserialization algorithm or to provide an option or flag
// to force array serialization to be shallow.
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
}
});
} else if ( !traditional && obj != null && typeof obj === "object" ) {
if ( jQuery.isEmptyObject( obj ) ) {
add( prefix, "" );
// Serialize object item.
} else {
jQuery.each( obj, function( k, v ) {
buildParams( prefix + "[" + k + "]", v, traditional, add );
});
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
// This is still on the jQuery object... for now
// Want to move this to jQuery.ajax some day
jQuery.extend({
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {},
handleError: function( s, xhr, status, e ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context, xhr, status, e );
}
// Fire the global callback
if ( s.global ) {
jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] );
}
},
handleSuccess: function( s, xhr, status, data ) {
// If a local callback was specified, fire it and pass it the data
if ( s.success ) {
s.success.call( s.context, data, status, xhr );
}
// Fire the global callback
if ( s.global ) {
jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] );
}
},
handleComplete: function( s, xhr, status ) {
// Process result
if ( s.complete ) {
s.complete.call( s.context, xhr, status );
}
// The request was completed
if ( s.global ) {
jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] );
}
// Handle the global AJAX counter
if ( s.global && jQuery.active-- === 1 ) {
jQuery.event.trigger( "ajaxStop" );
}
},
triggerGlobal: function( s, type, args ) {
(s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args);
},
// Determines if an XMLHttpRequest was successful or not
httpSuccess: function( xhr ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
try {
// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
return !xhr.status && location.protocol === "file:" ||
xhr.status >= 200 && xhr.status < 300 ||
xhr.status === 304 || xhr.status === 1223;
} catch(e) {}
return false;
},
// Determines if an XMLHttpRequest returns NotModified
httpNotModified: function( xhr, url ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
var lastModified = xhr.getResponseHeader("Last-Modified"),
etag = xhr.getResponseHeader("Etag");
if ( lastModified ) {
jQuery.lastModified[url] = lastModified;
}
if ( etag ) {
jQuery.etag[url] = etag;
}
return xhr.status === 304;
},
httpData: function( xhr, type, s ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
var ct = xhr.getResponseHeader("content-type") || "",
xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.nodeName === "parsererror" ) {
jQuery.error( "parsererror" );
}
// Allow a pre-filtering function to sanitize the response
// s is checked to keep backwards compatibility
if ( s && s.dataFilter ) {
data = s.dataFilter( data, type );
}
// The filter can actually parse the response
if ( typeof data === "string" ) {
// Get the JavaScript object, if JSON is used.
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
data = jQuery.parseJSON( data );
// If the type is "script", eval it in global context
} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
jQuery.globalEval( data );
}
}
return data;
}
});
/*
* Create the request object; Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
if ( window.ActiveXObject ) {
jQuery.ajaxSettings.xhr = function() {
if ( window.location.protocol !== "file:" ) {
try {
return new window.XMLHttpRequest();
} catch(xhrError) {}
}
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch(activeError) {}
};
}
// Does this browser support XHR requests?
jQuery.support.ajax = !!jQuery.ajaxSettings.xhr();
var elemdisplay = {},
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
timerId,
fxAttrs = [
// height animations
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
// width animations
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
];
jQuery.fn.extend({
show: function( speed, easing, callback ) {
/// <summary>
/// Show all matched elements using a graceful animation and firing an optional callback after completion.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
var elem, display;
if ( speed || speed === 0 ) {
return this.animate( genFx("show", 3), speed, easing, callback);
} else {
for ( var i = 0, j = this.length; i < j; i++ ) {
elem = this[i];
display = elem.style.display;
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
display = elem.style.display = "";
}
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
elem = this[i];
display = elem.style.display;
if ( display === "" || display === "none" ) {
elem.style.display = jQuery.data(elem, "olddisplay") || "";
}
}
return this;
}
},
hide: function( speed, callback ) {
/// <summary>
/// Hides all matched elements using a graceful animation and firing an optional callback after completion.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
if ( speed || speed === 0 ) {
return this.animate( genFx("hide", 3), speed, easing, callback);
} else {
for ( var i = 0, j = this.length; i < j; i++ ) {
var display = jQuery.css( this[i], "display" );
if ( display !== "none" ) {
jQuery.data( this[i], "olddisplay", display );
}
}
// Set the display of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
this[i].style.display = "none";
}
return this;
}
},
// Save the old toggle function
_toggle: jQuery.fn.toggle,
toggle: function( fn, fn2, callback ) {
/// <summary>
/// Toggles displaying each of the set of matched elements.
/// </summary>
/// <returns type="jQuery" />
var bool = typeof fn === "boolean";
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
this._toggle.apply( this, arguments );
} else if ( fn == null || bool ) {
this.each(function() {
var state = bool ? fn : jQuery(this).is(":hidden");
jQuery(this)[ state ? "show" : "hide" ]();
});
} else {
this.animate(genFx("toggle", 3), fn, fn2, callback);
}
return this;
},
fadeTo: function( speed, to, easing, callback ) {
/// <summary>
/// Fades the opacity of all matched elements to a specified opacity.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
return this.filter(":hidden").css("opacity", 0).show().end()
.animate({opacity: to}, speed, easing, callback);
},
animate: function( prop, speed, easing, callback ) {
/// <summary>
/// A function for making custom animations.
/// </summary>
/// <param name="prop" type="Options">A set of style attributes that you wish to animate and to what end.</param>
/// <param name="speed" optional="true" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="easing" optional="true" type="String">The name of the easing effect that you want to use. There are two built-in values, 'linear' and 'swing'.</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
var optall = jQuery.speed(speed, easing, callback);
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete );
}
return this[ optall.queue === false ? "each" : "queue" ](function() {
// XXX 'this' does not always have a nodeName when running the
// test suite
var opt = jQuery.extend({}, optall), p,
isElement = this.nodeType === 1,
hidden = isElement && jQuery(this).is(":hidden"),
self = this;
for ( p in prop ) {
var name = jQuery.camelCase( p );
if ( p !== name ) {
prop[ name ] = prop[ p ];
delete prop[ p ];
p = name;
}
if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
return opt.complete.call(this);
}
if ( isElement && ( p === "height" || p === "width" ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE does not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height
// animated
if ( jQuery.css( this, "display" ) === "inline" &&
jQuery.css( this, "float" ) === "none" ) {
if ( !jQuery.support.inlineBlockNeedsLayout ) {
this.style.display = "inline-block";
} else {
var display = defaultDisplay(this.nodeName);
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( display === "inline" ) {
this.style.display = "inline-block";
} else {
this.style.display = "inline";
this.style.zoom = 1;
}
}
}
}
if ( jQuery.isArray( prop[p] ) ) {
// Create (if needed) and add to specialEasing
(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
prop[p] = prop[p][0];
}
}
if ( opt.overflow != null ) {
this.style.overflow = "hidden";
}
opt.curAnim = jQuery.extend({}, prop);
jQuery.each( prop, function( name, val ) {
var e = new jQuery.fx( self, opt, name );
if ( rfxtypes.test(val) ) {
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
} else {
var parts = rfxnum.exec(val),
start = e.cur() || 0;
if ( parts ) {
var end = parseFloat( parts[2] ),
unit = parts[3] || "px";
// We need to compute starting value
if ( unit !== "px" ) {
jQuery.style( self, name, (end || 1) + unit);
start = ((end || 1) / e.cur()) * start;
jQuery.style( self, name, start + unit);
}
// If a +=/-= token was provided, we're doing a relative animation
if ( parts[1] ) {
end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
}
e.custom( start, end, unit );
} else {
e.custom( start, val, "" );
}
}
});
// For JS strict compliance
return true;
});
},
stop: function( clearQueue, gotoEnd ) {
/// <summary>
/// Stops all currently animations on the specified elements.
/// </summary>
/// <param name="clearQueue" optional="true" type="Boolean">True to clear animations that are queued to run.</param>
/// <param name="gotoEnd" optional="true" type="Boolean">True to move the element value to the end of its animation target.</param>
/// <returns type="jQuery" />
var timers = jQuery.timers;
if ( clearQueue ) {
this.queue([]);
}
this.each(function() {
// go in reverse order so anything added to the queue during the loop is ignored
for ( var i = timers.length - 1; i >= 0; i-- ) {
if ( timers[i].elem === this ) {
if (gotoEnd) {
// force the next step to be the last
timers[i](true);
}
timers.splice(i, 1);
}
}
});
// start the next in the queue if the last step wasn't forced
if ( !gotoEnd ) {
this.dequeue();
}
return this;
}
});
function genFx( type, num ) {
var obj = {};
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
obj[ this ] = type;
});
return obj;
}
// Generate shortcuts for custom animations
// jQuery.each({
// slideDown: genFx("show", 1),
// slideUp: genFx("hide", 1),
// slideToggle: genFx("toggle", 1),
// fadeIn: { opacity: "show" },
// fadeOut: { opacity: "hide" },
// fadeToggle: { opacity: "toggle" }
// }, function( name, props ) {
// jQuery.fn[ name ] = function( speed, easing, callback ) {
// return this.animate( props, speed, easing, callback );
// };
// });
jQuery.fn[ "slideDown" ] = function( speed, callback ) {
/// <summary>
/// Reveal all matched elements by adjusting their height.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
return this.animate( genFx("show", 1), speed, callback );
};
jQuery.fn[ "slideUp" ] = function( speed, callback ) {
/// <summary>
/// Hiding all matched elements by adjusting their height.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
return this.animate( genFx("hide", 1), speed, callback );
};
jQuery.fn[ "slideToggle" ] = function( speed, callback ) {
/// <summary>
/// Toggles the visibility of all matched elements by adjusting their height.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
return this.animate( genFx("toggle", 1), speed, callback );
};
jQuery.fn[ "fadeIn" ] = function( speed, callback ) {
/// <summary>
/// Fades in all matched elements by adjusting their opacity.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
return this.animate( { opacity: "show" }, speed, callback );
};
jQuery.fn[ "fadeOut" ] = function( speed, callback ) {
/// <summary>
/// Fades the opacity of all matched elements to a specified opacity.
/// </summary>
/// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or
/// the number of milliseconds to run the animation</param>
/// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param>
/// <returns type="jQuery" />
return this.animate( { opacity: "hide" }, speed, callback );
};
jQuery.extend({
speed: function( speed, easing, fn ) {
/// <summary>
/// This member is internal.
/// </summary>
/// <private />
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
// Queueing
opt.old = opt.complete;
opt.complete = function() {
if ( opt.queue !== false ) {
jQuery(this).dequeue();
}
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
};
return opt;
},
easing: {
linear: function( p, n, firstNum, diff ) {
/// <summary>
/// This member is internal.
/// </summary>
/// <private />
return firstNum + diff * p;
},
swing: function( p, n, firstNum, diff ) {
/// <summary>
/// This member is internal.
/// </summary>
/// <private />
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
}
},
timers: [],
fx: function( elem, options, prop ) {
/// <summary>
/// This member is internal.
/// </summary>
/// <private />
this.options = options;
this.elem = elem;
this.prop = prop;
if ( !options.orig ) {
options.orig = {};
}
}
});
jQuery.fx.prototype = {
// Simple function for setting a style value
update: function() {
/// <summary>
/// This member is internal.
/// </summary>
/// <private />
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
},
// Get the current size
cur: function() {
/// <summary>
/// This member is internal.
/// </summary>
/// <private />
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
return this.elem[ this.prop ];
}
var r = parseFloat( jQuery.css( this.elem, this.prop ) );
return r && r > -10000 ? r : 0;
},
// Start an animation from one number to another
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx;
this.startTime = jQuery.now();
this.start = from;
this.end = to;
this.unit = unit || this.unit || "px";
this.now = this.start;
this.pos = this.state = 0;
function t( gotoEnd ) {
return self.step(gotoEnd);
}
t.elem = this.elem;
if ( t() && jQuery.timers.push(t) && !timerId ) {
timerId = setInterval(fx.tick, fx.interval);
}
},
// Simple 'show' function
show: function() {
/// <summary>
/// Displays each of the set of matched elements if they are hidden.
/// </summary>
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any
// flash of content
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
// Start by showing the element
jQuery( this.elem ).show();
},
// Simple 'hide' function
hide: function() {
/// <summary>
/// Hides each of the set of matched elements if they are shown.
/// </summary>
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.hide = true;
// Begin the animation
this.custom(this.cur(), 0);
},
// Each step of an animation
step: function( gotoEnd ) {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
var t = jQuery.now(), done = true;
if ( gotoEnd || t >= this.options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
this.options.curAnim[ this.prop ] = true;
for ( var i in this.options.curAnim ) {
if ( this.options.curAnim[i] !== true ) {
done = false;
}
}
if ( done ) {
// Reset the overflow
if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
var elem = this.elem,
options = this.options;
jQuery.each( [ "", "X", "Y" ], function (index, value) {
elem.style[ "overflow" + value ] = options.overflow[index];
} );
}
// Hide the element if the "hide" operation was done
if ( this.options.hide ) {
jQuery(this.elem).hide();
}
// Reset the properties, if the item has been hidden or shown
if ( this.options.hide || this.options.show ) {
for ( var p in this.options.curAnim ) {
jQuery.style( this.elem, p, this.options.orig[p] );
}
}
// Execute the complete function
this.options.complete.call( this.elem );
}
return false;
} else {
var n = t - this.startTime;
this.state = n / this.options.duration;
// Perform the easing function, defaults to swing
var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
this.now = this.start + ((this.end - this.start) * this.pos);
// Perform the next step of the animation
this.update();
}
return true;
}
};
jQuery.extend( jQuery.fx, {
tick: function() {
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ ) {
if ( !timers[i]() ) {
timers.splice(i--, 1);
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
},
interval: 13,
stop: function() {
clearInterval( timerId );
timerId = null;
},
speeds: {
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
opacity: function( fx ) {
jQuery.style( fx.elem, "opacity", fx.now );
},
_default: function( fx ) {
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
} else {
fx.elem[ fx.prop ] = fx.now;
}
}
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
function defaultDisplay( nodeName ) {
if ( !elemdisplay[ nodeName ] ) {
var elem = jQuery("<" + nodeName + ">").appendTo("body"),
display = elem.css("display");
elem.remove();
if ( display === "none" || display === "" ) {
display = "block";
}
elemdisplay[ nodeName ] = display;
}
return elemdisplay[ nodeName ];
}
var rtable = /^t(?:able|d|h)$/i,
rroot = /^(?:body|html)$/i;
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
/// <summary>
/// Set the current coordinates of every element in the set of matched elements,
/// relative to the document.
/// </summary>
/// <param name="options" type="Object">
/// An object containing the properties top and left, which are integers indicating the
/// new top and left coordinates for the elements.
/// </param>
/// <returns type="jQuery" />
var elem = this[0], box;
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( !elem || !elem.ownerDocument ) {
return null;
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
try {
box = elem.getBoundingClientRect();
} catch(e) {}
var doc = elem.ownerDocument,
docElem = doc.documentElement;
// Make sure we're not dealing with a disconnected DOM node
if ( !box || !jQuery.contains( docElem, elem ) ) {
return box || { top: 0, left: 0 };
}
var body = doc.body,
win = getWindow(doc),
clientTop = docElem.clientTop || body.clientTop || 0,
clientLeft = docElem.clientLeft || body.clientLeft || 0,
scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ),
scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
top = box.top + scrollTop - clientTop,
left = box.left + scrollLeft - clientLeft;
return { top: top, left: left };
};
} else {
jQuery.fn.offset = function( options ) {
/// <summary>
/// Set the current coordinates of every element in the set of matched elements,
/// relative to the document.
/// </summary>
/// <param name="options" type="Object">
/// An object containing the properties top and left, which are integers indicating the
/// new top and left coordinates for the elements.
/// </param>
/// <returns type="jQuery" />
var elem = this[0];
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( !elem || !elem.ownerDocument ) {
return null;
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
jQuery.offset.initialize();
var computedStyle,
offsetParent = elem.offsetParent,
prevOffsetParent = elem,
doc = elem.ownerDocument,
docElem = doc.documentElement,
body = doc.body,
defaultView = doc.defaultView,
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
top = elem.offsetTop,
left = elem.offsetLeft;
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
break;
}
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
top -= elem.scrollTop;
left -= elem.scrollLeft;
if ( elem === offsetParent ) {
top += elem.offsetTop;
left += elem.offsetLeft;
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevOffsetParent = offsetParent;
offsetParent = elem.offsetParent;
}
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevComputedStyle = computedStyle;
}
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
top += body.offsetTop;
left += body.offsetLeft;
}
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
top += Math.max( docElem.scrollTop, body.scrollTop );
left += Math.max( docElem.scrollLeft, body.scrollLeft );
}
return { top: top, left: left };
};
}
jQuery.offset = {
initialize: function() {
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
container.innerHTML = html;
body.insertBefore( container, body.firstChild );
innerDiv = container.firstChild;
checkDiv = innerDiv.firstChild;
td = innerDiv.nextSibling.firstChild.firstChild;
this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
checkDiv.style.position = "fixed";
checkDiv.style.top = "20px";
// safari subtracts parent border width here which is 5px
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
checkDiv.style.position = checkDiv.style.top = "";
innerDiv.style.overflow = "hidden";
innerDiv.style.position = "relative";
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
body.removeChild( container );
body = container = innerDiv = checkDiv = table = td = null;
jQuery.offset.initialize = jQuery.noop;
},
bodyOffset: function( body ) {
var top = body.offsetTop,
left = body.offsetLeft;
jQuery.offset.initialize();
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
}
return { top: top, left: left };
},
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is absolute
if ( calculatePosition ) {
curPosition = curElem.position();
}
curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;
curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
if (options.top != null) {
props.top = (options.top - curOffset.top) + curTop;
}
if (options.left != null) {
props.left = (options.left - curOffset.left) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
position: function() {
/// <summary>
/// Gets the top and left positions of an element relative to its offset parent.
/// </summary>
/// <returns type="Object">An object with two integer properties, 'top' and 'left'.</returns>
if ( !this[0] ) {
return null;
}
var elem = this[0],
// Get *real* offsetParent
offsetParent = this.offsetParent(),
// Get correct offsets
offset = this.offset(),
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
// Add offsetParent borders
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
// Subtract the two offsets
return {
top: offset.top - parentOffset.top,
left: offset.left - parentOffset.left
};
},
offsetParent: function() {
/// <summary>
/// This method is internal.
/// </summary>
/// <private />
return this.map(function() {
var offsetParent = this.offsetParent || document.body;
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent;
});
}
});
// Create scrollLeft and scrollTop methods
jQuery.each( ["Left", "Top"], function( i, name ) {
var method = "scroll" + name;
jQuery.fn[ method ] = function(val) {
/// <summary>
/// Gets and optionally sets the scroll left offset of the first matched element.
/// </summary>
/// <param name="val" type="Number" integer="true" optional="true">A positive number representing the desired scroll left offset.</param>
/// <returns type="Number" integer="true">The scroll left offset of the first matched element.</returns>
var elem = this[0], win;
if ( !elem ) {
return null;
}
if ( val !== undefined ) {
// Set the scroll offset
return this.each(function() {
win = getWindow( this );
if ( win ) {
win.scrollTo(
!i ? val : jQuery(win).scrollLeft(),
i ? val : jQuery(win).scrollTop()
);
} else {
this[ method ] = val;
}
});
} else {
win = getWindow( elem );
// Return the scroll offset
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
jQuery.support.boxModel && win.document.documentElement[ method ] ||
win.document.body[ method ] :
elem[ method ];
}
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Height" ], function( i, name ) {
var type = name.toLowerCase();
// innerHeight and innerWidth
jQuery.fn["inner" + name] = function() {
/// <summary>
/// Gets the inner height of the first matched element, excluding border but including padding.
/// </summary>
/// <returns type="Number" integer="true">The outer height of the first matched element.</returns>
return this[0] ?
parseFloat( jQuery.css( this[0], type, "padding" ) ) :
null;
};
// outerHeight and outerWidth
jQuery.fn["outer" + name] = function( margin ) {
/// <summary>
/// Gets the outer height of the first matched element, including border and padding by default.
/// </summary>
/// <param name="margins" type="Map">A set of key/value pairs that specify the options for the method.</param>
/// <returns type="Number" integer="true">The outer height of the first matched element.</returns>
return this[0] ?
parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
null;
};
jQuery.fn[ type ] = function( size ) {
/// <summary>
/// Set the CSS height of every matched element. If no explicit unit
/// was specified (like 'em' or '%') then &quot;px&quot; is added to the width. If no parameter is specified, it gets
/// the current computed pixel height of the first matched element.
/// Part of CSS
/// </summary>
/// <returns type="jQuery" type="jQuery" />
/// <param name="cssProperty" type="String">
/// Set the CSS property to the specified value. Omit to get the value of the first matched element.
/// </param>
// Get window width or height
var elem = this[0];
if ( !elem ) {
return size == null ? null : this;
}
if ( jQuery.isFunction( size ) ) {
return this.each(function( i ) {
var self = jQuery( this );
self[ type ]( size.call( this, i, self[ type ]() ) );
});
}
if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
elem.document.body[ "client" + name ];
// Get document width or height
} else if ( elem.nodeType === 9 ) {
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
return Math.max(
elem.documentElement["client" + name],
elem.body["scroll" + name], elem.documentElement["scroll" + name],
elem.body["offset" + name], elem.documentElement["offset" + name]
);
// Get or set width or height on the element
} else if ( size === undefined ) {
var orig = jQuery.css( elem, type ),
ret = parseFloat( orig );
return jQuery.isNaN( ret ) ? orig : ret;
// Set the width or height on the element (default to pixels if value is unitless)
} else {
return this.css( type, typeof size === "string" ? size : size + "px" );
}
};
});
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Width" ], function( i, name ) {
var type = name.toLowerCase();
// innerHeight and innerWidth
jQuery.fn["inner" + name] = function() {
/// <summary>
/// Gets the inner width of the first matched element, excluding border but including padding.
/// </summary>
/// <returns type="Number" integer="true">The outer width of the first matched element.</returns>
return this[0] ?
parseFloat( jQuery.css( this[0], type, "padding" ) ) :
null;
};
// outerHeight and outerWidth
jQuery.fn["outer" + name] = function( margin ) {
/// <summary>
/// Gets the outer width of the first matched element, including border and padding by default.
/// </summary>
/// <param name="margin" type="Map">A set of key/value pairs that specify the options for the method.</param>
/// <returns type="Number" integer="true">The outer width of the first matched element.</returns>
return this[0] ?
parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
null;
};
jQuery.fn[ type ] = function( size ) {
/// <summary>
/// Set the CSS width of every matched element. If no explicit unit
/// was specified (like 'em' or '%') then &quot;px&quot; is added to the width. If no parameter is specified, it gets
/// the current computed pixel width of the first matched element.
/// Part of CSS
/// </summary>
/// <returns type="jQuery" type="jQuery" />
/// <param name="cssProperty" type="String">
/// Set the CSS property to the specified value. Omit to get the value of the first matched element.
/// </param>
// Get window width or height
var elem = this[0];
if ( !elem ) {
return size == null ? null : this;
}
if ( jQuery.isFunction( size ) ) {
return this.each(function( i ) {
var self = jQuery( this );
self[ type ]( size.call( this, i, self[ type ]() ) );
});
}
if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
elem.document.body[ "client" + name ];
// Get document width or height
} else if ( elem.nodeType === 9 ) {
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
return Math.max(
elem.documentElement["client" + name],
elem.body["scroll" + name], elem.documentElement["scroll" + name],
elem.body["offset" + name], elem.documentElement["offset" + name]
);
// Get or set width or height on the element
} else if ( size === undefined ) {
var orig = jQuery.css( elem, type ),
ret = parseFloat( orig );
return jQuery.isNaN( ret ) ? orig : ret;
// Set the width or height on the element (default to pixels if value is unitless)
} else {
return this.css( type, typeof size === "string" ? size : size + "px" );
}
};
});
})(window);
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI CSS Framework 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Accordion 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Autocomplete 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Menu 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
list-style:none;
padding: 2px;
margin: 0;
display:block;
float: left;
}
.ui-menu .ui-menu {
margin-top: -3px;
}
.ui-menu .ui-menu-item {
margin:0;
padding: 0;
zoom: 1;
float: left;
clear: left;
width: 100%;
}
.ui-menu .ui-menu-item a {
text-decoration:none;
display:block;
padding:.2em .4em;
line-height:1.5;
zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Button 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Datepicker 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Dialog 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Dialog#theming
*/
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Progressbar 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Resizable 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Selectable 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Slider 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Slider#theming
*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI Tabs 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI CSS Framework 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
.ui-widget-content a { color: #222222/*{fcContent}*/; }
.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
.ui-widget-header a { color: #222222/*{fcHeader}*/; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; border-radius: 4px/*{cornerRadius}*/; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
// Name: MicrosoftAjax.debug.js
// Assembly: System.Web.Extensions
// Version: 4.0.0.0
// FileVersion: 4.0.20526.0
//-----------------------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------
// MicrosoftAjax.js
// Microsoft AJAX Framework.
Function.__typeName = 'Function';
Function.__class = true;
Function.createCallback = function Function$createCallback(method, context) {
/// <summary locid="M:J#Function.createCallback" />
/// <param name="method" type="Function"></param>
/// <param name="context" mayBeNull="true"></param>
/// <returns type="Function"></returns>
var e = Function._validateParams(arguments, [
{name: "method", type: Function},
{name: "context", mayBeNull: true}
]);
if (e) throw e;
return function() {
var l = arguments.length;
if (l > 0) {
var args = [];
for (var i = 0; i < l; i++) {
args[i] = arguments[i];
}
args[l] = context;
return method.apply(this, args);
}
return method.call(this, context);
}
}
Function.createDelegate = function Function$createDelegate(instance, method) {
/// <summary locid="M:J#Function.createDelegate" />
/// <param name="instance" mayBeNull="true"></param>
/// <param name="method" type="Function"></param>
/// <returns type="Function"></returns>
var e = Function._validateParams(arguments, [
{name: "instance", mayBeNull: true},
{name: "method", type: Function}
]);
if (e) throw e;
return function() {
return method.apply(instance, arguments);
}
}
Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() {
/// <summary locid="M:J#Function.emptyMethod" />
}
Function.validateParameters = function Function$validateParameters(parameters, expectedParameters, validateParameterCount) {
/// <summary locid="M:J#Function.validateParameters" />
/// <param name="parameters"></param>
/// <param name="expectedParameters"></param>
/// <param name="validateParameterCount" type="Boolean" optional="true"></param>
/// <returns type="Error" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "parameters"},
{name: "expectedParameters"},
{name: "validateParameterCount", type: Boolean, optional: true}
]);
if (e) throw e;
return Function._validateParams(parameters, expectedParameters, validateParameterCount);
}
Function._validateParams = function Function$_validateParams(params, expectedParams, validateParameterCount) {
var e, expectedLength = expectedParams.length;
validateParameterCount = validateParameterCount || (typeof(validateParameterCount) === "undefined");
e = Function._validateParameterCount(params, expectedParams, validateParameterCount);
if (e) {
e.popStackFrame();
return e;
}
for (var i = 0, l = params.length; i < l; i++) {
var expectedParam = expectedParams[Math.min(i, expectedLength - 1)],
paramName = expectedParam.name;
if (expectedParam.parameterArray) {
paramName += "[" + (i - expectedLength + 1) + "]";
}
else if (!validateParameterCount && (i >= expectedLength)) {
break;
}
e = Function._validateParameter(params[i], expectedParam, paramName);
if (e) {
e.popStackFrame();
return e;
}
}
return null;
}
Function._validateParameterCount = function Function$_validateParameterCount(params, expectedParams, validateParameterCount) {
var i, error,
expectedLen = expectedParams.length,
actualLen = params.length;
if (actualLen < expectedLen) {
var minParams = expectedLen;
for (i = 0; i < expectedLen; i++) {
var param = expectedParams[i];
if (param.optional || param.parameterArray) {
minParams--;
}
}
if (actualLen < minParams) {
error = true;
}
}
else if (validateParameterCount && (actualLen > expectedLen)) {
error = true;
for (i = 0; i < expectedLen; i++) {
if (expectedParams[i].parameterArray) {
error = false;
break;
}
}
}
if (error) {
var e = Error.parameterCount();
e.popStackFrame();
return e;
}
return null;
}
Function._validateParameter = function Function$_validateParameter(param, expectedParam, paramName) {
var e,
expectedType = expectedParam.type,
expectedInteger = !!expectedParam.integer,
expectedDomElement = !!expectedParam.domElement,
mayBeNull = !!expectedParam.mayBeNull;
e = Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
if (e) {
e.popStackFrame();
return e;
}
var expectedElementType = expectedParam.elementType,
elementMayBeNull = !!expectedParam.elementMayBeNull;
if (expectedType === Array && typeof(param) !== "undefined" && param !== null &&
(expectedElementType || !elementMayBeNull)) {
var expectedElementInteger = !!expectedParam.elementInteger,
expectedElementDomElement = !!expectedParam.elementDomElement;
for (var i=0; i < param.length; i++) {
var elem = param[i];
e = Function._validateParameterType(elem, expectedElementType,
expectedElementInteger, expectedElementDomElement, elementMayBeNull,
paramName + "[" + i + "]");
if (e) {
e.popStackFrame();
return e;
}
}
}
return null;
}
Function._validateParameterType = function Function$_validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
var e, i;
if (typeof(param) === "undefined") {
if (mayBeNull) {
return null;
}
else {
e = Error.argumentUndefined(paramName);
e.popStackFrame();
return e;
}
}
if (param === null) {
if (mayBeNull) {
return null;
}
else {
e = Error.argumentNull(paramName);
e.popStackFrame();
return e;
}
}
if (expectedType && expectedType.__enum) {
if (typeof(param) !== 'number') {
e = Error.argumentType(paramName, Object.getType(param), expectedType);
e.popStackFrame();
return e;
}
if ((param % 1) === 0) {
var values = expectedType.prototype;
if (!expectedType.__flags || (param === 0)) {
for (i in values) {
if (values[i] === param) return null;
}
}
else {
var v = param;
for (i in values) {
var vali = values[i];
if (vali === 0) continue;
if ((vali & param) === vali) {
v -= vali;
}
if (v === 0) return null;
}
}
}
e = Error.argumentOutOfRange(paramName, param, String.format(Sys.Res.enumInvalidValue, param, expectedType.getName()));
e.popStackFrame();
return e;
}
if (expectedDomElement && (!Sys._isDomElement(param) || (param.nodeType === 3))) {
e = Error.argument(paramName, Sys.Res.argumentDomElement);
e.popStackFrame();
return e;
}
if (expectedType && !Sys._isInstanceOfType(expectedType, param)) {
e = Error.argumentType(paramName, Object.getType(param), expectedType);
e.popStackFrame();
return e;
}
if (expectedType === Number && expectedInteger) {
if ((param % 1) !== 0) {
e = Error.argumentOutOfRange(paramName, param, Sys.Res.argumentInteger);
e.popStackFrame();
return e;
}
}
return null;
}
Error.__typeName = 'Error';
Error.__class = true;
Error.create = function Error$create(message, errorInfo) {
/// <summary locid="M:J#Error.create" />
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <param name="errorInfo" optional="true" mayBeNull="true"></param>
/// <returns type="Error"></returns>
var e = Function._validateParams(arguments, [
{name: "message", type: String, mayBeNull: true, optional: true},
{name: "errorInfo", mayBeNull: true, optional: true}
]);
if (e) throw e;
var err = new Error(message);
err.message = message;
if (errorInfo) {
for (var v in errorInfo) {
err[v] = errorInfo[v];
}
}
err.popStackFrame();
return err;
}
Error.argument = function Error$argument(paramName, message) {
/// <summary locid="M:J#Error.argument" />
/// <param name="paramName" type="String" optional="true" mayBeNull="true"></param>
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "paramName", type: String, mayBeNull: true, optional: true},
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.ArgumentException: " + (message ? message : Sys.Res.argument);
if (paramName) {
displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
}
var err = Error.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
err.popStackFrame();
return err;
}
Error.argumentNull = function Error$argumentNull(paramName, message) {
/// <summary locid="M:J#Error.argumentNull" />
/// <param name="paramName" type="String" optional="true" mayBeNull="true"></param>
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "paramName", type: String, mayBeNull: true, optional: true},
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.ArgumentNullException: " + (message ? message : Sys.Res.argumentNull);
if (paramName) {
displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
}
var err = Error.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
err.popStackFrame();
return err;
}
Error.argumentOutOfRange = function Error$argumentOutOfRange(paramName, actualValue, message) {
/// <summary locid="M:J#Error.argumentOutOfRange" />
/// <param name="paramName" type="String" optional="true" mayBeNull="true"></param>
/// <param name="actualValue" optional="true" mayBeNull="true"></param>
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "paramName", type: String, mayBeNull: true, optional: true},
{name: "actualValue", mayBeNull: true, optional: true},
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.ArgumentOutOfRangeException: " + (message ? message : Sys.Res.argumentOutOfRange);
if (paramName) {
displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
}
if (typeof(actualValue) !== "undefined" && actualValue !== null) {
displayMessage += "\n" + String.format(Sys.Res.actualValue, actualValue);
}
var err = Error.create(displayMessage, {
name: "Sys.ArgumentOutOfRangeException",
paramName: paramName,
actualValue: actualValue
});
err.popStackFrame();
return err;
}
Error.argumentType = function Error$argumentType(paramName, actualType, expectedType, message) {
/// <summary locid="M:J#Error.argumentType" />
/// <param name="paramName" type="String" optional="true" mayBeNull="true"></param>
/// <param name="actualType" type="Type" optional="true" mayBeNull="true"></param>
/// <param name="expectedType" type="Type" optional="true" mayBeNull="true"></param>
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "paramName", type: String, mayBeNull: true, optional: true},
{name: "actualType", type: Type, mayBeNull: true, optional: true},
{name: "expectedType", type: Type, mayBeNull: true, optional: true},
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.ArgumentTypeException: ";
if (message) {
displayMessage += message;
}
else if (actualType && expectedType) {
displayMessage +=
String.format(Sys.Res.argumentTypeWithTypes, actualType.getName(), expectedType.getName());
}
else {
displayMessage += Sys.Res.argumentType;
}
if (paramName) {
displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
}
var err = Error.create(displayMessage, {
name: "Sys.ArgumentTypeException",
paramName: paramName,
actualType: actualType,
expectedType: expectedType
});
err.popStackFrame();
return err;
}
Error.argumentUndefined = function Error$argumentUndefined(paramName, message) {
/// <summary locid="M:J#Error.argumentUndefined" />
/// <param name="paramName" type="String" optional="true" mayBeNull="true"></param>
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "paramName", type: String, mayBeNull: true, optional: true},
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.ArgumentUndefinedException: " + (message ? message : Sys.Res.argumentUndefined);
if (paramName) {
displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
}
var err = Error.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
err.popStackFrame();
return err;
}
Error.format = function Error$format(message) {
/// <summary locid="M:J#Error.format" />
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.FormatException: " + (message ? message : Sys.Res.format);
var err = Error.create(displayMessage, {name: 'Sys.FormatException'});
err.popStackFrame();
return err;
}
Error.invalidOperation = function Error$invalidOperation(message) {
/// <summary locid="M:J#Error.invalidOperation" />
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.InvalidOperationException: " + (message ? message : Sys.Res.invalidOperation);
var err = Error.create(displayMessage, {name: 'Sys.InvalidOperationException'});
err.popStackFrame();
return err;
}
Error.notImplemented = function Error$notImplemented(message) {
/// <summary locid="M:J#Error.notImplemented" />
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.NotImplementedException: " + (message ? message : Sys.Res.notImplemented);
var err = Error.create(displayMessage, {name: 'Sys.NotImplementedException'});
err.popStackFrame();
return err;
}
Error.parameterCount = function Error$parameterCount(message) {
/// <summary locid="M:J#Error.parameterCount" />
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "message", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var displayMessage = "Sys.ParameterCountException: " + (message ? message : Sys.Res.parameterCount);
var err = Error.create(displayMessage, {name: 'Sys.ParameterCountException'});
err.popStackFrame();
return err;
}
Error.prototype.popStackFrame = function Error$popStackFrame() {
/// <summary locid="M:J#checkParam" />
if (arguments.length !== 0) throw Error.parameterCount();
if (typeof(this.stack) === "undefined" || this.stack === null ||
typeof(this.fileName) === "undefined" || this.fileName === null ||
typeof(this.lineNumber) === "undefined" || this.lineNumber === null) {
return;
}
var stackFrames = this.stack.split("\n");
var currentFrame = stackFrames[0];
var pattern = this.fileName + ":" + this.lineNumber;
while(typeof(currentFrame) !== "undefined" &&
currentFrame !== null &&
currentFrame.indexOf(pattern) === -1) {
stackFrames.shift();
currentFrame = stackFrames[0];
}
var nextFrame = stackFrames[1];
if (typeof(nextFrame) === "undefined" || nextFrame === null) {
return;
}
var nextFrameParts = nextFrame.match(/@(.*):(\d+)$/);
if (typeof(nextFrameParts) === "undefined" || nextFrameParts === null) {
return;
}
this.fileName = nextFrameParts[1];
this.lineNumber = parseInt(nextFrameParts[2]);
stackFrames.shift();
this.stack = stackFrames.join("\n");
}
Object.__typeName = 'Object';
Object.__class = true;
Object.getType = function Object$getType(instance) {
/// <summary locid="M:J#Object.getType" />
/// <param name="instance"></param>
/// <returns type="Type"></returns>
var e = Function._validateParams(arguments, [
{name: "instance"}
]);
if (e) throw e;
var ctor = instance.constructor;
if (!ctor || (typeof(ctor) !== "function") || !ctor.__typeName || (ctor.__typeName === 'Object')) {
return Object;
}
return ctor;
}
Object.getTypeName = function Object$getTypeName(instance) {
/// <summary locid="M:J#Object.getTypeName" />
/// <param name="instance"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "instance"}
]);
if (e) throw e;
return Object.getType(instance).getName();
}
String.__typeName = 'String';
String.__class = true;
String.prototype.endsWith = function String$endsWith(suffix) {
/// <summary locid="M:J#String.endsWith" />
/// <param name="suffix" type="String"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "suffix", type: String}
]);
if (e) throw e;
return (this.substr(this.length - suffix.length) === suffix);
}
String.prototype.startsWith = function String$startsWith(prefix) {
/// <summary locid="M:J#String.startsWith" />
/// <param name="prefix" type="String"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "prefix", type: String}
]);
if (e) throw e;
return (this.substr(0, prefix.length) === prefix);
}
String.prototype.trim = function String$trim() {
/// <summary locid="M:J#String.trim" />
/// <returns type="String"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
return this.replace(/^\s+|\s+$/g, '');
}
String.prototype.trimEnd = function String$trimEnd() {
/// <summary locid="M:J#String.trimEnd" />
/// <returns type="String"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
return this.replace(/\s+$/, '');
}
String.prototype.trimStart = function String$trimStart() {
/// <summary locid="M:J#String.trimStart" />
/// <returns type="String"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
return this.replace(/^\s+/, '');
}
String.format = function String$format(format, args) {
/// <summary locid="M:J#String.format" />
/// <param name="format" type="String"></param>
/// <param name="args" parameterArray="true" mayBeNull="true"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String},
{name: "args", mayBeNull: true, parameterArray: true}
]);
if (e) throw e;
return String._toFormattedString(false, arguments);
}
String._toFormattedString = function String$_toFormattedString(useLocale, args) {
var result = '';
var format = args[0];
for (var i=0;;) {
var open = format.indexOf('{', i);
var close = format.indexOf('}', i);
if ((open < 0) && (close < 0)) {
result += format.slice(i);
break;
}
if ((close > 0) && ((close < open) || (open < 0))) {
if (format.charAt(close + 1) !== '}') {
throw Error.argument('format', Sys.Res.stringFormatBraceMismatch);
}
result += format.slice(i, close + 1);
i = close + 2;
continue;
}
result += format.slice(i, open);
i = open + 1;
if (format.charAt(i) === '{') {
result += '{';
i++;
continue;
}
if (close < 0) throw Error.argument('format', Sys.Res.stringFormatBraceMismatch);
var brace = format.substring(i, close);
var colonIndex = brace.indexOf(':');
var argNumber = parseInt((colonIndex < 0)? brace : brace.substring(0, colonIndex), 10) + 1;
if (isNaN(argNumber)) throw Error.argument('format', Sys.Res.stringFormatInvalid);
var argFormat = (colonIndex < 0)? '' : brace.substring(colonIndex + 1);
var arg = args[argNumber];
if (typeof(arg) === "undefined" || arg === null) {
arg = '';
}
if (arg.toFormattedString) {
result += arg.toFormattedString(argFormat);
}
else if (useLocale && arg.localeFormat) {
result += arg.localeFormat(argFormat);
}
else if (arg.format) {
result += arg.format(argFormat);
}
else
result += arg.toString();
i = close + 1;
}
return result;
}
Boolean.__typeName = 'Boolean';
Boolean.__class = true;
Boolean.parse = function Boolean$parse(value) {
/// <summary locid="M:J#Boolean.parse" />
/// <param name="value" type="String"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String}
], false);
if (e) throw e;
var v = value.trim().toLowerCase();
if (v === 'false') return false;
if (v === 'true') return true;
throw Error.argumentOutOfRange('value', value, Sys.Res.boolTrueOrFalse);
}
Date.__typeName = 'Date';
Date.__class = true;
Number.__typeName = 'Number';
Number.__class = true;
RegExp.__typeName = 'RegExp';
RegExp.__class = true;
if (!window) this.window = this;
window.Type = Function;
Type.__fullyQualifiedIdentifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]([^ \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*[^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\])?$", "i");
Type.__identifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\][^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*$", "i");
Type.prototype.callBaseMethod = function Type$callBaseMethod(instance, name, baseArguments) {
/// <summary locid="M:J#Type.callBaseMethod" />
/// <param name="instance"></param>
/// <param name="name" type="String"></param>
/// <param name="baseArguments" type="Array" optional="true" mayBeNull="true" elementMayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "instance"},
{name: "name", type: String},
{name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true}
]);
if (e) throw e;
var baseMethod = Sys._getBaseMethod(this, instance, name);
if (!baseMethod) throw Error.invalidOperation(String.format(Sys.Res.methodNotFound, name));
if (!baseArguments) {
return baseMethod.apply(instance);
}
else {
return baseMethod.apply(instance, baseArguments);
}
}
Type.prototype.getBaseMethod = function Type$getBaseMethod(instance, name) {
/// <summary locid="M:J#Type.getBaseMethod" />
/// <param name="instance"></param>
/// <param name="name" type="String"></param>
/// <returns type="Function" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "instance"},
{name: "name", type: String}
]);
if (e) throw e;
return Sys._getBaseMethod(this, instance, name);
}
Type.prototype.getBaseType = function Type$getBaseType() {
/// <summary locid="M:J#Type.getBaseType" />
/// <returns type="Type" mayBeNull="true"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
return (typeof(this.__baseType) === "undefined") ? null : this.__baseType;
}
Type.prototype.getInterfaces = function Type$getInterfaces() {
/// <summary locid="M:J#Type.getInterfaces" />
/// <returns type="Array" elementType="Type" mayBeNull="false" elementMayBeNull="false"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
var result = [];
var type = this;
while(type) {
var interfaces = type.__interfaces;
if (interfaces) {
for (var i = 0, l = interfaces.length; i < l; i++) {
var interfaceType = interfaces[i];
if (!Array.contains(result, interfaceType)) {
result[result.length] = interfaceType;
}
}
}
type = type.__baseType;
}
return result;
}
Type.prototype.getName = function Type$getName() {
/// <summary locid="M:J#Type.getName" />
/// <returns type="String"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
return (typeof(this.__typeName) === "undefined") ? "" : this.__typeName;
}
Type.prototype.implementsInterface = function Type$implementsInterface(interfaceType) {
/// <summary locid="M:J#Type.implementsInterface" />
/// <param name="interfaceType" type="Type"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "interfaceType", type: Type}
]);
if (e) throw e;
this.resolveInheritance();
var interfaceName = interfaceType.getName();
var cache = this.__interfaceCache;
if (cache) {
var cacheEntry = cache[interfaceName];
if (typeof(cacheEntry) !== 'undefined') return cacheEntry;
}
else {
cache = this.__interfaceCache = {};
}
var baseType = this;
while (baseType) {
var interfaces = baseType.__interfaces;
if (interfaces) {
if (Array.indexOf(interfaces, interfaceType) !== -1) {
return cache[interfaceName] = true;
}
}
baseType = baseType.__baseType;
}
return cache[interfaceName] = false;
}
Type.prototype.inheritsFrom = function Type$inheritsFrom(parentType) {
/// <summary locid="M:J#Type.inheritsFrom" />
/// <param name="parentType" type="Type"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "parentType", type: Type}
]);
if (e) throw e;
this.resolveInheritance();
var baseType = this.__baseType;
while (baseType) {
if (baseType === parentType) {
return true;
}
baseType = baseType.__baseType;
}
return false;
}
Type.prototype.initializeBase = function Type$initializeBase(instance, baseArguments) {
/// <summary locid="M:J#Type.initializeBase" />
/// <param name="instance"></param>
/// <param name="baseArguments" type="Array" optional="true" mayBeNull="true" elementMayBeNull="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "instance"},
{name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true}
]);
if (e) throw e;
if (!Sys._isInstanceOfType(this, instance)) throw Error.argumentType('instance', Object.getType(instance), this);
this.resolveInheritance();
if (this.__baseType) {
if (!baseArguments) {
this.__baseType.apply(instance);
}
else {
this.__baseType.apply(instance, baseArguments);
}
}
return instance;
}
Type.prototype.isImplementedBy = function Type$isImplementedBy(instance) {
/// <summary locid="M:J#Type.isImplementedBy" />
/// <param name="instance" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "instance", mayBeNull: true}
]);
if (e) throw e;
if (typeof(instance) === "undefined" || instance === null) return false;
var instanceType = Object.getType(instance);
return !!(instanceType.implementsInterface && instanceType.implementsInterface(this));
}
Type.prototype.isInstanceOfType = function Type$isInstanceOfType(instance) {
/// <summary locid="M:J#Type.isInstanceOfType" />
/// <param name="instance" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "instance", mayBeNull: true}
]);
if (e) throw e;
return Sys._isInstanceOfType(this, instance);
}
Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) {
/// <summary locid="M:J#Type.registerClass" />
/// <param name="typeName" type="String"></param>
/// <param name="baseType" type="Type" optional="true" mayBeNull="true"></param>
/// <param name="interfaceTypes" parameterArray="true" type="Type"></param>
/// <returns type="Type"></returns>
var e = Function._validateParams(arguments, [
{name: "typeName", type: String},
{name: "baseType", type: Type, mayBeNull: true, optional: true},
{name: "interfaceTypes", type: Type, parameterArray: true}
]);
if (e) throw e;
if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName);
var parsedName;
try {
parsedName = eval(typeName);
}
catch(e) {
throw Error.argument('typeName', Sys.Res.argumentTypeName);
}
if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName);
if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName));
if ((arguments.length > 1) && (typeof(baseType) === 'undefined')) throw Error.argumentUndefined('baseType');
if (baseType && !baseType.__class) throw Error.argument('baseType', Sys.Res.baseNotAClass);
this.prototype.constructor = this;
this.__typeName = typeName;
this.__class = true;
if (baseType) {
this.__baseType = baseType;
this.__basePrototypePending = true;
}
Sys.__upperCaseTypes[typeName.toUpperCase()] = this;
if (interfaceTypes) {
this.__interfaces = [];
this.resolveInheritance();
for (var i = 2, l = arguments.length; i < l; i++) {
var interfaceType = arguments[i];
if (!interfaceType.__interface) throw Error.argument('interfaceTypes[' + (i - 2) + ']', Sys.Res.notAnInterface);
for (var methodName in interfaceType.prototype) {
var method = interfaceType.prototype[methodName];
if (!this.prototype[methodName]) {
this.prototype[methodName] = method;
}
}
this.__interfaces.push(interfaceType);
}
}
Sys.__registeredTypes[typeName] = true;
return this;
}
Type.prototype.registerInterface = function Type$registerInterface(typeName) {
/// <summary locid="M:J#Type.registerInterface" />
/// <param name="typeName" type="String"></param>
/// <returns type="Type"></returns>
var e = Function._validateParams(arguments, [
{name: "typeName", type: String}
]);
if (e) throw e;
if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName);
var parsedName;
try {
parsedName = eval(typeName);
}
catch(e) {
throw Error.argument('typeName', Sys.Res.argumentTypeName);
}
if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName);
if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName));
Sys.__upperCaseTypes[typeName.toUpperCase()] = this;
this.prototype.constructor = this;
this.__typeName = typeName;
this.__interface = true;
Sys.__registeredTypes[typeName] = true;
return this;
}
Type.prototype.resolveInheritance = function Type$resolveInheritance() {
/// <summary locid="M:J#Type.resolveInheritance" />
if (arguments.length !== 0) throw Error.parameterCount();
if (this.__basePrototypePending) {
var baseType = this.__baseType;
baseType.resolveInheritance();
for (var memberName in baseType.prototype) {
var memberValue = baseType.prototype[memberName];
if (!this.prototype[memberName]) {
this.prototype[memberName] = memberValue;
}
}
delete this.__basePrototypePending;
}
}
Type.getRootNamespaces = function Type$getRootNamespaces() {
/// <summary locid="M:J#Type.getRootNamespaces" />
/// <returns type="Array"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
return Array.clone(Sys.__rootNamespaces);
}
Type.isClass = function Type$isClass(type) {
/// <summary locid="M:J#Type.isClass" />
/// <param name="type" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "type", mayBeNull: true}
]);
if (e) throw e;
if ((typeof(type) === 'undefined') || (type === null)) return false;
return !!type.__class;
}
Type.isInterface = function Type$isInterface(type) {
/// <summary locid="M:J#Type.isInterface" />
/// <param name="type" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "type", mayBeNull: true}
]);
if (e) throw e;
if ((typeof(type) === 'undefined') || (type === null)) return false;
return !!type.__interface;
}
Type.isNamespace = function Type$isNamespace(object) {
/// <summary locid="M:J#Type.isNamespace" />
/// <param name="object" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "object", mayBeNull: true}
]);
if (e) throw e;
if ((typeof(object) === 'undefined') || (object === null)) return false;
return !!object.__namespace;
}
Type.parse = function Type$parse(typeName, ns) {
/// <summary locid="M:J#Type.parse" />
/// <param name="typeName" type="String" mayBeNull="true"></param>
/// <param name="ns" optional="true" mayBeNull="true"></param>
/// <returns type="Type" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "typeName", type: String, mayBeNull: true},
{name: "ns", mayBeNull: true, optional: true}
]);
if (e) throw e;
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);
if (typeof(fn) !== 'function') throw Error.argument('typeName', Sys.Res.notATypeName);
Type.__htClasses[typeName] = fn;
}
return fn;
}
Type.registerNamespace = function Type$registerNamespace(namespacePath) {
/// <summary locid="M:J#Type.registerNamespace" />
/// <param name="namespacePath" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "namespacePath", type: String}
]);
if (e) throw e;
Type._registerNamespace(namespacePath);
}
Type._registerNamespace = function Type$_registerNamespace(namespacePath) {
if (!Type.__fullyQualifiedIdentifierRegExp.test(namespacePath)) throw Error.argument('namespacePath', Sys.Res.invalidNameSpace);
var rootObject = window;
var namespaceParts = namespacePath.split('.');
for (var i = 0; i < namespaceParts.length; i++) {
var currentPart = namespaceParts[i];
var ns = rootObject[currentPart];
var nsType = typeof(ns);
if ((nsType !== "undefined") && (ns !== null)) {
if (nsType === "function") {
throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsClass, namespaceParts.splice(0, i + 1).join('.')));
}
if ((typeof(ns) !== "object") || (ns instanceof Array)) {
throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsNonObject, namespaceParts.splice(0, i + 1).join('.')));
}
}
if (!ns) {
ns = rootObject[currentPart] = {};
}
if (!ns.__namespace) {
if ((i === 0) && (namespacePath !== "Sys")) {
Sys.__rootNamespaces[Sys.__rootNamespaces.length] = ns;
}
ns.__namespace = true;
ns.__typeName = namespaceParts.slice(0, i + 1).join('.');
var parsedName;
try {
parsedName = eval(ns.__typeName);
}
catch(e) {
parsedName = null;
}
if (parsedName !== ns) {
delete rootObject[currentPart];
throw Error.argument('namespacePath', Sys.Res.invalidNameSpace);
}
ns.getName = function ns$getName() {return this.__typeName;}
}
rootObject = ns;
}
}
Type._checkDependency = function Type$_checkDependency(dependency, featureName) {
var scripts = Type._registerScript._scripts, isDependent = (scripts ? (!!scripts[dependency]) : false);
if ((typeof(featureName) !== 'undefined') && !isDependent) {
throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded,
featureName, dependency));
}
return isDependent;
}
Type._registerScript = function Type$_registerScript(scriptName, dependencies) {
var scripts = Type._registerScript._scripts;
if (!scripts) {
Type._registerScript._scripts = scripts = {};
}
if (scripts[scriptName]) {
throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, scriptName));
}
scripts[scriptName] = true;
if (dependencies) {
for (var i = 0, l = dependencies.length; i < l; i++) {
var dependency = dependencies[i];
if (!Type._checkDependency(dependency)) {
throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, scriptName, dependency));
}
}
}
}
Type._registerNamespace("Sys");
Sys.__upperCaseTypes = {};
Sys.__rootNamespaces = [Sys];
Sys.__registeredTypes = {};
Sys._isInstanceOfType = function Sys$_isInstanceOfType(type, instance) {
if (typeof(instance) === "undefined" || instance === null) return false;
if (instance instanceof type) return true;
var instanceType = Object.getType(instance);
return !!(instanceType === type) ||
(instanceType.inheritsFrom && instanceType.inheritsFrom(type)) ||
(instanceType.implementsInterface && instanceType.implementsInterface(type));
}
Sys._getBaseMethod = function Sys$_getBaseMethod(type, instance, name) {
if (!Sys._isInstanceOfType(type, instance)) throw Error.argumentType('instance', Object.getType(instance), type);
var baseType = type.getBaseType();
if (baseType) {
var baseMethod = baseType.prototype[name];
return (baseMethod instanceof Function) ? baseMethod : null;
}
return null;
}
Sys._isDomElement = function Sys$_isDomElement(obj) {
var val = false;
if (typeof (obj.nodeType) !== 'number') {
var doc = obj.ownerDocument || obj.document || obj;
if (doc != obj) {
var w = doc.defaultView || doc.parentWindow;
val = (w != obj);
}
else {
val = (typeof (doc.body) === 'undefined');
}
}
return !val;
}
Array.__typeName = 'Array';
Array.__class = true;
Array.add = Array.enqueue = function Array$enqueue(array, item) {
/// <summary locid="M:J#Array.enqueue" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="item" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "item", mayBeNull: true}
]);
if (e) throw e;
array[array.length] = item;
}
Array.addRange = function Array$addRange(array, items) {
/// <summary locid="M:J#Array.addRange" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="items" type="Array" elementMayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "items", type: Array, elementMayBeNull: true}
]);
if (e) throw e;
array.push.apply(array, items);
}
Array.clear = function Array$clear(array) {
/// <summary locid="M:J#Array.clear" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true}
]);
if (e) throw e;
array.length = 0;
}
Array.clone = function Array$clone(array) {
/// <summary locid="M:J#Array.clone" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <returns type="Array" elementMayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true}
]);
if (e) throw e;
if (array.length === 1) {
return [array[0]];
}
else {
return Array.apply(null, array);
}
}
Array.contains = function Array$contains(array, item) {
/// <summary locid="M:J#Array.contains" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="item" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "item", mayBeNull: true}
]);
if (e) throw e;
return (Sys._indexOf(array, item) >= 0);
}
Array.dequeue = function Array$dequeue(array) {
/// <summary locid="M:J#Array.dequeue" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <returns mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true}
]);
if (e) throw e;
return array.shift();
}
Array.forEach = function Array$forEach(array, method, instance) {
/// <summary locid="M:J#Array.forEach" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="method" type="Function"></param>
/// <param name="instance" optional="true" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "method", type: Function},
{name: "instance", mayBeNull: true, optional: true}
]);
if (e) throw e;
for (var i = 0, l = array.length; i < l; i++) {
var elt = array[i];
if (typeof(elt) !== 'undefined') method.call(instance, elt, i, array);
}
}
Array.indexOf = function Array$indexOf(array, item, start) {
/// <summary locid="M:J#Array.indexOf" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="item" optional="true" mayBeNull="true"></param>
/// <param name="start" optional="true" mayBeNull="true"></param>
/// <returns type="Number"></returns>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "item", mayBeNull: true, optional: true},
{name: "start", mayBeNull: true, optional: true}
]);
if (e) throw e;
return Sys._indexOf(array, item, start);
}
Array.insert = function Array$insert(array, index, item) {
/// <summary locid="M:J#Array.insert" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="index" mayBeNull="true"></param>
/// <param name="item" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "index", mayBeNull: true},
{name: "item", mayBeNull: true}
]);
if (e) throw e;
array.splice(index, 0, item);
}
Array.parse = function Array$parse(value) {
/// <summary locid="M:J#Array.parse" />
/// <param name="value" type="String" mayBeNull="true"></param>
/// <returns type="Array" elementMayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String, mayBeNull: true}
]);
if (e) throw e;
if (!value) return [];
var v = eval(value);
if (!Array.isInstanceOfType(v)) throw Error.argument('value', Sys.Res.arrayParseBadFormat);
return v;
}
Array.remove = function Array$remove(array, item) {
/// <summary locid="M:J#Array.remove" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="item" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "item", mayBeNull: true}
]);
if (e) throw e;
var index = Sys._indexOf(array, item);
if (index >= 0) {
array.splice(index, 1);
}
return (index >= 0);
}
Array.removeAt = function Array$removeAt(array, index) {
/// <summary locid="M:J#Array.removeAt" />
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="index" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "index", mayBeNull: true}
]);
if (e) throw e;
array.splice(index, 1);
}
Sys._indexOf = function Sys$_indexOf(array, item, start) {
if (typeof(item) === "undefined") return -1;
var length = array.length;
if (length !== 0) {
start = start - 0;
if (isNaN(start)) {
start = 0;
}
else {
if (isFinite(start)) {
start = start - (start % 1);
}
if (start < 0) {
start = Math.max(0, length + start);
}
}
for (var i = start; i < length; i++) {
if ((typeof(array[i]) !== "undefined") && (array[i] === item)) {
return i;
}
}
}
return -1;
}
Type._registerScript._scripts = {
"MicrosoftAjaxCore.js": true,
"MicrosoftAjaxGlobalization.js": true,
"MicrosoftAjaxSerialization.js": true,
"MicrosoftAjaxComponentModel.js": true,
"MicrosoftAjaxHistory.js": true,
"MicrosoftAjaxNetwork.js" : true,
"MicrosoftAjaxWebServices.js": true };
Sys.IDisposable = function Sys$IDisposable() {
throw Error.notImplemented();
}
function Sys$IDisposable$dispose() {
throw Error.notImplemented();
}
Sys.IDisposable.prototype = {
dispose: Sys$IDisposable$dispose
}
Sys.IDisposable.registerInterface('Sys.IDisposable');
Sys.StringBuilder = function Sys$StringBuilder(initialText) {
/// <summary locid="M:J#Sys.StringBuilder.#ctor" />
/// <param name="initialText" optional="true" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "initialText", mayBeNull: true, optional: true}
]);
if (e) throw e;
this._parts = (typeof(initialText) !== 'undefined' && initialText !== null && initialText !== '') ?
[initialText.toString()] : [];
this._value = {};
this._len = 0;
}
function Sys$StringBuilder$append(text) {
/// <summary locid="M:J#Sys.StringBuilder.append" />
/// <param name="text" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "text", mayBeNull: true}
]);
if (e) throw e;
this._parts[this._parts.length] = text;
}
function Sys$StringBuilder$appendLine(text) {
/// <summary locid="M:J#Sys.StringBuilder.appendLine" />
/// <param name="text" optional="true" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "text", mayBeNull: true, optional: true}
]);
if (e) throw e;
this._parts[this._parts.length] =
((typeof(text) === 'undefined') || (text === null) || (text === '')) ?
'\r\n' : text + '\r\n';
}
function Sys$StringBuilder$clear() {
/// <summary locid="M:J#Sys.StringBuilder.clear" />
if (arguments.length !== 0) throw Error.parameterCount();
this._parts = [];
this._value = {};
this._len = 0;
}
function Sys$StringBuilder$isEmpty() {
/// <summary locid="M:J#Sys.StringBuilder.isEmpty" />
/// <returns type="Boolean"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
if (this._parts.length === 0) return true;
return this.toString() === '';
}
function Sys$StringBuilder$toString(separator) {
/// <summary locid="M:J#Sys.StringBuilder.toString" />
/// <param name="separator" type="String" optional="true" mayBeNull="true"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "separator", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
separator = separator || '';
var parts = this._parts;
if (this._len !== parts.length) {
this._value = {};
this._len = parts.length;
}
var val = this._value;
if (typeof(val[separator]) === 'undefined') {
if (separator !== '') {
for (var i = 0; i < parts.length;) {
if ((typeof(parts[i]) === 'undefined') || (parts[i] === '') || (parts[i] === null)) {
parts.splice(i, 1);
}
else {
i++;
}
}
}
val[separator] = this._parts.join(separator);
}
return val[separator];
}
Sys.StringBuilder.prototype = {
append: Sys$StringBuilder$append,
appendLine: Sys$StringBuilder$appendLine,
clear: Sys$StringBuilder$clear,
isEmpty: Sys$StringBuilder$isEmpty,
toString: Sys$StringBuilder$toString
}
Sys.StringBuilder.registerClass('Sys.StringBuilder');
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;
}
Sys.EventArgs = function Sys$EventArgs() {
/// <summary locid="M:J#Sys.EventArgs.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
}
Sys.EventArgs.registerClass('Sys.EventArgs');
Sys.EventArgs.Empty = new Sys.EventArgs();
Sys.CancelEventArgs = function Sys$CancelEventArgs() {
/// <summary locid="M:J#Sys.CancelEventArgs.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
Sys.CancelEventArgs.initializeBase(this);
this._cancel = false;
}
function Sys$CancelEventArgs$get_cancel() {
/// <value type="Boolean" locid="P:J#Sys.CancelEventArgs.cancel"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._cancel;
}
function Sys$CancelEventArgs$set_cancel(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]);
if (e) throw e;
this._cancel = value;
}
Sys.CancelEventArgs.prototype = {
get_cancel: Sys$CancelEventArgs$get_cancel,
set_cancel: Sys$CancelEventArgs$set_cancel
}
Sys.CancelEventArgs.registerClass('Sys.CancelEventArgs', Sys.EventArgs);
Type.registerNamespace('Sys.UI');
Sys._Debug = function Sys$_Debug() {
/// <summary locid="M:J#Sys.Debug.#ctor" />
/// <field name="isDebug" type="Boolean" locid="F:J#Sys.Debug.isDebug"></field>
if (arguments.length !== 0) throw Error.parameterCount();
}
function Sys$_Debug$_appendConsole(text) {
if ((typeof(Debug) !== 'undefined') && Debug.writeln) {
Debug.writeln(text);
}
if (window.console && window.console.log) {
window.console.log(text);
}
if (window.opera) {
window.opera.postError(text);
}
if (window.debugService) {
window.debugService.trace(text);
}
}
function Sys$_Debug$_appendTrace(text) {
var traceElement = document.getElementById('TraceConsole');
if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) {
traceElement.value += text + '\n';
}
}
function Sys$_Debug$assert(condition, message, displayCaller) {
/// <summary locid="M:J#Sys.Debug.assert" />
/// <param name="condition" type="Boolean"></param>
/// <param name="message" type="String" optional="true" mayBeNull="true"></param>
/// <param name="displayCaller" type="Boolean" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "condition", type: Boolean},
{name: "message", type: String, mayBeNull: true, optional: true},
{name: "displayCaller", type: Boolean, optional: true}
]);
if (e) throw e;
if (!condition) {
message = (displayCaller && this.assert.caller) ?
String.format(Sys.Res.assertFailedCaller, message, this.assert.caller) :
String.format(Sys.Res.assertFailed, message);
if (confirm(String.format(Sys.Res.breakIntoDebugger, message))) {
this.fail(message);
}
}
}
function Sys$_Debug$clearTrace() {
/// <summary locid="M:J#Sys.Debug.clearTrace" />
if (arguments.length !== 0) throw Error.parameterCount();
var traceElement = document.getElementById('TraceConsole');
if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) {
traceElement.value = '';
}
}
function Sys$_Debug$fail(message) {
/// <summary locid="M:J#Sys.Debug.fail" />
/// <param name="message" type="String" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "message", type: String, mayBeNull: true}
]);
if (e) throw e;
this._appendConsole(message);
if (Sys.Browser.hasDebuggerStatement) {
eval('debugger');
}
}
function Sys$_Debug$trace(text) {
/// <summary locid="M:J#Sys.Debug.trace" />
/// <param name="text"></param>
var e = Function._validateParams(arguments, [
{name: "text"}
]);
if (e) throw e;
this._appendConsole(text);
this._appendTrace(text);
}
function Sys$_Debug$traceDump(object, name) {
/// <summary locid="M:J#Sys.Debug.traceDump" />
/// <param name="object" mayBeNull="true"></param>
/// <param name="name" type="String" mayBeNull="true" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "object", mayBeNull: true},
{name: "name", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var text = this._traceDump(object, name, true);
}
function Sys$_Debug$_traceDump(object, name, recursive, indentationPadding, loopArray) {
name = name? name : 'traceDump';
indentationPadding = indentationPadding? indentationPadding : '';
if (object === null) {
this.trace(indentationPadding + name + ': null');
return;
}
switch(typeof(object)) {
case 'undefined':
this.trace(indentationPadding + name + ': Undefined');
break;
case 'number': case 'string': case 'boolean':
this.trace(indentationPadding + name + ': ' + object);
break;
default:
if (Date.isInstanceOfType(object) || RegExp.isInstanceOfType(object)) {
this.trace(indentationPadding + name + ': ' + object.toString());
break;
}
if (!loopArray) {
loopArray = [];
}
else if (Array.contains(loopArray, object)) {
this.trace(indentationPadding + name + ': ...');
return;
}
Array.add(loopArray, object);
if ((object == window) || (object === document) ||
(window.HTMLElement && (object instanceof HTMLElement)) ||
(typeof(object.nodeName) === 'string')) {
var tag = object.tagName? object.tagName : 'DomElement';
if (object.id) {
tag += ' - ' + object.id;
}
this.trace(indentationPadding + name + ' {' + tag + '}');
}
else {
var typeName = Object.getTypeName(object);
this.trace(indentationPadding + name + (typeof(typeName) === 'string' ? ' {' + typeName + '}' : ''));
if ((indentationPadding === '') || recursive) {
indentationPadding += " ";
var i, length, properties, p, v;
if (Array.isInstanceOfType(object)) {
length = object.length;
for (i = 0; i < length; i++) {
this._traceDump(object[i], '[' + i + ']', recursive, indentationPadding, loopArray);
}
}
else {
for (p in object) {
v = object[p];
if (!Function.isInstanceOfType(v)) {
this._traceDump(v, p, recursive, indentationPadding, loopArray);
}
}
}
}
}
Array.remove(loopArray, object);
}
}
Sys._Debug.prototype = {
_appendConsole: Sys$_Debug$_appendConsole,
_appendTrace: Sys$_Debug$_appendTrace,
assert: Sys$_Debug$assert,
clearTrace: Sys$_Debug$clearTrace,
fail: Sys$_Debug$fail,
trace: Sys$_Debug$trace,
traceDump: Sys$_Debug$traceDump,
_traceDump: Sys$_Debug$_traceDump
}
Sys._Debug.registerClass('Sys._Debug');
Sys.Debug = new Sys._Debug();
Sys.Debug.isDebug = true;
function Sys$Enum$parse(value, ignoreCase) {
/// <summary locid="M:J#Sys.Enum.parse" />
/// <param name="value" type="String"></param>
/// <param name="ignoreCase" type="Boolean" optional="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String},
{name: "ignoreCase", type: Boolean, optional: true}
]);
if (e) throw e;
var values, parsed, val;
if (ignoreCase) {
values = this.__lowerCaseValues;
if (!values) {
this.__lowerCaseValues = values = {};
var prototype = this.prototype;
for (var name in prototype) {
values[name.toLowerCase()] = prototype[name];
}
}
}
else {
values = this.prototype;
}
if (!this.__flags) {
val = (ignoreCase ? value.toLowerCase() : value);
parsed = values[val.trim()];
if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value, this.__typeName));
return parsed;
}
else {
var parts = (ignoreCase ? value.toLowerCase() : value).split(',');
var v = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var part = parts[i].trim();
parsed = values[part];
if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value.split(',')[i].trim(), this.__typeName));
v |= parsed;
}
return v;
}
}
function Sys$Enum$toString(value) {
/// <summary locid="M:J#Sys.Enum.toString" />
/// <param name="value" optional="true" mayBeNull="true"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "value", mayBeNull: true, optional: true}
]);
if (e) throw e;
if ((typeof(value) === 'undefined') || (value === null)) return this.__string;
if ((typeof(value) != 'number') || ((value % 1) !== 0)) throw Error.argumentType('value', Object.getType(value), this);
var values = this.prototype;
var i;
if (!this.__flags || (value === 0)) {
for (i in values) {
if (values[i] === value) {
return i;
}
}
}
else {
var sorted = this.__sortedValues;
if (!sorted) {
sorted = [];
for (i in values) {
sorted[sorted.length] = {key: i, value: values[i]};
}
sorted.sort(function(a, b) {
return a.value - b.value;
});
this.__sortedValues = sorted;
}
var parts = [];
var v = value;
for (i = sorted.length - 1; i >= 0; i--) {
var kvp = sorted[i];
var vali = kvp.value;
if (vali === 0) continue;
if ((vali & value) === vali) {
parts[parts.length] = kvp.key;
v -= vali;
if (v === 0) break;
}
}
if (parts.length && v === 0) return parts.reverse().join(', ');
}
throw Error.argumentOutOfRange('value', value, String.format(Sys.Res.enumInvalidValue, value, this.__typeName));
}
Type.prototype.registerEnum = function Type$registerEnum(name, flags) {
/// <summary locid="M:J#Sys.UI.LineType.#ctor" />
/// <param name="name" type="String"></param>
/// <param name="flags" type="Boolean" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "name", type: String},
{name: "flags", type: Boolean, optional: true}
]);
if (e) throw e;
if (!Type.__fullyQualifiedIdentifierRegExp.test(name)) throw Error.argument('name', Sys.Res.notATypeName);
var parsedName;
try {
parsedName = eval(name);
}
catch(e) {
throw Error.argument('name', Sys.Res.argumentTypeName);
}
if (parsedName !== this) throw Error.argument('name', Sys.Res.badTypeName);
if (Sys.__registeredTypes[name]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, name));
for (var j in this.prototype) {
var val = this.prototype[j];
if (!Type.__identifierRegExp.test(j)) throw Error.invalidOperation(String.format(Sys.Res.enumInvalidValueName, j));
if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger);
if (typeof(this[j]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.enumReservedName, j));
}
Sys.__upperCaseTypes[name.toUpperCase()] = this;
for (var i in this.prototype) {
this[i] = this.prototype[i];
}
this.__typeName = name;
this.parse = Sys$Enum$parse;
this.__string = this.toString();
this.toString = Sys$Enum$toString;
this.__flags = flags;
this.__enum = true;
Sys.__registeredTypes[name] = true;
}
Type.isEnum = function Type$isEnum(type) {
/// <summary locid="M:J#Type.isEnum" />
/// <param name="type" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "type", mayBeNull: true}
]);
if (e) throw e;
if ((typeof(type) === 'undefined') || (type === null)) return false;
return !!type.__enum;
}
Type.isFlags = function Type$isFlags(type) {
/// <summary locid="M:J#Type.isFlags" />
/// <param name="type" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "type", mayBeNull: true}
]);
if (e) throw e;
if ((typeof(type) === 'undefined') || (type === null)) return false;
return !!type.__flags;
}
Sys.CollectionChange = function Sys$CollectionChange(action, newItems, newStartingIndex, oldItems, oldStartingIndex) {
/// <summary locid="M:J#Sys.CollectionChange.#ctor" />
/// <param name="action" type="Sys.NotifyCollectionChangedAction"></param>
/// <param name="newItems" optional="true" mayBeNull="true"></param>
/// <param name="newStartingIndex" type="Number" integer="true" optional="true" mayBeNull="true"></param>
/// <param name="oldItems" optional="true" mayBeNull="true"></param>
/// <param name="oldStartingIndex" type="Number" integer="true" optional="true" mayBeNull="true"></param>
/// <field name="action" type="Sys.NotifyCollectionChangedAction" locid="F:J#Sys.CollectionChange.action"></field>
/// <field name="newItems" type="Array" mayBeNull="true" elementMayBeNull="true" locid="F:J#Sys.CollectionChange.newItems"></field>
/// <field name="newStartingIndex" type="Number" integer="true" locid="F:J#Sys.CollectionChange.newStartingIndex"></field>
/// <field name="oldItems" type="Array" mayBeNull="true" elementMayBeNull="true" locid="F:J#Sys.CollectionChange.oldItems"></field>
/// <field name="oldStartingIndex" type="Number" integer="true" locid="F:J#Sys.CollectionChange.oldStartingIndex"></field>
var e = Function._validateParams(arguments, [
{name: "action", type: Sys.NotifyCollectionChangedAction},
{name: "newItems", mayBeNull: true, optional: true},
{name: "newStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true},
{name: "oldItems", mayBeNull: true, optional: true},
{name: "oldStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true}
]);
if (e) throw e;
this.action = action;
if (newItems) {
if (!(newItems instanceof Array)) {
newItems = [newItems];
}
}
this.newItems = newItems || null;
if (typeof newStartingIndex !== "number") {
newStartingIndex = -1;
}
this.newStartingIndex = newStartingIndex;
if (oldItems) {
if (!(oldItems instanceof Array)) {
oldItems = [oldItems];
}
}
this.oldItems = oldItems || null;
if (typeof oldStartingIndex !== "number") {
oldStartingIndex = -1;
}
this.oldStartingIndex = oldStartingIndex;
}
Sys.CollectionChange.registerClass("Sys.CollectionChange");
Sys.NotifyCollectionChangedAction = function Sys$NotifyCollectionChangedAction() {
/// <summary locid="M:J#Sys.NotifyCollectionChangedAction.#ctor" />
/// <field name="add" type="Number" integer="true" static="true" locid="F:J#Sys.NotifyCollectionChangedAction.add"></field>
/// <field name="remove" type="Number" integer="true" static="true" locid="F:J#Sys.NotifyCollectionChangedAction.remove"></field>
/// <field name="reset" type="Number" integer="true" static="true" locid="F:J#Sys.NotifyCollectionChangedAction.reset"></field>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
Sys.NotifyCollectionChangedAction.prototype = {
add: 0,
remove: 1,
reset: 2
}
Sys.NotifyCollectionChangedAction.registerEnum('Sys.NotifyCollectionChangedAction');
Sys.NotifyCollectionChangedEventArgs = function Sys$NotifyCollectionChangedEventArgs(changes) {
/// <summary locid="M:J#Sys.NotifyCollectionChangedEventArgs.#ctor" />
/// <param name="changes" type="Array" elementType="Sys.CollectionChange"></param>
var e = Function._validateParams(arguments, [
{name: "changes", type: Array, elementType: Sys.CollectionChange}
]);
if (e) throw e;
this._changes = changes;
Sys.NotifyCollectionChangedEventArgs.initializeBase(this);
}
function Sys$NotifyCollectionChangedEventArgs$get_changes() {
/// <value type="Array" elementType="Sys.CollectionChange" locid="P:J#Sys.NotifyCollectionChangedEventArgs.changes"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._changes || [];
}
Sys.NotifyCollectionChangedEventArgs.prototype = {
get_changes: Sys$NotifyCollectionChangedEventArgs$get_changes
}
Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs", Sys.EventArgs);
Sys.Observer = function Sys$Observer() {
throw Error.invalidOperation();
}
Sys.Observer.registerClass("Sys.Observer");
Sys.Observer.makeObservable = function Sys$Observer$makeObservable(target) {
/// <summary locid="M:J#Sys.Observer.makeObservable" />
/// <param name="target" mayBeNull="false"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "target"}
]);
if (e) throw e;
var isArray = target instanceof Array,
o = Sys.Observer;
Sys.Observer._ensureObservable(target);
if (target.setValue === o._observeMethods.setValue) return target;
o._addMethods(target, o._observeMethods);
if (isArray) {
o._addMethods(target, o._arrayMethods);
}
return target;
}
Sys.Observer._ensureObservable = function Sys$Observer$_ensureObservable(target) {
var type = typeof target;
if ((type === "string") || (type === "number") || (type === "boolean") || (type === "date")) {
throw Error.invalidOperation(String.format(Sys.Res.notObservable, type));
}
}
Sys.Observer._addMethods = function Sys$Observer$_addMethods(target, methods) {
for (var m in methods) {
if (target[m] && (target[m] !== methods[m])) {
throw Error.invalidOperation(String.format(Sys.Res.observableConflict, m));
}
target[m] = methods[m];
}
}
Sys.Observer._addEventHandler = function Sys$Observer$_addEventHandler(target, eventName, handler) {
Sys.Observer._getContext(target, true).events._addHandler(eventName, handler);
}
Sys.Observer.addEventHandler = function Sys$Observer$addEventHandler(target, eventName, handler) {
/// <summary locid="M:J#Sys.Observer.addEventHandler" />
/// <param name="target"></param>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
Sys.Observer._addEventHandler(target, eventName, handler);
}
Sys.Observer._removeEventHandler = function Sys$Observer$_removeEventHandler(target, eventName, handler) {
Sys.Observer._getContext(target, true).events._removeHandler(eventName, handler);
}
Sys.Observer.removeEventHandler = function Sys$Observer$removeEventHandler(target, eventName, handler) {
/// <summary locid="M:J#Sys.Observer.removeEventHandler" />
/// <param name="target"></param>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
Sys.Observer._removeEventHandler(target, eventName, handler);
}
Sys.Observer.raiseEvent = function Sys$Observer$raiseEvent(target, eventName, eventArgs) {
/// <summary locid="M:J#Sys.Observer.raiseEvent" />
/// <param name="target"></param>
/// <param name="eventName" type="String"></param>
/// <param name="eventArgs" type="Sys.EventArgs"></param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "eventName", type: String},
{name: "eventArgs", type: Sys.EventArgs}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
var ctx = Sys.Observer._getContext(target);
if (!ctx) return;
var handler = ctx.events.getHandler(eventName);
if (handler) {
handler(target, eventArgs);
}
}
Sys.Observer.addPropertyChanged = function Sys$Observer$addPropertyChanged(target, handler) {
/// <summary locid="M:J#Sys.Observer.addPropertyChanged" />
/// <param name="target" mayBeNull="false"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
Sys.Observer._addEventHandler(target, "propertyChanged", handler);
}
Sys.Observer.removePropertyChanged = function Sys$Observer$removePropertyChanged(target, handler) {
/// <summary locid="M:J#Sys.Observer.removePropertyChanged" />
/// <param name="target" mayBeNull="false"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
Sys.Observer._removeEventHandler(target, "propertyChanged", handler);
}
Sys.Observer.beginUpdate = function Sys$Observer$beginUpdate(target) {
/// <summary locid="M:J#Sys.Observer.beginUpdate" />
/// <param name="target" mayBeNull="false"></param>
var e = Function._validateParams(arguments, [
{name: "target"}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
Sys.Observer._getContext(target, true).updating = true;
}
Sys.Observer.endUpdate = function Sys$Observer$endUpdate(target) {
/// <summary locid="M:J#Sys.Observer.endUpdate" />
/// <param name="target" mayBeNull="false"></param>
var e = Function._validateParams(arguments, [
{name: "target"}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
var ctx = Sys.Observer._getContext(target);
if (!ctx || !ctx.updating) return;
ctx.updating = false;
var dirty = ctx.dirty;
ctx.dirty = false;
if (dirty) {
if (target instanceof Array) {
var changes = ctx.changes;
ctx.changes = null;
Sys.Observer.raiseCollectionChanged(target, changes);
}
Sys.Observer.raisePropertyChanged(target, "");
}
}
Sys.Observer.isUpdating = function Sys$Observer$isUpdating(target) {
/// <summary locid="M:J#Sys.Observer.isUpdating" />
/// <param name="target" mayBeNull="false"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "target"}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
var ctx = Sys.Observer._getContext(target);
return ctx ? ctx.updating : false;
}
Sys.Observer._setValue = function Sys$Observer$_setValue(target, propertyName, value) {
var getter, setter, mainTarget = target, path = propertyName.split('.');
for (var i = 0, l = (path.length - 1); i < l ; i++) {
var name = path[i];
getter = target["get_" + name];
if (typeof (getter) === "function") {
target = getter.call(target);
}
else {
target = target[name];
}
var type = typeof (target);
if ((target === null) || (type === "undefined")) {
throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath, propertyName));
}
}
var currentValue, lastPath = path[l];
getter = target["get_" + lastPath];
setter = target["set_" + lastPath];
if (typeof(getter) === 'function') {
currentValue = getter.call(target);
}
else {
currentValue = target[lastPath];
}
if (typeof(setter) === 'function') {
setter.call(target, value);
}
else {
target[lastPath] = value;
}
if (currentValue !== value) {
var ctx = Sys.Observer._getContext(mainTarget);
if (ctx && ctx.updating) {
ctx.dirty = true;
return;
};
Sys.Observer.raisePropertyChanged(mainTarget, path[0]);
}
}
Sys.Observer.setValue = function Sys$Observer$setValue(target, propertyName, value) {
/// <summary locid="M:J#Sys.Observer.setValue" />
/// <param name="target" mayBeNull="false"></param>
/// <param name="propertyName" type="String"></param>
/// <param name="value" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "propertyName", type: String},
{name: "value", mayBeNull: true}
]);
if (e) throw e;
Sys.Observer._ensureObservable(target);
Sys.Observer._setValue(target, propertyName, value);
}
Sys.Observer.raisePropertyChanged = function Sys$Observer$raisePropertyChanged(target, propertyName) {
/// <summary locid="M:J#Sys.Observer.raisePropertyChanged" />
/// <param name="target" mayBeNull="false"></param>
/// <param name="propertyName" type="String"></param>
Sys.Observer.raiseEvent(target, "propertyChanged", new Sys.PropertyChangedEventArgs(propertyName));
}
Sys.Observer.addCollectionChanged = function Sys$Observer$addCollectionChanged(target, handler) {
/// <summary locid="M:J#Sys.Observer.addCollectionChanged" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._addEventHandler(target, "collectionChanged", handler);
}
Sys.Observer.removeCollectionChanged = function Sys$Observer$removeCollectionChanged(target, handler) {
/// <summary locid="M:J#Sys.Observer.removeCollectionChanged" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._removeEventHandler(target, "collectionChanged", handler);
}
Sys.Observer._collectionChange = function Sys$Observer$_collectionChange(target, change) {
var ctx = Sys.Observer._getContext(target);
if (ctx && ctx.updating) {
ctx.dirty = true;
var changes = ctx.changes;
if (!changes) {
ctx.changes = changes = [change];
}
else {
changes.push(change);
}
}
else {
Sys.Observer.raiseCollectionChanged(target, [change]);
Sys.Observer.raisePropertyChanged(target, 'length');
}
}
Sys.Observer.add = function Sys$Observer$add(target, item) {
/// <summary locid="M:J#Sys.Observer.add" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
/// <param name="item" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true},
{name: "item", mayBeNull: true}
]);
if (e) throw e;
var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], target.length);
Array.add(target, item);
Sys.Observer._collectionChange(target, change);
}
Sys.Observer.addRange = function Sys$Observer$addRange(target, items) {
/// <summary locid="M:J#Sys.Observer.addRange" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
/// <param name="items" type="Array" elementMayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true},
{name: "items", type: Array, elementMayBeNull: true}
]);
if (e) throw e;
var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, items, target.length);
Array.addRange(target, items);
Sys.Observer._collectionChange(target, change);
}
Sys.Observer.clear = function Sys$Observer$clear(target) {
/// <summary locid="M:J#Sys.Observer.clear" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true}
]);
if (e) throw e;
var oldItems = Array.clone(target);
Array.clear(target);
Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset, null, -1, oldItems, 0));
}
Sys.Observer.insert = function Sys$Observer$insert(target, index, item) {
/// <summary locid="M:J#Sys.Observer.insert" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
/// <param name="index" type="Number" integer="true"></param>
/// <param name="item" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true},
{name: "index", type: Number, integer: true},
{name: "item", mayBeNull: true}
]);
if (e) throw e;
Array.insert(target, index, item);
Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], index));
}
Sys.Observer.remove = function Sys$Observer$remove(target, item) {
/// <summary locid="M:J#Sys.Observer.remove" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
/// <param name="item" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true},
{name: "item", mayBeNull: true}
]);
if (e) throw e;
var index = Array.indexOf(target, item);
if (index !== -1) {
Array.remove(target, item);
Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index));
return true;
}
return false;
}
Sys.Observer.removeAt = function Sys$Observer$removeAt(target, index) {
/// <summary locid="M:J#Sys.Observer.removeAt" />
/// <param name="target" type="Array" elementMayBeNull="true"></param>
/// <param name="index" type="Number" integer="true"></param>
var e = Function._validateParams(arguments, [
{name: "target", type: Array, elementMayBeNull: true},
{name: "index", type: Number, integer: true}
]);
if (e) throw e;
if ((index > -1) && (index < target.length)) {
var item = target[index];
Array.removeAt(target, index);
Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index));
}
}
Sys.Observer.raiseCollectionChanged = function Sys$Observer$raiseCollectionChanged(target, changes) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="target"></param>
/// <param name="changes" type="Array" elementType="Sys.CollectionChange"></param>
Sys.Observer.raiseEvent(target, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes));
}
Sys.Observer._observeMethods = {
add_propertyChanged: function(handler) {
Sys.Observer._addEventHandler(this, "propertyChanged", handler);
},
remove_propertyChanged: function(handler) {
Sys.Observer._removeEventHandler(this, "propertyChanged", handler);
},
addEventHandler: function(eventName, handler) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._addEventHandler(this, eventName, handler);
},
removeEventHandler: function(eventName, handler) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._removeEventHandler(this, eventName, handler);
},
get_isUpdating: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <returns type="Boolean"></returns>
return Sys.Observer.isUpdating(this);
},
beginUpdate: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
Sys.Observer.beginUpdate(this);
},
endUpdate: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
Sys.Observer.endUpdate(this);
},
setValue: function(name, value) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="name" type="String"></param>
/// <param name="value" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "name", type: String},
{name: "value", mayBeNull: true}
]);
if (e) throw e;
Sys.Observer._setValue(this, name, value);
},
raiseEvent: function(eventName, eventArgs) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="eventName" type="String"></param>
/// <param name="eventArgs" type="Sys.EventArgs"></param>
Sys.Observer.raiseEvent(this, eventName, eventArgs);
},
raisePropertyChanged: function(name) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="name" type="String"></param>
Sys.Observer.raiseEvent(this, "propertyChanged", new Sys.PropertyChangedEventArgs(name));
}
}
Sys.Observer._arrayMethods = {
add_collectionChanged: function(handler) {
Sys.Observer._addEventHandler(this, "collectionChanged", handler);
},
remove_collectionChanged: function(handler) {
Sys.Observer._removeEventHandler(this, "collectionChanged", handler);
},
add: function(item) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="item" mayBeNull="true"></param>
Sys.Observer.add(this, item);
},
addRange: function(items) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="items" type="Array" elementMayBeNull="true"></param>
Sys.Observer.addRange(this, items);
},
clear: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
Sys.Observer.clear(this);
},
insert: function(index, item) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="index" type="Number" integer="true"></param>
/// <param name="item" mayBeNull="true"></param>
Sys.Observer.insert(this, index, item);
},
remove: function(item) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="item" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
return Sys.Observer.remove(this, item);
},
removeAt: function(index) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="index" type="Number" integer="true"></param>
Sys.Observer.removeAt(this, index);
},
raiseCollectionChanged: function(changes) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged" />
/// <param name="changes" type="Array" elementType="Sys.CollectionChange"></param>
Sys.Observer.raiseEvent(this, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes));
}
}
Sys.Observer._getContext = function Sys$Observer$_getContext(obj, create) {
var ctx = obj._observerContext;
if (ctx) return ctx();
if (create) {
return (obj._observerContext = Sys.Observer._createContext())();
}
return null;
}
Sys.Observer._createContext = function Sys$Observer$_createContext() {
var ctx = {
events: new Sys.EventHandlerList()
};
return function() {
return ctx;
}
}
Date._appendPreOrPostMatch = function Date$_appendPreOrPostMatch(preMatch, strBuilder) {
var quoteCount = 0;
var escaped = false;
for (var i = 0, il = preMatch.length; i < il; i++) {
var c = preMatch.charAt(i);
switch (c) {
case '\'':
if (escaped) strBuilder.append("'");
else quoteCount++;
escaped = false;
break;
case '\\':
if (escaped) strBuilder.append("\\");
escaped = !escaped;
break;
default:
strBuilder.append(c);
escaped = false;
break;
}
}
return quoteCount;
}
Date._expandFormat = function Date$_expandFormat(dtf, format) {
if (!format) {
format = "F";
}
var len = format.length;
if (len === 1) {
switch (format) {
case "d":
return dtf.ShortDatePattern;
case "D":
return dtf.LongDatePattern;
case "t":
return dtf.ShortTimePattern;
case "T":
return dtf.LongTimePattern;
case "f":
return dtf.LongDatePattern + " " + dtf.ShortTimePattern;
case "F":
return dtf.FullDateTimePattern;
case "M": case "m":
return dtf.MonthDayPattern;
case "s":
return dtf.SortableDateTimePattern;
case "Y": case "y":
return dtf.YearMonthPattern;
default:
throw Error.format(Sys.Res.formatInvalidString);
}
}
else if ((len === 2) && (format.charAt(0) === "%")) {
format = format.charAt(1);
}
return format;
}
Date._expandYear = function Date$_expandYear(dtf, year) {
var now = new Date(),
era = Date._getEra(now);
if (year < 100) {
var curr = Date._getEraYear(now, dtf, era);
year += curr - (curr % 100);
if (year > dtf.Calendar.TwoDigitYearMax) {
year -= 100;
}
}
return year;
}
Date._getEra = function Date$_getEra(date, eras) {
if (!eras) return 0;
var start, ticks = date.getTime();
for (var i = 0, l = eras.length; i < l; i += 4) {
start = eras[i+2];
if ((start === null) || (ticks >= start)) {
return i;
}
}
return 0;
}
Date._getEraYear = function Date$_getEraYear(date, dtf, era, sortable) {
var year = date.getFullYear();
if (!sortable && dtf.eras) {
year -= dtf.eras[era + 3];
}
return year;
}
Date._getParseRegExp = function Date$_getParseRegExp(dtf, format) {
if (!dtf._parseRegExp) {
dtf._parseRegExp = {};
}
else if (dtf._parseRegExp[format]) {
return dtf._parseRegExp[format];
}
var expFormat = Date._expandFormat(dtf, format);
expFormat = expFormat.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1");
var regexp = new Sys.StringBuilder("^");
var groups = [];
var index = 0;
var quoteCount = 0;
var tokenRegExp = Date._getTokenRegExp();
var match;
while ((match = tokenRegExp.exec(expFormat)) !== null) {
var preMatch = expFormat.slice(index, match.index);
index = tokenRegExp.lastIndex;
quoteCount += Date._appendPreOrPostMatch(preMatch, regexp);
if ((quoteCount%2) === 1) {
regexp.append(match[0]);
continue;
}
switch (match[0]) {
case 'dddd': case 'ddd':
case 'MMMM': case 'MMM':
case 'gg': case 'g':
regexp.append("(\\D+)");
break;
case 'tt': case 't':
regexp.append("(\\D*)");
break;
case 'yyyy':
regexp.append("(\\d{4})");
break;
case 'fff':
regexp.append("(\\d{3})");
break;
case 'ff':
regexp.append("(\\d{2})");
break;
case 'f':
regexp.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':
regexp.append("(\\d\\d?)");
break;
case 'zzz':
regexp.append("([+-]?\\d\\d?:\\d{2})");
break;
case 'zz': case 'z':
regexp.append("([+-]?\\d\\d?)");
break;
case '/':
regexp.append("(\\" + dtf.DateSeparator + ")");
break;
default:
Sys.Debug.fail("Invalid date format pattern");
}
Array.add(groups, match[0]);
}
Date._appendPreOrPostMatch(expFormat.slice(index), regexp);
regexp.append("$");
var regexpStr = regexp.toString().replace(/\s+/g, "\\s+");
var parseRegExp = {'regExp': regexpStr, 'groups': groups};
dtf._parseRegExp[format] = parseRegExp;
return parseRegExp;
}
Date._getTokenRegExp = function Date$_getTokenRegExp() {
return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g;
}
Date.parseLocale = function Date$parseLocale(value, formats) {
/// <summary locid="M:J#Date.parseLocale" />
/// <param name="value" type="String"></param>
/// <param name="formats" parameterArray="true" optional="true" mayBeNull="true"></param>
/// <returns type="Date"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String},
{name: "formats", mayBeNull: true, optional: true, parameterArray: true}
]);
if (e) throw e;
return Date._parse(value, Sys.CultureInfo.CurrentCulture, arguments);
}
Date.parseInvariant = function Date$parseInvariant(value, formats) {
/// <summary locid="M:J#Date.parseInvariant" />
/// <param name="value" type="String"></param>
/// <param name="formats" parameterArray="true" optional="true" mayBeNull="true"></param>
/// <returns type="Date"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String},
{name: "formats", mayBeNull: true, optional: true, parameterArray: true}
]);
if (e) throw e;
return Date._parse(value, Sys.CultureInfo.InvariantCulture, arguments);
}
Date._parse = function Date$_parse(value, cultureInfo, args) {
var i, l, date, format, formats, custom = false;
for (i = 1, l = args.length; i < l; i++) {
format = args[i];
if (format) {
custom = true;
date = Date._parseExact(value, format, cultureInfo);
if (date) return date;
}
}
if (! custom) {
formats = cultureInfo._getDateTimeFormats();
for (i = 0, l = formats.length; i < l; i++) {
date = Date._parseExact(value, formats[i], cultureInfo);
if (date) return date;
}
}
return null;
}
Date._parseExact = function Date$_parseExact(value, format, cultureInfo) {
value = value.trim();
var dtf = cultureInfo.dateTimeFormat,
parseInfo = Date._getParseRegExp(dtf, format),
match = new RegExp(parseInfo.regExp).exec(value);
if (match === null) return null;
var groups = parseInfo.groups,
era = null, year = null, month = null, date = null, weekDay = null,
hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null,
pmHour = false;
for (var j = 0, jl = groups.length; j < jl; j++) {
var matchGroup = match[j+1];
if (matchGroup) {
switch (groups[j]) {
case 'dd': case 'd':
date = parseInt(matchGroup, 10);
if ((date < 1) || (date > 31)) return null;
break;
case 'MMMM':
month = cultureInfo._getMonthIndex(matchGroup);
if ((month < 0) || (month > 11)) return null;
break;
case 'MMM':
month = cultureInfo._getAbbrMonthIndex(matchGroup);
if ((month < 0) || (month > 11)) return null;
break;
case 'M': case 'MM':
month = parseInt(matchGroup, 10) - 1;
if ((month < 0) || (month > 11)) return null;
break;
case 'y': case 'yy':
year = Date._expandYear(dtf,parseInt(matchGroup, 10));
if ((year < 0) || (year > 9999)) return null;
break;
case 'yyyy':
year = parseInt(matchGroup, 10);
if ((year < 0) || (year > 9999)) return null;
break;
case 'h': case 'hh':
hour = parseInt(matchGroup, 10);
if (hour === 12) hour = 0;
if ((hour < 0) || (hour > 11)) return null;
break;
case 'H': case 'HH':
hour = parseInt(matchGroup, 10);
if ((hour < 0) || (hour > 23)) return null;
break;
case 'm': case 'mm':
min = parseInt(matchGroup, 10);
if ((min < 0) || (min > 59)) return null;
break;
case 's': case 'ss':
sec = parseInt(matchGroup, 10);
if ((sec < 0) || (sec > 59)) return null;
break;
case 'tt': case 't':
var upperToken = matchGroup.toUpperCase();
pmHour = (upperToken === dtf.PMDesignator.toUpperCase());
if (!pmHour && (upperToken !== dtf.AMDesignator.toUpperCase())) return null;
break;
case 'f':
msec = parseInt(matchGroup, 10) * 100;
if ((msec < 0) || (msec > 999)) return null;
break;
case 'ff':
msec = parseInt(matchGroup, 10) * 10;
if ((msec < 0) || (msec > 999)) return null;
break;
case 'fff':
msec = parseInt(matchGroup, 10);
if ((msec < 0) || (msec > 999)) return null;
break;
case 'dddd':
weekDay = cultureInfo._getDayIndex(matchGroup);
if ((weekDay < 0) || (weekDay > 6)) return null;
break;
case 'ddd':
weekDay = cultureInfo._getAbbrDayIndex(matchGroup);
if ((weekDay < 0) || (weekDay > 6)) return null;
break;
case 'zzz':
var offsets = matchGroup.split(/:/);
if (offsets.length !== 2) return null;
hourOffset = parseInt(offsets[0], 10);
if ((hourOffset < -12) || (hourOffset > 13)) return null;
var minOffset = parseInt(offsets[1], 10);
if ((minOffset < 0) || (minOffset > 59)) return null;
tzMinOffset = (hourOffset * 60) + (matchGroup.startsWith('-')? -minOffset : minOffset);
break;
case 'z': case 'zz':
hourOffset = parseInt(matchGroup, 10);
if ((hourOffset < -12) || (hourOffset > 13)) return null;
tzMinOffset = hourOffset * 60;
break;
case 'g': case 'gg':
var eraName = matchGroup;
if (!eraName || !dtf.eras) return null;
eraName = eraName.toLowerCase().trim();
for (var i = 0, l = dtf.eras.length; i < l; i += 4) {
if (eraName === dtf.eras[i + 1].toLowerCase()) {
era = i;
break;
}
}
if (era === null) return null;
break;
}
}
}
var result = new Date(), defaults, convert = dtf.Calendar.convert;
if (convert) {
defaults = convert.fromGregorian(result);
}
if (!convert) {
defaults = [result.getFullYear(), result.getMonth(), result.getDate()];
}
if (year === null) {
year = defaults[0];
}
else if (dtf.eras) {
year += dtf.eras[(era || 0) + 3];
}
if (month === null) {
month = defaults[1];
}
if (date === null) {
date = defaults[2];
}
if (convert) {
result = convert.toGregorian(year, month, date);
if (result === null) return null;
}
else {
result.setFullYear(year, month, date);
if (result.getDate() !== date) return null;
if ((weekDay !== null) && (result.getDay() !== weekDay)) {
return null;
}
}
if (pmHour && (hour < 12)) {
hour += 12;
}
result.setHours(hour, min, sec, msec);
if (tzMinOffset !== null) {
var adjustedMin = result.getMinutes() - (tzMinOffset + result.getTimezoneOffset());
result.setHours(result.getHours() + parseInt(adjustedMin/60, 10), adjustedMin%60);
}
return result;
}
Date.prototype.format = function Date$format(format) {
/// <summary locid="M:J#Date.format" />
/// <param name="format" type="String"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture);
}
Date.prototype.localeFormat = function Date$localeFormat(format) {
/// <summary locid="M:J#Date.localeFormat" />
/// <param name="format" type="String"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture);
}
Date.prototype._toFormattedString = function Date$_toFormattedString(format, cultureInfo) {
var dtf = cultureInfo.dateTimeFormat,
convert = dtf.Calendar.convert;
if (!format || !format.length || (format === 'i')) {
if (cultureInfo && cultureInfo.name.length) {
if (convert) {
return this._toFormattedString(dtf.FullDateTimePattern, cultureInfo);
}
else {
var eraDate = new Date(this.getTime());
var era = Date._getEra(this, dtf.eras);
eraDate.setFullYear(Date._getEraYear(this, dtf, era));
return eraDate.toLocaleString();
}
}
else {
return this.toString();
}
}
var eras = dtf.eras,
sortable = (format === "s");
format = Date._expandFormat(dtf, format);
var ret = new Sys.StringBuilder();
var hour;
function addLeadingZero(num) {
if (num < 10) {
return '0' + num;
}
return num.toString();
}
function addLeadingZeros(num) {
if (num < 10) {
return '00' + num;
}
if (num < 100) {
return '0' + num;
}
return num.toString();
}
function padYear(year) {
if (year < 10) {
return '000' + year;
}
else if (year < 100) {
return '00' + year;
}
else if (year < 1000) {
return '0' + year;
}
return year.toString();
}
var foundDay, checkedDay, dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g;
function hasDay() {
if (foundDay || checkedDay) {
return foundDay;
}
foundDay = dayPartRegExp.test(format);
checkedDay = true;
return foundDay;
}
var quoteCount = 0,
tokenRegExp = Date._getTokenRegExp(),
converted;
if (!sortable && convert) {
converted = convert.fromGregorian(this);
}
for (;;) {
var index = tokenRegExp.lastIndex;
var ar = tokenRegExp.exec(format);
var preMatch = format.slice(index, ar ? ar.index : format.length);
quoteCount += Date._appendPreOrPostMatch(preMatch, ret);
if (!ar) break;
if ((quoteCount%2) === 1) {
ret.append(ar[0]);
continue;
}
function getPart(date, part) {
if (converted) {
return converted[part];
}
switch (part) {
case 0: return date.getFullYear();
case 1: return date.getMonth();
case 2: return date.getDate();
}
}
switch (ar[0]) {
case "dddd":
ret.append(dtf.DayNames[this.getDay()]);
break;
case "ddd":
ret.append(dtf.AbbreviatedDayNames[this.getDay()]);
break;
case "dd":
foundDay = true;
ret.append(addLeadingZero(getPart(this, 2)));
break;
case "d":
foundDay = true;
ret.append(getPart(this, 2));
break;
case "MMMM":
ret.append((dtf.MonthGenitiveNames && hasDay())
? dtf.MonthGenitiveNames[getPart(this, 1)]
: dtf.MonthNames[getPart(this, 1)]);
break;
case "MMM":
ret.append((dtf.AbbreviatedMonthGenitiveNames && hasDay())
? dtf.AbbreviatedMonthGenitiveNames[getPart(this, 1)]
: dtf.AbbreviatedMonthNames[getPart(this, 1)]);
break;
case "MM":
ret.append(addLeadingZero(getPart(this, 1) + 1));
break;
case "M":
ret.append(getPart(this, 1) + 1);
break;
case "yyyy":
ret.append(padYear(converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)));
break;
case "yy":
ret.append(addLeadingZero((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100));
break;
case "y":
ret.append((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100);
break;
case "hh":
hour = this.getHours() % 12;
if (hour === 0) hour = 12;
ret.append(addLeadingZero(hour));
break;
case "h":
hour = this.getHours() % 12;
if (hour === 0) hour = 12;
ret.append(hour);
break;
case "HH":
ret.append(addLeadingZero(this.getHours()));
break;
case "H":
ret.append(this.getHours());
break;
case "mm":
ret.append(addLeadingZero(this.getMinutes()));
break;
case "m":
ret.append(this.getMinutes());
break;
case "ss":
ret.append(addLeadingZero(this.getSeconds()));
break;
case "s":
ret.append(this.getSeconds());
break;
case "tt":
ret.append((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator);
break;
case "t":
ret.append(((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator).charAt(0));
break;
case "f":
ret.append(addLeadingZeros(this.getMilliseconds()).charAt(0));
break;
case "ff":
ret.append(addLeadingZeros(this.getMilliseconds()).substr(0, 2));
break;
case "fff":
ret.append(addLeadingZeros(this.getMilliseconds()));
break;
case "z":
hour = this.getTimezoneOffset() / 60;
ret.append(((hour <= 0) ? '+' : '-') + Math.floor(Math.abs(hour)));
break;
case "zz":
hour = this.getTimezoneOffset() / 60;
ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour))));
break;
case "zzz":
hour = this.getTimezoneOffset() / 60;
ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour))) +
":" + addLeadingZero(Math.abs(this.getTimezoneOffset() % 60)));
break;
case "g":
case "gg":
if (dtf.eras) {
ret.append(dtf.eras[Date._getEra(this, eras) + 1]);
}
break;
case "/":
ret.append(dtf.DateSeparator);
break;
default:
Sys.Debug.fail("Invalid date format pattern");
}
}
return ret.toString();
}
String.localeFormat = function String$localeFormat(format, args) {
/// <summary locid="M:J#String.localeFormat" />
/// <param name="format" type="String"></param>
/// <param name="args" parameterArray="true" mayBeNull="true"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String},
{name: "args", mayBeNull: true, parameterArray: true}
]);
if (e) throw e;
return String._toFormattedString(true, arguments);
}
Number.parseLocale = function Number$parseLocale(value) {
/// <summary locid="M:J#Number.parseLocale" />
/// <param name="value" type="String"></param>
/// <returns type="Number"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String}
], false);
if (e) throw e;
return Number._parse(value, Sys.CultureInfo.CurrentCulture);
}
Number.parseInvariant = function Number$parseInvariant(value) {
/// <summary locid="M:J#Number.parseInvariant" />
/// <param name="value" type="String"></param>
/// <returns type="Number"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String}
], false);
if (e) throw e;
return Number._parse(value, Sys.CultureInfo.InvariantCulture);
}
Number._parse = function Number$_parse(value, cultureInfo) {
value = value.trim();
if (value.match(/^[+-]?infinity$/i)) {
return parseFloat(value);
}
if (value.match(/^0x[a-f0-9]+$/i)) {
return parseInt(value);
}
var numFormat = cultureInfo.numberFormat;
var signInfo = Number._parseNumberNegativePattern(value, numFormat, numFormat.NumberNegativePattern);
var sign = signInfo[0];
var num = signInfo[1];
if ((sign === '') && (numFormat.NumberNegativePattern !== 1)) {
signInfo = Number._parseNumberNegativePattern(value, numFormat, 1);
sign = signInfo[0];
num = signInfo[1];
}
if (sign === '') sign = '+';
var exponent;
var intAndFraction;
var exponentPos = num.indexOf('e');
if (exponentPos < 0) exponentPos = num.indexOf('E');
if (exponentPos < 0) {
intAndFraction = num;
exponent = null;
}
else {
intAndFraction = num.substr(0, exponentPos);
exponent = num.substr(exponentPos + 1);
}
var integer;
var fraction;
var decimalPos = intAndFraction.indexOf(numFormat.NumberDecimalSeparator);
if (decimalPos < 0) {
integer = intAndFraction;
fraction = null;
}
else {
integer = intAndFraction.substr(0, decimalPos);
fraction = intAndFraction.substr(decimalPos + numFormat.NumberDecimalSeparator.length);
}
integer = integer.split(numFormat.NumberGroupSeparator).join('');
var altNumGroupSeparator = numFormat.NumberGroupSeparator.replace(/\u00A0/g, " ");
if (numFormat.NumberGroupSeparator !== altNumGroupSeparator) {
integer = integer.split(altNumGroupSeparator).join('');
}
var p = sign + integer;
if (fraction !== null) {
p += '.' + fraction;
}
if (exponent !== null) {
var expSignInfo = Number._parseNumberNegativePattern(exponent, numFormat, 1);
if (expSignInfo[0] === '') {
expSignInfo[0] = '+';
}
p += 'e' + expSignInfo[0] + expSignInfo[1];
}
if (p.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)) {
return parseFloat(p);
}
return Number.NaN;
}
Number._parseNumberNegativePattern = function Number$_parseNumberNegativePattern(value, numFormat, numberNegativePattern) {
var neg = numFormat.NegativeSign;
var pos = numFormat.PositiveSign;
switch (numberNegativePattern) {
case 4:
neg = ' ' + neg;
pos = ' ' + pos;
case 3:
if (value.endsWith(neg)) {
return ['-', value.substr(0, value.length - neg.length)];
}
else if (value.endsWith(pos)) {
return ['+', value.substr(0, value.length - pos.length)];
}
break;
case 2:
neg += ' ';
pos += ' ';
case 1:
if (value.startsWith(neg)) {
return ['-', value.substr(neg.length)];
}
else if (value.startsWith(pos)) {
return ['+', value.substr(pos.length)];
}
break;
case 0:
if (value.startsWith('(') && value.endsWith(')')) {
return ['-', value.substr(1, value.length - 2)];
}
break;
default:
Sys.Debug.fail("");
}
return ['', value];
}
Number.prototype.format = function Number$format(format) {
/// <summary locid="M:J#Number.format" />
/// <param name="format" type="String"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture);
}
Number.prototype.localeFormat = function Number$localeFormat(format) {
/// <summary locid="M:J#Number.localeFormat" />
/// <param name="format" type="String"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture);
}
Number.prototype._toFormattedString = function Number$_toFormattedString(format, cultureInfo) {
if (!format || (format.length === 0) || (format === 'i')) {
if (cultureInfo && (cultureInfo.name.length > 0)) {
return this.toLocaleString();
}
else {
return this.toString();
}
}
var _percentPositivePattern = ["n %", "n%", "%n" ];
var _percentNegativePattern = ["-n %", "-n%", "-%n"];
var _numberNegativePattern = ["(n)","-n","- n","n-","n -"];
var _currencyPositivePattern = ["$n","n$","$ n","n $"];
var _currencyNegativePattern = ["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];
function zeroPad(str, count, left) {
for (var l=str.length; l < count; l++) {
str = (left ? ('0' + str) : (str + '0'));
}
return str;
}
function expandNumber(number, precision, groupSizes, sep, decimalChar) {
Sys.Debug.assert(groupSizes.length > 0, "groupSizes must be an array of at least 1");
var curSize = groupSizes[0];
var curGroupIndex = 1;
var factor = Math.pow(10, precision);
var rounded = (Math.round(number * factor) / factor);
if (!isFinite(rounded)) {
rounded = number;
}
number = rounded;
var numberString = number.toString();
var right = "";
var exponent;
var split = numberString.split(/e/i);
numberString = split[0];
exponent = (split.length > 1 ? parseInt(split[1]) : 0);
split = numberString.split('.');
numberString = split[0];
right = split.length > 1 ? split[1] : "";
var l;
if (exponent > 0) {
right = zeroPad(right, exponent, false);
numberString += right.slice(0, exponent);
right = right.substr(exponent);
}
else if (exponent < 0) {
exponent = -exponent;
numberString = zeroPad(numberString, exponent+1, true);
right = numberString.slice(-exponent, numberString.length) + right;
numberString = numberString.slice(0, -exponent);
}
if (precision > 0) {
if (right.length > precision) {
right = right.slice(0, precision);
}
else {
right = zeroPad(right, precision, false);
}
right = decimalChar + right;
}
else {
right = "";
}
var stringIndex = numberString.length-1;
var ret = "";
while (stringIndex >= 0) {
if (curSize === 0 || curSize > stringIndex) {
if (ret.length > 0)
return numberString.slice(0, stringIndex + 1) + sep + ret + right;
else
return numberString.slice(0, stringIndex + 1) + right;
}
if (ret.length > 0)
ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1) + sep + ret;
else
ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1);
stringIndex -= curSize;
if (curGroupIndex < groupSizes.length) {
curSize = groupSizes[curGroupIndex];
curGroupIndex++;
}
}
return numberString.slice(0, stringIndex + 1) + sep + ret + right;
}
var nf = cultureInfo.numberFormat;
var number = Math.abs(this);
if (!format)
format = "D";
var precision = -1;
if (format.length > 1) precision = parseInt(format.slice(1), 10);
var pattern;
switch (format.charAt(0)) {
case "d":
case "D":
pattern = 'n';
if (precision !== -1) {
number = zeroPad(""+number, precision, true);
}
if (this < 0) number = -number;
break;
case "c":
case "C":
if (this < 0) pattern = _currencyNegativePattern[nf.CurrencyNegativePattern];
else pattern = _currencyPositivePattern[nf.CurrencyPositivePattern];
if (precision === -1) precision = nf.CurrencyDecimalDigits;
number = expandNumber(Math.abs(this), precision, nf.CurrencyGroupSizes, nf.CurrencyGroupSeparator, nf.CurrencyDecimalSeparator);
break;
case "n":
case "N":
if (this < 0) pattern = _numberNegativePattern[nf.NumberNegativePattern];
else pattern = 'n';
if (precision === -1) precision = nf.NumberDecimalDigits;
number = expandNumber(Math.abs(this), precision, nf.NumberGroupSizes, nf.NumberGroupSeparator, nf.NumberDecimalSeparator);
break;
case "p":
case "P":
if (this < 0) pattern = _percentNegativePattern[nf.PercentNegativePattern];
else pattern = _percentPositivePattern[nf.PercentPositivePattern];
if (precision === -1) precision = nf.PercentDecimalDigits;
number = expandNumber(Math.abs(this) * 100, precision, nf.PercentGroupSizes, nf.PercentGroupSeparator, nf.PercentDecimalSeparator);
break;
default:
throw Error.format(Sys.Res.formatBadFormatSpecifier);
}
var regex = /n|\$|-|%/g;
var ret = "";
for (;;) {
var index = regex.lastIndex;
var ar = regex.exec(pattern);
ret += pattern.slice(index, ar ? ar.index : pattern.length);
if (!ar)
break;
switch (ar[0]) {
case "n":
ret += number;
break;
case "$":
ret += nf.CurrencySymbol;
break;
case "-":
if (/[1-9]/.test(number)) {
ret += nf.NegativeSign;
}
break;
case "%":
ret += nf.PercentSymbol;
break;
default:
Sys.Debug.fail("Invalid number format pattern");
}
}
return ret;
}
Sys.CultureInfo = function Sys$CultureInfo(name, numberFormat, dateTimeFormat) {
/// <summary locid="M:J#Sys.CultureInfo.#ctor" />
/// <param name="name" type="String"></param>
/// <param name="numberFormat" type="Object"></param>
/// <param name="dateTimeFormat" type="Object"></param>
var e = Function._validateParams(arguments, [
{name: "name", type: String},
{name: "numberFormat", type: Object},
{name: "dateTimeFormat", type: Object}
]);
if (e) throw e;
this.name = name;
this.numberFormat = numberFormat;
this.dateTimeFormat = dateTimeFormat;
}
function Sys$CultureInfo$_getDateTimeFormats() {
if (! this._dateTimeFormats) {
var dtf = this.dateTimeFormat;
this._dateTimeFormats =
[ dtf.MonthDayPattern,
dtf.YearMonthPattern,
dtf.ShortDatePattern,
dtf.ShortTimePattern,
dtf.LongDatePattern,
dtf.LongTimePattern,
dtf.FullDateTimePattern,
dtf.RFC1123Pattern,
dtf.SortableDateTimePattern,
dtf.UniversalSortableDateTimePattern ];
}
return this._dateTimeFormats;
}
function Sys$CultureInfo$_getIndex(value, a1, a2) {
var upper = this._toUpper(value),
i = Array.indexOf(a1, upper);
if (i === -1) {
i = Array.indexOf(a2, upper);
}
return i;
}
function Sys$CultureInfo$_getMonthIndex(value) {
if (!this._upperMonths) {
this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames);
this._upperMonthsGenitive = this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames);
}
return this._getIndex(value, this._upperMonths, this._upperMonthsGenitive);
}
function Sys$CultureInfo$_getAbbrMonthIndex(value) {
if (!this._upperAbbrMonths) {
this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
this._upperAbbrMonthsGenitive = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames);
}
return this._getIndex(value, this._upperAbbrMonths, this._upperAbbrMonthsGenitive);
}
function Sys$CultureInfo$_getDayIndex(value) {
if (!this._upperDays) {
this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames);
}
return Array.indexOf(this._upperDays, this._toUpper(value));
}
function Sys$CultureInfo$_getAbbrDayIndex(value) {
if (!this._upperAbbrDays) {
this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);
}
return Array.indexOf(this._upperAbbrDays, this._toUpper(value));
}
function Sys$CultureInfo$_toUpperArray(arr) {
var result = [];
for (var i = 0, il = arr.length; i < il; i++) {
result[i] = this._toUpper(arr[i]);
}
return result;
}
function Sys$CultureInfo$_toUpper(value) {
return value.split("\u00A0").join(' ').toUpperCase();
}
Sys.CultureInfo.prototype = {
_getDateTimeFormats: Sys$CultureInfo$_getDateTimeFormats,
_getIndex: Sys$CultureInfo$_getIndex,
_getMonthIndex: Sys$CultureInfo$_getMonthIndex,
_getAbbrMonthIndex: Sys$CultureInfo$_getAbbrMonthIndex,
_getDayIndex: Sys$CultureInfo$_getDayIndex,
_getAbbrDayIndex: Sys$CultureInfo$_getAbbrDayIndex,
_toUpperArray: Sys$CultureInfo$_toUpperArray,
_toUpper: Sys$CultureInfo$_toUpper
}
Sys.CultureInfo.registerClass('Sys.CultureInfo');
Sys.CultureInfo._parse = function Sys$CultureInfo$_parse(value) {
var dtf = value.dateTimeFormat;
if (dtf && !dtf.eras) {
dtf.eras = value.eras;
}
return new Sys.CultureInfo(value.name, value.numberFormat, dtf);
}
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",""]},"eras":[1,"A.D.",null,0]});
if (typeof(__cultureInfo) === "object") {
Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo);
delete __cultureInfo;
}
else {
Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse({"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",""]},"eras":[1,"A.D.",null,0]});
}
Type.registerNamespace('Sys.Serialization');
Sys.Serialization.JavaScriptSerializer = function Sys$Serialization$JavaScriptSerializer() {
/// <summary locid="M:J#Sys.Serialization.JavaScriptSerializer.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
}
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 Sys$Serialization$JavaScriptSerializer$_init() {
var replaceChars = ['\\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 i = 0; i < 32; i++) {
var c = String.fromCharCode(i);
Sys.Serialization.JavaScriptSerializer._charsToEscape[i+2] = c;
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c] = new RegExp(c, 'g');
Sys.Serialization.JavaScriptSerializer._escapeChars[c] = replaceChars[i];
}
}
Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeBooleanWithBuilder(object, stringBuilder) {
stringBuilder.append(object.toString());
}
Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeNumberWithBuilder(object, stringBuilder) {
if (isFinite(object)) {
stringBuilder.append(String(object));
}
else {
throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers);
}
}
Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(string, stringBuilder) {
stringBuilder.append('"');
if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(string)) {
if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0) {
Sys.Serialization.JavaScriptSerializer._init();
}
if (string.length < 128) {
string = string.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal,
function(x) { return Sys.Serialization.JavaScriptSerializer._escapeChars[x]; });
}
else {
for (var i = 0; i < 34; i++) {
var c = Sys.Serialization.JavaScriptSerializer._charsToEscape[i];
if (string.indexOf(c) !== -1) {
if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox) {
string = string.split(c).join(Sys.Serialization.JavaScriptSerializer._escapeChars[c]);
}
else {
string = string.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c],
Sys.Serialization.JavaScriptSerializer._escapeChars[c]);
}
}
}
}
}
stringBuilder.append(string);
stringBuilder.append('"');
}
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeWithBuilder(object, stringBuilder, sort, prevObjects) {
var i;
switch (typeof object) {
case 'object':
if (object) {
if (prevObjects){
for( var j = 0; j < prevObjects.length; j++) {
if (prevObjects[j] === object) {
throw Error.invalidOperation(Sys.Res.cannotSerializeObjectWithCycle);
}
}
}
else {
prevObjects = new Array();
}
try {
Array.add(prevObjects, object);
if (Number.isInstanceOfType(object)){
Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(object, stringBuilder);
}
else if (Boolean.isInstanceOfType(object)){
Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(object, stringBuilder);
}
else if (String.isInstanceOfType(object)){
Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(object, stringBuilder);
}
else if (Array.isInstanceOfType(object)) {
stringBuilder.append('[');
for (i = 0; i < object.length; ++i) {
if (i > 0) {
stringBuilder.append(',');
}
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object[i], stringBuilder,false,prevObjects);
}
stringBuilder.append(']');
}
else {
if (Date.isInstanceOfType(object)) {
stringBuilder.append('"\\/Date(');
stringBuilder.append(object.getTime());
stringBuilder.append(')\\/"');
break;
}
var properties = [];
var propertyCount = 0;
for (var name in object) {
if (name.startsWith('$')) {
continue;
}
if (name === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && propertyCount !== 0){
properties[propertyCount++] = properties[0];
properties[0] = name;
}
else{
properties[propertyCount++] = name;
}
}
if (sort) properties.sort();
stringBuilder.append('{');
var needComma = false;
for (i=0; i<propertyCount; i++) {
var value = object[properties[i]];
if (typeof value !== 'undefined' && typeof value !== 'function') {
if (needComma) {
stringBuilder.append(',');
}
else {
needComma = true;
}
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(properties[i], stringBuilder, sort, prevObjects);
stringBuilder.append(':');
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(value, stringBuilder, sort, prevObjects);
}
}
stringBuilder.append('}');
}
}
finally {
Array.removeAt(prevObjects, prevObjects.length - 1);
}
}
else {
stringBuilder.append('null');
}
break;
case 'number':
Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(object, stringBuilder);
break;
case 'string':
Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(object, stringBuilder);
break;
case 'boolean':
Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(object, stringBuilder);
break;
default:
stringBuilder.append('null');
break;
}
}
Sys.Serialization.JavaScriptSerializer.serialize = function Sys$Serialization$JavaScriptSerializer$serialize(object) {
/// <summary locid="M:J#Sys.Serialization.JavaScriptSerializer.serialize" />
/// <param name="object" mayBeNull="true"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "object", mayBeNull: true}
]);
if (e) throw e;
var stringBuilder = new Sys.StringBuilder();
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object, stringBuilder, false);
return stringBuilder.toString();
}
Sys.Serialization.JavaScriptSerializer.deserialize = function Sys$Serialization$JavaScriptSerializer$deserialize(data, secure) {
/// <summary locid="M:J#Sys.Serialization.JavaScriptSerializer.deserialize" />
/// <param name="data" type="String"></param>
/// <param name="secure" type="Boolean" optional="true"></param>
/// <returns></returns>
var e = Function._validateParams(arguments, [
{name: "data", type: String},
{name: "secure", type: Boolean, optional: true}
]);
if (e) throw e;
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 (e) {
throw Error.argument('data', Sys.Res.cannotDeserializeInvalidJson);
}
}
Type.registerNamespace('Sys.UI');
Sys.EventHandlerList = function Sys$EventHandlerList() {
/// <summary locid="M:J#Sys.EventHandlerList.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
this._list = {};
}
function Sys$EventHandlerList$_addHandler(id, handler) {
Array.add(this._getEvent(id, true), handler);
}
function Sys$EventHandlerList$addHandler(id, handler) {
/// <summary locid="M:J#Sys.EventHandlerList.addHandler" />
/// <param name="id" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
this._addHandler(id, handler);
}
function Sys$EventHandlerList$_removeHandler(id, handler) {
var evt = this._getEvent(id);
if (!evt) return;
Array.remove(evt, handler);
}
function Sys$EventHandlerList$removeHandler(id, handler) {
/// <summary locid="M:J#Sys.EventHandlerList.removeHandler" />
/// <param name="id" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
this._removeHandler(id, handler);
}
function Sys$EventHandlerList$getHandler(id) {
/// <summary locid="M:J#Sys.EventHandlerList.getHandler" />
/// <param name="id" type="String"></param>
/// <returns type="Function"></returns>
var e = Function._validateParams(arguments, [
{name: "id", type: String}
]);
if (e) throw e;
var evt = this._getEvent(id);
if (!evt || (evt.length === 0)) return null;
evt = Array.clone(evt);
return function(source, args) {
for (var i = 0, l = evt.length; i < l; i++) {
evt[i](source, args);
}
};
}
function Sys$EventHandlerList$_getEvent(id, create) {
if (!this._list[id]) {
if (!create) return null;
this._list[id] = [];
}
return this._list[id];
}
Sys.EventHandlerList.prototype = {
_addHandler: Sys$EventHandlerList$_addHandler,
addHandler: Sys$EventHandlerList$addHandler,
_removeHandler: Sys$EventHandlerList$_removeHandler,
removeHandler: Sys$EventHandlerList$removeHandler,
getHandler: Sys$EventHandlerList$getHandler,
_getEvent: Sys$EventHandlerList$_getEvent
}
Sys.EventHandlerList.registerClass('Sys.EventHandlerList');
Sys.CommandEventArgs = function Sys$CommandEventArgs(commandName, commandArgument, commandSource) {
/// <summary locid="M:J#Sys.CommandEventArgs.#ctor" />
/// <param name="commandName" type="String"></param>
/// <param name="commandArgument" mayBeNull="true"></param>
/// <param name="commandSource" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "commandName", type: String},
{name: "commandArgument", mayBeNull: true},
{name: "commandSource", mayBeNull: true}
]);
if (e) throw e;
Sys.CommandEventArgs.initializeBase(this);
this._commandName = commandName;
this._commandArgument = commandArgument;
this._commandSource = commandSource;
}
function Sys$CommandEventArgs$get_commandName() {
/// <value type="String" locid="P:J#Sys.CommandEventArgs.commandName"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._commandName;
}
function Sys$CommandEventArgs$get_commandArgument() {
/// <value mayBeNull="true" locid="P:J#Sys.CommandEventArgs.commandArgument"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._commandArgument;
}
function Sys$CommandEventArgs$get_commandSource() {
/// <value mayBeNull="true" locid="P:J#Sys.CommandEventArgs.commandSource"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._commandSource;
}
Sys.CommandEventArgs.prototype = {
_commandName: null,
_commandArgument: null,
_commandSource: null,
get_commandName: Sys$CommandEventArgs$get_commandName,
get_commandArgument: Sys$CommandEventArgs$get_commandArgument,
get_commandSource: Sys$CommandEventArgs$get_commandSource
}
Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs);
Sys.INotifyPropertyChange = function Sys$INotifyPropertyChange() {
/// <summary locid="M:J#Sys.INotifyPropertyChange.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$INotifyPropertyChange$add_propertyChanged(handler) {
/// <summary locid="E:J#Sys.INotifyPropertyChange.propertyChanged" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
throw Error.notImplemented();
}
function Sys$INotifyPropertyChange$remove_propertyChanged(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
throw Error.notImplemented();
}
Sys.INotifyPropertyChange.prototype = {
add_propertyChanged: Sys$INotifyPropertyChange$add_propertyChanged,
remove_propertyChanged: Sys$INotifyPropertyChange$remove_propertyChanged
}
Sys.INotifyPropertyChange.registerInterface('Sys.INotifyPropertyChange');
Sys.PropertyChangedEventArgs = function Sys$PropertyChangedEventArgs(propertyName) {
/// <summary locid="M:J#Sys.PropertyChangedEventArgs.#ctor" />
/// <param name="propertyName" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "propertyName", type: String}
]);
if (e) throw e;
Sys.PropertyChangedEventArgs.initializeBase(this);
this._propertyName = propertyName;
}
function Sys$PropertyChangedEventArgs$get_propertyName() {
/// <value type="String" locid="P:J#Sys.PropertyChangedEventArgs.propertyName"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._propertyName;
}
Sys.PropertyChangedEventArgs.prototype = {
get_propertyName: Sys$PropertyChangedEventArgs$get_propertyName
}
Sys.PropertyChangedEventArgs.registerClass('Sys.PropertyChangedEventArgs', Sys.EventArgs);
Sys.INotifyDisposing = function Sys$INotifyDisposing() {
/// <summary locid="M:J#Sys.INotifyDisposing.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$INotifyDisposing$add_disposing(handler) {
/// <summary locid="E:J#Sys.INotifyDisposing.disposing" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
throw Error.notImplemented();
}
function Sys$INotifyDisposing$remove_disposing(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
throw Error.notImplemented();
}
Sys.INotifyDisposing.prototype = {
add_disposing: Sys$INotifyDisposing$add_disposing,
remove_disposing: Sys$INotifyDisposing$remove_disposing
}
Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");
Sys.Component = function Sys$Component() {
/// <summary locid="M:J#Sys.Component.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
if (Sys.Application) Sys.Application.registerDisposableObject(this);
}
function Sys$Component$get_events() {
/// <value type="Sys.EventHandlerList" locid="P:J#Sys.Component.events"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._events) {
this._events = new Sys.EventHandlerList();
}
return this._events;
}
function Sys$Component$get_id() {
/// <value type="String" locid="P:J#Sys.Component.id"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._id;
}
function Sys$Component$set_id(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
if (this._idSet) throw Error.invalidOperation(Sys.Res.componentCantSetIdTwice);
this._idSet = true;
var oldId = this.get_id();
if (oldId && Sys.Application.findComponent(oldId)) throw Error.invalidOperation(Sys.Res.componentCantSetIdAfterAddedToApp);
this._id = value;
}
function Sys$Component$get_isInitialized() {
/// <value type="Boolean" locid="P:J#Sys.Component.isInitialized"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._initialized;
}
function Sys$Component$get_isUpdating() {
/// <value type="Boolean" locid="P:J#Sys.Component.isUpdating"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._updating;
}
function Sys$Component$add_disposing(handler) {
/// <summary locid="E:J#Sys.Component.disposing" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().addHandler("disposing", handler);
}
function Sys$Component$remove_disposing(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().removeHandler("disposing", handler);
}
function Sys$Component$add_propertyChanged(handler) {
/// <summary locid="E:J#Sys.Component.propertyChanged" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().addHandler("propertyChanged", handler);
}
function Sys$Component$remove_propertyChanged(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().removeHandler("propertyChanged", handler);
}
function Sys$Component$beginUpdate() {
this._updating = true;
}
function Sys$Component$dispose() {
if (this._events) {
var handler = this._events.getHandler("disposing");
if (handler) {
handler(this, Sys.EventArgs.Empty);
}
}
delete this._events;
Sys.Application.unregisterDisposableObject(this);
Sys.Application.removeComponent(this);
}
function Sys$Component$endUpdate() {
this._updating = false;
if (!this._initialized) this.initialize();
this.updated();
}
function Sys$Component$initialize() {
this._initialized = true;
}
function Sys$Component$raisePropertyChanged(propertyName) {
/// <summary locid="M:J#Sys.Component.raisePropertyChanged" />
/// <param name="propertyName" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "propertyName", type: String}
]);
if (e) throw e;
if (!this._events) return;
var handler = this._events.getHandler("propertyChanged");
if (handler) {
handler(this, new Sys.PropertyChangedEventArgs(propertyName));
}
}
function Sys$Component$updated() {
}
Sys.Component.prototype = {
_id: null,
_idSet: false,
_initialized: false,
_updating: false,
get_events: Sys$Component$get_events,
get_id: Sys$Component$get_id,
set_id: Sys$Component$set_id,
get_isInitialized: Sys$Component$get_isInitialized,
get_isUpdating: Sys$Component$get_isUpdating,
add_disposing: Sys$Component$add_disposing,
remove_disposing: Sys$Component$remove_disposing,
add_propertyChanged: Sys$Component$add_propertyChanged,
remove_propertyChanged: Sys$Component$remove_propertyChanged,
beginUpdate: Sys$Component$beginUpdate,
dispose: Sys$Component$dispose,
endUpdate: Sys$Component$endUpdate,
initialize: Sys$Component$initialize,
raisePropertyChanged: Sys$Component$raisePropertyChanged,
updated: Sys$Component$updated
}
Sys.Component.registerClass('Sys.Component', null, Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing);
function Sys$Component$_setProperties(target, properties) {
/// <summary locid="M:J#Sys.Component._setProperties" />
/// <param name="target"></param>
/// <param name="properties"></param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "properties"}
]);
if (e) throw e;
var current;
var targetType = Object.getType(target);
var isObject = (targetType === Object) || (targetType === Sys.UI.DomElement);
var isComponent = Sys.Component.isInstanceOfType(target) && !target.get_isUpdating();
if (isComponent) target.beginUpdate();
for (var name in properties) {
var val = properties[name];
var getter = isObject ? null : target["get_" + name];
if (isObject || typeof(getter) !== 'function') {
var targetVal = target[name];
if (!isObject && typeof(targetVal) === 'undefined') throw Error.invalidOperation(String.format(Sys.Res.propertyUndefined, name));
if (!val || (typeof(val) !== 'object') || (isObject && !targetVal)) {
target[name] = val;
}
else {
Sys$Component$_setProperties(targetVal, val);
}
}
else {
var setter = target["set_" + name];
if (typeof(setter) === 'function') {
setter.apply(target, [val]);
}
else if (val instanceof Array) {
current = getter.apply(target);
if (!(current instanceof Array)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNotAnArray, name));
for (var i = 0, j = current.length, l= val.length; i < l; i++, j++) {
current[j] = val[i];
}
}
else if ((typeof(val) === 'object') && (Object.getType(val) === Object)) {
current = getter.apply(target);
if ((typeof(current) === 'undefined') || (current === null)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNullOrUndefined, name));
Sys$Component$_setProperties(current, val);
}
else {
throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name));
}
}
}
if (isComponent) target.endUpdate();
}
function Sys$Component$_setReferences(component, references) {
for (var name in references) {
var setter = component["set_" + name];
var reference = $find(references[name]);
if (typeof(setter) !== 'function') throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name));
if (!reference) throw Error.invalidOperation(String.format(Sys.Res.referenceNotFound, references[name]));
setter.apply(component, [reference]);
}
}
var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) {
/// <summary locid="M:J#Sys.Component.create" />
/// <param name="type" type="Type"></param>
/// <param name="properties" optional="true" mayBeNull="true"></param>
/// <param name="events" optional="true" mayBeNull="true"></param>
/// <param name="references" optional="true" mayBeNull="true"></param>
/// <param name="element" domElement="true" optional="true" mayBeNull="true"></param>
/// <returns type="Sys.UI.Component"></returns>
var e = Function._validateParams(arguments, [
{name: "type", type: Type},
{name: "properties", mayBeNull: true, optional: true},
{name: "events", mayBeNull: true, optional: true},
{name: "references", mayBeNull: true, optional: true},
{name: "element", mayBeNull: true, domElement: true, optional: true}
]);
if (e) throw e;
if (!type.inheritsFrom(Sys.Component)) {
throw Error.argument('type', String.format(Sys.Res.createNotComponent, type.getName()));
}
if (type.inheritsFrom(Sys.UI.Behavior) || type.inheritsFrom(Sys.UI.Control)) {
if (!element) throw Error.argument('element', Sys.Res.createNoDom);
}
else if (element) throw Error.argument('element', Sys.Res.createComponentOnDom);
var component = (element ? new type(element): new type());
var app = Sys.Application;
var creatingComponents = app.get_isCreatingComponents();
component.beginUpdate();
if (properties) {
Sys$Component$_setProperties(component, properties);
}
if (events) {
for (var name in events) {
if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name));
if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction);
component["add_" + name](events[name]);
}
}
if (component.get_id()) {
app.addComponent(component);
}
if (creatingComponents) {
app._createdComponents[app._createdComponents.length] = component;
if (references) {
app._addComponentToSecondPass(component, references);
}
else {
component.endUpdate();
}
}
else {
if (references) {
Sys$Component$_setReferences(component, references);
}
component.endUpdate();
}
return component;
}
Sys.UI.MouseButton = function Sys$UI$MouseButton() {
/// <summary locid="M:J#Sys.UI.MouseButton.#ctor" />
/// <field name="leftButton" type="Number" integer="true" static="true" locid="F:J#Sys.UI.MouseButton.leftButton"></field>
/// <field name="middleButton" type="Number" integer="true" static="true" locid="F:J#Sys.UI.MouseButton.middleButton"></field>
/// <field name="rightButton" type="Number" integer="true" static="true" locid="F:J#Sys.UI.MouseButton.rightButton"></field>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
Sys.UI.MouseButton.prototype = {
leftButton: 0,
middleButton: 1,
rightButton: 2
}
Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");
Sys.UI.Key = function Sys$UI$Key() {
/// <summary locid="M:J#Sys.UI.Key.#ctor" />
/// <field name="backspace" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.backspace"></field>
/// <field name="tab" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.tab"></field>
/// <field name="enter" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.enter"></field>
/// <field name="esc" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.esc"></field>
/// <field name="space" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.space"></field>
/// <field name="pageUp" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.pageUp"></field>
/// <field name="pageDown" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.pageDown"></field>
/// <field name="end" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.end"></field>
/// <field name="home" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.home"></field>
/// <field name="left" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.left"></field>
/// <field name="up" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.up"></field>
/// <field name="right" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.right"></field>
/// <field name="down" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.down"></field>
/// <field name="del" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.del"></field>
if (arguments.length !== 0) throw Error.parameterCount();
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 Sys$UI$Point(x, y) {
/// <summary locid="M:J#Sys.UI.Point.#ctor" />
/// <param name="x" type="Number" integer="true"></param>
/// <param name="y" type="Number" integer="true"></param>
/// <field name="x" type="Number" integer="true" locid="F:J#Sys.UI.Point.x"></field>
/// <field name="y" type="Number" integer="true" locid="F:J#Sys.UI.Point.y"></field>
var e = Function._validateParams(arguments, [
{name: "x", type: Number, integer: true},
{name: "y", type: Number, integer: true}
]);
if (e) throw e;
this.x = x;
this.y = y;
}
Sys.UI.Point.registerClass('Sys.UI.Point');
Sys.UI.Bounds = function Sys$UI$Bounds(x, y, width, height) {
/// <summary locid="M:J#Sys.UI.Bounds.#ctor" />
/// <param name="x" type="Number" integer="true"></param>
/// <param name="y" type="Number" integer="true"></param>
/// <param name="width" type="Number" integer="true"></param>
/// <param name="height" type="Number" integer="true"></param>
/// <field name="x" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.x"></field>
/// <field name="y" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.y"></field>
/// <field name="width" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.width"></field>
/// <field name="height" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.height"></field>
var e = Function._validateParams(arguments, [
{name: "x", type: Number, integer: true},
{name: "y", type: Number, integer: true},
{name: "width", type: Number, integer: true},
{name: "height", type: Number, integer: true}
]);
if (e) throw e;
this.x = x;
this.y = y;
this.height = height;
this.width = width;
}
Sys.UI.Bounds.registerClass('Sys.UI.Bounds');
Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) {
/// <summary locid="M:J#Sys.UI.DomEvent.#ctor" />
/// <param name="eventObject"></param>
/// <field name="altKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.altKey"></field>
/// <field name="button" type="Sys.UI.MouseButton" locid="F:J#Sys.UI.DomEvent.button"></field>
/// <field name="charCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.charCode"></field>
/// <field name="clientX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientX"></field>
/// <field name="clientY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientY"></field>
/// <field name="ctrlKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.ctrlKey"></field>
/// <field name="keyCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.keyCode"></field>
/// <field name="offsetX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetX"></field>
/// <field name="offsetY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetY"></field>
/// <field name="screenX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenX"></field>
/// <field name="screenY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenY"></field>
/// <field name="shiftKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.shiftKey"></field>
/// <field name="target" locid="F:J#Sys.UI.DomEvent.target"></field>
/// <field name="type" type="String" locid="F:J#Sys.UI.DomEvent.type"></field>
var e = Function._validateParams(arguments, [
{name: "eventObject"}
]);
if (e) throw e;
var ev = eventObject;
var etype = this.type = ev.type.toLowerCase();
this.rawEvent = ev;
this.altKey = ev.altKey;
if (typeof(ev.button) !== 'undefined') {
this.button = (typeof(ev.which) !== 'undefined') ? ev.button :
(ev.button === 4) ? Sys.UI.MouseButton.middleButton :
(ev.button === 2) ? Sys.UI.MouseButton.rightButton :
Sys.UI.MouseButton.leftButton;
}
if (etype === 'keypress') {
this.charCode = ev.charCode || ev.keyCode;
}
else if (ev.keyCode && (ev.keyCode === 46)) {
this.keyCode = 127;
}
else {
this.keyCode = ev.keyCode;
}
this.clientX = ev.clientX;
this.clientY = ev.clientY;
this.ctrlKey = ev.ctrlKey;
this.target = ev.target ? ev.target : ev.srcElement;
if (!etype.startsWith('key')) {
if ((typeof(ev.offsetX) !== 'undefined') && (typeof(ev.offsetY) !== 'undefined')) {
this.offsetX = ev.offsetX;
this.offsetY = ev.offsetY;
}
else if (this.target && (this.target.nodeType !== 3) && (typeof(ev.clientX) === 'number')) {
var loc = Sys.UI.DomElement.getLocation(this.target);
var w = Sys.UI.DomElement._getWindow(this.target);
this.offsetX = (w.pageXOffset || 0) + ev.clientX - loc.x;
this.offsetY = (w.pageYOffset || 0) + ev.clientY - loc.y;
}
}
this.screenX = ev.screenX;
this.screenY = ev.screenY;
this.shiftKey = ev.shiftKey;
}
function Sys$UI$DomEvent$preventDefault() {
/// <summary locid="M:J#Sys.UI.DomEvent.preventDefault" />
if (arguments.length !== 0) throw Error.parameterCount();
if (this.rawEvent.preventDefault) {
this.rawEvent.preventDefault();
}
else if (window.event) {
this.rawEvent.returnValue = false;
}
}
function Sys$UI$DomEvent$stopPropagation() {
/// <summary locid="M:J#Sys.UI.DomEvent.stopPropagation" />
if (arguments.length !== 0) throw Error.parameterCount();
if (this.rawEvent.stopPropagation) {
this.rawEvent.stopPropagation();
}
else if (window.event) {
this.rawEvent.cancelBubble = true;
}
}
Sys.UI.DomEvent.prototype = {
preventDefault: Sys$UI$DomEvent$preventDefault,
stopPropagation: Sys$UI$DomEvent$stopPropagation
}
Sys.UI.DomEvent.registerClass('Sys.UI.DomEvent');
var $addHandler = Sys.UI.DomEvent.addHandler = function Sys$UI$DomEvent$addHandler(element, eventName, handler, autoRemove) {
/// <summary locid="M:J#Sys.UI.DomEvent.addHandler" />
/// <param name="element"></param>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
/// <param name="autoRemove" type="Boolean" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "element"},
{name: "eventName", type: String},
{name: "handler", type: Function},
{name: "autoRemove", type: Boolean, optional: true}
]);
if (e) throw e;
Sys.UI.DomEvent._ensureDomNode(element);
if (eventName === "error") throw Error.invalidOperation(Sys.Res.addHandlerCantBeUsedForError);
if (!element._events) {
element._events = {};
}
var eventCache = element._events[eventName];
if (!eventCache) {
element._events[eventName] = eventCache = [];
}
var browserHandler;
if (element.addEventListener) {
browserHandler = function(e) {
return handler.call(element, new Sys.UI.DomEvent(e));
}
element.addEventListener(eventName, browserHandler, false);
}
else if (element.attachEvent) {
browserHandler = function() {
var e = {};
try {e = Sys.UI.DomElement._getWindow(element).event} catch(ex) {}
return handler.call(element, new Sys.UI.DomEvent(e));
}
element.attachEvent('on' + eventName, browserHandler);
}
eventCache[eventCache.length] = {handler: handler, browserHandler: browserHandler, autoRemove: autoRemove };
if (autoRemove) {
var d = element.dispose;
if (d !== Sys.UI.DomEvent._disposeHandlers) {
element.dispose = Sys.UI.DomEvent._disposeHandlers;
if (typeof(d) !== "undefined") {
element._chainDispose = d;
}
}
}
}
var $addHandlers = Sys.UI.DomEvent.addHandlers = function Sys$UI$DomEvent$addHandlers(element, events, handlerOwner, autoRemove) {
/// <summary locid="M:J#Sys.UI.DomEvent.addHandlers" />
/// <param name="element"></param>
/// <param name="events" type="Object"></param>
/// <param name="handlerOwner" optional="true"></param>
/// <param name="autoRemove" type="Boolean" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "element"},
{name: "events", type: Object},
{name: "handlerOwner", optional: true},
{name: "autoRemove", type: Boolean, optional: true}
]);
if (e) throw e;
Sys.UI.DomEvent._ensureDomNode(element);
for (var name in events) {
var handler = events[name];
if (typeof(handler) !== 'function') throw Error.invalidOperation(Sys.Res.cantAddNonFunctionhandler);
if (handlerOwner) {
handler = Function.createDelegate(handlerOwner, handler);
}
$addHandler(element, name, handler, autoRemove || false);
}
}
var $clearHandlers = Sys.UI.DomEvent.clearHandlers = function Sys$UI$DomEvent$clearHandlers(element) {
/// <summary locid="M:J#Sys.UI.DomEvent.clearHandlers" />
/// <param name="element"></param>
var e = Function._validateParams(arguments, [
{name: "element"}
]);
if (e) throw e;
Sys.UI.DomEvent._ensureDomNode(element);
Sys.UI.DomEvent._clearHandlers(element, false);
}
Sys.UI.DomEvent._clearHandlers = function Sys$UI$DomEvent$_clearHandlers(element, autoRemoving) {
if (element._events) {
var cache = element._events;
for (var name in cache) {
var handlers = cache[name];
for (var i = handlers.length - 1; i >= 0; i--) {
var entry = handlers[i];
if (!autoRemoving || entry.autoRemove) {
$removeHandler(element, name, entry.handler);
}
}
}
element._events = null;
}
}
Sys.UI.DomEvent._disposeHandlers = function Sys$UI$DomEvent$_disposeHandlers() {
Sys.UI.DomEvent._clearHandlers(this, true);
var d = this._chainDispose, type = typeof(d);
if (type !== "undefined") {
this.dispose = d;
this._chainDispose = null;
if (type === "function") {
this.dispose();
}
}
}
var $removeHandler = Sys.UI.DomEvent.removeHandler = function Sys$UI$DomEvent$removeHandler(element, eventName, handler) {
/// <summary locid="M:J#Sys.UI.DomEvent.removeHandler" />
/// <param name="element"></param>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "element"},
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.UI.DomEvent._removeHandler(element, eventName, handler);
}
Sys.UI.DomEvent._removeHandler = function Sys$UI$DomEvent$_removeHandler(element, eventName, handler) {
Sys.UI.DomEvent._ensureDomNode(element);
var browserHandler = null;
if ((typeof(element._events) !== 'object') || !element._events) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
var cache = element._events[eventName];
if (!(cache instanceof Array)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
for (var i = 0, l = cache.length; i < l; i++) {
if (cache[i].handler === handler) {
browserHandler = cache[i].browserHandler;
break;
}
}
if (typeof(browserHandler) !== 'function') throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
if (element.removeEventListener) {
element.removeEventListener(eventName, browserHandler, false);
}
else if (element.detachEvent) {
element.detachEvent('on' + eventName, browserHandler);
}
cache.splice(i, 1);
}
Sys.UI.DomEvent._ensureDomNode = function Sys$UI$DomEvent$_ensureDomNode(element) {
if (element.tagName && (element.tagName.toUpperCase() === "SCRIPT")) return;
var doc = element.ownerDocument || element.document || element;
if ((typeof(element.document) !== 'object') && (element != doc) && (typeof(element.nodeType) !== 'number')) {
throw Error.argument("element", Sys.Res.argumentDomNode);
}
}
Sys.UI.DomElement = function Sys$UI$DomElement() {
/// <summary locid="M:J#Sys.UI.DomElement.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
Sys.UI.DomElement.registerClass('Sys.UI.DomElement');
Sys.UI.DomElement.addCssClass = function Sys$UI$DomElement$addCssClass(element, className) {
/// <summary locid="M:J#Sys.UI.DomElement.addCssClass" />
/// <param name="element" domElement="true"></param>
/// <param name="className" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "className", type: String}
]);
if (e) throw e;
if (!Sys.UI.DomElement.containsCssClass(element, className)) {
if (element.className === '') {
element.className = className;
}
else {
element.className += ' ' + className;
}
}
}
Sys.UI.DomElement.containsCssClass = function Sys$UI$DomElement$containsCssClass(element, className) {
/// <summary locid="M:J#Sys.UI.DomElement.containsCssClass" />
/// <param name="element" domElement="true"></param>
/// <param name="className" type="String"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "className", type: String}
]);
if (e) throw e;
return Array.contains(element.className.split(' '), className);
}
Sys.UI.DomElement.getBounds = function Sys$UI$DomElement$getBounds(element) {
/// <summary locid="M:J#Sys.UI.DomElement.getBounds" />
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.Bounds"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
var offset = Sys.UI.DomElement.getLocation(element);
return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);
}
var $get = Sys.UI.DomElement.getElementById = function Sys$UI$DomElement$getElementById(id, element) {
/// <summary locid="M:J#Sys.UI.DomElement.getElementById" />
/// <param name="id" type="String"></param>
/// <param name="element" domElement="true" optional="true" mayBeNull="true"></param>
/// <returns domElement="true" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "element", mayBeNull: true, domElement: true, optional: true}
]);
if (e) throw e;
if (!element) return document.getElementById(id);
if (element.getElementById) return element.getElementById(id);
var nodeQueue = [];
var childNodes = element.childNodes;
for (var i = 0; i < childNodes.length; i++) {
var node = childNodes[i];
if (node.nodeType == 1) {
nodeQueue[nodeQueue.length] = node;
}
}
while (nodeQueue.length) {
node = nodeQueue.shift();
if (node.id == id) {
return node;
}
childNodes = node.childNodes;
for (i = 0; i < childNodes.length; i++) {
node = childNodes[i];
if (node.nodeType == 1) {
nodeQueue[nodeQueue.length] = node;
}
}
}
return null;
}
if (document.documentElement.getBoundingClientRect) {
Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) {
/// <summary locid="M:J#Sys.UI.DomElement.getLocation" />
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.Point"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
if (element.self || element.nodeType === 9) return new Sys.UI.Point(0,0);
var clientRect = element.getBoundingClientRect();
if (!clientRect) {
return new Sys.UI.Point(0,0);
}
var documentElement = element.ownerDocument.documentElement,
offsetX = Math.floor(clientRect.left + 0.5) + documentElement.scrollLeft,
offsetY = Math.floor(clientRect.top + 0.5) + documentElement.scrollTop;
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
try {
var f = element.ownerDocument.parentWindow.frameElement || null;
if (f) {
var offset = (f.frameBorder === "0" || f.frameBorder === "no") ? 2 : 0;
offsetX += offset;
offsetY += offset;
}
}
catch(ex) {
}
if (Sys.Browser.version <= 7) {
var multiplier, before, rect, d = document.createElement("div");
d.style.cssText = "position:absolute !important;left:0px !important;right:0px !important;height:0px !important;width:1px !important;display:hidden !important";
try {
before = document.body.childNodes[0];
document.body.insertBefore(d, before);
rect = d.getBoundingClientRect();
document.body.removeChild(d);
multiplier = (rect.right - rect.left);
}
catch (e) {
}
if (multiplier && (multiplier !== 1)) {
offsetX = Math.floor(offsetX / multiplier);
offsetY = Math.floor(offsetY / multiplier);
}
}
if ((document.documentMode || 0) < 8) {
offsetX -= 2;
offsetY -= 2;
}
}
return new Sys.UI.Point(offsetX, offsetY);
}
}
else if (Sys.Browser.agent === Sys.Browser.Safari) {
Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) {
/// <summary locid="M:J#Sys.UI.DomElement.getLocation" />
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.Point"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0);
var offsetX = 0, offsetY = 0,
parent,
previous = null,
previousStyle = null,
currentStyle;
for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) {
currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
var tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
if ((parent.offsetLeft || parent.offsetTop) &&
((tagName !== "BODY") || (!previousStyle || previousStyle.position !== "absolute"))) {
offsetX += parent.offsetLeft;
offsetY += parent.offsetTop;
}
if (previous && Sys.Browser.version >= 3) {
offsetX += parseInt(currentStyle.borderLeftWidth);
offsetY += parseInt(currentStyle.borderTopWidth);
}
}
currentStyle = Sys.UI.DomElement._getCurrentStyle(element);
var elementPosition = currentStyle ? currentStyle.position : null;
if (!elementPosition || (elementPosition !== "absolute")) {
for (parent = element.parentNode; parent; parent = parent.parentNode) {
tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) {
offsetX -= (parent.scrollLeft || 0);
offsetY -= (parent.scrollTop || 0);
}
currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
var parentPosition = currentStyle ? currentStyle.position : null;
if (parentPosition && (parentPosition === "absolute")) break;
}
}
return new Sys.UI.Point(offsetX, offsetY);
}
}
else {
Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) {
/// <summary locid="M:J#Sys.UI.DomElement.getLocation" />
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.Point"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0);
var offsetX = 0, offsetY = 0,
parent,
previous = null,
previousStyle = null,
currentStyle = null;
for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) {
var tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
if ((parent.offsetLeft || parent.offsetTop) &&
!((tagName === "BODY") &&
(!previousStyle || previousStyle.position !== "absolute"))) {
offsetX += parent.offsetLeft;
offsetY += parent.offsetTop;
}
if (previous !== null && currentStyle) {
if ((tagName !== "TABLE") && (tagName !== "TD") && (tagName !== "HTML")) {
offsetX += parseInt(currentStyle.borderLeftWidth) || 0;
offsetY += parseInt(currentStyle.borderTopWidth) || 0;
}
if (tagName === "TABLE" &&
(currentStyle.position === "relative" || currentStyle.position === "absolute")) {
offsetX += parseInt(currentStyle.marginLeft) || 0;
offsetY += parseInt(currentStyle.marginTop) || 0;
}
}
}
currentStyle = Sys.UI.DomElement._getCurrentStyle(element);
var elementPosition = currentStyle ? currentStyle.position : null;
if (!elementPosition || (elementPosition !== "absolute")) {
for (parent = element.parentNode; parent; parent = parent.parentNode) {
tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) {
offsetX -= (parent.scrollLeft || 0);
offsetY -= (parent.scrollTop || 0);
currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
if (currentStyle) {
offsetX += parseInt(currentStyle.borderLeftWidth) || 0;
offsetY += parseInt(currentStyle.borderTopWidth) || 0;
}
}
}
}
return new Sys.UI.Point(offsetX, offsetY);
}
}
Sys.UI.DomElement.isDomElement = function Sys$UI$DomElement$isDomElement(obj) {
/// <summary locid="M:J#Sys.UI.DomElement.isDomElement" />
/// <param name="obj"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "obj"}
]);
if (e) throw e;
return Sys._isDomElement(obj);
}
Sys.UI.DomElement.removeCssClass = function Sys$UI$DomElement$removeCssClass(element, className) {
/// <summary locid="M:J#Sys.UI.DomElement.removeCssClass" />
/// <param name="element" domElement="true"></param>
/// <param name="className" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "className", type: String}
]);
if (e) throw e;
var currentClassName = ' ' + element.className + ' ';
var index = currentClassName.indexOf(' ' + className + ' ');
if (index >= 0) {
element.className = (currentClassName.substr(0, index) + ' ' +
currentClassName.substring(index + className.length + 1, currentClassName.length)).trim();
}
}
Sys.UI.DomElement.resolveElement = function Sys$UI$DomElement$resolveElement(elementOrElementId, containerElement) {
/// <summary locid="M:J#Sys.UI.DomElement.resolveElement" />
/// <param name="elementOrElementId" mayBeNull="true"></param>
/// <param name="containerElement" domElement="true" optional="true" mayBeNull="true"></param>
/// <returns domElement="true"></returns>
var e = Function._validateParams(arguments, [
{name: "elementOrElementId", mayBeNull: true},
{name: "containerElement", mayBeNull: true, domElement: true, optional: true}
]);
if (e) throw e;
var el = elementOrElementId;
if (!el) return null;
if (typeof(el) === "string") {
el = Sys.UI.DomElement.getElementById(el, containerElement);
if (!el) {
throw Error.argument("elementOrElementId", String.format(Sys.Res.elementNotFound, elementOrElementId));
}
}
else if(!Sys.UI.DomElement.isDomElement(el)) {
throw Error.argument("elementOrElementId", Sys.Res.expectedElementOrId);
}
return el;
}
Sys.UI.DomElement.raiseBubbleEvent = function Sys$UI$DomElement$raiseBubbleEvent(source, args) {
/// <summary locid="M:J#Sys.UI.DomElement.raiseBubbleEvent" />
/// <param name="source" domElement="true"></param>
/// <param name="args" type="Sys.EventArgs"></param>
var e = Function._validateParams(arguments, [
{name: "source", domElement: true},
{name: "args", type: Sys.EventArgs}
]);
if (e) throw e;
var target = source;
while (target) {
var control = target.control;
if (control && control.onBubbleEvent && control.raiseBubbleEvent) {
Sys.UI.DomElement._raiseBubbleEventFromControl(control, source, args);
return;
}
target = target.parentNode;
}
}
Sys.UI.DomElement._raiseBubbleEventFromControl = function Sys$UI$DomElement$_raiseBubbleEventFromControl(control, source, args) {
if (!control.onBubbleEvent(source, args)) {
control._raiseBubbleEvent(source, args);
}
}
Sys.UI.DomElement.setLocation = function Sys$UI$DomElement$setLocation(element, x, y) {
/// <summary locid="M:J#Sys.UI.DomElement.setLocation" />
/// <param name="element" domElement="true"></param>
/// <param name="x" type="Number" integer="true"></param>
/// <param name="y" type="Number" integer="true"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "x", type: Number, integer: true},
{name: "y", type: Number, integer: true}
]);
if (e) throw e;
var style = element.style;
style.position = 'absolute';
style.left = x + "px";
style.top = y + "px";
}
Sys.UI.DomElement.toggleCssClass = function Sys$UI$DomElement$toggleCssClass(element, className) {
/// <summary locid="M:J#Sys.UI.DomElement.toggleCssClass" />
/// <param name="element" domElement="true"></param>
/// <param name="className" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "className", type: String}
]);
if (e) throw e;
if (Sys.UI.DomElement.containsCssClass(element, className)) {
Sys.UI.DomElement.removeCssClass(element, className);
}
else {
Sys.UI.DomElement.addCssClass(element, className);
}
}
Sys.UI.DomElement.getVisibilityMode = function Sys$UI$DomElement$getVisibilityMode(element) {
/// <summary locid="M:J#Sys.UI.DomElement.getVisibilityMode" />
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.VisibilityMode"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
return (element._visibilityMode === Sys.UI.VisibilityMode.hide) ?
Sys.UI.VisibilityMode.hide :
Sys.UI.VisibilityMode.collapse;
}
Sys.UI.DomElement.setVisibilityMode = function Sys$UI$DomElement$setVisibilityMode(element, value) {
/// <summary locid="M:J#Sys.UI.DomElement.setVisibilityMode" />
/// <param name="element" domElement="true"></param>
/// <param name="value" type="Sys.UI.VisibilityMode"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "value", type: Sys.UI.VisibilityMode}
]);
if (e) throw e;
Sys.UI.DomElement._ensureOldDisplayMode(element);
if (element._visibilityMode !== value) {
element._visibilityMode = value;
if (Sys.UI.DomElement.getVisible(element) === false) {
if (element._visibilityMode === Sys.UI.VisibilityMode.hide) {
element.style.display = element._oldDisplayMode;
}
else {
element.style.display = 'none';
}
}
element._visibilityMode = value;
}
}
Sys.UI.DomElement.getVisible = function Sys$UI$DomElement$getVisible(element) {
/// <summary locid="M:J#Sys.UI.DomElement.getVisible" />
/// <param name="element" domElement="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element);
if (!style) return true;
return (style.visibility !== 'hidden') && (style.display !== 'none');
}
Sys.UI.DomElement.setVisible = function Sys$UI$DomElement$setVisible(element, value) {
/// <summary locid="M:J#Sys.UI.DomElement.setVisible" />
/// <param name="element" domElement="true"></param>
/// <param name="value" type="Boolean"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "value", type: Boolean}
]);
if (e) throw e;
if (value !== Sys.UI.DomElement.getVisible(element)) {
Sys.UI.DomElement._ensureOldDisplayMode(element);
element.style.visibility = value ? 'visible' : 'hidden';
if (value || (element._visibilityMode === Sys.UI.VisibilityMode.hide)) {
element.style.display = element._oldDisplayMode;
}
else {
element.style.display = 'none';
}
}
}
Sys.UI.DomElement._ensureOldDisplayMode = function Sys$UI$DomElement$_ensureOldDisplayMode(element) {
if (!element._oldDisplayMode) {
var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element);
element._oldDisplayMode = style ? style.display : null;
if (!element._oldDisplayMode || element._oldDisplayMode === 'none') {
switch(element.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':
element._oldDisplayMode = 'block';
break;
case 'LI':
element._oldDisplayMode = 'list-item';
break;
default:
element._oldDisplayMode = 'inline';
}
}
}
}
Sys.UI.DomElement._getWindow = function Sys$UI$DomElement$_getWindow(element) {
var doc = element.ownerDocument || element.document || element;
return doc.defaultView || doc.parentWindow;
}
Sys.UI.DomElement._getCurrentStyle = function Sys$UI$DomElement$_getCurrentStyle(element) {
if (element.nodeType === 3) return null;
var w = Sys.UI.DomElement._getWindow(element);
if (element.documentElement) element = element.documentElement;
var computedStyle = (w && (element !== w) && w.getComputedStyle) ?
w.getComputedStyle(element, null) :
element.currentStyle || element.style;
if (!computedStyle && (Sys.Browser.agent === Sys.Browser.Safari) && element.style) {
var oldDisplay = element.style.display;
var oldPosition = element.style.position;
element.style.position = 'absolute';
element.style.display = 'block';
var style = w.getComputedStyle(element, null);
element.style.display = oldDisplay;
element.style.position = oldPosition;
computedStyle = {};
for (var n in style) {
computedStyle[n] = style[n];
}
computedStyle.display = 'none';
}
return computedStyle;
}
Sys.IContainer = function Sys$IContainer() {
throw Error.notImplemented();
}
function Sys$IContainer$addComponent(component) {
/// <summary locid="M:J#Sys.IContainer.addComponent" />
/// <param name="component" type="Sys.Component"></param>
var e = Function._validateParams(arguments, [
{name: "component", type: Sys.Component}
]);
if (e) throw e;
throw Error.notImplemented();
}
function Sys$IContainer$removeComponent(component) {
/// <summary locid="M:J#Sys.IContainer.removeComponent" />
/// <param name="component" type="Sys.Component"></param>
var e = Function._validateParams(arguments, [
{name: "component", type: Sys.Component}
]);
if (e) throw e;
throw Error.notImplemented();
}
function Sys$IContainer$findComponent(id) {
/// <summary locid="M:J#Sys.IContainer.findComponent" />
/// <param name="id" type="String"></param>
/// <returns type="Sys.Component"></returns>
var e = Function._validateParams(arguments, [
{name: "id", type: String}
]);
if (e) throw e;
throw Error.notImplemented();
}
function Sys$IContainer$getComponents() {
/// <summary locid="M:J#Sys.IContainer.getComponents" />
/// <returns type="Array" elementType="Sys.Component"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
Sys.IContainer.prototype = {
addComponent: Sys$IContainer$addComponent,
removeComponent: Sys$IContainer$removeComponent,
findComponent: Sys$IContainer$findComponent,
getComponents: Sys$IContainer$getComponents
}
Sys.IContainer.registerInterface("Sys.IContainer");
Sys.ApplicationLoadEventArgs = function Sys$ApplicationLoadEventArgs(components, isPartialLoad) {
/// <summary locid="M:J#Sys.ApplicationLoadEventArgs.#ctor" />
/// <param name="components" type="Array" elementType="Sys.Component"></param>
/// <param name="isPartialLoad" type="Boolean"></param>
var e = Function._validateParams(arguments, [
{name: "components", type: Array, elementType: Sys.Component},
{name: "isPartialLoad", type: Boolean}
]);
if (e) throw e;
Sys.ApplicationLoadEventArgs.initializeBase(this);
this._components = components;
this._isPartialLoad = isPartialLoad;
}
function Sys$ApplicationLoadEventArgs$get_components() {
/// <value type="Array" elementType="Sys.Component" locid="P:J#Sys.ApplicationLoadEventArgs.components"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._components;
}
function Sys$ApplicationLoadEventArgs$get_isPartialLoad() {
/// <value type="Boolean" locid="P:J#Sys.ApplicationLoadEventArgs.isPartialLoad"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._isPartialLoad;
}
Sys.ApplicationLoadEventArgs.prototype = {
get_components: Sys$ApplicationLoadEventArgs$get_components,
get_isPartialLoad: Sys$ApplicationLoadEventArgs$get_isPartialLoad
}
Sys.ApplicationLoadEventArgs.registerClass('Sys.ApplicationLoadEventArgs', Sys.EventArgs);
Sys._Application = function Sys$_Application() {
/// <summary locid="M:J#Sys.Application.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
Sys._Application.initializeBase(this);
this._disposableObjects = [];
this._components = {};
this._createdComponents = [];
this._secondPassComponents = [];
this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler);
Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate);
this._domReady();
}
function Sys$_Application$get_isCreatingComponents() {
/// <value type="Boolean" locid="P:J#Sys.Application.isCreatingComponents"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._creatingComponents;
}
function Sys$_Application$get_isDisposing() {
/// <value type="Boolean" locid="P:J#Sys.Application.isDisposing"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._disposing;
}
function Sys$_Application$add_init(handler) {
/// <summary locid="E:J#Sys.Application.init" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
if (this._initialized) {
handler(this, Sys.EventArgs.Empty);
}
else {
this.get_events().addHandler("init", handler);
}
}
function Sys$_Application$remove_init(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().removeHandler("init", handler);
}
function Sys$_Application$add_load(handler) {
/// <summary locid="E:J#Sys.Application.load" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().addHandler("load", handler);
}
function Sys$_Application$remove_load(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().removeHandler("load", handler);
}
function Sys$_Application$add_unload(handler) {
/// <summary locid="E:J#Sys.Application.unload" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().addHandler("unload", handler);
}
function Sys$_Application$remove_unload(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this.get_events().removeHandler("unload", handler);
}
function Sys$_Application$addComponent(component) {
/// <summary locid="M:J#Sys.Application.addComponent" />
/// <param name="component" type="Sys.Component"></param>
var e = Function._validateParams(arguments, [
{name: "component", type: Sys.Component}
]);
if (e) throw e;
var id = component.get_id();
if (!id) throw Error.invalidOperation(Sys.Res.cantAddWithoutId);
if (typeof(this._components[id]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.appDuplicateComponent, id));
this._components[id] = component;
}
function Sys$_Application$beginCreateComponents() {
/// <summary locid="M:J#Sys.Application.beginCreateComponents" />
if (arguments.length !== 0) throw Error.parameterCount();
this._creatingComponents = true;
}
function Sys$_Application$dispose() {
/// <summary locid="M:J#Sys.Application.dispose" />
if (arguments.length !== 0) throw Error.parameterCount();
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 unloadHandler = this.get_events().getHandler("unload");
if (unloadHandler) {
unloadHandler(this, Sys.EventArgs.Empty);
}
var disposableObjects = Array.clone(this._disposableObjects);
for (var i = 0, l = disposableObjects.length; i < l; i++) {
var object = disposableObjects[i];
if (typeof(object) !== "undefined") {
object.dispose();
}
}
Array.clear(this._disposableObjects);
Sys.UI.DomEvent.removeHandler(window, "unload", this._unloadHandlerDelegate);
if (Sys._ScriptLoader) {
var sl = Sys._ScriptLoader.getInstance();
if(sl) {
sl.dispose();
}
}
Sys._Application.callBaseMethod(this, 'dispose');
}
}
function Sys$_Application$disposeElement(element, childNodesOnly) {
/// <summary locid="M:J#Sys._Application.disposeElement" />
/// <param name="element"></param>
/// <param name="childNodesOnly" type="Boolean"></param>
var e = Function._validateParams(arguments, [
{name: "element"},
{name: "childNodesOnly", type: Boolean}
]);
if (e) throw e;
if (element.nodeType === 1) {
var children = element.getElementsByTagName("*");
for (var i = children.length - 1; i >= 0; i--) {
this._disposeElementInternal(children[i]);
}
if (!childNodesOnly) {
this._disposeElementInternal(element);
}
}
}
function Sys$_Application$endCreateComponents() {
/// <summary locid="M:J#Sys.Application.endCreateComponents" />
if (arguments.length !== 0) throw Error.parameterCount();
var components = this._secondPassComponents;
for (var i = 0, l = components.length; i < l; i++) {
var component = components[i].component;
Sys$Component$_setReferences(component, components[i].references);
component.endUpdate();
}
this._secondPassComponents = [];
this._creatingComponents = false;
}
function Sys$_Application$findComponent(id, parent) {
/// <summary locid="M:J#Sys.Application.findComponent" />
/// <param name="id" type="String"></param>
/// <param name="parent" optional="true" mayBeNull="true"></param>
/// <returns type="Sys.Component" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "parent", mayBeNull: true, optional: true}
]);
if (e) throw e;
return (parent ?
((Sys.IContainer.isInstanceOfType(parent)) ?
parent.findComponent(id) :
parent[id] || null) :
Sys.Application._components[id] || null);
}
function Sys$_Application$getComponents() {
/// <summary locid="M:J#Sys.Application.getComponents" />
/// <returns type="Array" elementType="Sys.Component"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
var res = [];
var components = this._components;
for (var name in components) {
res[res.length] = components[name];
}
return res;
}
function Sys$_Application$initialize() {
/// <summary locid="M:J#Sys.Application.initialize" />
if (arguments.length !== 0) throw Error.parameterCount();
if(!this.get_isInitialized() && !this._disposing) {
Sys._Application.callBaseMethod(this, 'initialize');
this._raiseInit();
if (this.get_stateString) {
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
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 loadedEntry = this.get_stateString();
if (loadedEntry !== this._currentEntry) {
this._navigate(loadedEntry);
}
else {
this._ensureHistory();
}
}
this.raiseLoad();
}
}
function Sys$_Application$notifyScriptLoaded() {
/// <summary locid="M:J#Sys.Application.notifyScriptLoaded" />
if (arguments.length !== 0) throw Error.parameterCount();
}
function Sys$_Application$registerDisposableObject(object) {
/// <summary locid="M:J#Sys.Application.registerDisposableObject" />
/// <param name="object" type="Sys.IDisposable"></param>
var e = Function._validateParams(arguments, [
{name: "object", type: Sys.IDisposable}
]);
if (e) throw e;
if (!this._disposing) {
var objects = this._disposableObjects,
i = objects.length;
objects[i] = object;
object.__msdisposeindex = i;
}
}
function Sys$_Application$raiseLoad() {
/// <summary locid="M:J#Sys.Application.raiseLoad" />
if (arguments.length !== 0) throw Error.parameterCount();
var h = this.get_events().getHandler("load");
var args = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !!this._loaded);
this._loaded = true;
if (h) {
h(this, args);
}
if (window.pageLoad) {
window.pageLoad(this, args);
}
this._createdComponents = [];
}
function Sys$_Application$removeComponent(component) {
/// <summary locid="M:J#Sys.Application.removeComponent" />
/// <param name="component" type="Sys.Component"></param>
var e = Function._validateParams(arguments, [
{name: "component", type: Sys.Component}
]);
if (e) throw e;
var id = component.get_id();
if (id) delete this._components[id];
}
function Sys$_Application$unregisterDisposableObject(object) {
/// <summary locid="M:J#Sys.Application.unregisterDisposableObject" />
/// <param name="object" type="Sys.IDisposable"></param>
var e = Function._validateParams(arguments, [
{name: "object", type: Sys.IDisposable}
]);
if (e) throw e;
if (!this._disposing) {
var i = object.__msdisposeindex;
if (typeof(i) === "number") {
var disposableObjects = this._disposableObjects;
delete disposableObjects[i];
delete object.__msdisposeindex;
if (++this._deleteCount > 1000) {
var newArray = [];
for (var j = 0, l = disposableObjects.length; j < l; j++) {
object = disposableObjects[j];
if (typeof(object) !== "undefined") {
object.__msdisposeindex = newArray.length;
newArray.push(object);
}
}
this._disposableObjects = newArray;
this._deleteCount = 0;
}
}
}
}
function Sys$_Application$_addComponentToSecondPass(component, references) {
this._secondPassComponents[this._secondPassComponents.length] = {component: component, references: references};
}
function Sys$_Application$_disposeComponents(list) {
if (list) {
for (var i = list.length - 1; i >= 0; i--) {
var item = list[i];
if (typeof(item.dispose) === "function") {
item.dispose();
}
}
}
}
function Sys$_Application$_disposeElementInternal(element) {
var d = element.dispose;
if (d && typeof(d) === "function") {
element.dispose();
}
else {
var c = element.control;
if (c && typeof(c.dispose) === "function") {
c.dispose();
}
}
var list = element._behaviors;
if (list) {
this._disposeComponents(list);
}
list = element._components;
if (list) {
this._disposeComponents(list);
element._components = null;
}
}
function Sys$_Application$_domReady() {
var check, er, app = this;
function init() { app.initialize(); }
var onload = function() {
Sys.UI.DomEvent.removeHandler(window, "load", onload);
init();
}
Sys.UI.DomEvent.addHandler(window, "load", onload);
if (document.addEventListener) {
try {
document.addEventListener("DOMContentLoaded", check = function() {
document.removeEventListener("DOMContentLoaded", check, false);
init();
}, false);
}
catch (er) { }
}
else if (document.attachEvent) {
if ((window == window.top) && document.documentElement.doScroll) {
var timeout, el = document.createElement("div");
check = function() {
try {
el.doScroll("left");
}
catch (er) {
timeout = window.setTimeout(check, 0);
return;
}
el = null;
init();
}
check();
}
else {
document.attachEvent("onreadystatechange", check = function() {
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", check);
init();
}
});
}
}
}
function Sys$_Application$_raiseInit() {
var handler = this.get_events().getHandler("init");
if (handler) {
this.beginCreateComponents();
handler(this, Sys.EventArgs.Empty);
this.endCreateComponents();
}
}
function Sys$_Application$_unloadHandler(event) {
this.dispose();
}
Sys._Application.prototype = {
_creatingComponents: false,
_disposing: false,
_deleteCount: 0,
get_isCreatingComponents: Sys$_Application$get_isCreatingComponents,
get_isDisposing: Sys$_Application$get_isDisposing,
add_init: Sys$_Application$add_init,
remove_init: Sys$_Application$remove_init,
add_load: Sys$_Application$add_load,
remove_load: Sys$_Application$remove_load,
add_unload: Sys$_Application$add_unload,
remove_unload: Sys$_Application$remove_unload,
addComponent: Sys$_Application$addComponent,
beginCreateComponents: Sys$_Application$beginCreateComponents,
dispose: Sys$_Application$dispose,
disposeElement: Sys$_Application$disposeElement,
endCreateComponents: Sys$_Application$endCreateComponents,
findComponent: Sys$_Application$findComponent,
getComponents: Sys$_Application$getComponents,
initialize: Sys$_Application$initialize,
notifyScriptLoaded: Sys$_Application$notifyScriptLoaded,
registerDisposableObject: Sys$_Application$registerDisposableObject,
raiseLoad: Sys$_Application$raiseLoad,
removeComponent: Sys$_Application$removeComponent,
unregisterDisposableObject: Sys$_Application$unregisterDisposableObject,
_addComponentToSecondPass: Sys$_Application$_addComponentToSecondPass,
_disposeComponents: Sys$_Application$_disposeComponents,
_disposeElementInternal: Sys$_Application$_disposeElementInternal,
_domReady: Sys$_Application$_domReady,
_raiseInit: Sys$_Application$_raiseInit,
_unloadHandler: Sys$_Application$_unloadHandler
}
Sys._Application.registerClass('Sys._Application', Sys.Component, Sys.IContainer);
Sys.Application = new Sys._Application();
var $find = Sys.Application.findComponent;
Sys.UI.Behavior = function Sys$UI$Behavior(element) {
/// <summary locid="M:J#Sys.UI.Behavior.#ctor" />
/// <param name="element" domElement="true"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
Sys.UI.Behavior.initializeBase(this);
this._element = element;
var behaviors = element._behaviors;
if (!behaviors) {
element._behaviors = [this];
}
else {
behaviors[behaviors.length] = this;
}
}
function Sys$UI$Behavior$get_element() {
/// <value domElement="true" locid="P:J#Sys.UI.Behavior.element"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._element;
}
function Sys$UI$Behavior$get_id() {
/// <value type="String" locid="P:J#Sys.UI.Behavior.id"></value>
if (arguments.length !== 0) throw Error.parameterCount();
var baseId = Sys.UI.Behavior.callBaseMethod(this, 'get_id');
if (baseId) return baseId;
if (!this._element || !this._element.id) return '';
return this._element.id + '$' + this.get_name();
}
function Sys$UI$Behavior$get_name() {
/// <value type="String" locid="P:J#Sys.UI.Behavior.name"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (this._name) return this._name;
var name = Object.getTypeName(this);
var i = name.lastIndexOf('.');
if (i !== -1) name = name.substr(i + 1);
if (!this.get_isInitialized()) this._name = name;
return name;
}
function Sys$UI$Behavior$set_name(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
if ((value === '') || (value.charAt(0) === ' ') || (value.charAt(value.length - 1) === ' '))
throw Error.argument('value', Sys.Res.invalidId);
if (typeof(this._element[value]) !== 'undefined')
throw Error.invalidOperation(String.format(Sys.Res.behaviorDuplicateName, value));
if (this.get_isInitialized()) throw Error.invalidOperation(Sys.Res.cantSetNameAfterInit);
this._name = value;
}
function Sys$UI$Behavior$initialize() {
Sys.UI.Behavior.callBaseMethod(this, 'initialize');
var name = this.get_name();
if (name) this._element[name] = this;
}
function Sys$UI$Behavior$dispose() {
Sys.UI.Behavior.callBaseMethod(this, 'dispose');
var e = this._element;
if (e) {
var name = this.get_name();
if (name) {
e[name] = null;
}
var behaviors = e._behaviors;
Array.remove(behaviors, this);
if (behaviors.length === 0) {
e._behaviors = null;
}
delete this._element;
}
}
Sys.UI.Behavior.prototype = {
_name: null,
get_element: Sys$UI$Behavior$get_element,
get_id: Sys$UI$Behavior$get_id,
get_name: Sys$UI$Behavior$get_name,
set_name: Sys$UI$Behavior$set_name,
initialize: Sys$UI$Behavior$initialize,
dispose: Sys$UI$Behavior$dispose
}
Sys.UI.Behavior.registerClass('Sys.UI.Behavior', Sys.Component);
Sys.UI.Behavior.getBehaviorByName = function Sys$UI$Behavior$getBehaviorByName(element, name) {
/// <summary locid="M:J#Sys.UI.Behavior.getBehaviorByName" />
/// <param name="element" domElement="true"></param>
/// <param name="name" type="String"></param>
/// <returns type="Sys.UI.Behavior" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "name", type: String}
]);
if (e) throw e;
var b = element[name];
return (b && Sys.UI.Behavior.isInstanceOfType(b)) ? b : null;
}
Sys.UI.Behavior.getBehaviors = function Sys$UI$Behavior$getBehaviors(element) {
/// <summary locid="M:J#Sys.UI.Behavior.getBehaviors" />
/// <param name="element" domElement="true"></param>
/// <returns type="Array" elementType="Sys.UI.Behavior"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
if (!element._behaviors) return [];
return Array.clone(element._behaviors);
}
Sys.UI.Behavior.getBehaviorsByType = function Sys$UI$Behavior$getBehaviorsByType(element, type) {
/// <summary locid="M:J#Sys.UI.Behavior.getBehaviorsByType" />
/// <param name="element" domElement="true"></param>
/// <param name="type" type="Type"></param>
/// <returns type="Array" elementType="Sys.UI.Behavior"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true},
{name: "type", type: Type}
]);
if (e) throw e;
var behaviors = element._behaviors;
var results = [];
if (behaviors) {
for (var i = 0, l = behaviors.length; i < l; i++) {
if (type.isInstanceOfType(behaviors[i])) {
results[results.length] = behaviors[i];
}
}
}
return results;
}
Sys.UI.VisibilityMode = function Sys$UI$VisibilityMode() {
/// <summary locid="M:J#Sys.UI.VisibilityMode.#ctor" />
/// <field name="hide" type="Number" integer="true" static="true" locid="F:J#Sys.UI.VisibilityMode.hide"></field>
/// <field name="collapse" type="Number" integer="true" static="true" locid="F:J#Sys.UI.VisibilityMode.collapse"></field>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
Sys.UI.VisibilityMode.prototype = {
hide: 0,
collapse: 1
}
Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");
Sys.UI.Control = function Sys$UI$Control(element) {
/// <summary locid="M:J#Sys.UI.Control.#ctor" />
/// <param name="element" domElement="true"></param>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
if (typeof(element.control) !== 'undefined') throw Error.invalidOperation(Sys.Res.controlAlreadyDefined);
Sys.UI.Control.initializeBase(this);
this._element = element;
element.control = this;
var role = this.get_role();
if (role) {
element.setAttribute("role", role);
}
}
function Sys$UI$Control$get_element() {
/// <value domElement="true" locid="P:J#Sys.UI.Control.element"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._element;
}
function Sys$UI$Control$get_id() {
/// <value type="String" locid="P:J#Sys.UI.Control.id"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._element) return '';
return this._element.id;
}
function Sys$UI$Control$set_id(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
throw Error.invalidOperation(Sys.Res.cantSetId);
}
function Sys$UI$Control$get_parent() {
/// <value type="Sys.UI.Control" locid="P:J#Sys.UI.Control.parent"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (this._parent) return this._parent;
if (!this._element) return null;
var parentElement = this._element.parentNode;
while (parentElement) {
if (parentElement.control) {
return parentElement.control;
}
parentElement = parentElement.parentNode;
}
return null;
}
function Sys$UI$Control$set_parent(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.Control}]);
if (e) throw e;
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
var parents = [this];
var current = value;
while (current) {
if (Array.contains(parents, current)) throw Error.invalidOperation(Sys.Res.circularParentChain);
parents[parents.length] = current;
current = current.get_parent();
}
this._parent = value;
}
function Sys$UI$Control$get_role() {
/// <value type="String" locid="P:J#Sys.UI.Control.role"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return null;
}
function Sys$UI$Control$get_visibilityMode() {
/// <value type="Sys.UI.VisibilityMode" locid="P:J#Sys.UI.Control.visibilityMode"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
return Sys.UI.DomElement.getVisibilityMode(this._element);
}
function Sys$UI$Control$set_visibilityMode(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.VisibilityMode}]);
if (e) throw e;
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
Sys.UI.DomElement.setVisibilityMode(this._element, value);
}
function Sys$UI$Control$get_visible() {
/// <value type="Boolean" locid="P:J#Sys.UI.Control.visible"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
return Sys.UI.DomElement.getVisible(this._element);
}
function Sys$UI$Control$set_visible(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]);
if (e) throw e;
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
Sys.UI.DomElement.setVisible(this._element, value)
}
function Sys$UI$Control$addCssClass(className) {
/// <summary locid="M:J#Sys.UI.Control.addCssClass" />
/// <param name="className" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "className", type: String}
]);
if (e) throw e;
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
Sys.UI.DomElement.addCssClass(this._element, className);
}
function Sys$UI$Control$dispose() {
Sys.UI.Control.callBaseMethod(this, 'dispose');
if (this._element) {
this._element.control = null;
delete this._element;
}
if (this._parent) delete this._parent;
}
function Sys$UI$Control$onBubbleEvent(source, args) {
/// <summary locid="M:J#Sys.UI.Control.onBubbleEvent" />
/// <param name="source"></param>
/// <param name="args" type="Sys.EventArgs"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "source"},
{name: "args", type: Sys.EventArgs}
]);
if (e) throw e;
return false;
}
function Sys$UI$Control$raiseBubbleEvent(source, args) {
/// <summary locid="M:J#Sys.UI.Control.raiseBubbleEvent" />
/// <param name="source"></param>
/// <param name="args" type="Sys.EventArgs"></param>
var e = Function._validateParams(arguments, [
{name: "source"},
{name: "args", type: Sys.EventArgs}
]);
if (e) throw e;
this._raiseBubbleEvent(source, args);
}
function Sys$UI$Control$_raiseBubbleEvent(source, args) {
var currentTarget = this.get_parent();
while (currentTarget) {
if (currentTarget.onBubbleEvent(source, args)) {
return;
}
currentTarget = currentTarget.get_parent();
}
}
function Sys$UI$Control$removeCssClass(className) {
/// <summary locid="M:J#Sys.UI.Control.removeCssClass" />
/// <param name="className" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "className", type: String}
]);
if (e) throw e;
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
Sys.UI.DomElement.removeCssClass(this._element, className);
}
function Sys$UI$Control$toggleCssClass(className) {
/// <summary locid="M:J#Sys.UI.Control.toggleCssClass" />
/// <param name="className" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "className", type: String}
]);
if (e) throw e;
if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
Sys.UI.DomElement.toggleCssClass(this._element, className);
}
Sys.UI.Control.prototype = {
_parent: null,
_visibilityMode: Sys.UI.VisibilityMode.hide,
get_element: Sys$UI$Control$get_element,
get_id: Sys$UI$Control$get_id,
set_id: Sys$UI$Control$set_id,
get_parent: Sys$UI$Control$get_parent,
set_parent: Sys$UI$Control$set_parent,
get_role: Sys$UI$Control$get_role,
get_visibilityMode: Sys$UI$Control$get_visibilityMode,
set_visibilityMode: Sys$UI$Control$set_visibilityMode,
get_visible: Sys$UI$Control$get_visible,
set_visible: Sys$UI$Control$set_visible,
addCssClass: Sys$UI$Control$addCssClass,
dispose: Sys$UI$Control$dispose,
onBubbleEvent: Sys$UI$Control$onBubbleEvent,
raiseBubbleEvent: Sys$UI$Control$raiseBubbleEvent,
_raiseBubbleEvent: Sys$UI$Control$_raiseBubbleEvent,
removeCssClass: Sys$UI$Control$removeCssClass,
toggleCssClass: Sys$UI$Control$toggleCssClass
}
Sys.UI.Control.registerClass('Sys.UI.Control', Sys.Component);
Sys.HistoryEventArgs = function Sys$HistoryEventArgs(state) {
/// <summary locid="M:J#Sys.HistoryEventArgs.#ctor" />
/// <param name="state" type="Object"></param>
var e = Function._validateParams(arguments, [
{name: "state", type: Object}
]);
if (e) throw e;
Sys.HistoryEventArgs.initializeBase(this);
this._state = state;
}
function Sys$HistoryEventArgs$get_state() {
/// <value type="Object" locid="P:J#Sys.HistoryEventArgs.state"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._state;
}
Sys.HistoryEventArgs.prototype = {
get_state: Sys$HistoryEventArgs$get_state
}
Sys.HistoryEventArgs.registerClass('Sys.HistoryEventArgs', Sys.EventArgs);
Sys.Application._appLoadHandler = null;
Sys.Application._beginRequestHandler = null;
Sys.Application._clientId = null;
Sys.Application._currentEntry = '';
Sys.Application._endRequestHandler = null;
Sys.Application._history = null;
Sys.Application._enableHistory = false;
Sys.Application._historyEnabledInScriptManager = false;
Sys.Application._historyFrame = null;
Sys.Application._historyInitialized = false;
Sys.Application._historyPointIsNew = false;
Sys.Application._ignoreTimer = false;
Sys.Application._initialState = null;
Sys.Application._state = {};
Sys.Application._timerCookie = 0;
Sys.Application._timerHandler = null;
Sys.Application._uniqueId = null;
Sys._Application.prototype.get_stateString = function Sys$_Application$get_stateString() {
/// <summary locid="M:J#Sys._Application.get_stateString" />
if (arguments.length !== 0) throw Error.parameterCount();
var hash = null;
if (Sys.Browser.agent === Sys.Browser.Firefox) {
var href = window.location.href;
var hashIndex = href.indexOf('#');
if (hashIndex !== -1) {
hash = href.substring(hashIndex + 1);
}
else {
hash = "";
}
return hash;
}
else {
hash = window.location.hash;
}
if ((hash.length > 0) && (hash.charAt(0) === '#')) {
hash = hash.substring(1);
}
return hash;
};
Sys._Application.prototype.get_enableHistory = function Sys$_Application$get_enableHistory() {
/// <summary locid="M:J#Sys._Application.get_enableHistory" />
if (arguments.length !== 0) throw Error.parameterCount();
return this._enableHistory;
};
Sys._Application.prototype.set_enableHistory = function Sys$_Application$set_enableHistory(value) {
if (this._initialized && !this._initializing) {
throw Error.invalidOperation(Sys.Res.historyCannotEnableHistory);
}
else if (this._historyEnabledInScriptManager && !value) {
throw Error.invalidOperation(Sys.Res.invalidHistorySettingCombination);
}
this._enableHistory = value;
};
Sys._Application.prototype.add_navigate = function Sys$_Application$add_navigate(handler) {
/// <summary locid="E:J#Sys.Application.navigate" />
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "handler", type: Function}
]);
if (e) throw e;
this.get_events().addHandler("navigate", handler);
};
Sys._Application.prototype.remove_navigate = function Sys$_Application$remove_navigate(handler) {
/// <summary locid="M:J#Sys._Application.remove_navigate" />
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "handler", type: Function}
]);
if (e) throw e;
this.get_events().removeHandler("navigate", handler);
};
Sys._Application.prototype.addHistoryPoint = function Sys$_Application$addHistoryPoint(state, title) {
/// <summary locid="M:J#Sys.Application.addHistoryPoint" />
/// <param name="state" type="Object"></param>
/// <param name="title" type="String" optional="true" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "state", type: Object},
{name: "title", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
if (!this._enableHistory) throw Error.invalidOperation(Sys.Res.historyCannotAddHistoryPointWithHistoryDisabled);
for (var n in state) {
var v = state[n];
var t = typeof(v);
if ((v !== null) && ((t === 'object') || (t === 'function') || (t === 'undefined'))) {
throw Error.argument('state', Sys.Res.stateMustBeStringDictionary);
}
}
this._ensureHistory();
var initialState = this._state;
for (var key in state) {
var value = state[key];
if (value === null) {
if (typeof(initialState[key]) !== 'undefined') {
delete initialState[key];
}
}
else {
initialState[key] = value;
}
}
var entry = this._serializeState(initialState);
this._historyPointIsNew = true;
this._setState(entry, title);
this._raiseNavigate();
};
Sys._Application.prototype.setServerId = function Sys$_Application$setServerId(clientId, uniqueId) {
/// <summary locid="M:J#Sys.Application.setServerId" />
/// <param name="clientId" type="String"></param>
/// <param name="uniqueId" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "clientId", type: String},
{name: "uniqueId", type: String}
]);
if (e) throw e;
this._clientId = clientId;
this._uniqueId = uniqueId;
};
Sys._Application.prototype.setServerState = function Sys$_Application$setServerState(value) {
/// <summary locid="M:J#Sys.Application.setServerState" />
/// <param name="value" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "value", type: String}
]);
if (e) throw e;
this._ensureHistory();
this._state.__s = value;
this._updateHiddenField(value);
};
Sys._Application.prototype._deserializeState = function Sys$_Application$_deserializeState(entry) {
var result = {};
entry = entry || '';
var serverSeparator = entry.indexOf('&&');
if ((serverSeparator !== -1) && (serverSeparator + 2 < entry.length)) {
result.__s = entry.substr(serverSeparator + 2);
entry = entry.substr(0, serverSeparator);
}
var tokens = entry.split('&');
for (var i = 0, l = tokens.length; i < l; i++) {
var token = tokens[i];
var equal = token.indexOf('=');
if ((equal !== -1) && (equal + 1 < token.length)) {
var name = token.substr(0, equal);
var value = token.substr(equal + 1);
result[name] = decodeURIComponent(value);
}
}
return result;
};
Sys._Application.prototype._enableHistoryInScriptManager = function Sys$_Application$_enableHistoryInScriptManager() {
this._enableHistory = true;
this._historyEnabledInScriptManager = true;
};
Sys._Application.prototype._ensureHistory = function Sys$_Application$_ensureHistory() {
if (!this._historyInitialized && this._enableHistory) {
if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.documentMode < 8)) {
this._historyFrame = document.getElementById('__historyFrame');
if (!this._historyFrame) throw Error.invalidOperation(Sys.Res.historyMissingFrame);
this._ignoreIFrame = true;
}
this._timerHandler = Function.createDelegate(this, this._onIdle);
this._timerCookie = window.setTimeout(this._timerHandler, 100);
try {
this._initialState = this._deserializeState(this.get_stateString());
} catch(e) {}
this._historyInitialized = true;
}
};
Sys._Application.prototype._navigate = function Sys$_Application$_navigate(entry) {
this._ensureHistory();
var state = this._deserializeState(entry);
if (this._uniqueId) {
var oldServerEntry = this._state.__s || '';
var newServerEntry = state.__s || '';
if (newServerEntry !== oldServerEntry) {
this._updateHiddenField(newServerEntry);
__doPostBack(this._uniqueId, newServerEntry);
this._state = state;
return;
}
}
this._setState(entry);
this._state = state;
this._raiseNavigate();
};
Sys._Application.prototype._onIdle = function Sys$_Application$_onIdle() {
delete this._timerCookie;
var entry = this.get_stateString();
if (entry !== this._currentEntry) {
if (!this._ignoreTimer) {
this._historyPointIsNew = false;
this._navigate(entry);
}
}
else {
this._ignoreTimer = false;
}
this._timerCookie = window.setTimeout(this._timerHandler, 100);
};
Sys._Application.prototype._onIFrameLoad = function Sys$_Application$_onIFrameLoad(entry) {
this._ensureHistory();
if (!this._ignoreIFrame) {
this._historyPointIsNew = false;
this._navigate(entry);
}
this._ignoreIFrame = false;
};
Sys._Application.prototype._onPageRequestManagerBeginRequest = function Sys$_Application$_onPageRequestManagerBeginRequest(sender, args) {
this._ignoreTimer = true;
};
Sys._Application.prototype._onPageRequestManagerEndRequest = function Sys$_Application$_onPageRequestManagerEndRequest(sender, args) {
var dataItem = args.get_dataItems()[this._clientId];
var eventTarget = document.getElementById("__EVENTTARGET");
if (eventTarget && eventTarget.value === this._uniqueId) {
eventTarget.value = '';
}
if (typeof(dataItem) !== 'undefined') {
this.setServerState(dataItem);
this._historyPointIsNew = true;
}
else {
this._ignoreTimer = false;
}
var entry = this._serializeState(this._state);
if (entry !== this._currentEntry) {
this._ignoreTimer = true;
this._setState(entry);
this._raiseNavigate();
}
};
Sys._Application.prototype._raiseNavigate = function Sys$_Application$_raiseNavigate() {
var h = this.get_events().getHandler("navigate");
var stateClone = {};
for (var key in this._state) {
if (key !== '__s') {
stateClone[key] = this._state[key];
}
}
var args = new Sys.HistoryEventArgs(stateClone);
if (h) {
h(this, args);
}
var err;
try {
if ((Sys.Browser.agent === Sys.Browser.Firefox) && window.location.hash &&
(!window.frameElement || window.top.location.hash)) {
window.history.go(0);
}
}
catch(err) {
}
};
Sys._Application.prototype._serializeState = function Sys$_Application$_serializeState(state) {
var serialized = [];
for (var key in state) {
var value = state[key];
if (key === '__s') {
var serverState = value;
}
else {
if (key.indexOf('=') !== -1) throw Error.argument('state', Sys.Res.stateFieldNameInvalid);
serialized[serialized.length] = key + '=' + encodeURIComponent(value);
}
}
return serialized.join('&') + (serverState ? '&&' + serverState : '');
};
Sys._Application.prototype._setState = function Sys$_Application$_setState(entry, title) {
if (this._enableHistory) {
entry = entry || '';
if (entry !== this._currentEntry) {
if (window.theForm) {
var action = window.theForm.action;
var hashIndex = action.indexOf('#');
window.theForm.action = ((hashIndex !== -1) ? action.substring(0, hashIndex) : action) + '#' + entry;
}
if (this._historyFrame && this._historyPointIsNew) {
this._ignoreIFrame = true;
var frameDoc = this._historyFrame.contentWindow.document;
frameDoc.open("javascript:'<html></html>'");
frameDoc.write("<html><head><title>" + (title || document.title) +
"</title><scri" + "pt type=\"text/javascript\">parent.Sys.Application._onIFrameLoad(" +
Sys.Serialization.JavaScriptSerializer.serialize(entry) +
");</scri" + "pt></head><body></body></html>");
frameDoc.close();
}
this._ignoreTimer = false;
this._currentEntry = entry;
if (this._historyFrame || this._historyPointIsNew) {
var currentHash = this.get_stateString();
if (entry !== currentHash) {
var loc = document.location;
if (loc.href.length - loc.hash.length + entry.length > 1024) {
throw Error.invalidOperation(Sys.Res.urlMustBeLessThan1024chars);
}
window.location.hash = entry;
this._currentEntry = this.get_stateString();
if ((typeof(title) !== 'undefined') && (title !== null)) {
document.title = title;
}
}
}
this._historyPointIsNew = false;
}
}
};
Sys._Application.prototype._updateHiddenField = function Sys$_Application$_updateHiddenField(value) {
if (this._clientId) {
var serverStateField = document.getElementById(this._clientId);
if (serverStateField) {
serverStateField.value = value;
}
}
};
if (!window.XMLHttpRequest) {
window.XMLHttpRequest = function window$XMLHttpRequest() {
var progIDs = [ 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP' ];
for (var i = 0, l = progIDs.length; i < l; i++) {
try {
return new ActiveXObject(progIDs[i]);
}
catch (ex) {
}
}
return null;
}
}
Type.registerNamespace('Sys.Net');
Sys.Net.WebRequestExecutor = function Sys$Net$WebRequestExecutor() {
/// <summary locid="M:J#Sys.Net.WebRequestExecutor.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
this._webRequest = null;
this._resultObject = null;
}
function Sys$Net$WebRequestExecutor$get_webRequest() {
/// <value type="Sys.Net.WebRequest" locid="P:J#Sys.Net.WebRequestExecutor.webRequest"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._webRequest;
}
function Sys$Net$WebRequestExecutor$_set_webRequest(value) {
if (this.get_started()) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'set_webRequest'));
}
this._webRequest = value;
}
function Sys$Net$WebRequestExecutor$get_started() {
/// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.started"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_responseAvailable() {
/// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.responseAvailable"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_timedOut() {
/// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.timedOut"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_aborted() {
/// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.aborted"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_responseData() {
/// <value type="String" locid="P:J#Sys.Net.WebRequestExecutor.responseData"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_statusCode() {
/// <value type="Number" locid="P:J#Sys.Net.WebRequestExecutor.statusCode"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_statusText() {
/// <value type="String" locid="P:J#Sys.Net.WebRequestExecutor.statusText"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_xml() {
/// <value locid="P:J#Sys.Net.WebRequestExecutor.xml"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$get_object() {
/// <value locid="P:J#Sys.Net.WebRequestExecutor.object"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._resultObject) {
this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());
}
return this._resultObject;
}
function Sys$Net$WebRequestExecutor$executeRequest() {
/// <summary locid="M:J#Sys.Net.WebRequestExecutor.executeRequest" />
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$abort() {
/// <summary locid="M:J#Sys.Net.WebRequestExecutor.abort" />
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$getResponseHeader(header) {
/// <summary locid="M:J#Sys.Net.WebRequestExecutor.getResponseHeader" />
/// <param name="header" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "header", type: String}
]);
if (e) throw e;
throw Error.notImplemented();
}
function Sys$Net$WebRequestExecutor$getAllResponseHeaders() {
/// <summary locid="M:J#Sys.Net.WebRequestExecutor.getAllResponseHeaders" />
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
Sys.Net.WebRequestExecutor.prototype = {
get_webRequest: Sys$Net$WebRequestExecutor$get_webRequest,
_set_webRequest: Sys$Net$WebRequestExecutor$_set_webRequest,
get_started: Sys$Net$WebRequestExecutor$get_started,
get_responseAvailable: Sys$Net$WebRequestExecutor$get_responseAvailable,
get_timedOut: Sys$Net$WebRequestExecutor$get_timedOut,
get_aborted: Sys$Net$WebRequestExecutor$get_aborted,
get_responseData: Sys$Net$WebRequestExecutor$get_responseData,
get_statusCode: Sys$Net$WebRequestExecutor$get_statusCode,
get_statusText: Sys$Net$WebRequestExecutor$get_statusText,
get_xml: Sys$Net$WebRequestExecutor$get_xml,
get_object: Sys$Net$WebRequestExecutor$get_object,
executeRequest: Sys$Net$WebRequestExecutor$executeRequest,
abort: Sys$Net$WebRequestExecutor$abort,
getResponseHeader: Sys$Net$WebRequestExecutor$getResponseHeader,
getAllResponseHeaders: Sys$Net$WebRequestExecutor$getAllResponseHeaders
}
Sys.Net.WebRequestExecutor.registerClass('Sys.Net.WebRequestExecutor');
Sys.Net.XMLDOM = function Sys$Net$XMLDOM(markup) {
/// <summary locid="M:J#Sys.Net.XMLDOM.#ctor" />
/// <param name="markup" type="String"></param>
var e = Function._validateParams(arguments, [
{name: "markup", type: String}
]);
if (e) throw e;
if (!window.DOMParser) {
var progIDs = [ 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ];
for (var i = 0, l = progIDs.length; i < l; i++) {
try {
var xmlDOM = new ActiveXObject(progIDs[i]);
xmlDOM.async = false;
xmlDOM.loadXML(markup);
xmlDOM.setProperty('SelectionLanguage', 'XPath');
return xmlDOM;
}
catch (ex) {
}
}
}
else {
try {
var domParser = new window.DOMParser();
return domParser.parseFromString(markup, 'text/xml');
}
catch (ex) {
}
}
return null;
}
Sys.Net.XMLHttpExecutor = function Sys$Net$XMLHttpExecutor() {
/// <summary locid="M:J#Sys.Net.XMLHttpExecutor.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
Sys.Net.XMLHttpExecutor.initializeBase(this);
var _this = 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 (_this._xmlHttpRequest.readyState === 4 ) {
try {
if (typeof(_this._xmlHttpRequest.status) === "undefined") {
return;
}
}
catch(ex) {
return;
}
_this._clearTimer();
_this._responseAvailable = true;
_this._webRequest.completed(Sys.EventArgs.Empty);
if (_this._xmlHttpRequest != null) {
_this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
_this._xmlHttpRequest = null;
}
}
});
this._clearTimer = (function() {
if (_this._timer != null) {
window.clearTimeout(_this._timer);
_this._timer = null;
}
});
this._onTimeout = (function() {
if (!_this._responseAvailable) {
_this._clearTimer();
_this._timedOut = true;
_this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
_this._xmlHttpRequest.abort();
_this._webRequest.completed(Sys.EventArgs.Empty);
_this._xmlHttpRequest = null;
}
});
}
function Sys$Net$XMLHttpExecutor$get_timedOut() {
/// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.timedOut"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._timedOut;
}
function Sys$Net$XMLHttpExecutor$get_started() {
/// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.started"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._started;
}
function Sys$Net$XMLHttpExecutor$get_responseAvailable() {
/// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.responseAvailable"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._responseAvailable;
}
function Sys$Net$XMLHttpExecutor$get_aborted() {
/// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.aborted"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._aborted;
}
function Sys$Net$XMLHttpExecutor$executeRequest() {
/// <summary locid="M:J#Sys.Net.XMLHttpExecutor.executeRequest" />
if (arguments.length !== 0) throw Error.parameterCount();
this._webRequest = this.get_webRequest();
if (this._started) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'executeRequest'));
}
if (this._webRequest === null) {
throw Error.invalidOperation(Sys.Res.nullWebRequest);
}
var body = this._webRequest.get_body();
var headers = this._webRequest.get_headers();
this._xmlHttpRequest = new XMLHttpRequest();
this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange;
var verb = this._webRequest.get_httpVerb();
this._xmlHttpRequest.open(verb, this._webRequest.getResolvedUrl(), true );
this._xmlHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
if (headers) {
for (var header in headers) {
var val = headers[header];
if (typeof(val) !== "function")
this._xmlHttpRequest.setRequestHeader(header, val);
}
}
if (verb.toLowerCase() === "post") {
if ((headers === null) || !headers['Content-Type']) {
this._xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
}
if (!body) {
body = "";
}
}
var timeout = this._webRequest.get_timeout();
if (timeout > 0) {
this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), timeout);
}
this._xmlHttpRequest.send(body);
this._started = true;
}
function Sys$Net$XMLHttpExecutor$getResponseHeader(header) {
/// <summary locid="M:J#Sys.Net.XMLHttpExecutor.getResponseHeader" />
/// <param name="header" type="String"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "header", type: String}
]);
if (e) throw e;
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getResponseHeader'));
}
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getResponseHeader'));
}
var result;
try {
result = this._xmlHttpRequest.getResponseHeader(header);
} catch (e) {
}
if (!result) result = "";
return result;
}
function Sys$Net$XMLHttpExecutor$getAllResponseHeaders() {
/// <summary locid="M:J#Sys.Net.XMLHttpExecutor.getAllResponseHeaders" />
/// <returns type="String"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getAllResponseHeaders'));
}
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getAllResponseHeaders'));
}
return this._xmlHttpRequest.getAllResponseHeaders();
}
function Sys$Net$XMLHttpExecutor$get_responseData() {
/// <value type="String" locid="P:J#Sys.Net.XMLHttpExecutor.responseData"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_responseData'));
}
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_responseData'));
}
return this._xmlHttpRequest.responseText;
}
function Sys$Net$XMLHttpExecutor$get_statusCode() {
/// <value type="Number" locid="P:J#Sys.Net.XMLHttpExecutor.statusCode"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusCode'));
}
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusCode'));
}
var result = 0;
try {
result = this._xmlHttpRequest.status;
}
catch(ex) {
}
return result;
}
function Sys$Net$XMLHttpExecutor$get_statusText() {
/// <value type="String" locid="P:J#Sys.Net.XMLHttpExecutor.statusText"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusText'));
}
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusText'));
}
return this._xmlHttpRequest.statusText;
}
function Sys$Net$XMLHttpExecutor$get_xml() {
/// <value locid="P:J#Sys.Net.XMLHttpExecutor.xml"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_xml'));
}
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_xml'));
}
var xml = this._xmlHttpRequest.responseXML;
if (!xml || !xml.documentElement) {
xml = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);
if (!xml || !xml.documentElement)
return null;
}
else if (navigator.userAgent.indexOf('MSIE') !== -1) {
xml.setProperty('SelectionLanguage', 'XPath');
}
if (xml.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" &&
xml.documentElement.tagName === "parsererror") {
return null;
}
if (xml.documentElement.firstChild && xml.documentElement.firstChild.tagName === "parsererror") {
return null;
}
return xml;
}
function Sys$Net$XMLHttpExecutor$abort() {
/// <summary locid="M:J#Sys.Net.XMLHttpExecutor.abort" />
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._started) {
throw Error.invalidOperation(Sys.Res.cannotAbortBeforeStart);
}
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.prototype = {
get_timedOut: Sys$Net$XMLHttpExecutor$get_timedOut,
get_started: Sys$Net$XMLHttpExecutor$get_started,
get_responseAvailable: Sys$Net$XMLHttpExecutor$get_responseAvailable,
get_aborted: Sys$Net$XMLHttpExecutor$get_aborted,
executeRequest: Sys$Net$XMLHttpExecutor$executeRequest,
getResponseHeader: Sys$Net$XMLHttpExecutor$getResponseHeader,
getAllResponseHeaders: Sys$Net$XMLHttpExecutor$getAllResponseHeaders,
get_responseData: Sys$Net$XMLHttpExecutor$get_responseData,
get_statusCode: Sys$Net$XMLHttpExecutor$get_statusCode,
get_statusText: Sys$Net$XMLHttpExecutor$get_statusText,
get_xml: Sys$Net$XMLHttpExecutor$get_xml,
abort: Sys$Net$XMLHttpExecutor$abort
}
Sys.Net.XMLHttpExecutor.registerClass('Sys.Net.XMLHttpExecutor', Sys.Net.WebRequestExecutor);
Sys.Net._WebRequestManager = function Sys$Net$_WebRequestManager() {
/// <summary locid="P:J#Sys.Net.WebRequestManager.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
this._defaultTimeout = 0;
this._defaultExecutorType = "Sys.Net.XMLHttpExecutor";
}
function Sys$Net$_WebRequestManager$add_invokingRequest(handler) {
/// <summary locid="E:J#Sys.Net.WebRequestManager.invokingRequest" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this._get_eventHandlerList().addHandler("invokingRequest", handler);
}
function Sys$Net$_WebRequestManager$remove_invokingRequest(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this._get_eventHandlerList().removeHandler("invokingRequest", handler);
}
function Sys$Net$_WebRequestManager$add_completedRequest(handler) {
/// <summary locid="E:J#Sys.Net.WebRequestManager.completedRequest" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this._get_eventHandlerList().addHandler("completedRequest", handler);
}
function Sys$Net$_WebRequestManager$remove_completedRequest(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this._get_eventHandlerList().removeHandler("completedRequest", handler);
}
function Sys$Net$_WebRequestManager$_get_eventHandlerList() {
if (!this._events) {
this._events = new Sys.EventHandlerList();
}
return this._events;
}
function Sys$Net$_WebRequestManager$get_defaultTimeout() {
/// <value type="Number" locid="P:J#Sys.Net.WebRequestManager.defaultTimeout"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._defaultTimeout;
}
function Sys$Net$_WebRequestManager$set_defaultTimeout(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Number}]);
if (e) throw e;
if (value < 0) {
throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout);
}
this._defaultTimeout = value;
}
function Sys$Net$_WebRequestManager$get_defaultExecutorType() {
/// <value type="String" locid="P:J#Sys.Net.WebRequestManager.defaultExecutorType"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._defaultExecutorType;
}
function Sys$Net$_WebRequestManager$set_defaultExecutorType(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
this._defaultExecutorType = value;
}
function Sys$Net$_WebRequestManager$executeRequest(webRequest) {
/// <summary locid="M:J#Sys.Net.WebRequestManager.executeRequest" />
/// <param name="webRequest" type="Sys.Net.WebRequest"></param>
var e = Function._validateParams(arguments, [
{name: "webRequest", type: Sys.Net.WebRequest}
]);
if (e) throw e;
var executor = webRequest.get_executor();
if (!executor) {
var failed = false;
try {
var executorType = eval(this._defaultExecutorType);
executor = new executorType();
} catch (e) {
failed = true;
}
if (failed || !Sys.Net.WebRequestExecutor.isInstanceOfType(executor) || !executor) {
throw Error.argument("defaultExecutorType", String.format(Sys.Res.invalidExecutorType, this._defaultExecutorType));
}
webRequest.set_executor(executor);
}
if (executor.get_aborted()) {
return;
}
var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest);
var handler = this._get_eventHandlerList().getHandler("invokingRequest");
if (handler) {
handler(this, evArgs);
}
if (!evArgs.get_cancel()) {
executor.executeRequest();
}
}
Sys.Net._WebRequestManager.prototype = {
add_invokingRequest: Sys$Net$_WebRequestManager$add_invokingRequest,
remove_invokingRequest: Sys$Net$_WebRequestManager$remove_invokingRequest,
add_completedRequest: Sys$Net$_WebRequestManager$add_completedRequest,
remove_completedRequest: Sys$Net$_WebRequestManager$remove_completedRequest,
_get_eventHandlerList: Sys$Net$_WebRequestManager$_get_eventHandlerList,
get_defaultTimeout: Sys$Net$_WebRequestManager$get_defaultTimeout,
set_defaultTimeout: Sys$Net$_WebRequestManager$set_defaultTimeout,
get_defaultExecutorType: Sys$Net$_WebRequestManager$get_defaultExecutorType,
set_defaultExecutorType: Sys$Net$_WebRequestManager$set_defaultExecutorType,
executeRequest: Sys$Net$_WebRequestManager$executeRequest
}
Sys.Net._WebRequestManager.registerClass('Sys.Net._WebRequestManager');
Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager();
Sys.Net.NetworkRequestEventArgs = function Sys$Net$NetworkRequestEventArgs(webRequest) {
/// <summary locid="M:J#Sys.Net.NetworkRequestEventArgs.#ctor" />
/// <param name="webRequest" type="Sys.Net.WebRequest"></param>
var e = Function._validateParams(arguments, [
{name: "webRequest", type: Sys.Net.WebRequest}
]);
if (e) throw e;
Sys.Net.NetworkRequestEventArgs.initializeBase(this);
this._webRequest = webRequest;
}
function Sys$Net$NetworkRequestEventArgs$get_webRequest() {
/// <value type="Sys.Net.WebRequest" locid="P:J#Sys.Net.NetworkRequestEventArgs.webRequest"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._webRequest;
}
Sys.Net.NetworkRequestEventArgs.prototype = {
get_webRequest: Sys$Net$NetworkRequestEventArgs$get_webRequest
}
Sys.Net.NetworkRequestEventArgs.registerClass('Sys.Net.NetworkRequestEventArgs', Sys.CancelEventArgs);
Sys.Net.WebRequest = function Sys$Net$WebRequest() {
/// <summary locid="M:J#Sys.Net.WebRequest.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
this._url = "";
this._headers = { };
this._body = null;
this._userContext = null;
this._httpVerb = null;
this._executor = null;
this._invokeCalled = false;
this._timeout = 0;
}
function Sys$Net$WebRequest$add_completed(handler) {
/// <summary locid="E:J#Sys.Net.WebRequest.completed" />
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this._get_eventHandlerList().addHandler("completed", handler);
}
function Sys$Net$WebRequest$remove_completed(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
if (e) throw e;
this._get_eventHandlerList().removeHandler("completed", handler);
}
function Sys$Net$WebRequest$completed(eventArgs) {
/// <summary locid="M:J#Sys.Net.WebRequest.completed" />
/// <param name="eventArgs" type="Sys.EventArgs"></param>
var e = Function._validateParams(arguments, [
{name: "eventArgs", type: Sys.EventArgs}
]);
if (e) throw e;
var handler = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");
if (handler) {
handler(this._executor, eventArgs);
}
handler = this._get_eventHandlerList().getHandler("completed");
if (handler) {
handler(this._executor, eventArgs);
}
}
function Sys$Net$WebRequest$_get_eventHandlerList() {
if (!this._events) {
this._events = new Sys.EventHandlerList();
}
return this._events;
}
function Sys$Net$WebRequest$get_url() {
/// <value type="String" locid="P:J#Sys.Net.WebRequest.url"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._url;
}
function Sys$Net$WebRequest$set_url(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
this._url = value;
}
function Sys$Net$WebRequest$get_headers() {
/// <value locid="P:J#Sys.Net.WebRequest.headers"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._headers;
}
function Sys$Net$WebRequest$get_httpVerb() {
/// <value type="String" locid="P:J#Sys.Net.WebRequest.httpVerb"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (this._httpVerb === null) {
if (this._body === null) {
return "GET";
}
return "POST";
}
return this._httpVerb;
}
function Sys$Net$WebRequest$set_httpVerb(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
if (value.length === 0) {
throw Error.argument('value', Sys.Res.invalidHttpVerb);
}
this._httpVerb = value;
}
function Sys$Net$WebRequest$get_body() {
/// <value mayBeNull="true" locid="P:J#Sys.Net.WebRequest.body"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._body;
}
function Sys$Net$WebRequest$set_body(value) {
var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]);
if (e) throw e;
this._body = value;
}
function Sys$Net$WebRequest$get_userContext() {
/// <value mayBeNull="true" locid="P:J#Sys.Net.WebRequest.userContext"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._userContext;
}
function Sys$Net$WebRequest$set_userContext(value) {
var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]);
if (e) throw e;
this._userContext = value;
}
function Sys$Net$WebRequest$get_executor() {
/// <value type="Sys.Net.WebRequestExecutor" locid="P:J#Sys.Net.WebRequest.executor"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._executor;
}
function Sys$Net$WebRequest$set_executor(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Sys.Net.WebRequestExecutor}]);
if (e) throw e;
if (this._executor !== null && this._executor.get_started()) {
throw Error.invalidOperation(Sys.Res.setExecutorAfterActive);
}
this._executor = value;
this._executor._set_webRequest(this);
}
function Sys$Net$WebRequest$get_timeout() {
/// <value type="Number" locid="P:J#Sys.Net.WebRequest.timeout"></value>
if (arguments.length !== 0) throw Error.parameterCount();
if (this._timeout === 0) {
return Sys.Net.WebRequestManager.get_defaultTimeout();
}
return this._timeout;
}
function Sys$Net$WebRequest$set_timeout(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Number}]);
if (e) throw e;
if (value < 0) {
throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout);
}
this._timeout = value;
}
function Sys$Net$WebRequest$getResolvedUrl() {
/// <summary locid="M:J#Sys.Net.WebRequest.getResolvedUrl" />
/// <returns type="String"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
return Sys.Net.WebRequest._resolveUrl(this._url);
}
function Sys$Net$WebRequest$invoke() {
/// <summary locid="M:J#Sys.Net.WebRequest.invoke" />
if (arguments.length !== 0) throw Error.parameterCount();
if (this._invokeCalled) {
throw Error.invalidOperation(Sys.Res.invokeCalledTwice);
}
Sys.Net.WebRequestManager.executeRequest(this);
this._invokeCalled = true;
}
Sys.Net.WebRequest.prototype = {
add_completed: Sys$Net$WebRequest$add_completed,
remove_completed: Sys$Net$WebRequest$remove_completed,
completed: Sys$Net$WebRequest$completed,
_get_eventHandlerList: Sys$Net$WebRequest$_get_eventHandlerList,
get_url: Sys$Net$WebRequest$get_url,
set_url: Sys$Net$WebRequest$set_url,
get_headers: Sys$Net$WebRequest$get_headers,
get_httpVerb: Sys$Net$WebRequest$get_httpVerb,
set_httpVerb: Sys$Net$WebRequest$set_httpVerb,
get_body: Sys$Net$WebRequest$get_body,
set_body: Sys$Net$WebRequest$set_body,
get_userContext: Sys$Net$WebRequest$get_userContext,
set_userContext: Sys$Net$WebRequest$set_userContext,
get_executor: Sys$Net$WebRequest$get_executor,
set_executor: Sys$Net$WebRequest$set_executor,
get_timeout: Sys$Net$WebRequest$get_timeout,
set_timeout: Sys$Net$WebRequest$set_timeout,
getResolvedUrl: Sys$Net$WebRequest$getResolvedUrl,
invoke: Sys$Net$WebRequest$invoke
}
Sys.Net.WebRequest._resolveUrl = function Sys$Net$WebRequest$_resolveUrl(url, baseUrl) {
if (url && url.indexOf('://') !== -1) {
return url;
}
if (!baseUrl || baseUrl.length === 0) {
var baseElement = document.getElementsByTagName('base')[0];
if (baseElement && baseElement.href && baseElement.href.length > 0) {
baseUrl = baseElement.href;
}
else {
baseUrl = document.URL;
}
}
var qsStart = baseUrl.indexOf('?');
if (qsStart !== -1) {
baseUrl = baseUrl.substr(0, qsStart);
}
qsStart = baseUrl.indexOf('#');
if (qsStart !== -1) {
baseUrl = baseUrl.substr(0, qsStart);
}
baseUrl = baseUrl.substr(0, baseUrl.lastIndexOf('/') + 1);
if (!url || url.length === 0) {
return baseUrl;
}
if (url.charAt(0) === '/') {
var slashslash = baseUrl.indexOf('://');
if (slashslash === -1) {
throw Error.argument("baseUrl", Sys.Res.badBaseUrl1);
}
var nextSlash = baseUrl.indexOf('/', slashslash + 3);
if (nextSlash === -1) {
throw Error.argument("baseUrl", Sys.Res.badBaseUrl2);
}
return baseUrl.substr(0, nextSlash) + url;
}
else {
var lastSlash = baseUrl.lastIndexOf('/');
if (lastSlash === -1) {
throw Error.argument("baseUrl", Sys.Res.badBaseUrl3);
}
return baseUrl.substr(0, lastSlash+1) + url;
}
}
Sys.Net.WebRequest._createQueryString = function Sys$Net$WebRequest$_createQueryString(queryString, encodeMethod, addParams) {
encodeMethod = encodeMethod || encodeURIComponent;
var i = 0, obj, val, arg, sb = new Sys.StringBuilder();
if (queryString) {
for (arg in queryString) {
obj = queryString[arg];
if (typeof(obj) === "function") continue;
val = Sys.Serialization.JavaScriptSerializer.serialize(obj);
if (i++) {
sb.append('&');
}
sb.append(arg);
sb.append('=');
sb.append(encodeMethod(val));
}
}
if (addParams) {
if (i) {
sb.append('&');
}
sb.append(addParams);
}
return sb.toString();
}
Sys.Net.WebRequest._createUrl = function Sys$Net$WebRequest$_createUrl(url, queryString, addParams) {
if (!queryString && !addParams) {
return url;
}
var qs = Sys.Net.WebRequest._createQueryString(queryString, null, addParams);
return qs.length
? url + ((url && url.indexOf('?') >= 0) ? "&" : "?") + qs
: url;
}
Sys.Net.WebRequest.registerClass('Sys.Net.WebRequest');
Sys._ScriptLoaderTask = function Sys$_ScriptLoaderTask(scriptElement, completedCallback) {
/// <summary locid="M:J#Sys._ScriptLoaderTask.#ctor" />
/// <param name="scriptElement" domElement="true"></param>
/// <param name="completedCallback" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "scriptElement", domElement: true},
{name: "completedCallback", type: Function}
]);
if (e) throw e;
this._scriptElement = scriptElement;
this._completedCallback = completedCallback;
}
function Sys$_ScriptLoaderTask$get_scriptElement() {
/// <value domElement="true" locid="P:J#Sys._ScriptLoaderTask.scriptElement"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._scriptElement;
}
function Sys$_ScriptLoaderTask$dispose() {
if(this._disposed) {
return;
}
this._disposed = true;
this._removeScriptElementHandlers();
Sys._ScriptLoaderTask._clearScript(this._scriptElement);
this._scriptElement = null;
}
function Sys$_ScriptLoaderTask$execute() {
/// <summary locid="M:J#Sys._ScriptLoaderTask.execute" />
if (arguments.length !== 0) throw Error.parameterCount();
this._addScriptElementHandlers();
var headElements = document.getElementsByTagName('head');
if (headElements.length === 0) {
throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead);
}
else {
headElements[0].appendChild(this._scriptElement);
}
}
function Sys$_ScriptLoaderTask$_addScriptElementHandlers() {
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);
}
}
function Sys$_ScriptLoaderTask$_removeScriptElementHandlers() {
if(this._scriptLoadDelegate) {
var scriptElement = this.get_scriptElement();
if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) {
$removeHandler(scriptElement, 'load', this._scriptLoadDelegate);
}
else {
$removeHandler(scriptElement, 'readystatechange', this._scriptLoadDelegate);
}
if (this._scriptErrorDelegate) {
this._scriptElement.removeEventListener('error', this._scriptErrorDelegate, false);
this._scriptErrorDelegate = null;
}
this._scriptLoadDelegate = null;
}
}
function Sys$_ScriptLoaderTask$_scriptErrorHandler() {
if(this._disposed) {
return;
}
this._completedCallback(this.get_scriptElement(), false);
}
function Sys$_ScriptLoaderTask$_scriptLoadHandler() {
if(this._disposed) {
return;
}
var scriptElement = this.get_scriptElement();
if ((scriptElement.readyState !== 'loaded') &&
(scriptElement.readyState !== 'complete')) {
return;
}
this._completedCallback(scriptElement, true);
}
Sys._ScriptLoaderTask.prototype = {
get_scriptElement: Sys$_ScriptLoaderTask$get_scriptElement,
dispose: Sys$_ScriptLoaderTask$dispose,
execute: Sys$_ScriptLoaderTask$execute,
_addScriptElementHandlers: Sys$_ScriptLoaderTask$_addScriptElementHandlers,
_removeScriptElementHandlers: Sys$_ScriptLoaderTask$_removeScriptElementHandlers,
_scriptErrorHandler: Sys$_ScriptLoaderTask$_scriptErrorHandler,
_scriptLoadHandler: Sys$_ScriptLoaderTask$_scriptLoadHandler
}
Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable);
Sys._ScriptLoaderTask._clearScript = function Sys$_ScriptLoaderTask$_clearScript(scriptElement) {
if (!Sys.Debug.isDebug) {
scriptElement.parentNode.removeChild(scriptElement);
}
}
Type.registerNamespace('Sys.Net');
Sys.Net.WebServiceProxy = function Sys$Net$WebServiceProxy() {
}
function Sys$Net$WebServiceProxy$get_timeout() {
/// <value type="Number" locid="P:J#Sys.Net.WebServiceProxy.timeout"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._timeout || 0;
}
function Sys$Net$WebServiceProxy$set_timeout(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Number}]);
if (e) throw e;
if (value < 0) { throw Error.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); }
this._timeout = value;
}
function Sys$Net$WebServiceProxy$get_defaultUserContext() {
/// <value mayBeNull="true" locid="P:J#Sys.Net.WebServiceProxy.defaultUserContext"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return (typeof(this._userContext) === "undefined") ? null : this._userContext;
}
function Sys$Net$WebServiceProxy$set_defaultUserContext(value) {
var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]);
if (e) throw e;
this._userContext = value;
}
function Sys$Net$WebServiceProxy$get_defaultSucceededCallback() {
/// <value type="Function" mayBeNull="true" locid="P:J#Sys.Net.WebServiceProxy.defaultSucceededCallback"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._succeeded || null;
}
function Sys$Net$WebServiceProxy$set_defaultSucceededCallback(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]);
if (e) throw e;
this._succeeded = value;
}
function Sys$Net$WebServiceProxy$get_defaultFailedCallback() {
/// <value type="Function" mayBeNull="true" locid="P:J#Sys.Net.WebServiceProxy.defaultFailedCallback"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._failed || null;
}
function Sys$Net$WebServiceProxy$set_defaultFailedCallback(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]);
if (e) throw e;
this._failed = value;
}
function Sys$Net$WebServiceProxy$get_enableJsonp() {
/// <value type="Boolean" locid="P:J#Sys.Net.WebServiceProxy.enableJsonp"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return !!this._jsonp;
}
function Sys$Net$WebServiceProxy$set_enableJsonp(value) {
var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]);
if (e) throw e;
this._jsonp = value;
}
function Sys$Net$WebServiceProxy$get_path() {
/// <value type="String" locid="P:J#Sys.Net.WebServiceProxy.path"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._path || null;
}
function Sys$Net$WebServiceProxy$set_path(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
this._path = value;
}
function Sys$Net$WebServiceProxy$get_jsonpCallbackParameter() {
/// <value type="String" locid="P:J#Sys.Net.WebServiceProxy.jsonpCallbackParameter"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._callbackParameter || "callback";
}
function Sys$Net$WebServiceProxy$set_jsonpCallbackParameter(value) {
var e = Function._validateParams(arguments, [{name: "value", type: String}]);
if (e) throw e;
this._callbackParameter = value;
}
function Sys$Net$WebServiceProxy$_invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext) {
/// <summary locid="M:J#Sys.Net.WebServiceProxy._invoke" />
/// <param name="servicePath" type="String"></param>
/// <param name="methodName" type="String"></param>
/// <param name="useGet" type="Boolean"></param>
/// <param name="params"></param>
/// <param name="onSuccess" type="Function" mayBeNull="true" optional="true"></param>
/// <param name="onFailure" type="Function" mayBeNull="true" optional="true"></param>
/// <param name="userContext" mayBeNull="true" optional="true"></param>
/// <returns type="Sys.Net.WebRequest" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "servicePath", type: String},
{name: "methodName", type: String},
{name: "useGet", type: Boolean},
{name: "params"},
{name: "onSuccess", type: Function, mayBeNull: true, optional: true},
{name: "onFailure", type: Function, mayBeNull: true, optional: true},
{name: "userContext", mayBeNull: true, optional: true}
]);
if (e) throw e;
onSuccess = onSuccess || this.get_defaultSucceededCallback();
onFailure = onFailure || this.get_defaultFailedCallback();
if (userContext === null || typeof userContext === 'undefined') userContext = this.get_defaultUserContext();
return Sys.Net.WebServiceProxy.invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, this.get_timeout(), this.get_enableJsonp(), this.get_jsonpCallbackParameter());
}
Sys.Net.WebServiceProxy.prototype = {
get_timeout: Sys$Net$WebServiceProxy$get_timeout,
set_timeout: Sys$Net$WebServiceProxy$set_timeout,
get_defaultUserContext: Sys$Net$WebServiceProxy$get_defaultUserContext,
set_defaultUserContext: Sys$Net$WebServiceProxy$set_defaultUserContext,
get_defaultSucceededCallback: Sys$Net$WebServiceProxy$get_defaultSucceededCallback,
set_defaultSucceededCallback: Sys$Net$WebServiceProxy$set_defaultSucceededCallback,
get_defaultFailedCallback: Sys$Net$WebServiceProxy$get_defaultFailedCallback,
set_defaultFailedCallback: Sys$Net$WebServiceProxy$set_defaultFailedCallback,
get_enableJsonp: Sys$Net$WebServiceProxy$get_enableJsonp,
set_enableJsonp: Sys$Net$WebServiceProxy$set_enableJsonp,
get_path: Sys$Net$WebServiceProxy$get_path,
set_path: Sys$Net$WebServiceProxy$set_path,
get_jsonpCallbackParameter: Sys$Net$WebServiceProxy$get_jsonpCallbackParameter,
set_jsonpCallbackParameter: Sys$Net$WebServiceProxy$set_jsonpCallbackParameter,
_invoke: Sys$Net$WebServiceProxy$_invoke
}
Sys.Net.WebServiceProxy.registerClass('Sys.Net.WebServiceProxy');
Sys.Net.WebServiceProxy.invoke = function Sys$Net$WebServiceProxy$invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, timeout, enableJsonp, jsonpCallbackParameter) {
/// <summary locid="M:J#Sys.Net.WebServiceProxy.invoke" />
/// <param name="servicePath" type="String"></param>
/// <param name="methodName" type="String" mayBeNull="true" optional="true"></param>
/// <param name="useGet" type="Boolean" optional="true"></param>
/// <param name="params" mayBeNull="true" optional="true"></param>
/// <param name="onSuccess" type="Function" mayBeNull="true" optional="true"></param>
/// <param name="onFailure" type="Function" mayBeNull="true" optional="true"></param>
/// <param name="userContext" mayBeNull="true" optional="true"></param>
/// <param name="timeout" type="Number" optional="true"></param>
/// <param name="enableJsonp" type="Boolean" optional="true" mayBeNull="true"></param>
/// <param name="jsonpCallbackParameter" type="String" optional="true" mayBeNull="true"></param>
/// <returns type="Sys.Net.WebRequest" mayBeNull="true"></returns>
var e = Function._validateParams(arguments, [
{name: "servicePath", type: String},
{name: "methodName", type: String, mayBeNull: true, optional: true},
{name: "useGet", type: Boolean, optional: true},
{name: "params", mayBeNull: true, optional: true},
{name: "onSuccess", type: Function, mayBeNull: true, optional: true},
{name: "onFailure", type: Function, mayBeNull: true, optional: true},
{name: "userContext", mayBeNull: true, optional: true},
{name: "timeout", type: Number, optional: true},
{name: "enableJsonp", type: Boolean, mayBeNull: true, optional: true},
{name: "jsonpCallbackParameter", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
var schemeHost = (enableJsonp !== false) ? Sys.Net.WebServiceProxy._xdomain.exec(servicePath) : null,
tempCallback, jsonp = schemeHost && (schemeHost.length === 3) &&
((schemeHost[1] !== location.protocol) || (schemeHost[2] !== location.host));
useGet = jsonp || useGet;
if (jsonp) {
jsonpCallbackParameter = jsonpCallbackParameter || "callback";
tempCallback = "_jsonp" + Sys._jsonp++;
}
if (!params) params = {};
var urlParams = params;
if (!useGet || !urlParams) urlParams = {};
var script, error, timeoutcookie = null, loader, body = null,
url = Sys.Net.WebRequest._createUrl(methodName
? (servicePath+"/"+encodeURIComponent(methodName))
: servicePath, urlParams, jsonp ? (jsonpCallbackParameter + "=Sys." + tempCallback) : null);
if (jsonp) {
script = document.createElement("script");
script.src = url;
loader = new Sys._ScriptLoaderTask(script, function(script, loaded) {
if (!loaded || tempCallback) {
jsonpComplete({ Message: String.format(Sys.Res.webServiceFailedNoMsg, methodName) }, -1);
}
});
function jsonpComplete(data, statusCode) {
if (timeoutcookie !== null) {
window.clearTimeout(timeoutcookie);
timeoutcookie = null;
}
loader.dispose();
delete Sys[tempCallback];
tempCallback = null;
if ((typeof(statusCode) !== "undefined") && (statusCode !== 200)) {
if (onFailure) {
error = new Sys.Net.WebServiceError(false,
data.Message || String.format(Sys.Res.webServiceFailedNoMsg, methodName),
data.StackTrace || null,
data.ExceptionType || null,
data);
error._statusCode = statusCode;
onFailure(error, userContext, methodName);
}
else {
if (data.StackTrace && data.Message) {
error = data.StackTrace + "-- " + data.Message;
}
else {
error = data.StackTrace || data.Message;
}
error = String.format(error ? Sys.Res.webServiceFailed : Sys.Res.webServiceFailedNoMsg, methodName, error);
throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error));
}
}
else if (onSuccess) {
onSuccess(data, userContext, methodName);
}
}
Sys[tempCallback] = jsonpComplete;
loader.execute();
return null;
}
var request = new Sys.Net.WebRequest();
request.set_url(url);
request.get_headers()['Content-Type'] = 'application/json; charset=utf-8';
if (!useGet) {
body = Sys.Serialization.JavaScriptSerializer.serialize(params);
if (body === "{}") body = "";
}
request.set_body(body);
request.add_completed(onComplete);
if (timeout && timeout > 0) request.set_timeout(timeout);
request.invoke();
function onComplete(response, eventArgs) {
if (response.get_responseAvailable()) {
var statusCode = response.get_statusCode();
var result = null;
try {
var contentType = response.getResponseHeader("Content-Type");
if (contentType.startsWith("application/json")) {
result = response.get_object();
}
else if (contentType.startsWith("text/xml")) {
result = response.get_xml();
}
else {
result = response.get_responseData();
}
} catch (ex) {
}
var error = response.getResponseHeader("jsonerror");
var errorObj = (error === "true");
if (errorObj) {
if (result) {
result = new Sys.Net.WebServiceError(false, result.Message, result.StackTrace, result.ExceptionType, result);
}
}
else if (contentType.startsWith("application/json")) {
result = (!result || (typeof(result.d) === "undefined")) ? result : result.d;
}
if (((statusCode < 200) || (statusCode >= 300)) || errorObj) {
if (onFailure) {
if (!result || !errorObj) {
result = new Sys.Net.WebServiceError(false , String.format(Sys.Res.webServiceFailedNoMsg, methodName));
}
result._statusCode = statusCode;
onFailure(result, userContext, methodName);
}
else {
if (result && errorObj) {
error = result.get_exceptionType() + "-- " + result.get_message();
}
else {
error = response.get_responseData();
}
throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error));
}
}
else if (onSuccess) {
onSuccess(result, userContext, methodName);
}
}
else {
var msg;
if (response.get_timedOut()) {
msg = String.format(Sys.Res.webServiceTimedOut, methodName);
}
else {
msg = String.format(Sys.Res.webServiceFailedNoMsg, methodName)
}
if (onFailure) {
onFailure(new Sys.Net.WebServiceError(response.get_timedOut(), msg, "", ""), userContext, methodName);
}
else {
throw Sys.Net.WebServiceProxy._createFailedError(methodName, msg);
}
}
}
return request;
}
Sys.Net.WebServiceProxy._createFailedError = function Sys$Net$WebServiceProxy$_createFailedError(methodName, errorMessage) {
var displayMessage = "Sys.Net.WebServiceFailedException: " + errorMessage;
var e = Error.create(displayMessage, { 'name': 'Sys.Net.WebServiceFailedException', 'methodName': methodName });
e.popStackFrame();
return e;
}
Sys.Net.WebServiceProxy._defaultFailedCallback = function Sys$Net$WebServiceProxy$_defaultFailedCallback(err, methodName) {
var error = err.get_exceptionType() + "-- " + err.get_message();
throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error));
}
Sys.Net.WebServiceProxy._generateTypedConstructor = function Sys$Net$WebServiceProxy$_generateTypedConstructor(type) {
return function(properties) {
if (properties) {
for (var name in properties) {
this[name] = properties[name];
}
}
this.__type = type;
}
}
Sys._jsonp = 0;
Sys.Net.WebServiceProxy._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;
Sys.Net.WebServiceError = function Sys$Net$WebServiceError(timedOut, message, stackTrace, exceptionType, errorObject) {
/// <summary locid="M:J#Sys.Net.WebServiceError.#ctor" />
/// <param name="timedOut" type="Boolean"></param>
/// <param name="message" type="String" mayBeNull="true"></param>
/// <param name="stackTrace" type="String" mayBeNull="true" optional="true"></param>
/// <param name="exceptionType" type="String" mayBeNull="true" optional="true"></param>
/// <param name="errorObject" type="Object" mayBeNull="true" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "timedOut", type: Boolean},
{name: "message", type: String, mayBeNull: true},
{name: "stackTrace", type: String, mayBeNull: true, optional: true},
{name: "exceptionType", type: String, mayBeNull: true, optional: true},
{name: "errorObject", type: Object, mayBeNull: true, optional: true}
]);
if (e) throw e;
this._timedOut = timedOut;
this._message = message;
this._stackTrace = stackTrace;
this._exceptionType = exceptionType;
this._errorObject = errorObject;
this._statusCode = -1;
}
function Sys$Net$WebServiceError$get_timedOut() {
/// <value type="Boolean" locid="P:J#Sys.Net.WebServiceError.timedOut"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._timedOut;
}
function Sys$Net$WebServiceError$get_statusCode() {
/// <value type="Number" locid="P:J#Sys.Net.WebServiceError.statusCode"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._statusCode;
}
function Sys$Net$WebServiceError$get_message() {
/// <value type="String" locid="P:J#Sys.Net.WebServiceError.message"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._message;
}
function Sys$Net$WebServiceError$get_stackTrace() {
/// <value type="String" locid="P:J#Sys.Net.WebServiceError.stackTrace"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._stackTrace || "";
}
function Sys$Net$WebServiceError$get_exceptionType() {
/// <value type="String" locid="P:J#Sys.Net.WebServiceError.exceptionType"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._exceptionType || "";
}
function Sys$Net$WebServiceError$get_errorObject() {
/// <value type="Object" locid="P:J#Sys.Net.WebServiceError.errorObject"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._errorObject || null;
}
Sys.Net.WebServiceError.prototype = {
get_timedOut: Sys$Net$WebServiceError$get_timedOut,
get_statusCode: Sys$Net$WebServiceError$get_statusCode,
get_message: Sys$Net$WebServiceError$get_message,
get_stackTrace: Sys$Net$WebServiceError$get_stackTrace,
get_exceptionType: Sys$Net$WebServiceError$get_exceptionType,
get_errorObject: Sys$Net$WebServiceError$get_errorObject
}
Sys.Net.WebServiceError.registerClass('Sys.Net.WebServiceError');
Type.registerNamespace('Sys');
Sys.Res={
'urlMustBeLessThan1024chars':'The history state must be small enough to not make the url larger than 1024 characters.',
'argumentTypeName':'Value is not the name of an existing type.',
'cantBeCalledAfterDispose':'Can\'t be called after dispose.',
'componentCantSetIdAfterAddedToApp':'The id property of a component can\'t be set after it\'s been added to the Application object.',
'behaviorDuplicateName':'A behavior with name \'{0}\' already exists or it is the name of an existing property on the target element.',
'notATypeName':'Value is not a valid type name.',
'elementNotFound':'An element with id \'{0}\' could not be found.',
'stateMustBeStringDictionary':'The state object can only have null and string fields.',
'boolTrueOrFalse':'Value must be \'true\' or \'false\'.',
'scriptLoadFailedNoHead':'ScriptLoader requires pages to contain a <head> element.',
'stringFormatInvalid':'The format string is invalid.',
'referenceNotFound':'Component \'{0}\' was not found.',
'enumReservedName':'\'{0}\' is a reserved name that can\'t be used as an enum value name.',
'circularParentChain':'The chain of control parents can\'t have circular references.',
'namespaceContainsNonObject':'Object {0} already exists and is not an object.',
'undefinedEvent':'\'{0}\' is not an event.',
'propertyUndefined':'\'{0}\' is not a property or an existing field.',
'observableConflict':'Object already contains a member with the name \'{0}\'.',
'historyCannotEnableHistory':'Cannot set enableHistory after initialization.',
'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.',
'scriptLoadFailedDebug':'The script \'{0}\' failed to load. Check for:\r\n Inaccessible path.\r\n Script errors. (IE) Enable \'Display a notification about every script error\' under advanced settings.',
'propertyNotWritable':'\'{0}\' is not a writable property.',
'enumInvalidValueName':'\'{0}\' is not a valid name for an enum value.',
'controlAlreadyDefined':'A control is already associated with the element.',
'addHandlerCantBeUsedForError':'Can\'t add a handler for the error event using this method. Please set the window.onerror property instead.',
'cantAddNonFunctionhandler':'Can\'t add a handler that is not a function.',
'invalidNameSpace':'Value is not a valid namespace identifier.',
'notAnInterface':'Value is not a valid interface.',
'eventHandlerNotFunction':'Handler must be a function.',
'propertyNotAnArray':'\'{0}\' is not an Array property.',
'namespaceContainsClass':'Object {0} already exists as a class, enum, or interface.',
'typeRegisteredTwice':'Type {0} has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.',
'cantSetNameAfterInit':'The name property can\'t be set on this object after initialization.',
'historyMissingFrame':'For the history feature to work in IE, the page must have an iFrame element with id \'__historyFrame\' pointed to a page that gets its title from the \'title\' query string parameter and calls Sys.Application._onIFrameLoad() on the parent window. This can be done by setting EnableHistory to true on ScriptManager.',
'appDuplicateComponent':'Two components with the same id \'{0}\' can\'t be added to the application.',
'historyCannotAddHistoryPointWithHistoryDisabled':'A history point can only be added if enableHistory is set to true.',
'baseNotAClass':'Value is not a class.',
'expectedElementOrId':'Value must be a DOM element or DOM element Id.',
'methodNotFound':'No method found with name \'{0}\'.',
'arrayParseBadFormat':'Value must be a valid string representation for an array. It must start with a \'[\' and end with a \']\'.',
'stateFieldNameInvalid':'State field names must not contain any \'=\' characters.',
'cantSetId':'The id property can\'t be set on this object.',
'stringFormatBraceMismatch':'The format string contains an unmatched opening or closing brace.',
'enumValueNotInteger':'An enumeration definition can only contain integer values.',
'propertyNullOrUndefined':'Cannot set the properties of \'{0}\' because it returned a null value.',
'argumentDomNode':'Value must be a DOM element or a text node.',
'componentCantSetIdTwice':'The id property of a component can\'t be set more than once.',
'createComponentOnDom':'Value must be null for Components that are not Controls or Behaviors.',
'createNotComponent':'{0} does not derive from Sys.Component.',
'createNoDom':'Value must not be null for Controls and Behaviors.',
'cantAddWithoutId':'Can\'t add a component that doesn\'t have an id.',
'notObservable':'Instances of type \'{0}\' cannot be observed.',
'badTypeName':'Value is not the name of the type being registered or the name is a reserved word.',
'argumentInteger':'Value must be an integer.',
'invokeCalledTwice':'Cannot call invoke more than once.',
'webServiceFailed':'The server method \'{0}\' failed with the following error: {1}',
'argumentType':'Object cannot be converted to the required type.',
'argumentNull':'Value cannot be null.',
'scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.',
'scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.',
'formatBadFormatSpecifier':'Format specifier was invalid.',
'requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.',
'webServiceFailedNoMsg':'The server method \'{0}\' 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':'\'{0}\' is not a valid value for enum {1}.',
'scriptLoadFailed':'The script \'{0}\' 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 \'{0}\' returned an invalid type. Expected type: {1}',
'servicePathNotSet':'The path to the web service has not been set.',
'argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.',
'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}',
'nullReferenceInPath':'Null reference while evaluating data path: \'{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 \'{0}\' timed out.',
'notImplemented':'The method or operation is not implemented.',
'assertFailed':'Assertion Failed: {0}',
'invalidOperation':'Operation is not valid due to the current state of the object.',
'breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?'
};
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// 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.validateParameters=function(c,b,a){return Function._validateParams(c,b,a)};Function._validateParams=function(g,e,c){var a,d=e.length;c=c||typeof c==="undefined";a=Function._validateParameterCount(g,e,c);if(a){a.popStackFrame();return a}for(var b=0,i=g.length;b<i;b++){var f=e[Math.min(b,d-1)],h=f.name;if(f.parameterArray)h+="["+(b-d+1)+"]";else if(!c&&b>=d)break;a=Function._validateParameter(g[b],f,h);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(j,d,i){var a,c,b=d.length,e=j.length;if(e<b){var f=b;for(a=0;a<b;a++){var g=d[a];if(g.optional||g.parameterArray)f--}if(e<f)c=true}else if(i&&e>b){c=true;for(a=0;a<b;a++)if(d[a].parameterArray){c=false;break}}if(c){var h=Error.parameterCount();h.popStackFrame();return h}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(b,c,k,j,h,d){var a,g;if(typeof b==="undefined")if(h)return null;else{a=Error.argumentUndefined(d);a.popStackFrame();return a}if(b===null)if(h)return null;else{a=Error.argumentNull(d);a.popStackFrame();return a}if(c&&c.__enum){if(typeof b!=="number"){a=Error.argumentType(d,Object.getType(b),c);a.popStackFrame();return a}if(b%1===0){var e=c.prototype;if(!c.__flags||b===0){for(g in e)if(e[g]===b)return null}else{var i=b;for(g in e){var f=e[g];if(f===0)continue;if((f&b)===f)i-=f;if(i===0)return null}}}a=Error.argumentOutOfRange(d,b,String.format(Sys.Res.enumInvalidValue,b,c.getName()));a.popStackFrame();return a}if(j&&(!Sys._isDomElement(b)||b.nodeType===3)){a=Error.argument(d,Sys.Res.argumentDomElement);a.popStackFrame();return a}if(c&&!Sys._isInstanceOfType(c,b)){a=Error.argumentType(d,Object.getType(b),c);a.popStackFrame();return a}if(c===Number&&k)if(b%1!==0){a=Error.argumentOutOfRange(d,b,Sys.Res.argumentInteger);a.popStackFrame();return a}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._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;Number.__typeName="Number";Number.__class=true;RegExp.__typeName="RegExp";RegExp.__class=true;if(!window)this.window=this;window.Type=Function;Type.prototype.callBaseMethod=function(a,d,b){var c=Sys._getBaseMethod(this,a,d);if(!b)return c.apply(a);else return c.apply(a,b)};Type.prototype.getBaseMethod=function(a,b){return Sys._getBaseMethod(this,a,b)};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(a){return Sys._isInstanceOfType(this,a)};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(e){var d=window,c=e.split(".");for(var b=0;b<c.length;b++){var f=c[b],a=d[f];if(!a)a=d[f]={};if(!a.__namespace){if(b===0&&e!=="Sys")Sys.__rootNamespaces[Sys.__rootNamespaces.length]=a;a.__namespace=true;a.__typeName=c.slice(0,b+1).join(".");a.getName=function(){return this.__typeName}}d=a}};Type._checkDependency=function(c,a){var d=Type._registerScript._scripts,b=d?!!d[c]:false;if(typeof a!=="undefined"&&!b)throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded,a,c));return b};Type._registerScript=function(a,c){var b=Type._registerScript._scripts;if(!b)Type._registerScript._scripts=b={};if(b[a])throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded,a));b[a]=true;if(c)for(var d=0,f=c.length;d<f;d++){var e=c[d];if(!Type._checkDependency(e))throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound,a,e))}};Type.registerNamespace("Sys");Sys.__upperCaseTypes={};Sys.__rootNamespaces=[Sys];Sys._isInstanceOfType=function(c,b){if(typeof b==="undefined"||b===null)return false;if(b instanceof c)return true;var a=Object.getType(b);return !!(a===c)||a.inheritsFrom&&a.inheritsFrom(c)||a.implementsInterface&&a.implementsInterface(c)};Sys._getBaseMethod=function(d,e,c){var b=d.getBaseType();if(b){var a=b.prototype[c];return a instanceof Function?a:null}return null};Sys._isDomElement=function(a){var c=false;if(typeof a.nodeType!=="number"){var b=a.ownerDocument||a.document||a;if(b!=a){var d=b.defaultView||b.parentWindow;c=d!=a}else c=typeof b.body==="undefined"}return !c};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 Sys._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(a,c,b){return Sys._indexOf(a,c,b)};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=Sys._indexOf(b,c);if(a>=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};Sys._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};Type._registerScript._scripts={"MicrosoftAjaxCore.js":true,"MicrosoftAjaxGlobalization.js":true,"MicrosoftAjaxSerialization.js":true,"MicrosoftAjaxComponentModel.js":true,"MicrosoftAjaxHistory.js":true,"MicrosoftAjaxNetwork.js":true,"MicrosoftAjaxWebServices.js":true};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");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;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);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.CollectionChange=function(e,a,c,b,d){this.action=e;if(a)if(!(a instanceof Array))a=[a];this.newItems=a||null;if(typeof c!=="number")c=-1;this.newStartingIndex=c;if(b)if(!(b instanceof Array))b=[b];this.oldItems=b||null;if(typeof d!=="number")d=-1;this.oldStartingIndex=d};Sys.CollectionChange.registerClass("Sys.CollectionChange");Sys.NotifyCollectionChangedAction=function(){throw Error.notImplemented()};Sys.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");Sys.NotifyCollectionChangedEventArgs=function(a){this._changes=a;Sys.NotifyCollectionChangedEventArgs.initializeBase(this)};Sys.NotifyCollectionChangedEventArgs.prototype={get_changes:function(){return this._changes||[]}};Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",Sys.EventArgs);Sys.Observer=function(){};Sys.Observer.registerClass("Sys.Observer");Sys.Observer.makeObservable=function(a){var c=a instanceof Array,b=Sys.Observer;if(a.setValue===b._observeMethods.setValue)return a;b._addMethods(a,b._observeMethods);if(c)b._addMethods(a,b._arrayMethods);return a};Sys.Observer._addMethods=function(c,b){for(var a in b)c[a]=b[a]};Sys.Observer._addEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._addHandler(a,b)};Sys.Observer.addEventHandler=function(c,a,b){Sys.Observer._addEventHandler(c,a,b)};Sys.Observer._removeEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._removeHandler(a,b)};Sys.Observer.removeEventHandler=function(c,a,b){Sys.Observer._removeEventHandler(c,a,b)};Sys.Observer.raiseEvent=function(b,e,d){var c=Sys.Observer._getContext(b);if(!c)return;var a=c.events.getHandler(e);if(a)a(b,d)};Sys.Observer.addPropertyChanged=function(b,a){Sys.Observer._addEventHandler(b,"propertyChanged",a)};Sys.Observer.removePropertyChanged=function(b,a){Sys.Observer._removeEventHandler(b,"propertyChanged",a)};Sys.Observer.beginUpdate=function(a){Sys.Observer._getContext(a,true).updating=true};Sys.Observer.endUpdate=function(b){var a=Sys.Observer._getContext(b);if(!a||!a.updating)return;a.updating=false;var d=a.dirty;a.dirty=false;if(d){if(b instanceof Array){var c=a.changes;a.changes=null;Sys.Observer.raiseCollectionChanged(b,c)}Sys.Observer.raisePropertyChanged(b,"")}};Sys.Observer.isUpdating=function(b){var a=Sys.Observer._getContext(b);return a?a.updating:false};Sys.Observer._setValue=function(a,j,g){var b,f,k=a,d=j.split(".");for(var i=0,m=d.length-1;i<m;i++){var l=d[i];b=a["get_"+l];if(typeof b==="function")a=b.call(a);else a=a[l];var n=typeof a;if(a===null||n==="undefined")throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath,j))}var e,c=d[m];b=a["get_"+c];f=a["set_"+c];if(typeof b==="function")e=b.call(a);else e=a[c];if(typeof f==="function")f.call(a,g);else a[c]=g;if(e!==g){var h=Sys.Observer._getContext(k);if(h&&h.updating){h.dirty=true;return}Sys.Observer.raisePropertyChanged(k,d[0])}};Sys.Observer.setValue=function(b,a,c){Sys.Observer._setValue(b,a,c)};Sys.Observer.raisePropertyChanged=function(b,a){Sys.Observer.raiseEvent(b,"propertyChanged",new Sys.PropertyChangedEventArgs(a))};Sys.Observer.addCollectionChanged=function(b,a){Sys.Observer._addEventHandler(b,"collectionChanged",a)};Sys.Observer.removeCollectionChanged=function(b,a){Sys.Observer._removeEventHandler(b,"collectionChanged",a)};Sys.Observer._collectionChange=function(d,c){var a=Sys.Observer._getContext(d);if(a&&a.updating){a.dirty=true;var b=a.changes;if(!b)a.changes=b=[c];else b.push(c)}else{Sys.Observer.raiseCollectionChanged(d,[c]);Sys.Observer.raisePropertyChanged(d,"length")}};Sys.Observer.add=function(a,b){var c=new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add,[b],a.length);Array.add(a,b);Sys.Observer._collectionChange(a,c)};Sys.Observer.addRange=function(a,b){var c=new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add,b,a.length);Array.addRange(a,b);Sys.Observer._collectionChange(a,c)};Sys.Observer.clear=function(a){var b=Array.clone(a);Array.clear(a);Sys.Observer._collectionChange(a,new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset,null,-1,b,0))};Sys.Observer.insert=function(a,b,c){Array.insert(a,b,c);Sys.Observer._collectionChange(a,new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add,[c],b))};Sys.Observer.remove=function(a,b){var c=Array.indexOf(a,b);if(c!==-1){Array.remove(a,b);Sys.Observer._collectionChange(a,new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove,null,-1,[b],c));return true}return false};Sys.Observer.removeAt=function(b,a){if(a>-1&&a<b.length){var c=b[a];Array.removeAt(b,a);Sys.Observer._collectionChange(b,new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove,null,-1,[c],a))}};Sys.Observer.raiseCollectionChanged=function(b,a){Sys.Observer.raiseEvent(b,"collectionChanged",new Sys.NotifyCollectionChangedEventArgs(a))};Sys.Observer._observeMethods={add_propertyChanged:function(a){Sys.Observer._addEventHandler(this,"propertyChanged",a)},remove_propertyChanged:function(a){Sys.Observer._removeEventHandler(this,"propertyChanged",a)},addEventHandler:function(a,b){Sys.Observer._addEventHandler(this,a,b)},removeEventHandler:function(a,b){Sys.Observer._removeEventHandler(this,a,b)},get_isUpdating:function(){return Sys.Observer.isUpdating(this)},beginUpdate:function(){Sys.Observer.beginUpdate(this)},endUpdate:function(){Sys.Observer.endUpdate(this)},setValue:function(b,a){Sys.Observer._setValue(this,b,a)},raiseEvent:function(b,a){Sys.Observer.raiseEvent(this,b,a)},raisePropertyChanged:function(a){Sys.Observer.raiseEvent(this,"propertyChanged",new Sys.PropertyChangedEventArgs(a))}};Sys.Observer._arrayMethods={add_collectionChanged:function(a){Sys.Observer._addEventHandler(this,"collectionChanged",a)},remove_collectionChanged:function(a){Sys.Observer._removeEventHandler(this,"collectionChanged",a)},add:function(a){Sys.Observer.add(this,a)},addRange:function(a){Sys.Observer.addRange(this,a)},clear:function(){Sys.Observer.clear(this)},insert:function(a,b){Sys.Observer.insert(this,a,b)},remove:function(a){return Sys.Observer.remove(this,a)},removeAt:function(a){Sys.Observer.removeAt(this,a)},raiseCollectionChanged:function(a){Sys.Observer.raiseEvent(this,"collectionChanged",new Sys.NotifyCollectionChangedEventArgs(a))}};Sys.Observer._getContext=function(b,c){var a=b._observerContext;if(a)return a();if(c)return (b._observerContext=Sys.Observer._createContext())();return null};Sys.Observer._createContext=function(){var a={events:new Sys.EventHandlerList};return function(){return a}};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";var c=b.length;if(c===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.LongDatePattern+" "+a.ShortTimePattern;case "F":return a.FullDateTimePattern;case "M":case "m":return a.MonthDayPattern;case "s":return a.SortableDateTimePattern;case "Y":case "y":return a.YearMonthPattern;default:throw Error.format(Sys.Res.formatInvalidString)}else if(c===2&&b.charAt(0)==="%")b=b.charAt(1);return b};Date._expandYear=function(c,a){var d=new Date,e=Date._getEra(d);if(a<100){var b=Date._getEraYear(d,c,e);a+=b-b%100;if(a>c.Calendar.TwoDigitYearMax)a-=100}return a};Date._getEra=function(e,c){if(!c)return 0;var b,d=e.getTime();for(var a=0,f=c.length;a<f;a+=4){b=c[a+2];if(b===null||d>=b)return a}return 0};Date._getEraYear=function(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];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":case "gg":case "g":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?)");break;case "/":a.append("(\\"+b.DateSeparator+")")}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|gg|g/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(h,d,i){var a,c,b,f,e,g=false;for(a=1,c=i.length;a<c;a++){f=i[a];if(f){g=true;b=Date._parseExact(h,f,d);if(b)return b}}if(!g){e=d._getDateTimeFormats();for(a=0,c=e.length;a<c;a++){b=Date._parseExact(h,e[a],d);if(b)return b}}return null};Date._parseExact=function(w,D,k){w=w.trim();var g=k.dateTimeFormat,A=Date._getParseRegExp(g,D),C=(new RegExp(A.regExp)).exec(w);if(C===null)return null;var B=A.groups,x=null,e=null,c=null,j=null,i=null,d=0,h,q=0,r=0,f=0,n=null,v=false;for(var t=0,E=B.length;t<E;t++){var a=C[t+1];if(a)switch(B[t]){case "dd":case "d":j=parseInt(a,10);if(j<1||j>31)return null;break;case "MMMM":c=k._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=k._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":e=Date._expandYear(g,parseInt(a,10));if(e<0||e>9999)return null;break;case "yyyy":e=parseInt(a,10);if(e<0||e>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":q=parseInt(a,10);if(q<0||q>59)return null;break;case "s":case "ss":r=parseInt(a,10);if(r<0||r>59)return null;break;case "tt":case "t":var z=a.toUpperCase();v=z===g.PMDesignator.toUpperCase();if(!v&&z!==g.AMDesignator.toUpperCase())return null;break;case "f":f=parseInt(a,10)*100;if(f<0||f>999)return null;break;case "ff":f=parseInt(a,10)*10;if(f<0||f>999)return null;break;case "fff":f=parseInt(a,10);if(f<0||f>999)return null;break;case "dddd":i=k._getDayIndex(a);if(i<0||i>6)return null;break;case "ddd":i=k._getAbbrDayIndex(a);if(i<0||i>6)return null;break;case "zzz":var u=a.split(/:/);if(u.length!==2)return null;h=parseInt(u[0],10);if(h<-12||h>13)return null;var o=parseInt(u[1],10);if(o<0||o>59)return null;n=h*60+(a.startsWith("-")?-o:o);break;case "z":case "zz":h=parseInt(a,10);if(h<-12||h>13)return null;n=h*60;break;case "g":case "gg":var p=a;if(!p||!g.eras)return null;p=p.toLowerCase().trim();for(var s=0,F=g.eras.length;s<F;s+=4)if(p===g.eras[s+1].toLowerCase()){x=s;break}if(x===null)return null}}var b=new Date,l,m=g.Calendar.convert;if(m)l=m.fromGregorian(b);if(!m)l=[b.getFullYear(),b.getMonth(),b.getDate()];if(e===null)e=l[0];else if(g.eras)e+=g.eras[(x||0)+3];if(c===null)c=l[1];if(j===null)j=l[2];if(m){b=m.toGregorian(e,c,j);if(b===null)return null}else{b.setFullYear(e,c,j);if(b.getDate()!==j)return null;if(i!==null&&b.getDay()!==i)return null}if(v&&d<12)d+=12;b.setHours(d,q,r,f);if(n!==null){var y=b.getMinutes()-(n+b.getTimezoneOffset());b.setHours(b.getHours()+parseInt(y/60,10),y%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,j){var b=j.dateTimeFormat,n=b.Calendar.convert;if(!e||!e.length||e==="i")if(j&&j.name.length)if(n)return this._toFormattedString(b.FullDateTimePattern,j);else{var r=new Date(this.getTime()),x=Date._getEra(this,b.eras);r.setFullYear(Date._getEraYear(this,b,x));return r.toLocaleString()}else return this.toString();var l=b.eras,k=e==="s";e=Date._expandFormat(b,e);var a=new Sys.StringBuilder,c;function d(a){if(a<10)return "0"+a;return a.toString()}function m(a){if(a<10)return "00"+a;if(a<100)return "0"+a;return a.toString()}function v(a){if(a<10)return "000"+a;else if(a<100)return "00"+a;else if(a<1000)return "0"+a;return a.toString()}var h,p,t=/([^d]|^)(d|dd)([^d]|$)/g;function s(){if(h||p)return h;h=t.test(e);p=true;return h}var q=0,o=Date._getTokenRegExp(),f;if(!k&&n)f=n.fromGregorian(this);for(;true;){var w=o.lastIndex,i=o.exec(e),u=e.slice(w,i?i.index:e.length);q+=Date._appendPreOrPostMatch(u,a);if(!i)break;if(q%2===1){a.append(i[0]);continue}function g(a,b){if(f)return f[b];switch(b){case 0:return a.getFullYear();case 1:return a.getMonth();case 2:return a.getDate()}}switch(i[0]){case "dddd":a.append(b.DayNames[this.getDay()]);break;case "ddd":a.append(b.AbbreviatedDayNames[this.getDay()]);break;case "dd":h=true;a.append(d(g(this,2)));break;case "d":h=true;a.append(g(this,2));break;case "MMMM":a.append(b.MonthGenitiveNames&&s()?b.MonthGenitiveNames[g(this,1)]:b.MonthNames[g(this,1)]);break;case "MMM":a.append(b.AbbreviatedMonthGenitiveNames&&s()?b.AbbreviatedMonthGenitiveNames[g(this,1)]:b.AbbreviatedMonthNames[g(this,1)]);break;case "MM":a.append(d(g(this,1)+1));break;case "M":a.append(g(this,1)+1);break;case "yyyy":a.append(v(f?f[0]:Date._getEraYear(this,b,Date._getEra(this,l),k)));break;case "yy":a.append(d((f?f[0]:Date._getEraYear(this,b,Date._getEra(this,l),k))%100));break;case "y":a.append((f?f[0]:Date._getEraYear(this,b,Date._getEra(this,l),k))%100);break;case "hh":c=this.getHours()%12;if(c===0)c=12;a.append(d(c));break;case "h":c=this.getHours()%12;if(c===0)c=12;a.append(c);break;case "HH":a.append(d(this.getHours()));break;case "H":a.append(this.getHours());break;case "mm":a.append(d(this.getMinutes()));break;case "m":a.append(this.getMinutes());break;case "ss":a.append(d(this.getSeconds()));break;case "s":a.append(this.getSeconds());break;case "tt":a.append(this.getHours()<12?b.AMDesignator:b.PMDesignator);break;case "t":a.append((this.getHours()<12?b.AMDesignator:b.PMDesignator).charAt(0));break;case "f":a.append(m(this.getMilliseconds()).charAt(0));break;case "ff":a.append(m(this.getMilliseconds()).substr(0,2));break;case "fff":a.append(m(this.getMilliseconds()));break;case "z":c=this.getTimezoneOffset()/60;a.append((c<=0?"+":"-")+Math.floor(Math.abs(c)));break;case "zz":c=this.getTimezoneOffset()/60;a.append((c<=0?"+":"-")+d(Math.floor(Math.abs(c))));break;case "zzz":c=this.getTimezoneOffset()/60;a.append((c<=0?"+":"-")+d(Math.floor(Math.abs(c)))+":"+d(Math.abs(this.getTimezoneOffset()%60)));break;case "g":case "gg":if(b.eras)a.append(b.eras[Date._getEra(this,l)+1]);break;case "/":a.append(b.DateSeparator)}}return a.toString()};String.localeFormat=function(){return String._toFormattedString(true,arguments)};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(e,j){if(!e||e.length===0||e==="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,d=Math.abs(this);if(!e)e="D";var b=-1;if(e.length>1)b=parseInt(e.slice(1),10);var c;switch(e.charAt(0)){case "d":case "D":c="n";if(b!==-1)d=g(""+d,b,true);if(this<0)d=-d;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;d=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;d=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;d=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+=d;break;case "$":f+=a.CurrencySymbol;break;case "-":if(/[1-9]/.test(d))f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};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},_getIndex:function(c,d,e){var b=this._toUpper(c),a=Array.indexOf(d,b);if(a===-1)a=Array.indexOf(e,b);return a},_getMonthIndex:function(a){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);this._upperMonthsGenitive=this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)}return this._getIndex(a,this._upperMonths,this._upperMonthsGenitive)},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);this._upperAbbrMonthsGenitive=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)}return this._getIndex(a,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},_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.registerClass("Sys.CultureInfo");Sys.CultureInfo._parse=function(a){var b=a.dateTimeFormat;if(b&&!b.eras)b.eras=a.eras;return new Sys.CultureInfo(a.name,a.numberFormat,b)};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",""]},"eras":[1,"A.D.",null,0]});if(typeof __cultureInfo==="object"){Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse(__cultureInfo);delete __cultureInfo}else Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse({"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",""]},"eras":[1,"A.D.",null,0]});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)}};Type.registerNamespace("Sys.UI");Sys.EventHandlerList=function(){this._list={}};Sys.EventHandlerList.prototype={_addHandler:function(b,a){Array.add(this._getEvent(b,true),a)},addHandler:function(b,a){this._addHandler(b,a)},_removeHandler:function(c,b){var a=this._getEvent(c);if(!a)return;Array.remove(a,b)},removeHandler:function(b,a){this._removeHandler(b,a)},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.CommandEventArgs=function(c,a,b){Sys.CommandEventArgs.initializeBase(this);this._commandName=c;this._commandArgument=a;this._commandSource=b};Sys.CommandEventArgs.prototype={_commandName:null,_commandArgument:null,_commandSource:null,get_commandName:function(){return this._commandName},get_commandArgument:function(){return this._commandArgument},get_commandSource:function(){return this._commandSource}};Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs",Sys.CancelEventArgs);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,g){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,autoRemove:g};if(g){var f=a.dispose;if(f!==Sys.UI.DomEvent._disposeHandlers){a.dispose=Sys.UI.DomEvent._disposeHandlers;if(typeof f!=="undefined")a._chainDispose=f}}},$addHandlers=Sys.UI.DomEvent.addHandlers=function(f,d,c,e){for(var b in d){var a=d[b];if(c)a=Function.createDelegate(c,a);$addHandler(f,b,a,e||false)}},$clearHandlers=Sys.UI.DomEvent.clearHandlers=function(a){Sys.UI.DomEvent._clearHandlers(a,false)};Sys.UI.DomEvent._clearHandlers=function(a,g){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--){var f=d[c];if(!g||f.autoRemove)$removeHandler(a,b,f.handler)}}a._events=null}};Sys.UI.DomEvent._disposeHandlers=function(){Sys.UI.DomEvent._clearHandlers(this,true);var b=this._chainDispose,a=typeof b;if(a!=="undefined"){this.dispose=b;this._chainDispose=null;if(a==="function")this.dispose()}};var $removeHandler=Sys.UI.DomEvent.removeHandler=function(b,a,c){Sys.UI.DomEvent._removeHandler(b,a,c)};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};if(document.documentElement.getBoundingClientRect)Sys.UI.DomElement.getLocation=function(b){if(b.self||b.nodeType===9)return new Sys.UI.Point(0,0);var f=b.getBoundingClientRect();if(!f)return new Sys.UI.Point(0,0);var i=b.ownerDocument.documentElement,c=Math.floor(f.left+.5)+i.scrollLeft,d=Math.floor(f.top+.5)+i.scrollTop;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){try{var h=b.ownerDocument.parentWindow.frameElement||null;if(h){var k=h.frameBorder==="0"||h.frameBorder==="no"?2:0;c+=k;d+=k}}catch(l){}if(Sys.Browser.version<=7){var a,j,g,e=document.createElement("div");e.style.cssText="position:absolute !important;left:0px !important;right:0px !important;height:0px !important;width:1px !important;display:hidden !important";try{j=document.body.childNodes[0];document.body.insertBefore(e,j);g=e.getBoundingClientRect();document.body.removeChild(e);a=g.right-g.left}catch(l){}if(a&&a!==1){c=Math.floor(c/a);d=Math.floor(d/a)}}if((document.documentMode||0)<8){c-=2;d-=2}}return new Sys.UI.Point(c,d)};else if(Sys.Browser.agent===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 d=0,e=0,a,j=null,g=null,b;for(a=c;a;j=a,(g=b,a=a.offsetParent)){b=Sys.UI.DomElement._getCurrentStyle(a);var f=a.tagName?a.tagName.toUpperCase():null;if((a.offsetLeft||a.offsetTop)&&(f!=="BODY"||(!g||g.position!=="absolute"))){d+=a.offsetLeft;e+=a.offsetTop}if(j&&Sys.Browser.version>=3){d+=parseInt(b.borderLeftWidth);e+=parseInt(b.borderTopWidth)}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(a=c.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)){d-=a.scrollLeft||0;e-=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(d,e)};else 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,a,i=null,g=null,b=null;for(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(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.isDomElement=function(a){return Sys._isDomElement(a)};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.resolveElement=function(b,c){var a=b;if(!a)return null;if(typeof a==="string")a=Sys.UI.DomElement.getElementById(a,c);return a};Sys.UI.DomElement.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){Sys.UI.DomElement._raiseBubbleEventFromControl(a,c,d);return}b=b.parentNode}};Sys.UI.DomElement._raiseBubbleEventFromControl=function(a,b,c){if(!a.onBubbleEvent(b,c))a._raiseBubbleEvent(b,c)};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.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._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);this._domReady()};Sys._Application.prototype={_creatingComponents:false,_disposing:false,_deleteCount:0,get_isCreatingComponents:function(){return this._creatingComponents},get_isDisposing:function(){return this._disposing},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_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},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,f=b.length;a<f;a++){var d=b[a];if(typeof d!=="undefined")d.dispose()}Array.clear(this._disposableObjects);Sys.UI.DomEvent.removeHandler(window,"unload",this._unloadHandlerDelegate);if(Sys._ScriptLoader){var e=Sys._ScriptLoader.getInstance();if(e)e.dispose()}Sys._Application.callBaseMethod(this,"dispose")}},disposeElement:function(a,d){if(a.nodeType===1){var c=a.getElementsByTagName("*");for(var b=c.length-1;b>=0;b--)this._disposeElementInternal(c[b]);if(!d)this._disposeElementInternal(a)}},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.get_isInitialized()&&!this._disposing){Sys._Application.callBaseMethod(this,"initialize");this._raiseInit();if(this.get_stateString){if(Sys.WebForms&&Sys.WebForms.PageRequestManager){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);else this._ensureHistory()}this.raiseLoad()}},notifyScriptLoaded:function(){},registerDisposableObject:function(b){if(!this._disposing){var a=this._disposableObjects,c=a.length;a[c]=b;b.__msdisposeindex=c}},raiseLoad:function(){var b=this.get_events().getHandler("load"),a=new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!!this._loaded);this._loaded=true;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]},unregisterDisposableObject:function(a){if(!this._disposing){var e=a.__msdisposeindex;if(typeof e==="number"){var b=this._disposableObjects;delete b[e];delete a.__msdisposeindex;if(++this._deleteCount>1000){var c=[];for(var d=0,f=b.length;d<f;d++){a=b[d];if(typeof a!=="undefined"){a.__msdisposeindex=c.length;c.push(a)}}this._disposableObjects=c;this._deleteCount=0}}}},_addComponentToSecondPass:function(b,a){this._secondPassComponents[this._secondPassComponents.length]={component:b,references:a}},_disposeComponents:function(a){if(a)for(var b=a.length-1;b>=0;b--){var c=a[b];if(typeof c.dispose==="function")c.dispose()}},_disposeElementInternal:function(a){var d=a.dispose;if(d&&typeof d==="function")a.dispose();else{var c=a.control;if(c&&typeof c.dispose==="function")c.dispose()}var b=a._behaviors;if(b)this._disposeComponents(b);b=a._components;if(b){this._disposeComponents(b);a._components=null}},_domReady:function(){var a,g,f=this;function b(){f.initialize()}var c=function(){Sys.UI.DomEvent.removeHandler(window,"load",c);b()};Sys.UI.DomEvent.addHandler(window,"load",c);if(document.addEventListener)try{document.addEventListener("DOMContentLoaded",a=function(){document.removeEventListener("DOMContentLoaded",a,false);b()},false)}catch(h){}else if(document.attachEvent)if(window==window.top&&document.documentElement.doScroll){var e,d=document.createElement("div");a=function(){try{d.doScroll("left")}catch(c){e=window.setTimeout(a,0);return}d=null;b()};a()}else document.attachEvent("onreadystatechange",a=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}})},_raiseInit:function(){var a=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;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");var a=this._element;if(a){var c=this.get_name();if(c)a[c]=null;var b=a._behaviors;Array.remove(b,this);if(b.length===0)a._behaviors=null;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;var b=this.get_role();if(b)a.setAttribute("role",b)};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_role:function(){return null},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=null;delete this._element}if(this._parent)delete this._parent},onBubbleEvent:function(){return false},raiseBubbleEvent:function(a,b){this._raiseBubbleEvent(a,b)},_raiseBubbleEvent:function(b,c){var a=this.get_parent();while(a){if(a.onBubbleEvent(b,c))return;a=a.get_parent()}},removeCssClass:function(a){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.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._appLoadHandler=null;Sys.Application._beginRequestHandler=null;Sys.Application._clientId=null;Sys.Application._currentEntry="";Sys.Application._endRequestHandler=null;Sys.Application._history=null;Sys.Application._enableHistory=false;Sys.Application._historyFrame=null;Sys.Application._historyInitialized=false;Sys.Application._historyPointIsNew=false;Sys.Application._ignoreTimer=false;Sys.Application._initialState=null;Sys.Application._state={};Sys.Application._timerCookie=0;Sys.Application._timerHandler=null;Sys.Application._uniqueId=null;Sys._Application.prototype.get_stateString=function(){var a=null;if(Sys.Browser.agent===Sys.Browser.Firefox){var c=window.location.href,b=c.indexOf("#");if(b!==-1)a=c.substring(b+1);else a="";return a}else a=window.location.hash;if(a.length>0&&a.charAt(0)==="#")a=a.substring(1);return a};Sys._Application.prototype.get_enableHistory=function(){return this._enableHistory};Sys._Application.prototype.set_enableHistory=function(a){this._enableHistory=a};Sys._Application.prototype.add_navigate=function(a){this.get_events().addHandler("navigate",a)};Sys._Application.prototype.remove_navigate=function(a){this.get_events().removeHandler("navigate",a)};Sys._Application.prototype.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()};Sys._Application.prototype.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};Sys._Application.prototype.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};Sys._Application.prototype._deserializeState=function(a){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,j=g.length;f<j;f++){var d=g[f],c=d.indexOf("=");if(c!==-1&&c+1<d.length){var i=d.substr(0,c),h=d.substr(c+1);e[i]=decodeURIComponent(h)}}return e};Sys._Application.prototype._enableHistoryInScriptManager=function(){this._enableHistory=true};Sys._Application.prototype._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}this._timerHandler=Function.createDelegate(this,this._onIdle);this._timerCookie=window.setTimeout(this._timerHandler,100);try{this._initialState=this._deserializeState(this.get_stateString())}catch(a){}this._historyInitialized=true}};Sys._Application.prototype._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()};Sys._Application.prototype._onIdle=function(){delete this._timerCookie;var a=this.get_stateString();if(a!==this._currentEntry){if(!this._ignoreTimer){this._historyPointIsNew=false;this._navigate(a)}}else this._ignoreTimer=false;this._timerCookie=window.setTimeout(this._timerHandler,100)};Sys._Application.prototype._onIFrameLoad=function(a){this._ensureHistory();if(!this._ignoreIFrame){this._historyPointIsNew=false;this._navigate(a)}this._ignoreIFrame=false};Sys._Application.prototype._onPageRequestManagerBeginRequest=function(){this._ignoreTimer=true};Sys._Application.prototype._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()}};Sys._Application.prototype._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);var e;try{if(Sys.Browser.agent===Sys.Browser.Firefox&&window.location.hash&&(!window.frameElement||window.top.location.hash))window.history.go(0)}catch(f){}};Sys._Application.prototype._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:"")};Sys._Application.prototype._setState=function(a,b){if(this._enableHistory){a=a||"";if(a!==this._currentEntry){if(window.theForm){var d=window.theForm.action,e=d.indexOf("#");window.theForm.action=(e!==-1?d.substring(0,e):d)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){this._ignoreIFrame=true;var c=this._historyFrame.contentWindow.document;c.open("javascript:'<html></html>'");c.write("<html><head><title>"+(b||document.title)+"</title><scri"+'pt type="text/javascript">parent.Sys.Application._onIFrameLoad('+Sys.Serialization.JavaScriptSerializer.serialize(a)+");</scri"+"pt></head><body></body></html>");c.close()}this._ignoreTimer=false;this._currentEntry=a;if(this._historyFrame||this._historyPointIsNew){var f=this.get_stateString();if(a!==f){window.location.hash=a;this._currentEntry=this.get_stateString();if(typeof b!=="undefined"&&b!==null)document.title=b}}this._historyPointIsNew=false}}};Sys._Application.prototype._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};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};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);this._xmlHttpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest");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(c,b,f){b=b||encodeURIComponent;var h=0,e,g,d,a=new Sys.StringBuilder;if(c)for(d in c){e=c[d];if(typeof e==="function")continue;g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(h++)a.append("&");a.append(d);a.append("=");a.append(b(g))}if(f){if(h)a.append("&");a.append(f)}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b,c){if(!b&&!c)return a;var d=Sys.Net.WebRequest._createQueryString(b,null,c);return d.length?a+(a&&a.indexOf("?")>=0?"&":"?")+d:a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoaderTask._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;this._completedCallback(a,true)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys._ScriptLoaderTask._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Type.registerNamespace("Sys.Net");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext==="undefined"?null:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||null},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||null},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return !!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||null},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||"callback"},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(d,e,g,f,c,b,a){c=c||this.get_defaultSucceededCallback();b=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(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(q,a,m,l,j,b,g,e,w,p){var i=w!==false?Sys.Net.WebServiceProxy._xdomain.exec(q):null,c,n=i&&i.length===3&&(i[1]!==location.protocol||i[2]!==location.host);m=n||m;if(n){p=p||"callback";c="_jsonp"+Sys._jsonp++}if(!l)l={};var r=l;if(!m||!r)r={};var s,h,f=null,k,o=null,u=Sys.Net.WebRequest._createUrl(a?q+"/"+encodeURIComponent(a):q,r,n?p+"=Sys."+c:null);if(n){s=document.createElement("script");s.src=u;k=new Sys._ScriptLoaderTask(s,function(d,b){if(!b||c)t({Message:String.format(Sys.Res.webServiceFailedNoMsg,a)},-1)});function v(){if(f===null)return;f=null;h=new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut,a));k.dispose();delete Sys[c];if(b)b(h,g,a)}function t(d,e){if(f!==null){window.clearTimeout(f);f=null}k.dispose();delete Sys[c];c=null;if(typeof e!=="undefined"&&e!==200){if(b){h=new Sys.Net.WebServiceError(false,d.Message||String.format(Sys.Res.webServiceFailedNoMsg,a),d.StackTrace||null,d.ExceptionType||null,d);h._statusCode=e;b(h,g,a)}}else if(j)j(d,g,a)}Sys[c]=t;e=e||Sys.Net.WebRequestManager.get_defaultTimeout();if(e>0)f=window.setTimeout(v,e);k.execute();return null}var d=new Sys.Net.WebRequest;d.set_url(u);d.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!m){o=Sys.Serialization.JavaScriptSerializer.serialize(l);if(o==="{}")o=""}d.set_body(o);d.add_completed(x);if(e&&e>0)d.set_timeout(e);d.invoke();function x(d){if(d.get_responseAvailable()){var f=d.get_statusCode(),c=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))c=d.get_object();else if(e.startsWith("text/xml"))c=d.get_xml();else c=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(c)c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)}else if(e.startsWith("application/json"))c=!c||typeof c.d==="undefined"?c:c.d;if(f<200||f>=300||h){if(b){if(!c||!h)c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a));c._statusCode=f;b(c,g,a)}}else if(j)j(c,g,a)}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}return d};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys._jsonp=0;Sys.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;Sys.Net.WebServiceError=function(d,e,c,a,b){this._timedOut=d;this._message=e;this._stackTrace=c;this._exceptionType=a;this._errorObject=b;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||""},get_errorObject:function(){return this._errorObject||null}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");
Type.registerNamespace('Sys');Sys.Res={'argumentInteger':'Value must be an integer.','invokeCalledTwice':'Cannot call invoke more than once.','webServiceFailed':'The server method \'{0}\' failed with the following error: {1}','argumentType':'Object cannot be converted to the required type.','argumentNull':'Value cannot be null.','scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.','scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.','formatBadFormatSpecifier':'Format specifier was invalid.','requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.','webServiceFailedNoMsg':'The server method \'{0}\' 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':'\'{0}\' is not a valid value for enum {1}.','scriptLoadFailed':'The script \'{0}\' 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 \'{0}\' returned an invalid type. Expected type: {1}','servicePathNotSet':'The path to the web service has not been set.','argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.','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}','nullReferenceInPath':'Null reference while evaluating data path: \'{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 \'{0}\' timed out.','notImplemented':'The method or operation is not implemented.','assertFailed':'Assertion Failed: {0}','invalidOperation':'Operation is not valid due to the current state of the object.','breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?'};
//!----------------------------------------------------------
//! Copyright (C) Microsoft Corporation. All rights reserved.
//!----------------------------------------------------------
//! MicrosoftMvcAjax.js
Type.registerNamespace('Sys.Mvc');
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.AjaxOptions
Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; }
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.InsertionMode
Sys.Mvc.InsertionMode = function() {
/// <field name="replace" type="Number" integer="true" static="true">
/// </field>
/// <field name="insertBefore" type="Number" integer="true" static="true">
/// </field>
/// <field name="insertAfter" type="Number" integer="true" static="true">
/// </field>
};
Sys.Mvc.InsertionMode.prototype = {
replace: 0,
insertBefore: 1,
insertAfter: 2
}
Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false);
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.AjaxContext
Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) {
/// <param name="request" type="Sys.Net.WebRequest">
/// </param>
/// <param name="updateTarget" type="Object" domElement="true">
/// </param>
/// <param name="loadingElement" type="Object" domElement="true">
/// </param>
/// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
/// </param>
/// <field name="_insertionMode" type="Sys.Mvc.InsertionMode">
/// </field>
/// <field name="_loadingElement" type="Object" domElement="true">
/// </field>
/// <field name="_response" type="Sys.Net.WebRequestExecutor">
/// </field>
/// <field name="_request" type="Sys.Net.WebRequest">
/// </field>
/// <field name="_updateTarget" type="Object" domElement="true">
/// </field>
this._request = request;
this._updateTarget = updateTarget;
this._loadingElement = loadingElement;
this._insertionMode = insertionMode;
}
Sys.Mvc.AjaxContext.prototype = {
_insertionMode: 0,
_loadingElement: null,
_response: null,
_request: null,
_updateTarget: null,
get_data: function Sys_Mvc_AjaxContext$get_data() {
/// <value type="String"></value>
if (this._response) {
return this._response.get_responseData();
}
else {
return null;
}
},
get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() {
/// <value type="Sys.Mvc.InsertionMode"></value>
return this._insertionMode;
},
get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() {
/// <value type="Object" domElement="true"></value>
return this._loadingElement;
},
get_object: function Sys_Mvc_AjaxContext$get_object() {
/// <value type="Object"></value>
var executor = this.get_response();
return (executor) ? executor.get_object() : null;
},
get_response: function Sys_Mvc_AjaxContext$get_response() {
/// <value type="Sys.Net.WebRequestExecutor"></value>
return this._response;
},
set_response: function Sys_Mvc_AjaxContext$set_response(value) {
/// <value type="Sys.Net.WebRequestExecutor"></value>
this._response = value;
return value;
},
get_request: function Sys_Mvc_AjaxContext$get_request() {
/// <value type="Sys.Net.WebRequest"></value>
return this._request;
},
get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() {
/// <value type="Object" domElement="true"></value>
return this._updateTarget;
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.AsyncHyperlink
Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() {
}
Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) {
/// <param name="anchor" type="Object" domElement="true">
/// </param>
/// <param name="evt" type="Sys.UI.DomEvent">
/// </param>
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
/// </param>
evt.preventDefault();
Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions);
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.MvcHelpers
Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() {
}
Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <param name="offsetX" type="Number" integer="true">
/// </param>
/// <param name="offsetY" type="Number" integer="true">
/// </param>
/// <returns type="String"></returns>
if (element.disabled) {
return null;
}
var name = element.name;
if (name) {
var tagName = element.tagName.toUpperCase();
var encodedName = encodeURIComponent(name);
var inputElement = element;
if (tagName === 'INPUT') {
var type = inputElement.type;
if (type === 'submit') {
return encodedName + '=' + encodeURIComponent(inputElement.value);
}
else if (type === 'image') {
return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY;
}
}
else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) {
return encodedName + '=' + encodeURIComponent(inputElement.value);
}
}
return null;
}
Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) {
/// <param name="form" type="Object" domElement="true">
/// </param>
/// <returns type="String"></returns>
var formElements = form.elements;
var formBody = new Sys.StringBuilder();
var count = formElements.length;
for (var i = 0; i < count; i++) {
var element = formElements[i];
var name = element.name;
if (!name || !name.length) {
continue;
}
var tagName = element.tagName.toUpperCase();
if (tagName === 'INPUT') {
var inputElement = element;
var type = inputElement.type;
if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) {
formBody.append(encodeURIComponent(name));
formBody.append('=');
formBody.append(encodeURIComponent(inputElement.value));
formBody.append('&');
}
}
else if (tagName === 'SELECT') {
var selectElement = element;
var optionCount = selectElement.options.length;
for (var j = 0; j < optionCount; j++) {
var optionElement = selectElement.options[j];
if (optionElement.selected) {
formBody.append(encodeURIComponent(name));
formBody.append('=');
formBody.append(encodeURIComponent(optionElement.value));
formBody.append('&');
}
}
}
else if (tagName === 'TEXTAREA') {
formBody.append(encodeURIComponent(name));
formBody.append('=');
formBody.append(encodeURIComponent((element.value)));
formBody.append('&');
}
}
var additionalInput = form._additionalInput;
if (additionalInput) {
formBody.append(additionalInput);
formBody.append('&');
}
return formBody.toString();
}
Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) {
/// <param name="url" type="String">
/// </param>
/// <param name="verb" type="String">
/// </param>
/// <param name="body" type="String">
/// </param>
/// <param name="triggerElement" type="Object" domElement="true">
/// </param>
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
/// </param>
if (ajaxOptions.confirm) {
if (!confirm(ajaxOptions.confirm)) {
return;
}
}
if (ajaxOptions.url) {
url = ajaxOptions.url;
}
if (ajaxOptions.httpMethod) {
verb = ajaxOptions.httpMethod;
}
if (body.length > 0 && !body.endsWith('&')) {
body += '&';
}
body += 'X-Requested-With=XMLHttpRequest';
var upperCaseVerb = verb.toUpperCase();
var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST');
if (!isGetOrPost) {
body += '&';
body += 'X-HTTP-Method-Override=' + upperCaseVerb;
}
var requestBody = '';
if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') {
if (url.indexOf('?') > -1) {
if (!url.endsWith('&')) {
url += '&';
}
url += body;
}
else {
url += '?';
url += body;
}
}
else {
requestBody = body;
}
var request = new Sys.Net.WebRequest();
request.set_url(url);
if (isGetOrPost) {
request.set_httpVerb(verb);
}
else {
request.set_httpVerb('POST');
request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb;
}
request.set_body(requestBody);
if (verb.toUpperCase() === 'PUT') {
request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;';
}
request.get_headers()['X-Requested-With'] = 'XMLHttpRequest';
var updateElement = null;
if (ajaxOptions.updateTargetId) {
updateElement = $get(ajaxOptions.updateTargetId);
}
var loadingElement = null;
if (ajaxOptions.loadingElementId) {
loadingElement = $get(ajaxOptions.loadingElementId);
}
var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode);
var continueRequest = true;
if (ajaxOptions.onBegin) {
continueRequest = ajaxOptions.onBegin(ajaxContext) !== false;
}
if (loadingElement) {
Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true);
}
if (continueRequest) {
request.add_completed(Function.createDelegate(null, function(executor) {
Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext);
}));
request.invoke();
}
}
Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) {
/// <param name="request" type="Sys.Net.WebRequest">
/// </param>
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
/// </param>
/// <param name="ajaxContext" type="Sys.Mvc.AjaxContext">
/// </param>
ajaxContext.set_response(request.get_executor());
if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) {
return;
}
var statusCode = ajaxContext.get_response().get_statusCode();
if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) {
if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) {
var contentType = ajaxContext.get_response().getResponseHeader('Content-Type');
if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) {
eval(ajaxContext.get_data());
}
else {
Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data());
}
}
if (ajaxOptions.onSuccess) {
ajaxOptions.onSuccess(ajaxContext);
}
}
else {
if (ajaxOptions.onFailure) {
ajaxOptions.onFailure(ajaxContext);
}
}
if (ajaxContext.get_loadingElement()) {
Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false);
}
}
Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) {
/// <param name="target" type="Object" domElement="true">
/// </param>
/// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
/// </param>
/// <param name="content" type="String">
/// </param>
if (target) {
switch (insertionMode) {
case Sys.Mvc.InsertionMode.replace:
target.innerHTML = content;
break;
case Sys.Mvc.InsertionMode.insertBefore:
if (content && content.length > 0) {
target.innerHTML = content + target.innerHTML.trimStart();
}
break;
case Sys.Mvc.InsertionMode.insertAfter:
if (content && content.length > 0) {
target.innerHTML = target.innerHTML.trimEnd() + content;
}
break;
}
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.AsyncForm
Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() {
}
Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) {
/// <param name="form" type="Object" domElement="true">
/// </param>
/// <param name="evt" type="Sys.UI.DomEvent">
/// </param>
var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY);
form._additionalInput = additionalInput;
}
Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) {
/// <param name="form" type="Object" domElement="true">
/// </param>
/// <param name="evt" type="Sys.UI.DomEvent">
/// </param>
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
/// </param>
evt.preventDefault();
var validationCallbacks = form.validationCallbacks;
if (validationCallbacks) {
for (var i = 0; i < validationCallbacks.length; i++) {
var callback = validationCallbacks[i];
if (!callback()) {
return;
}
}
}
var body = Sys.Mvc.MvcHelpers._serializeForm(form);
Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions);
}
Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');
Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');
Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');
Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm');
// ---- Do not remove this footer ----
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
// -----------------------------------
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftMvcAjax.js
Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};}
Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2}
Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;}
Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_object:function(){var $0=this.get_response();return ($0)?$0.get_object():null;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}}
Sys.Mvc.AsyncHyperlink=function(){}
Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);}
Sys.Mvc.MvcHelpers=function(){}
Sys.Mvc.MvcHelpers.$0=function($p0,$p1,$p2){if($p0.disabled){return null;}var $0=$p0.name;if($0){var $1=$p0.tagName.toUpperCase();var $2=encodeURIComponent($0);var $3=$p0;if($1==='INPUT'){var $4=$3.type;if($4==='submit'){return $2+'='+encodeURIComponent($3.value);}else if($4==='image'){return $2+'.x='+$p1+'&'+$2+'.y='+$p2;}}else if(($1==='BUTTON')&&($0.length)&&($3.type==='submit')){return $2+'='+encodeURIComponent($3.value);}}return null;}
Sys.Mvc.MvcHelpers.$1=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $4=0;$4<$2;$4++){var $5=$0[$4];var $6=$5.name;if(!$6||!$6.length){continue;}var $7=$5.tagName.toUpperCase();if($7==='INPUT'){var $8=$5;var $9=$8.type;if(($9==='text')||($9==='password')||($9==='hidden')||((($9==='checkbox')||($9==='radio'))&&$5.checked)){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($8.value));$1.append('&');}}else if($7==='SELECT'){var $A=$5;var $B=$A.options.length;for(var $C=0;$C<$B;$C++){var $D=$A.options[$C];if($D.selected){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($D.value));$1.append('&');}}}else if($7==='TEXTAREA'){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent(($5.value)));$1.append('&');}}var $3=$p0._additionalInput;if($3){$1.append($3);$1.append('&');}return $1.toString();}
Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0=$p1.toUpperCase();var $1=($0==='GET'||$0==='POST');if(!$1){$p2+='&';$p2+='X-HTTP-Method-Override='+$0;}var $2='';if($0==='GET'||$0==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$2=$p2;}var $3=new Sys.Net.WebRequest();$3.set_url($p0);if($1){$3.set_httpVerb($p1);}else{$3.set_httpVerb('POST');$3.get_headers()['X-HTTP-Method-Override']=$0;}$3.set_body($2);if($p1.toUpperCase()==='PUT'){$3.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$3.get_headers()['X-Requested-With']='XMLHttpRequest';var $4=null;if($p4.updateTargetId){$4=$get($p4.updateTargetId);}var $5=null;if($p4.loadingElementId){$5=$get($p4.loadingElementId);}var $6=new Sys.Mvc.AjaxContext($3,$4,$5,$p4.insertionMode);var $7=true;if($p4.onBegin){$7=$p4.onBegin($6)!==false;}if($5){Sys.UI.DomElement.setVisible($6.get_loadingElement(),true);}if($7){$3.add_completed(Function.createDelegate(null,function($p1_0){
Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}}
Sys.Mvc.MvcHelpers.$3=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}}
Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}}
Sys.Mvc.AsyncForm=function(){}
Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;}
Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=form.validationCallbacks;if($0){for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3()){return;}}}var $1=Sys.Mvc.MvcHelpers.$1(form);Sys.Mvc.MvcHelpers.$2(form.action,form.method||'post',$1,form,ajaxOptions);}
Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm');
// ---- Do not remove this footer ----
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
// -----------------------------------
//!----------------------------------------------------------
//! Copyright (C) Microsoft Corporation. All rights reserved.
//!----------------------------------------------------------
//! MicrosoftMvcValidation.js
Type.registerNamespace('Sys.Mvc');
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.Validation
Sys.Mvc.$create_Validation = function Sys_Mvc_Validation() { return {}; }
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.JsonValidationField
Sys.Mvc.$create_JsonValidationField = function Sys_Mvc_JsonValidationField() { return {}; }
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.JsonValidationOptions
Sys.Mvc.$create_JsonValidationOptions = function Sys_Mvc_JsonValidationOptions() { return {}; }
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.JsonValidationRule
Sys.Mvc.$create_JsonValidationRule = function Sys_Mvc_JsonValidationRule() { return {}; }
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.ValidationContext
Sys.Mvc.$create_ValidationContext = function Sys_Mvc_ValidationContext() { return {}; }
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.NumberValidator
Sys.Mvc.NumberValidator = function Sys_Mvc_NumberValidator() {
}
Sys.Mvc.NumberValidator.create = function Sys_Mvc_NumberValidator$create(rule) {
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
/// </param>
/// <returns type="Sys.Mvc.Validator"></returns>
return Function.createDelegate(new Sys.Mvc.NumberValidator(), new Sys.Mvc.NumberValidator().validate);
}
Sys.Mvc.NumberValidator.prototype = {
validate: function Sys_Mvc_NumberValidator$validate(value, context) {
/// <param name="value" type="String">
/// </param>
/// <param name="context" type="Sys.Mvc.ValidationContext">
/// </param>
/// <returns type="Object"></returns>
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
return true;
}
var n = Number.parseLocale(value);
return (!isNaN(n));
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.FormContext
Sys.Mvc.FormContext = function Sys_Mvc_FormContext(formElement, validationSummaryElement) {
/// <param name="formElement" type="Object" domElement="true">
/// </param>
/// <param name="validationSummaryElement" type="Object" domElement="true">
/// </param>
/// <field name="_validationSummaryErrorCss" type="String" static="true">
/// </field>
/// <field name="_validationSummaryValidCss" type="String" static="true">
/// </field>
/// <field name="_formValidationTag" type="String" static="true">
/// </field>
/// <field name="_onClickHandler" type="Sys.UI.DomEventHandler">
/// </field>
/// <field name="_onSubmitHandler" type="Sys.UI.DomEventHandler">
/// </field>
/// <field name="_errors" type="Array">
/// </field>
/// <field name="_submitButtonClicked" type="Object" domElement="true">
/// </field>
/// <field name="_validationSummaryElement" type="Object" domElement="true">
/// </field>
/// <field name="_validationSummaryULElement" type="Object" domElement="true">
/// </field>
/// <field name="fields" type="Array" elementType="FieldContext">
/// </field>
/// <field name="_formElement" type="Object" domElement="true">
/// </field>
/// <field name="replaceValidationSummary" type="Boolean">
/// </field>
this._errors = [];
this.fields = new Array(0);
this._formElement = formElement;
this._validationSummaryElement = validationSummaryElement;
formElement[Sys.Mvc.FormContext._formValidationTag] = this;
if (validationSummaryElement) {
var ulElements = validationSummaryElement.getElementsByTagName('ul');
if (ulElements.length > 0) {
this._validationSummaryULElement = ulElements[0];
}
}
this._onClickHandler = Function.createDelegate(this, this._form_OnClick);
this._onSubmitHandler = Function.createDelegate(this, this._form_OnSubmit);
}
Sys.Mvc.FormContext._Application_Load = function Sys_Mvc_FormContext$_Application_Load() {
var allFormOptions = window.mvcClientValidationMetadata;
if (allFormOptions) {
while (allFormOptions.length > 0) {
var thisFormOptions = allFormOptions.pop();
Sys.Mvc.FormContext._parseJsonOptions(thisFormOptions);
}
}
}
Sys.Mvc.FormContext._getFormElementsWithName = function Sys_Mvc_FormContext$_getFormElementsWithName(formElement, name) {
/// <param name="formElement" type="Object" domElement="true">
/// </param>
/// <param name="name" type="String">
/// </param>
/// <returns type="Array" elementType="Object" elementDomElement="true"></returns>
var allElementsWithNameInForm = [];
var allElementsWithName = document.getElementsByName(name);
for (var i = 0; i < allElementsWithName.length; i++) {
var thisElement = allElementsWithName[i];
if (Sys.Mvc.FormContext._isElementInHierarchy(formElement, thisElement)) {
Array.add(allElementsWithNameInForm, thisElement);
}
}
return allElementsWithNameInForm;
}
Sys.Mvc.FormContext.getValidationForForm = function Sys_Mvc_FormContext$getValidationForForm(formElement) {
/// <param name="formElement" type="Object" domElement="true">
/// </param>
/// <returns type="Sys.Mvc.FormContext"></returns>
return formElement[Sys.Mvc.FormContext._formValidationTag];
}
Sys.Mvc.FormContext._isElementInHierarchy = function Sys_Mvc_FormContext$_isElementInHierarchy(parent, child) {
/// <param name="parent" type="Object" domElement="true">
/// </param>
/// <param name="child" type="Object" domElement="true">
/// </param>
/// <returns type="Boolean"></returns>
while (child) {
if (parent === child) {
return true;
}
child = child.parentNode;
}
return false;
}
Sys.Mvc.FormContext._parseJsonOptions = function Sys_Mvc_FormContext$_parseJsonOptions(options) {
/// <param name="options" type="Sys.Mvc.JsonValidationOptions">
/// </param>
/// <returns type="Sys.Mvc.FormContext"></returns>
var formElement = $get(options.FormId);
var validationSummaryElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(options.ValidationSummaryId)) ? $get(options.ValidationSummaryId) : null;
var formContext = new Sys.Mvc.FormContext(formElement, validationSummaryElement);
formContext.enableDynamicValidation();
formContext.replaceValidationSummary = options.ReplaceValidationSummary;
for (var i = 0; i < options.Fields.length; i++) {
var field = options.Fields[i];
var fieldElements = Sys.Mvc.FormContext._getFormElementsWithName(formElement, field.FieldName);
var validationMessageElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(field.ValidationMessageId)) ? $get(field.ValidationMessageId) : null;
var fieldContext = new Sys.Mvc.FieldContext(formContext);
Array.addRange(fieldContext.elements, fieldElements);
fieldContext.validationMessageElement = validationMessageElement;
fieldContext.replaceValidationMessageContents = field.ReplaceValidationMessageContents;
for (var j = 0; j < field.ValidationRules.length; j++) {
var rule = field.ValidationRules[j];
var validator = Sys.Mvc.ValidatorRegistry.getValidator(rule);
if (validator) {
var validation = Sys.Mvc.$create_Validation();
validation.fieldErrorMessage = rule.ErrorMessage;
validation.validator = validator;
Array.add(fieldContext.validations, validation);
}
}
fieldContext.enableDynamicValidation();
Array.add(formContext.fields, fieldContext);
}
var registeredValidatorCallbacks = formElement.validationCallbacks;
if (!registeredValidatorCallbacks) {
registeredValidatorCallbacks = [];
formElement.validationCallbacks = registeredValidatorCallbacks;
}
registeredValidatorCallbacks.push(Function.createDelegate(null, function() {
return Sys.Mvc._validationUtil.arrayIsNullOrEmpty(formContext.validate('submit'));
}));
return formContext;
}
Sys.Mvc.FormContext.prototype = {
_onClickHandler: null,
_onSubmitHandler: null,
_submitButtonClicked: null,
_validationSummaryElement: null,
_validationSummaryULElement: null,
_formElement: null,
replaceValidationSummary: false,
addError: function Sys_Mvc_FormContext$addError(message) {
/// <param name="message" type="String">
/// </param>
this.addErrors([ message ]);
},
addErrors: function Sys_Mvc_FormContext$addErrors(messages) {
/// <param name="messages" type="Array" elementType="String">
/// </param>
if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) {
Array.addRange(this._errors, messages);
this._onErrorCountChanged();
}
},
clearErrors: function Sys_Mvc_FormContext$clearErrors() {
Array.clear(this._errors);
this._onErrorCountChanged();
},
_displayError: function Sys_Mvc_FormContext$_displayError() {
if (this._validationSummaryElement) {
if (this._validationSummaryULElement) {
Sys.Mvc._validationUtil.removeAllChildren(this._validationSummaryULElement);
for (var i = 0; i < this._errors.length; i++) {
var liElement = document.createElement('li');
Sys.Mvc._validationUtil.setInnerText(liElement, this._errors[i]);
this._validationSummaryULElement.appendChild(liElement);
}
}
Sys.UI.DomElement.removeCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss);
Sys.UI.DomElement.addCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss);
}
},
_displaySuccess: function Sys_Mvc_FormContext$_displaySuccess() {
var validationSummaryElement = this._validationSummaryElement;
if (validationSummaryElement) {
var validationSummaryULElement = this._validationSummaryULElement;
if (validationSummaryULElement) {
validationSummaryULElement.innerHTML = '';
}
Sys.UI.DomElement.removeCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss);
Sys.UI.DomElement.addCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss);
}
},
enableDynamicValidation: function Sys_Mvc_FormContext$enableDynamicValidation() {
Sys.UI.DomEvent.addHandler(this._formElement, 'click', this._onClickHandler);
Sys.UI.DomEvent.addHandler(this._formElement, 'submit', this._onSubmitHandler);
},
_findSubmitButton: function Sys_Mvc_FormContext$_findSubmitButton(element) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <returns type="Object" domElement="true"></returns>
if (element.disabled) {
return null;
}
var tagName = element.tagName.toUpperCase();
var inputElement = element;
if (tagName === 'INPUT') {
var type = inputElement.type;
if (type === 'submit' || type === 'image') {
return inputElement;
}
}
else if ((tagName === 'BUTTON') && (inputElement.type === 'submit')) {
return inputElement;
}
return null;
},
_form_OnClick: function Sys_Mvc_FormContext$_form_OnClick(e) {
/// <param name="e" type="Sys.UI.DomEvent">
/// </param>
this._submitButtonClicked = this._findSubmitButton(e.target);
},
_form_OnSubmit: function Sys_Mvc_FormContext$_form_OnSubmit(e) {
/// <param name="e" type="Sys.UI.DomEvent">
/// </param>
var form = e.target;
var submitButton = this._submitButtonClicked;
if (submitButton && submitButton.disableValidation) {
return;
}
var errorMessages = this.validate('submit');
if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(errorMessages)) {
e.preventDefault();
}
},
_onErrorCountChanged: function Sys_Mvc_FormContext$_onErrorCountChanged() {
if (!this._errors.length) {
this._displaySuccess();
}
else {
this._displayError();
}
},
validate: function Sys_Mvc_FormContext$validate(eventName) {
/// <param name="eventName" type="String">
/// </param>
/// <returns type="Array" elementType="String"></returns>
var fields = this.fields;
var errors = [];
for (var i = 0; i < fields.length; i++) {
var field = fields[i];
if (!field.elements[0].disabled) {
var thisErrors = field.validate(eventName);
if (thisErrors) {
Array.addRange(errors, thisErrors);
}
}
}
if (this.replaceValidationSummary) {
this.clearErrors();
this.addErrors(errors);
}
return errors;
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.FieldContext
Sys.Mvc.FieldContext = function Sys_Mvc_FieldContext(formContext) {
/// <param name="formContext" type="Sys.Mvc.FormContext">
/// </param>
/// <field name="_hasTextChangedTag" type="String" static="true">
/// </field>
/// <field name="_hasValidationFiredTag" type="String" static="true">
/// </field>
/// <field name="_inputElementErrorCss" type="String" static="true">
/// </field>
/// <field name="_inputElementValidCss" type="String" static="true">
/// </field>
/// <field name="_validationMessageErrorCss" type="String" static="true">
/// </field>
/// <field name="_validationMessageValidCss" type="String" static="true">
/// </field>
/// <field name="_onBlurHandler" type="Sys.UI.DomEventHandler">
/// </field>
/// <field name="_onChangeHandler" type="Sys.UI.DomEventHandler">
/// </field>
/// <field name="_onInputHandler" type="Sys.UI.DomEventHandler">
/// </field>
/// <field name="_onPropertyChangeHandler" type="Sys.UI.DomEventHandler">
/// </field>
/// <field name="_errors" type="Array">
/// </field>
/// <field name="defaultErrorMessage" type="String">
/// </field>
/// <field name="elements" type="Array" elementType="Object" elementDomElement="true">
/// </field>
/// <field name="formContext" type="Sys.Mvc.FormContext">
/// </field>
/// <field name="replaceValidationMessageContents" type="Boolean">
/// </field>
/// <field name="validationMessageElement" type="Object" domElement="true">
/// </field>
/// <field name="validations" type="Array" elementType="Validation">
/// </field>
this._errors = [];
this.elements = new Array(0);
this.validations = new Array(0);
this.formContext = formContext;
this._onBlurHandler = Function.createDelegate(this, this._element_OnBlur);
this._onChangeHandler = Function.createDelegate(this, this._element_OnChange);
this._onInputHandler = Function.createDelegate(this, this._element_OnInput);
this._onPropertyChangeHandler = Function.createDelegate(this, this._element_OnPropertyChange);
}
Sys.Mvc.FieldContext.prototype = {
_onBlurHandler: null,
_onChangeHandler: null,
_onInputHandler: null,
_onPropertyChangeHandler: null,
defaultErrorMessage: null,
formContext: null,
replaceValidationMessageContents: false,
validationMessageElement: null,
addError: function Sys_Mvc_FieldContext$addError(message) {
/// <param name="message" type="String">
/// </param>
this.addErrors([ message ]);
},
addErrors: function Sys_Mvc_FieldContext$addErrors(messages) {
/// <param name="messages" type="Array" elementType="String">
/// </param>
if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) {
Array.addRange(this._errors, messages);
this._onErrorCountChanged();
}
},
clearErrors: function Sys_Mvc_FieldContext$clearErrors() {
Array.clear(this._errors);
this._onErrorCountChanged();
},
_displayError: function Sys_Mvc_FieldContext$_displayError() {
var validationMessageElement = this.validationMessageElement;
if (validationMessageElement) {
if (this.replaceValidationMessageContents) {
Sys.Mvc._validationUtil.setInnerText(validationMessageElement, this._errors[0]);
}
Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss);
Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss);
}
var elements = this.elements;
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss);
Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss);
}
},
_displaySuccess: function Sys_Mvc_FieldContext$_displaySuccess() {
var validationMessageElement = this.validationMessageElement;
if (validationMessageElement) {
if (this.replaceValidationMessageContents) {
Sys.Mvc._validationUtil.setInnerText(validationMessageElement, '');
}
Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss);
Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss);
}
var elements = this.elements;
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss);
Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss);
}
},
_element_OnBlur: function Sys_Mvc_FieldContext$_element_OnBlur(e) {
/// <param name="e" type="Sys.UI.DomEvent">
/// </param>
if (e.target[Sys.Mvc.FieldContext._hasTextChangedTag] || e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
this.validate('blur');
}
},
_element_OnChange: function Sys_Mvc_FieldContext$_element_OnChange(e) {
/// <param name="e" type="Sys.UI.DomEvent">
/// </param>
e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
},
_element_OnInput: function Sys_Mvc_FieldContext$_element_OnInput(e) {
/// <param name="e" type="Sys.UI.DomEvent">
/// </param>
e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
this.validate('input');
}
},
_element_OnPropertyChange: function Sys_Mvc_FieldContext$_element_OnPropertyChange(e) {
/// <param name="e" type="Sys.UI.DomEvent">
/// </param>
if (e.rawEvent.propertyName === 'value') {
e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
this.validate('input');
}
}
},
enableDynamicValidation: function Sys_Mvc_FieldContext$enableDynamicValidation() {
var elements = this.elements;
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
if (Sys.Mvc._validationUtil.elementSupportsEvent(element, 'onpropertychange')) {
var compatMode = document.documentMode;
if (compatMode && compatMode >= 8) {
Sys.UI.DomEvent.addHandler(element, 'propertychange', this._onPropertyChangeHandler);
}
}
else {
Sys.UI.DomEvent.addHandler(element, 'input', this._onInputHandler);
}
Sys.UI.DomEvent.addHandler(element, 'change', this._onChangeHandler);
Sys.UI.DomEvent.addHandler(element, 'blur', this._onBlurHandler);
}
},
_getErrorString: function Sys_Mvc_FieldContext$_getErrorString(validatorReturnValue, fieldErrorMessage) {
/// <param name="validatorReturnValue" type="Object">
/// </param>
/// <param name="fieldErrorMessage" type="String">
/// </param>
/// <returns type="String"></returns>
var fallbackErrorMessage = fieldErrorMessage || this.defaultErrorMessage;
if (Boolean.isInstanceOfType(validatorReturnValue)) {
return (validatorReturnValue) ? null : fallbackErrorMessage;
}
if (String.isInstanceOfType(validatorReturnValue)) {
return ((validatorReturnValue).length) ? validatorReturnValue : fallbackErrorMessage;
}
return null;
},
_getStringValue: function Sys_Mvc_FieldContext$_getStringValue() {
/// <returns type="String"></returns>
var elements = this.elements;
return (elements.length > 0) ? elements[0].value : null;
},
_markValidationFired: function Sys_Mvc_FieldContext$_markValidationFired() {
var elements = this.elements;
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
element[Sys.Mvc.FieldContext._hasValidationFiredTag] = true;
}
},
_onErrorCountChanged: function Sys_Mvc_FieldContext$_onErrorCountChanged() {
if (!this._errors.length) {
this._displaySuccess();
}
else {
this._displayError();
}
},
validate: function Sys_Mvc_FieldContext$validate(eventName) {
/// <param name="eventName" type="String">
/// </param>
/// <returns type="Array" elementType="String"></returns>
var validations = this.validations;
var errors = [];
var value = this._getStringValue();
for (var i = 0; i < validations.length; i++) {
var validation = validations[i];
var context = Sys.Mvc.$create_ValidationContext();
context.eventName = eventName;
context.fieldContext = this;
context.validation = validation;
var retVal = validation.validator(value, context);
var errorMessage = this._getErrorString(retVal, validation.fieldErrorMessage);
if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(errorMessage)) {
Array.add(errors, errorMessage);
}
}
this._markValidationFired();
this.clearErrors();
this.addErrors(errors);
return errors;
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.RangeValidator
Sys.Mvc.RangeValidator = function Sys_Mvc_RangeValidator(minimum, maximum) {
/// <param name="minimum" type="Number">
/// </param>
/// <param name="maximum" type="Number">
/// </param>
/// <field name="_minimum" type="Number">
/// </field>
/// <field name="_maximum" type="Number">
/// </field>
this._minimum = minimum;
this._maximum = maximum;
}
Sys.Mvc.RangeValidator.create = function Sys_Mvc_RangeValidator$create(rule) {
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
/// </param>
/// <returns type="Sys.Mvc.Validator"></returns>
var min = rule.ValidationParameters['min'];
var max = rule.ValidationParameters['max'];
return Function.createDelegate(new Sys.Mvc.RangeValidator(min, max), new Sys.Mvc.RangeValidator(min, max).validate);
}
Sys.Mvc.RangeValidator.prototype = {
_minimum: null,
_maximum: null,
validate: function Sys_Mvc_RangeValidator$validate(value, context) {
/// <param name="value" type="String">
/// </param>
/// <param name="context" type="Sys.Mvc.ValidationContext">
/// </param>
/// <returns type="Object"></returns>
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
return true;
}
var n = Number.parseLocale(value);
return (!isNaN(n) && this._minimum <= n && n <= this._maximum);
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.RegularExpressionValidator
Sys.Mvc.RegularExpressionValidator = function Sys_Mvc_RegularExpressionValidator(pattern) {
/// <param name="pattern" type="String">
/// </param>
/// <field name="_pattern" type="String">
/// </field>
this._pattern = pattern;
}
Sys.Mvc.RegularExpressionValidator.create = function Sys_Mvc_RegularExpressionValidator$create(rule) {
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
/// </param>
/// <returns type="Sys.Mvc.Validator"></returns>
var pattern = rule.ValidationParameters['pattern'];
return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator(pattern), new Sys.Mvc.RegularExpressionValidator(pattern).validate);
}
Sys.Mvc.RegularExpressionValidator.prototype = {
_pattern: null,
validate: function Sys_Mvc_RegularExpressionValidator$validate(value, context) {
/// <param name="value" type="String">
/// </param>
/// <param name="context" type="Sys.Mvc.ValidationContext">
/// </param>
/// <returns type="Object"></returns>
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
return true;
}
var regExp = new RegExp(this._pattern);
var matches = regExp.exec(value);
return (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(matches) && matches[0].length === value.length);
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.RequiredValidator
Sys.Mvc.RequiredValidator = function Sys_Mvc_RequiredValidator() {
}
Sys.Mvc.RequiredValidator.create = function Sys_Mvc_RequiredValidator$create(rule) {
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
/// </param>
/// <returns type="Sys.Mvc.Validator"></returns>
return Function.createDelegate(new Sys.Mvc.RequiredValidator(), new Sys.Mvc.RequiredValidator().validate);
}
Sys.Mvc.RequiredValidator._isRadioInputElement = function Sys_Mvc_RequiredValidator$_isRadioInputElement(element) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <returns type="Boolean"></returns>
if (element.tagName.toUpperCase() === 'INPUT') {
var inputType = (element.type).toUpperCase();
if (inputType === 'RADIO') {
return true;
}
}
return false;
}
Sys.Mvc.RequiredValidator._isSelectInputElement = function Sys_Mvc_RequiredValidator$_isSelectInputElement(element) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <returns type="Boolean"></returns>
if (element.tagName.toUpperCase() === 'SELECT') {
return true;
}
return false;
}
Sys.Mvc.RequiredValidator._isTextualInputElement = function Sys_Mvc_RequiredValidator$_isTextualInputElement(element) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <returns type="Boolean"></returns>
if (element.tagName.toUpperCase() === 'INPUT') {
var inputType = (element.type).toUpperCase();
switch (inputType) {
case 'TEXT':
case 'PASSWORD':
case 'FILE':
return true;
}
}
if (element.tagName.toUpperCase() === 'TEXTAREA') {
return true;
}
return false;
}
Sys.Mvc.RequiredValidator._validateRadioInput = function Sys_Mvc_RequiredValidator$_validateRadioInput(elements) {
/// <param name="elements" type="Array" elementType="Object" elementDomElement="true">
/// </param>
/// <returns type="Object"></returns>
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
if (element.checked) {
return true;
}
}
return false;
}
Sys.Mvc.RequiredValidator._validateSelectInput = function Sys_Mvc_RequiredValidator$_validateSelectInput(optionElements) {
/// <param name="optionElements" type="DOMElementCollection">
/// </param>
/// <returns type="Object"></returns>
for (var i = 0; i < optionElements.length; i++) {
var element = optionElements[i];
if (element.selected) {
if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)) {
return true;
}
}
}
return false;
}
Sys.Mvc.RequiredValidator._validateTextualInput = function Sys_Mvc_RequiredValidator$_validateTextualInput(element) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <returns type="Object"></returns>
return (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value));
}
Sys.Mvc.RequiredValidator.prototype = {
validate: function Sys_Mvc_RequiredValidator$validate(value, context) {
/// <param name="value" type="String">
/// </param>
/// <param name="context" type="Sys.Mvc.ValidationContext">
/// </param>
/// <returns type="Object"></returns>
var elements = context.fieldContext.elements;
if (!elements.length) {
return true;
}
var sampleElement = elements[0];
if (Sys.Mvc.RequiredValidator._isTextualInputElement(sampleElement)) {
return Sys.Mvc.RequiredValidator._validateTextualInput(sampleElement);
}
if (Sys.Mvc.RequiredValidator._isRadioInputElement(sampleElement)) {
return Sys.Mvc.RequiredValidator._validateRadioInput(elements);
}
if (Sys.Mvc.RequiredValidator._isSelectInputElement(sampleElement)) {
return Sys.Mvc.RequiredValidator._validateSelectInput((sampleElement).options);
}
return true;
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.StringLengthValidator
Sys.Mvc.StringLengthValidator = function Sys_Mvc_StringLengthValidator(minLength, maxLength) {
/// <param name="minLength" type="Number" integer="true">
/// </param>
/// <param name="maxLength" type="Number" integer="true">
/// </param>
/// <field name="_maxLength" type="Number" integer="true">
/// </field>
/// <field name="_minLength" type="Number" integer="true">
/// </field>
this._minLength = minLength;
this._maxLength = maxLength;
}
Sys.Mvc.StringLengthValidator.create = function Sys_Mvc_StringLengthValidator$create(rule) {
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
/// </param>
/// <returns type="Sys.Mvc.Validator"></returns>
var minLength = (rule.ValidationParameters['min'] || 0);
var maxLength = (rule.ValidationParameters['max'] || Number.MAX_VALUE);
return Function.createDelegate(new Sys.Mvc.StringLengthValidator(minLength, maxLength), new Sys.Mvc.StringLengthValidator(minLength, maxLength).validate);
}
Sys.Mvc.StringLengthValidator.prototype = {
_maxLength: 0,
_minLength: 0,
validate: function Sys_Mvc_StringLengthValidator$validate(value, context) {
/// <param name="value" type="String">
/// </param>
/// <param name="context" type="Sys.Mvc.ValidationContext">
/// </param>
/// <returns type="Object"></returns>
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
return true;
}
return (this._minLength <= value.length && value.length <= this._maxLength);
}
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc._validationUtil
Sys.Mvc._validationUtil = function Sys_Mvc__validationUtil() {
}
Sys.Mvc._validationUtil.arrayIsNullOrEmpty = function Sys_Mvc__validationUtil$arrayIsNullOrEmpty(array) {
/// <param name="array" type="Array" elementType="Object">
/// </param>
/// <returns type="Boolean"></returns>
return (!array || !array.length);
}
Sys.Mvc._validationUtil.stringIsNullOrEmpty = function Sys_Mvc__validationUtil$stringIsNullOrEmpty(value) {
/// <param name="value" type="String">
/// </param>
/// <returns type="Boolean"></returns>
return (!value || !value.length);
}
Sys.Mvc._validationUtil.elementSupportsEvent = function Sys_Mvc__validationUtil$elementSupportsEvent(element, eventAttributeName) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <param name="eventAttributeName" type="String">
/// </param>
/// <returns type="Boolean"></returns>
return (eventAttributeName in element);
}
Sys.Mvc._validationUtil.removeAllChildren = function Sys_Mvc__validationUtil$removeAllChildren(element) {
/// <param name="element" type="Object" domElement="true">
/// </param>
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
Sys.Mvc._validationUtil.setInnerText = function Sys_Mvc__validationUtil$setInnerText(element, innerText) {
/// <param name="element" type="Object" domElement="true">
/// </param>
/// <param name="innerText" type="String">
/// </param>
var textNode = document.createTextNode(innerText);
Sys.Mvc._validationUtil.removeAllChildren(element);
element.appendChild(textNode);
}
////////////////////////////////////////////////////////////////////////////////
// Sys.Mvc.ValidatorRegistry
Sys.Mvc.ValidatorRegistry = function Sys_Mvc_ValidatorRegistry() {
/// <field name="validators" type="Object" static="true">
/// </field>
}
Sys.Mvc.ValidatorRegistry.getValidator = function Sys_Mvc_ValidatorRegistry$getValidator(rule) {
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
/// </param>
/// <returns type="Sys.Mvc.Validator"></returns>
var creator = Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];
return (creator) ? creator(rule) : null;
}
Sys.Mvc.ValidatorRegistry._getDefaultValidators = function Sys_Mvc_ValidatorRegistry$_getDefaultValidators() {
/// <returns type="Object"></returns>
return { required: Function.createDelegate(null, Sys.Mvc.RequiredValidator.create), length: Function.createDelegate(null, Sys.Mvc.StringLengthValidator.create), regex: Function.createDelegate(null, Sys.Mvc.RegularExpressionValidator.create), range: Function.createDelegate(null, Sys.Mvc.RangeValidator.create), number: Function.createDelegate(null, Sys.Mvc.NumberValidator.create) };
}
Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');
Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');
Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');
Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');
Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');
Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');
Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');
Sys.Mvc._validationUtil.registerClass('Sys.Mvc._validationUtil');
Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');
Sys.Mvc.FormContext._validationSummaryErrorCss = 'validation-summary-errors';
Sys.Mvc.FormContext._validationSummaryValidCss = 'validation-summary-valid';
Sys.Mvc.FormContext._formValidationTag = '__MVC_FormValidation';
Sys.Mvc.FieldContext._hasTextChangedTag = '__MVC_HasTextChanged';
Sys.Mvc.FieldContext._hasValidationFiredTag = '__MVC_HasValidationFired';
Sys.Mvc.FieldContext._inputElementErrorCss = 'input-validation-error';
Sys.Mvc.FieldContext._inputElementValidCss = 'input-validation-valid';
Sys.Mvc.FieldContext._validationMessageErrorCss = 'field-validation-error';
Sys.Mvc.FieldContext._validationMessageValidCss = 'field-validation-valid';
Sys.Mvc.ValidatorRegistry.validators = Sys.Mvc.ValidatorRegistry._getDefaultValidators();
// ---- Do not remove this footer ----
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
// -----------------------------------
// register validation
Sys.Application.add_load(function() {
Sys.Application.remove_load(arguments.callee);
Sys.Mvc.FormContext._Application_Load();
});
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftMvcValidation.js
Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_Validation=function(){return {};}
Sys.Mvc.$create_JsonValidationField=function(){return {};}
Sys.Mvc.$create_JsonValidationOptions=function(){return {};}
Sys.Mvc.$create_JsonValidationRule=function(){return {};}
Sys.Mvc.$create_ValidationContext=function(){return {};}
Sys.Mvc.NumberValidator=function(){}
Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);}
Sys.Mvc.NumberValidator.prototype={validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0));}}
Sys.Mvc.FormContext=function(formElement,validationSummaryElement){this.$5=[];this.fields=new Array(0);this.$9=formElement;this.$7=validationSummaryElement;formElement['__MVC_FormValidation'] = this;if(validationSummaryElement){var $0=validationSummaryElement.getElementsByTagName('ul');if($0.length>0){this.$8=$0[0];}}this.$3=Function.createDelegate(this,this.$D);this.$4=Function.createDelegate(this,this.$E);}
Sys.Mvc.FormContext._Application_Load=function(){var $0=window.mvcClientValidationMetadata;if($0){while($0.length>0){var $1=$0.pop();Sys.Mvc.FormContext.$12($1);}}}
Sys.Mvc.FormContext.$F=function($p0,$p1){var $0=[];var $1=document.getElementsByName($p1);for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];if(Sys.Mvc.FormContext.$10($p0,$3)){Array.add($0,$3);}}return $0;}
Sys.Mvc.FormContext.getValidationForForm=function(formElement){return formElement['__MVC_FormValidation'];}
Sys.Mvc.FormContext.$10=function($p0,$p1){while($p1){if($p0===$p1){return true;}$p1=$p1.parentNode;}return false;}
Sys.Mvc.FormContext.$12=function($p0){var $0=$get($p0.FormId);var $1=(!Sys.Mvc._ValidationUtil.$1($p0.ValidationSummaryId))?$get($p0.ValidationSummaryId):null;var $2=new Sys.Mvc.FormContext($0,$1);$2.enableDynamicValidation();$2.replaceValidationSummary=$p0.ReplaceValidationSummary;for(var $4=0;$4<$p0.Fields.length;$4++){var $5=$p0.Fields[$4];var $6=Sys.Mvc.FormContext.$F($0,$5.FieldName);var $7=(!Sys.Mvc._ValidationUtil.$1($5.ValidationMessageId))?$get($5.ValidationMessageId):null;var $8=new Sys.Mvc.FieldContext($2);Array.addRange($8.elements,$6);$8.validationMessageElement=$7;$8.replaceValidationMessageContents=$5.ReplaceValidationMessageContents;for(var $9=0;$9<$5.ValidationRules.length;$9++){var $A=$5.ValidationRules[$9];var $B=Sys.Mvc.ValidatorRegistry.getValidator($A);if($B){var $C=Sys.Mvc.$create_Validation();$C.fieldErrorMessage=$A.ErrorMessage;$C.validator=$B;Array.add($8.validations,$C);}}$8.enableDynamicValidation();Array.add($2.fields,$8);}var $3=$0.validationCallbacks;if(!$3){$3=[];$0.validationCallbacks = $3;}$3.push(Function.createDelegate(null,function(){
return Sys.Mvc._ValidationUtil.$0($2.validate('submit'));}));return $2;}
Sys.Mvc.FormContext.prototype={$3:null,$4:null,$6:null,$7:null,$8:null,$9:null,replaceValidationSummary:false,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$5,messages);this.$11();}},clearErrors:function(){Array.clear(this.$5);this.$11();},$A:function(){if(this.$7){if(this.$8){Sys.Mvc._ValidationUtil.$3(this.$8);for(var $0=0;$0<this.$5.length;$0++){var $1=document.createElement('li');Sys.Mvc._ValidationUtil.$4($1,this.$5[$0]);this.$8.appendChild($1);}}Sys.UI.DomElement.removeCssClass(this.$7,'validation-summary-valid');Sys.UI.DomElement.addCssClass(this.$7,'validation-summary-errors');}},$B:function(){var $0=this.$7;if($0){var $1=this.$8;if($1){$1.innerHTML='';}Sys.UI.DomElement.removeCssClass($0,'validation-summary-errors');Sys.UI.DomElement.addCssClass($0,'validation-summary-valid');}},enableDynamicValidation:function(){Sys.UI.DomEvent.addHandler(this.$9,'click',this.$3);Sys.UI.DomEvent.addHandler(this.$9,'submit',this.$4);},$C:function($p0){if($p0.disabled){return null;}var $0=$p0.tagName.toUpperCase();var $1=$p0;if($0==='INPUT'){var $2=$1.type;if($2==='submit'||$2==='image'){return $1;}}else if(($0==='BUTTON')&&($1.type==='submit')){return $1;}return null;},$D:function($p0){this.$6=this.$C($p0.target);},$E:function($p0){var $0=$p0.target;var $1=this.$6;if($1&&$1.disableValidation){return;}var $2=this.validate('submit');if(!Sys.Mvc._ValidationUtil.$0($2)){$p0.preventDefault();}},$11:function(){if(!this.$5.length){this.$B();}else{this.$A();}},validate:function(eventName){var $0=this.fields;var $1=[];for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3.elements[0].disabled){var $4=$3.validate(eventName);if($4){Array.addRange($1,$4);}}}if(this.replaceValidationSummary){this.clearErrors();this.addErrors($1);}return $1;}}
Sys.Mvc.FieldContext=function(formContext){this.$A=[];this.elements=new Array(0);this.validations=new Array(0);this.formContext=formContext;this.$6=Function.createDelegate(this,this.$D);this.$7=Function.createDelegate(this,this.$E);this.$8=Function.createDelegate(this,this.$F);this.$9=Function.createDelegate(this,this.$10);}
Sys.Mvc.FieldContext.prototype={$6:null,$7:null,$8:null,$9:null,defaultErrorMessage:null,formContext:null,replaceValidationMessageContents:false,validationMessageElement:null,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$A,messages);this.$14();}},clearErrors:function(){Array.clear(this.$A);this.$14();},$B:function(){var $0=this.validationMessageElement;if($0){if(this.replaceValidationMessageContents){Sys.Mvc._ValidationUtil.$4($0,this.$A[0]);}Sys.UI.DomElement.removeCssClass($0,'field-validation-valid');Sys.UI.DomElement.addCssClass($0,'field-validation-error');}var $1=this.elements;for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];Sys.UI.DomElement.removeCssClass($3,'input-validation-valid');Sys.UI.DomElement.addCssClass($3,'input-validation-error');}},$C:function(){var $0=this.validationMessageElement;if($0){if(this.replaceValidationMessageContents){Sys.Mvc._ValidationUtil.$4($0,'');}Sys.UI.DomElement.removeCssClass($0,'field-validation-error');Sys.UI.DomElement.addCssClass($0,'field-validation-valid');}var $1=this.elements;for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];Sys.UI.DomElement.removeCssClass($3,'input-validation-error');Sys.UI.DomElement.addCssClass($3,'input-validation-valid');}},$D:function($p0){if($p0.target['__MVC_HasTextChanged']||$p0.target['__MVC_HasValidationFired']){this.validate('blur');}},$E:function($p0){$p0.target['__MVC_HasTextChanged'] = true;},$F:function($p0){$p0.target['__MVC_HasTextChanged'] = true;if($p0.target['__MVC_HasValidationFired']){this.validate('input');}},$10:function($p0){if($p0.rawEvent.propertyName==='value'){$p0.target['__MVC_HasTextChanged'] = true;if($p0.target['__MVC_HasValidationFired']){this.validate('input');}}},enableDynamicValidation:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];if(Sys.Mvc._ValidationUtil.$2($2,'onpropertychange')){var $3=document.documentMode;if($3&&$3>=8){Sys.UI.DomEvent.addHandler($2,'propertychange',this.$9);}}else{Sys.UI.DomEvent.addHandler($2,'input',this.$8);}Sys.UI.DomEvent.addHandler($2,'change',this.$7);Sys.UI.DomEvent.addHandler($2,'blur',this.$6);}},$11:function($p0,$p1){var $0=$p1||this.defaultErrorMessage;if(Boolean.isInstanceOfType($p0)){return ($p0)?null:$0;}if(String.isInstanceOfType($p0)){return (($p0).length)?$p0:$0;}return null;},$12:function(){var $0=this.elements;return ($0.length>0)?$0[0].value:null;},$13:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];$2['__MVC_HasValidationFired'] = true;}},$14:function(){if(!this.$A.length){this.$C();}else{this.$B();}},validate:function(eventName){var $0=this.validations;var $1=[];var $2=this.$12();for(var $3=0;$3<$0.length;$3++){var $4=$0[$3];var $5=Sys.Mvc.$create_ValidationContext();$5.eventName=eventName;$5.fieldContext=this;$5.validation=$4;var $6=$4.validator($2,$5);var $7=this.$11($6,$4.fieldErrorMessage);if(!Sys.Mvc._ValidationUtil.$1($7)){Array.add($1,$7);}}this.$13();this.clearErrors();this.addErrors($1);return $1;}}
Sys.Mvc.RangeValidator=function(minimum,maximum){this.$0=minimum;this.$1=maximum;}
Sys.Mvc.RangeValidator.create=function(rule){var $0=rule.ValidationParameters['min'];var $1=rule.ValidationParameters['max'];return Function.createDelegate(new Sys.Mvc.RangeValidator($0,$1),new Sys.Mvc.RangeValidator($0,$1).validate);}
Sys.Mvc.RangeValidator.prototype={$0:null,$1:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0)&&this.$0<=$0&&$0<=this.$1);}}
Sys.Mvc.RegularExpressionValidator=function(pattern){this.$0=pattern;}
Sys.Mvc.RegularExpressionValidator.create=function(rule){var $0=rule.ValidationParameters['pattern'];return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator($0),new Sys.Mvc.RegularExpressionValidator($0).validate);}
Sys.Mvc.RegularExpressionValidator.prototype={$0:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=new RegExp(this.$0);var $1=$0.exec(value);return (!Sys.Mvc._ValidationUtil.$0($1)&&$1[0].length===value.length);}}
Sys.Mvc.RequiredValidator=function(){}
Sys.Mvc.RequiredValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.RequiredValidator(),new Sys.Mvc.RequiredValidator().validate);}
Sys.Mvc.RequiredValidator.$0=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();if($0==='RADIO'){return true;}}return false;}
Sys.Mvc.RequiredValidator.$1=function($p0){if($p0.tagName.toUpperCase()==='SELECT'){return true;}return false;}
Sys.Mvc.RequiredValidator.$2=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();switch($0){case 'TEXT':case 'PASSWORD':case 'FILE':return true;}}if($p0.tagName.toUpperCase()==='TEXTAREA'){return true;}return false;}
Sys.Mvc.RequiredValidator.$3=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.checked){return true;}}return false;}
Sys.Mvc.RequiredValidator.$4=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.selected){if(!Sys.Mvc._ValidationUtil.$1($1.value)){return true;}}}return false;}
Sys.Mvc.RequiredValidator.$5=function($p0){return (!Sys.Mvc._ValidationUtil.$1($p0.value));}
Sys.Mvc.RequiredValidator.prototype={validate:function(value,context){var $0=context.fieldContext.elements;if(!$0.length){return true;}var $1=$0[0];if(Sys.Mvc.RequiredValidator.$2($1)){return Sys.Mvc.RequiredValidator.$5($1);}if(Sys.Mvc.RequiredValidator.$0($1)){return Sys.Mvc.RequiredValidator.$3($0);}if(Sys.Mvc.RequiredValidator.$1($1)){return Sys.Mvc.RequiredValidator.$4(($1).options);}return true;}}
Sys.Mvc.StringLengthValidator=function(minLength,maxLength){this.$1=minLength;this.$0=maxLength;}
Sys.Mvc.StringLengthValidator.create=function(rule){var $0=(rule.ValidationParameters['min']||0);var $1=(rule.ValidationParameters['max']||Number.MAX_VALUE);return Function.createDelegate(new Sys.Mvc.StringLengthValidator($0,$1),new Sys.Mvc.StringLengthValidator($0,$1).validate);}
Sys.Mvc.StringLengthValidator.prototype={$0:0,$1:0,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}return (this.$1<=value.length&&value.length<=this.$0);}}
Sys.Mvc._ValidationUtil=function(){}
Sys.Mvc._ValidationUtil.$0=function($p0){return (!$p0||!$p0.length);}
Sys.Mvc._ValidationUtil.$1=function($p0){return (!$p0||!$p0.length);}
Sys.Mvc._ValidationUtil.$2=function($p0,$p1){return ($p1 in $p0);}
Sys.Mvc._ValidationUtil.$3=function($p0){while($p0.firstChild){$p0.removeChild($p0.firstChild);}}
Sys.Mvc._ValidationUtil.$4=function($p0,$p1){var $0=document.createTextNode($p1);Sys.Mvc._ValidationUtil.$3($p0);$p0.appendChild($0);}
Sys.Mvc.ValidatorRegistry=function(){}
Sys.Mvc.ValidatorRegistry.getValidator=function(rule){var $0=Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];return ($0)?$0(rule):null;}
Sys.Mvc.ValidatorRegistry.$0=function(){return {required:Function.createDelegate(null,Sys.Mvc.RequiredValidator.create),length:Function.createDelegate(null,Sys.Mvc.StringLengthValidator.create),regex:Function.createDelegate(null,Sys.Mvc.RegularExpressionValidator.create),range:Function.createDelegate(null,Sys.Mvc.RangeValidator.create),number:Function.createDelegate(null,Sys.Mvc.NumberValidator.create)};}
Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');Sys.Mvc._ValidationUtil.registerClass('Sys.Mvc._ValidationUtil');Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');Sys.Mvc.ValidatorRegistry.validators=Sys.Mvc.ValidatorRegistry.$0();
// ---- Do not remove this footer ----
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
// -----------------------------------
Sys.Application.add_load(function(){Sys.Application.remove_load(arguments.callee);Sys.Mvc.FormContext._Application_Load();});
/*----------------------------------------------------------
The base color for this template is #5c87b2. If you'd like
to use a different color start by replacing all instances of
#5c87b2 with your new color.
----------------------------------------------------------*/
body
{
background-color: #5c87b2;
font-size: 75%;
font-family: Verdana, Tahoma, Arial, "Helvetica Neue", Helvetica, Sans-Serif;
margin: 0;
padding: 0;
color: #696969;
}
a:link
{
color: #034af3;
text-decoration: underline;
}
a:visited
{
color: #505abc;
}
a:hover
{
color: #1d60ff;
text-decoration: none;
}
a:active
{
color: #12eb87;
}
p, ul
{
margin-bottom: 20px;
line-height: 1.6em;
}
/* HEADINGS
----------------------------------------------------------*/
h1, h2, h3, h4, h5, h6
{
font-size: 1.5em;
color: #000;
}
h1
{
font-size: 2em;
padding-bottom: 0;
margin-bottom: 0;
}
h2
{
padding: 0 0 10px 0;
}
h3
{
font-size: 1.2em;
}
h4
{
font-size: 1.1em;
}
h5, h6
{
font-size: 1em;
}
/* this rule styles <h2> tags that are the
first child of the left and right table columns */
.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2
{
margin-top: 0;
}
/* PRIMARY LAYOUT ELEMENTS
----------------------------------------------------------*/
/* you can specify a greater or lesser percentage for the
page width. Or, you can specify an exact pixel width. */
.page
{
width: 90%;
margin-left: auto;
margin-right: auto;
}
#header
{
position: relative;
margin-bottom: 0px;
color: #000;
padding: 0;
}
#header h1
{
font-weight: bold;
padding: 5px 0;
margin: 0;
color: #fff;
border: none;
line-height: 2em;
font-size: 32px !important;
}
#main
{
padding: 30px 30px 15px 30px;
background-color: #fff;
margin-bottom: 30px;
_height: 1px; /* only IE6 applies CSS properties starting with an underscore */
}
#footer
{
color: #999;
padding: 10px 0;
text-align: center;
line-height: normal;
margin: 0;
font-size: .9em;
}
/* TAB MENU
----------------------------------------------------------*/
ul#menu
{
border-bottom: 1px #5C87B2 solid;
padding: 0 0 2px;
position: relative;
margin: 0;
text-align: right;
}
ul#menu li
{
display: inline;
list-style: none;
}
ul#menu li#greeting
{
padding: 10px 20px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
color: #fff;
}
ul#menu li a
{
padding: 10px 20px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
background-color: #e8eef4;
color: #034af3;
}
ul#menu li a:hover
{
background-color: #fff;
text-decoration: none;
}
ul#menu li a:active
{
background-color: #a6e2a6;
text-decoration: none;
}
ul#menu li.selected a
{
background-color: #fff;
color: #000;
}
/* FORM LAYOUT ELEMENTS
----------------------------------------------------------*/
fieldset
{
border:1px solid #ddd;
padding:0 1.4em 1.4em 1.4em;
margin:0 0 1.5em 0;
}
legend
{
font-size:1.2em;
font-weight: bold;
}
textarea
{
min-height: 75px;
}
input[type="text"]
{
width: 200px;
border: 1px solid #CCC;
}
input[type="password"]
{
width: 200px;
border: 1px solid #CCC;
}
/* TABLE
----------------------------------------------------------*/
table
{
border: solid 1px #e8eef4;
border-collapse: collapse;
}
table td
{
padding: 5px;
border: solid 1px #e8eef4;
}
table th
{
padding: 6px 5px;
text-align: left;
background-color: #e8eef4;
border: solid 1px #e8eef4;
}
/* MISC
----------------------------------------------------------*/
.clear
{
clear: both;
}
.error
{
color:Red;
}
#menucontainer
{
margin-top:40px;
}
div#title
{
display:block;
float:left;
text-align:left;
}
#logindisplay
{
font-size:1.1em;
display:block;
text-align:right;
margin:10px;
color:White;
}
#logindisplay a:link
{
color: white;
text-decoration: underline;
}
#logindisplay a:visited
{
color: white;
text-decoration: underline;
}
#logindisplay a:hover
{
color: white;
text-decoration: none;
}
/* Styles for validation helpers
-----------------------------------------------------------*/
.field-validation-error
{
color: #ff0000;
}
.field-validation-valid
{
display: none;
}
.input-validation-error
{
border: 1px solid #ff0000;
background-color: #ffeeee;
}
.validation-summary-errors
{
font-weight: bold;
color: #ff0000;
}
.validation-summary-valid
{
display: none;
}
/* Styles for editor and display helpers
----------------------------------------------------------*/
.display-label,
.editor-label
{
margin: 1em 0 0 0;
}
.display-field,
.editor-field
{
margin:0.5em 0 0 0;
}
.text-box
{
width: 30em;
}
.text-box.multi-line
{
height: 6.5em;
}
.tri-state
{
width: 6em;
}
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
<?xml version="1.0"?>
<!-- Дополнительные сведения по использованию преобразования web.config см. по ссылке http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
В следующем примере преобразование "SetAttributes" будет изменять значение
"connectionString" с целью использования "ReleaseSQLServer", только когда указатель "Match"
находит атрибут "name", которое имеет значение "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
В следующем пример преобразование "Replace" будет заменять весь
раздел <customErrors> в файле web.config.
Заметьте, поскольку имеется только один раздел customErrors в узле
<system.web>, не требуется использовать атрибут "xdt:Locator".
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
<?xml version="1.0"?>
<!-- Дополнительные сведения по использованию преобразования web.config см. по ссылке http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
В следующем примере преобразование "SetAttributes" будет изменять значение
"connectionString" с целью использования "ReleaseSQLServer", только когда указатель "Match"
находит атрибут "name", которое имеет значение "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
В следующем пример преобразование "Replace" будет заменять весь
раздел <customErrors> в файле web.config.
Заметьте, поскольку имеется только один раздел customErrors в узле
<system.web>, не требуется использовать атрибут "xdt:Locator".
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{230D5BA8-FB42-4643-A229-42495DC3D6D1}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>website.account</RootNamespace>
<AssemblyName>website.account</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac">
<HintPath>..\packages\Autofac.2.4.4.705\lib\NET40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Integration.Mvc">
<HintPath>..\packages\Autofac.Mvc3.2.4.4.705\lib\NET40\Autofac.Integration.Mvc.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
<Compile Include="AccountAreaRegistration.cs" />
<Compile Include="Controllers\AccountControllers.cs" />
<Compile Include="Models\AccountModels.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="web.config" />
</ItemGroup>
<ItemGroup>
<Content Include="web.Debug.config">
<DependentUpon>web.config</DependentUpon>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="web.Release.config">
<DependentUpon>web.config</DependentUpon>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>5690</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "website", "website\website.csproj", "{0A600AEA-CA3D-4EB7-9324-BAE575E54124}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "website.account", "website.account\website.account.csproj", "{230D5BA8-FB42-4643-A229-42495DC3D6D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A600AEA-CA3D-4EB7-9324-BAE575E54124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A600AEA-CA3D-4EB7-9324-BAE575E54124}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A600AEA-CA3D-4EB7-9324-BAE575E54124}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A600AEA-CA3D-4EB7-9324-BAE575E54124}.Release|Any CPU.Build.0 = Release|Any CPU
{230D5BA8-FB42-4643-A229-42495DC3D6D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{230D5BA8-FB42-4643-A229-42495DC3D6D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{230D5BA8-FB42-4643-A229-42495DC3D6D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{230D5BA8-FB42-4643-A229-42495DC3D6D1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

This file has been truncated, but you can view the full file.
/*!
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
*
* Date: Thu Nov 11 19:04:53 2010 -0500
*/
(function( window, undefined ) {
// Use the correct document accordingly with window argument (sandbox)
var document = window.document;
var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// A central reference to the root jQuery(document)
rootjQuery,
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
rwhite = /\s/,
// Used for trimming whitespace
trimLeft = /^\s+/,
trimRight = /\s+$/,
// Check for non-word characters
rnonword = /\W/,
// Check for digits
rdigit = /\d/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
// Useragent RegExp
rwebkit = /(webkit)[ \/]([\w.]+)/,
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
rmsie = /(msie) ([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
// For matching the engine and version of the browser
browserMatch,
// Has the ready events already been bound?
readyBound = false,
// The functions to execute on DOM ready
readyList = [],
// The ready event handler
DOMContentLoaded,
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
trim = String.prototype.trim,
indexOf = Array.prototype.indexOf,
// [[Class]] -> type pairs
class2type = {};
jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
// The body element only exists once, optimize finding it
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = "body";
this.length = 1;
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
match = quickExpr.exec( selector );
// Verify a match, and that no context was specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
doc = (context ? context.ownerDocument || context : document);
// If a single string is passed in and it's a single tag
// just do a createElement and skip the rest
ret = rsingleTag.exec( selector );
if ( ret ) {
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
} else {
selector = [ doc.createElement( ret[1] ) ];
}
} else {
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}
return jQuery.merge( this, selector );
// HANDLE: $("#id")
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $("TAG")
} else if ( !context && !rnonword.test( selector ) ) {
this.selector = selector;
this.context = document;
selector = document.getElementsByTagName( selector );
return jQuery.merge( this, selector );
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return jQuery( context ).find( selector );
}
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if (selector.selector !== undefined) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The current version of jQuery being used
jquery: "1.4.4",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return slice.call( this, 0 );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = jQuery();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
} else {
jQuery.merge( ret, elems );
}
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
if ( name === "find" ) {
ret.selector = this.selector + (this.selector ? " " : "") + selector;
} else if ( name ) {
ret.selector = this.selector + "." + name + "(" + selector + ")";
}
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// If the DOM is already ready
if ( jQuery.isReady ) {
// Execute the function immediately
fn.call( document, jQuery );
// Otherwise, remember the function for later
} else if ( readyList ) {
// Add the function to the wait list
readyList.push( fn );
}
return this;
},
eq: function( i ) {
return i === -1 ?
this.slice( i ) :
this.slice( i, +i + 1 );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
slice: function() {
return this.pushStack( slice.apply( this, arguments ),
"slice", slice.call(arguments).join(",") );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || jQuery(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
window.$ = _$;
if ( deep ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Handle when the DOM is ready
ready: function( wait ) {
// A third-party is pushing the ready event forwards
if ( wait === true ) {
jQuery.readyWait--;
}
// Make sure that the DOM is not already loaded
if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
if ( readyList ) {
// Execute all of them
var fn,
i = 0,
ready = readyList;
// Reset the list of functions
readyList = null;
while ( (fn = ready[ i++ ]) ) {
fn.call( document, jQuery );
}
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( "ready" ).unbind( "ready" );
}
}
}
},
bindReady: function() {
if ( readyBound ) {
return;
}
readyBound = true;
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout( jQuery.ready, 1 );
}
// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent("onreadystatechange", DOMContentLoaded);
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// If IE and not a frame
// continually check to see if the document is ready
var toplevel = false;
try {
toplevel = window.frameElement == null;
} catch(e) {}
if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
}
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},
// A crude way of determining if an object is a window
isWindow: function( obj ) {
return obj && typeof obj === "object" && "setInterval" in obj;
},
isNaN: function( obj ) {
return obj == null || !rdigit.test( obj ) || isNaN( obj );
},
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ toString.call(obj) ] || "object";
},
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
// Not own constructor property must be Object
if ( obj.constructor &&
!hasOwn.call(obj, "constructor") &&
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
for ( var name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw msg;
},
parseJSON: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test(data.replace(rvalidescape, "@")
.replace(rvalidtokens, "]")
.replace(rvalidbraces, "")) ) {
// Try to use the native JSON parser first
return window.JSON && window.JSON.parse ?
window.JSON.parse( data ) :
(new Function("return " + data))();
} else {
jQuery.error( "Invalid JSON: " + data );
}
},
noop: function() {},
// Evalulates a script in a global context
globalEval: function( data ) {
if ( data && rnotwhite.test(data) ) {
// Inspired by code by Andrea Giammarchi
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
var head = document.getElementsByTagName("head")[0] || document.documentElement,
script = document.createElement("script");
script.type = "text/javascript";
if ( jQuery.support.scriptEval ) {
script.appendChild( document.createTextNode( data ) );
} else {
script.text = data;
}
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709).
head.insertBefore( script, head.firstChild );
head.removeChild( script );
}
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
},
// args is for internal usage only
each: function( object, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction(object);
if ( args ) {
if ( isObj ) {
for ( name in object ) {
if ( callback.apply( object[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.apply( object[ i++ ], args ) === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
for ( name in object ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
break;
}
}
} else {
for ( var value = object[0];
i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
}
}
return object;
},
// Use native String.trim function wherever possible
trim: trim ?
function( text ) {
return text == null ?
"" :
trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
},
// results is for internal usage only
makeArray: function( array, results ) {
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// The extra typeof function check is to prevent crashes
// in Safari 2 (See: #3039)
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
var type = jQuery.type(array);
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
push.call( ret, array );
} else {
jQuery.merge( ret, array );
}
}
return ret;
},
inArray: function( elem, array ) {
if ( array.indexOf ) {
return array.indexOf( elem );
}
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( array[ i ] === elem ) {
return i;
}
}
return -1;
},
merge: function( first, second ) {
var i = first.length,
j = 0;
if ( typeof second.length === "number" ) {
for ( var l = second.length; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var ret = [], retVal;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var ret = [], value;
// Go through the array, translating each of the items to their
// new value (or values).
for ( var i = 0, length = elems.length; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
return ret.concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
proxy: function( fn, proxy, thisObject ) {
if ( arguments.length === 2 ) {
if ( typeof proxy === "string" ) {
thisObject = fn;
fn = thisObject[ proxy ];
proxy = undefined;
} else if ( proxy && !jQuery.isFunction( proxy ) ) {
thisObject = proxy;
proxy = undefined;
}
}
if ( !proxy && fn ) {
proxy = function() {
return fn.apply( thisObject || this, arguments );
};
}
// Set the guid of unique handler to the same of original handler, so it can be removed
if ( fn ) {
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
}
// So proxy can be declared as an argument
return proxy;
},
// Mutifunctional method to get and set values to a collection
// The value/s can be optionally by executed if its a function
access: function( elems, key, value, exec, fn, pass ) {
var length = elems.length;
// Setting many attributes
if ( typeof key === "object" ) {
for ( var k in key ) {
jQuery.access( elems, k, key[k], exec, fn, value );
}
return elems;
}
// Setting one attribute
if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
exec = !pass && exec && jQuery.isFunction(value);
for ( var i = 0; i < length; i++ ) {
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
}
return elems;
}
// Getting an attribute
return length ? fn( elems[0], key ) : undefined;
},
now: function() {
return (new Date()).getTime();
},
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
uaMatch: function( ua ) {
ua = ua.toLowerCase();
var match = rwebkit.exec( ua ) ||
ropera.exec( ua ) ||
rmsie.exec( ua ) ||
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
[];
return { browser: match[1] || "", version: match[2] || "0" };
},
browser: {}
});
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] = true;
jQuery.browser.version = browserMatch.version;
}
// Deprecated, use jQuery.browser.webkit instead
if ( jQuery.browser.webkit ) {
jQuery.browser.safari = true;
}
if ( indexOf ) {
jQuery.inArray = function( elem, array ) {
return indexOf.call( array, elem );
};
}
// Verify that \s matches non-breaking spaces
// (IE fails on this test)
if ( !rwhite.test( "\xA0" ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// Cleanup functions for the document ready method
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
};
} else if ( document.attachEvent ) {
DOMContentLoaded = function() {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( document.readyState === "complete" ) {
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
};
}
// The DOM ready check for Internet Explorer
function doScrollCheck() {
if ( jQuery.isReady ) {
return;
}
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}
// and execute any waiting functions
jQuery.ready();
}
// Expose jQuery to the global object
return (window.jQuery = window.$ = jQuery);
})();
(function() {
jQuery.support = {};
var root = document.documentElement,
script = document.createElement("script"),
div = document.createElement("div"),
id = "script" + jQuery.now();
div.style.display = "none";
div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var all = div.getElementsByTagName("*"),
a = div.getElementsByTagName("a")[0],
select = document.createElement("select"),
opt = select.appendChild( document.createElement("option") );
// Can't get basic test support
if ( !all || !all.length || !a ) {
return;
}
jQuery.support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText insted)
style: /red/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.55$/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
checkOn: div.getElementsByTagName("input")[0].value === "on",
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Will be defined later
deleteExpando: true,
optDisabled: false,
checkClone: false,
scriptEval: false,
noCloneEvent: true,
boxModel: null,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableHiddenOffsets: true
};
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as diabled)
select.disabled = true;
jQuery.support.optDisabled = !opt.disabled;
script.type = "text/javascript";
try {
script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
} catch(e) {}
root.insertBefore( script, root.firstChild );
// Make sure that the execution of code works by injecting a script
// tag with appendChild/createTextNode
// (IE doesn't support this, fails, and uses .text instead)
if ( window[ id ] ) {
jQuery.support.scriptEval = true;
delete window[ id ];
}
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try {
delete script.test;
} catch(e) {
jQuery.support.deleteExpando = false;
}
root.removeChild( script );
if ( div.attachEvent && div.fireEvent ) {
div.attachEvent("onclick", function click() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
jQuery.support.noCloneEvent = false;
div.detachEvent("onclick", click);
});
div.cloneNode(true).fireEvent("onclick");
}
div = document.createElement("div");
div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
var fragment = document.createDocumentFragment();
fragment.appendChild( div.firstChild );
// WebKit doesn't clone checked state correctly in fragments
jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
// Figure out if the W3C box model works as expected
// document.body must exist before we can do this
jQuery(function() {
var div = document.createElement("div");
div.style.width = div.style.paddingLeft = "1px";
document.body.appendChild( div );
jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
if ( "zoom" in div.style ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE < 8 does this)
div.style.display = "inline";
div.style.zoom = 1;
jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
div.style.display = "";
div.innerHTML = "<div style='width:4px;'></div>";
jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
}
div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
var tds = div.getElementsByTagName("td");
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
tds[0].style.display = "";
tds[1].style.display = "none";
// Check if empty table cells still have offsetWidth/Height
// (IE < 8 fail this test)
jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
div.innerHTML = "";
document.body.removeChild( div ).style.display = "none";
div = tds = null;
});
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
var eventSupported = function( eventName ) {
var el = document.createElement("div");
eventName = "on" + eventName;
var isSupported = (eventName in el);
if ( !isSupported ) {
el.setAttribute(eventName, "return;");
isSupported = typeof el[eventName] === "function";
}
el = null;
return isSupported;
};
jQuery.support.submitBubbles = eventSupported("submit");
jQuery.support.changeBubbles = eventSupported("change");
// release memory in IE
root = script = div = all = a = null;
})();
var windowData = {},
rbrace = /^(?:\{.*\}|\[.*\])$/;
jQuery.extend({
cache: {},
// Please use with caution
uuid: 0,
// Unique for each copy of jQuery on the page
expando: "jQuery" + jQuery.now(),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
data: function( elem, name, data ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
elem = elem == window ?
windowData :
elem;
var isNode = elem.nodeType,
id = isNode ? elem[ jQuery.expando ] : null,
cache = jQuery.cache, thisCache;
if ( isNode && !id && typeof name === "string" && data === undefined ) {
return;
}
// Get the data from the object directly
if ( !isNode ) {
cache = elem;
// Compute a unique ID for the element
} else if ( !id ) {
elem[ jQuery.expando ] = id = ++jQuery.uuid;
}
// Avoid generating a new cache unless none exists and we
// want to manipulate it.
if ( typeof name === "object" ) {
if ( isNode ) {
cache[ id ] = jQuery.extend(cache[ id ], name);
} else {
jQuery.extend( cache, name );
}
} else if ( isNode && !cache[ id ] ) {
cache[ id ] = {};
}
thisCache = isNode ? cache[ id ] : cache;
// Prevent overriding the named cache with undefined values
if ( data !== undefined ) {
thisCache[ name ] = data;
}
return typeof name === "string" ? thisCache[ name ] : thisCache;
},
removeData: function( elem, name ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
elem = elem == window ?
windowData :
elem;
var isNode = elem.nodeType,
id = isNode ? elem[ jQuery.expando ] : elem,
cache = jQuery.cache,
thisCache = isNode ? cache[ id ] : id;
// If we want to remove a specific section of the element's data
if ( name ) {
if ( thisCache ) {
// Remove the section of cache data
delete thisCache[ name ];
// If we've removed all the data, remove the element's cache
if ( isNode && jQuery.isEmptyObject(thisCache) ) {
jQuery.removeData( elem );
}
}
// Otherwise, we want to remove all of the element's data
} else {
if ( isNode && jQuery.support.deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
// Completely remove the data cache
} else if ( isNode ) {
delete cache[ id ];
// Remove all fields from the object
} else {
for ( var n in elem ) {
delete elem[ n ];
}
}
}
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
if ( elem.nodeName ) {
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
if ( match ) {
return !(match === true || elem.getAttribute("classid") !== match);
}
}
return true;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var data = null;
if ( typeof key === "undefined" ) {
if ( this.length ) {
var attr = this[0].attributes, name;
data = jQuery.data( this[0] );
for ( var i = 0, l = attr.length; i < l; i++ ) {
name = attr[i].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = name.substr( 5 );
dataAttr( this[0], name, data[ name ] );
}
}
}
return data;
} else if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
var parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";
if ( value === undefined ) {
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
// Try to fetch any internally stored data first
if ( data === undefined && this.length ) {
data = jQuery.data( this[0], key );
data = dataAttr( this[0], key, data );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
} else {
return this.each(function() {
var $this = jQuery( this ),
args = [ parts[0], value ];
$this.triggerHandler( "setData" + parts[1] + "!", args );
jQuery.data( this, key, value );
$this.triggerHandler( "changeData" + parts[1] + "!", args );
});
}
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
data = elem.getAttribute( "data-" + key );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
!jQuery.isNaN( data ) ? parseFloat( data ) :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
jQuery.extend({
queue: function( elem, type, data ) {
if ( !elem ) {
return;
}
type = (type || "fx") + "queue";
var q = jQuery.data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( !data ) {
return q || [];
}
if ( !q || jQuery.isArray(data) ) {
q = jQuery.data( elem, type, jQuery.makeArray(data) );
} else {
q.push( data );
}
return q;
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
fn = queue.shift();
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift("inprogress");
}
fn.call(elem, function() {
jQuery.dequeue(elem, type);
});
}
}
});
jQuery.fn.extend({
queue: function( type, data ) {
if ( typeof type !== "string" ) {
data = type;
type = "fx";
}
if ( data === undefined ) {
return jQuery.queue( this[0], type );
}
return this.each(function( i ) {
var queue = jQuery.queue( this, type, data );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
type = type || "fx";
return this.queue( type, function() {
var elem = this;
setTimeout(function() {
jQuery.dequeue( elem, type );
}, time );
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
}
});
var rclass = /[\n\t]/g,
rspaces = /\s+/,
rreturn = /\r/g,
rspecialurl = /^(?:href|src|style)$/,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
rradiocheck = /^(?:radio|checkbox)$/i;
jQuery.props = {
"for": "htmlFor",
"class": "className",
readonly: "readOnly",
maxlength: "maxLength",
cellspacing: "cellSpacing",
rowspan: "rowSpan",
colspan: "colSpan",
tabindex: "tabIndex",
usemap: "useMap",
frameborder: "frameBorder"
};
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, name, value, true, jQuery.attr );
},
removeAttr: function( name, fn ) {
return this.each(function(){
jQuery.attr( this, name, "" );
if ( this.nodeType === 1 ) {
this.removeAttribute( name );
}
});
},
addClass: function( value ) {
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
self.addClass( value.call(this, i, self.attr("class")) );
});
}
if ( value && typeof value === "string" ) {
var classNames = (value || "").split( rspaces );
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
if ( elem.nodeType === 1 ) {
if ( !elem.className ) {
elem.className = value;
} else {
var className = " " + elem.className + " ",
setClass = elem.className;
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
setClass += " " + classNames[c];
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
self.removeClass( value.call(this, i, self.attr("class")) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
var classNames = (value || "").split( rspaces );
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
var className = (" " + elem.className + " ").replace(rclass, " ");
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[c] + " ", " ");
}
elem.className = jQuery.trim( className );
} else {
elem.className = "";
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this);
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.split( rspaces );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery.data( this, "__className__", this.className );
}
// toggle whole className
this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ";
for ( var i = 0, l = this.length; i < l; i++ ) {
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
return true;
}
}
return false;
},
val: function( value ) {
if ( !arguments.length ) {
var elem = this[0];
if ( elem ) {
if ( jQuery.nodeName( elem, "option" ) ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
// We need to handle select boxes special
if ( jQuery.nodeName( elem, "select" ) ) {
var index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
// Nothing was selected
if ( index < 0 ) {
return null;
}
// Loop through all the selected options
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery(option).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
}
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
return elem.getAttribute("value") === null ? "on" : elem.value;
}
// Everything else, we just grab the value
return (elem.value || "").replace(rreturn, "");
}
return undefined;
}
var isFunction = jQuery.isFunction(value);
return this.each(function(i) {
var self = jQuery(this), val = value;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call(this, i, self.val());
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray(val) ) {
val = jQuery.map(val, function (value) {
return value == null ? "" : value + "";
});
}
if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
this.checked = jQuery.inArray( self.val(), val ) >= 0;
} else if ( jQuery.nodeName( this, "select" ) ) {
var values = jQuery.makeArray(val);
jQuery( "option", this ).each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
this.selectedIndex = -1;
}
} else {
this.value = val;
}
});
}
});
jQuery.extend({
attrFn: {
val: true,
css: true,
html: true,
text: true,
data: true,
width: true,
height: true,
offset: true
},
attr: function( elem, name, value, pass ) {
// don't set attributes on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
if ( pass && name in jQuery.attrFn ) {
return jQuery(elem)[name](value);
}
var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
// Whether we are setting (or getting)
set = value !== undefined;
// Try to normalize/fix the name
name = notxml && jQuery.props[ name ] || name;
// These attributes require special treatment
var special = rspecialurl.test( name );
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( name === "selected" && !jQuery.support.optSelected ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
}
// If applicable, access the attribute via the DOM 0 way
// 'in' checks fail in Blackberry 4.7 #6931
if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
if ( set ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error( "type property can't be changed" );
}
if ( value === null ) {
if ( elem.nodeType === 1 ) {
elem.removeAttribute( name );
}
} else {
elem[ name ] = value;
}
}
// browsers index elements by id/name on forms, give priority to attributes.
if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
return elem.getAttributeNode( name ).nodeValue;
}
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
if ( name === "tabIndex" ) {
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified ?
attributeNode.value :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
return elem[ name ];
}
if ( !jQuery.support.style && notxml && name === "style" ) {
if ( set ) {
elem.style.cssText = "" + value;
}
return elem.style.cssText;
}
if ( set ) {
// convert the value to a string (all browsers do this but IE) see #1070
elem.setAttribute( name, "" + value );
}
// Ensure that missing attributes return undefined
// Blackberry 4.7 returns "" from getAttribute #6938
if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
return undefined;
}
var attr = !jQuery.support.hrefNormalized && notxml && special ?
// Some attributes require a special call on IE
elem.getAttribute( name, 2 ) :
elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return attr === null ? undefined : attr;
}
});
var rnamespaces = /\.(.*)$/,
rformElems = /^(?:textarea|input|select)$/i,
rperiod = /\./g,
rspace = / /g,
rescape = /[^\w\s.|`]/g,
fcleanup = function( nm ) {
return nm.replace(rescape, "\\$&");
},
focusCounts = { focusin: 0, focusout: 0 };
/*
* A number of helper functions used for managing events.
* Many of the ideas behind this code originated from
* Dean Edwards' addEvent library.
*/
jQuery.event = {
// Bind an event to an element
// Original by Dean Edwards
add: function( elem, types, handler, data ) {
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
elem = window;
}
if ( handler === false ) {
handler = returnFalse;
} else if ( !handler ) {
// Fixes bug #7229. Fix recommended by jdalton
return;
}
var handleObjIn, handleObj;
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
}
// Make sure that the function being executed has a unique ID
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure
var elemData = jQuery.data( elem );
// If no elemData is found then we must be trying to bind to one of the
// banned noData elements
if ( !elemData ) {
return;
}
// Use a key less likely to result in collisions for plain JS objects.
// Fixes bug #7150.
var eventKey = elem.nodeType ? "events" : "__events__",
events = elemData[ eventKey ],
eventHandle = elemData.handle;
if ( typeof events === "function" ) {
// On plain objects events is a fn that holds the the data
// which prevents this data from being JSON serialized
// the function does not need to be called, it just contains the data
eventHandle = events.handle;
events = events.events;
} else if ( !events ) {
if ( !elem.nodeType ) {
// On plain objects, create a fn that acts as the holder
// of the values to avoid JSON serialization of event data
elemData[ eventKey ] = elemData = function(){};
}
elemData.events = events = {};
}
if ( !eventHandle ) {
elemData.handle = eventHandle = function() {
// Handle the second event of a trigger and when
// an event is called after a page has unloaded
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
undefined;
};
}
// Add elem as a property of the handle function
// This is to prevent a memory leak with non-native events in IE.
eventHandle.elem = elem;
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = types.split(" ");
var type, i = 0, namespaces;
while ( (type = types[ i++ ]) ) {
handleObj = handleObjIn ?
jQuery.extend({}, handleObjIn) :
{ handler: handler, data: data };
// Namespaced event handlers
if ( type.indexOf(".") > -1 ) {
namespaces = type.split(".");
type = namespaces.shift();
handleObj.namespace = namespaces.slice(0).sort().join(".");
} else {
namespaces = [];
handleObj.namespace = "";
}
handleObj.type = type;
if ( !handleObj.guid ) {
handleObj.guid = handler.guid;
}
// Get the current list of functions bound to this event
var handlers = events[ type ],
special = jQuery.event.special[ type ] || {};
// Init the event handler queue
if ( !handlers ) {
handlers = events[ type ] = [];
// Check for a special event handler
// Only use addEventListener/attachEvent if the special
// events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add the function to the element's handler list
handlers.push( handleObj );
// Keep track of which events have been used, for global triggering
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
global: {},
// Detach an event or set of events from an element
remove: function( elem, types, handler, pos ) {
// don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
if ( handler === false ) {
handler = returnFalse;
}
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
eventKey = elem.nodeType ? "events" : "__events__",
elemData = jQuery.data( elem ),
events = elemData && elemData[ eventKey ];
if ( !elemData || !events ) {
return;
}
if ( typeof events === "function" ) {
elemData = events;
events = events.events;
}
// types is actually an event object here
if ( types && types.type ) {
handler = types.handler;
types = types.type;
}
// Unbind all events for the element
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
types = types || "";
for ( type in events ) {
jQuery.event.remove( elem, type + types );
}
return;
}
// Handle multiple events separated by a space
// jQuery(...).unbind("mouseover mouseout", fn);
types = types.split(" ");
while ( (type = types[ i++ ]) ) {
origType = type;
handleObj = null;
all = type.indexOf(".") < 0;
namespaces = [];
if ( !all ) {
// Namespaced event handlers
namespaces = type.split(".");
type = namespaces.shift();
namespace = new RegExp("(^|\\.)" +
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
}
eventType = events[ type ];
if ( !eventType ) {
continue;
}
if ( !handler ) {
for ( j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( all || namespace.test( handleObj.namespace ) ) {
jQuery.event.remove( elem, origType, handleObj.handler, j );
eventType.splice( j--, 1 );
}
}
continue;
}
special = jQuery.event.special[ type ] || {};
for ( j = pos || 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( handler.guid === handleObj.guid ) {
// remove the given handler for the given type
if ( all || namespace.test( handleObj.namespace ) ) {
if ( pos == null ) {
eventType.splice( j--, 1 );
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
if ( pos != null ) {
break;
}
}
}
// remove generic event handler if no more handlers exist
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
ret = null;
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
var handle = elemData.handle;
if ( handle ) {
handle.elem = null;
}
delete elemData.events;
delete elemData.handle;
if ( typeof elemData === "function" ) {
jQuery.removeData( elem, eventKey );
} else if ( jQuery.isEmptyObject( elemData ) ) {
jQuery.removeData( elem );
}
}
},
// bubbling is internal
trigger: function( event, data, elem /*, bubbling */ ) {
// Event object or event type
var type = event.type || event,
bubbling = arguments[3];
if ( !bubbling ) {
event = typeof event === "object" ?
// jQuery.Event object
event[ jQuery.expando ] ? event :
// Object literal
jQuery.extend( jQuery.Event(type), event ) :
// Just the event type (string)
jQuery.Event(type);
if ( type.indexOf("!") >= 0 ) {
event.type = type = type.slice(0, -1);
event.exclusive = true;
}
// Handle a global trigger
if ( !elem ) {
// Don't bubble custom events when global (to avoid too much overhead)
event.stopPropagation();
// Only trigger if we've ever bound an event for it
if ( jQuery.event.global[ type ] ) {
jQuery.each( jQuery.cache, function() {
if ( this.events && this.events[type] ) {
jQuery.event.trigger( event, data, this.handle.elem );
}
});
}
}
// Handle triggering a single element
// don't do events on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
// Clean up in case it is reused
event.result = undefined;
event.target = elem;
// Clone the incoming data, if any
data = jQuery.makeArray( data );
data.unshift( event );
}
event.currentTarget = elem;
// Trigger the event, it is assumed that "handle" is a function
var handle = elem.nodeType ?
jQuery.data( elem, "handle" ) :
(jQuery.data( elem, "__events__" ) || {}).handle;
if ( handle ) {
handle.apply( elem, data );
}
var parent = elem.parentNode || elem.ownerDocument;
// Trigger an inline bound script
try {
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
event.result = false;
event.preventDefault();
}
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (inlineError) {}
if ( !event.isPropagationStopped() && parent ) {
jQuery.event.trigger( event, data, parent, true );
} else if ( !event.isDefaultPrevented() ) {
var old,
target = event.target,
targetType = type.replace( rnamespaces, "" ),
isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
special = jQuery.event.special[ targetType ] || {};
if ( (!special._default || special._default.call( elem, event ) === false) &&
!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
try {
if ( target[ targetType ] ) {
// Make sure that we don't accidentally re-trigger the onFOO events
old = target[ "on" + targetType ];
if ( old ) {
target[ "on" + targetType ] = null;
}
jQuery.event.triggered = true;
target[ targetType ]();
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (triggerError) {}
if ( old ) {
target[ "on" + targetType ] = old;
}
jQuery.event.triggered = false;
}
}
},
handle: function( event ) {
var all, handlers, namespaces, namespace_re, events,
namespace_sort = [],
args = jQuery.makeArray( arguments );
event = args[0] = jQuery.event.fix( event || window.event );
event.currentTarget = this;
// Namespaced event handlers
all = event.type.indexOf(".") < 0 && !event.exclusive;
if ( !all ) {
namespaces = event.type.split(".");
event.type = namespaces.shift();
namespace_sort = namespaces.slice(0).sort();
namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
}
event.namespace = event.namespace || namespace_sort.join(".");
events = jQuery.data(this, this.nodeType ? "events" : "__events__");
if ( typeof events === "function" ) {
events = events.events;
}
handlers = (events || {})[ event.type ];
if ( events && handlers ) {
// Clone the handlers to prevent manipulation
handlers = handlers.slice(0);
for ( var j = 0, l = handlers.length; j < l; j++ ) {
var handleObj = handlers[ j ];
// Filter the functions by class
if ( all || namespace_re.test( handleObj.namespace ) ) {
// Pass in a reference to the handler function itself
// So that we can later remove it
event.handler = handleObj.handler;
event.data = handleObj.data;
event.handleObj = handleObj;
var ret = handleObj.handler.apply( this, args );
if ( ret !== undefined ) {
event.result = ret;
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
}
return event.result;
},
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// store a copy of the original event object
// and "clone" to set read-only properties
var originalEvent = event;
event = jQuery.Event( originalEvent );
for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary
if ( !event.target ) {
// Fixes #1925 where srcElement might not be defined either
event.target = event.srcElement || document;
}
// check if target is a textnode (safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && event.fromElement ) {
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
}
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && event.clientX != null ) {
var doc = document.documentElement,
body = document.body;
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
}
// Add which for key events
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
event.which = event.charCode != null ? event.charCode : event.keyCode;
}
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
if ( !event.metaKey && event.ctrlKey ) {
event.metaKey = event.ctrlKey;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && event.button !== undefined ) {
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
}
return event;
},
// Deprecated, use jQuery.guid instead
guid: 1E8,
// Deprecated, use jQuery.proxy instead
proxy: jQuery.proxy,
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady,
teardown: jQuery.noop
},
live: {
add: function( handleObj ) {
jQuery.event.add( this,
liveConvert( handleObj.origType, handleObj.selector ),
jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
},
remove: function( handleObj ) {
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
}
},
beforeunload: {
setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( jQuery.isWindow( this ) ) {
this.onbeforeunload = eventHandle;
}
},
teardown: function( namespaces, eventHandle ) {
if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
}
}
};
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
if ( elem.detachEvent ) {
elem.detachEvent( "on" + type, handle );
}
};
jQuery.Event = function( src ) {
// Allow instantiation without the 'new' keyword
if ( !this.preventDefault ) {
return new jQuery.Event( src );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Event type
} else {
this.type = src;
}
// timeStamp is buggy for some events on Firefox(#3843)
// So we won't rely on the native value
this.timeStamp = jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// otherwise set the returnValue property of the original event to false (IE)
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if stopPropagation exists run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// otherwise set the cancelBubble property of the original event to true (IE)
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function( event ) {
// Check if mouse(over|out) are still within the same parent element
var parent = event.relatedTarget;
// Firefox sometimes assigns relatedTarget a XUL element
// which we cannot access the parentNode property of
try {
// Traverse up the tree
while ( parent && parent !== this ) {
parent = parent.parentNode;
}
if ( parent !== this ) {
// set the correct event type
event.type = event.data;
// handle event if we actually just moused on to a non sub-element
jQuery.event.handle.apply( this, arguments );
}
// assuming we've left the element since we most likely mousedover a xul element
} catch(e) { }
},
// In case of event delegation, we only need to rename the event.type,
// liveHandler will take care of the rest.
delegate = function( event ) {
event.type = event.data;
jQuery.event.handle.apply( this, arguments );
};
// Create mouseenter and mouseleave events
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
setup: function( data ) {
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
},
teardown: function( data ) {
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
}
};
});
// submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( this.nodeName.toLowerCase() !== "form" ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target,
type = elem.type;
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
e.liveFired = undefined;
return trigger( "submit", this, arguments );
}
});
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target,
type = elem.type;
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
e.liveFired = undefined;
return trigger( "submit", this, arguments );
}
});
} else {
return false;
}
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialSubmit" );
}
};
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
var changeFilters,
getVal = function( elem ) {
var type = elem.type, val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;
} else if ( type === "select-multiple" ) {
val = elem.selectedIndex > -1 ?
jQuery.map( elem.options, function( elem ) {
return elem.selected;
}).join("-") :
"";
} else if ( elem.nodeName.toLowerCase() === "select" ) {
val = elem.selectedIndex;
}
return val;
},
testChange = function testChange( e ) {
var elem = e.target, data, val;
if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
return;
}
data = jQuery.data( elem, "_change_data" );
val = getVal(elem);
// the current data will be also retrieved by beforeactivate
if ( e.type !== "focusout" || elem.type !== "radio" ) {
jQuery.data( elem, "_change_data", val );
}
if ( data === undefined || val === data ) {
return;
}
if ( data != null || val ) {
e.type = "change";
e.liveFired = undefined;
return jQuery.event.trigger( e, arguments[1], elem );
}
};
jQuery.event.special.change = {
filters: {
focusout: testChange,
beforedeactivate: testChange,
click: function( e ) {
var elem = e.target, type = elem.type;
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
return testChange.call( this, e );
}
},
// Change has to be called before submit
// Keydown will be called before keypress, which is used in submit-event delegation
keydown: function( e ) {
var elem = e.target, type = elem.type;
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
type === "select-multiple" ) {
return testChange.call( this, e );
}
},
// Beforeactivate happens also before the previous element is blurred
// with this event you can't trigger a change event, but you can store
// information
beforeactivate: function( e ) {
var elem = e.target;
jQuery.data( elem, "_change_data", getVal(elem) );
}
},
setup: function( data, namespaces ) {
if ( this.type === "file" ) {
return false;
}
for ( var type in changeFilters ) {
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
}
return rformElems.test( this.nodeName );
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialChange" );
return rformElems.test( this.nodeName );
}
};
changeFilters = jQuery.event.special.change.filters;
// Handle when the input is .focus()'d
changeFilters.focus = changeFilters.beforeactivate;
}
function trigger( type, elem, args ) {
args[0].type = type;
return jQuery.event.handle.apply( elem, args );
}
// Create "bubbling" focus and blur events
if ( document.addEventListener ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
jQuery.event.special[ fix ] = {
setup: function() {
if ( focusCounts[fix]++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --focusCounts[fix] === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
function handler( e ) {
e = jQuery.event.fix( e );
e.type = fix;
return jQuery.event.trigger( e, null, e.target );
}
});
}
jQuery.each(["bind", "one"], function( i, name ) {
jQuery.fn[ name ] = function( type, data, fn ) {
// Handle object literals
if ( typeof type === "object" ) {
for ( var key in type ) {
this[ name ](key, data, type[key], fn);
}
return this;
}
if ( jQuery.isFunction( data ) || data === false ) {
fn = data;
data = undefined;
}
var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
jQuery( this ).unbind( event, handler );
return fn.apply( this, arguments );
}) : fn;
if ( type === "unload" && name !== "one" ) {
this.one( type, data, fn );
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.add( this[i], type, handler, data );
}
}
return this;
};
});
jQuery.fn.extend({
unbind: function( type, fn ) {
// Handle object literals
if ( typeof type === "object" && !type.preventDefault ) {
for ( var key in type ) {
this.unbind(key, type[key]);
}
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.remove( this[i], type, fn );
}
}
return this;
},
delegate: function( selector, types, data, fn ) {
return this.live( types, data, fn, selector );
},
undelegate: function( selector, types, fn ) {
if ( arguments.length === 0 ) {
return this.unbind( "live" );
} else {
return this.die( types, null, fn, selector );
}
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
if ( this[0] ) {
var event = jQuery.Event( type );
event.preventDefault();
event.stopPropagation();
jQuery.event.trigger( event, data, this[0] );
return event.result;
}
},
toggle: function( fn ) {
// Save reference to arguments for access in closure
var args = arguments,
i = 1;
// link all the functions, so any of them can unbind this click handler
while ( i < args.length ) {
jQuery.proxy( fn, args[ i++ ] );
}
return this.click( jQuery.proxy( fn, function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
return args[ lastToggle ].apply( this, arguments ) || false;
}));
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
var liveMap = {
focus: "focusin",
blur: "focusout",
mouseenter: "mouseover",
mouseleave: "mouseout"
};
jQuery.each(["live", "die"], function( i, name ) {
jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
var type, i = 0, match, namespaces, preType,
selector = origSelector || this.selector,
context = origSelector ? this : jQuery( this.context );
if ( typeof types === "object" && !types.preventDefault ) {
for ( var key in types ) {
context[ name ]( key, data, types[key], selector );
}
return this;
}
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
types = (types || "").split(" ");
while ( (type = types[ i++ ]) != null ) {
match = rnamespaces.exec( type );
namespaces = "";
if ( match ) {
namespaces = match[0];
type = type.replace( rnamespaces, "" );
}
if ( type === "hover" ) {
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
continue;
}
preType = type;
if ( type === "focus" || type === "blur" ) {
types.push( liveMap[ type ] + namespaces );
type = type + namespaces;
} else {
type = (liveMap[ type ] || type) + namespaces;
}
if ( name === "live" ) {
// bind live handler
for ( var j = 0, l = context.length; j < l; j++ ) {
jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
}
} else {
// unbind live handler
context.unbind( "live." + liveConvert( type, selector ), fn );
}
}
return this;
};
});
function liveHandler( event ) {
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
elems = [],
selectors = [],
events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
if ( typeof events === "function" ) {
events = events.events;
}
// Make sure we avoid non-left-click bubbling in Firefox (#3861)
if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
return;
}
if ( event.namespace ) {
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
}
event.liveFired = this;
var live = events.live.slice(0);
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
selectors.push( handleObj.selector );
} else {
live.splice( j--, 1 );
}
}
match = jQuery( event.target ).closest( selectors, event.currentTarget );
for ( i = 0, l = match.length; i < l; i++ ) {
close = match[i];
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
elem = close.elem;
related = null;
// Those two events require additional checking
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
event.type = handleObj.preType;
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
}
if ( !related || related !== elem ) {
elems.push({ elem: elem, handleObj: handleObj, level: close.level });
}
}
}
}
for ( i = 0, l = elems.length; i < l; i++ ) {
match = elems[i];
if ( maxLevel && match.level > maxLevel ) {
break;
}
event.currentTarget = match.elem;
event.data = match.handleObj.data;
event.handleObj = match.handleObj;
ret = match.handleObj.origHandler.apply( match.elem, arguments );
if ( ret === false || event.isPropagationStopped() ) {
maxLevel = match.level;
if ( ret === false ) {
stop = false;
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
return stop;
}
function liveConvert( type, selector ) {
return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
if ( fn == null ) {
fn = data;
data = null;
}
return arguments.length > 0 ?
this.bind( name, data, fn ) :
this.trigger( name );
};
if ( jQuery.attrFn ) {
jQuery.attrFn[ name ] = true;
}
});
// Prevent memory leaks in IE
// Window isn't included so as not to unbind existing unload events
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) {
jQuery(window).bind("unload", function() {
for ( var id in jQuery.cache ) {
if ( jQuery.cache[ id ].handle ) {
// Try/Catch is to handle iframes being unloaded, see #4280
try {
jQuery.event.remove( jQuery.cache[ id ].handle.elem );
} catch(e) {}
}
}
});
}
(function(){
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
done = 0,
toString = Object.prototype.toString,
hasDuplicate = false,
baseHasDuplicate = true;
// Here we check if the JavaScript engine is using some sort of
// optimization where it does not always call our comparision
// function. If that is the case, discard the hasDuplicate value.
// Thus far that includes Google Chrome.
[0, 0].sort(function() {
baseHasDuplicate = false;
return 0;
});
var Sizzle = function( selector, context, results, seed ) {
results = results || [];
context = context || document;
var origContext = context;
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
return [];
}
if ( !selector || typeof selector !== "string" ) {
return results;
}
var m, set, checkSet, extra, ret, cur, pop, i,
prune = true,
contextXML = Sizzle.isXML( context ),
parts = [],
soFar = selector;
// Reset the position of the chunker regexp (start from head)
do {
chunker.exec( "" );
m = chunker.exec( soFar );
if ( m ) {
soFar = m[3];
parts.push( m[1] );
if ( m[2] ) {
extra = m[3];
break;
}
}
} while ( m );
if ( parts.length > 1 && origPOS.exec( selector ) ) {
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
set = posProcess( parts[0] + parts[1], context );
} else {
set = Expr.relative[ parts[0] ] ?
[ context ] :
Sizzle( parts.shift(), context );
while ( parts.length ) {
selector = parts.shift();
if ( Expr.relative[ selector ] ) {
selector += parts.shift();
}
set = posProcess( selector, set );
}
}
} else {
// Take a shortcut and set the context if the root selector is an ID
// (but not if it'll be faster if the inner selector is an ID)
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
ret = Sizzle.find( parts.shift(), context, contextXML );
context = ret.expr ?
Sizzle.filter( ret.expr, ret.set )[0] :
ret.set[0];
}
if ( context ) {
ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
set = ret.expr ?
Sizzle.filter( ret.expr, ret.set ) :
ret.set;
if ( parts.length > 0 ) {
checkSet = makeArray( set );
} else {
prune = false;
}
while ( parts.length ) {
cur = parts.pop();
pop = cur;
if ( !Expr.relative[ cur ] ) {
cur = "";
} else {
pop = parts.pop();
}
if ( pop == null ) {
pop = context;
}
Expr.relative[ cur ]( checkSet, pop, contextXML );
}
} else {
checkSet = parts = [];
}
}
if ( !checkSet ) {
checkSet = set;
}
if ( !checkSet ) {
Sizzle.error( cur || selector );
}
if ( toString.call(checkSet) === "[object Array]" ) {
if ( !prune ) {
results.push.apply( results, checkSet );
} else if ( context && context.nodeType === 1 ) {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
results.push( set[i] );
}
}
} else {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
results.push( set[i] );
}
}
}
} else {
makeArray( checkSet, results );
}
if ( extra ) {
Sizzle( extra, origContext, results, seed );
Sizzle.uniqueSort( results );
}
return results;
};
Sizzle.uniqueSort = function( results ) {
if ( sortOrder ) {
hasDuplicate = baseHasDuplicate;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( var i = 1; i < results.length; i++ ) {
if ( results[i] === results[ i - 1 ] ) {
results.splice( i--, 1 );
}
}
}
}
return results;
};
Sizzle.matches = function( expr, set ) {
return Sizzle( expr, null, null, set );
};
Sizzle.matchesSelector = function( node, expr ) {
return Sizzle( expr, null, null, [node] ).length > 0;
};
Sizzle.find = function( expr, context, isXML ) {
var set;
if ( !expr ) {
return [];
}
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
var match,
type = Expr.order[i];
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
var left = match[1];
match.splice( 1, 1 );
if ( left.substr( left.length - 1 ) !== "\\" ) {
match[1] = (match[1] || "").replace(/\\/g, "");
set = Expr.find[ type ]( match, context, isXML );
if ( set != null ) {
expr = expr.replace( Expr.match[ type ], "" );
break;
}
}
}
}
if ( !set ) {
set = context.getElementsByTagName( "*" );
}
return { set: set, expr: expr };
};
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
old = expr,
result = [],
curLoop = set,
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
while ( expr && set.length ) {
for ( var type in Expr.filter ) {
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
var found, item,
filter = Expr.filter[ type ],
left = match[1];
anyFound = false;
match.splice(1,1);
if ( left.substr( left.length - 1 ) === "\\" ) {
continue;
}
if ( curLoop === result ) {
result = [];
}
if ( Expr.preFilter[ type ] ) {
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
}
if ( match ) {
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
if ( inplace && found != null ) {
if ( pass ) {
anyFound = true;
} else {
curLoop[i] = false;
}
} else if ( pass ) {
result.push( item );
anyFound = true;
}
}
}
}
if ( found !== undefined ) {
if ( !inplace ) {
curLoop = result;
}
expr = expr.replace( Expr.match[ type ], "" );
if ( !anyFound ) {
return [];
}
break;
}
}
}
// Improper expression
if ( expr === old ) {
if ( anyFound == null ) {
Sizzle.error( expr );
} else {
break;
}
}
old = expr;
}
return curLoop;
};
Sizzle.error = function( msg ) {
throw "Syntax error, unrecognized expression: " + msg;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function( elem ) {
return elem.getAttribute( "href" );
}
},
relative: {
"+": function(checkSet, part){
var isPartStr = typeof part === "string",
isTag = isPartStr && !/\W/.test( part ),
isPartStrNotTag = isPartStr && !isTag;
if ( isTag ) {
part = part.toLowerCase();
}
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
if ( (elem = checkSet[i]) ) {
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
elem || false :
elem === part;
}
}
if ( isPartStrNotTag ) {
Sizzle.filter( part, checkSet, true );
}
},
">": function( checkSet, part ) {
var elem,
isPartStr = typeof part === "string",
i = 0,
l = checkSet.length;
if ( isPartStr && !/\W/.test( part ) ) {
part = part.toLowerCase();
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
var parent = elem.parentNode;
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
}
}
} else {
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
checkSet[i] = isPartStr ?
elem.parentNode :
elem.parentNode === part;
}
}
if ( isPartStr ) {
Sizzle.filter( part, checkSet, true );
}
}
},
"": function(checkSet, part, isXML){
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !/\W/.test(part) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
},
"~": function( checkSet, part, isXML ) {
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !/\W/.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
}
},
find: {
ID: function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
},
NAME: function( match, context ) {
if ( typeof context.getElementsByName !== "undefined" ) {
var ret = [],
results = context.getElementsByName( match[1] );
for ( var i = 0, l = results.length; i < l; i++ ) {
if ( results[i].getAttribute("name") === match[1] ) {
ret.push( results[i] );
}
}
return ret.length === 0 ? null : ret;
}
},
TAG: function( match, context ) {
return context.getElementsByTagName( match[1] );
}
},
preFilter: {
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
match = " " + match[1].replace(/\\/g, "") + " ";
if ( isXML ) {
return match;
}
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
if ( elem ) {
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
if ( !inplace ) {
result.push( elem );
}
} else if ( inplace ) {
curLoop[i] = false;
}
}
}
return false;
},
ID: function( match ) {
return match[1].replace(/\\/g, "");
},
TAG: function( match, curLoop ) {
return match[1].toLowerCase();
},
CHILD: function( match ) {
if ( match[1] === "nth" ) {
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
// calculate the numbers (first)n+(last) including if they are negative
match[2] = (test[1] + (test[2] || 1)) - 0;
match[3] = test[3] - 0;
}
// TODO: Move to normal caching system
match[0] = done++;
return match;
},
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
var name = match[1].replace(/\\/g, "");
if ( !isXML && Expr.attrMap[name] ) {
match[1] = Expr.attrMap[name];
}
if ( match[2] === "~=" ) {
match[4] = " " + match[4] + " ";
}
return match;
},
PSEUDO: function( match, curLoop, inplace, result, not ) {
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
if ( !inplace ) {
result.push.apply( result, ret );
}
return false;
}
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
return true;
}
return match;
},
POS: function( match ) {
match.unshift( true );
return match;
}
},
filters: {
enabled: function( elem ) {
return elem.disabled === false && elem.type !== "hidden";
},
disabled: function( elem ) {
return elem.disabled === true;
},
checked: function( elem ) {
return elem.checked === true;
},
selected: function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
elem.parentNode.selectedIndex;
return elem.selected === true;
},
parent: function( elem ) {
return !!elem
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment