├── LICENSE
├── README.md
├── ajaximage.php
├── class.ImageFilter.php
├── db.php
├── index.php
├── loader.gif
└── scripts
├── jquery.form.js
├── jquery.min.js
└── jquery.wallform.js
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 David Garcia
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PHP nudity and porn image detector
2 |
3 | PHP code by Bakr Alsharif from Egypt:
4 | http://www.9lessons.info/2014/01/block-uploads-of-adult-or-nude-images.html
5 |
6 | Live demo:
7 | http://demos.9lessons.info/ajaximageupload/index_m_block.php
8 |
9 | ## Block Uploads of Adult or Nude Images using PHP.
10 |
11 | I found an interesting and useful class file in phpclasses.org, that helps to detect image nudity based on skin pixel score developed by Bakr Alsharif from Egypt. I had integrated this with my previous tutorial Ajax image upload with Jquery and PHP, sure this code helps you to block adult or nudity images.
12 |
13 | ### Sample database design for Users.
14 |
15 | **Users**
16 | Contains user details username, password and email etc.
17 | ```sql
18 | CREATE TABLE `users` (
19 | `uid` int(11) AUTO_INCREMENT PRIMARY KEY,
20 | `username` varchar(255) UNIQUE KEY,
21 | `password` varchar(100),
22 | `email` varchar(255) UNIQUE KEY
23 | )
24 | ```
25 | Sample values:
26 | ```sql
27 | INSERT INTO `users`
28 | (`uid`, `username`, `password`, `email`)
29 | VALUES
30 | ('1', '9lessons', MD5('password'), 'srinivas@9lessons.info');
31 | ```
32 |
33 | ### Javascript Code
34 |
35 | `$("#photoimg").on('change',function(){})`
36 | - photoimg is the ID name of INPUT FILE tag and
37 |
38 | `$('#imageform').ajaxForm()`
39 | - imageform is the ID name of FORM.
40 |
41 | While changing INPUT it calls FORM submit without refreshing page using `ajaxForm()` method. Uploaded images will `prepend` inside `#preview` tag.
42 |
43 | ```html
44 |
46 |
47 |
73 | ```
74 |
75 | Here hiding and showing `#imageloadstatus` and `#imageloadbutton` based on form upload submit status.
76 |
77 | ### PHP Code
78 |
79 | **index.php**
80 | Contains simple PHP and HTML code. Here `$session_id=1` means user id session value.
81 | ```php
82 |
87 |
88 |
89 |
97 | ```
98 |
99 | **ajaximage.php**
100 | Contains PHP code. This script helps you to upload images into `uploads` folder. Image file name rename into `timestamp+session_id.extention`
101 | ```php
102 | GetScore($_FILES['photoimg']['tmp_name']);
136 | if(isset($score))
137 | {
138 | if($score >= 60) // Score value If more than 60%, it consider as adult image.
139 | {
140 | echo "Image scored ".$score."%, It seems that you have uploaded a nude picture :-(";
141 | }
142 | else
143 | {
144 | //---Image Filter Code
145 | $actual_image_name = time().$session_id.".".$ext;
146 | $tmp = $_FILES['photoimg']['tmp_name'];
147 | if(move_uploaded_file($tmp, $path.$actual_image_name))
148 | {
149 | mysqli_query($connection,"UPDATE users SET profile_image='$actual_image_name' WHERE uid='$session_id'");
150 | echo " ";
151 | }
152 | else
153 | echo "failed";
154 | //---Image Filter Code
155 | }
156 | }
157 | //---Image Filter Code
158 | }
159 | else
160 | echo "Image file size max 1 MB";
161 | }
162 | else
163 | echo "Invalid file format..";
164 | }
165 | else
166 | echo "Please select image..!";
167 | exit;
168 | }
169 | ?>
170 | ```
171 |
172 | **db.php**
173 | Database configuration file, just modify database credentials.
174 | ```php
175 |
183 | ```
184 |
185 |
--------------------------------------------------------------------------------
/ajaximage.php:
--------------------------------------------------------------------------------
1 | GetScore($_FILES['photoimg']['tmp_name']);
31 |
32 | if (isset($score)) {
33 | if ($score >= 40) {
34 | echo "Image scored ".$score."%, It seems that you have uploaded a nude picture :-(";
35 | } else {
36 |
37 | //---------
38 | $actual_image_name = time().".".$ext;
39 | $tmp = $_FILES['photoimg']['tmp_name'];
40 | if (move_uploaded_file($tmp, $path.$actual_image_name)) {
41 | mysqli_query($connection, "UPDATE users SET profile_image='$actual_image_name' WHERE uid='$session_id'");
42 |
43 | echo " ";
44 | } else {
45 | echo "Fail upload folder with read access.";
46 | }
47 | //--------
48 | }
49 | }
50 | } else {
51 | echo "Image file size max 1 MB";
52 | }
53 | } else {
54 | echo "Invalid file format..";
55 | }
56 | } else {
57 | echo "Please select image..!";
58 | }
59 |
60 | exit;
61 | }
62 |
--------------------------------------------------------------------------------
/class.ImageFilter.php:
--------------------------------------------------------------------------------
1 | arA['R'] = ($this->colorA >> 16) & 0xFF;
39 | $this->arA['G'] = ($this->colorA >> 8) & 0xFF;
40 | $this->arA['B'] = $this->colorA & 0xFF;
41 |
42 | $this->arB['R'] = ($this->colorB >> 16) & 0xFF;
43 | $this->arB['G'] = ($this->colorB >> 8) & 0xFF;
44 | $this->arB['B'] = $this->colorB & 0xFF;
45 | }
46 |
47 | public function GetScore($image)
48 | {
49 | $x = 0;
50 | $y = 0;
51 | $img = $this->_GetImageResource($image, $x, $y);
52 | if (!$img) {
53 | return false;
54 | }
55 |
56 | $score = 0;
57 |
58 | $xPoints = array($x/8, $x/4, ($x/8 + $x/4), $x-($x/8 + $x/4), $x-($x/4), $x-($x/8));
59 | $yPoints = array($y/8, $y/4, ($y/8 + $y/4), $y-($y/8 + $y/4), $y-($y/8), $y-($y/8));
60 | $zPoints = array($xPoints[2], $yPoints[1], $xPoints[3], $y);
61 |
62 |
63 | for ($i=1; $i<=$x; $i++) {
64 | for ($j=1; $j<=$y; $j++) {
65 | $color = imagecolorat($img, $i, $j);
66 | if ($color >= $this->colorA && $color <= $this->colorB) {
67 | $color = array('R'=> ($color >> 16) & 0xFF, 'G'=> ($color >> 8) & 0xFF, 'B'=> $color & 0xFF);
68 | if ($color['G'] >= $this->arA['G'] && $color['G'] <= $this->arB['G'] && $color['B'] >= $this->arA['B'] && $color['B'] <= $this->arB['B']) {
69 | if ($i >= $zPoints[0] && $j >= $zPoints[1] && $i <= $zPoints[2] && $j <= $zPoints[3]) {
70 | $score += 3;
71 | } elseif ($i <= $xPoints[0] || $i >=$xPoints[5] || $j <= $yPoints[0] || $j >= $yPoints[5]) {
72 | $score += 0.10;
73 | } elseif ($i <= $xPoints[0] || $i >=$xPoints[4] || $j <= $yPoints[0] || $j >= $yPoints[4]) {
74 | $score += 0.40;
75 | } else {
76 | $score += 1.50;
77 | }
78 | }
79 | }
80 | }
81 | }
82 |
83 | imagedestroy($img);
84 |
85 | $score = sprintf('%01.2f', ($score * 100) / ($x * $y));
86 | if ($score > 100) {
87 | $score = 100;
88 | }
89 | return $score;
90 | }
91 |
92 | public function GetScoreAndFill($image, $outputImage)
93 | {
94 | $x = 0;
95 | $y = 0;
96 | $img = $this->_GetImageResource($image, $x, $y);
97 | if (!$img) {
98 | return false;
99 | }
100 |
101 | $score = 0;
102 |
103 | $xPoints = array($x/8, $x/4, ($x/8 + $x/4), $x-($x/8 + $x/4), $x-($x/4), $x-($x/8));
104 | $yPoints = array($y/8, $y/4, ($y/8 + $y/4), $y-($y/8 + $y/4), $y-($y/8), $y-($y/8));
105 | $zPoints = array($xPoints[2], $yPoints[1], $xPoints[3], $y);
106 |
107 |
108 | for ($i=1; $i<=$x; $i++) {
109 | for ($j=1; $j<=$y; $j++) {
110 | $color = imagecolorat($img, $i, $j);
111 | if ($color >= $this->colorA && $color <= $this->colorB) {
112 | $color = array('R'=> ($color >> 16) & 0xFF, 'G'=> ($color >> 8) & 0xFF, 'B'=> $color & 0xFF);
113 | if ($color['G'] >= $this->arA['G'] && $color['G'] <= $this->arB['G'] && $color['B'] >= $this->arA['B'] && $color['B'] <= $this->arB['B']) {
114 | if ($i >= $zPoints[0] && $j >= $zPoints[1] && $i <= $zPoints[2] && $j <= $zPoints[3]) {
115 | $score += 3;
116 | imagefill($img, $i, $j, 16711680);
117 | } elseif ($i <= $xPoints[0] || $i >=$xPoints[5] || $j <= $yPoints[0] || $j >= $yPoints[5]) {
118 | $score += 0.10;
119 | imagefill($img, $i, $j, 14540253);
120 | } elseif ($i <= $xPoints[0] || $i >=$xPoints[4] || $j <= $yPoints[0] || $j >= $yPoints[4]) {
121 | $score += 0.40;
122 | imagefill($img, $i, $j, 16514887);
123 | } else {
124 | $score += 1.50;
125 | imagefill($img, $i, $j, 512);
126 | }
127 | }
128 | }
129 | }
130 | }
131 | imagejpeg($img, $outputImage);
132 |
133 | imagedestroy($img);
134 |
135 | $score = sprintf('%01.2f', ($score * 100) / ($x * $y));
136 | if ($score > 100) {
137 | $score = 100;
138 | }
139 | return $score;
140 | }
141 |
142 | public function _GetImageResource($image, &$x, &$y)
143 | {
144 | $info = GetImageSize($image);
145 |
146 | $x = $info[0];
147 | $y = $info[1];
148 |
149 | switch ($info[2]) {
150 | case IMAGETYPE_GIF:
151 | return @ImageCreateFromGif($image);
152 |
153 | case IMAGETYPE_JPEG:
154 | return @ImageCreateFromJpeg($image);
155 |
156 | case IMAGETYPE_PNG:
157 | return @ImageCreateFromPng($image);
158 |
159 | default:
160 | return false;
161 | }
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/db.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | Ajax Image Upload Block Adult Images 9lessons blog
9 |
10 |
11 |
12 |
13 |
14 |
42 |
43 |
62 |
63 | 9lessons.info
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DavidGarciaCat/php-nudity-image-detector/0e860bd77e7755ecf0b3d3b11d7bade6b4f5af64/loader.gif
--------------------------------------------------------------------------------
/scripts/jquery.form.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery Form Plugin
3 | * version: 2.84 (12-AUG-2011)
4 | * @requires jQuery v1.3.2 or later
5 | *
6 | * Examples and documentation at: http://malsup.com/jquery/form/
7 | * Dual licensed under the MIT and GPL licenses:
8 | * http://www.opensource.org/licenses/mit-license.php
9 | * http://www.gnu.org/licenses/gpl.html
10 | */
11 | ;(function($) {
12 |
13 | /*
14 | Usage Note:
15 | -----------
16 | Do not use both ajaxSubmit and ajaxForm on the same form. These
17 | functions are intended to be exclusive. Use ajaxSubmit if you want
18 | to bind your own submit handler to the form. For example,
19 |
20 | $(document).ready(function() {
21 | $('#myForm').bind('submit', function(e) {
22 | e.preventDefault(); // <-- important
23 | $(this).ajaxSubmit({
24 | target: '#output'
25 | });
26 | });
27 | });
28 |
29 | Use ajaxForm when you want the plugin to manage all the event binding
30 | for you. For example,
31 |
32 | $(document).ready(function() {
33 | $('#myForm').ajaxForm({
34 | target: '#output'
35 | });
36 | });
37 |
38 | When using ajaxForm, the ajaxSubmit function will be invoked for you
39 | at the appropriate time.
40 | */
41 |
42 | /**
43 | * ajaxSubmit() provides a mechanism for immediately submitting
44 | * an HTML form using AJAX.
45 | */
46 | $.fn.ajaxSubmit = function(options) {
47 | // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
48 | if (!this.length) {
49 | log('ajaxSubmit: skipping submit process - no element selected');
50 | return this;
51 | }
52 |
53 | var method, action, url, $form = this;
54 |
55 | if (typeof options == 'function') {
56 | options = { success: options };
57 | }
58 |
59 | method = this.attr('method');
60 | action = this.attr('action');
61 | url = (typeof action === 'string') ? $.trim(action) : '';
62 | url = url || window.location.href || '';
63 | if (url) {
64 | // clean url (don't include hash vaue)
65 | url = (url.match(/^([^#]+)/)||[])[1];
66 | }
67 |
68 | options = $.extend(true, {
69 | url: url,
70 | success: $.ajaxSettings.success,
71 | type: method || 'GET',
72 | iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
73 | }, options);
74 |
75 | // hook for manipulating the form data before it is extracted;
76 | // convenient for use with rich editors like tinyMCE or FCKEditor
77 | var veto = {};
78 | this.trigger('form-pre-serialize', [this, options, veto]);
79 | if (veto.veto) {
80 | log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
81 | return this;
82 | }
83 |
84 | // provide opportunity to alter form data before it is serialized
85 | if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
86 | log('ajaxSubmit: submit aborted via beforeSerialize callback');
87 | return this;
88 | }
89 |
90 | var n,v,a = this.formToArray(options.semantic);
91 | if (options.data) {
92 | options.extraData = options.data;
93 | for (n in options.data) {
94 | if( $.isArray(options.data[n]) ) {
95 | for (var k in options.data[n]) {
96 | a.push( { name: n, value: options.data[n][k] } );
97 | }
98 | }
99 | else {
100 | v = options.data[n];
101 | v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
102 | a.push( { name: n, value: v } );
103 | }
104 | }
105 | }
106 |
107 | // give pre-submit callback an opportunity to abort the submit
108 | if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
109 | log('ajaxSubmit: submit aborted via beforeSubmit callback');
110 | return this;
111 | }
112 |
113 | // fire vetoable 'validate' event
114 | this.trigger('form-submit-validate', [a, this, options, veto]);
115 | if (veto.veto) {
116 | log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
117 | return this;
118 | }
119 |
120 | var q = $.param(a);
121 |
122 | if (options.type.toUpperCase() == 'GET') {
123 | options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
124 | options.data = null; // data is null for 'get'
125 | }
126 | else {
127 | options.data = q; // data is the query string for 'post'
128 | }
129 |
130 | var callbacks = [];
131 | if (options.resetForm) {
132 | callbacks.push(function() { $form.resetForm(); });
133 | }
134 | if (options.clearForm) {
135 | callbacks.push(function() { $form.clearForm(); });
136 | }
137 |
138 | // perform a load on the target only if dataType is not provided
139 | if (!options.dataType && options.target) {
140 | var oldSuccess = options.success || function(){};
141 | callbacks.push(function(data) {
142 | var fn = options.replaceTarget ? 'replaceWith' : 'html';
143 | $(options.target)[fn](data).each(oldSuccess, arguments);
144 | });
145 | }
146 | else if (options.success) {
147 | callbacks.push(options.success);
148 | }
149 |
150 | options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
151 | var context = options.context || options; // jQuery 1.4+ supports scope context
152 | for (var i=0, max=callbacks.length; i < max; i++) {
153 | callbacks[i].apply(context, [data, status, xhr || $form, $form]);
154 | }
155 | };
156 |
157 | // are there files to upload?
158 | var fileInputs = $('input:file', this).length > 0;
159 | var mp = 'multipart/form-data';
160 | var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
161 |
162 | // options.iframe allows user to force iframe mode
163 | // 06-NOV-09: now defaulting to iframe mode if file input is detected
164 | if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
165 | // hack to fix Safari hang (thanks to Tim Molendijk for this)
166 | // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
167 | if (options.closeKeepAlive) {
168 | $.get(options.closeKeepAlive, function() { fileUpload(a); });
169 | }
170 | else {
171 | fileUpload(a);
172 | }
173 | }
174 | else {
175 | // IE7 massage (see issue 57)
176 | if ($.browser.msie && method == 'get') {
177 | var ieMeth = $form[0].getAttribute('method');
178 | if (typeof ieMeth === 'string')
179 | options.type = ieMeth;
180 | }
181 | $.ajax(options);
182 | }
183 |
184 | // fire 'notify' event
185 | this.trigger('form-submit-notify', [this, options]);
186 | return this;
187 |
188 |
189 | // private function for handling file uploads (hat tip to YAHOO!)
190 | function fileUpload(a) {
191 | var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
192 | var useProp = !!$.fn.prop;
193 |
194 | if (a) {
195 | // ensure that every serialized input is still enabled
196 | for (i=0; i < a.length; i++) {
197 | el = $(form[a[i].name]);
198 | el[ useProp ? 'prop' : 'attr' ]('disabled', false);
199 | }
200 | }
201 |
202 | if ($(':input[name=submit],:input[id=submit]', form).length) {
203 | // if there is an input with a name or id of 'submit' then we won't be
204 | // able to invoke the submit fn on the form (at least not x-browser)
205 | alert('Error: Form elements must not have name or id of "submit".');
206 | return;
207 | }
208 |
209 | s = $.extend(true, {}, $.ajaxSettings, options);
210 | s.context = s.context || s;
211 | id = 'jqFormIO' + (new Date().getTime());
212 | if (s.iframeTarget) {
213 | $io = $(s.iframeTarget);
214 | n = $io.attr('name');
215 | if (n == null)
216 | $io.attr('name', id);
217 | else
218 | id = n;
219 | }
220 | else {
221 | $io = $('');
222 | $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
223 | }
224 | io = $io[0];
225 |
226 |
227 | xhr = { // mock object
228 | aborted: 0,
229 | responseText: null,
230 | responseXML: null,
231 | status: 0,
232 | statusText: 'n/a',
233 | getAllResponseHeaders: function() {},
234 | getResponseHeader: function() {},
235 | setRequestHeader: function() {},
236 | abort: function(status) {
237 | var e = (status === 'timeout' ? 'timeout' : 'aborted');
238 | log('aborting upload... ' + e);
239 | this.aborted = 1;
240 | $io.attr('src', s.iframeSrc); // abort op in progress
241 | xhr.error = e;
242 | s.error && s.error.call(s.context, xhr, e, status);
243 | g && $.event.trigger("ajaxError", [xhr, s, e]);
244 | s.complete && s.complete.call(s.context, xhr, e);
245 | }
246 | };
247 |
248 | g = s.global;
249 | // trigger ajax global events so that activity/block indicators work like normal
250 | if (g && ! $.active++) {
251 | $.event.trigger("ajaxStart");
252 | }
253 | if (g) {
254 | $.event.trigger("ajaxSend", [xhr, s]);
255 | }
256 |
257 | if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
258 | if (s.global) {
259 | $.active--;
260 | }
261 | return;
262 | }
263 | if (xhr.aborted) {
264 | return;
265 | }
266 |
267 | // add submitting element to data if we know it
268 | sub = form.clk;
269 | if (sub) {
270 | n = sub.name;
271 | if (n && !sub.disabled) {
272 | s.extraData = s.extraData || {};
273 | s.extraData[n] = sub.value;
274 | if (sub.type == "image") {
275 | s.extraData[n+'.x'] = form.clk_x;
276 | s.extraData[n+'.y'] = form.clk_y;
277 | }
278 | }
279 | }
280 |
281 | var CLIENT_TIMEOUT_ABORT = 1;
282 | var SERVER_ABORT = 2;
283 |
284 | function getDoc(frame) {
285 | var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
286 | return doc;
287 | }
288 |
289 | // take a breath so that pending repaints get some cpu time before the upload starts
290 | function doSubmit() {
291 | // make sure form attrs are set
292 | var t = $form.attr('target'), a = $form.attr('action');
293 |
294 | // update form attrs in IE friendly way
295 | form.setAttribute('target',id);
296 | if (!method) {
297 | form.setAttribute('method', 'POST');
298 | }
299 | if (a != s.url) {
300 | form.setAttribute('action', s.url);
301 | }
302 |
303 | // ie borks in some cases when setting encoding
304 | if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
305 | $form.attr({
306 | encoding: 'multipart/form-data',
307 | enctype: 'multipart/form-data'
308 | });
309 | }
310 |
311 | // support timout
312 | if (s.timeout) {
313 | timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
314 | }
315 |
316 | // look for server aborts
317 | function checkState() {
318 | try {
319 | var state = getDoc(io).readyState;
320 | log('state = ' + state);
321 | if (state.toLowerCase() == 'uninitialized')
322 | setTimeout(checkState,50);
323 | }
324 | catch(e) {
325 | log('Server abort: ' , e, ' (', e.name, ')');
326 | cb(SERVER_ABORT);
327 | timeoutHandle && clearTimeout(timeoutHandle);
328 | timeoutHandle = undefined;
329 | }
330 | }
331 |
332 | // add "extra" data to form if provided in options
333 | var extraInputs = [];
334 | try {
335 | if (s.extraData) {
336 | for (var n in s.extraData) {
337 | extraInputs.push(
338 | $(' ').attr('value',s.extraData[n])
339 | .appendTo(form)[0]);
340 | }
341 | }
342 |
343 | if (!s.iframeTarget) {
344 | // add iframe to doc and submit the form
345 | $io.appendTo('body');
346 | io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
347 | }
348 | setTimeout(checkState,15);
349 | form.submit();
350 | }
351 | finally {
352 | // reset attrs and remove "extra" input elements
353 | form.setAttribute('action',a);
354 | if(t) {
355 | form.setAttribute('target', t);
356 | } else {
357 | $form.removeAttr('target');
358 | }
359 | $(extraInputs).remove();
360 | }
361 | }
362 |
363 | if (s.forceSync) {
364 | doSubmit();
365 | }
366 | else {
367 | setTimeout(doSubmit, 10); // this lets dom updates render
368 | }
369 |
370 | var data, doc, domCheckCount = 50, callbackProcessed;
371 |
372 | function cb(e) {
373 | if (xhr.aborted || callbackProcessed) {
374 | return;
375 | }
376 | try {
377 | doc = getDoc(io);
378 | }
379 | catch(ex) {
380 | log('cannot access response document: ', ex);
381 | e = SERVER_ABORT;
382 | }
383 | if (e === CLIENT_TIMEOUT_ABORT && xhr) {
384 | xhr.abort('timeout');
385 | return;
386 | }
387 | else if (e == SERVER_ABORT && xhr) {
388 | xhr.abort('server abort');
389 | return;
390 | }
391 |
392 | if (!doc || doc.location.href == s.iframeSrc) {
393 | // response not received yet
394 | if (!timedOut)
395 | return;
396 | }
397 | io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
398 |
399 | var status = 'success', errMsg;
400 | try {
401 | if (timedOut) {
402 | throw 'timeout';
403 | }
404 |
405 | var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
406 | log('isXml='+isXml);
407 | if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
408 | if (--domCheckCount) {
409 | // in some browsers (Opera) the iframe DOM is not always traversable when
410 | // the onload callback fires, so we loop a bit to accommodate
411 | log('requeing onLoad callback, DOM not available');
412 | setTimeout(cb, 250);
413 | return;
414 | }
415 | // let this fall through because server response could be an empty document
416 | //log('Could not access iframe DOM after mutiple tries.');
417 | //throw 'DOMException: not available';
418 | }
419 |
420 | //log('response detected');
421 | var docRoot = doc.body ? doc.body : doc.documentElement;
422 | xhr.responseText = docRoot ? docRoot.innerHTML : null;
423 | xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
424 | if (isXml)
425 | s.dataType = 'xml';
426 | xhr.getResponseHeader = function(header){
427 | var headers = {'content-type': s.dataType};
428 | return headers[header];
429 | };
430 | // support for XHR 'status' & 'statusText' emulation :
431 | if (docRoot) {
432 | xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
433 | xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
434 | }
435 |
436 | var dt = s.dataType || '';
437 | var scr = /(json|script|text)/.test(dt.toLowerCase());
438 | if (scr || s.textarea) {
439 | // see if user embedded response in textarea
440 | var ta = doc.getElementsByTagName('textarea')[0];
441 | if (ta) {
442 | xhr.responseText = ta.value;
443 | // support for XHR 'status' & 'statusText' emulation :
444 | xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
445 | xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
446 | }
447 | else if (scr) {
448 | // account for browsers injecting pre around json response
449 | var pre = doc.getElementsByTagName('pre')[0];
450 | var b = doc.getElementsByTagName('body')[0];
451 | if (pre) {
452 | xhr.responseText = pre.textContent ? pre.textContent : pre.innerHTML;
453 | }
454 | else if (b) {
455 | xhr.responseText = b.innerHTML;
456 | }
457 | }
458 | }
459 | else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
460 | xhr.responseXML = toXml(xhr.responseText);
461 | }
462 |
463 | try {
464 | data = httpData(xhr, s.dataType, s);
465 | }
466 | catch (e) {
467 | status = 'parsererror';
468 | xhr.error = errMsg = (e || status);
469 | }
470 | }
471 | catch (e) {
472 | log('error caught: ',e);
473 | status = 'error';
474 | xhr.error = errMsg = (e || status);
475 | }
476 |
477 | if (xhr.aborted) {
478 | log('upload aborted');
479 | status = null;
480 | }
481 |
482 | if (xhr.status) { // we've set xhr.status
483 | status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
484 | }
485 |
486 | // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
487 | if (status === 'success') {
488 | s.success && s.success.call(s.context, data, 'success', xhr);
489 | g && $.event.trigger("ajaxSuccess", [xhr, s]);
490 | }
491 | else if (status) {
492 | if (errMsg == undefined)
493 | errMsg = xhr.statusText;
494 | s.error && s.error.call(s.context, xhr, status, errMsg);
495 | g && $.event.trigger("ajaxError", [xhr, s, errMsg]);
496 | }
497 |
498 | g && $.event.trigger("ajaxComplete", [xhr, s]);
499 |
500 | if (g && ! --$.active) {
501 | $.event.trigger("ajaxStop");
502 | }
503 |
504 | s.complete && s.complete.call(s.context, xhr, status);
505 |
506 | callbackProcessed = true;
507 | if (s.timeout)
508 | clearTimeout(timeoutHandle);
509 |
510 | // clean up
511 | setTimeout(function() {
512 | if (!s.iframeTarget)
513 | $io.remove();
514 | xhr.responseXML = null;
515 | }, 100);
516 | }
517 |
518 | var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
519 | if (window.ActiveXObject) {
520 | doc = new ActiveXObject('Microsoft.XMLDOM');
521 | doc.async = 'false';
522 | doc.loadXML(s);
523 | }
524 | else {
525 | doc = (new DOMParser()).parseFromString(s, 'text/xml');
526 | }
527 | return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
528 | };
529 | var parseJSON = $.parseJSON || function(s) {
530 | return window['eval']('(' + s + ')');
531 | };
532 |
533 | var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
534 |
535 | var ct = xhr.getResponseHeader('content-type') || '',
536 | xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
537 | data = xml ? xhr.responseXML : xhr.responseText;
538 |
539 | if (xml && data.documentElement.nodeName === 'parsererror') {
540 | $.error && $.error('parsererror');
541 | }
542 | if (s && s.dataFilter) {
543 | data = s.dataFilter(data, type);
544 | }
545 | if (typeof data === 'string') {
546 | if (type === 'json' || !type && ct.indexOf('json') >= 0) {
547 | data = parseJSON(data);
548 | } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
549 | $.globalEval(data);
550 | }
551 | }
552 | return data;
553 | };
554 | }
555 | };
556 |
557 | /**
558 | * ajaxForm() provides a mechanism for fully automating form submission.
559 | *
560 | * The advantages of using this method instead of ajaxSubmit() are:
561 | *
562 | * 1: This method will include coordinates for elements (if the element
563 | * is used to submit the form).
564 | * 2. This method will include the submit element's name/value data (for the element that was
565 | * used to submit the form).
566 | * 3. This method binds the submit() method to the form for you.
567 | *
568 | * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
569 | * passes the options argument along after properly binding events for submit elements and
570 | * the form itself.
571 | */
572 | $.fn.ajaxForm = function(options) {
573 | // in jQuery 1.3+ we can fix mistakes with the ready state
574 | if (this.length === 0) {
575 | var o = { s: this.selector, c: this.context };
576 | if (!$.isReady && o.s) {
577 | log('DOM not ready, queuing ajaxForm');
578 | $(function() {
579 | $(o.s,o.c).ajaxForm(options);
580 | });
581 | return this;
582 | }
583 | // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
584 | log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
585 | return this;
586 | }
587 |
588 | return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
589 | if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
590 | e.preventDefault();
591 | $(this).ajaxSubmit(options);
592 | }
593 | }).bind('click.form-plugin', function(e) {
594 | var target = e.target;
595 | var $el = $(target);
596 | if (!($el.is(":submit,input:image"))) {
597 | // is this a child element of the submit el? (ex: a span within a button)
598 | var t = $el.closest(':submit');
599 | if (t.length == 0) {
600 | return;
601 | }
602 | target = t[0];
603 | }
604 | var form = this;
605 | form.clk = target;
606 | if (target.type == 'image') {
607 | if (e.offsetX != undefined) {
608 | form.clk_x = e.offsetX;
609 | form.clk_y = e.offsetY;
610 | } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
611 | var offset = $el.offset();
612 | form.clk_x = e.pageX - offset.left;
613 | form.clk_y = e.pageY - offset.top;
614 | } else {
615 | form.clk_x = e.pageX - target.offsetLeft;
616 | form.clk_y = e.pageY - target.offsetTop;
617 | }
618 | }
619 | // clear form vars
620 | setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
621 | });
622 | };
623 |
624 | // ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
625 | $.fn.ajaxFormUnbind = function() {
626 | return this.unbind('submit.form-plugin click.form-plugin');
627 | };
628 |
629 | /**
630 | * formToArray() gathers form element data into an array of objects that can
631 | * be passed to any of the following ajax functions: $.get, $.post, or load.
632 | * Each object in the array has both a 'name' and 'value' property. An example of
633 | * an array for a simple login form might be:
634 | *
635 | * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
636 | *
637 | * It is this array that is passed to pre-submit callback functions provided to the
638 | * ajaxSubmit() and ajaxForm() methods.
639 | */
640 | $.fn.formToArray = function(semantic) {
641 | var a = [];
642 | if (this.length === 0) {
643 | return a;
644 | }
645 |
646 | var form = this[0];
647 | var els = semantic ? form.getElementsByTagName('*') : form.elements;
648 | if (!els) {
649 | return a;
650 | }
651 |
652 | var i,j,n,v,el,max,jmax;
653 | for(i=0, max=els.length; i < max; i++) {
654 | el = els[i];
655 | n = el.name;
656 | if (!n) {
657 | continue;
658 | }
659 |
660 | if (semantic && form.clk && el.type == "image") {
661 | // handle image inputs on the fly when semantic == true
662 | if(!el.disabled && form.clk == el) {
663 | a.push({name: n, value: $(el).val()});
664 | a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
665 | }
666 | continue;
667 | }
668 |
669 | v = $.fieldValue(el, true);
670 | if (v && v.constructor == Array) {
671 | for(j=0, jmax=v.length; j < jmax; j++) {
672 | a.push({name: n, value: v[j]});
673 | }
674 | }
675 | else if (v !== null && typeof v != 'undefined') {
676 | a.push({name: n, value: v});
677 | }
678 | }
679 |
680 | if (!semantic && form.clk) {
681 | // input type=='image' are not found in elements array! handle it here
682 | var $input = $(form.clk), input = $input[0];
683 | n = input.name;
684 | if (n && !input.disabled && input.type == 'image') {
685 | a.push({name: n, value: $input.val()});
686 | a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
687 | }
688 | }
689 | return a;
690 | };
691 |
692 | /**
693 | * Serializes form data into a 'submittable' string. This method will return a string
694 | * in the format: name1=value1&name2=value2
695 | */
696 | $.fn.formSerialize = function(semantic) {
697 | //hand off to jQuery.param for proper encoding
698 | return $.param(this.formToArray(semantic));
699 | };
700 |
701 | /**
702 | * Serializes all field elements in the jQuery object into a query string.
703 | * This method will return a string in the format: name1=value1&name2=value2
704 | */
705 | $.fn.fieldSerialize = function(successful) {
706 | var a = [];
707 | this.each(function() {
708 | var n = this.name;
709 | if (!n) {
710 | return;
711 | }
712 | var v = $.fieldValue(this, successful);
713 | if (v && v.constructor == Array) {
714 | for (var i=0,max=v.length; i < max; i++) {
715 | a.push({name: n, value: v[i]});
716 | }
717 | }
718 | else if (v !== null && typeof v != 'undefined') {
719 | a.push({name: this.name, value: v});
720 | }
721 | });
722 | //hand off to jQuery.param for proper encoding
723 | return $.param(a);
724 | };
725 |
726 | /**
727 | * Returns the value(s) of the element in the matched set. For example, consider the following form:
728 | *
729 | *
737 | *
738 | * var v = $(':text').fieldValue();
739 | * // if no values are entered into the text inputs
740 | * v == ['','']
741 | * // if values entered into the text inputs are 'foo' and 'bar'
742 | * v == ['foo','bar']
743 | *
744 | * var v = $(':checkbox').fieldValue();
745 | * // if neither checkbox is checked
746 | * v === undefined
747 | * // if both checkboxes are checked
748 | * v == ['B1', 'B2']
749 | *
750 | * var v = $(':radio').fieldValue();
751 | * // if neither radio is checked
752 | * v === undefined
753 | * // if first radio is checked
754 | * v == ['C1']
755 | *
756 | * The successful argument controls whether or not the field element must be 'successful'
757 | * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
758 | * The default value of the successful argument is true. If this value is false the value(s)
759 | * for each element is returned.
760 | *
761 | * Note: This method *always* returns an array. If no valid value can be determined the
762 | * array will be empty, otherwise it will contain one or more values.
763 | */
764 | $.fn.fieldValue = function(successful) {
765 | for (var val=[], i=0, max=this.length; i < max; i++) {
766 | var el = this[i];
767 | var v = $.fieldValue(el, successful);
768 | if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
769 | continue;
770 | }
771 | v.constructor == Array ? $.merge(val, v) : val.push(v);
772 | }
773 | return val;
774 | };
775 |
776 | /**
777 | * Returns the value of the field element.
778 | */
779 | $.fieldValue = function(el, successful) {
780 | var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
781 | if (successful === undefined) {
782 | successful = true;
783 | }
784 |
785 | if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
786 | (t == 'checkbox' || t == 'radio') && !el.checked ||
787 | (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
788 | tag == 'select' && el.selectedIndex == -1)) {
789 | return null;
790 | }
791 |
792 | if (tag == 'select') {
793 | var index = el.selectedIndex;
794 | if (index < 0) {
795 | return null;
796 | }
797 | var a = [], ops = el.options;
798 | var one = (t == 'select-one');
799 | var max = (one ? index+1 : ops.length);
800 | for(var i=(one ? index : 0); i < max; i++) {
801 | var op = ops[i];
802 | if (op.selected) {
803 | var v = op.value;
804 | if (!v) { // extra pain for IE...
805 | v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
806 | }
807 | if (one) {
808 | return v;
809 | }
810 | a.push(v);
811 | }
812 | }
813 | return a;
814 | }
815 | return $(el).val();
816 | };
817 |
818 | /**
819 | * Clears the form data. Takes the following actions on the form's input fields:
820 | * - input text fields will have their 'value' property set to the empty string
821 | * - select elements will have their 'selectedIndex' property set to -1
822 | * - checkbox and radio inputs will have their 'checked' property set to false
823 | * - inputs of type submit, button, reset, and hidden will *not* be effected
824 | * - button elements will *not* be effected
825 | */
826 | $.fn.clearForm = function() {
827 | return this.each(function() {
828 | $('input,select,textarea', this).clearFields();
829 | });
830 | };
831 |
832 | /**
833 | * Clears the selected form elements.
834 | */
835 | $.fn.clearFields = $.fn.clearInputs = function() {
836 | var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
837 | return this.each(function() {
838 | var t = this.type, tag = this.tagName.toLowerCase();
839 | if (re.test(t) || tag == 'textarea') {
840 | this.value = '';
841 | }
842 | else if (t == 'checkbox' || t == 'radio') {
843 | this.checked = false;
844 | }
845 | else if (tag == 'select') {
846 | this.selectedIndex = -1;
847 | }
848 | });
849 | };
850 |
851 | /**
852 | * Resets the form data. Causes all form elements to be reset to their original value.
853 | */
854 | $.fn.resetForm = function() {
855 | return this.each(function() {
856 | // guard against an input with the name of 'reset'
857 | // note that IE reports the reset function as an 'object'
858 | if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
859 | this.reset();
860 | }
861 | });
862 | };
863 |
864 | /**
865 | * Enables or disables any matching elements.
866 | */
867 | $.fn.enable = function(b) {
868 | if (b === undefined) {
869 | b = true;
870 | }
871 | return this.each(function() {
872 | this.disabled = !b;
873 | });
874 | };
875 |
876 | /**
877 | * Checks/unchecks any matching checkboxes or radio buttons and
878 | * selects/deselects and matching option elements.
879 | */
880 | $.fn.selected = function(select) {
881 | if (select === undefined) {
882 | select = true;
883 | }
884 | return this.each(function() {
885 | var t = this.type;
886 | if (t == 'checkbox' || t == 'radio') {
887 | this.checked = select;
888 | }
889 | else if (this.tagName.toLowerCase() == 'option') {
890 | var $sel = $(this).parent('select');
891 | if (select && $sel[0] && $sel[0].type == 'select-one') {
892 | // deselect all other options
893 | $sel.find('option').selected(false);
894 | }
895 | this.selected = select;
896 | }
897 | });
898 | };
899 |
900 | // helper fn for console logging
901 | function log() {
902 | var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
903 | if (window.console && window.console.log) {
904 | window.console.log(msg);
905 | }
906 | else if (window.opera && window.opera.postError) {
907 | window.opera.postError(msg);
908 | }
909 | };
910 |
911 | })(jQuery);
912 |
--------------------------------------------------------------------------------
/scripts/jquery.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v@1.8.1 jquery.com | jquery.org/license */
2 | (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.1",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;ba ",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,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%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0),h[l]&&j.push(k);j.length&&t.push({elem:f,matches:j})}n.length>o&&t.push({elem:this,matches:n.slice(o)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function $(a,b,c,d){c=c||[],b=b||q;var e,f,g,j,k=b.nodeType;if(k!==1&&k!==9)return[];if(!a||typeof a!="string")return c;g=h(b);if(!g&&!d)if(e=L.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&i(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return u.apply(c,t.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&X&&b.getElementsByClassName)return u.apply(c,t.call(b.getElementsByClassName(j),0)),c}return bk(a,b,c,d,g)}function _(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function ba(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bb(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bc(a,b,c,d){var e,g,h,i,j,k,l,m,n,p,r=!c&&b!==q,s=(r?"":"")+a.replace(H,"$1"),u=y[o][s];if(u)return d?0:t.call(u,0);j=a,k=[],m=0,n=f.preFilter,p=f.filter;while(j){if(!e||(g=I.exec(j)))g&&(j=j.slice(g[0].length),h.selector=l),k.push(h=[]),l="",r&&(j=" "+j);e=!1;if(g=J.exec(j))l+=g[0],j=j.slice(g[0].length),e=h.push({part:g.pop().replace(H," "),string:g[0],captures:g});for(i in p)(g=S[i].exec(j))&&(!n[i]||(g=n[i](g,b,c)))&&(l+=g[0],j=j.slice(g[0].length),e=h.push({part:i,string:g.shift(),captures:g}));if(!e)break}return l&&(h.selector=l),d?j.length:j?$.error(a):t.call(y(s,k),0)}function bd(a,b,e,f){var g=b.dir,h=s++;return a||(a=function(a){return a===e}),b.first?function(b){while(b=b[g])if(b.nodeType===1)return a(b)&&b}:f?function(b){while(b=b[g])if(b.nodeType===1&&a(b))return b}:function(b){var e,f=h+"."+c,i=f+"."+d;while(b=b[g])if(b.nodeType===1){if((e=b[o])===i)return b.sizset;if(typeof e=="string"&&e.indexOf(f)===0){if(b.sizset)return b}else{b[o]=i;if(a(b))return b.sizset=!0,b;b.sizset=!1}}}}function be(a,b){return a?function(c){var d=b(c);return d&&a(d===!0?c:d)}:b}function bf(a,b,c){var d,e,g=0;for(;d=a[g];g++)f.relative[d.part]?e=bd(e,f.relative[d.part],b,c):e=be(e,f.filter[d.part].apply(null,d.captures.concat(b,c)));return e}function bg(a){return function(b){var c,d=0;for(;c=a[d];d++)if(c(b))return!0;return!1}}function bh(a,b,c,d){var e=0,f=b.length;for(;e0?i(h,c,g):[]}function bj(a,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s=0,t=a.length,v=S.POS,w=new RegExp("^"+v.source+"(?!"+A+")","i"),x=function(){var a=1,c=arguments.length-2;for(;al){g+=k.slice(l,n.index),l=p,q=[c],J.test(g)&&(m&&(q=m),m=e);if(r=O.test(g))g=g.slice(0,-5).replace(J,"$&*"),l++;n.length>1&&n[0].replace(w,x),m=bi(g,n[1],n[2],q,m,r)}g=""}}o||(g+=k),o=!1}g?J.test(g)?bh(g,m||[c],d,e):$(g,c,d,e?e.concat(m):m):u.apply(d,m)}return t===1?d:$.uniqueSort(d)}function bk(a,b,e,g,h){a=a.replace(H,"$1");var i,k,l,m,n,o,p,q,r,s,v=bc(a,b,h),w=b.nodeType;if(S.POS.test(a))return bj(v,b,e,g);if(g)i=t.call(g,0);else if(v.length===1){if((o=t.call(v[0],0)).length>2&&(p=o[0]).part==="ID"&&w===9&&!h&&f.relative[o[1].part]){b=f.find.ID(p.captures[0].replace(R,""),b,h)[0];if(!b)return e;a=a.slice(o.shift().string.length)}r=(v=N.exec(o[0].string))&&!v.index&&b.parentNode||b,q="";for(n=o.length-1;n>=0;n--){p=o[n],s=p.part,q=p.string+q;if(f.relative[s])break;if(f.order.test(s)){i=f.find[s](p.captures[0].replace(R,""),r,h);if(i==null)continue;a=a.slice(0,a.length-q.length)+q.replace(S[s],""),a||u.apply(e,t.call(i,0));break}}}if(a){k=j(a,b,h),c=k.dirruns++,i==null&&(i=f.find.TAG("*",N.test(a)&&b.parentNode||b));for(n=0;m=i[n];n++)d=k.runs++,k(m)&&e.push(m)}return e}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=a.document,r=q.documentElement,s=0,t=[].slice,u=[].push,v=function(a,b){return a[o]=b||!0,a},w=function(){var a={},b=[];return v(function(c,d){return b.push(c)>f.cacheLength&&delete a[b.shift()],a[c]=d},a)},x=w(),y=w(),z=w(),A="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",C=B.replace("w","w#"),D="([*^$|!~]?=)",E="\\["+A+"*("+B+")"+A+"*(?:"+D+A+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+C+")|)|)"+A+"*\\]",F=":("+B+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+E+")|[^:]|\\\\.)*|.*))\\)|)",G=":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",H=new RegExp("^"+A+"+|((?:^|[^\\\\])(?:\\\\.)*)"+A+"+$","g"),I=new RegExp("^"+A+"*,"+A+"*"),J=new RegExp("^"+A+"*([\\x20\\t\\r\\n\\f>+~])"+A+"*"),K=new RegExp(F),L=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,M=/^:not/,N=/[\x20\t\r\n\f]*[+~]/,O=/:not\($/,P=/h\d/i,Q=/input|select|textarea|button/i,R=/\\(?!\\)/g,S={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),NAME:new RegExp("^\\[name=['\"]?("+B+")['\"]?\\]"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+E),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+A+"*(even|odd|(([+-]|)(\\d*)n|)"+A+"*(?:([+-]|)"+A+"*(\\d+)|))"+A+"*\\)|)","i"),POS:new RegExp(G,"ig"),needsContext:new RegExp("^"+A+"*[>+~]|"+G,"i")},T=function(a){var b=q.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},U=T(function(a){return a.appendChild(q.createComment("")),!a.getElementsByTagName("*").length}),V=T(function(a){return a.innerHTML=" ",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),W=T(function(a){a.innerHTML=" ";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),X=T(function(a){return a.innerHTML="
",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),Y=T(function(a){a.id=o+0,a.innerHTML="
",r.insertBefore(a,r.firstChild);var b=q.getElementsByName&&q.getElementsByName(o).length===2+q.getElementsByName(o+0).length;return e=!q.getElementById(o),r.removeChild(a),b});try{t.call(r.childNodes,0)[0].nodeType}catch(Z){t=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}$.matches=function(a,b){return $(a,null,null,b)},$.matchesSelector=function(a,b){return $(b,null,null,[a]).length>0},g=$.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=g(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=g(b);return c},h=$.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},i=$.contains=r.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:r.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},$.attr=function(a,b){var c,d=h(a);return d||(b=b.toLowerCase()),f.attrHandle[b]?f.attrHandle[b](a):W||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},f=$.selectors={cacheLength:50,createPseudo:v,match:S,order:new RegExp("ID|TAG"+(Y?"|NAME":"")+(X?"|CLASS":"")),attrHandle:V?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:e?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:U?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(R,""),a[3]=(a[4]||a[5]||"").replace(R,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||$.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&$.error(a[0]),a},PSEUDO:function(a,b,c){var d,e;if(S.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(d=a[4])K.test(d)&&(e=bc(d,b,c,!0))&&(e=d.indexOf(")",d.length-e)-d.length)&&(d=d.slice(0,e),a[0]=a[0].slice(0,e)),a[2]=d;return a.slice(0,3)}},filter:{ID:e?function(a){return a=a.replace(R,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(R,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(R,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=x[o][a];return b||(b=x(a,new RegExp("(^|"+A+")"+a+"("+A+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=$.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return $.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=s++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[o]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[o]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e,g=f.pseudos[a]||f.pseudos[a.toLowerCase()];return g||$.error("unsupported pseudo: "+a),g[o]?g(b,c,d):g.length>1?(e=[a,a,"",b],function(a){return g(a,0,e)}):g}},pseudos:{not:v(function(a,b,c){var d=j(a.replace(H,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!f.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:v(function(a){return function(b){return(b.textContent||b.innerText||g(b)).indexOf(a)>-1}}),has:v(function(a){return function(b){return $(a,b).length>0}}),header:function(a){return P.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:_("radio"),checkbox:_("checkbox"),file:_("file"),password:_("password"),image:_("image"),submit:ba("submit"),reset:ba("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return Q.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e ",a.querySelectorAll("[selected]").length||e.push("\\["+A+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="
",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+A+"*(?:\"\"|'')"),a.innerHTML=" ",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bk=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return u.apply(f,t.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j,k,l,m=d.getAttribute("id"),n=m||o,p=N.test(a)&&d.parentNode||d;m?n=n.replace(c,"\\$&"):d.setAttribute("id",n),j=bc(a,d,h),n="[id='"+n+"']";for(k=0,l=j.length;k0})}(),f.setFilters.nth=f.setFilters.eq,f.filters=f.pseudos,$.attr=p.attr,p.find=$,p.expr=$.selectors,p.expr[":"]=p.expr.pseudos,p.unique=$.uniqueSort,p.text=$.getText,p.isXMLDoc=$.isXML,p.contains=$.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/ ]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""," "],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>$2>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/