diff --git a/9781430250289.jpg b/9781430250289.jpg new file mode 100644 index 0000000..9c58f9a Binary files /dev/null and b/9781430250289.jpg differ diff --git a/BookSourceCode/Chapter 11 - File upload/bootstrap-fileupload.js b/BookSourceCode/Chapter 11 - File upload/bootstrap-fileupload.js new file mode 100644 index 0000000..70ca027 --- /dev/null +++ b/BookSourceCode/Chapter 11 - File upload/bootstrap-fileupload.js @@ -0,0 +1,243 @@ +/* =========================================================== + * bootstrap-fileupload.js j2 + * Code to upload files in SharePoint; derived from bootstrap file upload plugin + * http://jasny.github.com/bootstrap/javascript.html#fileupload + * =========================================================== + * Copyright 2012 Jasny BV, Netherlands. + * + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + +!function ($) { + + "use strict"; // jshint ;_ + //alert("fileupload.js"); + /* FILEUPLOAD PUBLIC CLASS DEFINITION + * ================================= */ + var file + + var Fileupload = function (element, options) { + //alert("FILEUPLOAD"); + this.$element = $(element) + this.type = this.$element.data('uploadtype') || (this.$element.find('.thumbnail').length > 0 ? "image" : "file") + + this.$input = this.$element.find(':file') + if (this.$input.length === 0) return + + this.name = this.$input.attr('name') || options.name + + this.$hidden = this.$element.find('input[type=hidden][name="' + this.name + '"]') + if (this.$hidden.length === 0) { + this.$hidden = $('') + this.$element.prepend(this.$hidden) + } + + + this.$preview = this.$element.find('.fileupload-preview') + this.$path = this.$element.find('.fileupload-path') + var height = this.$preview.css('height') + if (this.$preview.css('display') != 'inline' && height != '0px' && height != 'none') this.$preview.css('line-height', height) + + this.original = { + 'exists': this.$element.hasClass('fileupload-exists'), + 'preview': this.$preview.html(), + 'path': this.$path.html(), + 'hiddenVal': this.$hidden.val() + } + + this.$remove = this.$element.find('[data-dismiss="fileupload"]') + this.$uploadnow = this.$element.find('[data-dismiss="fileuploadnow"]') + this.$element.find('[data-trigger="fileupload"]').on('click.fileupload', $.proxy(this.trigger, this)) + + this.listen() + } + + Fileupload.prototype = { + + listen: function () { + //alert("listen") + this.$input.on('change.fileupload', $.proxy(this.change, this)) + $(this.$input[0].form).on('reset.fileupload', $.proxy(this.reset, this)) + if (this.$remove) this.$remove.on('click.fileupload', $.proxy(this.clear, this)) + if (this.$uploadnow) this.$uploadnow.on('click.fileupload', $.proxy(this.upload, this)) + }, + + upload: function (e) { + alert("upload invoked"); + if (!file) { + alert("no file to upload") + this.clear() + return + } + alert("before file reading") + var bufferReader = new FileReader() + + + bufferReader.onload = function (e) { + alert("buffer reading") + var buffer = e.target.result; + var digest = $('#__REQUESTDIGEST').val(); + alert(digest); + + $.ajax({ + url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetFolderByServerRelativeUrl('/sites/fileuploadtest/Documents/Communities')/Files/Add(url='" + file.name + "',overwrite=true)", + method: 'POST', + data: buffer,//bytes, + //binaryStringRequestBody: true, + headers: { + //"Accept": "application/json; odata=verbose", + 'content-type': "application/json;odata=verbose", + 'X-RequestDigest': $('#__REQUESTDIGEST').val(), + "content-length": buffer.length//bytes.byteLength + }, + processData: false,//ensure no conversion is done on the image file + success: function (e) { + alert('successfully done'); + }, + error: function (err) { alert("Error in JSON: " + JSON.stringify(err)); }, + //state: "Update" + }); + + } + bufferReader.onerror = function (e) { + alert("File could not be read! Code " + e.target.error.code); + }; + + bufferReader.readAsArrayBuffer(file); + alert("after add file"); + e.preventDefault() + }, + + change: function (e, invoked) { + //alert("change") + if (invoked === 'clear') return + + file = e.target.files !== undefined ? e.target.files[0] : (e.target.value ? { name: e.target.value.replace(/^.+\\/, '')} : null) + + if (!file) { + this.clear() + return + } + + this.$hidden.val('') + this.$hidden.attr('name', '') + this.$input.attr('name', this.name) + + if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match('image.*') : file.name.match('\\.(gif|png|jpe?g)$')) && typeof FileReader !== "undefined") {//this.type === "image" && + + var urlReader = new FileReader() + var preview = this.$preview + var element = this.$element + + + + urlReader.onload = function (e) { + preview.html('') + element.addClass('fileupload-exists').removeClass('fileupload-new') + } + urlReader.onerror = function (e) { + alert("File could not be read! Code " + e.target.error.code); + }; + + + urlReader.readAsDataURL(file) + this.$path.text(file.name) + + } else { + alert("did not read file"); + //alert("file type: " + file.type + " type: " + this.type); + this.$path.text(file.name) + this.$element.addClass('fileupload-exists').removeClass('fileupload-new') + } + }, + + clear: function (e) { + //alert("clear") + this.$hidden.val('') + this.$hidden.attr('name', this.name) + this.$input.attr('name', '') + + //ie8+ doesn't support changing the value of input with type=file so clone instead + if (navigator.userAgent.match(/msie/i)) { + var inputClone = this.$input.clone(true); + this.$input.after(inputClone); + this.$input.remove(); + this.$input = inputClone; + } else { + this.$input.val('') + } + + this.$preview.html('') + this.$path.html('') + this.$element.addClass('fileupload-new').removeClass('fileupload-exists') + + if (e) { + this.$input.trigger('change', ['clear']) + e.preventDefault() + } + }, + + reset: function (e) { + //alert("reset") + this.clear() + + this.$hidden.val(this.original.hiddenVal) + this.$preview.html(this.original.preview) + this.$path.html(this.original.path) + + if (this.original.exists) this.$element.addClass('fileupload-exists').removeClass('fileupload-new') + else this.$element.addClass('fileupload-new').removeClass('fileupload-exists') + }, + + trigger: function (e) { + alert("trigger") + this.$input.trigger('click') + e.preventDefault() + } + } + + + /* FILEUPLOAD PLUGIN DEFINITION + * =========================== */ + + $.fn.fileupload = function (options) { + return this.each(function () { + var $this = $(this) + , data = $this.data('fileupload') + if (!data) $this.data('fileupload', (data = new Fileupload(this, options))) + if (typeof options == 'string') data[options]() + }) + } + + $.fn.fileupload.Constructor = Fileupload + + + /* FILEUPLOAD DATA-API + * ================== */ + + $(document).on('click.fileupload.data-api', '[data-provides="fileupload"]', function (e) { + //alert("fileupload data-api") + var $this = $(this) + if ($this.data('fileupload')) return + $this.fileupload($this.data()) + + var $target = $(e.target).closest('[data-dismiss="fileupload"],[data-trigger="fileupload"]'); + //alert("target"); + if ($target.length > 0) { + //alert("click fileupload") + $target.trigger('click.fileupload') + e.preventDefault() + } + }) + +} (window.jQuery); diff --git a/BookSourceCode/Chapter 11 - File upload/fileupload_htmlsource.txt b/BookSourceCode/Chapter 11 - File upload/fileupload_htmlsource.txt new file mode 100644 index 0000000..36f057c --- /dev/null +++ b/BookSourceCode/Chapter 11 - File upload/fileupload_htmlsource.txt @@ -0,0 +1,10 @@ +
+ + +
+
+ +  
+ Select fileChange RemoveUpload
+
+
\ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList.sln b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList.sln new file mode 100644 index 0000000..79ec797 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPGeolocationList", "SPGeolocationList\SPGeolocationList.csproj", "{325E13CB-6AB1-41A9-8620-3E25366C9DA6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {325E13CB-6AB1-41A9-8620-3E25366C9DA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {325E13CB-6AB1-41A9-8620-3E25366C9DA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {325E13CB-6AB1-41A9-8620-3E25366C9DA6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {325E13CB-6AB1-41A9-8620-3E25366C9DA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {325E13CB-6AB1-41A9-8620-3E25366C9DA6}.Release|Any CPU.Build.0 = Release|Any CPU + {325E13CB-6AB1-41A9-8620-3E25366C9DA6}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList.v11.suo b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList.v11.suo new file mode 100644 index 0000000..b6251fd Binary files /dev/null and b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList.v11.suo differ diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/AppManifest.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/AppManifest.xml new file mode 100644 index 0000000..a45c3be --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/AppManifest.xml @@ -0,0 +1,18 @@ + + + + SPGeolocationList + ~appWebUrl/Pages/Default.aspx?{StandardTokens} + + + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/App.css b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/App.css new file mode 100644 index 0000000..ca018f2 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/App.css @@ -0,0 +1 @@ +/* Place custom styles below */ diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/Elements.xml new file mode 100644 index 0000000..d300303 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/Elements.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/Elements.xml new file mode 100644 index 0000000..852e6b6 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/Elements.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/LocationListInstance/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/LocationListInstance/Elements.xml new file mode 100644 index 0000000..461232d --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/LocationListInstance/Elements.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/LocationListInstance/SharePointProjectItem.spdata b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/LocationListInstance/SharePointProjectItem.spdata new file mode 100644 index 0000000..379cb48 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/LocationListInstance/SharePointProjectItem.spdata @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/Schema.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/Schema.xml new file mode 100644 index 0000000..8e4bc9e --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/Schema.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + main.xsl + 30 + + + + + + + + + + + + + + + + main.xsl + clienttemplates.js + 30 + + + + + + + + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/SharePointProjectItem.spdata b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/SharePointProjectItem.spdata new file mode 100644 index 0000000..d4c8e1e --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/LocationList/SharePointProjectItem.spdata @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SPGeolocationListWebPart/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SPGeolocationListWebPart/Elements.xml new file mode 100644 index 0000000..1e11eb9 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SPGeolocationListWebPart/Elements.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SPGeolocationListWebPart/SharePointProjectItem.spdata b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SPGeolocationListWebPart/SharePointProjectItem.spdata new file mode 100644 index 0000000..1ba5f5f --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SPGeolocationListWebPart/SharePointProjectItem.spdata @@ -0,0 +1,6 @@ + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SharePointProjectItem.spdata b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SharePointProjectItem.spdata new file mode 100644 index 0000000..b9bc8c0 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Content/SharePointProjectItem.spdata @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Features/Feature1/Feature1.Template.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Features/Feature1/Feature1.Template.xml new file mode 100644 index 0000000..c27273d --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Features/Feature1/Feature1.Template.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Features/Feature1/Feature1.feature b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Features/Feature1/Feature1.feature new file mode 100644 index 0000000..7a9cf6d --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Features/Feature1/Feature1.feature @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/AppIcon.png b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/AppIcon.png new file mode 100644 index 0000000..0a0a5dd Binary files /dev/null and b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/AppIcon.png differ diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/Elements.xml new file mode 100644 index 0000000..6e83245 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/Elements.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/SharePointProjectItem.spdata b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/SharePointProjectItem.spdata new file mode 100644 index 0000000..fced765 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Images/SharePointProjectItem.spdata @@ -0,0 +1,7 @@ + + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Package/Package.Template.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Package/Package.Template.xml new file mode 100644 index 0000000..640ff0f --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Package/Package.Template.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Package/Package.package b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Package/Package.package new file mode 100644 index 0000000..abb87b7 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Package/Package.package @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/Default.aspx b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/Default.aspx new file mode 100644 index 0000000..71fbbed --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/Default.aspx @@ -0,0 +1,61 @@ +<%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%> +<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" language="C#" %> +<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> +<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> +<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> + + + + + +<%-- The markup and script in the following Content element will be placed in the of the page --%> + + + + + + + + + + + + + + + +<%-- The markup and script in the following Content element will be placed in the of the page --%> + + +
+

+

+

+ + *Family:

+ +

+ + Type Address: +
+ +
+ + + + + + + +
+ +
diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/Elements.xml new file mode 100644 index 0000000..d3b2651 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/Elements.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/SharePointProjectItem.spdata b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/SharePointProjectItem.spdata new file mode 100644 index 0000000..76f2c90 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Pages/SharePointProjectItem.spdata @@ -0,0 +1,7 @@ + + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/SPGeolocationList.csproj b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/SPGeolocationList.csproj new file mode 100644 index 0000000..6f1edc2 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/SPGeolocationList.csproj @@ -0,0 +1,119 @@ + + + + + Debug + AnyCPU + {325E13CB-6AB1-41A9-8620-3E25366C9DA6} + Library + Properties + SPGeolocationList + SPGeolocationList + v4.5 + 15.0 + 512 + {BB1F664B-9266-4fd6-B973-E1E44974B511};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + SharePointApp + {61cc8e76-03b5-482d-9514-60cb9f5e6b43} + {91b9823d-e91f-4421-84aa-daaaa50063a9} + {50edd2cd-071b-41da-b657-c6d91d6dd9f5} + {958d236b-9602-420f-b4a0-1fedc5e31b23} + Deploy App for SharePoint + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + {15b4625c-c422-47ef-bd9f-a3aa6bc5a998} + + + {f7dc925e-02d5-4cfc-8b89-e5e1702aff86} + + + {d5989bfb-f371-4dab-980c-8d4438331da2} + + + + {1ffaf046-3cc7-46a7-b4ea-f6b7dc38880d} + + + + + + ParentWebElementManifest + feature-elementmanifest + + + + + + + {958d236b-9602-420f-b4a0-1fedc5e31b23} + + + + + + + + + + + {eecc55bb-7d67-4f9a-87ad-f3797ff647ac} + + + + + + + manifest-icon + + + + {57f83ae9-ae93-499d-94fd-e978396ac6ad} + + + + + {0e9c4ead-1ad1-4fd2-aeb1-951d7d4edd27} + + + Package.package + + + {d9eb4b9c-9c34-42ff-be9b-3c5867a9c228} + + + Feature1.feature + + + + + Designer + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/SPGeolocationList.csproj.user b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/SPGeolocationList.csproj.user new file mode 100644 index 0000000..edaee91 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/SPGeolocationList.csproj.user @@ -0,0 +1,6 @@ + + + + http://win-3rfq1vlq9br/sites/eaglevista/ + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/App.js b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/App.js new file mode 100644 index 0000000..2bfaa33 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/App.js @@ -0,0 +1,184 @@ +var context; +var web; +var user; +var map; +var locationLat; +var locationLong; + +// This function is executed after the DOM is ready and SharePoint scripts are loaded +// Place any code you want to run when Default.aspx is loaded in this function +// The code creates a context object which is needed to use the SharePoint object model +function sharePointReady() { + //alert('set map key'); + context = new SP.ClientContext.get_current(); + web = context.get_web(); + var props = web.get_allProperties(); + props.set_item("BING_MAPS_KEY", "AqebMEelQzBhzGnbvS34kTlrwM8HTcVL1kS9lBVuwhwYI-pjGzMvcgcFz8g3ldNv");//"ApqzNRu0mn1Li2ngnD2x-ZCwalMB0m1IavSP5tcINeZRQ7feN1uppjEt-GpSPLiN"); + web.update(); + context.executeQueryAsync(onSetmapkeySuccess, onSetmapkeyFail); + + map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), { credentials: "AqebMEelQzBhzGnbvS34kTlrwM8HTcVL1kS9lBVuwhwYI-pjGzMvcgcFz8g3ldNv", mapTypeId: Microsoft.Maps.MapTypeId.road }); + +} + +function onSetmapkeySuccess() { + alert("set map success"); +} + +function onSetmapkeyFail() { + alert("set map failed"); +} + +// This function prepares, loads, and then executes a SharePoint query to get the current users information +function getUserName() { + user = web.get_currentUser(); + context.load(user); + context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail); +} + +// This function is executed if the above OM call is successful +// It replaces the content of the 'welcome' element with the user name +function onGetUserNameSuccess() { + $('#message').text('Hello ' + user.get_title()); +} + +// This function is executed if the above OM call fails +function onGetUserNameFail(sender, args) { + alert('Failed to get user name. Error:' + args.get_message()); +} + +function getcurrentaddress() { + alert('getcurrentaddress'); + if (navigator.geolocation) + { + navigator.geolocation.getCurrentPosition(showPosition, showError); + } + else { + alert("Geolocation is not supported by this browser."); + } +} + +function showPosition(position) +{ + alert('showposition'); + locationLat = position.coords.latitude; + locationLong = position.coords.longitude; + alert('Current lat: ' + locationLat + ' long: ' + locationLong); + createListItem(); +} +function showError(error) { + switch (error.code) { + case error.PERMISSION_DENIED: + alert("User denied the request for Geolocation."); + break; + case error.POSITION_UNAVAILABLE: + alert("Location information is unavailable."); + break; + case error.TIMEOUT: + alert("The request to get user location timed out."); + break; + case error.UNKNOWN_ERROR: + alert("An unknown error occurred."); + break; + } +} + + +function getaddress() { + //alert('getaddress'); + var address = $('#addresstext').val(); + //alert('input address: ' + address); + ClickGeocode(); +} +function clearaddressdefault() { + //alert('cleardefault'); + var current = $('#addresstext').val(); + if (current == 'Type address here...') { + //alert('clearing'); + $('#addresstext').val(''); + } +} + +function clearfamilydefault() { + //alert('cleardefault'); + var current = $('#familytext').val(); + if (current == 'Type family name here...') { + //alert('clearing'); + $('#familytext').val(''); + } +} + +//map related +function ClickGeocode(credentials) { + //alert('ClickGeocode'); + map.getCredentials(MakeGeocodeRequest); +} + +function MakeGeocodeRequest(credentials) { + //alert('MakeGeocodeRequest'); + //var addr = document.getElementById('addresstext').value; + //alert('MakeGeocodeRequest: ' + addr); + var geocodeRequest = "http://dev.virtualearth.net/REST/v1/Locations?query=" + encodeURI(document.getElementById('addresstext').value) + "&output=json&jsonp=GeocodeCallback&key=" + credentials; + + CallRestService(geocodeRequest); +} + +function GeocodeCallback(result) { + alert("Found location: " + result.resourceSets[0].resources[0].name); + + if (result && + result.resourceSets && + result.resourceSets.length > 0 && + result.resourceSets[0].resources && + result.resourceSets[0].resources.length > 0) { + + //get lat and lon + var lat = result.resourceSets[0].resources[0].point.coordinates[0]; + var long = result.resourceSets[0].resources[0].point.coordinates[1]; + locationLat = lat; + locationLong = long; + //alert('lat: ' + lat + ' long: ' + long); + createListItem(); + } +} + +function CallRestService(request) { + //alert('CallRestService'); + var script = document.createElement("script"); + script.setAttribute("type", "text/javascript"); + script.setAttribute("src", request); + document.body.appendChild(script); +} + +//create an item in a list +function createListItem() { + //alert('createListItem'); + var family = $('#familytext').val(); + var oList = web.get_lists().getByTitle('LocationList'); + + var itemCreateInfo = new SP.ListItemCreationInformation(); + this.oListItem = oList.addItem(itemCreateInfo); + oListItem.set_item('Title', family); + + alert('Adding new location: (lat: ' + locationLat + ' long: ' + locationLong + ')'); + oListItem.set_item('Location1', 'POINT (' + locationLong + ' ' + locationLat + ')'); + oListItem.update(); + + context.load(oListItem); + context.executeQueryAsync( + Function.createDelegate(this, this.onQuerySucceeded), + Function.createDelegate(this, this.onQueryFailed) + ); +} + +function onQuerySucceeded() { + alert('Item created!');// + oListItem.get_id()); + window.location.reload(); +} + +function onQueryFailed(sender, args) { + alert('Request failed. ' + args.get_message() + + '\n' + args.get_stackTrace()); +} + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/Elements.xml new file mode 100644 index 0000000..886f2b7 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/Elements.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/SharePointProjectItem.spdata b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/SharePointProjectItem.spdata new file mode 100644 index 0000000..c7b2159 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/SharePointProjectItem.spdata @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/_references.js b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/_references.js new file mode 100644 index 0000000..59ae3fa --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/_references.js @@ -0,0 +1,6 @@ +/// +/// +/// +/// +/// +/// \ No newline at end of file diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/jquery-1.6.2-vsdoc.js b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/jquery-1.6.2-vsdoc.js new file mode 100644 index 0000000..ebfe45f --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/Scripts/jquery-1.6.2-vsdoc.js @@ -0,0 +1,9134 @@ +/* +* 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.6.2 +*/ + +/*! +* Note: While Microsoft is not the author of this script file, Microsoft +* grants you the right to use this file for the sole purpose of either: +* (i) interacting through your browser with the Microsoft website, subject +* to the website's terms of use; or (ii) using the files as included with a +* Microsoft product subject to the Microsoft Software License Terms for that +* Microsoft product. Microsoft reserves all other rights to the files not +* expressly granted by Microsoft, whether by implication, estoppel or +* otherwise. The notices and licenses below are for informational purposes +* only. +* +* Provided for Informational Purposes Only +* MIT License +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +* jQuery JavaScript Library v1.6.2 +* http://jquery.com/ +* +* Copyright 2010, John Resig +* +* Includes Sizzle.js +* http://sizzlejs.com/ +* Copyright 2010, The Dojo Foundation +* +*/ +(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) { + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 1: context - A DOM Element, Document or jQuery to use as 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 () { + /// + /// The number of elements currently matched. + /// Part of Core + /// + /// + + return this.length; + }, + + toArray: function () { + /// + /// Retrieve all the DOM elements contained in the jQuery set, as an 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) { + /// + /// Access a single matched element. num is used to access the + /// Nth element matched. + /// Part of Core + /// + /// + /// + /// Access the element in the Nth position. + /// + + 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) { + /// + /// Set the jQuery object to an array of elements, while maintaining + /// the stack. + /// Part of Core + /// + /// + /// + /// An array of elements + /// + + // 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) { + /// + /// 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 + /// + /// + /// + /// A function to execute + /// + + return jQuery.each(this, callback, args); + }, + + ready: function (fn) { + /// + /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. + /// + /// The function to be executed when the DOM is ready. + + // 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) { + /// + /// 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 + /// + /// + /// + /// pos The index of the element that you wish to limit to. + /// + + return i === -1 ? + this.slice(i) : + this.slice(i, +i + 1); + }, + + first: function () { + /// + /// Reduce the set of matched elements to the first in the set. + /// + /// + + return this.eq(0); + }, + + last: function () { + /// + /// Reduce the set of matched elements to the final one in the set. + /// + /// + + return this.eq(-1); + }, + + slice: function () { + /// + /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. + /// + /// Where to start the subset (0-based). + /// Where to end the subset (not including the end element itself). + /// If omitted, ends at the end of the selection + /// The sliced elements + + return this.pushStack(slice.apply(this, arguments), + "slice", slice.call(arguments).join(",")); + }, + + map: function (callback) { + /// + /// This member is internal. + /// + /// + /// + + return this.pushStack(jQuery.map(this, function (elem, i) { + return callback.call(elem, i, elem); + })); + }, + + end: function () { + /// + /// 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 + /// + /// + + 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 () { + /// + /// 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 + /// + /// + /// The object to extend + /// + /// + /// The object that will be merged into the first. + /// + /// + /// (optional) More objects to merge into the first + /// + /// + + 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) { + /// + /// 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 + /// $("div p"), you now must do jQuery("div p"). + /// Part of Core + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// Determines if the parameter passed is a function. + /// + /// The object to check + /// True if the parameter is a function; otherwise false. + + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function (obj) { + /// + /// Determine if the parameter passed is an array. + /// + /// Object to test whether or not it is an array. + /// True if the parameter is a function; otherwise false. + + 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) { + /// + /// Check to see if an object is a plain object (created using "{}" or "new Object"). + /// + /// + /// The object that will be checked to see if it's a plain object. + /// + /// + + // 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) { + /// + /// Check to see if an object is empty (contains no properties). + /// + /// + /// The object that will be checked to see if it's empty. + /// + /// + + 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 () { + /// + /// An empty function. + /// + /// + }, + + // Evalulates a script in a global context + globalEval: function (data) { + /// + /// Internally evaluates a script in a global context. + /// + /// + + 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) { + /// + /// Checks whether the specified element has the specified DOM node name. + /// + /// The element to examine + /// The node name to check + /// True if the specified node name matches the node's DOM node name; otherwise false + + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function (object, callback, args) { + /// + /// 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 + /// + /// + /// The object, or array, to iterate over. + /// + /// + /// The function that will be executed on every 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) { + /// + /// Turns anything into a true array. This is an internal method. + /// + /// Anything to turn into an actual Array + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// The first array to merge. + /// + /// + /// The second array to merge. + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// array The Array to find items in. + /// + /// + /// The function to process each item against. + /// + /// + /// Invert the selection - select the opposite of the function. + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// array The Array to translate. + /// + /// + /// The function to process each item against. + /// + + 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) { + /// + /// Takes a function and returns a new one that will always have a particular scope. + /// + /// + /// The function whose scope will be changed. + /// + /// + /// The object to which the scope of the function should be set. + /// + /// + + 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) { + /// + /// Determines the index of the first parameter in the array. + /// + /// The value to see if it exists in the array. + /// The array to look through for the value + /// The 0-based index of the item if it was found, otherwise -1. + + 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 = "
a"; + + // 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 = ""; + + // 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 = "
"; + // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + // } + + // div.innerHTML = "
t
"; + // 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) { + /// + /// Store arbitrary data associated with the specified element. + /// + /// + /// The DOM element to associate with the data. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data value. + /// + /// + + 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) { + /// + /// Store arbitrary data associated with the matched elements. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data 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) { + /// + /// 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). + /// + /// The function to add to the queue. + /// + + 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) { + /// + /// Removes a queued function from the front of the queue and executes it. + /// + /// The type of queue to access. + /// + + 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) { + /// + /// Set a timer to delay execution of subsequent items in the queue. + /// + /// + /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + 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) { + /// + /// Remove from the queue all items that have not yet been run. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// The name of the property to set. + /// + /// + /// A function returning the value to set. + /// + + return jQuery.access(this, name, value, true, jQuery.attr); + }, + + removeAttr: function (name, fn) { + /// + /// Remove an attribute from each of the matched elements. + /// Part of DOM/Attributes + /// + /// + /// An attribute to remove. + /// + /// + + return this.each(function () { + jQuery.attr(this, name, ""); + if (this.nodeType === 1) { + this.removeAttribute(name); + } + }); + }, + + addClass: function (value) { + /// + /// Adds the specified class(es) to each of the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// One or more class names to be added to the class attribute of each matched element. + /// + /// + + 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) { + /// + /// Removes all or the specified class(es) from the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// (Optional) A class name to be removed from the class attribute of each matched element. + /// + /// + + 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) { + /// + /// 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. + /// + /// + /// A class name to be toggled for each element in the matched set. + /// + /// + /// A boolean value to determine whether the class should be added or removed. + /// + /// + + 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) { + /// + /// Checks the current selection against a class and returns whether at least one selection has a given class. + /// + /// The class to check against + /// True if at least one element in the selection has the class, otherwise false. + + 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) { + /// + /// Set the value of every matched element. + /// Part of DOM/Attributes + /// + /// + /// + /// A string of text or an array of strings to set as the value property of each + /// matched element. + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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 */) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + 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 () { + /// + /// This method is internal. + /// + /// + + if (focusCounts[fix]++ === 0) { + document.addEventListener(orig, handler, true); + } + }, + teardown: function () { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// Binds a handler to one or more events for each matched element. Can also bind custom events. + /// + /// 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 . + /// Additional data passed to the event handler as event.data + /// 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. + + // 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) { + /// + /// Binds a handler to one or more events to be executed exactly once for each matched element. + /// + /// 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 . + /// Additional data passed to the event handler as event.data + /// 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. + + // 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) { + /// + /// Unbinds a handler from one or more events for each matched element. + /// + /// 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 . + /// 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. + + // 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) { + /// + /// Triggers a type of event on every matched element. + /// + /// 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 . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + return this.each(function () { + jQuery.event.trigger(type, data, this); + }); + }, + + triggerHandler: function (type, data) { + /// + /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. + /// + /// 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 . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + 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) { + /// + /// Toggles among two or more function calls every other click. + /// + /// The functions among which to toggle execution + + // 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) { + /// + /// Simulates hovering (moving the mouse on or off of an object). + /// + /// The function to fire when the mouse is moved over a matched element. + /// The function to fire when the mouse is moved off of a matched element. + + 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) { + /// + /// Attach a handler to the event for all elements which match the current selector, now or + /// in the future. + /// + /// + /// A string containing a JavaScript event type, such as "click" or "keydown". + /// + /// + /// A map of data that will be passed to the event handler. + /// + /// + /// A function to execute at the time the event is triggered. + /// + /// + + 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) { + /// + /// Remove all event handlers previously attached using .live() from the elements. + /// + /// + /// A string containing a JavaScript event type, such as click or keydown. + /// + /// + /// The function that is to be no longer executed. + /// + /// + + 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) { + /// + /// 1: blur() - Triggers the blur event of each matched element. + /// 2: blur(fn) - Binds a function to the blur event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("blur", fn) : this.trigger("blur"); + }; + + jQuery.fn["focus"] = function (fn) { + /// + /// 1: focus() - Triggers the focus event of each matched element. + /// 2: focus(fn) - Binds a function to the focus event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("focus", fn) : this.trigger("focus"); + }; + + jQuery.fn["focusin"] = function (fn) { + /// + /// Bind an event handler to the "focusin" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind("focusin", fn) : this.trigger("focusin"); + }; + + jQuery.fn["focusout"] = function (fn) { + /// + /// Bind an event handler to the "focusout" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind("focusout", fn) : this.trigger("focusout"); + }; + + jQuery.fn["load"] = function (fn) { + /// + /// 1: load() - Triggers the load event of each matched element. + /// 2: load(fn) - Binds a function to the load event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("load", fn) : this.trigger("load"); + }; + + jQuery.fn["resize"] = function (fn) { + /// + /// 1: resize() - Triggers the resize event of each matched element. + /// 2: resize(fn) - Binds a function to the resize event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("resize", fn) : this.trigger("resize"); + }; + + jQuery.fn["scroll"] = function (fn) { + /// + /// 1: scroll() - Triggers the scroll event of each matched element. + /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("scroll", fn) : this.trigger("scroll"); + }; + + jQuery.fn["unload"] = function (fn) { + /// + /// 1: unload() - Triggers the unload event of each matched element. + /// 2: unload(fn) - Binds a function to the unload event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("unload", fn) : this.trigger("unload"); + }; + + jQuery.fn["click"] = function (fn) { + /// + /// 1: click() - Triggers the click event of each matched element. + /// 2: click(fn) - Binds a function to the click event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("click", fn) : this.trigger("click"); + }; + + jQuery.fn["dblclick"] = function (fn) { + /// + /// 1: dblclick() - Triggers the dblclick event of each matched element. + /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("dblclick", fn) : this.trigger("dblclick"); + }; + + jQuery.fn["mousedown"] = function (fn) { + /// + /// Binds a function to the mousedown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mousedown", fn) : this.trigger("mousedown"); + }; + + jQuery.fn["mouseup"] = function (fn) { + /// + /// Bind a function to the mouseup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseup", fn) : this.trigger("mouseup"); + }; + + jQuery.fn["mousemove"] = function (fn) { + /// + /// Bind a function to the mousemove event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mousemove", fn) : this.trigger("mousemove"); + }; + + jQuery.fn["mouseover"] = function (fn) { + /// + /// Bind a function to the mouseover event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseover", fn) : this.trigger("mouseover"); + }; + + jQuery.fn["mouseout"] = function (fn) { + /// + /// Bind a function to the mouseout event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseout", fn) : this.trigger("mouseout"); + }; + + jQuery.fn["mouseenter"] = function (fn) { + /// + /// Bind a function to the mouseenter event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseenter", fn) : this.trigger("mouseenter"); + }; + + jQuery.fn["mouseleave"] = function (fn) { + /// + /// Bind a function to the mouseleave event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseleave", fn) : this.trigger("mouseleave"); + }; + + jQuery.fn["change"] = function (fn) { + /// + /// 1: change() - Triggers the change event of each matched element. + /// 2: change(fn) - Binds a function to the change event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("change", fn) : this.trigger("change"); + }; + + jQuery.fn["select"] = function (fn) { + /// + /// 1: select() - Triggers the select event of each matched element. + /// 2: select(fn) - Binds a function to the select event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("select", fn) : this.trigger("select"); + }; + + jQuery.fn["submit"] = function (fn) { + /// + /// 1: submit() - Triggers the submit event of each matched element. + /// 2: submit(fn) - Binds a function to the submit event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("submit", fn) : this.trigger("submit"); + }; + + jQuery.fn["keydown"] = function (fn) { + /// + /// 1: keydown() - Triggers the keydown event of each matched element. + /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keydown", fn) : this.trigger("keydown"); + }; + + jQuery.fn["keypress"] = function (fn) { + /// + /// 1: keypress() - Triggers the keypress event of each matched element. + /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keypress", fn) : this.trigger("keypress"); + }; + + jQuery.fn["keyup"] = function (fn) { + /// + /// 1: keyup() - Triggers the keyup event of each matched element. + /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keyup", fn) : this.trigger("keyup"); + }; + + jQuery.fn["error"] = function (fn) { + /// + /// 1: error() - Triggers the error event of each matched element. + /// 2: error(fn) - Binds a function to the error event of each matched element. + /// + /// The function to execute. + /// + + 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) { + /// + /// Removes all duplicate elements from an array of elements. + /// + /// The array to translate + /// The array after translation. + + 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) { + /// + /// Internal use only; use hasClass('class') + /// + /// + + 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 = ""; + + // // 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 = ""; + + // 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 = "

"; + + // 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 = "
"; + + // 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) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return a !== b && (a.contains ? a.contains(b) : true); + }; + + } else if (document.documentElement.compareDocumentPosition) { + Sizzle.contains = function (a, b) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return !!(a.compareDocumentPosition(b) & 16); + }; + + } else { + Sizzle.contains = function () { + return false; + }; + } + + Sizzle.isXML = function (elem) { + /// + /// Determines if the parameter passed is an XML document. + /// + /// The object to test + /// True if the parameter is an XML document; otherwise false. + + // 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) { + /// + /// 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 + /// + /// + /// + /// An expression to search with. + /// + /// + + 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) { + /// + /// Reduce the set of matched elements to those that have a descendant that matches the + /// selector or DOM element. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// A set of elements to remove from the jQuery set of matched elements. + /// + /// + + return this.pushStack(winnow(this, selector, false), "not", selector); + }, + + filter: function (selector) { + /// + /// 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 + /// + /// + /// + /// A function to use for filtering + /// + /// + + return this.pushStack(winnow(this, selector, true), "filter", selector); + }, + + is: function (selector) { + /// + /// 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 + /// + /// + /// + /// The expression with which to filter + /// + + return !!selector && jQuery.filter(selector, this).length > 0; + }, + + closest: function (selectors, context) { + /// + /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + /// 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. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// Object to search for + /// + + 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) { + /// + /// Adds one or more Elements to the set of matched elements. + /// Part of DOM/Traversing + /// + /// + /// A string containing a selector expression to match additional elements against. + /// + /// + /// Add some elements rooted against the specified context. + /// + /// + + 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 () { + /// + /// Adds the previous selection to the current selection. + /// + /// + + 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.fn.parents = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + return jQuery.dir(elem, "parentNode"); + }; + + jQuery.fn.parentsUntil = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching ancestor elements. + /// + /// + return jQuery.dir(elem, "parentNode", until); + }; + + jQuery.each({ + parent: function (elem) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + 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) { + /// + /// Get all following siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching following + /// sibling elements. + /// + /// + + return jQuery.dir(elem, "nextSibling", until); + }, + prevUntil: function (elem, i, until) { + /// + /// Get all preceding siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching preceding + /// sibling elements. + /// + /// + + 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) { + /// + /// This member is internal only. + /// + /// + + 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) { + /// + /// This member is internal only. + /// + /// + + result = result || 1; + var num = 0; + + for (; cur; cur = cur[dir]) { + if (cur.nodeType === 1 && ++num === result) { + break; + } + } + + return cur; + }, + + sibling: function (n, elem) { + /// + /// This member is internal only. + /// + /// + + 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 = /\s]+\/)>/g, + wrapMap = { + option: [1, ""], + legend: [1, "
", "
"], + thead: [1, "", "
"], + tr: [2, "", "
"], + td: [3, "", "
"], + col: [2, "", "
"], + area: [1, "", ""], + _default: [0, "", ""] + }; + + wrapMap.optgroup = wrapMap.option; + wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; + wrapMap.th = wrapMap.td; + + // IE can't serialize and + + + + + + + + + + + + +<%-- The markup and script in the following Content element will be placed in the of the page --%> + + +
+

+

+

+ + *Family:

+ +

+ + Type Address: +
+ +
+ + + + + + + +
+ +
diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Pages/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Pages/Elements.xml new file mode 100644 index 0000000..d3b2651 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Pages/Elements.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/App.js b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/App.js new file mode 100644 index 0000000..9f53658 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/App.js @@ -0,0 +1,202 @@ +var context; +var web; +var user; +var map; +var locationLat; +var locationLong; + +// This function is executed after the DOM is ready and SharePoint scripts are loaded +// Place any code you want to run when Default.aspx is loaded in this function +// The code creates a context object which is needed to use the SharePoint object model +function sharePointReady() { + //alert('set map key'); + context = new SP.ClientContext.get_current(); + web = context.get_web(); + var props = web.get_allProperties(); + props.set_item("BING_MAPS_KEY", "AqebMEelQzBhzGnbvS34kTlrwM8HTcVL1kS9lBVuwhwYI-pjGzMvcgcFz8g3ldNv");//"ApqzNRu0mn1Li2ngnD2x-ZCwalMB0m1IavSP5tcINeZRQ7feN1uppjEt-GpSPLiN"); + web.update(); + context.executeQueryAsync(onSetmapkeySuccess, onSetmapkeyFail); + /* + alert('2'); + var properties = web.get_allProperties(); + properties.set_item("BING_MAPS_KEY", "ApqzNRu0mn1Li2ngnD2x-ZCwalMB0m1IavSP5tcINeZRQ7feN1uppjEt-GpSPLiN"); + alert('3'); + context.load(web); + alert('4'); + context.executeQueryAsync(onSetmapkeySuccess, onSetmapkeyFail); + alert('5'); + */ + //getUserName(); + + /* + alert('set map key'); + + web.AllProperties["BING_MAPS_KEY"] = "ApqzNRu0mn1Li2ngnD2x-ZCwalMB0m1IavSP5tcINeZRQ7feN1uppjEt-GpSPLiN"; + web.Update(); + context.executeQueryAsync(onSetmapkeySuccess, onSetmapkeyFail); + */ + map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), { credentials: "AqebMEelQzBhzGnbvS34kTlrwM8HTcVL1kS9lBVuwhwYI-pjGzMvcgcFz8g3ldNv", mapTypeId: Microsoft.Maps.MapTypeId.road }); + +} + +function onSetmapkeySuccess() { + alert("set map success"); +} + +function onSetmapkeyFail() { + alert("set map failed"); +} + +// This function prepares, loads, and then executes a SharePoint query to get the current users information +function getUserName() { + user = web.get_currentUser(); + context.load(user); + context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail); +} + +// This function is executed if the above OM call is successful +// It replaces the content of the 'welcome' element with the user name +function onGetUserNameSuccess() { + $('#message').text('Hello ' + user.get_title()); +} + +// This function is executed if the above OM call fails +function onGetUserNameFail(sender, args) { + alert('Failed to get user name. Error:' + args.get_message()); +} + +function getcurrentaddress() { + alert('getcurrentaddress'); + if (navigator.geolocation) + { + navigator.geolocation.getCurrentPosition(showPosition, showError); + } + else { + alert("Geolocation is not supported by this browser."); + } +} + +function showPosition(position) +{ + alert('showposition'); + locationLat = position.coords.latitude; + locationLong = position.coords.longitude; + alert('Current lat: ' + locationLat + ' long: ' + locationLong); + createListItem(); +} +function showError(error) { + switch (error.code) { + case error.PERMISSION_DENIED: + alert("User denied the request for Geolocation."); + break; + case error.POSITION_UNAVAILABLE: + alert("Location information is unavailable."); + break; + case error.TIMEOUT: + alert("The request to get user location timed out."); + break; + case error.UNKNOWN_ERROR: + alert("An unknown error occurred."); + break; + } +} + + +function getaddress() { + //alert('getaddress'); + var address = $('#addresstext').val(); + //alert('input address: ' + address); + ClickGeocode(); +} +function clearaddressdefault() { + //alert('cleardefault'); + var current = $('#addresstext').val(); + if (current == 'Type address here...') { + //alert('clearing'); + $('#addresstext').val(''); + } +} + +function clearfamilydefault() { + //alert('cleardefault'); + var current = $('#familytext').val(); + if (current == 'Type family name here...') { + //alert('clearing'); + $('#familytext').val(''); + } +} + +//map related +function ClickGeocode(credentials) { + //alert('ClickGeocode'); + map.getCredentials(MakeGeocodeRequest); +} + +function MakeGeocodeRequest(credentials) { + //alert('MakeGeocodeRequest'); + //var addr = document.getElementById('addresstext').value; + //alert('MakeGeocodeRequest: ' + addr); + var geocodeRequest = "http://dev.virtualearth.net/REST/v1/Locations?query=" + encodeURI(document.getElementById('addresstext').value) + "&output=json&jsonp=GeocodeCallback&key=" + credentials; + + CallRestService(geocodeRequest); +} + +function GeocodeCallback(result) { + alert("Found location: " + result.resourceSets[0].resources[0].name); + + if (result && + result.resourceSets && + result.resourceSets.length > 0 && + result.resourceSets[0].resources && + result.resourceSets[0].resources.length > 0) { + + //get lat and lon + var lat = result.resourceSets[0].resources[0].point.coordinates[0]; + var long = result.resourceSets[0].resources[0].point.coordinates[1]; + locationLat = lat; + locationLong = long; + //alert('lat: ' + lat + ' long: ' + long); + createListItem(); + } +} + +function CallRestService(request) { + //alert('CallRestService'); + var script = document.createElement("script"); + script.setAttribute("type", "text/javascript"); + script.setAttribute("src", request); + document.body.appendChild(script); +} + +//create an item in a list +function createListItem() { + //alert('createListItem'); + var family = $('#familytext').val(); + var oList = web.get_lists().getByTitle('LocationList'); + + var itemCreateInfo = new SP.ListItemCreationInformation(); + this.oListItem = oList.addItem(itemCreateInfo); + oListItem.set_item('Title', family); + + alert('Adding new location: (lat: ' + locationLat + ' long: ' + locationLong + ')'); + oListItem.set_item('Location1', 'POINT (' + locationLong + ' ' + locationLat + ')'); + oListItem.update(); + + context.load(oListItem); + context.executeQueryAsync( + Function.createDelegate(this, this.onQuerySucceeded), + Function.createDelegate(this, this.onQueryFailed) + ); +} + +function onQuerySucceeded() { + alert('Item created!');// + oListItem.get_id()); + window.location.reload(); +} + +function onQueryFailed(sender, args) { + alert('Request failed. ' + args.get_message() + + '\n' + args.get_stackTrace()); +} + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/Elements.xml new file mode 100644 index 0000000..d9827a1 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/Elements.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/jquery-1.6.2-vsdoc.js b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/jquery-1.6.2-vsdoc.js new file mode 100644 index 0000000..ebfe45f --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkg/Debug/SPGeolocationList/SPGeolocationList_Feature1/Scripts/jquery-1.6.2-vsdoc.js @@ -0,0 +1,9134 @@ +/* +* 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.6.2 +*/ + +/*! +* Note: While Microsoft is not the author of this script file, Microsoft +* grants you the right to use this file for the sole purpose of either: +* (i) interacting through your browser with the Microsoft website, subject +* to the website's terms of use; or (ii) using the files as included with a +* Microsoft product subject to the Microsoft Software License Terms for that +* Microsoft product. Microsoft reserves all other rights to the files not +* expressly granted by Microsoft, whether by implication, estoppel or +* otherwise. The notices and licenses below are for informational purposes +* only. +* +* Provided for Informational Purposes Only +* MIT License +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +* jQuery JavaScript Library v1.6.2 +* http://jquery.com/ +* +* Copyright 2010, John Resig +* +* Includes Sizzle.js +* http://sizzlejs.com/ +* Copyright 2010, The Dojo Foundation +* +*/ +(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) { + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 1: context - A DOM Element, Document or jQuery to use as 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 () { + /// + /// The number of elements currently matched. + /// Part of Core + /// + /// + + return this.length; + }, + + toArray: function () { + /// + /// Retrieve all the DOM elements contained in the jQuery set, as an 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) { + /// + /// Access a single matched element. num is used to access the + /// Nth element matched. + /// Part of Core + /// + /// + /// + /// Access the element in the Nth position. + /// + + 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) { + /// + /// Set the jQuery object to an array of elements, while maintaining + /// the stack. + /// Part of Core + /// + /// + /// + /// An array of elements + /// + + // 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) { + /// + /// 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 + /// + /// + /// + /// A function to execute + /// + + return jQuery.each(this, callback, args); + }, + + ready: function (fn) { + /// + /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. + /// + /// The function to be executed when the DOM is ready. + + // 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) { + /// + /// 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 + /// + /// + /// + /// pos The index of the element that you wish to limit to. + /// + + return i === -1 ? + this.slice(i) : + this.slice(i, +i + 1); + }, + + first: function () { + /// + /// Reduce the set of matched elements to the first in the set. + /// + /// + + return this.eq(0); + }, + + last: function () { + /// + /// Reduce the set of matched elements to the final one in the set. + /// + /// + + return this.eq(-1); + }, + + slice: function () { + /// + /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. + /// + /// Where to start the subset (0-based). + /// Where to end the subset (not including the end element itself). + /// If omitted, ends at the end of the selection + /// The sliced elements + + return this.pushStack(slice.apply(this, arguments), + "slice", slice.call(arguments).join(",")); + }, + + map: function (callback) { + /// + /// This member is internal. + /// + /// + /// + + return this.pushStack(jQuery.map(this, function (elem, i) { + return callback.call(elem, i, elem); + })); + }, + + end: function () { + /// + /// 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 + /// + /// + + 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 () { + /// + /// 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 + /// + /// + /// The object to extend + /// + /// + /// The object that will be merged into the first. + /// + /// + /// (optional) More objects to merge into the first + /// + /// + + 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) { + /// + /// 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 + /// $("div p"), you now must do jQuery("div p"). + /// Part of Core + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// Determines if the parameter passed is a function. + /// + /// The object to check + /// True if the parameter is a function; otherwise false. + + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function (obj) { + /// + /// Determine if the parameter passed is an array. + /// + /// Object to test whether or not it is an array. + /// True if the parameter is a function; otherwise false. + + 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) { + /// + /// Check to see if an object is a plain object (created using "{}" or "new Object"). + /// + /// + /// The object that will be checked to see if it's a plain object. + /// + /// + + // 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) { + /// + /// Check to see if an object is empty (contains no properties). + /// + /// + /// The object that will be checked to see if it's empty. + /// + /// + + 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 () { + /// + /// An empty function. + /// + /// + }, + + // Evalulates a script in a global context + globalEval: function (data) { + /// + /// Internally evaluates a script in a global context. + /// + /// + + 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) { + /// + /// Checks whether the specified element has the specified DOM node name. + /// + /// The element to examine + /// The node name to check + /// True if the specified node name matches the node's DOM node name; otherwise false + + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function (object, callback, args) { + /// + /// 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 + /// + /// + /// The object, or array, to iterate over. + /// + /// + /// The function that will be executed on every 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) { + /// + /// Turns anything into a true array. This is an internal method. + /// + /// Anything to turn into an actual Array + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// The first array to merge. + /// + /// + /// The second array to merge. + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// array The Array to find items in. + /// + /// + /// The function to process each item against. + /// + /// + /// Invert the selection - select the opposite of the function. + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// array The Array to translate. + /// + /// + /// The function to process each item against. + /// + + 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) { + /// + /// Takes a function and returns a new one that will always have a particular scope. + /// + /// + /// The function whose scope will be changed. + /// + /// + /// The object to which the scope of the function should be set. + /// + /// + + 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) { + /// + /// Determines the index of the first parameter in the array. + /// + /// The value to see if it exists in the array. + /// The array to look through for the value + /// The 0-based index of the item if it was found, otherwise -1. + + 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 = "
a"; + + // 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 = ""; + + // 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 = "
"; + // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + // } + + // div.innerHTML = "
t
"; + // 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) { + /// + /// Store arbitrary data associated with the specified element. + /// + /// + /// The DOM element to associate with the data. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data value. + /// + /// + + 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) { + /// + /// Store arbitrary data associated with the matched elements. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data 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) { + /// + /// 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). + /// + /// The function to add to the queue. + /// + + 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) { + /// + /// Removes a queued function from the front of the queue and executes it. + /// + /// The type of queue to access. + /// + + 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) { + /// + /// Set a timer to delay execution of subsequent items in the queue. + /// + /// + /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + 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) { + /// + /// Remove from the queue all items that have not yet been run. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// The name of the property to set. + /// + /// + /// A function returning the value to set. + /// + + return jQuery.access(this, name, value, true, jQuery.attr); + }, + + removeAttr: function (name, fn) { + /// + /// Remove an attribute from each of the matched elements. + /// Part of DOM/Attributes + /// + /// + /// An attribute to remove. + /// + /// + + return this.each(function () { + jQuery.attr(this, name, ""); + if (this.nodeType === 1) { + this.removeAttribute(name); + } + }); + }, + + addClass: function (value) { + /// + /// Adds the specified class(es) to each of the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// One or more class names to be added to the class attribute of each matched element. + /// + /// + + 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) { + /// + /// Removes all or the specified class(es) from the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// (Optional) A class name to be removed from the class attribute of each matched element. + /// + /// + + 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) { + /// + /// 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. + /// + /// + /// A class name to be toggled for each element in the matched set. + /// + /// + /// A boolean value to determine whether the class should be added or removed. + /// + /// + + 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) { + /// + /// Checks the current selection against a class and returns whether at least one selection has a given class. + /// + /// The class to check against + /// True if at least one element in the selection has the class, otherwise false. + + 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) { + /// + /// Set the value of every matched element. + /// Part of DOM/Attributes + /// + /// + /// + /// A string of text or an array of strings to set as the value property of each + /// matched element. + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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 */) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + 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 () { + /// + /// This method is internal. + /// + /// + + if (focusCounts[fix]++ === 0) { + document.addEventListener(orig, handler, true); + } + }, + teardown: function () { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// Binds a handler to one or more events for each matched element. Can also bind custom events. + /// + /// 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 . + /// Additional data passed to the event handler as event.data + /// 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. + + // 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) { + /// + /// Binds a handler to one or more events to be executed exactly once for each matched element. + /// + /// 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 . + /// Additional data passed to the event handler as event.data + /// 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. + + // 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) { + /// + /// Unbinds a handler from one or more events for each matched element. + /// + /// 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 . + /// 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. + + // 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) { + /// + /// Triggers a type of event on every matched element. + /// + /// 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 . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + return this.each(function () { + jQuery.event.trigger(type, data, this); + }); + }, + + triggerHandler: function (type, data) { + /// + /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. + /// + /// 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 . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + 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) { + /// + /// Toggles among two or more function calls every other click. + /// + /// The functions among which to toggle execution + + // 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) { + /// + /// Simulates hovering (moving the mouse on or off of an object). + /// + /// The function to fire when the mouse is moved over a matched element. + /// The function to fire when the mouse is moved off of a matched element. + + 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) { + /// + /// Attach a handler to the event for all elements which match the current selector, now or + /// in the future. + /// + /// + /// A string containing a JavaScript event type, such as "click" or "keydown". + /// + /// + /// A map of data that will be passed to the event handler. + /// + /// + /// A function to execute at the time the event is triggered. + /// + /// + + 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) { + /// + /// Remove all event handlers previously attached using .live() from the elements. + /// + /// + /// A string containing a JavaScript event type, such as click or keydown. + /// + /// + /// The function that is to be no longer executed. + /// + /// + + 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) { + /// + /// 1: blur() - Triggers the blur event of each matched element. + /// 2: blur(fn) - Binds a function to the blur event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("blur", fn) : this.trigger("blur"); + }; + + jQuery.fn["focus"] = function (fn) { + /// + /// 1: focus() - Triggers the focus event of each matched element. + /// 2: focus(fn) - Binds a function to the focus event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("focus", fn) : this.trigger("focus"); + }; + + jQuery.fn["focusin"] = function (fn) { + /// + /// Bind an event handler to the "focusin" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind("focusin", fn) : this.trigger("focusin"); + }; + + jQuery.fn["focusout"] = function (fn) { + /// + /// Bind an event handler to the "focusout" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind("focusout", fn) : this.trigger("focusout"); + }; + + jQuery.fn["load"] = function (fn) { + /// + /// 1: load() - Triggers the load event of each matched element. + /// 2: load(fn) - Binds a function to the load event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("load", fn) : this.trigger("load"); + }; + + jQuery.fn["resize"] = function (fn) { + /// + /// 1: resize() - Triggers the resize event of each matched element. + /// 2: resize(fn) - Binds a function to the resize event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("resize", fn) : this.trigger("resize"); + }; + + jQuery.fn["scroll"] = function (fn) { + /// + /// 1: scroll() - Triggers the scroll event of each matched element. + /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("scroll", fn) : this.trigger("scroll"); + }; + + jQuery.fn["unload"] = function (fn) { + /// + /// 1: unload() - Triggers the unload event of each matched element. + /// 2: unload(fn) - Binds a function to the unload event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("unload", fn) : this.trigger("unload"); + }; + + jQuery.fn["click"] = function (fn) { + /// + /// 1: click() - Triggers the click event of each matched element. + /// 2: click(fn) - Binds a function to the click event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("click", fn) : this.trigger("click"); + }; + + jQuery.fn["dblclick"] = function (fn) { + /// + /// 1: dblclick() - Triggers the dblclick event of each matched element. + /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("dblclick", fn) : this.trigger("dblclick"); + }; + + jQuery.fn["mousedown"] = function (fn) { + /// + /// Binds a function to the mousedown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mousedown", fn) : this.trigger("mousedown"); + }; + + jQuery.fn["mouseup"] = function (fn) { + /// + /// Bind a function to the mouseup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseup", fn) : this.trigger("mouseup"); + }; + + jQuery.fn["mousemove"] = function (fn) { + /// + /// Bind a function to the mousemove event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mousemove", fn) : this.trigger("mousemove"); + }; + + jQuery.fn["mouseover"] = function (fn) { + /// + /// Bind a function to the mouseover event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseover", fn) : this.trigger("mouseover"); + }; + + jQuery.fn["mouseout"] = function (fn) { + /// + /// Bind a function to the mouseout event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseout", fn) : this.trigger("mouseout"); + }; + + jQuery.fn["mouseenter"] = function (fn) { + /// + /// Bind a function to the mouseenter event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseenter", fn) : this.trigger("mouseenter"); + }; + + jQuery.fn["mouseleave"] = function (fn) { + /// + /// Bind a function to the mouseleave event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseleave", fn) : this.trigger("mouseleave"); + }; + + jQuery.fn["change"] = function (fn) { + /// + /// 1: change() - Triggers the change event of each matched element. + /// 2: change(fn) - Binds a function to the change event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("change", fn) : this.trigger("change"); + }; + + jQuery.fn["select"] = function (fn) { + /// + /// 1: select() - Triggers the select event of each matched element. + /// 2: select(fn) - Binds a function to the select event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("select", fn) : this.trigger("select"); + }; + + jQuery.fn["submit"] = function (fn) { + /// + /// 1: submit() - Triggers the submit event of each matched element. + /// 2: submit(fn) - Binds a function to the submit event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("submit", fn) : this.trigger("submit"); + }; + + jQuery.fn["keydown"] = function (fn) { + /// + /// 1: keydown() - Triggers the keydown event of each matched element. + /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keydown", fn) : this.trigger("keydown"); + }; + + jQuery.fn["keypress"] = function (fn) { + /// + /// 1: keypress() - Triggers the keypress event of each matched element. + /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keypress", fn) : this.trigger("keypress"); + }; + + jQuery.fn["keyup"] = function (fn) { + /// + /// 1: keyup() - Triggers the keyup event of each matched element. + /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keyup", fn) : this.trigger("keyup"); + }; + + jQuery.fn["error"] = function (fn) { + /// + /// 1: error() - Triggers the error event of each matched element. + /// 2: error(fn) - Binds a function to the error event of each matched element. + /// + /// The function to execute. + /// + + 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) { + /// + /// Removes all duplicate elements from an array of elements. + /// + /// The array to translate + /// The array after translation. + + 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) { + /// + /// Internal use only; use hasClass('class') + /// + /// + + 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 = ""; + + // // 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 = ""; + + // 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 = "

"; + + // 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 = "
"; + + // 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) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return a !== b && (a.contains ? a.contains(b) : true); + }; + + } else if (document.documentElement.compareDocumentPosition) { + Sizzle.contains = function (a, b) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return !!(a.compareDocumentPosition(b) & 16); + }; + + } else { + Sizzle.contains = function () { + return false; + }; + } + + Sizzle.isXML = function (elem) { + /// + /// Determines if the parameter passed is an XML document. + /// + /// The object to test + /// True if the parameter is an XML document; otherwise false. + + // 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) { + /// + /// 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 + /// + /// + /// + /// An expression to search with. + /// + /// + + 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) { + /// + /// Reduce the set of matched elements to those that have a descendant that matches the + /// selector or DOM element. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// A set of elements to remove from the jQuery set of matched elements. + /// + /// + + return this.pushStack(winnow(this, selector, false), "not", selector); + }, + + filter: function (selector) { + /// + /// 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 + /// + /// + /// + /// A function to use for filtering + /// + /// + + return this.pushStack(winnow(this, selector, true), "filter", selector); + }, + + is: function (selector) { + /// + /// 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 + /// + /// + /// + /// The expression with which to filter + /// + + return !!selector && jQuery.filter(selector, this).length > 0; + }, + + closest: function (selectors, context) { + /// + /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + /// 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. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// Object to search for + /// + + 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) { + /// + /// Adds one or more Elements to the set of matched elements. + /// Part of DOM/Traversing + /// + /// + /// A string containing a selector expression to match additional elements against. + /// + /// + /// Add some elements rooted against the specified context. + /// + /// + + 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 () { + /// + /// Adds the previous selection to the current selection. + /// + /// + + 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.fn.parents = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + return jQuery.dir(elem, "parentNode"); + }; + + jQuery.fn.parentsUntil = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching ancestor elements. + /// + /// + return jQuery.dir(elem, "parentNode", until); + }; + + jQuery.each({ + parent: function (elem) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + 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) { + /// + /// Get all following siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching following + /// sibling elements. + /// + /// + + return jQuery.dir(elem, "nextSibling", until); + }, + prevUntil: function (elem, i, until) { + /// + /// Get all preceding siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching preceding + /// sibling elements. + /// + /// + + 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) { + /// + /// This member is internal only. + /// + /// + + 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) { + /// + /// This member is internal only. + /// + /// + + result = result || 1; + var num = 0; + + for (; cur; cur = cur[dir]) { + if (cur.nodeType === 1 && ++num === result) { + break; + } + } + + return cur; + }, + + sibling: function (n, elem) { + /// + /// This member is internal only. + /// + /// + + 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 = /\s]+\/)>/g, + wrapMap = { + option: [1, ""], + legend: [1, "
", "
"], + thead: [1, "", "
"], + tr: [2, "", "
"], + td: [3, "", "
"], + col: [2, "", "
"], + area: [1, "", ""], + _default: [0, "", ""] + }; + + wrapMap.optgroup = wrapMap.option; + wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; + wrapMap.th = wrapMap.td; + + // IE can't serialize and + + + + + + + + + + + + +<%-- The markup and script in the following Content element will be placed in the of the page --%> + + +
+

+

+

+ + *Family:

+ +

+ + Type Address: +
+ +
+ + + + + + + +
+ +
diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/SPGeolocationList_Feature1/Pages/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/SPGeolocationList_Feature1/Pages/Elements.xml new file mode 100644 index 0000000..d3b2651 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/SPGeolocationList_Feature1/Pages/Elements.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/SPGeolocationList_Feature1/Scripts/Elements.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/SPGeolocationList_Feature1/Scripts/Elements.xml new file mode 100644 index 0000000..d9827a1 --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/SPGeolocationList_Feature1/Scripts/Elements.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/manifest.xml b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/manifest.xml new file mode 100644 index 0000000..f6f88cc --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/SPGeolocationList/pkgobj/Debug/TokenReplaceFolder/manifest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/packages/jQuery.1.6.2/Content/Scripts/jquery-1.6.2-vsdoc.js b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/packages/jQuery.1.6.2/Content/Scripts/jquery-1.6.2-vsdoc.js new file mode 100644 index 0000000..ebfe45f --- /dev/null +++ b/BookSourceCode/Chapter 12 - Geolocation/SPGeolocationList/packages/jQuery.1.6.2/Content/Scripts/jquery-1.6.2-vsdoc.js @@ -0,0 +1,9134 @@ +/* +* 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.6.2 +*/ + +/*! +* Note: While Microsoft is not the author of this script file, Microsoft +* grants you the right to use this file for the sole purpose of either: +* (i) interacting through your browser with the Microsoft website, subject +* to the website's terms of use; or (ii) using the files as included with a +* Microsoft product subject to the Microsoft Software License Terms for that +* Microsoft product. Microsoft reserves all other rights to the files not +* expressly granted by Microsoft, whether by implication, estoppel or +* otherwise. The notices and licenses below are for informational purposes +* only. +* +* Provided for Informational Purposes Only +* MIT License +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +* jQuery JavaScript Library v1.6.2 +* http://jquery.com/ +* +* Copyright 2010, John Resig +* +* Includes Sizzle.js +* http://sizzlejs.com/ +* Copyright 2010, The Dojo Foundation +* +*/ +(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) { + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 1: context - A DOM Element, Document or jQuery to use as 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 () { + /// + /// The number of elements currently matched. + /// Part of Core + /// + /// + + return this.length; + }, + + toArray: function () { + /// + /// Retrieve all the DOM elements contained in the jQuery set, as an 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) { + /// + /// Access a single matched element. num is used to access the + /// Nth element matched. + /// Part of Core + /// + /// + /// + /// Access the element in the Nth position. + /// + + 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) { + /// + /// Set the jQuery object to an array of elements, while maintaining + /// the stack. + /// Part of Core + /// + /// + /// + /// An array of elements + /// + + // 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) { + /// + /// 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 + /// + /// + /// + /// A function to execute + /// + + return jQuery.each(this, callback, args); + }, + + ready: function (fn) { + /// + /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. + /// + /// The function to be executed when the DOM is ready. + + // 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) { + /// + /// 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 + /// + /// + /// + /// pos The index of the element that you wish to limit to. + /// + + return i === -1 ? + this.slice(i) : + this.slice(i, +i + 1); + }, + + first: function () { + /// + /// Reduce the set of matched elements to the first in the set. + /// + /// + + return this.eq(0); + }, + + last: function () { + /// + /// Reduce the set of matched elements to the final one in the set. + /// + /// + + return this.eq(-1); + }, + + slice: function () { + /// + /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. + /// + /// Where to start the subset (0-based). + /// Where to end the subset (not including the end element itself). + /// If omitted, ends at the end of the selection + /// The sliced elements + + return this.pushStack(slice.apply(this, arguments), + "slice", slice.call(arguments).join(",")); + }, + + map: function (callback) { + /// + /// This member is internal. + /// + /// + /// + + return this.pushStack(jQuery.map(this, function (elem, i) { + return callback.call(elem, i, elem); + })); + }, + + end: function () { + /// + /// 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 + /// + /// + + 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 () { + /// + /// 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 + /// + /// + /// The object to extend + /// + /// + /// The object that will be merged into the first. + /// + /// + /// (optional) More objects to merge into the first + /// + /// + + 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) { + /// + /// 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 + /// $("div p"), you now must do jQuery("div p"). + /// Part of Core + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// Determines if the parameter passed is a function. + /// + /// The object to check + /// True if the parameter is a function; otherwise false. + + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function (obj) { + /// + /// Determine if the parameter passed is an array. + /// + /// Object to test whether or not it is an array. + /// True if the parameter is a function; otherwise false. + + 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) { + /// + /// Check to see if an object is a plain object (created using "{}" or "new Object"). + /// + /// + /// The object that will be checked to see if it's a plain object. + /// + /// + + // 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) { + /// + /// Check to see if an object is empty (contains no properties). + /// + /// + /// The object that will be checked to see if it's empty. + /// + /// + + 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 () { + /// + /// An empty function. + /// + /// + }, + + // Evalulates a script in a global context + globalEval: function (data) { + /// + /// Internally evaluates a script in a global context. + /// + /// + + 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) { + /// + /// Checks whether the specified element has the specified DOM node name. + /// + /// The element to examine + /// The node name to check + /// True if the specified node name matches the node's DOM node name; otherwise false + + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function (object, callback, args) { + /// + /// 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 + /// + /// + /// The object, or array, to iterate over. + /// + /// + /// The function that will be executed on every 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) { + /// + /// Turns anything into a true array. This is an internal method. + /// + /// Anything to turn into an actual Array + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// The first array to merge. + /// + /// + /// The second array to merge. + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// array The Array to find items in. + /// + /// + /// The function to process each item against. + /// + /// + /// Invert the selection - select the opposite of the function. + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// array The Array to translate. + /// + /// + /// The function to process each item against. + /// + + 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) { + /// + /// Takes a function and returns a new one that will always have a particular scope. + /// + /// + /// The function whose scope will be changed. + /// + /// + /// The object to which the scope of the function should be set. + /// + /// + + 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) { + /// + /// Determines the index of the first parameter in the array. + /// + /// The value to see if it exists in the array. + /// The array to look through for the value + /// The 0-based index of the item if it was found, otherwise -1. + + 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 = "
a"; + + // 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 = ""; + + // 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 = "
"; + // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + // } + + // div.innerHTML = "
t
"; + // 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) { + /// + /// Store arbitrary data associated with the specified element. + /// + /// + /// The DOM element to associate with the data. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data value. + /// + /// + + 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) { + /// + /// Store arbitrary data associated with the matched elements. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data 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) { + /// + /// 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). + /// + /// The function to add to the queue. + /// + + 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) { + /// + /// Removes a queued function from the front of the queue and executes it. + /// + /// The type of queue to access. + /// + + 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) { + /// + /// Set a timer to delay execution of subsequent items in the queue. + /// + /// + /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + 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) { + /// + /// Remove from the queue all items that have not yet been run. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// The name of the property to set. + /// + /// + /// A function returning the value to set. + /// + + return jQuery.access(this, name, value, true, jQuery.attr); + }, + + removeAttr: function (name, fn) { + /// + /// Remove an attribute from each of the matched elements. + /// Part of DOM/Attributes + /// + /// + /// An attribute to remove. + /// + /// + + return this.each(function () { + jQuery.attr(this, name, ""); + if (this.nodeType === 1) { + this.removeAttribute(name); + } + }); + }, + + addClass: function (value) { + /// + /// Adds the specified class(es) to each of the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// One or more class names to be added to the class attribute of each matched element. + /// + /// + + 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) { + /// + /// Removes all or the specified class(es) from the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// (Optional) A class name to be removed from the class attribute of each matched element. + /// + /// + + 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) { + /// + /// 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. + /// + /// + /// A class name to be toggled for each element in the matched set. + /// + /// + /// A boolean value to determine whether the class should be added or removed. + /// + /// + + 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) { + /// + /// Checks the current selection against a class and returns whether at least one selection has a given class. + /// + /// The class to check against + /// True if at least one element in the selection has the class, otherwise false. + + 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) { + /// + /// Set the value of every matched element. + /// Part of DOM/Attributes + /// + /// + /// + /// A string of text or an array of strings to set as the value property of each + /// matched element. + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + // 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 */) { + /// + /// This method is internal. + /// + /// + + // 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) { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// This method is internal. + /// + /// + + 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 () { + /// + /// This method is internal. + /// + /// + + if (focusCounts[fix]++ === 0) { + document.addEventListener(orig, handler, true); + } + }, + teardown: function () { + /// + /// This method is internal. + /// + /// + + 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) { + /// + /// Binds a handler to one or more events for each matched element. Can also bind custom events. + /// + /// 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 . + /// Additional data passed to the event handler as event.data + /// 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. + + // 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) { + /// + /// Binds a handler to one or more events to be executed exactly once for each matched element. + /// + /// 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 . + /// Additional data passed to the event handler as event.data + /// 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. + + // 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) { + /// + /// Unbinds a handler from one or more events for each matched element. + /// + /// 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 . + /// 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. + + // 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) { + /// + /// Triggers a type of event on every matched element. + /// + /// 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 . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + return this.each(function () { + jQuery.event.trigger(type, data, this); + }); + }, + + triggerHandler: function (type, data) { + /// + /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. + /// + /// 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 . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + 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) { + /// + /// Toggles among two or more function calls every other click. + /// + /// The functions among which to toggle execution + + // 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) { + /// + /// Simulates hovering (moving the mouse on or off of an object). + /// + /// The function to fire when the mouse is moved over a matched element. + /// The function to fire when the mouse is moved off of a matched element. + + 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) { + /// + /// Attach a handler to the event for all elements which match the current selector, now or + /// in the future. + /// + /// + /// A string containing a JavaScript event type, such as "click" or "keydown". + /// + /// + /// A map of data that will be passed to the event handler. + /// + /// + /// A function to execute at the time the event is triggered. + /// + /// + + 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) { + /// + /// Remove all event handlers previously attached using .live() from the elements. + /// + /// + /// A string containing a JavaScript event type, such as click or keydown. + /// + /// + /// The function that is to be no longer executed. + /// + /// + + 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) { + /// + /// 1: blur() - Triggers the blur event of each matched element. + /// 2: blur(fn) - Binds a function to the blur event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("blur", fn) : this.trigger("blur"); + }; + + jQuery.fn["focus"] = function (fn) { + /// + /// 1: focus() - Triggers the focus event of each matched element. + /// 2: focus(fn) - Binds a function to the focus event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("focus", fn) : this.trigger("focus"); + }; + + jQuery.fn["focusin"] = function (fn) { + /// + /// Bind an event handler to the "focusin" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind("focusin", fn) : this.trigger("focusin"); + }; + + jQuery.fn["focusout"] = function (fn) { + /// + /// Bind an event handler to the "focusout" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind("focusout", fn) : this.trigger("focusout"); + }; + + jQuery.fn["load"] = function (fn) { + /// + /// 1: load() - Triggers the load event of each matched element. + /// 2: load(fn) - Binds a function to the load event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("load", fn) : this.trigger("load"); + }; + + jQuery.fn["resize"] = function (fn) { + /// + /// 1: resize() - Triggers the resize event of each matched element. + /// 2: resize(fn) - Binds a function to the resize event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("resize", fn) : this.trigger("resize"); + }; + + jQuery.fn["scroll"] = function (fn) { + /// + /// 1: scroll() - Triggers the scroll event of each matched element. + /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("scroll", fn) : this.trigger("scroll"); + }; + + jQuery.fn["unload"] = function (fn) { + /// + /// 1: unload() - Triggers the unload event of each matched element. + /// 2: unload(fn) - Binds a function to the unload event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("unload", fn) : this.trigger("unload"); + }; + + jQuery.fn["click"] = function (fn) { + /// + /// 1: click() - Triggers the click event of each matched element. + /// 2: click(fn) - Binds a function to the click event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("click", fn) : this.trigger("click"); + }; + + jQuery.fn["dblclick"] = function (fn) { + /// + /// 1: dblclick() - Triggers the dblclick event of each matched element. + /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("dblclick", fn) : this.trigger("dblclick"); + }; + + jQuery.fn["mousedown"] = function (fn) { + /// + /// Binds a function to the mousedown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mousedown", fn) : this.trigger("mousedown"); + }; + + jQuery.fn["mouseup"] = function (fn) { + /// + /// Bind a function to the mouseup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseup", fn) : this.trigger("mouseup"); + }; + + jQuery.fn["mousemove"] = function (fn) { + /// + /// Bind a function to the mousemove event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mousemove", fn) : this.trigger("mousemove"); + }; + + jQuery.fn["mouseover"] = function (fn) { + /// + /// Bind a function to the mouseover event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseover", fn) : this.trigger("mouseover"); + }; + + jQuery.fn["mouseout"] = function (fn) { + /// + /// Bind a function to the mouseout event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseout", fn) : this.trigger("mouseout"); + }; + + jQuery.fn["mouseenter"] = function (fn) { + /// + /// Bind a function to the mouseenter event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseenter", fn) : this.trigger("mouseenter"); + }; + + jQuery.fn["mouseleave"] = function (fn) { + /// + /// Bind a function to the mouseleave event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("mouseleave", fn) : this.trigger("mouseleave"); + }; + + jQuery.fn["change"] = function (fn) { + /// + /// 1: change() - Triggers the change event of each matched element. + /// 2: change(fn) - Binds a function to the change event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("change", fn) : this.trigger("change"); + }; + + jQuery.fn["select"] = function (fn) { + /// + /// 1: select() - Triggers the select event of each matched element. + /// 2: select(fn) - Binds a function to the select event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("select", fn) : this.trigger("select"); + }; + + jQuery.fn["submit"] = function (fn) { + /// + /// 1: submit() - Triggers the submit event of each matched element. + /// 2: submit(fn) - Binds a function to the submit event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("submit", fn) : this.trigger("submit"); + }; + + jQuery.fn["keydown"] = function (fn) { + /// + /// 1: keydown() - Triggers the keydown event of each matched element. + /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keydown", fn) : this.trigger("keydown"); + }; + + jQuery.fn["keypress"] = function (fn) { + /// + /// 1: keypress() - Triggers the keypress event of each matched element. + /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keypress", fn) : this.trigger("keypress"); + }; + + jQuery.fn["keyup"] = function (fn) { + /// + /// 1: keyup() - Triggers the keyup event of each matched element. + /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind("keyup", fn) : this.trigger("keyup"); + }; + + jQuery.fn["error"] = function (fn) { + /// + /// 1: error() - Triggers the error event of each matched element. + /// 2: error(fn) - Binds a function to the error event of each matched element. + /// + /// The function to execute. + /// + + 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) { + /// + /// Removes all duplicate elements from an array of elements. + /// + /// The array to translate + /// The array after translation. + + 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) { + /// + /// Internal use only; use hasClass('class') + /// + /// + + 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 = ""; + + // // 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 = ""; + + // 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 = "

"; + + // 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 = "
"; + + // 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) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return a !== b && (a.contains ? a.contains(b) : true); + }; + + } else if (document.documentElement.compareDocumentPosition) { + Sizzle.contains = function (a, b) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return !!(a.compareDocumentPosition(b) & 16); + }; + + } else { + Sizzle.contains = function () { + return false; + }; + } + + Sizzle.isXML = function (elem) { + /// + /// Determines if the parameter passed is an XML document. + /// + /// The object to test + /// True if the parameter is an XML document; otherwise false. + + // 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) { + /// + /// 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 + /// + /// + /// + /// An expression to search with. + /// + /// + + 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) { + /// + /// Reduce the set of matched elements to those that have a descendant that matches the + /// selector or DOM element. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// A set of elements to remove from the jQuery set of matched elements. + /// + /// + + return this.pushStack(winnow(this, selector, false), "not", selector); + }, + + filter: function (selector) { + /// + /// 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 + /// + /// + /// + /// A function to use for filtering + /// + /// + + return this.pushStack(winnow(this, selector, true), "filter", selector); + }, + + is: function (selector) { + /// + /// 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 + /// + /// + /// + /// The expression with which to filter + /// + + return !!selector && jQuery.filter(selector, this).length > 0; + }, + + closest: function (selectors, context) { + /// + /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + /// 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. + /// + /// + + 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) { + /// + /// 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 + /// + /// + /// + /// Object to search for + /// + + 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) { + /// + /// Adds one or more Elements to the set of matched elements. + /// Part of DOM/Traversing + /// + /// + /// A string containing a selector expression to match additional elements against. + /// + /// + /// Add some elements rooted against the specified context. + /// + /// + + 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 () { + /// + /// Adds the previous selection to the current selection. + /// + /// + + 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.fn.parents = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + return jQuery.dir(elem, "parentNode"); + }; + + jQuery.fn.parentsUntil = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching ancestor elements. + /// + /// + return jQuery.dir(elem, "parentNode", until); + }; + + jQuery.each({ + parent: function (elem) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + 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) { + /// + /// Get all following siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching following + /// sibling elements. + /// + /// + + return jQuery.dir(elem, "nextSibling", until); + }, + prevUntil: function (elem, i, until) { + /// + /// Get all preceding siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching preceding + /// sibling elements. + /// + /// + + 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) { + /// + /// This member is internal only. + /// + /// + + 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) { + /// + /// This member is internal only. + /// + /// + + result = result || 1; + var num = 0; + + for (; cur; cur = cur[dir]) { + if (cur.nodeType === 1 && ++num === result) { + break; + } + } + + return cur; + }, + + sibling: function (n, elem) { + /// + /// This member is internal only. + /// + /// + + 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 = /\s]+\/)>/g, + wrapMap = { + option: [1, ""], + legend: [1, "
", "
"], + thead: [1, "", "
"], + tr: [2, "", "
"], + td: [3, "", "
"], + col: [2, "", "
"], + area: [1, "", ""], + _default: [0, "", ""] + }; + + wrapMap.optgroup = wrapMap.option; + wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; + wrapMap.th = wrapMap.td; + + // IE can't serialize and + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+ +
+

About Specter Group

+ +
+ +
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit.

+ + +
+

Left column

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit.

+
+ +
+

Right column

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit.

+
+
+ + +
+ +
+ + +
+
+ + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/blog-post.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/blog-post.html new file mode 100644 index 0000000..6265adb --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/blog-post.html @@ -0,0 +1,359 @@ + + + + + + + + + Specter Group - Single Blog Entry HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+
+
+ Thumbnail + +
+
+ LOREM IPSUM DOLOR +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

+
+
+ By EricOverfield, + 16 comments + red, cyan, white, blue +
+
+ + +
+

5 Comments

+ +
    +
  1. +
    + +
    OMedina
    + +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

    +
    +
    + + +
      +
    • +
      + +
      Jhon
      + +
      +

      Pellentesque ornare sem lacinia quam venenatis vestibulum. Vestibulum id ligula porta felis euismod semper. Sed posuere consectetur est at lobortis.

      +
      +
      +
    • + +
    • +
      + +
      Jhon
      + +
      +

      Pellentesque ornare sem lacinia quam venenatis vestibulum. Vestibulum id ligula porta felis euismod semper. Sed posuere consectetur est at lobortis.

      +
      +
      +
    • +
    + +
  2. + +
  3. +
    + +
    Jhon
    + +
    +

    Donec sed odio dui. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

    +
    +
    +
  4. + +
  5. +
    + +
    Jhon
    + +
    +

    Donec sed odio dui. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

    +
    +
    +
  6. +
+
+ + + +
+

Leave a Reply

+ +

Your email address will not be published. Required fields are marked *

+

+ +

+

+ +

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

+ +

+ +

+
+ +
+ + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/blog.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/blog.html new file mode 100644 index 0000000..0a290ba --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/blog.html @@ -0,0 +1,297 @@ + + + + + + + + + Specter Group - Blog HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+
+
+ Thumbnail + +
+
+ LOREM IPSUM DOLOR +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

+
+
+ By EricOverfield, + 16 comments + red, cyan, white, blue +
+
+ +
+
+ Thumbnail + +
+
+ LOREM IPSUM DOLOR +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

+
+
+ By EricOverfield, + 16 comments + red, cyan, white, blue +
+
+ +
+
+ Thumbnail + +
+
+ LOREM IPSUM DOLOR +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

+
+
+ By EricOverfield, + 16 comments + red, cyan, white, blue +
+
+ + + + +
+ + + + + + +
+
+ + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/communities.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/communities.html new file mode 100644 index 0000000..5e8c963 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/communities.html @@ -0,0 +1,257 @@ + + + + + + + + + Specter Group - Communities HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-eagle-vista.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-eagle-vista.html new file mode 100644 index 0000000..3f42e94 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-eagle-vista.html @@ -0,0 +1,363 @@ + + + + + + + + + Specter Group - Eagle Vista HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+
+
+ + + +
+
+ + +
+ +
+
+ +

Welcome to Eagle Vista

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit.

+ +
+
+ + +
+

Community Discussion

+ + + +
Start a New Discussion
+
+

+

+

+ Post Discussion Topic +

+
+ +
    +
  1. +
    + +
    OMedina
    + +
    +

    Grilling Time!

    +

    We are having a casual Friday grilling get together...

    +
    +
    +
  2. +
    + +
    RZhang
    + +
    +

    Car Pool Anyone?

    +

    Driving into the city, anyone want to carpool?

    +
    +
    +
  3. +
  4. +
    + +
    CBeckett
    + +
    +

    Recycling Day!

    +

    I'm looking for volunteers to help me...

    +
    +
    +
  5. +
  6. +
    + +
    KKhipple
    + +
    +

    Selling my laptop for $300

    +

    Anyone interested? Come and check it out...

    +
    +
    +
  7. +
+
+
+ + + + + + +
+
+ + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-otay-crossings.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-otay-crossings.html new file mode 100644 index 0000000..9e05550 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-otay-crossings.html @@ -0,0 +1,363 @@ + + + + + + + + + Specter Group - Otay Crossings HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+
+
+ + + +
+
+ + +
+ +
+
+ +

Welcome to Otay Crossings

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit.

+ +
+
+ + +
+

Community Discussion

+ + + +
Start a New Discussion
+
+

+

+

+ Post Discussion Topic +

+
+ +
    +
  1. +
    + +
    OMedina
    + +
    +

    Grilling Time!

    +

    We are having a casual Friday grilling get together...

    +
    +
    +
  2. +
    + +
    RZhang
    + +
    +

    Car Pool Anyone?

    +

    Driving into the city, anyone want to carpool?

    +
    +
    +
  3. +
  4. +
    + +
    CBeckett
    + +
    +

    Recycling Day!

    +

    I'm looking for volunteers to help me...

    +
    +
    +
  5. +
  6. +
    + +
    KKhipple
    + +
    +

    Selling my laptop for $300

    +

    Anyone interested? Come and check it out...

    +
    +
    +
  7. +
+
+
+ + + + + + +
+
+ + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-spruce-meadows.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-spruce-meadows.html new file mode 100644 index 0000000..829e9e8 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/community-spruce-meadows.html @@ -0,0 +1,363 @@ + + + + + + + + + Specter Group - Spruce Meadows HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+
+
+ + + +
+
+ + +
+ +
+
+ +

Welcome to Spruce Meadows

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit.

+ +
+
+ + +
+

Community Discussion

+ + + +
Start a New Discussion
+
+

+

+

+ Post Discussion Topic +

+
+ +
    +
  1. +
    + +
    OMedina
    + +
    +

    Grilling Time!

    +

    We are having a casual Friday grilling get together...

    +
    +
    +
  2. +
    + +
    RZhang
    + +
    +

    Car Pool Anyone?

    +

    Driving into the city, anyone want to carpool?

    +
    +
    +
  3. +
  4. +
    + +
    CBeckett
    + +
    +

    Recycling Day!

    +

    I'm looking for volunteers to help me...

    +
    +
    +
  5. +
  6. +
    + +
    KKhipple
    + +
    +

    Selling my laptop for $300

    +

    Anyone interested? Come and check it out...

    +
    +
    +
  7. +
+
+
+ + + + + + +
+
+ + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/contact.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/contact.html new file mode 100644 index 0000000..2ea8a3e --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/contact.html @@ -0,0 +1,261 @@ + + + + + + + + + Specter Group - Coutact Us HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+ +
+

Location

+ +
+ + + +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

+ +
+
+

Contact Form

+ +
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

Message

+
+ +

Form data sent. Thanks for your comments.

+
+ +
+ + +
+
+ + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/elements.css b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/elements.css new file mode 100644 index 0000000..89d3682 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/elements.css @@ -0,0 +1,399 @@ +/* Vars ----------------------------------------------------*/ +/* Mixins ----------------------------------------------------*/ +.block-divider { + border-bottom: 1px solid #333; + margin-bottom: 10px; + padding-bottom: 10px; +} +/* DROPCAP ------------------------------------------------------------*/ +.dropcap:first-letter { + font-size: 3.571em; + line-height: 0.76em; + padding: 0.2em 0.2em 0 0; + float: left; + display: block; +color: #333; +} +.dropcap.dark:first-letter { + display: block; + float: left; + font-size: 30px; + line-height: 40px; + margin: 0 8px 0 0; + padding: 10px 10px; + background: #333; + color: #fff; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} +/* INFOBOXES ------------------------------------------------------------*/ +.infobox-info,.infobox-warning,.infobox-success,.infobox-error { + border: 1px solid; + margin: 10px 0px; + padding: 15px 10px 15px 50px; + background-repeat: no-repeat; + background-position: 10px center; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} +.infobox-info { + color: #00529B; + background-color: #BDE5F8; + background-image: url('../img/info-blue.png'); +} +.infobox-warning { + color: #9F6000; + background-color: #FEEFB3; + background-image: url('../img/info-yellow.png'); +} +.infobox-success { + color: #4F8A10; + background-color: #DFF2BF; + background-image: url('../img/info-green.png'); +} +.infobox-error { + color: #D8000C; + background-color: #FFBABA; + background-image: url('../img/info-red.png'); +} +/* LISTS ------------------------------------------------------------*/ +.lists-check ul,.lists-arrow ul,.lists-plus ul,.lists-star ul,.lists-heart ul { + margin-bottom: 10px; + margin-left: 20px; +} +.lists-check ul li { + list-style-image: url(../img/bullets/check.png); + line-height: 1.5em; +} +.lists-arrow ul { + list-style-image: url(../img/bullets/arrow.png); + line-height: 1.5em; +} +.lists-plus ul { + list-style-image: url(../img/bullets/plus.png); + line-height: 1.5em; +} +.lists-star ul { + list-style-image: url(../img/bullets/star.png); + line-height: 1.5em; +} +.lists-heart ul { + list-style-image: url(../img/bullets/heart.png); + line-height: 1.5em; +} +/* PULLQUOTES ------------------------------------------------------------*/ +.pullquote-right,.pullquote-left { + border-left: #555555 2px solid; + float: right; + font-size: 16px; + line-height: 1.5em; + margin: 20px 0px 20px 20px; + width: 33%; + font-style: italic; +} +.pullquote-left { + float: left; + margin: 20px 20px 20px 0px; + padding: 0 0 0 20px; +} +.pullquote-right { + border-left: none; + border-right: #555555 2px solid; + padding: 0 20px 0 0px; +} +/* HIGHLIGHT ------------------------------------------------------------*/ +.highlight { + background: #fbe471; +} +/* Link buttons ------------------------------------------------*/ +.theme-link-button { + display: inline-block; + padding: 10px; + background: #cb5432; + color: #f1d76e; +} +.link-button { + display: inline-block; + background-color: #cb5432; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fe8300), to(#c46500)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fe8300, #c46500); + background-image: -moz-linear-gradient(top, #fe8300, #c46500); + background-image: -ms-linear-gradient(top, #fe8300, #c46500); + background-image: -o-linear-gradient(top, #fe8300, #c46500); + background-image: linear-gradient(top, #fe8300, #c46500); + border: 1px solid #c46500; + border-bottom: 1px solid #fe8300; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 0 0 #fe8300; + -moz-box-shadow: inset 0 1px 0 0 #fe8300; + -ms-box-shadow: inset 0 1px 0 0 #fe8300; + -o-box-shadow: inset 0 1px 0 0 #fe8300; + box-shadow: inset 0 1px 0 0 #fe8300; + color: #703a00; + font-weight: bold; + line-height: 1; + padding: 8px 10px; + text-align: center; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); +} +.link-button:hover { + color: #703a00; + background-color: #ff9627; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ff9627), to(#c46500)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #ff9627, #c46500); + background-image: -moz-linear-gradient(top, #ff9627, #c46500); + background-image: -ms-linear-gradient(top, #ff9627, #c46500); + background-image: -o-linear-gradient(top, #ff9627, #c46500); + background-image: linear-gradient(top, #ff9627, #c46500); +} +.link-button.fullwidth { + display: block; + width: 97%; + margin: 0 auto; +} +.list-buttons { + display: block; +} +.list-buttons li { + display: block; + float: left; + margin-right: 5px; + margin-bottom: 20px; +} +/* Link buttons red ------------------------------------------------*/ +.link-button.red { + color: #530909; + background-color: #e4504c; + background-image: -webkit-gradient(linear, left top, left bottom, from(#e4504c), to(#a61b1b)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #e4504c, #a61b1b); + background-image: -moz-linear-gradient(top, #e4504c, #a61b1b); + background-image: -ms-linear-gradient(top, #e4504c, #a61b1b); + background-image: -o-linear-gradient(top, #e4504c, #a61b1b); + background-image: linear-gradient(top, #e4504c, #a61b1b); + border: 1px solid #6e0606; + border-bottom: 1px solid #6e0606; + -webkit-box-shadow: inset 0 1px 0 0 #f95c59; + -moz-box-shadow: inset 0 1px 0 0 #f95c59; + -ms-box-shadow: inset 0 1px 0 0 #f95c59; + -o-box-shadow: inset 0 1px 0 0 #f95c59; + box-shadow: inset 0 1px 0 0 #f95c59; +} +.link-button.red:hover { + color: #530909; + background-color: #89cc54; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ff8380), to(#b40e0e)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #ff8380, #b40e0e); + background-image: -moz-linear-gradient(top, #ff8380, #b40e0e); + background-image: -ms-linear-gradient(top, #ff8380, #b40e0e); + background-image: -o-linear-gradient(top, #ff8380, #b40e0e); + background-image: linear-gradient(top, #ff8380, #b40e0e); +} +/* Link buttons green ------------------------------------------------*/ +.link-button.green { + color: #223613; + background-color: #7fbf4d; + background-image: -webkit-gradient(linear, left top, left bottom, from(#7fbf4d), to(#426825)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #7fbf4d, #426825); + background-image: -moz-linear-gradient(top, #7fbf4d, #426825); + background-image: -ms-linear-gradient(top, #7fbf4d, #426825); + background-image: -o-linear-gradient(top, #7fbf4d, #426825); + background-image: linear-gradient(top, #7fbf4d, #426825); + border: 1px solid #63a62f; + border-bottom: 1px solid #5b992b; + -webkit-box-shadow: inset 0 1px 0 0 #96ca6d; + -moz-box-shadow: inset 0 1px 0 0 #96ca6d; + -ms-box-shadow: inset 0 1px 0 0 #96ca6d; + -o-box-shadow: inset 0 1px 0 0 #96ca6d; + box-shadow: inset 0 1px 0 0 #96ca6d; +} +.link-button.green:hover { + color: #223613; + background-color: #89cc54; + background-image: -webkit-gradient(linear, left top, left bottom, from(#89cc54), to(#426825)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #89cc54, #426825); + background-image: -moz-linear-gradient(top, #89cc54, #426825); + background-image: -ms-linear-gradient(top, #89cc54, #426825); + background-image: -o-linear-gradient(top, #89cc54, #426825); + background-image: linear-gradient(top, #89cc54, #426825); +} +/* Link buttons blue ------------------------------------------------*/ +.link-button.blue { + color: #2c4358; + background-color: #97b2c9; + background-image: -webkit-gradient(linear, left top, left bottom, from(#97b2c9), to(#4e7da5)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #97b2c9, #4e7da5); + background-image: -moz-linear-gradient(top, #97b2c9, #4e7da5); + background-image: -ms-linear-gradient(top, #97b2c9, #4e7da5); + background-image: -o-linear-gradient(top, #97b2c9, #4e7da5); + background-image: linear-gradient(top, #97b2c9, #4e7da5); + border: 1px solid #b9d3e9; + border-bottom: 1px solid #2c4358; + -webkit-box-shadow: inset 0 1px 0 0 #b9d3e9; + -moz-box-shadow: inset 0 1px 0 0 #b9d3e9; + -ms-box-shadow: inset 0 1px 0 0 #b9d3e9; + -o-box-shadow: inset 0 1px 0 0 #b9d3e9; + box-shadow: inset 0 1px 0 0 #b9d3e9; +} +.link-button.blue:hover { + color: #2c4358; + background-color: #89cc54; + background-image: -webkit-gradient(linear, left top, left bottom, from(#89bde8), to(#3771a2)); + /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #89bde8, #3771a2); + background-image: -moz-linear-gradient(top, #89bde8, #3771a2); + background-image: -ms-linear-gradient(top, #89bde8, #3771a2); + background-image: -o-linear-gradient(top, #89bde8, #3771a2); + background-image: linear-gradient(top, #89bde8, #3771a2); +} +/* ACCORDION -------------------------------------------------*/ +.accordion-trigger,.toggle-trigger { + line-height: 30px; + font-size: 14px; + border-top: 1px solid #797367; + border-left: 1px solid #333; + border-right: 1px solid #333; + border-bottom: 1px solid #373125; +} +.accordion-trigger { + text-decoration: none; + color: #fff; + font-weight: bold; + padding: 5px 10px; + cursor: pointer; + background: #333; +} +.accordion-trigger.active { + border-bottom: 1px solid #333; +} +.accordion-trigger:hover { + background: #333; +} +.accordion-container { + margin-bottom: 0px; + padding: 5px 10px; + border-bottom: 1px solid #333; + border-right: 1px solid #333; + border-left: 1px solid #333; +} +/* TOGGLE -------------------------------------------------*/ +.toggle-trigger { + text-decoration: none; + color: #fff; + font-weight: bold; + cursor: pointer; + overflow: hidden; + background-color: #333; + padding: 5px 5px 5px 10px; +} +.toggle-trigger i { + display: block; + float: left; + width: 31px; + height: 31px; + margin-right: 10px; + background: url(../img/toggle.png) no-repeat 0px 0px; +} +.toggle-trigger i.simple { + background: url(../img/toggle-simple.png) no-repeat 0px 0px; +} +.toggle-trigger.active { + border-bottom: 1px solid #333; +} +.toggle-trigger.active i { + background-position: 0px -31px; +} +.toggle-trigger:hover { + background-color: #333; +} +.toggle-container { + margin-bottom: 0px; + padding: 5px 10px; + border-bottom: 1px solid #333; + border-right: 1px solid #333; + border-left: 1px solid #333; +} +/* TABS -------------------------------------------------*/ +/* root element for tabs */ +.tabs { + list-style: none; + margin: 0 !important; + padding: 0px; + height: 33px; +} +body.home .tabs { + padding: 0px 30px; +} +/* single tab */ +ul.tabs li { + display: block; + float: left; + text-indent: 0; + padding: 0; + margin: 2px 5px 0px 0px !important; + list-style-image: none !important; + border-top: 1px solid #333; + border-right: 1px solid #333; + border-left: 1px solid #333; +} +/* link inside the tab. uses a background image */ +ul.tabs a { + display: block; + font-size: 13px; + font-weight: bold; + height: 30px; + line-height: 30px; + text-align: center; + text-decoration: none; + padding: 0px 0px 0px 10px; + position: relative; + top: 0px; +} +ul.tabs a span { + display: block; + height: 100%; + padding-right: 10px; +} +ul.tabs a { + text-decoration: none; + color: #444444; + background: #fff; +} +ul.tabs a:active { + outline: none; +} +/* when mouse enters the tab move the background image */ +ul.tabs li:hover a,ul.tabs a.current { + background: #f3f3f3; + color: #444; + border-bottom: 1px solid #f1f1f1; +} +/* active tab uses a class name "current". its highlight is also done by moving the background image. */ +ul.tabs a.current,ul.tabs a.current:hover,ul.tabs li.current a { + cursor: default !important; + color: #444 !important; + display: block; + text-decoration: none; +} +/* initially all panes are hidden */.panes .pane { + display: none; +} +.panes > div { + display: none; + min-height: 200px; + border: 1px solid #333; + padding: 15px; + background: #f1f1f1; +} \ No newline at end of file diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/isotope.css b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/isotope.css new file mode 100644 index 0000000..d838198 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/isotope.css @@ -0,0 +1,49 @@ +/**** Isotope Filtering ****/ + +.isotope-item { + z-index: 2; +} + +.isotope-hidden.isotope-item { + pointer-events: none; + z-index: 1; +} + +/**** Isotope CSS3 transitions ****/ + +.isotope, +.isotope .isotope-item { + -webkit-transition-duration: 0.8s; + -moz-transition-duration: 0.8s; + -ms-transition-duration: 0.8s; + -o-transition-duration: 0.8s; + transition-duration: 0.8s; +} + +.isotope { + -webkit-transition-property: height, width; + -moz-transition-property: height, width; + -ms-transition-property: height, width; + -o-transition-property: height, width; + transition-property: height, width; +} + +.isotope .isotope-item { + -webkit-transition-property: -webkit-transform, opacity; + -moz-transition-property: -moz-transform, opacity; + -ms-transition-property: -ms-transform, opacity; + -o-transition-property: top, left, opacity; + transition-property: transform, opacity; +} + +/**** disabling Isotope CSS3 transitions ****/ + +.isotope.no-transition, +.isotope.no-transition .isotope-item, +.isotope .isotope-item.no-transition { + -webkit-transition-duration: 0s; + -moz-transition-duration: 0s; + -ms-transition-duration: 0s; + -o-transition-duration: 0s; + transition-duration: 0s; +} \ No newline at end of file diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/nivo-slider.css b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/nivo-slider.css new file mode 100644 index 0000000..0fd8ae6 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/nivo-slider.css @@ -0,0 +1,227 @@ +/* Vars ----------------------------------------------------*/ +/* Mixins ----------------------------------------------------*/ +/* SLIDER --------------------------------------------------------- */ +/* + * jQuery Nivo Slider v3.0 + * http://nivo.dev7studios.com + * + * Copyright 2012, Dev7studios + * Free to use and abuse under the MIT license. + * http://www.opensource.org/licenses/mit-license.php + */ +/* The Nivo Slider styles */ +.nivoSlider { + position: relative; + width: 100%; + height: auto; + overflow: hidden; +} +.nivoSlider img { + position: absolute; + top: 0px; + left: 0px; +} +.nivo-main-image { + display: block !important; + position: relative !important; + width: 100% !important; +} +/* If an image is wrapped in a link */ +.nivoSlider a.nivo-imageLink { + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 100%; + border: 0; + padding: 0; + margin: 0; + z-index: 6; + display: none; +} +/* The slices and boxes in the Slider */ +.nivo-slice { + display: block; + position: absolute; + z-index: 5; + height: 100%; + top: 0; +} +.nivo-box { + display: block; + position: absolute; + z-index: 5; + overflow: hidden; +} +.nivo-box img { + display: block; +} +/* Caption styles */ +.nivo-caption { + position: absolute; + left: 0px; + bottom: 0px; + background: #f3e4c8; + color: #585246; + width: 100%; + z-index: 8; + padding: 5px 10px; + opacity: 1; + overflow: hidden; + display: none; + -moz-opacity: 0.8; + filter: alpha(opacity=8); + -webkit-box-sizing: border-box; + /* Safari/Chrome, other WebKit */ + + -moz-box-sizing: border-box; + /* Firefox, other Gecko */ + + box-sizing: border-box; + /* Opera/IE 8+ */ + +} +.nivo-caption p { + padding: 5px; + margin: 0; +} +.nivo-caption a { + display: inline !important; +} +.nivo-html-caption { + display: none; +} +/* Direction nav styles (e.g. Next & Prev) */ +.nivo-directionNav a { + position: absolute; + top: 45%; + z-index: 9; + cursor: pointer; +} +.nivo-prevNav { + left: 0px; +} +.nivo-nextNav { + right: 0px; +} +/* Control nav styles (e.g. 1,2,3...) */ +.nivo-controlNav { + text-align: center; + padding: 15px 0; +} +.nivo-controlNav a { + cursor: pointer; +} +.nivo-controlNav a.active { + font-weight: bold; +} +/* +Skin Name: Nivo Slider Specter Theme +Skin Type: flexible +Description: Custom Skin +Version: 1 +Author: #SPWRD Authors +*/ +.theme-nivo-specter { + background: #fff; + margin-bottom: 20px; + position: relative; +} +.theme-nivo-specter.theme-home { + margin-bottom: 10px; +} +.theme-nivo-specter .nivoSlider { + position: relative; + background: #f3e4c8 url(../img/loading.gif) no-repeat 50% 50%; +} +.theme-nivo-specter .nivoSlider img { + position: absolute; + top: 0px; + left: 0px; + display: none; +} +.theme-nivo-specter .nivoSlider a { + border: 0; + display: block; +} +.theme-nivo-specter .nivo-controlNav { + text-align: left; + padding: 10px 0; + position: absolute; + bottom: 0px; + left: 20px; + z-index: 5; +} +.theme-nivo-specter .nivo-controlNav a { + display: inline-block; + width: 11px; + height: 11px; + background: #333333; + text-indent: -9999px; + border: 0; + margin: 0 2px; + -moz-border-radius: 11px 11px 11px 11px; + -webkit-border-radius: 11px 11px 11px 11px; + border-radius: 11px 11px 11px 11px; +} +.theme-nivo-specter .nivo-controlNav a.active { + background: #009899; +} +.theme-nivo-specter .nivo-directionNav a { + display: block; + width: 38px; + height: 38px; + background: url(../img/icon-arrows.png) no-repeat 0px -38px; + text-indent: -9999px; + border: 0; + top: 60%; +} + +.theme-nivo-specter a.nivo-nextNav { + background-position: 0px 0px; + right: 20px; +} +.theme-nivo-specter a.nivo-prevNav { + left: 20px; +} +.theme-nivo-specter .nivo-caption { + font-family: inherit; + left: auto; + right: -500px; + bottom: 20px; + background: #000; + color: #fff; + width: 40%; + min-height: 50%; + padding: 20px; + opacity: .8; + -moz-opacity: 0.8; + filter: alpha(opacity=8); opacity: .8; + -moz-opacity: 0.8; + filter: alpha(opacity=8); + display: none; + border-radius: 10px 0px 0px 10px; + -moz-border-radius: 10px 0px 0px 10px; + -webkit-border-radius: 10px 0px 0px 10px; +} +.theme-nivo-specter .nivo-caption a { + color: #cb5432; + border-bottom: 1px dotted #cb5432; +} +.theme-nivo-specter .nivo-caption a:hover { + color: #cb5432; +} +.theme-nivo-specter .nivo-controlNav.nivo-thumbs-enabled { + width: 100%; +} +.theme-nivo-specter .nivo-controlNav.nivo-thumbs-enabled a { + width: auto; + height: auto; + background: none; + margin-bottom: 5px; +} +.theme-nivo-specter .nivo-controlNav.nivo-thumbs-enabled img { + display: block; + width: 120px; + height: auto; +} diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/style.css b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/style.css new file mode 100644 index 0000000..e0ab861 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/style.css @@ -0,0 +1,1311 @@ +/*colors*/ +/* +burnt orange: #993300 +turquoise: #009899 +light grey: #e5e5e5 +light grey border: #c2c2c2 +dark grey: #333333 +text: #444444 +*/ + +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ +html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {margin: 0;padding: 0;border: 0;font-size: 100%;font: inherit;vertical-align: baseline;} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block;} +body {line-height: 1;} +ol, ul {list-style: none;} +blockquote, q {quotes: none;} +blockquote:before, blockquote:after,q:before, q:after {content: '';content: none;} +table {border-collapse: collapse;border-spacing: 0;} +/*end reset*/ + +/* Fonts ----------------------------------------------------*/ +/* Here you go ie */ +@font-face { + font-family: 'mensch'; + font-style: normal; + font-weight: normal; + src: url('../fonts/mensch-webfont.eot'); +} +/* For real web browsers */ +@font-face { + font-family: 'mensch'; + font-style: normal; + font-weight: normal; + src: url('../fonts/mensch-webfont.ttf'); +} +/* GENERAL ------------------------------------------------------------*/ +body { + font-family: Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 1.5em; + color: #444; +} +body a { + text-decoration: none; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + -o-transition: all 0.3s ease; + transition: all 0.3s ease; +} +body a:hover, body a.active { + text-decoration: none; +} +body p { + margin-bottom: 21px; +} +h1 { + font-size: 48px; +} +h2 { + font-size: 36px; +} +h3 { + font-size: 30px; +} +h4 { + font-size: 24px; +} +h5 { + font-size: 18px; +} +h6 { + font-size: 14px; +} +h1,h2,h3,h4,h5,h6 { + font-family: mensch, Helvetica, Arial, sans-serif; + line-height: 1.3em; + color: #009899; +} +.wrapper { + margin: 0 auto; + padding: 0px 10px; + position: relative; + width: 940px; +} +a.button { + display: inline-block; + color: #fff; + font-size: 20px; + line-height: 1em; + padding: 10px 20px; + border: 1px #c2c2c2 solid; + background: #009899 none; +} +a.button:hover { + color: #c2c2c2; + border: 1px #333333 solid; +} +/*end general*/ + +/*header*/ +header { + border-top: 7px #993300 solid; + background: transparent none; + min-height: 100px; +} +header .wrapper { + height: 105px; +} +header #logo { + display: inline-block; +} +header #logo img { + display: block; + margin: 20px 0px 20px 5px; +} +header .tagline { + background: transparent url("../img/divider-tagline.png") no-repeat; + display: inline-block; + margin: 20px 0 0; + min-height: 45px; + padding: 10px 0 10px 10px; + vertical-align: top; +} +header .tagline h2 { + color: #009899; + font-size: 24px; + line-height: 1em; +} +header .tagline h2 span { + color: #444; +} +header .searchbox { + position: absolute; + right: 10px; + bottom: 10px; + width: 260px; + text-align: left; +} +header #searchInputBox { + background: #e5e5e5 none; + border: 1px #c2c2c2 solid; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius:5px; + height: 38px; +} +header #searchInputBox input[type=text]{ + border: 0px; + width: 200px; + height: 28px; + padding: 5px 10px; + font-size: 16px; + line-height: 1em; + color: #333; + background: transparent none; + display: inline-block; + vertical-align: top; +} +header .searchbox a { + display: inline-block; + height: 24px; + width: 22px; + padding: 7px 10px 5px 0px; + vertical-align: top; + -webkit-transition: all 0s ease; + -moz-transition: all 0s ease; + -o-transition: all 0s ease; + transition: all 0s ease; + background: transparent url('../img/icon-search.png') no-repeat 0px 7px; +} +header .searchbox a:hover { + background-position: 0px -69px; +} +header .searchbox a img{ + display: none; +} +/*social*/ +header .social { + position: absolute; + top: -39px; + right: 10px; + height: 32px; + padding: 0px 7px 7px; + background: #993300 none; + border-radius: 0px 0px 0px 5px; + -moz-border-radius: 0px 0px 0px 5px; + -webkit-border-radius: 0px 0px 0px 5px; +} +header .social ul { + display: block; +} +header .social ul li { + float: left; + display: block; + padding-left: 7px; +} +header .social ul li:first-child { + padding-left: 0px; +} +header .social ul li a { + display: block; + width: 32px; + height: 32px; +} +header .social a.social-toggle { + position: absolute; + bottom: -20px; + right: 0px; + display: block; + padding: 0px 10px 8px 10px; + height: 14px; + width: 16px; + background: #993300 url('../img/icon-arrows-vert.png') no-repeat 10px 0px; + text-indent: -9999px; + border-radius: 0px 0px 5px 5px; + -moz-border-radius: 0px 0px 5px 5px; + -webkit-border-radius: 0px 0px 5px 5px; + -webkit-transition: all 0s ease; + -moz-transition: all 0s ease; + -o-transition: all 0s ease; + transition: all 0s ease; +} +header .social a.social-toggle:hover { + cursor: pointer; +} +header .social.down { + top: 0px; +} +header .social.down a.social-toggle { + background-position: 10px -25px; +} +.csstransforms.csstransitions header .social { + -webkit-transition: top 500ms ease; + -moz-transition: top 500ms ease; + -o-transition: top 500ms ease; + transition: top 500ms ease; +} +/*end social*/ + +/*top nav*/ +nav#topnav { + height: 60px; + margin-top: 0; + position: relative; + width: 100%; + z-index: 99; +} +nav .wrapper .nav { + height: 59px; + border-color: #333; + border-style: solid; + border-width: 1px 1px 0px 1px; + background: #000 none; + width: auto; +} +nav#topnav .nav ul, nav#topnav .nav ul * { + float: none; + list-style: none outside none; + margin: 0; + padding: 0; +} +nav#topnav .nav ul.root{ + display: block; + position: relative; + text-align: left; +} +nav#topnav .nav ul.root > li { + display: inline-block; + float: left; + height: 59px; + color: #2f2f2f; + position: relative; + white-space: nowrap; + border-right: 1px #2f2f2f solid; + vertical-align: top; +} +nav#topnav .nav ul.root > li a { + position: relative; + color: #fff; + display: block; + font-size: 18px; + line-height: 1em; + padding: 21px 20px 21px; + height: 17px; +} +nav#topnav .nav ul.root > li:first-child { + padding: 15px 20px 16px; + height: 28px; +} +nav#topnav .nav ul.root > li:first-child a { + background: transparent url('../img/icon-home.png') no-repeat 0px 0px; + height: 28px; + width: 28px; + text-indent: 1000%; + white-space: nowrap; + overflow: hidden; + padding: 0px; + -webkit-transition: all 0s ease; + -moz-transition: all 0s ease; + -o-transition: all 0s ease; + transition: all 0s ease; +} +nav#topnav .nav ul.root > li:hover > a { + color: #009899; +} +nav#topnav .nav ul.root > li:first-child:hover > a { + background-position: 0px -28px; +} +nav#topnav .nav ul.root > li ul { + margin-top: 0px; + text-align: left; + position: absolute; + left: 0px; + white-space: nowrap; + display: none; + border: none; +} +nav#topnav .nav ul.root > li ul li { + position: relative; +} +nav#topnav .nav ul.root > li:hover > ul { + display: block; +} +nav#topnav .nav ul.root > li ul li a { + background: none repeat scroll 0 0 #333; + padding: 19px 20px 20px; + border-color: #000; + border-style: solid; + border-width: 0px 1px 1px 1px; +} +nav#topnav .nav ul.root > li li:hover > a { + color: #009899; +} +/*only apply to thrid level and lower*/ +nav#topnav .nav ul.root ul ul { + left: 100%; + top: 0px; +} +nav#topnav .nav ul.root ul > li:hover > ul { + display: block; +} +nav#topnav .nav ul.root ul ul li a:first-child { + border-width: 1px; +} +/*end top nav*/ +nav .site-access { + position: absolute; + right: 20px; + top: 8px; +} +nav .site-access li { + float: left; + padding-left: 10px; +} +/*end header*/ + +/*main content area*/ +#main .wrapper { +} +.headline { + text-align: center; + border-bottom: 1px #333 solid; + margin-bottom: 10px; +} +.headline h2 { + text-align: center; + color: #444; + text-transform: uppercase; + line-height: 1em; + padding-bottom: 5px; +} +.headline h4 { + text-align: center; + color: #444; + text-transform: uppercase; + line-height: 1em; + padding-bottom: 5px; +} + +/*sections*/ +.section { + border-bottom: 1px solid #333333; + margin-bottom: 10px; +} +.section .heading { + margin-bottom: 10px; + text-align: left; +} +.section h2.heading { + color: #444; + font-size: 30px; +} +.section h2.heading:before { + content: "//"; + padding-right: 10px; +} + +/*columns*/ +.columns:after,.columns:before { + content: '\0020'; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; +} +.columns:after { + clear: both; +} +.columns { + zoom: 1; +} +.columns .col1,.columns .col2,.columns .col3,.columns .col4,.columns .col5,.columns .col6,.columns .col7,.columns .col8,.columns .col9,.columns .col10,.columns .col11,.columns .col12 { + float: left; + margin: 0px 0px 0px 20px; + position: relative; + box-sizing:border-box; + -moz-box-sizing:border-box; /* Firefox */ + -webkit-box-sizing:border-box; /* Safari */ +} +.columns .col1:first-child,.columns .col2:first-child,.columns .col3:first-child,.columns .col4:first-child,.columns .col5:first-child,.columns .col6:first-child,.columns .col7:first-child,.columns .col8:first-child,.columns .col9:first-child,.columns .col10:first-child,.columns .col11:first-child,.columns .col12:first-child { + margin-left: 0px; +} +.columns .col1 {width: 60px;} +.columns .col2 {width: 140px;} +.columns .col3 {width: 220px;} +.columns .col4 {width: 300px;} +.columns .col5 {width: 380px;} +.columns .col6 {width: 460px;} +.columns .col7 {width: 540px;} +.columns .col8 {width: 620px;} +.columns .col9 {width: 700px;} +.columns .col10 {width: 780px;} +.columns .col11 {width: 860px;} +.columns .col12 {width: 940px;} +/*end columns*/ + +/*community list*/ +.community-list .list li { + float: left; + text-align: left; + width: 31.33%; + padding-left: 3%; +} +.community-list .list li:first-child { + padding-left: 0%; +} +.community-list .list li .thumbcaption { + display: block; + line-height: 0; + margin-bottom: 10px; + padding: 0px; + overflow: hidden; + position: relative; +} +.community-list .list li .thumbcaption img { + max-width: 100%; + width: 100%; +} +.community-list .list li .thumbcaption > span { + position: absolute; + bottom: -100px; + left: 0px; + padding: 20px 2% 0px; + background: #000 none; + opacity: .7; + -moz-opacity: 0.7; + filter: alpha(opacity=7); + height: 20px; + width: 96%; + display: block; + color: #fff; + text-align: center; + font-size: 20px; +} +.community-list .list li:last-child { + margin-right: 0; +} +.community-list a.heading { + color: #009899; + display: block; + text-align: center; +} +/*end community list*/ +/*our homes*/ +.our-homes { + border-bottom: none; +} +.our-homes .columns { + padding-top: 40px; +} +.our-homes .columns > div { + background: #e5e5e5 none; + border: 1px #c2c2c2 solid; + min-height: 280px; +} +.our-homes .columns > div .header { + position: relative; + text-align: center; + left: 50%; + width: 100px; + height: 100px; + margin-top: -50px; +} +.our-homes .columns > div .header img { + display: block; + float: left; + position: relative; + right: 50%; +} +.our-homes .contentbox { + margin: 10px 20px 20px; + width: auto; + min-height: 160px; + display: block; + position: relative; +} +.our-homes .homes > img { + float: left; + border: 1px #c2c2c2 solid; + max-width: 230px; + width: 100%; +} +.our-homes .homes > span{ + float: left; + display: block; + width: 320px; + height: auto; + padding-left: 20px; +} +.our-homes .homes > span a{ + float: right; + margin-top: 20px; +} + +.our-homes .views li { + float: left; + display: block; + width: 50%; + text-align: center; + padding-bottom: 10px; +} +.our-homes .views li.full { + width: 100%; +} +.our-homes .views li a, .our-homes .views li a:link, .our-homes .views li a:visited { + color: #333; +} +.our-homes .views li a:hover { + color: #009899; +} +/*end our homes*/ + +/*page content*/ +/*end page content*/ + +/*Blog/posts*/ +/*end blog/posts*/ + +/*comments*/ +/*end comments*/ + +/*filter*/ +/*end filter*/ + +/*Project/portfolio*/ +/*end project/portfolio*/ + +/*community*/ +/*end community*/ + +/*forms*/ +/*end forms*/ + +/*sidebar*/ +/*end sidebar*/ +/*end main*/ + +/*footer*/ +footer { + background: #333 none; + color: #fff; +} +footer a { + color: #009899; +} +footer .cols { + font-size: 14px; + margin: 30px 0px; +} +footer .cols > li.col { + float: left; + width: 32%; + padding-left:2%; +} +footer .cols > li.col:first-child { + padding-left:0%; +} +footer .cols h1, footer .cols h2, footer .cols h3, footer .cols h4, footer .cols h5, footer .cols h6 { + font-weight: normal; + margin-bottom: 20px; + padding-bottom: 0; + padding-top: 0; + text-align: center; +} +footer .contact li { + padding: 0px 0px 0px 40px; + margin-bottom: 15px; + background: transparent url('../img/icon-contact.png') no-repeat 0px 0px; + color: #009899; +} +footer .contact li.phone { + background-position: 7px 3px; +} +footer .contact li.email { + background-position: 7px -29px; +} +footer .contact li.fb { + background-position: 7px -61px; +} +footer .recent-post { + padding: 0px 0px 15px; +} +footer .recent-post > a { + display: block; + float: left; + padding-right: 10px; +} +/* Tweet widget CSS */ +.tweet, .query { } +.tweet .tweet_list, .query .tweet_list { + -webkit-border-radius: .5em; + list-style-type: none; + margin: 0; + padding: 0; + overflow-y: hidden; +} +.tweet .tweet_list .awesome,.tweet .tweet_list .epic,.query .tweet_list .awesome,.query .tweet_list .epic { + text-transform: uppercase; +} +.tweet .tweet_list li, .query .tweet_list li { + overflow-y: auto; + overflow-x: hidden; + padding: 1em ; + background-image: url(../img/icon-bird.png); + background-repeat: no-repeat; + background-position: 6px 19px; + padding-left: 40px; +} +.tweet a,.query a { +} +.tweet .tweet_list .tweet_odd,.query .tweet_list .tweet_odd { + background-color: rgba(0,0,0,0.2); +} +.tweet .tweet_list .tweet_avatar,.query .tweet_list .tweet_avatar { + padding-right: .5em; + float: left; +} +.tweet .tweet_list .tweet_avatar img, .query .tweet_list .tweet_avatar img { + vertical-align: middle; +} +/*end tweets*/ +footer .footer-bottom { + background: #000 none; + font-size: 14px; +} +footer .footer-bottom p { + margin: 0px; + padding: 0px; + font-size: inherit; +} +footer .footer-bottom .wrapper { + padding: 15px 0px; +} +footer .footer-bottom .copyright { + float: left; + display: inline-block; +} +footer .footer-bottom .sitemap { + float: right; + display: inline-block; +} +footer .footer-bottom .sitemap li { + display: inline-block; + border-left: 1px #fff solid; + padding-left: 9px; + line-height: 1em; +} +footer .footer-bottom .sitemap li:first-child { + border-left: none; +} +footer .footer-bottom .sitemap li a, footer .footer-bottom .sitemap li a:link, footer .footer-bottom .sitemap li a:visited { + color: #fff; + font-size: inherit; +} +footer .footer-bottom .sitemap li a:hover { + color: #009899; +} +/*end footer*/ + +/*Clear fix*/ +.cf:after,.cf:before { + content: '\0020'; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; +} +.cf:after { + clear: both; +} +.cf { + zoom: 1; +} +/*end clear fix*/ + +/*additional page fixes*/ +/*general*/ +.page-content { + margin-top: 20px; +} +.section.noborder { + border-bottom: none; + margin-bottom: 10px; +} +h2.heading { + color: #444; + font-size: 30px; +} +h4.heading { + color: #444444; + font-size: 22px; + margin-bottom: 10px; +} +h2.heading:before, h4.heading:before { + content: "//"; + padding-right: 10px; +} +.one-half, .one-third, .one-fourth { + float: left; + margin-bottom: 40px; + margin-right: 2.1276%; + position: relative; +} +.one-half { + width: 48.9361%; +} +.one-third { + width: 31.9148%; +} +.one-fourth { + width: 23.4042%; +} +.last { + clear: right; + margin-right: 0 !important; +} +img.floatleft, div.floatleft { + float: left; + padding: 10px 10px 10px 0; +} +img.floatright, div.floatright { + float: right; + padding: 10px 0px 10px 10; +} +#sidebar a { + color: #009899; +} +#sidebar .ads a { + display: block; + float: left; + line-height: 0; + margin-bottom: 10px; + margin-right: 10px; +} +#sidebar li { + margin-bottom: 7px; +} +#sidebar .block { + margin-bottom: 20px; + padding-bottom: 5px; +} +/*end general*/ + +/*map*/ +#map_canvas { + display: block; + height: 300px; + margin-bottom: 20px; + width: 100%; +} +#sidebar #map_canvas { + height: 200px; +} +/*end map*/ + +/*Blog - Posts*/ +#posts-list { + float: left; + position: relative; + width: 680px; +} +#posts-list article { + background: none repeat scroll 0 0 #E5E5E5; + border: 1px solid #C2C2C2; + margin-top: 30px; + padding: 29px; + position: relative; +} +#posts-list article .feature-image { + line-height: 0; + position: relative; +} +#posts-list article .feature-image img { + max-width: 100%; +} +#posts-list article .feature-image .entry-date { + position: absolute; + bottom: -60px; + right: 0px; + height: 60px; + width: 50px; + background: #993300 none; + color: #fff; + font-family: mensch; + font-size: 20px; + line-height: 1.1em; + text-align: center; + border-radius: 0 0 5px 5px; + -moz-border-radius: 0 0 5px 5px; + -webkit-border-radius:0 0 5px 5px; +} +#posts-list article .feature-image .entry-date .month { + margin-top: 7px; +} +#posts-list article .excerpt { + color: #444; + margin-top: 40px; +} +#posts-list article .excerpt .post-heading { + color: #444; + display: block; + font-family: mensch; + font-size: 36px; + line-height: 1.1em; + max-width: 480px; +} +#posts-list article .meta { + border-top: 1px solid #444; + display: block; + font-size: 14px; + padding-top: 10px; +} +#posts-list article .meta a { + color: #993300; +} +#main .page-navigation { + position: relative; + display: block; + float: left; + left: 50%; + margin: 30px 0px; +} +#main .page-navigation div { + background: none repeat scroll 0 0 #333333; + -moz-box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.1); + box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.1); + color: #009899; + position: relative; + right: 50%; +} +#main .page-navigation .nav-next { + background: #333333 url("../img/icon-arrows.png") no-repeat left -38px; + float: left; + margin-right: 20px; + padding-left: 20px; +} +#main .page-navigation .nav-previous { + background: #333333 url("../img/icon-arrows.png") no-repeat right 0px; + float: right; + padding-right: 20px; +} +#main .page-navigation a { + color: #009899; + display: block; + padding: 7px 15px 7px 25px; + height: 24px; +} +#main .page-navigation .nav-previous a { + padding: 7px 25px 7px 15px; +} +#sidebar { + float: right; + font-size: 14px; + position: relative; + width: 240px; + margin-top: 30px; +} +/*end blog / posts*/ + +/*community*/ +.slider-community { + margin-top: 20px; +} +#community-listing { + margin-top: 0px; +} +.community-listing article, #sidebar.community-listing, .community-listing .page-content, #posts-list.community-listing .page-content article { + margin-top: 0px; +} +/*end community*/ + +/*property*/ +.property { + margin-bottom: 10px; + border-bottom: 1px solid #333333; +} +.property .property-content { + float: left; + width: 690px; +} +.property .property-info { + background: none repeat scroll 0 0 #E5E5E5; + border: 1px solid #C2C2C2; + width: 200px; + float: right; + padding: 20px; + font-size: 14px; + line-height: 1em; +} +.property .property-info p { + margin-bottom: 10px; +} +.property .property-info strong { + display: block; + font-weight: bold; +} +.property .property-info a { + color: #009899; +} +.related-properties { + margin-bottom: 20px; +} +.related-properties a { + color: #009899; +} +.related-properties .related-list li { + float: left; + margin-left: 20px; + text-align: center; + width: 300px; +} +.related-properties .related-list li:first-child { + margin-left: 0px; +} +.related-properties .related-list li .thumb { + background: #333333 none; + display: block; + line-height: 0; + margin-bottom: 10px; + padding: 0px; + color: #fff; +} +.related-properties .related-list li .thumb img { + max-width: 100%; + width: 100%; +} +/*end property*/ + +/*isotope*/ +#filter-buttons { + background: none repeat scroll 0 0 #E5E5E5; + border: 1px solid #C2C2C2; + height: 40px; + margin: 30px 0px 20px; + text-align: center; +} +#filter-buttons li { + display: inline-block; + margin-bottom: 0; +} +#filter-buttons li a { + color: #009899; + display: block; + line-height: 1em; + margin-bottom: 0; + margin-right: 5px; + text-decoration: none; + padding-top: 11px; +} +#filter-buttons li .selected { + background: url("../img/icon-arrows-vert.png") no-repeat scroll center top transparent; +} +.feature { + width: 940px; +} +.feature li { + background: #333333 none; + margin-bottom: 20px; + margin-left: 13px; + position: relative; + width: 300px; +} +.feature li a { + color: #009899; +} +.feature li .thumb { + display: block; + position: relative; + width: 280px; + margin: 10px; +} +.feature li .thumb img { + max-width: 100%; +} +.feature li .thumb .date { + background: none repeat scroll 0 0 #fff; + display: block; + position: absolute; + left: 110px; + bottom: -25px; + width: 60px; + height: 50px; + float: left; + padding-top: 10px; + font-family: mensch; + border-radius: 40px; + -moz-border-radius: 40px; + -webkit-border-radius:40px; +} +.feature li .thumb .date span { + display: block; + font-size: 20px; + line-height: 20px; + text-align: center; +} +.feature li .caption { + padding: 10px 10px 20px; + text-align: center; + color: #fff; +} +/*end isotope*/ + +/*comments*/ +#comments-wrap { + margin-bottom: 20px; + padding-top: 20px; +} +#comments-wrap .commentlist { + font-size: 14px; + list-style-type: none; + margin: 0 0 30px; +} +#comments-wrap .commentlist .comment-body { + border-bottom: 1px solid #444444; + margin: 0 0 18px; + padding: 5px 0 10px; +} +#comments-wrap .commentlist > li:last-child { + border: medium none; + padding-top: 0; +} +#comments-wrap .commentlist .v-card { + color: #333; +} +#comments-wrap .commentlist .comment img.avatar { + float: right; + height: 35px; + margin: 2px 15px 0 0; + width: 35px; +} +#comments-wrap .commentlist .respond-title-wrap, #comments-wrap .commentlist .comment-title-wrap { + border-bottom: 1px solid #444; + margin: 0px 0px 30px; + padding: 0px 0px 15px; +} +#comments-wrap .commentlist #respond-title, #comments-wrap .commentlist #comments, #comments-wrap .commentlist .add-comment-link { + color: #993300; + font-size: 15px; + font-weight: bold; +} +#comments-wrap .commentlist .respond-caption { + font-size: 11px; +} +#comments-wrap .commentlist .add-comment-link a { + font-size: 12px; + padding: 0 15px 0 0; +} +#comments-wrap .commentlist .comment-body { + margin-bottom: 20px; + position: relative; +} +#comments-wrap .commentlist ul li { + padding: 0; +} +#comments-wrap .commentlist ul li:first-child .comment-border { + border-bottom: 1px solid #333; + height: 18px; + margin: 18px 0 0; + width: 430px; +} +#comments-wrap .commentlist .comment p:last-child { + margin: 0; +} +#comments-wrap .commentlist .comment .children { + list-style-type: none; + margin-left: 13%; +} +#comments-wrap .commentlist .comment .children .comment-body { + border-bottom: 1px solid #444; + padding-bottom: 10px; +} +#comments-wrap .commentlist .comment .children .comment-meta { + margin-bottom: 10px; + margin-left: 0; +} +#comments-wrap .commentlist .comment .children li { + background: transparent none; +} +#comments-wrap .commentlist .comment .children .comment-body { + margin: 10px 0px 0px; +} +#comments-wrap .commentlist .nocomments { + padding: 20px; + text-align: center; +} +#comments-wrap .commentlist .comment-body ul { + list-style-type: disc; +} +#comments-wrap .commentlist .comment-body ol { + list-style-type: decimal; +} +#comments-wrap .commentlist .reply { + position: absolute; + right: 1px; + top: 1px; +} +#comments-wrap .commentlist .comment-reply-link-wrap .comment-reply-link { + color: #993300; + font-size: 11px; +} +#comments-wrap .commentlist .comment-reply-link-wrap .comment-reply-link:hover { + color: #993300; +} +#comments-wrap .commentlist .comment-meta { + font-size: 11px; + margin: 0 0 10px; + position: relative; +} +#comments-wrap .commentlist .comment-meta .comment-replies { + margin-left: 20px; +} +#comments-wrap .commentlist .comment-author { + color: #444; + font-weight: bold; +} +#comments-wrap .commentlist .comment-author cite { + color: #009899; + font-style: normal; + font-weight: bold; + margin: 0; + padding: 0; +} +#comments-wrap .commentlist .comment-author cite a { + color: #009899; + padding: 0 15px 0 0; +} +#comments-wrap .commentlist .comment-inner h4 a { + color: #009899; +} +#comments-wrap .commentlist .comments-pagination { + clear: both; + font-size: 11px; + line-height: 14px; + margin-bottom: 10px; + overflow: hidden; + padding: 20px 0; + position: relative; +} +#comments-wrap .commentlist .comments-pagination span, #comments-wrap .commentlist .comments-pagination a { + background: none repeat scroll 0 0 #e5e5e5; + color: #444; + display: block; + float: left; + margin: 2px 2px 2px 0; + padding: 6px 9px 5px; + text-decoration: none; + width: auto; +} +#comments-wrap .commentlist .comments-pagination span:hover, #comments-wrap .commentlist .comments-pagination a:hover { + background: none repeat scroll 0 0 #444; + color: #FFFFFF; +} +#comments-wrap .commentlist .comments-pagination .current { + background: none repeat scroll 0 0 #444; + color: #FFFFFF; + padding: 6px 9px 5px; +} +#comments-wrap .comments-links-horizontal li { + display: inline-block; + margin: 0 10px 5px; + padding: 0 5px 5px; +} +#comments-wrap .comments-links-horizontal li:first-child { + margin-left: 0; + padding-left: 0; +} +#comments-wrap .comments-links-horizontal li a { + color: #009899; +} +/*end comments*/ + +/*forms*/ +.form label { + display: inline-block; + width: 100px; +} +#commentform, #contactForm { + margin-bottom: 20px; +} +#commentform .comment-notes, #contactForm .comment-notes { + margin-bottom: 10px; +} +#commentform .form-allowed-tags, #contactForm .form-allowed-tags { + color: #444444; + font-size: 14px; + margin-bottom: 10px; +} +#commentform input[type="text"], #contactForm input[type="text"], #commentform textarea, #contactForm textarea { + background: none repeat scroll 0 0 #F1F1F1; + border: 1px solid #CCCCCC; + color: #484848; + font-family: Helvetica,Arial; + font-size: 14px; + line-height: 1.5em; + overflow: auto; + padding: 10px 15px; +} +#commentform input[type="text"]:focus, #contactForm input[type="text"]:focus, #commentform textarea:focus, #contactForm textarea:focus { + background: none repeat scroll 0 0 #FFFFFF; + -moz-box-shadow: 0 0 3px rgba(251, 228, 113, 0.4); + -webkit-box-shadow: 0 0 3px rgba(251, 228, 113, 0.4); + box-shadow: 0 0 3px rgba(251, 228, 113, 0.4); +} +#commentform input[type="text"], #contactForm input[type="text"], #commentform input[type="password"], #contactForm input[type="password"] { + margin-bottom: 10px; + margin-top: 10px; + overflow: hidden; + width: 50%; +} +#commentform textarea, #contactForm textarea { + height: 230px; + margin-bottom: 10px; + margin-top: 10px; + width: 93.1818%; +} +#commentform input[type="submit"], #contactForm input[type="submit"], #commentform input[type="button"], #contactForm input[type="button"] { + background: none repeat scroll 0 0 #333333; + -moz-box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.1); + box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.1); + color: #009899; + cursor: pointer; + font-size: 14px; + padding: 10px 15px; + -webkit-transition: all 0.3s ease 0s; + -moz-transition: all 0.3s ease 0s; + -o-transition: all 0.3s ease 0s; + transition: all 0.3s ease 0s; + width: auto; +} +#commentform input[type="submit"]:hover, #contactForm input[type="submit"]:hover, #commentform input[type="button"]:hover, #contactForm input[type="button"]:hover { + -webkit-transform: translate(0px, -5px); + -moz-transform: translate(0px, -5px); + -ms-transform: translate(0px, -5px); + -o-transform: translate(0px, -5px); + transform: translate(0px, -5px); +} +#commentform input#submit, #contactForm input#submit { + margin-top: 7px; +} +#commentform label, #contactForm label { + display: block; + margin-bottom: -10px; +} +#commentform p, #contactForm p { + margin-bottom: 10px; +} +#commentform #error, #contactForm #error { + margin-left: 10px; +} +#commentform #sent-form-msg, #contactForm #sent-form-msg { + background: none repeat scroll 0 0 rgba(0, 0, 0, 0.1); + color: #444444; + margin-bottom: 40px; + padding: 5px 10px; +} +#contactForm #error { + display: none; +} +#contactForm #sent-form-msg { + display: none; +} +/*end forms*/ +/*end additional page fixes*/ \ No newline at end of file diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/superfish.css b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/superfish.css new file mode 100644 index 0000000..e3e0604 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/css/superfish.css @@ -0,0 +1,62 @@ +/*** ESSENTIAL STYLES ***/ + +.sf-menu, .sf-menu * { + margin: 0; + padding: 0; + list-style: none; +} +.sf-menu { + +} +.sf-menu ul { + position: absolute; + top: -999em; + width: 10em; /* left offset of submenus need to match (see below) */ + +} +.sf-menu ul li { + width: 100%; +} +.sf-menu li:hover { + visibility: inherit; /* fixes IE7 'sticky bug' */ +} +.sf-menu li { + float: left; + position: relative; +} +.sf-menu a { + display: block; + position: relative; +} +.sf-menu li:hover ul, +.sf-menu li.sfHover ul { + left: 0; + top: 2.5em; /* match top ul list item height */ + z-index: 99; +} +ul.sf-menu li:hover li ul, +ul.sf-menu li.sfHover li ul { + top: -999em; +} +ul.sf-menu li li:hover ul, +ul.sf-menu li li.sfHover ul { + left: 10em; /* match ul width */ + top: 0; +} +ul.sf-menu li li:hover li ul, +ul.sf-menu li li.sfHover li ul { + top: -999em; +} +ul.sf-menu li li li:hover ul, +ul.sf-menu li li li.sfHover ul { + left: 10em; /* match ul width */ + top: 0; +} + + + + + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.eot b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.eot new file mode 100644 index 0000000..f33f41e Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.eot differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.svg b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.svg new file mode 100644 index 0000000..100e03e --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.ttf b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.ttf new file mode 100644 index 0000000..49aaa22 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.ttf differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.woff b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.woff new file mode 100644 index 0000000..bffd795 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/fonts/mensch-webfont.woff differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/banner-one.jpg b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/banner-one.jpg new file mode 100644 index 0000000..35b59ea Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/banner-one.jpg differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/banner-two.jpg b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/banner-two.jpg new file mode 100644 index 0000000..d8ff09e Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/banner-two.jpg differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bird.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bird.png new file mode 100644 index 0000000..2bf8da0 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bird.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/breadcrumb-separator.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/breadcrumb-separator.png new file mode 100644 index 0000000..cb4205a Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/breadcrumb-separator.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/arrow.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/arrow.png new file mode 100644 index 0000000..49fa15b Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/arrow.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/check.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/check.png new file mode 100644 index 0000000..2b89e90 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/check.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/heart.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/heart.png new file mode 100644 index 0000000..84058bf Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/heart.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/plus.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/plus.png new file mode 100644 index 0000000..b5c2787 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/plus.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/star.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/star.png new file mode 100644 index 0000000..b60f004 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/bullets/star.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-eagle-small.jpg b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-eagle-small.jpg new file mode 100644 index 0000000..b801c9f Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-eagle-small.jpg differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-otay-small.jpg b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-otay-small.jpg new file mode 100644 index 0000000..742286f Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-otay-small.jpg differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-spruce-small.jpg b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-spruce-small.jpg new file mode 100644 index 0000000..5964e7d Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/communities-spruce-small.jpg differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/divider-tagline.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/divider-tagline.png new file mode 100644 index 0000000..ceddb8b Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/divider-tagline.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/homes-small-one.jpg b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/homes-small-one.jpg new file mode 100644 index 0000000..063f1d1 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/homes-small-one.jpg differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-arrows-vert.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-arrows-vert.png new file mode 100644 index 0000000..5421e69 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-arrows-vert.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-arrows.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-arrows.png new file mode 100644 index 0000000..61cf789 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-arrows.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-bird.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-bird.png new file mode 100644 index 0000000..d43b076 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-bird.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-close.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-close.png new file mode 100644 index 0000000..cf12114 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-close.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-contact.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-contact.png new file mode 100644 index 0000000..08c38c2 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-contact.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-home.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-home.png new file mode 100644 index 0000000..2270652 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-home.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-homes-home.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-homes-home.png new file mode 100644 index 0000000..c4de9f6 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-homes-home.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-homes-view.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-homes-view.png new file mode 100644 index 0000000..baf47c5 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-homes-view.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-login.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-login.png new file mode 100644 index 0000000..aee3f2a Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-login.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-register.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-register.png new file mode 100644 index 0000000..09f8164 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-register.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-search.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-search.png new file mode 100644 index 0000000..e9bc5f6 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-search.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-photos.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-photos.png new file mode 100644 index 0000000..d6742e2 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-photos.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-tour.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-tour.png new file mode 100644 index 0000000..d6eb9b6 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-tour.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-video.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-video.png new file mode 100644 index 0000000..4372605 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/icon-view-video.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-blue.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-blue.png new file mode 100644 index 0000000..2ae51ba Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-blue.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-green.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-green.png new file mode 100644 index 0000000..7b55dc3 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-green.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-red.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-red.png new file mode 100644 index 0000000..40dada1 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-red.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-yellow.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-yellow.png new file mode 100644 index 0000000..aff3fbc Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/info-yellow.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/loading.gif b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/loading.gif new file mode 100644 index 0000000..bec7034 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/loading.gif differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/logo.gif b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/logo.gif new file mode 100644 index 0000000..abe36e8 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/logo.gif differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/500px.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/500px.png new file mode 100644 index 0000000..b0b5651 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/500px.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/AddThis.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/AddThis.png new file mode 100644 index 0000000..b4908db Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/AddThis.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Behance.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Behance.png new file mode 100644 index 0000000..601d25e Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Behance.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Blogger.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Blogger.png new file mode 100644 index 0000000..3ac7343 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Blogger.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Deliciou.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Deliciou.png new file mode 100644 index 0000000..ac1d8a3 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Deliciou.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/DeviantART.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/DeviantART.png new file mode 100644 index 0000000..db69615 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/DeviantART.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Digg.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Digg.png new file mode 100644 index 0000000..b4943ba Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Digg.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Dopplr.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Dopplr.png new file mode 100644 index 0000000..af86614 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Dopplr.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Dribbble.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Dribbble.png new file mode 100644 index 0000000..961de0b Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Dribbble.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Evernote.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Evernote.png new file mode 100644 index 0000000..562303b Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Evernote.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Facebook.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Facebook.png new file mode 100644 index 0000000..5e1df8f Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Facebook.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Flickr.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Flickr.png new file mode 100644 index 0000000..405968b Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Flickr.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Forrst.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Forrst.png new file mode 100644 index 0000000..d9dab97 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Forrst.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/GitHub.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/GitHub.png new file mode 100644 index 0000000..560ea6e Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/GitHub.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Google+.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Google+.png new file mode 100644 index 0000000..77c8956 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Google+.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Grooveshark.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Grooveshark.png new file mode 100644 index 0000000..074d8dd Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Grooveshark.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Instagram.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Instagram.png new file mode 100644 index 0000000..3842905 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Instagram.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Lastfm.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Lastfm.png new file mode 100644 index 0000000..3431912 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Lastfm.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/LinkedIn.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/LinkedIn.png new file mode 100644 index 0000000..499d64d Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/LinkedIn.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Mail.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Mail.png new file mode 100644 index 0000000..e3c3f48 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Mail.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/MySpace.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/MySpace.png new file mode 100644 index 0000000..875dc97 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/MySpace.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Path.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Path.png new file mode 100644 index 0000000..0787bea Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Path.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Paypal.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Paypal.png new file mode 100644 index 0000000..b6ef1c2 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Paypal.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Picasa.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Picasa.png new file mode 100644 index 0000000..2a68ce0 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Picasa.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Posterous.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Posterous.png new file mode 100644 index 0000000..c769b7e Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Posterous.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/RSS.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/RSS.png new file mode 100644 index 0000000..ca00b93 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/RSS.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Reddit.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Reddit.png new file mode 100644 index 0000000..dfbd246 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Reddit.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/ShareThis.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/ShareThis.png new file mode 100644 index 0000000..1e23f1b Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/ShareThis.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Skype.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Skype.png new file mode 100644 index 0000000..a4b8ede Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Skype.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Soundcloud.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Soundcloud.png new file mode 100644 index 0000000..5c7f178 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Soundcloud.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Spotify.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Spotify.png new file mode 100644 index 0000000..8870cf5 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Spotify.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/StumbleUpon.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/StumbleUpon.png new file mode 100644 index 0000000..099ca00 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/StumbleUpon.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Tumblr.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Tumblr.png new file mode 100644 index 0000000..bc35d5a Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Tumblr.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Twitter.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Twitter.png new file mode 100644 index 0000000..2b2335b Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Twitter.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Viddler.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Viddler.png new file mode 100644 index 0000000..9a68867 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Viddler.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Vimeo.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Vimeo.png new file mode 100644 index 0000000..57fe99f Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Vimeo.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Virb.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Virb.png new file mode 100644 index 0000000..02f5e56 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Virb.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Windows.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Windows.png new file mode 100644 index 0000000..4202706 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Windows.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/WordPress.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/WordPress.png new file mode 100644 index 0000000..9b72d37 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/WordPress.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/YouTube.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/YouTube.png new file mode 100644 index 0000000..d6ea08d Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/YouTube.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Zerply.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Zerply.png new file mode 100644 index 0000000..04f93f7 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/social/Zerply.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/breadcrumb-separator.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/breadcrumb-separator.psd new file mode 100644 index 0000000..c88358c Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/breadcrumb-separator.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/communities-small.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/communities-small.psd new file mode 100644 index 0000000..ad729eb Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/communities-small.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/divider-tagline.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/divider-tagline.psd new file mode 100644 index 0000000..43f9d82 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/divider-tagline.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/homes-small.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/homes-small.psd new file mode 100644 index 0000000..b582989 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/homes-small.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-arrows-vert.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-arrows-vert.psd new file mode 100644 index 0000000..866ae62 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-arrows-vert.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-arrows.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-arrows.psd new file mode 100644 index 0000000..12c58de Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-arrows.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-bird.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-bird.psd new file mode 100644 index 0000000..f1145da Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-bird.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-contact.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-contact.psd new file mode 100644 index 0000000..2b97e9a Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-contact.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-home.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-home.psd new file mode 100644 index 0000000..bfdbbed Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-home.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-homes.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-homes.psd new file mode 100644 index 0000000..3b0beb6 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-homes.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-search.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-search.psd new file mode 100644 index 0000000..685277e Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-search.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-site-access.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-site-access.psd new file mode 100644 index 0000000..0820a74 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-site-access.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-view.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-view.psd new file mode 100644 index 0000000..e227835 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/icon-view.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/logo.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/logo.psd new file mode 100644 index 0000000..b945259 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/logo.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/rotating-banner.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/rotating-banner.psd new file mode 100644 index 0000000..33d12a5 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/rotating-banner.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/toggle-simple.psd b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/toggle-simple.psd new file mode 100644 index 0000000..4328c35 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/source/toggle-simple.psd differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/toggle-simple.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/toggle-simple.png new file mode 100644 index 0000000..5c85cc2 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/toggle-simple.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/toggle.png b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/toggle.png new file mode 100644 index 0000000..5c85cc2 Binary files /dev/null and b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/img/toggle.png differ diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/index.html b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/index.html new file mode 100644 index 0000000..231e8ea --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/index.html @@ -0,0 +1,273 @@ + + + + + + + + + Specter Group HTML Version + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Better Homes

+

Stronger Communities

+
+ + +
+ +
+ + + + + + + +
+
+ + +
+
+
+ + +
+
+ + + +
+

Welcome to Specter Group

+

A Premier Builder Service Eastern Atlantis

+
+ + + +
+

Communities

+
    +
  • + Eagle VistaEagle Vista +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

    +
  • +
  • + Spruce MeadowsSpruce Meadows +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

    +
  • +
  • + Otay CrossingsOtay Crossings +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at, venenatis sit amet elit. Nullam tempor interdum nisi.

    +
  • +
+
+ + + +
+

Our Homes

+
+
+
+
+ Home + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas massa arcu, posuere eget hendrerit at. + Learn More + +
+
+
+
+ +
+
+
+ + + +
+
+ + + + + diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/js/hoverIntent.js b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/js/hoverIntent.js new file mode 100644 index 0000000..91da57b --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/js/hoverIntent.js @@ -0,0 +1,84 @@ +(function($){ + /* hoverIntent by Brian Cherne */ + $.fn.hoverIntent = function(f,g) { + // default configuration options + var cfg = { + sensitivity: 7, + interval: 100, + timeout: 0 + }; + // override configuration options with user supplied object + cfg = $.extend(cfg, g ? { over: f, out: g } : f ); + + // instantiate variables + // cX, cY = current X and Y position of mouse, updated by mousemove event + // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval + var cX, cY, pX, pY; + + // A private function for getting mouse position + var track = function(ev) { + cX = ev.pageX; + cY = ev.pageY; + }; + + // A private function for comparing current and previous mouse position + var compare = function(ev,ob) { + ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); + // compare mouse positions to see if they've crossed the threshold + if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { + $(ob).unbind("mousemove",track); + // set hoverIntent state to true (so mouseOut can be called) + ob.hoverIntent_s = 1; + return cfg.over.apply(ob,[ev]); + } else { + // set previous coordinates for next time + pX = cX; pY = cY; + // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) + ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); + } + }; + + // A private function for delaying the mouseOut function + var delay = function(ev,ob) { + ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); + ob.hoverIntent_s = 0; + return cfg.out.apply(ob,[ev]); + }; + + // A private function for handling mouse 'hovering' + var handleHover = function(e) { + // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut + var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; + while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } } + if ( p == this ) { return false; } + + // copy objects to be passed into t (required for event object to be passed in IE) + var ev = jQuery.extend({},e); + var ob = this; + + // cancel hoverIntent timer if it exists + if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } + + // else e.type == "onmouseover" + if (e.type == "mouseover") { + // set "previous" X and Y position based on initial entry point + pX = ev.pageX; pY = ev.pageY; + // update "current" X and Y position based on mousemove + $(ob).bind("mousemove",track); + // start polling interval (self-calling timeout) to compare mouse coordinates over time + if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} + + // else e.type == "onmouseout" + } else { + // unbind expensive mousemove event + $(ob).unbind("mousemove",track); + // if hoverIntent state is true, then call the mouseOut function after the specified delay + if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} + } + }; + + // bind the function to the two event listeners + return this.mouseover(handleHover).mouseout(handleHover); + }; + +})(jQuery); \ No newline at end of file diff --git a/BookSourceCode/Chapter 4 - HTML Template/HTML Template/js/jquery-1.9.1.min.js b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/js/jquery-1.9.1.min.js new file mode 100644 index 0000000..006e953 --- /dev/null +++ b/BookSourceCode/Chapter 4 - HTML Template/HTML Template/js/jquery-1.9.1.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery.min.map +*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="
t
",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; +return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="
",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) +}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("