1if ("undefined" == typeof $ektron) 2{ 3 /* 4 Ektron JavaScript Library 5 Copyright (c) 2008 Ektron, Inc. 6 All rights reserved 7 8 Instructions to upgrade this Ektron Library from jQuery 9 10 1. Add this comment 11 2. Paste jQuery between "Ektron - Begin jQuery" and "Ektron - End jQuery" comments 12 3. Add "Based on" to the jQuery version comment just below 13 4. Modify the jQuery "attr" method (see Ticket #3017) 14 5. Modify the jQuery "domManip" method for contentEditable Containers (defect #35400) 15 6. Modify the jQuery "evalScript" function w/try-catch block (defect #35400) 16 7. Modify the jQuery "clone" method (see jQuery Ticket #4074) 17 8. Add the Ektron stuff at the bottom 18 */ 19 20 // Ektron - Begin jQuery 21 22 (function() { 23 /* 24 * Based on jQuery JavaScript Library v1.3.2 25 * http://jquery.com/ 26 * 27 * Copyright (c) 2009 John Resig 28 * Dual licensed under the MIT and GPL licenses. 29 * http://docs.jquery.com/License 30 * 31 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) 32 * Revision: 6246 33 */ 34 var 35 // Will speed up references to window, and allows munging its name. 36 window = this, 37 // Will speed up references to undefined, and allows munging its name. 38 undefined, 39 // Map over jQuery in case of overwrite 40 _jQuery = window.jQuery, 41 // Map over the $ in case of overwrite 42 _$ = window.$, 43 44 jQuery = window.jQuery = window.$ = function(selector, context) { 45 // The jQuery object is actually just the init constructor 'enhanced' 46 return new jQuery.fn.init(selector, context); 47 }, 48 49 // A simple way to check for HTML strings or ID strings 50 // (both of which we optimize for) 51 quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, 52 // Is it a simple selector 53 isSimple = /^.[^:#\[\.,]*$/; 54 55 jQuery.fn = jQuery.prototype = { 56 init: function(selector, context) { 57 // Make sure that a selection was provided 58 selector = selector || document; 59 60 // Handle $(DOMElement) 61 if (selector.nodeType) { 62 this[0] = selector; 63 this.length = 1; 64 this.context = selector; 65 return this; 66 } 67 // Handle HTML strings 68 if (typeof selector === "string") { 69 // Are we dealing with HTML string or an ID? 70 var match = quickExpr.exec(selector); 71 72 // Verify a match, and that no context was specified for #id 73 if (match && (match[1] || !context)) { 74 75 // HANDLE: $(html) -> $(array) 76 if (match[1]) 77 selector = jQuery.clean([match[1]], context); 78 79 // HANDLE: $("#id") 80 else { 81 var elem = document.getElementById(match[3]); 82 83 // Handle the case where IE and Opera return items 84 // by name instead of ID 85 if (elem && elem.id != match[3]) 86 return jQuery().find(selector); 87 88 // Otherwise, we inject the element directly into the jQuery object 89 var ret = jQuery(elem || []); 90 ret.context = document; 91 ret.selector = selector; 92 return ret; 93 } 94 95 // HANDLE: $(expr, [context]) 96 // (which is just equivalent to: $(content).find(expr) 97 } else 98 return jQuery(context).find(selector); 99 100 // HANDLE: $(function) 101 // Shortcut for document ready 102 } else if (jQuery.isFunction(selector)) 103 return jQuery(document).ready(selector); 104 105 // Make sure that old selector state is passed along 106 if (selector.selector && selector.context) { 107 this.selector = selector.selector; 108 this.context = selector.context; 109 } 110 111 return this.setArray(jQuery.isArray(selector) ? 112 selector : 113 jQuery.makeArray(selector)); 114 }, 115 116 // Start with an empty selector 117 selector: "", 118 119 // The current version of jQuery being used 120 jquery: "1.3.2", 121 122 // The number of elements contained in the matched element set 123 size: function() { 124 return this.length; 125 }, 126 127 // Get the Nth element in the matched element set OR 128 // Get the whole matched element set as a clean array 129 get: function(num) { 130 return num === undefined ? 131 132 // Return a 'clean' array 133 Array.prototype.slice.call(this) : 134 135 // Return just the object 136 this[num]; 137 }, 138 139 // Take an array of elements and push it onto the stack 140 // (returning the new matched element set) 141 pushStack: function(elems, name, selector) { 142 // Build a new jQuery matched element set 143 var ret = jQuery(elems); 144 145 // Add the old object onto the stack (as a reference)
146 ret.prevObject = this; 147 148 ret.context = this.context; 149 150 if (name === "find") 151 ret.selector = this.selector + (this.selector ? " " : "") + selector; 152 else if (name) 153 ret.selector = this.selector + "." + name + "(" + selector + ")"; 154 155 // Return the newly-formed element set 156 return ret; 157 }, 158 159 // Force the current matched set of elements to become 160 // the specified array of elements (destroying the stack in the process) 161 // You should use pushStack() in order to do this, but maintain the stack 162 setArray: function(elems) { 163 // Resetting the length to 0, then using the native Array push 164 // is a super-fast way to populate an object with array-like properties 165 this.length = 0; 166 Array.prototype.push.apply(this, elems); 167 168 return this; 169 }, 170 171 // Execute a callback for every element in the matched set. 172 // (You can seed the arguments with an array of args, but this is 173 // only used internally.) 174 each: function(callback, args) { 175 return jQuery.each(this, callback, args); 176 }, 177 178 // Determine the position of an element within 179 // the matched set of elements 180 index: function(elem) { 181 // Ektron begin (from jQuery 1.4.1) 182 if ( !elem || typeof elem === "string" ) { 183 return jQuery.inArray( this[0], 184 // If it receives a string, the selector is used 185 // If it receives nothing, the siblings are used 186 elem ? jQuery( elem ) : this.parent().children() ); 187 } 188 // Ektron end 189 // Locate the position of the desired element 190 return jQuery.inArray( 191 // If it receives a jQuery object, the first element is used 192 elem && elem.jquery ? elem[0] : elem 193 , this); 194 }, 195 196 attr: function(name, value, type) { 197 var options = name; 198 199 // Look for the case where we're accessing a style value 200 if (typeof name === "string") 201 if (value === undefined) 202 // Ektron Begin 203 // Ektron Note: re-added "|| undefined" from 1.2.3 jQuery Ticket #3017 204 return this[0] && jQuery[type || "attr"](this[0], name) || undefined; 205 // Ektron End 206 else { 207 options = {}; 208 options[name] = value; 209 } 210 211 // Check to see if we're setting style values 212 return this.each(function(i) { 213 // Set all the styles 214 for (name in options) 215 jQuery.attr( 216 type ? 217 this.style : 218 this, 219 name, jQuery.prop(this, options[name], type, i, name) 220 ); 221 }); 222 }, 223 224 css: function(key, value) { 225 // ignore negative width and height values 226 if ((key == 'width' || key == 'height') && parseFloat(value) < 0) 227 value = undefined; 228 return this.attr(key, value, "curCSS"); 229 }, 230 231 text: function(text) { 232 if (typeof text !== "object" && text != null) 233 return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(text)); 234 235 var ret = ""; 236 237 jQuery.each(text || this, function() { 238 jQuery.each(this.childNodes, function() { 239 if (this.nodeType != 8) 240 ret += this.nodeType != 1 ? 241 this.nodeValue : 242 jQuery.fn.text([this]); 243 }); 244 }); 245 246 return ret; 247 }, 248 249 wrapAll: function(html) { 250 if (this[0]) { 251 // The elements to wrap the target around 252 var wrap = jQuery(html, this[0].ownerDocument).clone(); 253 254 if (this[0].parentNode) 255 wrap.insertBefore(this[0]); 256 257 wrap.map(function() { 258 var elem = this; 259 260 while (elem.firstChild) 261 elem = elem.firstChild; 262 263 return elem; 264 }).append(this); 265 } 266 267 return this; 268 }, 269 270 wrapInner: function(html) { 271 return this.each(function() { 272 jQuery(this).contents().wrapAll(html); 273 }); 274 }, 275 276 wrap: function(html) { 277 return this.each(function() { 278 jQuery(this).wrapAll(html); 279 }); 280 }, 281 282 append: function() { 283 return this.domManip(arguments, true, function(elem) { 284 if (this.nodeType == 1) 285 this.appendChild(elem); 286 }); 287 }, 288 289 prepend: function() { 290 return this.domManip(arguments, true, function(elem) { 291 if (this.nodeType == 1) 292 this.insertBefore(elem, this.firstChild); 293 }); 294 }, 295 296 before: function() { 297 return this.domManip(arguments, false, function(elem) { 298 this.parentNode.insertBefore(elem, this); 299 }); 300 }, 301 302 after: function() { 303 return this.domManip(arguments, false, function(elem) { 304 this.parentNode.insertBefore(elem, this.nextSibling); 305 }); 306 }, 307 308 end: function() { 309 return this.prevObject || jQuery([]); 310 }, 311 312 // For internal use only. 313 // Behaves like an Array's method, not like a jQuery method. 314 push: [].push, 315 sort: [].sort, 316 splice: [].splice, 317 318 find: function(selector) { 319 if (this.length === 1) { 320 var ret = this.pushStack([], "find", selector); 321 ret.length = 0; 322 jQuery.find(selector, this[0], ret); 323 return ret; 324 } else { 325 return this.pushStack(jQuery.unique(jQuery.map(this, function(elem) { 326 return jQuery.find(selector, elem); 327 })), "find", selector); 328 } 329 }, 330 331 clone: function(events) { 332 // Do the clone 333 var ret = this.map(function() { 334 if (!jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this)) { 335 // IE copies events bound via attachEvent when 336 // using cloneNode. Calling detachEvent on the 337 // clone will also remove the events from the orignal 338 // In order to get around this, we use innerHTML. 339 // Unfortunately, this means some modifications to 340 // attributes in IE that are actually only stored 341 // as properties will not be copied (such as the 342 // the name attribute on an input). 343 var html = this.outerHTML; 344 if (!html) { 345 var div = this.ownerDocument.createElement("div"); 346 div.appendChild(this.cloneNode(true)); 347 html = div.innerHTML; 348 } 349 350 // Ektron Begin 351 return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")], this.ownerDocument)[0]; 352 // Ektron Note: added ", this.ownerDocument", see jQuery 1.3.2 ticket #4074 353 // Ektron End 354 } else 355 return this.cloneNode(true); 356 }); 357 358 // Copy the events from the original to the clone 359 if (events === true) { 360 var orig = this.find("*").andSelf(), i = 0; 361 362 ret.find("*").andSelf().each(function() { 363 if (this.nodeName !== orig[i].nodeName) 364 return; 365 366 var events = jQuery.data(orig[i], "events"); 367 368 for (var type in events) { 369 for (var handler in events[type]) { 370 jQuery.event.add(this, type, events[type][handler], events[type][handler].data); 371 } 372 } 373 374 i++; 375 }); 376 } 377 378 // Return the cloned set 379 return ret; 380 }, 381 382 filter: function(selector) { 383 return this.pushStack( 384 jQuery.isFunction(selector) && 385 jQuery.grep(this, function(elem, i) { 386 return selector.call(elem, i); 387 }) || 388 389 jQuery.multiFilter(selector, jQuery.grep(this, function(elem) { 390 return elem.nodeType === 1; 391 })), "filter", selector); 392 }, 393 394 closest: function(selector) { 395 var pos = jQuery.expr.match.POS.test(selector) ? jQuery(selector) : null, 396 closer = 0; 397 398 return this.map(function() { 399 var cur = this; 400 while (cur && cur.ownerDocument) { 401 if (pos ? pos.index(cur) > -1 : jQuery(cur).is(selector)) { 402 jQuery.data(cur, "closest", closer); 403 return cur; 404 } 405 cur = cur.parentNode; 406 closer++; 407 } 408 }); 409 }, 410 411 not: function(selector) { 412 if (typeof selector === "string") 413 // test special case where just one selector is passed in 414 if (isSimple.test(selector)) 415 return this.pushStack(jQuery.multiFilter(selector, this, true), "not", selector); 416 else 417 selector = jQuery.multiFilter(selector, this); 418 419 var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; 420 return this.filter(function() { 421 return isArrayLike ? jQuery.inArray(this, selector) < 0 : this != selector; 422 }); 423 }, 424 425 add: function(selector) { 426 return this.pushStack(jQuery.unique(jQuery.merge( 427 this.get(), 428 typeof selector === "string" ? 429 jQuery(selector) : 430 jQuery.makeArray(selector) 431 ))); 432 }, 433 434 is: function(selector) { 435 return !!selector && jQuery.multiFilter(selector, this).length > 0; 436 }, 437 438 hasClass: function(selector) { 439 return !!selector && this.is("." + selector); 440 }, 441 442 val: function(value) { 443 if (value === undefined) { 444 var elem = this[0]; 445 446 if (elem) { 447 if (jQuery.nodeName(elem, 'option')) 448 return (elem.attributes.value || {}).specified ? elem.value : elem.text; 449 450 // We need to handle select boxes special 451 if (jQuery.nodeName(elem, "select")) { 452 var index = elem.selectedIndex, 453 values = [], 454 options = elem.options, 455 one = elem.type == "select-one"; 456 457 // Nothing was selected 458 if (index < 0) 459 return null; 460 461 // Loop through all the selected options 462 for (var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++) { 463 var option = options[i]; 464 465 if (option.selected) { 466 // Get the specifc value for the option 467 value = jQuery(option).val(); 468 469 // We don't need an array for one selects 470 if (one) 471 return value; 472 473 // Multi-Selects return an array 474 values.push(value); 475 } 476 } 477 478 return values; 479 } 480 481 // Everything else, we just grab the value 482 return (elem.value || "").replace(/\r/g, ""); 483 484 } 485 486 return undefined; 487 } 488 489 if (typeof value === "number") 490 value += ''; 491 492 return this.each(function() { 493 if (this.nodeType != 1) 494 return; 495 496 if (jQuery.isArray(value) && /radio|checkbox/.test(this.t
496ype)) 497 this.checked = (jQuery.inArray(this.value, value) >= 0 || 498 jQuery.inArray(this.name, value) >= 0); 499 500 else if (jQuery.nodeName(this, "select")) { 501 var values = jQuery.makeArray(value); 502 503 jQuery("option", this).each(function() { 504 this.selected = (jQuery.inArray(this.value, values) >= 0 || 505 jQuery.inArray(this.text, values) >= 0); 506 }); 507 508 if (!values.length) 509 this.selectedIndex = -1; 510 511 } else 512 this.value = value; 513 }); 514 }, 515 516 html: function(value) { 517 return value === undefined ? 518 (this[0] ? 519 this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : 520 null) : 521 this.empty().append(value); 522 }, 523 524 replaceWith: function(value) { 525 return this.after(value).remove(); 526 }, 527 528 eq: function(i) { 529 return this.slice(i, +i + 1); 530 }, 531 532 slice: function() { 533 return this.pushStack(Array.prototype.slice.apply(this, arguments), 534 "slice", Array.prototype.slice.call(arguments).join(",")); 535 }, 536 537 map: function(callback) { 538 return this.pushStack(jQuery.map(this, function(elem, i) { 539 return callback.call(elem, i, elem); 540 })); 541 }, 542 543 andSelf: function() { 544 return this.add(this.prevObject); 545 }, 546 547 domManip: function(args, table, callback) { 548 if (this[0]) { 549 var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), 550 scripts = jQuery.clean(args, (this[0].ownerDocument || this[0]), fragment), 551 first = fragment.firstChild; 552 553 if (first) 554 for (var i = 0, l = this.length; i < l; i++) 555 callback.call(root(this[i], first), this.length > 1 || i > 0 ? 556 fragment.cloneNode(true) : fragment); 557 if (scripts && scripts.length > 0) // Ektron added check for length > 0 558 // Ektron Begin 559 // Ektron Note: Don't evaluate script that is in editable container (defect #35400) 560 // Ektron Note: Keep script that is in editable container (defect #40836) 561 { 562 if (1 == this.nodeType && ($ektron.isEditableElement(this[0]) || "true" == this[0].getAttribute("contenteditable"))) 563 { 564 // Don't evaluate the scripts 565 } 566 else 567 { 568 // Ektron End 569 jQuery.each(scripts, evalScript); 570 // Ektron Begin 571 } 572 } 573 // Ektron End 574 } 575 576 return this; 577 578 function root(elem, cur) { 579 return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? 580 (elem.getElementsByTagName("tbody")[0] || 581 elem.appendChild(elem.ownerDocument.createElement("tbody"))) : 582 elem; 583 } 584 } 585 }; 586 587 // Give the init function the jQuery prototype for later instantiation 588 jQuery.fn.init.prototype = jQuery.fn; 589 590 function evalScript(i, elem) { 591 // Ektron Begin 592 // Ektron Note: Added try/catch block for #35400 in Firefox 593 try 594 { 595 // Ektron End 596 if (elem.src) 597 jQuery.ajax({ 598 url: elem.src, 599 async: false, 600 dataType: "script" 601 }); 602 603 else 604 jQuery.globalEval(elem.text || elem.textContent || elem.innerHTML || ""); 605 606 if (elem.parentNode) 607 elem.parentNode.removeChild(elem); 608 // Ektron Begin 609 } 610 catch(ex) 611 { 612 } 613 // Ektron End 614 } 615 616 function now() { 617 return +new Date; 618 } 619 620 jQuery.extend = jQuery.fn.extend = function() { 621 // copy reference to target object 622 var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; 623 624 // Handle a deep copy situation 625 if (typeof target === "boolean") { 626 deep = target; 627 target = arguments[1] || {}; 628 // skip the boolean and the target 629 i = 2; 630 } 631 632 // Handle case when target is a string or something (possible in deep copy) 633 if (typeof target !== "object" && !jQuery.isFunction(target)) 634 target = {}; 635 636 // extend jQuery itself if only one argument is passed 637 if (length == i) { 638 target = this; 639 --i; 640 } 641 642 for (; i < length; i++) 643 // Only deal with non-null/undefined values 644 if ((options = arguments[i]) != null) 645 // Extend the base object 646 for (var name in options) { 647 var src = target[name], copy = options[name]; 648 649 // Prevent never-ending loop 650 if (target === copy) 651 continue; 652 653 // Recurse if we're merging object values 654 if (deep && copy && typeof copy === "object" && !copy.nodeType) 655 target[name] = jQuery.extend(deep, 656 // Never move original objects, clone them 657 src || (copy.length != null ? [] : {}) 658 , copy); 659 660 // Don't bring in undefined values 661 else if (copy !== undefined) 662 target[name] = copy; 663 664 } 665 666 // Return the modified object 667 return target; 668 }; 669 670 // exclude the following css properties to add px 671 var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, 672 // cache defaultView 673 defaultView = document.defaultView || {}, 674 toString = Object.prototype.toString; 675 676 jQuery.extend({ 677 noConflict: function(deep) { 678 window.$ = _$; 679 680 if (deep) 681 window.jQuery = _jQuery; 682 683 return jQuery; 684 }, 685 686 // See test/unit/core.js for details concerning isFunction. 687 // Since version 1.3, DOM methods and functions like alert 688 // aren't supported. They return false on IE (#2968). 689 isFunction: function(obj) { 690 return toString.call(obj) === "[object Function]"; 691 }, 692 693 isArray: function(obj) { 694 return toString.call(obj) === "[object Array]"; 695 }, 696 697 // check if an element is in a (or is an) XML document 698 isXMLDoc: function(elem) { 699 return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || 700 !!elem.ownerDocument && jQuery.isXMLDoc(elem.ownerDocument); 701 }, 702 703 // Evalulates a script in a global context 704 globalEval: function(data) { 705 if (data && /\S/.test(data)) { 706 // Inspired by code by Andrea Giammarchi 707 // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html 708 var head = document.getElementsByTagName("head")[0] || document.documentElement, 709 script = document.createElement("script"); 710 711 script.type = "text/javascript"; 712 if (jQuery.support.scriptEval) 713 script.appendChild(document.createTextNode(data)); 714 else 715 script.text = data; 716 717 // Use insertBefore instead of appendChild to circumvent an IE6 bug. 718 // This arises when a base node is used (#2709).
719 head.insertBefore(script, head.firstChild); 720 head.removeChild(script); 721 } 722 }, 723 724 nodeName: function(elem, name) { 725 return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); 726 }, 727 728 // args is for internal usage only 729 each: function(object, callback, args) { 730 var name, i = 0, length = object.length; 731 732 if (args) { 733 if (length === undefined) { 734 for (name in object) 735 if (callback.apply(object[name], args) === false) 736 break; 737 } else 738 for (; i < length; ) 739 if (callback.apply(object[i++], args) === false) 740 break; 741 742 // A special, fast, case for the most common use of each 743 } else { 744 if (length === undefined) { 745 for (name in object) 746 if (callback.call(object[name], name, object[name]) === false) 747 break; 748 } else 749 for (var value = object[0]; 750 i < length && callback.call(value, i, value) !== false; value = object[++i]) { } 751 } 752 753 return object; 754 }, 755 756 prop: function(elem, value, type, i, name) { 757 // Handle executable functions 758 if (jQuery.isFunction(value)) 759 value = value.call(elem, i); 760 761 // Handle passing in a number to a CSS property 762 return typeof value === "number" && type == "curCSS" && !exclude.test(name) ? 763 value + "px" : 764 value; 765 }, 766 767 className: { 768 // internal only, use addClass("class") 769 add: function(elem, classNames) { 770 jQuery.each((classNames || "").split(/\s+/), function(i, className) { 771 if (elem.nodeType == 1 && !jQuery.className.has(elem.className, className)) 772 elem.className += (elem.className ? " " : "") + className; 773 }); 774 }, 775 776 // internal only, use removeClass("class") 777 remove: function(elem, classNames) { 778 if (elem.nodeType == 1) 779 elem.className = classNames !== undefined ? 780 jQuery.grep(elem.className.split(/\s+/), function(className) { 781 return !jQuery.className.has(classNames, className); 782 }).join(" ") : 783 ""; 784 }, 785 786 // internal only, use hasClass("class") 787 has: function(elem, className) { 788 return elem && jQuery.inArray(className, (elem.className || elem).toString().split(/\s+/)) > -1; 789 } 790 }, 791 792 // A method for quickly swapping in/out CSS properties to get correct calculations 793 swap: function(elem, options, callback) { 794 var old = {}; 795 // Remember the old values, and insert the new ones 796 for (var name in options) { 797 old[name] = elem.style[name]; 798 elem.style[name] = options[name]; 799 } 800 801 callback.call(elem); 802 803 // Revert the old values 804 for (var name in options) 805 elem.style[name] = old[name]; 806 }, 807 808 css: function(elem, name, force, extra) { 809 if (name == "width" || name == "height") { 810 var val, props = { position: "absolute", visibility: "hidden", display: "block" }, which = name == "width" ? ["Left", "Right"] : ["Top", "Bottom"]; 811 812 function getWH() { 813 val = name == "width" ? elem.offsetWidth : elem.offsetHeight; 814 815 if (extra === "border") 816 return; 817 818 jQuery.each(which, function() { 819 if (!extra) 820 val -= parseFloat(jQuery.curCSS(elem, "padding" + this, true)) || 0; 821 if (extra === "margin") 822 val += parseFloat(jQuery.curCSS(elem, "margin" + this, true)) || 0; 823 else 824 val -= parseFloat(jQuery.curCSS(elem, "border" + this + "Width", true)) || 0; 825 }); 826 } 827 828 if (elem.offsetWidth !== 0) 829 getWH(); 830 else 831 jQuery.swap(elem, props, getWH); 832 833 return Math.max(0, Math.round(val)); 834 } 835 836 return jQuery.curCSS(elem, name, force); 837 }, 838 839 curCSS: function(elem, name, force) { 840 var ret, style = elem.style; 841 842 // We need to handle opacity special in IE 843 if (name == "opacity" && !jQuery.support.opacity) { 844 ret = jQuery.attr(style, "opacity"); 845 846 return ret == "" ? 847 "1" : 848 ret; 849 } 850 851 // Make sure we're using the right name for getting the float value 852 if (name.match(/float/i)) 853 name = styleFloat; 854 855 if (!force && style && style[name]) 856 ret = style[name]; 857 858 else if (defaultView.getComputedStyle) { 859 860 // Only "float" is needed here 861 if (name.match(/float/i)) 862 name = "float"; 863 864 name = name.replace(/([A-Z])/g, "-$1").toLowerCase(); 865 866 var computedStyle = defaultView.getComputedStyle(elem, null); 867 868 if (computedStyle) 869 ret = computedStyle.getPropertyValue(name); 870 871 // We should always get a number back from opacity 872 if (name == "opacity" && ret == "") 873 ret = "1"; 874 875 } else if (elem.currentStyle) {
876 var camelCase = name.replace(/\-(\w)/g, function(all, letter) { 877 return letter.toUpperCase(); 878 }); 879 880 ret = elem.currentStyle[name] || elem.currentStyle[camelCase]; 881 882 // From the awesome hack by Dean Edwards 883 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 884 885 // If we're not dealing with a regular pixel number 886 // but a number that has a weird ending, we need to convert it to pixels 887 if (!/^\d+(px)?$/i.test(ret) && /^\d/.test(ret)) { 888 // Remember the original values 889 var left = style.left, rsLeft = elem.runtimeStyle.left; 890 891 // Put in the new values to get a computed value out 892 elem.runtimeStyle.left = elem.currentStyle.left; 893 style.left = ret || 0; 894 ret = style.pixelLeft + "px"; 895 896 // Revert the changed values 897 style.left = left; 898 elem.runtimeStyle.left = rsLeft; 899 } 900 } 901 902 return ret; 903 }, 904 905 clean: function(elems, context, fragment) { 906 context = context || document; 907 908 // !context.createElement fails in IE with an error but returns typeof 'object' 909 if (typeof context.createElement === "undefined") 910 context = context.ownerDocument || context[0] && context[0].ownerDocument || document; 911 912 // If a single string is passed in and it's a single tag 913 // just do a createElement and skip the rest 914 if (!fragment && elems.length === 1 && typeof elems[0] === "string") { 915 var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); 916 if (match) 917 return [context.createElement(match[1])]; 918 } 919 920 var ret = [], scripts = [], div = context.createElement("div"); 921 922 jQuery.each(elems, function(i, elem) { 923 if (typeof elem === "number") 924 elem += ''; 925 926 if (!elem) 927 return; 928 929 // Convert html string into DOM nodes 930 if (typeof elem === "string") { 931 // Fix "XHTML"-style tags in all browsers 932 elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag) { 933 return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? 934 all : 935 front + "></" + tag + ">"; 936 }); 937 938 // Trim whitespace, otherwise indexOf won't work as expected 939 var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); 940 941 var wrap = 942 // option or optgroup 943 !tags.indexOf("<opt") && 944 [1, "<select multiple='multiple'>", "</select>"] || 945 946 !tags.indexOf("<leg") && 947 [1, "<fieldset>", "</fieldset>"] || 948 949 tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && 950 [1, "<table>", "</table>"] || 951 952 !tags.indexOf("<tr") && 953 [2, "<table><tbody>", "</tbody></table>"] || 954 955 // <thead> matched above 956 (!tags.indexOf("<td") || !tags.indexOf("<th")) && 957 [3, "<table><tbody><tr>", "</tr></tbody></table>"] || 958 959 !tags.indexOf("<col") && 960 [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || 961 962 // IE can't serialize <link> and <script> tags normally 963 !jQuery.support.htmlSerialize && 964 [1, "div<div>", "</div>"] || 965 966 [0, "", ""]; 967 968 // Go to html and back, then peel off extra wrappers 969 div.innerHTML = wrap[1] + elem + wrap[2]; 970 971 // Move to the right depth 972 while (wrap[0]--)
973 div = div.lastChild; 974 975 // Remove IE's autoinserted <tbody> from table fragments 976 if (!jQuery.support.tbody) { 977 978 // String was a <table>, *may* have spurious <tbody> 979 var hasBody = /<tbody/i.test(elem), 980 tbody = !tags.indexOf("<table") && !hasBody ? 981 div.firstChild && div.firstChild.childNodes : 982 983 // String was a bare <thead> or <tfoot> 984 wrap[1] == "<table>" && !hasBody ? 985 div.childNodes : 986 []; 987 988 for (var j = tbody.length - 1; j >= 0; --j) 989 if (jQuery.nodeName(tbody[j], "tbody") && !tbody[j].childNodes.length) 990 tbody[j].parentNode.removeChild(tbody[j]); 991 992 } 993 994 // IE completely kills leading whitespace when innerHTML is used 995 if (!jQuery.support.leadingWhitespace && /^\s/.test(elem)) 996 div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]), div.firstChild); 997 998 elem = jQuery.makeArray(div.childNodes); 999 } 1000 1001 if (elem.nodeType) 1002 ret.push(elem); 1003 else 1004 ret = jQuery.merge(ret, elem); 1005 1006 }); 1007 1008 if (fragment) { 1009 for (var i = 0; ret[i]; i++) { 1010 if (jQuery.nodeName(ret[i], "script") && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript")) { 1011 scripts.push(ret[i].parentNode ? ret[i].parentNode.removeChild(ret[i]) : ret[i]); 1012 } else { 1013 if (ret[i].nodeType === 1) 1014 ret.splice.apply(ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script")))); 1015 fragment.appendChild(ret[i]); 1016 } 1017 } 1018 1019 return scripts; 1020 } 1021 1022 return ret; 1023 }, 1024 1025 attr: function(elem, name, value) { 1026 // don't set attributes on text and comment nodes 1027 if (!elem || elem.nodeType == 3 || elem.nodeType == 8) 1028 return undefined; 1029 1030 var notxml = !jQuery.isXMLDoc(elem), 1031 // Whether we are setting (or getting) 1032 set = value !== undefined; 1033 1034 // Try to normalize/fix the name 1035 name = notxml && jQuery.props[name] || name; 1036 1037 // Only do all the following if this is a node (faster for style) 1038 // IE elem.getAttribute passes even for style 1039 if (elem.tagName) { 1040 1041 // These attributes require special treatment 1042 var special = /href|src|style/.test(name); 1043 1044 // Safari mis-reports the default selected property of a hidden option 1045 // Accessing the parent's selectedIndex property fixes it 1046 if (name == "selected" && elem.parentNode) 1047 elem.parentNode.selectedIndex; 1048 1049 // If applicable, access the attribute via the DOM 0 way 1050 if (name in elem && notxml && !special) { 1051 if (set) { 1052 // We can't allow the type property to be changed (since it causes problems in IE) 1053 if (name == "type" && jQuery.nodeName(elem, "input") && elem.parentNode) 1054 throw "type property can't be changed"; 1055 1056 // Ektron Begin 1057 // Ektron Note: jQuery defect #4420 (determined not to be a jQuery bug) 1058 //Something is passing in bad data here causing IE7 to blow up. This check 1059 //works around the problem, but the defect is in whatever is passing in this 1060 //invalid data. This is being added here as a workaround as it was not clear 1061 //what was passing in the bad data. No Ektron defect associated with it. This 1062 //is added here for 8.02sp2 and should not be rolled into mainline. 1063 if ((value == 'NaNpx')||(value == 'px')) value = ''; 1064 elem[name] = value; 1065 } 1066 1067 // browsers index elements by id/name on forms, give priority to attributes. 1068 if (jQuery.nodeName(elem, "form") && elem.getAttributeNode(name)) 1069 return elem.getAttributeNode(name).nodeValue; 1070 1071 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set 1072 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 1073 if (name == "tabIndex") { 1074 var attributeNode = elem.getAttributeNode("tabIndex"); 1075 return attributeNode && attributeNode.specified 1076 ? attributeNode.value 1077 : elem.nodeName.match(/(button|input|object|select|textarea)/i) 1078 ? 0 1079 : elem.nodeName.match(/^(a|area)$/i) && elem.href 1080 ? 0 1081 : undefined; 1082 } 1083 1084 return elem[name]; 1085 } 1086 1087 if (!jQuery.support.style && notxml && name == "style") 1088 return jQuery.attr(elem.style, "cssText", value); 1089 1090 if (set) 1091 // convert the value to a string (all browsers do this but IE) see #1070 1092 elem.setAttribute(name, "" + value); 1093 1094 var attr = !jQuery.support.hrefNormalized && notxml && special 1095 // Some attributes require a special call on IE 1096 ? elem.getAttribute(name, 2) 1097 : elem.getAttribute(name); 1098 1099 // Non-existent attributes return null, we normalize to undefined 1100 return attr === null ? undefined : attr; 1101 } 1102 1103 // elem is actually elem.style ... set the style 1104 1105 // IE uses filters for opacity 1106 if (!jQuery.support.opacity && name == "opacity") { 1107 if (set) { 1108 // IE has trouble with opacity if it does not have layout 1109 // Force it by setting the zoom level 1110 elem.zoom = 1; 1111 1112 // Set the alpha filter to set the opacity 1113 elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/, "") + 1114 (parseInt(value) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); 1115 } 1116 1117 return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? 1118 (parseFloat(elem.filter.match(/opacity=([^)]*)/)[1]) / 100) + '' : 1119 ""; 1120 } 1121 1122 name = name.replace(/-([a-z])/ig, function(all, letter) { 1123 return letter.toUpperCase(); 1124 }); 1125 1126 if (set) 1127 elem[name] = value; 1128 1129 return elem[name]; 1130 }, 1131 1132 trim: function(text) { 1133 return (text || "").replace(/^\s+|\s+$/g, ""); 1134 }, 1135 1136 makeArray: function(array) { 1137 var ret = []; 1138 1139 if (array != null) { 1140 var i = array.length; 1141 // The window, strings (and functions) also have 'length' 1142 if (i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval) 1143 ret[0] = array; 1144 else 1145 while (i) 1146 ret[--i] = array[i]; 1147 } 1148 1149 return ret; 1150 }, 1151 1152 inArray: function(elem, array) { 1153 for (var i = 0, length = array.length; i < length; i++) 1154 // Use === because on IE, window == document 1155 if (array[i] === elem) 1156 return i; 1157 1158 return -1; 1159 }, 1160 1161 merge: function(first, second) { 1162 // We have to loop this way because IE & Opera overwrite the length 1163 // expando of getElementsByTagName 1164 var i = 0, elem, pos = first.length; 1165 // Also, we need to make sure that the correct elements are being returned
1166 // (IE returns comment nodes in a '*' query) 1167 if (!jQuery.support.getAll) { 1168 while ((elem = second[i++]) != null) 1169 if (elem.nodeType != 8) 1170 first[pos++] = elem; 1171 1172 } else 1173 while ((elem = second[i++]) != null) 1174 first[pos++] = elem; 1175 1176 return first; 1177 }, 1178 1179 unique: function(array) { 1180 var ret = [], done = {}; 1181 1182 try { 1183 1184 for (var i = 0, length = array.length; i < length; i++) { 1185 var id = jQuery.data(array[i]); 1186 1187 if (!done[id]) { 1188 done[id] = true; 1189 ret.push(array[i]); 1190 } 1191 } 1192 1193 } catch (e) { 1194 ret = array; 1195 } 1196 1197 return ret; 1198 }, 1199 1200 grep: function(elems, callback, inv) { 1201 var ret = []; 1202 1203 // Go through the array, only saving the items 1204 // that pass the validator function 1205 for (var i = 0, length = elems.length; i < length; i++) 1206 if (!inv != !callback(elems[i], i)) 1207 ret.push(elems[i]); 1208 1209 return ret; 1210 }, 1211 1212 map: function(elems, callback) { 1213 var ret = []; 1214 1215 // Go through the array, translating each of the items to their 1216 // new value (or values). 1217 for (var i = 0, length = elems.length; i < length; i++) { 1218 var value = callback(elems[i], i); 1219 1220 if (value != null) 1221 ret[ret.length] = value; 1222 } 1223 1224 return ret.concat.apply([], ret); 1225 } 1226 }); 1227 1228 // Use of jQuery.browser is deprecated. 1229 // It's included for backwards compatibility and plugins, 1230 // although they should work to migrate away. 1231 1232 var userAgent = navigator.userAgent.toLowerCase(); 1233 1234 // Figure out what browser is being used 1235 jQuery.browser = { 1236 version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1], 1237 safari: /webkit/.test(userAgent), 1238 opera: /opera/.test(userAgent), 1239 msie: /msie/.test(userAgent) && !/opera/.test(userAgent), 1240 mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent) 1241 }; 1242 1243 jQuery.each({ 1244 parent: function(elem) { return elem.parentNode; }, 1245 parents: function(elem) { return jQuery.dir(elem, "parentNode"); }, 1246 next: function(elem) { return jQuery.nth(elem, 2, "nextSibling"); }, 1247 prev: function(elem) { return jQuery.nth(elem, 2, "previousSibling"); }, 1248 nextAll: function(elem) { return jQuery.dir(elem, "nextSibling"); }, 1249 prevAll: function(elem) { return jQuery.dir(elem, "previousSibling"); }, 1250 siblings: function(elem) { return jQuery.sibling(elem.parentNode.firstChild, elem); }, 1251 children: function(elem) { return jQuery.sibling(elem.firstChild); }, 1252 contents: function(elem) { return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray(elem.childNodes); } 1253 }, function(name, fn) { 1254 jQuery.fn[name] = function(selector) { 1255 var ret = jQuery.map(this, fn); 1256 1257 if (selector && typeof selector == "string") 1258 ret = jQuery.multiFilter(selector, ret); 1259 1260 return this.pushStack(jQuery.unique(ret), name, selector); 1261 }; 1262 }); 1263 1264 jQuery.each({ 1265 appendTo: "append", 1266 prependTo: "prepend", 1267 insertBefore: "before", 1268 insertAfter: "after", 1269 replaceAll: "replaceWith" 1270 }, function(name, original) { 1271 jQuery.fn[name] = function(selector) { 1272 var ret = [], insert = jQuery(selector); 1273 1274 for (var i = 0, l = insert.length; i < l; i++) { 1275 var elems = (i > 0 ? this.clone(true) : this).get(); 1276 jQuery.fn[original].apply(jQuery(insert[i]), elems); 1277 ret = ret.concat(elems); 1278 } 1279 1280 return this.pushStack(ret, name, selector); 1281 }; 1282 }); 1283 1284 jQuery.each({ 1285 removeAttr: function(name) { 1286 jQuery.attr(this, name, ""); 1287 if (this.nodeType == 1) 1288 this.removeAttribute(name); 1289 }, 1290 1291 addClass: function(classNames) { 1292 jQuery.className.add(this, classNames); 1293 }, 1294 1295 removeClass: function(classNames) { 1296 jQuery.className.remove(this, classNames); 1297 }, 1298 1299 toggleClass: function(classNames, state) { 1300 if (typeof state !== "boolean") 1301 state = !jQuery.className.has(this, classNames); 1302 jQuery.className[state ? "add" : "remove"](this, classNames); 1303 }, 1304 1305 remove: function(selector) { 1306 if (!selector || jQuery.filter(selector, [this]).length) { 1307 // Prevent memory leaks 1308 jQuery("*", this).add([this]).each(function() { 1309 jQuery.event.remove(this); 1310 jQuery.removeData(this); 1311 }); 1312 if (this.parentNode) 1313 this.parentNode.removeChild(this); 1314 } 1315 }, 1316 1317 empty: function() { 1318 // Remove element nodes and prevent memory leaks 1319 jQuery(this).children().remove(); 1320 1321 // Remove any remaining nodes 1322 while (this.firstChild) 1323 this.removeChild(this.firstChild); 1324 } 1325 }, function(name, fn) { 1326 jQuery.fn[name] = function() { 1327 return this.each(fn, arguments); 1328 }; 1329 }); 1330 1331 // Helper function used by the dimensions and offset modules 1332 function num(elem, prop) {
1333 return elem[0] && parseInt(jQuery.curCSS(elem[0], prop, true), 10) || 0; 1334 } 1335 1336 var expando = "jQuery" + now(), uuid = 0, windowData = {}; 1337 1338 jQuery.extend({ 1339 cache: {}, 1340 1341 data: function(elem, name, data) { 1342 elem = elem == window ? 1343 windowData : 1344 elem; 1345 1346 var id = elem[expando]; 1347 1348 // Compute a unique ID for the element 1349 if (!id) 1350 id = elem[expando] = ++uuid; 1351 1352 // Only generate the data cache if we're 1353 // trying to access or manipulate it 1354 if (name && !jQuery.cache[id]) 1355 jQuery.cache[id] = {}; 1356 1357 // Prevent overriding the named cache with undefined values 1358 if (data !== undefined) 1359 jQuery.cache[id][name] = data; 1360 1361 // Return the named cache data, or the ID for the element 1362 return name ? 1363 jQuery.cache[id][name] : 1364 id; 1365 }, 1366 1367 removeData: function(elem, name) { 1368 elem = elem == window ? 1369 windowData : 1370 elem; 1371 1372 var id = elem[expando]; 1373 1374 // If we want to remove a specific section of the element's data 1375 if (name) { 1376 if (jQuery.cache[id]) { 1377 // Remove the section of cache data 1378 delete jQuery.cache[id][name]; 1379 1380 // If we've removed all the data, remove the element's cache 1381 name = ""; 1382 1383 for (name in jQuery.cache[id]) 1384 break; 1385 1386 if (!name) 1387 jQuery.removeData(elem); 1388 } 1389 1390 // Otherwise, we want to remove all of the element's data 1391 } else { 1392 // Clean up the element expando 1393 try { 1394 delete elem[expando]; 1395 } catch (e) { 1396 // IE has trouble directly removing the expando 1397 // but it's ok with using removeAttribute 1398 if (elem.removeAttribute) 1399 elem.removeAttribute(expando); 1400 } 1401 1402 // Completely remove the data cache 1403 delete jQuery.cache[id]; 1404 } 1405 }, 1406 queue: function(elem, type, data) { 1407 if (elem) { 1408 1409 type = (type || "fx") + "queue"; 1410 1411 var q = jQuery.data(elem, type); 1412 1413 if (!q || jQuery.isArray(data)) 1414 q = jQuery.data(elem, type, jQuery.makeArray(data)); 1415 else if (data) 1416 q.push(data); 1417 1418 } 1419 return q; 1420 }, 1421 1422 dequeue: function(elem, type) { 1423 var queue = jQuery.queue(elem, type), 1424 fn = queue.shift(); 1425 1426 if (!type || type === "fx") 1427 fn = queue[0]; 1428 1429 if (fn !== undefined) 1430 fn.call(elem); 1431 } 1432 }); 1433 1434 jQuery.fn.extend({ 1435 data: function(key, value) { 1436 var parts = key.split("."); 1437 parts[1] = parts[1] ? "." + parts[1] : ""; 1438 1439 if (value === undefined) { 1440 var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); 1441 1442 if (data === undefined && this.length) 1443 data = jQuery.data(this[0], key); 1444 1445 return data === undefined && parts[1] ? 1446 this.data(parts[0]) : 1447 data; 1448 } else 1449 return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { 1450 jQuery.data(this, key, value); 1451 }); 1452 }, 1453 1454 removeData: function(key) { 1455 return this.each(function() { 1456 jQuery.removeData(this, key); 1457 }); 1458 }, 1459 queue: function(type, data) { 1460 if (typeof type !== "string") { 1461 data = type; 1462 type = "fx"; 1463 } 1464 1465 if (data === undefined) 1466 return jQuery.queue(this[0], type); 1467 1468 return this.each(function() { 1469 var queue = jQuery.queue(this, type, data); 1470 1471 if (type == "fx" && queue.length == 1) 1472 queue[0].call(this); 1473 }); 1474 }, 1475 dequeue: function(type) { 1476 return this.each(function() { 1477 jQuery.dequeue(this, type); 1478 }); 1479 } 1480 }); /*! 1481 * Sizzle CSS Selector Engine - v0.9.3
1482 * Copyright 2009, The Dojo Foundation 1483 * Released under the MIT, BSD, and GPL Licenses. 1484 * More information: http://sizzlejs.com/ 1485 */ 1486 (function() { 1487 1488 var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, 1489 done = 0, 1490 toString = Object.prototype.toString; 1491 1492 var Sizzle = function(selector, context, results, seed) { 1493 results = results || []; 1494 context = context || document; 1495 1496 if (context.nodeType !== 1 && context.nodeType !== 9) 1497 return []; 1498 1499 if (!selector || typeof selector !== "string") { 1500 return results; 1501 } 1502 1503 var parts = [], m, set, checkSet, check, mode, extra, prune = true; 1504 1505 // Reset the position of the chunker regexp (start from head) 1506 chunker.lastIndex = 0; 1507 1508 while ((m = chunker.exec(selector)) !== null) { 1509 parts.push(m[1]); 1510 1511 if (m[2]) { 1512 extra = RegExp.rightContext; 1513 break; 1514 } 1515 } 1516 1517 if (parts.length > 1 && origPOS.exec(selector)) { 1518 if (parts.length === 2 && Expr.relative[parts[0]]) { 1519 set = posProcess(parts[0] + parts[1], context); 1520 } else { 1521 set = Expr.relative[parts[0]] ? 1522 [context] : 1523 Sizzle(parts.shift(), context); 1524 1525 while (parts.length) { 1526 selector = parts.shift(); 1527 1528 if (Expr.relative[selector]) 1529 selector += parts.shift(); 1530 1531 set = posProcess(selector, set); 1532 } 1533 } 1534 } else { 1535 var ret = seed ? 1536 { expr: parts.pop(), set: makeArray(seed)} : 1537 Sizzle.find(parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context)); 1538 set = Sizzle.filter(ret.expr, ret.set); 1539 1540 if (parts.length > 0) { 1541 checkSet = makeArray(set); 1542 } else { 1543 prune = false;
vendor: 5,248 bytes, lines 1544-1680
1544 } 1545 1546 while (parts.length) { 1547 var cur = parts.pop(), pop = cur; 1548 1549 if (!Expr.relative[cur]) { 1550 cur = ""; 1551 } else { 1552 pop = parts.pop(); 1553 } 1554 1555 if (pop == null) { 1556 pop = context; 1557 } 1558 1559 Expr.relative[cur](checkSet, pop, isXML(context)); 1560 } 1561 } 1562 1563 if (!checkSet) { 1564 checkSet = set; 1565 } 1566 1567 if (!checkSet) { 1568 throw "Syntax error, unrecognized expression: " + (cur || selector); 1569 } 1570 1571 if (toString.call(checkSet) === "[object Array]") { 1572 if (!prune) { 1573 results.push.apply(results, checkSet); 1574 } else if (context.nodeType === 1) { 1575 for (var i = 0; checkSet[i] != null; i++) { 1576 if (checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i]))) { 1577 results.push(set[i]); 1578 } 1579 } 1580 } else { 1581 for (var i = 0; checkSet[i] != null; i++) { 1582 if (checkSet[i] && checkSet[i].nodeType === 1) { 1583 results.push(set[i]); 1584 } 1585 } 1586 } 1587 } else { 1588 makeArray(checkSet, results); 1589 } 1590 1591 if (extra) { 1592 Sizzle(extra, context, results, seed); 1593 1594 if (sortOrder) { 1595 hasDuplicate = false; 1596 results.sort(sortOrder); 1597 1598 if (hasDuplicate) { 1599 for (var i = 1; i < results.length; i++) { 1600 if (results[i] === results[i - 1]) { 1601 results.splice(i--, 1); 1602 } 1603 } 1604 } 1605 } 1606 } 1607 1608 return results; 1609 }; 1610 1611 Sizzle.matches = function(expr, set) { 1612 return Sizzle(expr, null, null, set); 1613 }; 1614 1615 Sizzle.find = function(expr, context, isXML) { 1616 var set, match; 1617 1618 if (!expr) { 1619 return []; 1620 } 1621 1622 for (var i = 0, l = Expr.order.length; i < l; i++) { 1623 var type = Expr.order[i], match; 1624 1625 if ((match = Expr.match[type].exec(expr))) { 1626 var left = RegExp.leftContext; 1627 1628 if (left.substr(left.length - 1) !== "\\") { 1629 match[1] = (match[1] || "").replace(/\\/g, ""); 1630 set = Expr.find[type](match, context, isXML); 1631 if (set != null) { 1632 expr = expr.replace(Expr.match[type], ""); 1633 break; 1634 } 1635 } 1636 } 1637 } 1638 1639 if (!set) { 1640 set = context.getElementsByTagName("*"); 1641 } 1642 1643 return { set: set, expr: expr }; 1644 }; 1645 1646 Sizzle.filter = function(expr, set, inplace, not) { 1647 var old = expr, result = [], curLoop = set, match, anyFound, 1648 isXMLFilter = set && set[0] && isXML(set[0]); 1649 1650 while (expr && set.length) { 1651 for (var type in Expr.filter) { 1652 if ((match = Expr.match[type].exec(expr)) != null) { 1653 var filter = Expr.filter[type], found, item; 1654 anyFound = false; 1655 1656 if (curLoop == result) { 1657 result = []; 1658 } 1659 1660 if (Expr.preFilter[type]) { 1661 match = Expr.preFilter[type](match, curLoop, inplace, result, not, isXMLFilter); 1662 1663 if (!match) { 1664 anyFound = found = true; 1665 } else if (match === true) { 1666 continue; 1667 } 1668 } 1669 1670 if (match) { 1671 for (var i = 0; (item = curLoop[i]) != null; i++) { 1672 if (item) { 1673 found = filter(item, match, i, curLoop); 1674 var pass = not ^ !!found; 1675 1676 if (inplace && found != null) { 1677 if (pass) { 1678 anyFound = true; 1679 } else { 1680 curLoop[i] = false;
1681 } 1682 } else if (pass) { 1683 result.push(item); 1684 anyFound = true; 1685 } 1686 } 1687 } 1688 } 1689 1690 if (found !== undefined) { 1691 if (!inplace) { 1692 curLoop = result; 1693 } 1694 1695 expr = expr.replace(Expr.match[type], ""); 1696 1697 if (!anyFound) { 1698 return []; 1699 } 1700 1701 break; 1702 } 1703 } 1704 } 1705 1706 // Improper expression 1707 if (expr == old) { 1708 if (anyFound == null) { 1709 throw "Syntax error, unrecognized expression: " + expr; 1710 } else { 1711 break; 1712 } 1713 } 1714 1715 old = expr; 1716 } 1717 1718 return curLoop; 1719 }; 1720 1721 var Expr = Sizzle.selectors = { 1722 order: ["ID", "NAME", "TAG"], 1723 match: { 1724 ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, 1725 CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, 1726 NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, 1727 ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, 1728 TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, 1729 CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, 1730 POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, 1731 PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ 1732 }, 1733 attrMap: { 1734 "class": "className", 1735 "for": "htmlFor" 1736 }, 1737 attrHandle: { 1738 href: function(elem) { 1739 return elem.getAttribute("href"); 1740 } 1741 }, 1742 relative: { 1743 "+": function(checkSet, part, isXML) { 1744 var isPartStr = typeof part === "string", 1745 isTag = isPartStr && !/\W/.test(part), 1746 isPartStrNotTag = isPartStr && !isTag; 1747 1748 if (isTag && !isXML) { 1749 part = part.toUpperCase(); 1750 } 1751 1752 for (var i = 0, l = checkSet.length, elem; i < l; i++) { 1753 if ((elem = checkSet[i])) { 1754 while ((elem = elem.previousSibling) && elem.nodeType !== 1) { } 1755 1756 checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? 1757 elem || false : 1758 elem === part; 1759 } 1760 } 1761 1762 if (isPartStrNotTag) { 1763 Sizzle.filter(part, checkSet, true); 1764 } 1765 }, 1766 ">": function(checkSet, part, isXML) { 1767 var isPartStr = typeof part === "string"; 1768 1769 if (isPartStr && !/\W/.test(part)) { 1770 part = isXML ? part : part.toUpperCase(); 1771 1772 for (var i = 0, l = checkSet.length; i < l; i++) { 1773 var elem = checkSet[i]; 1774 if (elem) { 1775 var parent = elem.parentNode; 1776 checkSet[i] = parent.nodeName === part ? parent : false; 1777 } 1778 } 1779 } else { 1780 for (var i = 0, l = checkSet.length; i < l; i++) { 1781 var elem = checkSet[i]; 1782 if (elem) { 1783 checkSet[i] = isPartStr ? 1784 elem.parentNode : 1785 elem.parentNode === part; 1786 } 1787 } 1788 1789 if (isPartStr) { 1790 Sizzle.filter(part, checkSet, true); 1791 } 1792 } 1793 }, 1794 "": function(checkSet, part, isXML) { 1795 var doneName = done++, checkFn = dirCheck; 1796 1797 if (!part.match(/\W/)) { 1798 var nodeCheck = part = isXML ? part : part.toUpperCase(); 1799 checkFn = dirNodeCheck; 1800 } 1801 1802 checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); 1803 }, 1804 "~": function(checkSet, part, isXML) { 1805 var doneName = done++, checkFn = dirCheck; 1806 1807 if (typeof part === "string" && !part.match(/\W/)) { 1808 var nodeCheck = part = isXML ? part : part.toUpperCase(); 1809 checkFn = dirNodeCheck; 1810 } 1811 1812 checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); 1813 } 1814 }, 1815 find: { 1816 ID: function(match, context, isXML) { 1817 if (typeof context.getElementById !== "undefined" && !isXML) { 1818 var m = context.getElementById(match[1]); 1819 return m ? [m] : []; 1820 } 1821 }, 1822 NAME: function(match, context, isXML) { 1823 if (typeof context.getElementsByName !== "undefined") { 1824 var ret = [], results = context.getElementsByName(match[1]); 1825 1826 for (var i = 0, l = results.length; i < l; i++) { 1827 if (results[i].getAttribute("name") === match[1]) {
vendor: 8,416 bytes, lines 1828-2018
1828 ret.push(results[i]); 1829 } 1830 } 1831 1832 return ret.length === 0 ? null : ret; 1833 } 1834 }, 1835 TAG: function(match, context) { 1836 return context.getElementsByTagName(match[1]); 1837 } 1838 }, 1839 preFilter: { 1840 CLASS: function(match, curLoop, inplace, result, not, isXML) { 1841 match = " " + match[1].replace(/\\/g, "") + " "; 1842 1843 if (isXML) { 1844 return match; 1845 } 1846 1847 for (var i = 0, elem; (elem = curLoop[i]) != null; i++) { 1848 if (elem) { 1849 if (not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0)) { 1850 if (!inplace) 1851 result.push(elem); 1852 } else if (inplace) { 1853 curLoop[i] = false; 1854 } 1855 } 1856 } 1857 1858 return false; 1859 }, 1860 ID: function(match) { 1861 return match[1].replace(/\\/g, ""); 1862 }, 1863 TAG: function(match, curLoop) { 1864 for (var i = 0; curLoop[i] === false; i++) { } 1865 return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); 1866 }, 1867 CHILD: function(match) { 1868 if (match[1] == "nth") { 1869 // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' 1870 var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( 1871 match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || 1872 !/\D/.test(match[2]) && "0n+" + match[2] || match[2]); 1873 1874 // calculate the numbers (first)n+(last) including if they are negative 1875 match[2] = (test[1] + (test[2] || 1)) - 0; 1876 match[3] = test[3] - 0; 1877 } 1878 1879 // TODO: Move to normal caching system 1880 match[0] = done++; 1881 1882 return match; 1883 }, 1884 ATTR: function(match, curLoop, inplace, result, not, isXML) { 1885 var name = match[1].replace(/\\/g, ""); 1886 1887 if (!isXML && Expr.attrMap[name]) { 1888 match[1] = Expr.attrMap[name]; 1889 } 1890 1891 if (match[2] === "~=") { 1892 match[4] = " " + match[4] + " "; 1893 } 1894 1895 return match; 1896 }, 1897 PSEUDO: function(match, curLoop, inplace, result, not) { 1898 if (match[1] === "not") { 1899 // If we're dealing with a complex expression, or a simple one 1900 if (match[3].match(chunker).length > 1 || /^\w/.test(match[3])) { 1901 match[3] = Sizzle(match[3], null, null, curLoop); 1902 } else { 1903 var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); 1904 if (!inplace) { 1905 result.push.apply(result, ret); 1906 } 1907 return false; 1908 } 1909 } else if (Expr.match.POS.test(match[0]) || Expr.match.CHILD.test(match[0])) { 1910 return true; 1911 } 1912 1913 return match; 1914 }, 1915 POS: function(match) { 1916 match.unshift(true); 1917 return match; 1918 } 1919 }, 1920 filters: { 1921 enabled: function(elem) { 1922 return elem.disabled === false && elem.type !== "hidden"; 1923 }, 1924 disabled: function(elem) { 1925 return elem.disabled === true; 1926 }, 1927 checked: function(elem) { 1928 return elem.checked === true; 1929 }, 1930 selected: function(elem) { 1931 // Accessing this property makes selected-by-default 1932 // options in Safari work properly 1933 elem.parentNode.selectedIndex; 1934 return elem.selected === true; 1935 }, 1936 parent: function(elem) { 1937 return !!elem.firstChild; 1938 }, 1939 empty: function(elem) { 1940 return !elem.firstChild; 1941 }, 1942 has: function(elem, i, match) { 1943 return !!Sizzle(match[3], elem).length; 1944 }, 1945 header: function(elem) { 1946 return /h\d/i.test(elem.nodeName); 1947 }, 1948 text: function(elem) { 1949 return "text" === elem.type; 1950 }, 1951 radio: function(elem) { 1952 return "radio" === elem.type; 1953 }, 1954 checkbox: function(elem) { 1955 return "checkbox" === elem.type; 1956 }, 1957 file: function(elem) { 1958 return "file" === elem.type; 1959 }, 1960 password: function(elem) { 1961 return "password" === elem.type; 1962 }, 1963 submit: function(elem) { 1964 return "submit" === elem.type; 1965 }, 1966 image: function(elem) { 1967 return "image" === elem.type; 1968 }, 1969 reset: function(elem) { 1970 return "reset" === elem.type; 1971 }, 1972 button: function(elem) { 1973 return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; 1974 }, 1975 input: function(elem) { 1976 return /input|select|textarea|button/i.test(elem.nodeName); 1977 } 1978 }, 1979 setFilters: { 1980 first: function(elem, i) { 1981 return i === 0; 1982 }, 1983 last: function(elem, i, match, array) { 1984 return i === array.length - 1; 1985 }, 1986 even: function(elem, i) { 1987 return i % 2 === 0; 1988 }, 1989 odd: function(elem, i) { 1990 return i % 2 === 1; 1991 }, 1992 lt: function(elem, i, match) { 1993 return i < match[3] - 0; 1994 }, 1995 gt: function(elem, i, match) { 1996 return i > match[3] - 0; 1997 }, 1998 nth: function(elem, i, match) { 1999 return match[3] - 0 == i; 2000 }, 2001 eq: function(elem, i, match) { 2002 return match[3] - 0 == i; 2003 } 2004 }, 2005 filter: { 2006 PSEUDO: function(elem, match, i, array) { 2007 var name = match[1], filter = Expr.filters[name]; 2008 2009 if (filter) { 2010 return filter(elem, i, match, array); 2011 } else if (name === "contains") { 2012 return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; 2013 } else if (name === "not") { 2014 var not = match[3]; 2015 2016 for (var i = 0, l = not.length; i < l; i++) { 2017 if (not[i] === elem) { 2018 return false;
2019 } 2020 } 2021 2022 return true; 2023 } 2024 }, 2025 CHILD: function(elem, match) { 2026 var type = match[1], node = elem; 2027 switch (type) { 2028 case 'only': 2029 case 'first': 2030 while (node = node.previousSibling) { 2031 if (node.nodeType === 1) return false; 2032 } 2033 if (type == 'first') return true; 2034 node = elem; 2035 case 'last': 2036 while (node = node.nextSibling) { 2037 if (node.nodeType === 1) return false; 2038 } 2039 return true; 2040 case 'nth': 2041 var first = match[2], last = match[3]; 2042 2043 if (first == 1 && last == 0) { 2044 return true; 2045 } 2046 2047 var doneName = match[0], 2048 parent = elem.parentNode; 2049 2050 if (parent && (parent.sizcache !== doneName || !elem.nodeIndex)) { 2051 var count = 0; 2052 for (node = parent.firstChild; node; node = node.nextSibling) { 2053 if (node.nodeType === 1) { 2054 node.nodeIndex = ++count; 2055 } 2056 } 2057 parent.sizcache = doneName; 2058 } 2059 2060 var diff = elem.nodeIndex - last; 2061 if (first == 0) { 2062 return diff == 0; 2063 } else { 2064 return (diff % first == 0 && diff / first >= 0); 2065 } 2066 } 2067 }, 2068 ID: function(elem, match) { 2069 return elem.nodeType === 1 && elem.getAttribute("id") === match; 2070 }, 2071 TAG: function(elem, match) { 2072 return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; 2073 }, 2074 CLASS: function(elem, match) { 2075 return (" " + (elem.className || elem.getAttribute("class")) + " ") 2076 .indexOf(match) > -1; 2077 }, 2078 ATTR: function(elem, match) { 2079 var name = match[1], 2080 result = Expr.attrHandle[name] ? 2081 Expr.attrHandle[name](elem) : 2082 elem[name] != null ? 2083 elem[name] : 2084 elem.getAttribute(name), 2085 value = result + "", 2086 type = match[2], 2087 check = match[4]; 2088 2089 return result == null ? 2090 type === "!=" : 2091 type === "=" ? 2092 value === check : 2093 type === "*=" ? 2094 value.indexOf(check) >= 0 : 2095 type === "~=" ? 2096 (" " + value + " ").indexOf(check) >= 0 : 2097 !check ? 2098 value && result !== false : 2099 type === "!=" ? 2100 value != check : 2101 type === "^=" ? 2102 value.indexOf(check) === 0 : 2103 type === "$=" ? 2104 value.substr(value.length - check.length) === check : 2105 type === "|=" ? 2106 value === check || value.substr(0, check.length + 1) === check + "-" : 2107 false; 2108 }, 2109 POS: function(elem, match, i, array) { 2110 var name = match[2], filter = Expr.setFilters[name]; 2111 2112 if (filter) { 2113 return filter(elem, i, match, array); 2114 } 2115 } 2116 } 2117 }; 2118 2119 var origPOS = Expr.match.POS; 2120 2121 for (var type in Expr.match) { 2122 Expr.match[type] = RegExp(Expr.match[type].source + /(?![^\[]*\])(?![^\(]*\))/.source); 2123 } 2124 2125 var makeArray = function(array, results) { 2126 array = Array.prototype.slice.call(array); 2127 2128 if (results) { 2129 results.push.apply(results, array); 2130 return results; 2131 } 2132 2133 return array; 2134 }; 2135 2136 // Perform a simple check to determine if the browser is capable of
vendor: 5,673 bytes, lines 2137-2268
2137 // converting a NodeList to an array using builtin methods. 2138 try { 2139 Array.prototype.slice.call(document.documentElement.childNodes); 2140 2141 // Provide a fallback method if it does not work 2142 } catch (e) { 2143 makeArray = function(array, results) { 2144 var ret = results || []; 2145 2146 if (toString.call(array) === "[object Array]") { 2147 Array.prototype.push.apply(ret, array); 2148 } else { 2149 if (typeof array.length === "number") { 2150 for (var i = 0, l = array.length; i < l; i++) { 2151 ret.push(array[i]); 2152 } 2153 } else { 2154 for (var i = 0; array[i]; i++) { 2155 ret.push(array[i]); 2156 } 2157 } 2158 } 2159 2160 return ret; 2161 }; 2162 } 2163 2164 var sortOrder; 2165 2166 if (document.documentElement.compareDocumentPosition) { 2167 sortOrder = function(a, b) { 2168 var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; 2169 if (ret === 0) { 2170 hasDuplicate = true; 2171 } 2172 return ret; 2173 }; 2174 } else if ("sourceIndex" in document.documentElement) { 2175 sortOrder = function(a, b) { 2176 var ret = a.sourceIndex - b.sourceIndex; 2177 if (ret === 0) { 2178 hasDuplicate = true; 2179 } 2180 return ret; 2181 }; 2182 } else if (document.createRange) { 2183 sortOrder = function(a, b) { 2184 var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); 2185 aRange.selectNode(a); 2186 aRange.collapse(true); 2187 bRange.selectNode(b); 2188 bRange.collapse(true); 2189 var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); 2190 if (ret === 0) { 2191 hasDuplicate = true; 2192 } 2193 return ret; 2194 }; 2195 } 2196 2197 // Check to see if the browser returns elements by name when 2198 // querying by getElementById (and provide a workaround) 2199 (function() { 2200 // We're going to inject a fake input element with a specified name 2201 var form = document.createElement("form"), 2202 id = "script" + (new Date).getTime(); 2203 form.innerHTML = "<input name='" + id + "'/>"; 2204 2205 // Inject it into the root element, check its status, and remove it quickly 2206 var root = document.documentElement; 2207 root.insertBefore(form, root.firstChild); 2208 2209 // The workaround has to do additional checks after a getElementById 2210 // Which slows things down for other browsers (hence the branching) 2211 if (!!document.getElementById(id)) { 2212 Expr.find.ID = function(match, context, isXML) { 2213 if (typeof context.getElementById !== "undefined" && !isXML) { 2214 var m = context.getElementById(match[1]); 2215 return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; 2216 } 2217 }; 2218 2219 Expr.filter.ID = function(elem, match) { 2220 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 2221 return elem.nodeType === 1 && node && node.nodeValue === match; 2222 }; 2223 } 2224 2225 root.removeChild(form); 2226 })(); 2227 2228 (function() { 2229 // Check to see if the browser returns only elements 2230 // when doing getElementsByTagName("*") 2231 2232 // Create a fake element 2233 var div = document.createElement("div"); 2234 div.appendChild(document.createComment("")); 2235 2236 // Make sure no comments are found 2237 if (div.getElementsByTagName("*").length > 0) { 2238 Expr.find.TAG = function(match, context) { 2239 var results = context.getElementsByTagName(match[1]); 2240 2241 // Filter out possible comments 2242 if (match[1] === "*") { 2243 var tmp = []; 2244 2245 for (var i = 0; results[i]; i++) { 2246 if (results[i].nodeType === 1) { 2247 tmp.push(results[i]); 2248 } 2249 } 2250 2251 results = tmp; 2252 } 2253 2254 return results; 2255 }; 2256 } 2257 2258 // Check to see if an attribute returns normalized href attributes 2259 div.innerHTML = "<a href='#'></a>"; 2260 if (div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && 2261 div.firstChild.getAttribute("href") !== "#") { 2262 Expr.attrHandle.href = function(elem) { 2263 return elem.getAttribute("href", 2); 2264 }; 2265 } 2266 })(); 2267 2268 if (document.querySelectorAll) (function() {
2269 var oldSizzle = Sizzle, div = document.createElement("div"); 2270 div.innerHTML = "<p class='TEST'></p>"; 2271 2272 // Safari can't handle uppercase or unicode characters when 2273 // in quirks mode. 2274 if (div.querySelectorAll && div.querySelectorAll(".TEST").length === 0) { 2275 return; 2276 } 2277 2278 Sizzle = function(query, context, extra, seed) { 2279 context = context || document; 2280 2281 // Only use querySelectorAll on non-XML documents 2282 // (ID selectors don't work in non-HTML documents) 2283 if (!seed && context.nodeType === 9 && !isXML(context)) { 2284 try { 2285 return makeArray(context.querySelectorAll(query), extra); 2286 } catch (e) { } 2287 } 2288 2289 return oldSizzle(query, context, extra, seed); 2290 }; 2291 2292 Sizzle.find = oldSizzle.find; 2293 Sizzle.filter = oldSizzle.filter; 2294 Sizzle.selectors = oldSizzle.selectors; 2295 Sizzle.matches = oldSizzle.matches; 2296 })(); 2297 2298 if (document.getElementsByClassName && document.documentElement.getElementsByClassName) (function() { 2299 var div = document.createElement("div"); 2300 div.innerHTML = "<div class='test e'></div><div class='test'></div>"; 2301 2302 // Opera can't find a second classname (in 9.6) 2303 if (div.getElementsByClassName("e").length === 0) 2304 return; 2305 2306 // Safari caches class attributes, doesn't catch changes (in 3.2)
2307 div.lastChild.className = "e"; 2308 2309 if (div.getElementsByClassName("e").length === 1) 2310 return; 2311 2312 Expr.order.splice(1, 0, "CLASS"); 2313 Expr.find.CLASS = function(match, context, isXML) { 2314 if (typeof context.getElementsByClassName !== "undefined" && !isXML) { 2315 return context.getElementsByClassName(match[1]); 2316 } 2317 }; 2318 })(); 2319 2320 function dirNodeCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) { 2321 var sibDir = dir == "previousSibling" && !isXML; 2322 for (var i = 0, l = checkSet.length; i < l; i++) { 2323 var elem = checkSet[i]; 2324 if (elem) { 2325 if (sibDir && elem.nodeType === 1) { 2326 elem.sizcache = doneName; 2327 elem.sizset = i; 2328 } 2329 elem = elem[dir]; 2330 var match = false; 2331 2332 while (elem) { 2333 if (elem.sizcache === doneName) { 2334 match = checkSet[elem.sizset]; 2335 break; 2336 } 2337 2338 if (elem.nodeType === 1 && !isXML) { 2339 elem.sizcache = doneName; 2340 elem.sizset = i; 2341 } 2342 2343 if (elem.nodeName === cur) { 2344 match = elem; 2345 break; 2346 } 2347 2348 elem = elem[dir]; 2349 } 2350 2351 checkSet[i] = match; 2352 } 2353 } 2354 } 2355 2356 function dirCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) { 2357 var sibDir = dir == "previousSibling" && !isXML; 2358 for (var i = 0, l = checkSet.length; i < l; i++) { 2359 var elem = checkSet[i]; 2360 if (elem) { 2361 if (sibDir && elem.nodeType === 1) { 2362 elem.sizcache = doneName; 2363 elem.sizset = i; 2364 } 2365 elem = elem[dir]; 2366 var match = false; 2367 2368 while (elem) { 2369 if (elem.sizcache === doneName) { 2370 match = checkSet[elem.sizset]; 2371 break; 2372 } 2373 2374 if (elem.nodeType === 1) { 2375 if (!isXML) { 2376 elem.sizcache = doneName; 2377 elem.sizset = i; 2378 } 2379 if (typeof cur !== "string") { 2380 if (elem === cur) { 2381 match = true; 2382 break; 2383 } 2384 2385 } else if (Sizzle.filter(cur, [elem]).length > 0) { 2386 match = elem; 2387 break; 2388 } 2389 } 2390 2391 elem = elem[dir]; 2392 } 2393 2394 checkSet[i] = match; 2395 } 2396 } 2397 } 2398 2399 var contains = document.compareDocumentPosition ? function(a, b) { 2400 return a.compareDocumentPosition(b) & 16; 2401 } : function(a, b) { 2402 return a !== b && (a.contains ? a.contains(b) : true); 2403 }; 2404 2405 var isXML = function(elem) { 2406 return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || 2407 !!elem.ownerDocument && isXML(elem.ownerDocument); 2408 }; 2409 2410 var posProcess = function(selector, context) { 2411 var tmpSet = [], later = "", match, 2412 root = context.nodeType ? [context] : context; 2413 2414 // Position selectors must be done after the filter 2415 // And so must :not(positional) so we move all PSEUDOs to the end 2416 while ((match = Expr.match.PSEUDO.exec(selector))) { 2417 later += match[0]; 2418 selector = selector.replace(Expr.match.PSEUDO, ""); 2419 } 2420 2421 selector = Expr.relative[selector] ? selector + "*" : selector; 2422 2423 for (var i = 0, l = root.length; i < l; i++) { 2424 Sizzle(selector, root[i], tmpSet); 2425 } 2426 2427 return Sizzle.filter(later, tmpSet); 2428 }; 2429 2430 // EXPOSE 2431 jQuery.find = Sizzle; 2432 jQuery.filter = Sizzle.filter; 2433 jQuery.expr = Sizzle.selectors; 2434 jQuery.expr[":"] = jQuery.expr.filters; 2435 2436 Sizzle.selectors.filters.hidden = function(elem) { 2437 return elem.offsetWidth === 0 || elem.offsetHeight === 0; 2438 }; 2439 2440 Sizzle.selectors.filters.visible = function(elem) { 2441 return elem.offsetWidth > 0 || elem.offsetHeight > 0; 2442 }; 2443 2444 Sizzle.selectors.filters.animated = function(elem) { 2445 return jQuery.grep(jQuery.timers, function(fn) { 2446 return elem === fn.elem; 2447 }).length; 2448 }; 2449 2450 jQuery.multiFilter = function(expr, elems, not) { 2451 if (not) { 2452 expr = ":not(" + expr + ")"; 2453 } 2454 2455 return Sizzle.matches(expr, elems); 2456 }; 2457 2458 jQuery.dir = function(elem, dir) { 2459 var matched = [], cur = elem[dir]; 2460 while (cur && cur != document) { 2461 if (cur.nodeType == 1) 2462 matched.push(cur); 2463 cur = cur[dir]; 2464 } 2465 return matched; 2466 }; 2467 2468 jQuery.nth = function(cur, result, dir, elem) { 2469 result = result || 1; 2470 var num = 0; 2471 2472 for (; cur; cur = cur[dir]) 2473 if (cur.nodeType == 1 && ++num == result) 2474 break; 2475 2476 return cur; 2477 }; 2478 2479 jQuery.sibling = function(n, elem) { 2480 var r = []; 2481 2482 for (; n; n = n.nextSibling) { 2483 if (n.nodeType == 1 && n != elem) 2484 r.push(n); 2485 } 2486 2487 return r; 2488 }; 2489 2490 return; 2491
2492 window.Sizzle = Sizzle; 2493 2494 })(); 2495 /* 2496 * A number of helper functions used for managing events. 2497 * Many of the ideas behind this code originated from 2498 * Dean Edwards' addEvent library. 2499 */ 2500 jQuery.event = { 2501 2502 // Bind an event to an element 2503 // Original by Dean Edwards 2504 add: function(elem, types, handler, data) { 2505 if (elem.nodeType == 3 || elem.nodeType == 8) 2506 return; 2507 2508 // For whatever reason, IE has trouble passing the window object 2509 // around, causing it to be cloned in the process 2510 if (elem.setInterval && elem != window) 2511 elem = window; 2512 2513 // Make sure that the function being executed has a unique ID 2514 if (!handler.guid) 2515 handler.guid = this.guid++; 2516 2517 // if data is passed, bind to handler 2518 if (data !== undefined) { 2519 // Create temporary function pointer to original handler 2520 var fn = handler; 2521 2522 // Create unique handler function, wrapped around original handler 2523 handler = this.proxy(fn); 2524 2525 // Store data in unique handler 2526 handler.data = data; 2527 } 2528 2529 // Init the element's event structure 2530 var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), 2531 handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function() { 2532 // Handle the second event of a trigger and when 2533 // an event is called after a page has unloaded 2534 return typeof jQuery !== "undefined" && !jQuery.event.triggered ? 2535 jQuery.event.handle.apply(arguments.callee.elem, arguments) : 2536 undefined; 2537 }); 2538 // Add elem as a property of the handle function 2539 // This is to prevent a memory leak with non-native 2540 // event in IE. 2541 handle.elem = elem; 2542 2543 // Handle multiple events separated by a space 2544 // jQuery(...).bind("mouseover mouseout", fn); 2545 jQuery.each(types.split(/\s+/), function(index, type) { 2546 // Namespaced event handlers 2547 var namespaces = type.split("."); 2548 type = namespaces.shift(); 2549 handler.type = namespaces.slice().sort().join("."); 2550 2551 // Get the current list of functions bound to this event 2552 var handlers = events[type]; 2553 2554 if (jQuery.event.specialAll[type]) 2555 jQuery.event.specialAll[type].setup.call(elem, data, namespaces); 2556 2557 // Init the event handler queue 2558 if (!handlers) { 2559 handlers = events[type] = {}; 2560 2561 // Check for a special event handler 2562 // Only use addEventListener/attachEvent if the special 2563 // events handler returns false 2564 if (!jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false) { 2565 // Bind the global event handler to the element 2566 if (elem.addEventListener) 2567 elem.addEventListener(type, handle, false); 2568 else if (elem.attachEvent) 2569 elem.attachEvent("on" + type, handle); 2570 } 2571 } 2572 2573 // Add the function to the element's handler list 2574 handlers[handler.guid] = handler; 2575 2576 // Keep track of which events have been used, for global triggering 2577 jQuery.event.global[type] = true; 2578 }); 2579 2580 // Nullify elem to prevent memory leaks in IE 2581 elem = null; 2582 }, 2583 2584 guid: 1, 2585 global: {}, 2586 2587 // Detach an event or set of events from an element 2588 remove: function(elem, types, handler) { 2589 // don't do events on text and comment nodes 2590 if (elem.nodeType == 3 || elem.nodeType == 8) 2591 return; 2592 2593 var events = jQuery.data(elem, "events"), ret, index; 2594 2595 if (events) { 2596 // Unbind all events for the element 2597 if (types === undefined || (typeof types === "string" && types.charAt(0) == ".")) 2598 for (var type in events) 2599 this.remove(elem, type + (types || "")); 2600 else { 2601 // types is actually an event object here 2602 if (types.type) { 2603 handler = types.handler; 2604 types = types.type; 2605 } 2606 2607 // Handle multiple events seperated by a space 2608 // jQuery(...).unbind("mouseover mouseout", fn); 2609 jQuery.each(types.split(/\s+/), function(index, type) { 2610 // Namespaced event handlers 2611 var namespaces = type.split("."); 2612 type = namespaces.shift(); 2613 var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); 2614 2615 if (events[type]) { 2616 // remove the given handler for the given type 2617 if (handler) 2618 delete events[type][handler.guid]; 2619 2620 // remove all handlers for the given type 2621 else 2622 for (var handle in events[type]) 2623 // Handle the removal of namespaced events 2624 if (namespace.test(events[type][handle].type)) 2625 delete events[type][handle]; 2626 2627 if (jQuery.event.specialAll[type]) 2628 jQuery.event.specialAll[type].teardown.call(elem, namespaces); 2629 2630 // remove generic event handler if no more handlers exist 2631 for (ret in events[type]) break; 2632 if (!ret) { 2633 if (!jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false) { 2634 if (elem.removeEventListener) 2635 elem.removeEventListener(type, jQuery.data(elem, "handle"), false); 2636 else if (elem.detachEvent) 2637 elem.detachEvent("on" + type, jQuery.data(elem, "handle")); 2638 } 2639 ret = null; 2640 delete events[type]; 2641 } 2642 } 2643 }); 2644 } 2645 2646 // Remove the expando if it's no longer used 2647 for (ret in events) break; 2648 if (!ret) { 2649 var handle = jQuery.data(elem, "handle"); 2650 if (handle) handle.elem = null; 2651 jQuery.removeData(elem, "events"); 2652 jQuery.removeData(elem, "handle"); 2653 } 2654 } 2655 }, 2656 2657 // bubbling is internal 2658 trigger: function(event, data, elem, bubbling) { 2659 // Event object or event type 2660 var type = event.type || event; 2661 2662 if (!bubbling) { 2663 event = typeof event === "object" ? 2664 // jQuery.Event object 2665 event[expando] ? event : 2666 // Object literal 2667 jQuery.extend(jQuery.Event(type), event) : 2668 // Just the event type (string) 2669 jQuery.Event(type); 2670 2671 if (type.indexOf("!") >= 0) { 2672 event.type = type = type.slice(0, -1); 2673 event.exclusive = true; 2674 } 2675 2676 // Handle a global trigger 2677 if (!elem) { 2678 // Don't bubble custom events when global (to avoid too much overhead) 2679 event.stopPropagation(); 2680 // Only trigger if we've ever bound an event for it 2681 if (this.global[type]) 2682 jQuery.each(jQuery.cache, function() { 2683 if (this.events && this.events[type]) 2684 jQuery.event.trigger(event, data, this.handle.elem); 2685 }); 2686 } 2687 2688 // Handle triggering a single element 2689 2690 // don't do events on text and comment nodes 2691 if (!elem || elem.nodeType == 3 || elem.nodeType == 8) 2692 return undefined; 2693 2694 // Clean up in case it is reused 2695 event.result = undefined; 2696 event.target = elem; 2697 2698 // Clone the incoming data, if any 2699 data = jQuery.makeArray(data); 2700 data.unshift(event); 2701 } 2702 2703 event.currentTarget = elem; 2704 2705 // Trigger the event, it is assumed that "handle" is a function 2706 var handle = jQuery.data(elem, "handle"); 2707 if (handle) 2708 handle.apply(elem, data); 2709 2710 // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) 2711 if ((!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on" + type] && elem["on" + type].apply(elem, data) === false) 2712 event.result = false;
2713 2714 // Trigger the native events (except for clicks on links) 2715 if (!bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click")) { 2716 this.triggered = true; 2717 try { 2718 elem[type](); 2719 // prevent IE from throwing an error for some hidden elements 2720 } catch (e) { } 2721 } 2722 2723 this.triggered = false; 2724 2725 if (!event.isPropagationStopped()) { 2726 var parent = elem.parentNode || elem.ownerDocument; 2727 if (parent) 2728 jQuery.event.trigger(event, data, parent, true); 2729 } 2730 }, 2731 2732 handle: function(event) { 2733 // returned undefined or false 2734 var all, handlers; 2735 2736 event = arguments[0] = jQuery.event.fix(event || window.event); 2737 event.currentTarget = this; 2738 2739 // Namespaced event handlers 2740 var namespaces = event.type.split("."); 2741 event.type = namespaces.shift(); 2742 2743 // Cache this now, all = true means, any handler 2744 all = !namespaces.length && !event.exclusive; 2745 2746 var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); 2747 2748 handlers = (jQuery.data(this, "events") || {})[event.type]; 2749 2750 for (var j in handlers) { 2751 var handler = handlers[j]; 2752 2753 // Filter the functions by class 2754 if (all || namespace.test(handler.type)) { 2755 // Pass in a reference to the handler function itself 2756 // So that we can later remove it 2757 event.handler = handler; 2758 event.data = handler.data; 2759 2760 // Ektron Begin 2761 // Ektron Note: added try/catch 2762 try 2763 { 2764 // Ektron End 2765 var ret = handler.apply(this, arguments); 2766 // Ektron Begin 2767 } 2768 catch(ex) 2769 { 2770 Ektron.OnException.diagException(ex, arguments, handler); 2771 } 2772 // Ektron End 2773 if (ret !== undefined) { 2774 event.result = ret; 2775 if (ret === false) { 2776 event.preventDefault(); 2777 event.stopPropagation(); 2778 } 2779 } 2780 2781 if (event.isImmediatePropagationStopped()) 2782 break; 2783 2784 } 2785 } 2786 }, 2787 2788 props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), 2789 2790 fix: function(event) { 2791 if (event[expando]) 2792 return event; 2793 2794 // store a copy of the original event object 2795 // and "clone" to set read-only properties 2796 var originalEvent = event; 2797 event = jQuery.Event(originalEvent); 2798 2799 for (var i = this.props.length, prop; i; ) { 2800 prop = this.props[--i]; 2801 event[prop] = originalEvent[prop]; 2802 } 2803 2804 // Fix target property, if necessary 2805 if (!event.target) 2806 event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either 2807 2808 // check if target is a textnode (safari) 2809 if (event.target.nodeType == 3) 2810 event.target = event.target.parentNode; 2811 2812 // Add relatedTarget, if necessary 2813 if (!event.relatedTarget && event.fromElement) 2814 event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; 2815 2816 // Calculate pageX/Y if missing and clientX/Y available 2817 if (event.pageX == null && event.clientX != null) { 2818 var doc = document.documentElement, body = document.body; 2819 event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); 2820 event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); 2821 } 2822 2823 // Add which for key events 2824 if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode)) 2825 event.which = event.charCode || event.keyCode; 2826 2827 // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) 2828 if (!event.metaKey && event.ctrlKey) 2829 event.metaKey = event.ctrlKey; 2830 2831 // Add which for click: 1 == left; 2 == middle; 3 == right 2832 // Note: button is not normalized, so don't use it 2833 if (!event.which && event.button) 2834 event.which = (event.button & 1 ? 1 : (event.button & 2 ? 3 : (event.button & 4 ? 2 : 0))); 2835 2836 return event; 2837 }, 2838 2839 proxy: function(fn, proxy) { 2840 proxy = proxy || function() { return fn.apply(this, arguments); }; 2841 // Set the guid of unique handler to the same of original handler, so it can be removed 2842 proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; 2843 // So proxy can be declared as an argument 2844 return proxy; 2845 }, 2846 2847 special: { 2848 ready: { 2849 // Make sure the ready event is setup 2850 setup: bindReady, 2851 teardown: function() { } 2852 } 2853 }, 2854 2855 specialAll: { 2856 live: { 2857 setup: function(selector, namespaces) { 2858 jQuery.event.add(this, namespaces[0], liveHandler); 2859 }, 2860 teardown: function(namespaces) { 2861 if (namespaces.length) { 2862 var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); 2863 2864 jQuery.each((jQuery.data(this, "events").live || {}), function() {
2865 if (name.test(this.type)) 2866 remove++; 2867 }); 2868 2869 if (remove < 1) 2870 jQuery.event.remove(this, namespaces[0], liveHandler); 2871 } 2872 } 2873 } 2874 } 2875 }; 2876 2877 jQuery.Event = function(src) { 2878 // Allow instantiation without the 'new' keyword 2879 if (!this.preventDefault) 2880 return new jQuery.Event(src); 2881 2882 // Event object 2883 if (src && src.type) { 2884 this.originalEvent = src; 2885 this.type = src.type; 2886 // Event type 2887 } else 2888 this.type = src; 2889 2890 // timeStamp is buggy for some events on Firefox(#3843) 2891 // So we won't rely on the native value 2892 this.timeStamp = now(); 2893 2894 // Mark it as fixed 2895 this[expando] = true; 2896 }; 2897 2898 function returnFalse() { 2899 return false; 2900 } 2901 function returnTrue() { 2902 return true; 2903 } 2904 2905 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 2906 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 2907 jQuery.Event.prototype = { 2908 preventDefault: function() { 2909 this.isDefaultPrevented = returnTrue; 2910 2911 var e = this.originalEvent; 2912 if (!e) 2913 return; 2914 // if preventDefault exists run it on the original event 2915 if (e.preventDefault) 2916 e.preventDefault(); 2917 // otherwise set the returnValue property of the original event to false (IE) 2918 e.returnValue = false; 2919 }, 2920 stopPropagation: function() { 2921 this.isPropagationStopped = returnTrue; 2922 2923 var e = this.originalEvent; 2924 if (!e) 2925 return; 2926 // if stopPropagation exists run it on the original event 2927 if (e.stopPropagation) 2928 e.stopPropagation(); 2929 // otherwise set the cancelBubble property of the original event to true (IE) 2930 e.cancelBubble = true; 2931 }, 2932 stopImmediatePropagation: function() { 2933 this.isImmediatePropagationStopped = returnTrue; 2934 this.stopPropagation(); 2935 }, 2936 isDefaultPrevented: returnFalse, 2937 isPropagationStopped: returnFalse, 2938 isImmediatePropagationStopped: returnFalse 2939 }; 2940 // Checks if an event happened on an element within another element 2941 // Used in jQuery.event.special.mouseenter and mouseleave handlers 2942 var withinElement = function(event) { 2943 // Check if mouse(over|out) are still within the same parent element 2944 var parent = event.relatedTarget; 2945 // Traverse up the tree 2946 while (parent && parent != this) 2947 try { parent = parent.parentNode; } 2948 catch (e) { parent = this; } 2949 2950 if (parent != this) { 2951 // set the correct event type 2952 event.type = event.data; 2953 // handle event if we actually just moused on to a non sub-element 2954 jQuery.event.handle.apply(this, arguments); 2955 } 2956 }; 2957 2958 jQuery.each({ 2959 mouseover: 'mouseenter', 2960 mouseout: 'mouseleave' 2961 }, function(orig, fix) { 2962 jQuery.event.special[fix] = { 2963 setup: function() { 2964 jQuery.event.add(this, orig, withinElement, fix); 2965 }, 2966 teardown: function() { 2967 jQuery.event.remove(this, orig, withinElement); 2968 } 2969 }; 2970 }); 2971 2972 jQuery.fn.extend({ 2973 bind: function(type, data, fn) { 2974 return type == "unload" ? this.one(type, data, fn) : this.each(function() { 2975 jQuery.event.add(this, type, fn || data, fn && data); 2976 }); 2977 }, 2978 2979 one: function(type, data, fn) { 2980 var one = jQuery.event.proxy(fn || data, function(event) { 2981 jQuery(this).unbind(event, one); 2982 return (fn || data).apply(this, arguments); 2983 }); 2984 return this.each(function() { 2985 jQuery.event.add(this, type, one, fn && data); 2986 }); 2987 }, 2988
2989 unbind: function(type, fn) { 2990 return this.each(function() { 2991 jQuery.event.remove(this, type, fn); 2992 }); 2993 }, 2994 2995 trigger: function(type, data) { 2996 return this.each(function() { 2997 jQuery.event.trigger(type, data, this); 2998 }); 2999 }, 3000 3001 triggerHandler: function(type, data) { 3002 if (this[0]) { 3003 var event = jQuery.Event(type); 3004 event.preventDefault(); 3005 event.stopPropagation(); 3006 jQuery.event.trigger(event, data, this[0]); 3007 return event.result; 3008 } 3009 }, 3010 3011 toggle: function(fn) { 3012 // Save reference to arguments for access in closure 3013 var args = arguments, i = 1; 3014 3015 // link all the functions, so any of them can unbind this click handler 3016 while (i < args.length) 3017 jQuery.event.proxy(fn, args[i++]); 3018 3019 return this.click(jQuery.event.proxy(fn, function(event) { 3020 // Figure out which function to execute 3021 this.lastToggle = (this.lastToggle || 0) % i; 3022 3023 // Make sure that clicks stop 3024 event.preventDefault(); 3025 3026 // and execute the function 3027 return args[this.lastToggle++].apply(this, arguments) || false; 3028 })); 3029 }, 3030 3031 hover: function(fnOver, fnOut) { 3032 return this.mouseenter(fnOver).mouseleave(fnOut); 3033 }, 3034 3035 ready: function(fn) { 3036 // Attach the listeners 3037 bindReady(); 3038 3039 // If the DOM is already ready 3040 if (jQuery.isReady) 3041 // Execute the function immediately 3042 fn.call(document, jQuery); 3043 3044 // Otherwise, remember the function for later 3045 else 3046 // Add the function to the wait list 3047 jQuery.readyList.push(fn); 3048 3049 return this; 3050 }, 3051 3052 live: function(type, fn) { 3053 var proxy = jQuery.event.proxy(fn); 3054 proxy.guid += this.selector + type; 3055 3056 jQuery(document).bind(liveConvert(type, this.selector), this.selector, proxy); 3057 3058 return this; 3059 }, 3060 3061 die: function(type, fn) { 3062 jQuery(document).unbind(liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type} : null); 3063 return this; 3064 } 3065 }); 3066 3067 function liveHandler(event) { 3068 var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), 3069 stop = true, 3070 elems = []; 3071 3072 jQuery.each(jQuery.data(this, "events").live || [], function(i, fn) { 3073 if (check.test(fn.type)) { 3074 var elem = jQuery(event.target).closest(fn.data)[0]; 3075 if (elem) 3076 elems.push({ elem: elem, fn: fn }); 3077 } 3078 }); 3079 3080 elems.sort(function(a, b) { 3081 return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest"); 3082 }); 3083 3084 jQuery.each(elems, function() { 3085 if (this.fn.call(this.elem, event, this.fn.data) === false) 3086 return (stop = false); 3087 }); 3088 3089 return stop; 3090 } 3091 3092 function liveConvert(type, selector) { 3093 return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); 3094 } 3095 3096 jQuery.extend({ 3097 isReady: false, 3098 readyList: [], 3099 // Handle when the DOM is ready 3100 ready: function() { 3101 // Make sure that the DOM is not already loaded 3102 if (!jQuery.isReady) { 3103 // Remember that the DOM is ready 3104 jQuery.isReady = true; 3105 3106 // If there are functions bound, to execute 3107 if (jQuery.readyList) { 3108 // Execute all of them 3109 jQuery.each(jQuery.readyList, function() { 3110 this.call(document, jQuery); 3111 }); 3112 3113 // Reset the list of functions 3114 jQuery.readyList = null; 3115 } 3116
3117 // Trigger any bound ready events 3118 jQuery(document).triggerHandler("ready"); 3119 } 3120 } 3121 }); 3122 3123 var readyBound = false; 3124 3125 function bindReady() { 3126 if (readyBound) return; 3127 readyBound = true; 3128 3129 // Mozilla, Opera and webkit nightlies currently support this event 3130 if (document.addEventListener) { 3131 // Use the handy event callback 3132 document.addEventListener("DOMContentLoaded", function() { 3133 document.removeEventListener("DOMContentLoaded", arguments.callee, false); 3134 jQuery.ready(); 3135 }, false); 3136 3137 // If IE event model is used 3138 } else if (document.attachEvent) { 3139 // ensure firing before onload, 3140 // maybe late but safe also for iframes 3141 document.attachEvent("onreadystatechange", function() { 3142 if (document.readyState === "complete") { 3143 document.detachEvent("onreadystatechange", arguments.callee); 3144 jQuery.ready(); 3145 } 3146 }); 3147 3148 // If IE and not an iframe 3149 // continually check to see if the document is ready 3150 if (document.documentElement.doScroll && window == window.top) (function() { 3151 if (jQuery.isReady) return; 3152 3153 try { 3154 // If IE is used, use the trick by Diego Perini 3155 // http://javascript.nwbox.com/IEContentLoaded/ 3156 document.documentElement.doScroll("left"); 3157 } catch (error) { 3158 setTimeout(arguments.callee, 0); 3159 return; 3160 } 3161 3162 // and execute any waiting functions 3163 jQuery.ready(); 3164 })(); 3165 } 3166 3167 // A fallback to window.onload, that will always work 3168 jQuery.event.add(window, "load", jQuery.ready); 3169 } 3170 3171 jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick," + 3172 "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + 3173 "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name) { 3174 3175 // Handle event binding 3176 jQuery.fn[name] = function(fn) { 3177 return fn ? this.bind(name, fn) : this.trigger(name); 3178 }; 3179 }); 3180 3181 // Prevent memory leaks in IE 3182 // And prevent errors on refresh with events like mouseover in other browsers 3183 // Window isn't included so as not to unbind existing unload events 3184 jQuery(window).bind('unload', function() { 3185 for (var id in jQuery.cache) 3186 // Skip the window 3187 if (id != 1 && jQuery.cache[id].handle) 3188 jQuery.event.remove(jQuery.cache[id].handle.elem); 3189 }); 3190 (function() { 3191 3192 jQuery.support = {}; 3193 3194 var root = document.documentElement, 3195 script = document.createElement("script"), 3196 div = document.createElement("div"), 3197 id = "script" + (new Date).getTime(); 3198 3199 div.style.display = "none"; 3200 div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; 3201 3202 var all = div.getElementsByTagName("*"), 3203 a = div.getElementsByTagName("a")[0]; 3204 3205 // Can't get basic test support 3206 if (!all || !all.length || !a) { 3207 return; 3208 } 3209 3210 jQuery.support = { 3211 // IE strips leading whitespace when .innerHTML is used 3212 leadingWhitespace: div.firstChild.nodeType == 3, 3213 3214 // Make sure that tbody elements aren't automatically inserted 3215 // IE will insert them into empty tables 3216 tbody: !div.getElementsByTagName("tbody").length, 3217 3218 // Make sure that you can get all elements in an <object> element 3219 // IE 7 always returns no results 3220 objectAll: !!div.getElementsByTagName("object")[0] 3221 .getElementsByTagName("*").length, 3222 3223 // Make sure that link elements get serialized correctly by innerHTML 3224 // This requires a wrapper element in IE 3225 htmlSerialize: !!div.getElementsByTagName("link").length, 3226 3227 // Get the style information from getAttribute 3228 // (IE uses .cssText insted) 3229 style: /red/.test(a.getAttribute("style")), 3230 3231 // Make sure that URLs aren't manipulated 3232 // (IE normalizes it by default) 3233 hrefNormalized: a.getAttribute("href") === "/a", 3234 3235 // Make sure that element opacity exists 3236 // (IE uses filter instead) 3237 opacity: a.style.opacity === "0.5", 3238 3239 // Verify style float existence 3240 // (IE uses styleFloat instead of cssFloat) 3241 cssFloat: !!a.style.cssFloat, 3242
3243 // Will be defined later 3244 scriptEval: false, 3245 noCloneEvent: true, 3246 boxModel: null 3247 }; 3248 3249 script.type = "text/javascript"; 3250 try { 3251 script.appendChild(document.createTextNode("window." + id + "=1;")); 3252 } catch (e) { } 3253 3254 root.insertBefore(script, root.firstChild); 3255 3256 // Make sure that the execution of code works by injecting a script 3257 // tag with appendChild/createTextNode 3258 // (IE doesn't support this, fails, and uses .text instead) 3259 if (window[id]) { 3260 jQuery.support.scriptEval = true; 3261 delete window[id]; 3262 } 3263 3264 root.removeChild(script); 3265 3266 if (div.attachEvent && div.fireEvent) { 3267 div.attachEvent("onclick", function() { 3268 // Cloning a node shouldn't copy over any 3269 // bound event handlers (IE does this) 3270 jQuery.support.noCloneEvent = false; 3271 div.detachEvent("onclick", arguments.callee); 3272 }); 3273 div.cloneNode(true).fireEvent("onclick"); 3274 } 3275 3276 // Figure out if the W3C box model works as expected 3277 // document.body must exist before we can do this 3278 jQuery(function() { 3279 var div = document.createElement("div"); 3280 div.style.width = div.style.paddingLeft = "1px"; 3281 // Ektron Begin 3282 // Ektron Note: added try/catch block to get around document.body is null or not an object 3283 // see jQuery Ticket #6018 (supposedly fixed in jQuery v1.4) 3284 try { 3285 // Ektron End 3286 document.body.appendChild(div); 3287 jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; 3288 document.body.removeChild(div).style.display = 'none'; 3289 // Ektron Begin 3290 } 3291 catch (e) { } 3292 // Ektron End 3293 div = null; 3294 3295 }); 3296 })(); 3297 3298 var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; 3299 3300 jQuery.props = { 3301 "for": "htmlFor", 3302 "class": "className", 3303 "float": styleFloat, 3304 cssFloat: styleFloat, 3305 styleFloat: styleFloat, 3306 readonly: "readOnly", 3307 maxlength: "maxLength", 3308 cellspacing: "cellSpacing", 3309 rowspan: "rowSpan", 3310 tabindex: "tabIndex" 3311 }; 3312 jQuery.fn.extend({ 3313 // Keep a copy of the old load 3314 _load: jQuery.fn.load, 3315 3316 load: function(url, params, callback) { 3317 if (typeof url !== "string") 3318 return this._load(url); 3319 3320 var off = url.indexOf(" "); 3321 if (off >= 0) { 3322 var selector = url.slice(off, url.length); 3323 url = url.slice(0, off); 3324 } 3325 3326 // Default to a GET request 3327 var type = "GET"; 3328 3329 // If the second parameter was provided 3330 if (params) 3331 // If it's a function 3332 if (jQuery.isFunction(params)) { 3333 // We assume that it's the callback 3334 callback = params; 3335 params = null; 3336 3337 // Otherwise, build a param string 3338 } else if (typeof params === "object") { 3339 params = jQuery.param(params); 3340 type = "POST"; 3341 } 3342 3343 var self = this; 3344 3345 // Request the remote document 3346 jQuery.ajax({ 3347 url: url, 3348 type: type, 3349 dataType: "html", 3350 data: params, 3351 complete: function(res, status) { 3352 // If successful, inject the HTML into all the matched elements 3353 if (status == "success" || status == "notmodified") 3354 // See if a selector was specified 3355 self.html(selector ? 3356 // Create a dummy div to hold the results 3357 jQuery("<div/>") 3358 // inject the contents of the document in, removing the scripts 3359 // to avoid any 'Permission Denied' errors in IE 3360 .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) 3361 3362 // Locate the specified elements 3363 .find(selector) : 3364 3365 // If not, just inject the full result 3366 res.responseText); 3367 3368 if (callback) 3369 self.each(callback, [res.responseText, status, res]); 3370 } 3371 }); 3372 return this; 3373 }, 3374 3375 serialize: function() { 3376 return jQuery.param(this.serializeArray()); 3377 }, 3378 serializeArray: function() { 3379 return this.map(function() { 3380 return this.elements ? jQuery.makeArray(this.elements) : this; 3381 }) 3382 .filter(function() { 3383 return this.name && !this.disabled && 3384 (this.checked || /select|textarea/i.test(this.nodeName) ||
3385 /text|hidden|password|search/i.test(this.type)); 3386 }) 3387 .map(function(i, elem) { 3388 var val = jQuery(this).val(); 3389 return val == null ? null : 3390 3391 3392 jQuery.isArray(val) ? 3393 jQuery.map(val, function(val, i) { 3394 return { name: elem.name, value: val }; 3395 }) : 3396 { name: elem.name, value: val }; 3397 }).get(); 3398 } 3399 }); 3400 3401 // Attach a bunch of functions for handling common AJAX events 3402 jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i, o) { 3403 jQuery.fn[o] = function(f) { 3404 return this.bind(o, f); 3405 }; 3406 }); 3407 3408 var jsc = now(); 3409 3410 jQuery.extend({ 3411 3412 get: function(url, data, callback, type) { 3413 // shift arguments if data argument was ommited 3414 if (jQuery.isFunction(data)) { 3415 callback = data; 3416 data = null; 3417 } 3418 3419 return jQuery.ajax({ 3420 type: "GET", 3421 url: url, 3422 data: data, 3423 success: callback, 3424 dataType: type 3425 }); 3426 }, 3427 3428 getScript: function(url, callback) { 3429 return jQuery.get(url, null, callback, "script"); 3430 }, 3431 3432 getJSON: function(url, data, callback) { 3433 return jQuery.get(url, data, callback, "json"); 3434 }, 3435 3436 post: function(url, data, callback, type) { 3437 if (jQuery.isFunction(data)) { 3438 callback = data; 3439 data = {}; 3440 } 3441 3442 return jQuery.ajax({ 3443 type: "POST", 3444 url: url, 3445 data: data, 3446 success: callback, 3447 dataType: type 3448 }); 3449 }, 3450 3451 ajaxSetup: function(settings) { 3452 jQuery.extend(jQuery.ajaxSettings, settings); 3453 }, 3454 3455 ajaxSettings: { 3456 url: location.href, 3457 global: true, 3458 type: "GET", 3459 contentType: "application/x-www-form-urlencoded", 3460 processData: true, 3461 async: true, 3462 /* 3463 timeout: 0, 3464 data: null, 3465 username: null, 3466 password: null, 3467 */ 3468 // Create the request object; Microsoft failed to properly 3469 // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available 3470 // This function can be overriden by calling jQuery.ajaxSetup 3471 xhr: function() { 3472 return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); 3473 }, 3474 accepts: { 3475 xml: "application/xml, text/xml", 3476 html: "text/html", 3477 script: "text/javascript, application/javascript", 3478 json: "application/json, text/javascript", 3479 text: "text/plain", 3480 _default: "*/*" 3481 } 3482 }, 3483 3484 // Last-Modified header cache for next request 3485 lastModified: {}, 3486 3487 ajax: function(s) { 3488 // Extend the settings, but re-extend 's' so that it can be 3489 // checked again later (in the test suite, specifically) 3490 s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); 3491 3492 var jsonp, jsre = /=\?(&|$)/g, status, data, 3493 type = s.type.toUpperCase(); 3494 3495 // convert data if not already a string 3496 if (s.data && s.processData && typeof s.data !== "string") 3497 s.data = jQuery.param(s.data); 3498 3499 // Handle JSONP Parameter Callbacks 3500 if (s.dataType == "jsonp") { 3501 if (type == "GET") { 3502 if (!s.url.match(jsre)) 3503 s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; 3504 } else if (!s.data || !s.data.match(jsre)) 3505 s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; 3506 s.dataType = "json"; 3507 } 3508 3509 // Build temporary JSONP function 3510 if (s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre))) { 3511 jsonp = "jsonp" + jsc++; 3512 3513 // Replace the =? sequence both in the query string and the data 3514 if (s.data) 3515 s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); 3516 s.url = s.url.replace(jsre, "=" + jsonp + "$1"); 3517 3518 // We need to make sure 3519 // that a JSONP style response is executed properly 3520 s.dataType = "script"; 3521 3522 // Handle JSONP-style loading 3523 window[jsonp] = function(tmp) { 3524 data = tmp; 3525 success(); 3526 complete(); 3527 // Garbage collect 3528 window[jsonp] = undefined; 3529 try { delete window[jsonp]; } catch (e) { } 3530 if (head) 3531 head.removeChild(script); 3532 }; 3533 } 3534 3535 if (s.dataType == "script" && s.cache == null) 3536 s.cache = false;
3537 3538 if (s.cache === false && type == "GET") { 3539 var ts = now(); 3540 // try replacing _= if it is there 3541 var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); 3542 // if nothing was replaced, add timestamp to the end 3543 s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); 3544 } 3545 3546 // If data is available, append data to url for get requests 3547 if (s.data && type == "GET") { 3548 s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; 3549 3550 // IE likes to send both get and post data, prevent this 3551 s.data = null; 3552 } 3553 3554 // Watch for a new set of requests 3555 if (s.global && !jQuery.active++) 3556 jQuery.event.trigger("ajaxStart"); 3557 3558 // Matches an absolute URL, and saves the domain 3559 var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec(s.url); 3560 3561 // If we're requesting a remote document 3562 // and trying to load JSON or Script with a GET 3563 if (s.dataType == "script" && type == "GET" && parts 3564 && (parts[1] && parts[1] != location.protocol || parts[2] != location.host)) { 3565 3566 var head = document.getElementsByTagName("head")[0]; 3567 var script = document.createElement("script"); 3568 script.src = s.url; 3569 if (s.scriptCharset) 3570 script.charset = s.scriptCharset; 3571 3572 // Handle Script loading 3573 if (!jsonp) { 3574 var done = false; 3575 3576 // Attach handlers for all browsers 3577 script.onload = script.onreadystatechange = function() { 3578 if (!done && (!this.readyState || 3579 this.readyState == "loaded" || this.readyState == "complete")) { 3580 done = true; 3581 success(); 3582 complete(); 3583 3584 // Handle memory leak in IE 3585 script.onload = script.onreadystatechange = null; 3586 head.removeChild(script); 3587 } 3588 }; 3589 } 3590 3591 head.appendChild(script); 3592 3593 // We handle everything using the script element injection 3594 return undefined; 3595 } 3596 3597 var requestDone = false; 3598 3599 // Create the request object 3600 var xhr = s.xhr(); 3601 3602 // Open the socket 3603 // Passing null username, generates a login popup on Opera (#2865) 3604 if (s.username) 3605 xhr.open(type, s.url, s.async, s.username, s.password); 3606 else 3607 xhr.open(type, s.url, s.async); 3608 3609 // Need an extra try/catch for cross domain requests in Firefox 3 3610 try { 3611 // Set the correct header, if data is being sent 3612 if (s.data) 3613 xhr.setRequestHeader("Content-Type", s.contentType); 3614 3615 // Set the If-Modified-Since header, if ifModified mode. 3616 if (s.ifModified) 3617 xhr.setRequestHeader("If-Modified-Since", 3618 jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT"); 3619 3620 // Set header so the called script knows that it's an XMLHttpRequest 3621 xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); 3622 3623 // Set the Accepts header for the server, depending on the dataType 3624 xhr.setRequestHeader("Accept", s.dataType && s.accepts[s.dataType] ? 3625 s.accepts[s.dataType] + ", */*" : 3626 s.accepts._default); 3627 } catch (e) { } 3628 3629 // Allow custom headers/mimetypes and early abort 3630 if (s.beforeSend && s.beforeSend(xhr, s) === false) { 3631 // Handle the global AJAX counter
3632 if (s.global && ! --jQuery.active) 3633 jQuery.event.trigger("ajaxStop"); 3634 // close opended socket 3635 xhr.abort(); 3636 return false; 3637 } 3638 3639 if (s.global) 3640 jQuery.event.trigger("ajaxSend", [xhr, s]); 3641 3642 // Wait for a response to come back 3643 var onreadystatechange = function(isTimeout) { 3644 // The request was aborted, clear the interval and decrement jQuery.active 3645 if (xhr.readyState == 0) { 3646 if (ival) { 3647 // clear poll interval 3648 clearInterval(ival); 3649 ival = null; 3650 // Handle the global AJAX counter 3651 if (s.global && ! --jQuery.active) 3652 jQuery.event.trigger("ajaxStop"); 3653 } 3654 // The transfer is complete and the data is available, or the request timed out 3655 } else if (!requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout")) { 3656 requestDone = true; 3657 3658 // clear poll interval 3659 if (ival) { 3660 clearInterval(ival); 3661 ival = null; 3662 } 3663 3664 status = isTimeout == "timeout" ? "timeout" : 3665 !jQuery.httpSuccess(xhr) ? "error" : 3666 s.ifModified && jQuery.httpNotModified(xhr, s.url) ? "notmodified" : 3667 "success"; 3668 3669 if (status == "success") { 3670 // Watch for, and catch, XML document parse errors 3671 try { 3672 // process the data (runs the xml through httpData regardless of callback) 3673 data = jQuery.httpData(xhr, s.dataType, s); 3674 } catch (e) { 3675 status = "parsererror"; 3676 } 3677 } 3678 3679 // Make sure that the request was successful or notmodified 3680 if (status == "success") { 3681 // Cache Last-Modified header, if ifModified mode. 3682 var modRes; 3683 try { 3684 modRes = xhr.getResponseHeader("Last-Modified"); 3685 } catch (e) { } // swallow exception thrown by FF if header is not available 3686 3687 if (s.ifModified && modRes) 3688 jQuery.lastModified[s.url] = modRes; 3689 3690 // JSONP handles its own success callback 3691 if (!jsonp) 3692 success(); 3693 } else 3694 jQuery.handleError(s, xhr, status); 3695 3696 // Fire the complete handlers 3697 complete(); 3698 3699 if (isTimeout) 3700 xhr.abort(); 3701 3702 // Stop memory leaks 3703 if (s.async) 3704 xhr = null; 3705 } 3706 }; 3707 3708 if (s.async) { 3709 // don't attach the handler to the request, just poll it instead 3710 var ival = setInterval(onreadystatechange, 13); 3711 3712 // Timeout checker 3713 if (s.timeout > 0) 3714 setTimeout(function() { 3715 // Check to see if the request is still happening 3716 if (xhr && !requestDone) 3717 onreadystatechange("timeout"); 3718 }, s.timeout); 3719 } 3720 3721 // Send the data 3722 try { 3723 xhr.send(s.data); 3724 } catch (e) { 3725 jQuery.handleError(s, xhr, null, e); 3726 } 3727 3728 // firefox 1.5 doesn't fire statechange for sync requests 3729 if (!s.async) 3730 onreadystatechange(); 3731 3732 function success() { 3733 // If a local callback was specified, fire it and pass it the data 3734 if (s.success) 3735 s.success(data, status); 3736 3737 // Fire the global callback 3738 if (s.global) 3739 jQuery.event.trigger("ajaxSuccess", [xhr, s]); 3740 } 3741 3742 function complete() { 3743 // Process result 3744 if (s.complete) 3745 s.complete(xhr, status); 3746 3747 // The request was completed 3748 if (s.global)
3749 jQuery.event.trigger("ajaxComplete", [xhr, s]); 3750 3751 // Handle the global AJAX counter 3752 if (s.global && ! --jQuery.active) 3753 jQuery.event.trigger("ajaxStop"); 3754 } 3755 3756 // return XMLHttpRequest to allow aborting the request etc. 3757 return xhr; 3758 }, 3759 3760 handleError: function(s, xhr, status, e) { 3761 // If a local callback was specified, fire it 3762 if (s.error) s.error(xhr, status, e); 3763 3764 // Fire the global callback 3765 if (s.global) 3766 jQuery.event.trigger("ajaxError", [xhr, s, e]); 3767 }, 3768 3769 // Counter for holding the number of active queries 3770 active: 0, 3771 3772 // Determines if an XMLHttpRequest was successful or not 3773 httpSuccess: function(xhr) { 3774 try { 3775 // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 3776 return !xhr.status && location.protocol == "file:" || 3777 (xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || xhr.status == 1223; 3778 } catch (e) { } 3779 return false; 3780 }, 3781 3782 // Determines if an XMLHttpRequest returns NotModified 3783 httpNotModified: function(xhr, url) { 3784 try { 3785 var xhrRes = xhr.getResponseHeader("Last-Modified"); 3786 3787 // Firefox always returns 200. check Last-Modified date 3788 return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; 3789 } catch (e) { } 3790 return false; 3791 }, 3792 3793 httpData: function(xhr, type, s) { 3794 var ct = xhr.getResponseHeader("content-type"), 3795 xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, 3796 data = xml ? xhr.responseXML : xhr.responseText; 3797 3798 if (xml && data.documentElement.tagName == "parsererror") 3799 throw "parsererror"; 3800 3801 // Allow a pre-filtering function to sanitize the response 3802 // s != null is checked to keep backwards compatibility 3803 if (s && s.dataFilter) 3804 data = s.dataFilter(data, type); 3805 3806 // The filter can actually parse the response 3807 if (typeof data === "string") { 3808 3809 // If the type is "script", eval it in global context 3810 if (type == "script") 3811 jQuery.globalEval(data); 3812 3813 // Get the JavaScript object, if JSON is used. 3814 if (type == "json") 3815 data = window["eval"]("(" + data + ")"); 3816 } 3817 3818 return data; 3819 }, 3820 3821 // Serialize an array of form elements or a set of 3822 // key/values into a query string 3823 param: function(a) { 3824 var s = []; 3825 3826 function add(key, value) { 3827 s[s.length] = encodeURIComponent(key) + '=' + encodeURIComponent(value); 3828 }; 3829 3830 // If an array was passed in, assume that it is an array 3831 // of form elements 3832 if (jQuery.isArray(a) || a.jquery) 3833 // Serialize the form elements 3834 jQuery.each(a, function() { 3835 add(this.name, this.value); 3836 }); 3837 3838 // Otherwise, assume that it's an object of key/value pairs 3839 else 3840 // Serialize the key/values 3841 for (var j in a) 3842 // If the value is an array then the key names need to be repeated 3843 if (jQuery.isArray(a[j])) 3844 jQuery.each(a[j], function() { 3845 add(j, this); 3846 }); 3847 else 3848 add(j, jQuery.isFunction(a[j]) ? a[j]() : a[j]); 3849 3850 // Return the resulting serialization 3851 return s.join("&").replace(/%20/g, "+"); 3852 } 3853 3854 }); 3855 var elemdisplay = {}, 3856 timerId, 3857 fxAttrs = [ 3858 // height animations 3859 ["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], 3860 // width animations 3861 ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], 3862 // opacity animations 3863 ["opacity"] 3864 ]; 3865 3866 function genFx(type, num) { 3867 var obj = {}; 3868 jQuery.each(fxAttrs.concat.apply([], fxAttrs.slice(0, num)), function() { 3869 obj[this] = type; 3870 }); 3871 return obj; 3872 } 3873 3874 jQuery.fn.extend({ 3875 show: function(speed, callback) { 3876 if (speed) { 3877 return this.animate(genFx("show", 3), speed, callback); 3878 } else { 3879 for (var i = 0, l = this.length; i < l; i++) { 3880 var old = jQuery.data(this[i], "olddisplay"); 3881 3882 this[i].style.display = old || ""; 3883 3884 if (jQuery.css(this[i], "display") === "none") { 3885 var tagName = this[i].tagName, display; 3886 3887 if (elemdisplay[tagName]) { 3888 display = elemdisplay[tagName]; 3889 } else { 3890 var elem = jQuery("<" + tagName + " />").appendTo("body"); 3891 3892 display = elem.css("display"); 3893 if (display === "none") 3894 display = "block"; 3895 3896 elem.remove(); 3897 3898 elemdisplay[tagName] = display; 3899 } 3900 3901 jQuery.data(this[i], "olddisplay", display); 3902 } 3903 } 3904 3905 // Set the display of the elements in a second loop 3906 // to avoid the constant reflow 3907 for (var i = 0, l = this.length; i < l; i++) { 3908 this[i].style.display = jQuery.data(this[i], "olddisplay") || ""; 3909 } 3910 3911 return this; 3912 } 3913 }, 3914 3915 hide: function(speed, callback) { 3916 if (speed) { 3917 return this.animate(genFx("hide", 3), speed, callback); 3918 } else { 3919 for (var i = 0, l = this.length; i < l; i++) { 3920 var old = jQuery.data(this[i], "olddisplay"); 3921 if (!old && old !== "none") 3922 jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); 3923 } 3924 3925 // Set the display of the elements in a second loop 3926 // to avoid the constant reflow 3927 for (var i = 0, l = this.length; i < l; i++) { 3928 this[i].style.display = "none"; 3929 } 3930 3931 return this; 3932 } 3933 }, 3934 3935 // Save the old toggle function 3936 _toggle: jQuery.fn.toggle, 3937 3938 toggle: function(fn, fn2) { 3939 var bool = typeof fn === "boolean"; 3940 3941 return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? 3942 this._toggle.apply(this, arguments) : 3943 fn == null || bool ? 3944 this.each(function() { 3945 var state = bool ? fn : jQuery(this).is(":hidden"); 3946 jQuery(this)[state ? "show" : "hide"](); 3947 }) : 3948 this.animate(genFx("toggle", 3), fn, fn2); 3949 }, 3950 3951 fadeTo: function(speed, to, callback) { 3952 return this.animate({ opacity: to }, speed, callback); 3953 }, 3954 3955 animate: function(prop, speed, easing, callback) { 3956 var optall = jQuery.speed(speed, easing, callback); 3957 3958 return this[optall.queue === false ? "each" : "queue"](function() { 3959 3960 var opt = jQuery.extend({}, optall), p, 3961 hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), 3962 self = this; 3963 3964 for (p in prop) { 3965 if (prop[p] == "hide" && hidden || prop[p] == "show" && !hidden) 3966 return opt.complete.call(this); 3967 3968 if ((p == "height" || p == "width") && this.style) { 3969 // Store display property 3970 opt.display = jQuery.css(this, "display"); 3971 3972 // Make sure that nothing sneaks out 3973 opt.overflow = this.style.overflow; 3974 } 3975 } 3976 3977 if (opt.overflow != null) 3978 this.style.overflow = "hidden"; 3979 3980 opt.curAnim = jQuery.extend({}
3980, prop); 3981 3982 jQuery.each(prop, function(name, val) { 3983 var e = new jQuery.fx(self, opt, name); 3984 3985 if (/toggle|show|hide/.test(val)) 3986 e[val == "toggle" ? hidden ? "show" : "hide" : val](prop); 3987 else { 3988 var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), 3989 start = e.cur(true) || 0; 3990 3991 if (parts) { 3992 var end = parseFloat(parts[2]), 3993 unit = parts[3] || "px"; 3994 3995 // We need to compute starting value 3996 if (unit != "px") { 3997 self.style[name] = (end || 1) + unit; 3998 start = ((end || 1) / e.cur(true)) * start; 3999 self.style[name] = start + unit; 4000 } 4001 4002 // If a +=/-= token was provided, we're doing a relative animation 4003 if (parts[1]) 4004 end = ((parts[1] == "-=" ? -1 : 1) * end) + start; 4005 4006 e.custom(start, end, unit); 4007 } else 4008 e.custom(start, val, ""); 4009 } 4010 }); 4011 4012 // For JS strict compliance 4013 return true; 4014 }); 4015 }, 4016 4017 stop: function(clearQueue, gotoEnd) { 4018 var timers = jQuery.timers; 4019 4020 if (clearQueue) 4021 this.queue([]); 4022 4023 this.each(function() { 4024 // go in reverse order so anything added to the queue during the loop is ignored 4025 for (var i = timers.length - 1; i >= 0; i--) 4026 if (timers[i].elem == this) { 4027 if (gotoEnd) 4028 // force the next step to be the last 4029 timers[i](true); 4030 timers.splice(i, 1); 4031 } 4032 }); 4033 4034 // start the next in the queue if the last step wasn't forced 4035 if (!gotoEnd) 4036 this.dequeue(); 4037 4038 return this; 4039 } 4040 4041 }); 4042 4043 // Generate shortcuts for custom animations 4044 jQuery.each({ 4045 slideDown: genFx("show", 1), 4046 slideUp: genFx("hide", 1), 4047 slideToggle: genFx("toggle", 1), 4048 fadeIn: { opacity: "show" }, 4049 fadeOut: { opacity: "hide" } 4050 }, function(name, props) { 4051 jQuery.fn[name] = function(speed, callback) { 4052 return this.animate(props, speed, callback); 4053 }; 4054 }); 4055 4056 jQuery.extend({ 4057 4058 speed: function(speed, easing, fn) { 4059 var opt = typeof speed === "object" ? speed : { 4060 complete: fn || !fn && easing || 4061 jQuery.isFunction(speed) && speed, 4062 duration: speed, 4063 easing: fn && easing || easing && !jQuery.isFunction(easing) && easing 4064 }; 4065 4066 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 4067 jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; 4068 4069 // Queueing 4070 opt.old = opt.complete; 4071 opt.complete = function() { 4072 if (opt.queue !== false) 4073 jQuery(this).dequeue(); 4074 if (jQuery.isFunction(opt.old)) 4075 opt.old.call(this); 4076 }; 4077 4078 return opt; 4079 }, 4080 4081 easing: { 4082 linear: function(p, n, firstNum, diff) { 4083 return firstNum + diff * p; 4084 }, 4085 swing: function(p, n, firstNum, diff) { 4086 return ((-Math.cos(p * Math.PI) / 2) + 0.5) * diff + firstNum; 4087 } 4088 }, 4089 4090 timers: [], 4091 4092 fx: function(elem, options, prop) { 4093 this.options = options; 4094 this.elem = elem; 4095 this.prop = prop; 4096 4097 if (!options.orig) 4098 options.orig = {}; 4099 } 4100 4101 }); 4102 4103 jQuery.fx.prototype = { 4104 4105 // Simple function for setting a style value 4106 update: function() { 4107 if (this.options.step) 4108 this.options.step.call(this.elem, this.now, this); 4109 4110 (jQuery.fx.step[this.prop] || jQuery.fx.step._default)(this); 4111 4112 // Set display property to block for height/width animations 4113 if ((this.prop == "height" || this.prop == "width") && this.elem.style) 4114 this.elem.style.display = "block"; 4115 }, 4116 4117 // Get the current size 4118 cur: function(force) { 4119 if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) 4120 return this.elem[this.prop]; 4121 4122 var r = parseFloat(jQuery.css(this.elem, this.prop, force)); 4123 return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; 4124 }, 4125 4126 // Start an animation from one number to another 4127 custom: function(from, to, unit) {
4128 this.startTime = now(); 4129 this.start = from; 4130 this.end = to; 4131 this.unit = unit || this.unit || "px"; 4132 this.now = this.start; 4133 this.pos = this.state = 0; 4134 4135 var self = this; 4136 function t(gotoEnd) { 4137 return self.step(gotoEnd); 4138 } 4139 4140 t.elem = this.elem; 4141 4142 if (t() && jQuery.timers.push(t) && !timerId) { 4143 timerId = setInterval(function() { 4144 var timers = jQuery.timers; 4145 4146 for (var i = 0; i < timers.length; i++) 4147 if (!timers[i]()) 4148 timers.splice(i--, 1); 4149 4150 if (!timers.length) { 4151 clearInterval(timerId); 4152 timerId = undefined; 4153 } 4154 }, 13); 4155 } 4156 }, 4157 4158 // Simple 'show' function 4159 show: function() { 4160 // Remember where we started, so that we can go back to it later 4161 this.options.orig[this.prop] = jQuery.attr(this.elem.style, this.prop); 4162 this.options.show = true; 4163 4164 // Begin the animation 4165 // Make sure that we start at a small width/height to avoid any 4166 // flash of content 4167 this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); 4168 4169 // Start by showing the element 4170 jQuery(this.elem).show(); 4171 }, 4172 4173 // Simple 'hide' function 4174 hide: function() { 4175 // Remember where we started, so that we can go back to it later 4176 this.options.orig[this.prop] = jQuery.attr(this.elem.style, this.prop); 4177 this.options.hide = true; 4178 4179 // Begin the animation 4180 this.custom(this.cur(), 0); 4181 }, 4182 4183 // Each step of an animation 4184 step: function(gotoEnd) { 4185 var t = now(); 4186 4187 if (gotoEnd || t >= this.options.duration + this.startTime) { 4188 this.now = this.end; 4189 this.pos = this.state = 1; 4190 this.update(); 4191 4192 this.options.curAnim[this.prop] = true; 4193 4194 var done = true; 4195 for (var i in this.options.curAnim) 4196 if (this.options.curAnim[i] !== true) 4197 done = false; 4198 4199 if (done) { 4200 if (this.options.display != null) { 4201 // Reset the overflow 4202 this.elem.style.overflow = this.options.overflow; 4203 4204 // Reset the display 4205 this.elem.style.display = this.options.display; 4206 if (jQuery.css(this.elem, "display") == "none") 4207 this.elem.style.display = "block"; 4208 } 4209 4210 // Hide the element if the "hide" operation was done 4211 if (this.options.hide) 4212 jQuery(this.elem).hide(); 4213 4214 // Reset the properties, if the item has been hidden or shown 4215 if (this.options.hide || this.options.show) 4216 for (var p in this.options.curAnim) 4217 jQuery.attr(this.elem.style, p, this.options.orig[p]); 4218 4219 // Execute the complete function 4220 this.options.complete.call(this.elem); 4221 } 4222 4223 return false; 4224 } else { 4225 var n = t - this.startTime; 4226 this.state = n / this.options.duration; 4227 4228 // Perform the easing function, defaults to swing 4229 this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
4230 this.now = this.start + ((this.end - this.start) * this.pos); 4231 4232 // Perform the next step of the animation 4233 this.update(); 4234 } 4235 4236 return true; 4237 } 4238 4239 }; 4240 4241 jQuery.extend(jQuery.fx, { 4242 speeds: { 4243 slow: 600, 4244 fast: 200, 4245 // Default speed 4246 _default: 400 4247 }, 4248 step: { 4249 4250 opacity: function(fx) { 4251 jQuery.attr(fx.elem.style, "opacity", fx.now); 4252 }, 4253 4254 _default: function(fx) { 4255 if (fx.elem.style && fx.elem.style[fx.prop] != null) 4256 fx.elem.style[fx.prop] = fx.now + fx.unit; 4257 else 4258 fx.elem[fx.prop] = fx.now; 4259 } 4260 } 4261 }); 4262 if (document.documentElement["getBoundingClientRect"]) 4263 jQuery.fn.offset = function() { 4264 if (!this[0]) return { top: 0, left: 0 }; 4265 if (this[0] === this[0].ownerDocument.body) return jQuery.offset.bodyOffset(this[0]); 4266 var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, 4267 clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, 4268 top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop) - clientTop, 4269 left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; 4270 return { top: top, left: left }; 4271 }; 4272 else 4273 jQuery.fn.offset = function() { 4274 if (!this[0]) return { top: 0, left: 0 }; 4275 if (this[0] === this[0].ownerDocument.body) return jQuery.offset.bodyOffset(this[0]); 4276 jQuery.offset.initialized || jQuery.offset.initialize(); 4277 4278 var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, 4279 doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, 4280 body = doc.body, defaultView = doc.defaultView, 4281 prevComputedStyle = defaultView.getComputedStyle(elem, null), 4282 top = elem.offsetTop, left = elem.offsetLeft; 4283 4284 while ((elem = elem.parentNode) && elem !== body && elem !== docElem) { 4285 computedStyle = defaultView.getComputedStyle(elem, null); 4286 top -= elem.scrollTop, left -= elem.scrollLeft; 4287 if (elem === offsetParent) { 4288 top += elem.offsetTop, left += elem.offsetLeft; 4289 if (jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName))) 4290 top += parseInt(computedStyle.borderTopWidth, 10) || 0, 4291 left += parseInt(computedStyle.borderLeftWidth, 10) || 0; 4292 prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; 4293 } 4294 if (jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible") 4295 top += parseInt(computedStyle.borderTopWidth, 10) || 0, 4296 left += parseInt(computedStyle.borderLeftWidth, 10) || 0; 4297 prevComputedStyle = computedStyle; 4298 } 4299 4300 if (prevComputedStyle.position === "relative" || prevComputedStyle.position === "static") 4301 top += body.offsetTop, 4302 left += body.offsetLeft; 4303 4304 if (prevComputedStyle.position === "fixed") 4305 top += Math.max(docElem.scrollTop, body.scrollTop), 4306 left += Math.max(docElem.scrollLeft, body.scrollLeft); 4307 4308 return { top: top, left: left }; 4309 }; 4310 4311 jQuery.offset = { 4312 initialize: function() { 4313 if (this.initialized) return; 4314 var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, 4315 html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>'; 4316 4317 rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; 4318 for (prop in rules) container.style[prop] = rules[prop]; 4319 4320 container.innerHTML = html; 4321 body.insertBefore(container, body.firstChild); 4322 innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; 4323 4324 this.doesNotAddBorder = (checkDiv.offsetTop !== 5); 4325 this.doesAddBorderForTableAndCells = (td.offsetTop === 5); 4326 4327 innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; 4328 this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); 4329 4330 body.style.marginTop = '1px'; 4331 this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); 4332 body.style.marginTop = bodyMarginTop; 4333 4334 body.removeChild(container); 4335 this.initialized = true; 4336 }, 4337 4338 bodyOffset: function(body) { 4339 jQuery.offset.initialized || jQuery.offset.initialize(); 4340 var top = body.offsetTop, left = body.offsetLeft; 4341 if (jQuery.offset.doesNotIncludeMarginInBodyOffset)
4342 top += parseInt(jQuery.curCSS(body, 'marginTop', true), 10) || 0, 4343 left += parseInt(jQuery.curCSS(body, 'marginLeft', true), 10) || 0; 4344 return { top: top, left: left }; 4345 } 4346 }; 4347 4348 4349 jQuery.fn.extend({ 4350 position: function() { 4351 var left = 0, top = 0, results; 4352 4353 if (this[0]) { 4354 // Get *real* offsetParent 4355 var offsetParent = this.offsetParent(), 4356 4357 // Get correct offsets 4358 offset = this.offset(), 4359 parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0} : offsetParent.offset(); 4360 4361 // Subtract element margins 4362 // note: when an element has margin: auto the offsetLeft and marginLeft 4363 // are the same in Safari causing offset.left to incorrectly be 0 4364 offset.top -= num(this, 'marginTop'); 4365 offset.left -= num(this, 'marginLeft'); 4366 4367 // Add offsetParent borders 4368 parentOffset.top += num(offsetParent, 'borderTopWidth'); 4369 parentOffset.left += num(offsetParent, 'borderLeftWidth'); 4370 4371 // Subtract the two offsets 4372 results = { 4373 top: offset.top - parentOffset.top, 4374 left: offset.left - parentOffset.left 4375 }; 4376 } 4377 4378 return results; 4379 }, 4380 4381 offsetParent: function() { 4382 var offsetParent = this[0].offsetParent || document.body; 4383 while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static')) 4384 offsetParent = offsetParent.offsetParent; 4385 return jQuery(offsetParent); 4386 } 4387 }); 4388 4389 4390 // Create scrollLeft and scrollTop methods 4391 jQuery.each(['Left', 'Top'], function(i, name) { 4392 var method = 'scroll' + name; 4393 4394 jQuery.fn[method] = function(val) { 4395 if (!this[0]) return null; 4396 4397 return val !== undefined ? 4398 4399 // Set the scroll offset 4400 this.each(function() { 4401 this == window || this == document ? 4402 window.scrollTo( 4403 !i ? val : jQuery(window).scrollLeft(), 4404 i ? val : jQuery(window).scrollTop() 4405 ) : 4406 this[method] = val; 4407 }) : 4408 4409 // Return the scroll offset 4410 this[0] == window || this[0] == document ? 4411 self[i ? 'pageYOffset' : 'pageXOffset'] || 4412 jQuery.boxModel && document.documentElement[method] || 4413 document.body[method] : 4414 this[0][method]; 4415 }; 4416 }); 4417 // Create innerHeight, innerWidth, outerHeight and outerWidth methods 4418 jQuery.each(["Height", "Width"], function(i, name) { 4419 4420 var tl = i ? "Left" : "Top", // top or left 4421 br = i ? "Right" : "Bottom", // bottom or right 4422 lower = name.toLowerCase(); 4423 4424 // innerHeight and innerWidth 4425 jQuery.fn["inner" + name] = function() { 4426 return this[0] ? 4427 jQuery.css(this[0], lower, false, "padding") : 4428 null; 4429 }; 4430 4431 // outerHeight and outerWidth 4432 jQuery.fn["outer" + name] = function(margin) { 4433 return this[0] ? 4434 jQuery.css(this[0], lower, false, margin ? "margin" : "border") : 4435 null; 4436 }; 4437 4438 var type = name.toLowerCase(); 4439 4440 jQuery.fn[type] = function(size) { 4441 // Get window width or height 4442 return this[0] == window ? 4443 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode 4444 document.compatMode == "CSS1Compat" && document.documentElement["client" + name] || 4445 document.body["client" + name] : 4446 4447 // Get document width or height 4448 this[0] == document ? 4449 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater 4450 Math.max( 4451 document.documentElement["client" + name], 4452 document.body["scroll" + name], document.documentElement["scroll" + name], 4453 document.body["offset" + name], document.documentElement["offset" + name] 4454 ) : 4455 4456 // Get or set width or height on the element 4457 size === undefined ? 4458 // Get width or height on the element 4459 (this.length ? jQuery.css(this[0], type) : null) : 4460 4461 // Set the width or height on the element (default to pixels if value is unitless) 4462 this.css(type, typeof size === "string" ? size : size + "px"); 4463 }; 4464 4465 }); 4466 })(); 4467 // Ektron - End jQuery 4468 4469 /* 4470 ************************************** 4471 Define $ektron 4472 ************************************** 4473 */ 4474 var $ektron = window.$ektron = window.jQuery; 4475 4476 // return $ and jQuery objects as needed 4477 window.jQuery.noConflict(true); 4478 4479 // if $ and jQuery were never defined, make them $ektron 4480 if ("undefined" == typeof(window.$)) 4481 { 4482 window.$ = window.$ektron; 4483 } 4484 if ("undefined" == typeof(window.jQuery)) 4485 { 4486 window.jQuery = window.$ektron; 4487 } 4488 4489 4490 /* 4491 ************************************** 4492 Ektron Namespace 4493 ************************************** 4494 */ 4495 if ("undefined" == typeof Ektron) 4496 { 4497 var Ektron = window.Ektron = {}; 4498 } 4499 /* 4500 If you are creating a new class, add it to the Ektron namespace. 4501 USAGE: 4502 (function(){ 4503 Ektron.MyClass = function MyClass(...) 4504 { 4505 }; // constructor 4506 // shared public 4507 Ektron.MyClass.sharedPublic = function sharedPublic(...) 4508 { 4509 }; 4510 // shared private 4511 var s_private = []; 4512 function private() 4513 { 4514 }; 4515 })(); // Ektron.MyClass 4516 */ 4517 4518 /* 4519 ************************************** 4520 Ektron.QueryString Namespace 4521 ************************************** 4522 */ 4523 Ektron.QueryString = {}; 4524 4525 window.location.search.replace(new RegExp( "([^?=&]+)(=([^&]*))?", "g" ), 4526 function( $0, $1, $2, $3 ) 4527 { 4528 Ektron.QueryString[$1] = $3; 4529 } 4530 ); 4531 4532 /* Use this namespaced object to access any of the QueryString parameters 4533 by key. For example: 4534 4535 Given the URL http://www.ektron.com?id=224 4536 4537 To alert the key "id" value we would simply do the following 4538 Ektron.ready(function() 4539 { 4540 alert(Ektron.QueryString["id"]); 4541 } 4542 ); 4543 4544 /* 4545 ************************************** 4546 Ektron.RegExp Namespace 4547 ************************************** 4548 */ 4549 Ektron.RegExp = {}; 4550 4551 Ektron.RegExp.escape = function(s) 4552 { 4553 return (s+"").replace(Ektron.RegExp.escape.re, "\\$&"); 4554 }; 4555 Ektron.RegExp.escape.re = /[^\w\s]/g; 4556 4557 Ektron.RegExp.Char = {}; 4558 Ektron.RegExp.Char.amp = /\&/g; 4559 Ektron.RegExp.Char.lt = /</g; 4560 Ektron.RegExp.Char.gt = />/g; 4561 Ektron.RegExp.Char.apos = /\'/g; 4562 Ektron.RegExp.Char.quot = /\"/g; 4563 Ektron.RegExp.Char.lf = /\n/g; 4564 Ektron.RegExp.Char.cr = /\r/g; 4565 Ektron.RegExp.Char.backslash = /\\/g; 4566 4567 Ektron.RegExp.Entity = {}; 4568 Ektron.RegExp.Entity.amp = /\&/g; 4569 Ektron.RegExp.Entity.lt = /\</g; 4570 Ektron.RegExp.Entity.gt = /\>/g; 4571 Ektron.RegExp.Entity.apos = /\'/g; 4572 Ektron.RegExp.Entity.quot = /\"/g; 4573 4574 Ektron.RegExp.CharacterClass = {}; 4575 4576 // IE (as of IE 7) omits non-breaking space and other Unicode space separators in "\s". 4577 Ektron.RegExp.CharacterClass.s = "[\t\x0b\f \xa0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\n\r\u2028\u2029]"; 4578 /* 4579 ECMA-262 3rd Edition - December 1999 4580 4581 15.10.2.12 CharacterClassEscape 4582 The production CharacterClassEscape :: s evaluates by returning the set of characters containing the 4583 characters that are on the right-hand side of the WhiteSpace (7.2) or LineTerminator (7.3) 4584 productions. 4585 4586 7.2 White Space 4587 \u0009 Tab <TAB> 4588 \u000B Vertical Tab <VT> 4589 \u000C Form Feed <FF> 4590 \u0020 Space <SP> 4591 \u00A0 No-break space <NBSP> 4592 Other category �Zs� Any other Unicode 4593 �space separator� 4594 4595 7.3 Line Terminator 4596 \u000A Line Feed <LF> 4597 \u000D Carriage Return <CR> 4598 \u2028 Line separator <LS> 4599 \u2029 Paragraph separator <PS> 4600 4601 Unicode Regular Expressions http://unicode.org/reports/tr18/ 4602 Unicode Regular Expression Guidelines http://unicode.org/reports/tr18/tr18-6d2.html
4603 UNICODE CHARACTER DATABASE http://www.unicode.org/Public/UNIDATA/UCD.html 4604 Revision 5.1.0 4605 Date 2008-03-25 4606 http://www.unicode.org/Public/UNIDATA/PropList.txt 4607 # PropList-5.1.0.txt 4608 # Date: 2008-03-20, 17:55:27 GMT [MD] 4609 0020 ; White_Space # Zs SPACE 4610 00A0 ; White_Space # Zs NO-BREAK SPACE 4611 1680 ; White_Space # Zs OGHAM SPACE MARK 4612 180E ; White_Space # Zs MONGOLIAN VOWEL SEPARATOR 4613 2000..200A ; White_Space # Zs [11] EN QUAD..HAIR SPACE 4614 202F ; White_Space # Zs NARROW NO-BREAK SPACE 4615 205F ; White_Space # Zs MEDIUM MATHEMATICAL SPACE 4616 3000 ; White_Space # Zs IDEOGRAPHIC SPACE 4617 4618 Reference: http://en.wikipedia.org/wiki/Space_(punctuation)#Table_of_spaces 4619 */ 4620 4621 /* 4622 ************************************** 4623 Ektron.OnException 4624 ************************************** 4625 */ 4626 Ektron.OnException = function(me, onexception, ex, args, callee) 4627 /* 4628 callee is optional 4629 4630 USAGE: (not a class; this is an event, do not use 'new') 4631 function myFunction(arg1, arg2, ..., onexception) 4632 { 4633 try 4634 { 4635 // code 4636 } 4637 catch (ex) 4638 { 4639 Ektron.OnException(this, onexception, ex, arguments); 4640 } 4641 try 4642 { 4643 callback(arg); 4644 } 4645 catch (ex) 4646 { 4647 Ektron.OnException(this, onexception, ex, [arg], callback); 4648 } 4649 } 4650 myObject.myFunction(arg0, arg1, Ektron.OnException.returnValue(null)); // return null if error 4651 myObject.myFunction(arg0, arg1, Ektron.OnException.returnArgument(0)); // return arg0 if error 4652 myObject.myFunction(arg0, arg1, Ektron.OnException.returnException); // return error message if error 4653 myObject.myFunction(arg0, arg1, function(ex, args) // custom response if error 4654 { 4655 return "An error occurred. arg1=" + args[1] + " Error=" + ex.message; 4656 }); 4657 */ 4658 { 4659 var returnValue; // default undefined 4660 var method = function(){}; 4661 if (callee) 4662 { 4663 method = callee; 4664 } 4665 else if (args && args.callee) 4666 { 4667 method = args.callee; 4668 } 4669 var onexceptionList = 4670 [ 4671 Ektron.onexception // namespace 4672 , me.constructor.onexception // class 4673 , me.onexception // object 4674 , method.onexception // method 4675 , onexception // argument, normally args[args.length-1] 4676 ]; 4677 for (var i = 0; i < onexceptionList.length; i++) 4678 { 4679 var onexception = onexceptionList[i]; 4680 if ("function" == typeof onexception && (0 == i || onexception != onexceptionList[i-1])) 4681 { 4682 var result = onexception.call(me, ex, args, callee); 4683 if (typeof result != "undefined") returnValue = result; 4684 } 4685 } 4686 if ("undefined" == typeof returnValue) 4687 { 4688 throw ex; 4689 } 4690 return returnValue; 4691 }; 4692 Ektron.OnException.exceptionMessage = function(ex, args, callee) 4693 /* 4694 args is optioal 4695 callee is optional 4696 */ 4697 { 4698 var msg = ""; 4699 try 4700 { 4701 // Have seen 'ex' be a string in FF 2. 4702 msg = ex.message || ex || ""; 4703 } 4704 catch (exIgnore) {}; 4705 var file = ""; 4706 try 4707 { 4708 file = ex.filename || ex.fileName || ex.sourceURL || ""; 4709 if (file) file = "\nFile: " + file; 4710 } 4711 catch (exIgnore) {}; 4712 var line = ""; 4713 try 4714 { 4715 // Have see "permission denied" error in FF 2 when attempting to read ex.lineNumber 4716 line = ex.lineNumber || ex.line || ""; 4717 if (line) line = "\nLine: " + line; 4718 } 4719 catch (exIgnore) {}; 4720 var func = ""; 4721 try 4722 { 4723 if (callee || (args && args.callee)) 4724 { 4725 var funcCode = String(callee || args.callee); 4726 var funcCodeLines = funcCode.split("\n"); 4727 var max = Ektron.OnException.exceptionMessage.maxLinesOfCode; 4728 if (funcCodeLines && funcCodeLines.length > max) 4729 { 4730 funcCodeLines.splice(max, funcCodeLines.length - max); 4731 funcCode = funcCodeLines.join("\n") + "..."; 4732 } 4733 func += "\n\nFunction:\n" + funcCode + "\n"; 4734 if (args && args.length > 0) 4735 { 4736 func += "Arguments:\n"; 4737 } 4738 }
4739 if (args && args.length) 4740 { 4741 for (var i = 0; i < args.length; i++) 4742 { 4743 var arg = args[i]; 4744 if (arg && "object" == typeof arg) 4745 { 4746 if (/* ELEMENT_NODE */ 1 == arg.nodeType) 4747 { 4748 var show = "[HTMLElement " + arg.tagName; 4749 if (arg.id) show += " id=\"" + arg.id + "\""; 4750 if (arg.className) show += " class=\"" + arg.className + "\""; 4751 show += "]"; 4752 arg = show; 4753 } 4754 else if (/* TEXT_NODE */ 3 == arg.nodeType) 4755 { 4756 arg = "[Node \"" + arg.nodeValue + "\"]"; 4757 } 4758 } 4759 func += "\n" + arg + "\n"; 4760 } 4761 } 4762 } 4763 catch (exIgnore) {}; 4764 return msg + file + line + func; 4765 }; 4766 Ektron.OnException.exceptionMessage.maxLinesOfCode = 24; 4767 4768 Ektron.OnException.ignoreException = function(ex, args, callee) { return null; }; 4769 Ektron.OnException.throwException = function(ex, args, callee) { throw ex; }; 4770 Ektron.OnException.returnException = function(ex, args, callee) { return Ektron.OnException.exceptionMessage(ex); }; 4771 Ektron.OnException.returnValue = function(v) 4772 { 4773 return function(ex, args, callee) { return v; }; 4774 }; 4775 Ektron.OnException.returnArgument = function(n) 4776 { 4777 return function(ex, args, callee) { if (args && args.length > n) return args[n]; }; 4778 }; 4779 Ektron.OnException.alertException = function(ex, args, callee) { alert(Ektron.OnException.exceptionMessage(ex, args, callee)); }; 4780 Ektron.OnException.consoleException = function(ex, args, callee) { if (typeof console != "undefined") console.error(Ektron.OnException.exceptionMessage(ex, args, callee)); /* firebug */ }; 4781 Ektron.OnException.diagException = function(ex, args, callee) 4782 { 4783 if (document != null && document.cookie && document.cookie.indexOf("Ektron.diagException=") > -1) 4784 { 4785 if (confirm("Click OK to debug or Cancel to continue.\n\n" + Ektron.OnException.exceptionMessage(ex, args, callee))) 4786 { 4787 debugger; 4788 } 4789 } 4790 return null; 4791 } 4792 4793 4794 /* 4795 ************************************** 4796 Ektron.Class Singleton Object 4797 ************************************** 4798 */ 4799 // This function implements multiple inheritance and is compatible with prototype inheritance. 4800 Ektron.Class = 4801 { 4802 functionName : function(fn) 4803 { 4804 if (typeof fn != "function") throw new TypeError("fn must be of type Function"); 4805 var a = fn.toString().match(/function (\w+)\(/); 4806 return (a != null ? a[1] : "anonymous"); 4807 }, 4808 nonEnumerables : ["toLocaleString", "toString", "valueOf"], 4809 inherits : function (thisObject, objBase, baseClassName) 4810 /* 4811 USAGE: 4812 Example 1 4813 function MyClass(arg1, arg2, ...) 4814 { 4815 Ektron.Class.inherits(this, new MyBaseClass(arg1, arg2, ...)); 4816 this.myMethod = function(arg1, arg2, ...) 4817 { 4818 this.MyBaseClass_myMethod(arg1, arg2, ...); // call base class method 4819 }; 4820 } 4821 var objMy = new MyClass(arg1, arg2, arg3); 4822 Example 2 4823 function MyClass(base, arg1, arg2, ...) 4824 { 4825 Ektron.Class.inherits(this, base, "base"); 4826 this.myMethod = function(arg1, arg2, ...) 4827 { 4828 this.base_myMethod(arg1, arg2, ...); // call base class method 4829 }; 4830 } 4831 var objMyBase = new MyBaseClass(arg1, arg2, ...); 4832 var objMy = new MyClass(objMyBase, arg1, arg2, arg3); 4833 Note: multiple inheritance is supported 4834 */ 4835 { 4836 if (typeof thisObject != "object") throw new TypeError("thisObject must be of type Object"); 4837 if (null === thisObject) throw new RangeError("thisObject is null"); 4838 if (typeof objBase != "object") throw new TypeError("objBase must be of type Object"); 4839 if (null === objBase) throw new RangeError("objBase is null"); 4840 if (typeof objBase.constructor != "function") throw new TypeError("objBase.constructor must be of type Function"); 4841 if (typeof baseClassName != "string" && typeof baseClassName != "undefined") throw new TypeError("baseClassName must be of type Str
4841ing or undefined"); 4842 if ("undefined" == typeof baseClassName) 4843 { 4844 for (var p in objBase.constructor.prototype) 4845 { 4846 throw new TypeError("baseClassName must be specified when objBase is derived using prototype"); 4847 } 4848 } 4849 if (typeof baseClassName != "string") 4850 { 4851 baseClassName = Ektron.Class.functionName(objBase.constructor); 4852 } 4853 if ("anonymous" == baseClassName) throw new TypeError("baseClassName must be specified when objBase constructor is anonymous"); 4854 // Copy properties from base object to thisObject 4855 for (var p in objBase) 4856 { 4857 if (p != "constructor") 4858 { 4859 thisObject[p] = objBase[p]; 4860 if ("function" == typeof objBase[p]) 4861 { 4862 thisObject[baseClassName + "_" + p] = objBase[p]; 4863 } 4864 } 4865 } 4866 for (var i in Ektron.Class.nonEnumerables) 4867 { 4868 thisObject[baseClassName + "_" + Ektron.Class.nonEnumerables[i]] = objBase[Ektron.Class.nonEnumerables[i]]; 4869 } 4870 return thisObject; 4871 }, 4872 overrides : function(baseClassName, methods) 4873 /* 4874 baseClassName: (optional) the (arbitrary) name of the base class, used to access base methods 4875 methods: (optional) array of method names (as strings) to override. 4876 If undefined, all methods are overridable. 4877 */ 4878 { 4879 if (typeof baseClassName != "string" && typeof baseClassName != "undefined") throw new TypeError("baseClassName must be of type String or undefined"); 4880 if (typeof baseClassName != "string") baseClassName = Ektron.Class.functionName(objBase.constructor); 4881 if (typeof methods != "undefined" && methods != null && methods.constructor != Array) throw new TypeError("methods must be of type Array or undefined"); 4882 4883 return function (objBase, args) 4884 /* 4885 USAGE: 4886 function MyClass(arg_1, arg_2, ...) 4887 { 4888 this.myMethod = function(arg_m1, arg_m2, ...) 4889 { 4890 this.base_myMethod(arg_m1, arg_m2, ...); // call base class method 4891 }; 4892 } 4893 MyClass.overrides = Ektron.Class.overrides("base", [ "myMethod" ]); 4894 var objMyBase = new MyBaseClass(arg_b1, arg_b2, ...); 4895 MyClass.overrides(objMyBase, [arg_1, arg_2, ...]); 4896 */ 4897 { 4898 if (typeof objBase != "object") throw new TypeError("objBase must be of type Object"); 4899 if (null === objBase) throw new RangeError("objBase is null"); 4900 if (typeof objBase.constructor != "function") throw new TypeError("objBase.constructor must be of type Function"); 4901 if (typeof args != "object" && typeof args != "undefined") throw new TypeError("args must be of type Array or undefined"); 4902 if ("undefined" == typeof args) args = []; 4903 objBase.constructor = this; 4904 var name = ""; 4905 // Copy base methods in case they are overridden 4906 if ("object" == typeof methods && methods.constructor == Array) 4907 { 4908 for (var i = 0; i < methods.length; i++) 4909 { 4910 name = baseClassName + "_" + methods[i]; 4911 if ("undefined" == typeof objBase[name]) 4912 { 4913 objBase[name] = objBase[methods[i]]; 4914 } 4915 } 4916 } 4917 else 4918 { 4919 var aryBaseMethods = []; 4920 for (var p in objBase) 4921 { 4922 if (("function" == typeof objBase[p]) && (p != "constructor")) 4923 { 4924 aryBaseMethods[p] = objBase[p]; 4925 } 4926 } 4927 for (var p in aryBaseMethods) 4928 { 4929 name = baseClassName + "_" + p; 4930 if ("undefined" == typeof objBase[name]) 4931 { 4932 objBase[name] = aryBaseMethods[p]; 4933 } 4934 } 4935 for (var i in Ektron.Class.nonEnumerables) 4936 { 4937 name = baseClassName + "_" + Ektron.Class.nonEnumerables[i]; 4938 if ("undefined" == typeof objBase[name]) 4939 { 4940 objBase[name] = objBase[Ektron.Class.nonEnumerables[i]]; 4941 } 4942 } 4943 } 4944 // 'this' is the derived class constructor function 4945 this.apply(objBase, args); 4946 return objBase; 4947 }; 4948 } 4949 }; 4950 4951 /* 4952 ************************************** 4953 Ektron.ready Function for "EktronReady" Event 4954 ************************************** 4955 */ 4956 Ektron.ready = function(fn) 4957 { 4958 if (!jQuery.isReady) 4959 { 4960 $ektron(document).ready(fn); 4961 } 4962 else 4963 { 4964 $ektron(document).one("EktronReady", function() 4965 { 4966 try 4967 { 4968 fn.apply(this, arguments); 4969 } 4970 catch (ex) 4971 { 4972 Ektron.OnException.diagException(ex, [fn]); 4973 } 4974 }); 4975 } 4976 }; 4977 // for PageRequestManager 4978 Ektron.ready.endRequestHandler = function(sender, args) 4979 { 4980 var objError = args.get_error(); 4981 if (objError) 4982 { 4983 args.set_errorHandled(true); 4984 Ektron.OnException.diagException(new Error("Error during Ajax request:\n" + objError.message), arguments); 4985 } 4986 else 4987 { 4988 $ektron(document).trigger("EktronReady", ["endRequest", sender, args]); 4989 } 4990 }; 4991 // for Page.ClientScript.GetCallbackEventReference, which is JavaScript function WebForm_DoCallback 4992 Ektron.ready.ClientScriptCallbackEvent = 4993 { 4994 eventCallback: function(result, context) 4995 { 4996 // note: $ektron.ajaxCallback triggers "EktronReady", ["callback"] 4997 $ektron(document).trigger("EktronReady", ["callbackEvent", context]); 4998 } 4999 , errorCallback: function(message, context) 5000 { 5001 Ektron.OnException.diagException(new Error("Error during Ajax DoCallback request:\n" + message), arguments); 5002 } 5003 }; 5004 5005 // If RadAjaxControl is already defined at this time, DON'T override its _endRequest handler, 5006 // just add to the MS Ajax endRequest, which will fire after Telerik's. 5007 if (typeof Sys != "undefined" && Sys.WebForms && Sys.WebForms.PageRequestManager && Sys.WebForms.PageRequestManager.getInstance() != null) 5008 { 5009 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(Ektron.ready.endRequestHandler); 5010 } 5011 else 5012 { 5013 $ektron(document).ready(function() 5014 { 5015// if (typeof Telerik != "undefined" && Telerik.Web && Telerik.Web.UI && Telerik.Web.UI.RadAjaxControl) 5016// { 5017// Ektron.Class.overrides("RadAjaxControl", ["_endRequest"]).call(function() 5018// { 5019// this._endRequest = function() 5020// { 5021// Telerik.Web.UI.RadAjaxControl.prototype.RadAjaxControl__endRequest.apply(this, arguments); 5022// $ektron(document).trigger("EktronReady", ["RadAjaxControl.ResponseEnd"]); 5023// }; 5024// }, Telerik.Web.UI.RadAjaxControl.prototype); 5025//// Ektron.Class.overrides("RadAjaxControl", ["EvalScriptCode"]).call(function() 5026//// { 5027//// this.EvalScriptCode = function() 5028//// { 5029//// this.RadAjaxControl_EvalScriptCode.apply(this, arguments); 5030//// }; 5031//// }, Telerik.Web.UI.RadAjaxControl); 5032// } 5033// else 5034 if (typeof Sys != "undefined" && Sys.WebForms && Sys.WebForms.PageRequestManager && Sys.WebForms.PageRequestManager.getInstance() != null) 5035 { 5036 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(Ektron.ready.endRequestHandler); 5037 } 5038 }); 5039 } 5040 5041 5042 Ektron.RegExp.ltrim = new RegExp("^" + Ektron.RegExp.CharacterClass.s + "+"); 5043 Ektron.RegExp.rtrim = new RegExp(Ektron.RegExp.CharacterClass.s + "+$"); 5044 5045 // Ektron speed and correctness improvement 5046 $ektron.trim = function( text ) 5047 { 5048 return (text+"").replace(Ektron.RegExp.ltrim,"").replace(Ektron.RegExp.rtrim,""); 5049 }; 5050 5051 /* 5052 ************************************** 5053 Ektron Extensions to the Library 5054 ************************************** 5055 */ 5056 $ektron.extend( 5057 { 5058 // Left Trim method 5059 ltrim: function(text) { return (text+"").replace(Ektron.RegExp.ltrim,""); }, 5060 // Right Trim method 5061 rtrim: function(text) { return (text+"").replace(Ektron.RegExp.rtrim,""); }, 5062 5063 // method to work around bugs in jquery' offset() when element is nested inside relative/absolute elements 5064 // from: http://www.mail-archive.com/[email protected]/msg72499.html 5065 positionedOffset: function(elem) { 5066 var offsetParent = elem.offsetParent(), offset = elem.offset(), position = elem.position(); 5067 if ( !/^body|html$/i.test( offsetParent[ 0 ].tagName ) ) { 5068 return { left : position.left, top : position.top, from : offsetParent } 5069 } else { 5070 return { left : offset.left, top : offset.top, from : offsetParent } 5071 } 5072 }, 5073 5074 // Method to add new functions to the window.onload event while preserving any existing onload functionality 5075 addLoadEvent: function(fn) 5076 { 5077 var oldOnLoad = window.onload; 5078 if (typeof window.onload != 'function') 5079 { 5080 window.onload = fn; 5081 } 5082 else 5083 { 5084 window.onload = function() 5085 { 5086 oldOnLoad(); 5087 fn(); 5088 } 5089 } 5090 }, 5091 5092 // See also $ektron.fn.ajaxCallback 5093 ajaxCallback: function(uniqueId, data, callback, onexception) // or function(options) 5094 { 5095 var options = ("object" == typeof uniqueId ? uniqueId : 5096 { 5097 uniqueId: uniqueId, 5098 data: data, 5099 success: callback, 5100 onexception: onexception 5101 }); 5102 var ajaxSettings = $ektron.extend( 5103 { 5104 uniqueId: "__Page", 5105 type: "POST", 5106 dataType: "html", 5107 data: "", 5108 success: function() { }, 5109 onexception: null 5110 }, options); 5111 5112 var uniqueId = ajaxSettings.uniqueId; 5113 var data = ajaxSettings.data; 5114 if ("object" == typeof data && data != null) 5115 { 5116 data = $ektron.param(data); 5117 } 5118 var successCallback = ajaxSettings.success; 5119 var onexception = ajaxSettings.onexception; 5120 5121 var aryClientManager = []; 5122 5123 $ektron(":hidden[id*='EktronClientManager']").each(function() 5124 { 5125 if (this.value) 5126 { 5127 var values = this.value.split(","); 5128 for (var i in values) 5129 { 5130 var name = values[i]; 5131 if (!aryClientManager[name]) 5132 { 5133 aryClientManager.push(name); 5134 aryClientManager[name] = true; 5135 } 5136 } 5137 } 5138 }); 5139 5140 return $ektron.ajax($ektron.extend(ajaxSettings, 5141 { 5142 data: 5143 { 5144 __CALLBACKID: uniqueId, 5145 __CALLBACKPARAM: data, 5146 __VIEWSTATE: "", 5147 EktronClientManager: aryClientManager.join(",") 5148 }, 5149 success: function(data) 5150 { 5151 if ("string" == typeof data) 5152 { 5153 var aryMatch = data.match(/^([0-9]+)\|/);
5154 if (aryMatch && 2 == aryMatch.length) 5155 { 5156 var nCount = parseInt(aryMatch[1], 10); 5157 data = data.substring(aryMatch[0].length + nCount); 5158 } 5159 else 5160 { 5161 data = data.replace(/^[se]/, "").replace(/0\|$/, ""); 5162 } 5163 } 5164 try 5165 { 5166 successCallback.apply(this, arguments); 5167 } 5168 catch (ex) 5169 { 5170 Ektron.OnException(this, onexception, ex, arguments, successCallback); 5171 } 5172 $ektron(document).trigger("EktronReady", ["callback"]); 5173 } 5174 })); 5175 }, 5176 5177 isEditableElement: function(elem) 5178 { 5179 if (!elem) return false; 5180 var bEditable = (true == elem.isContentEditable); 5181 if (elem.ownerDocument) 5182 { 5183 if ("on" == elem.ownerDocument.designMode) 5184 { 5185 bEditable = true; 5186 var strContentEditable = elem.contentEditable; // FF requires 3.0 and later 5187 if ("false" == strContentEditable) 5188 { 5189 bEditable = false; 5190 } 5191 else if (strContentEditable != "true") 5192 { 5193 $ektron(elem).parents("[contenteditable]").each(function() 5194 { 5195 var strContentEditable = this.contentEditable; // FF requires 3.0 and later 5196 if ("true" == strContentEditable) return false; // break 5197 if ("false" == strContentEditable) 5198 { 5199 bEditable = false; 5200 return false; // break 5201 } 5202 }); 5203 } 5204 } 5205 else if ((("INPUT" == elem.tagName && ("text" == elem.type || "" == elem.type)) || "TEXTAREA" == elem.tagName) && !elem.disabled && !elem.readOnly) 5206 { 5207 bEditable = true; 5208 } 5209 } 5210 return bEditable; 5211 } 5212 }); 5213 5214 $ektron.fn.extend( 5215 { 5216 unwrapInner: function() 5217 { 5218 var ret = []; 5219 this.each(function() 5220 { 5221 var $this = $ektron(this); 5222 if (null == this.firstChild && null == this.lastChild) 5223 { 5224 // empty, just remove 5225 $this.remove(); 5226 } 5227 else if (this.firstChild != null && this.lastChild != null) 5228 { 5229 // replace with its children 5230 var content = $this.contents(); 5231 $this.replaceWith(content); 5232 ret = ret.concat(content.get()); 5233 } 5234 else 5235 { 5236 // corrupt DOM (seen in IE 7 when pasting blocking tags in tags w/ inline content model, eg, P in SPAN 5237 // just leave it, but don't add it to the return stack 5238 Ektron.OnException.diagException(new ReferenceError("Corrupt DOM"), [this.nodeName, this.innerHTML]); 5239 } 5240 }); 5241 return this.pushStack(ret); 5242 }, 5243 5244 // See also $ektron.ajaxCallback 5245 ajaxCallback: function(uniqueId, data, callback, onexception) // or function(options) 5246 { 5247 var me = this; 5248 var options = ("object" == typeof uniqueId ? uniqueId : 5249 { 5250 uniqueId: uniqueId, 5251 data: data, 5252 complete: callback, 5253 onexception: onexception 5254 }); 5255 var ajaxSettings = $ektron.extend( 5256 { 5257 success: function() {}, 5258 complete: function() {}, 5259 onexception: null 5260 }, options); 5261 var successCallback = ajaxSettings.success; 5262 var completeCallback = ajaxSettings.complete; 5263 var onexception = ajaxSettings.onexception; 5264 5265 $ektron.ajaxCallback($ektron.extend(ajaxSettings, 5266 { 5267 success: function(data) 5268 { 5269 $ektron.each(me, function() 5270 { 5271 $ektron(this).html(data); 5272 }); 5273 try 5274 { 5275 successCallback.apply(me, arguments); 5276 } 5277 catch (ex) 5278 { 5279 Ektron.OnException(me, onexception, ex, arguments, successCallback); 5280 } 5281 }, 5282 complete: function() 5283 { 5284 try 5285 { 5286 completeCallback.apply(me, arguments); 5287 } 5288 catch (ex) 5289 { 5290 Ektron.OnException(me, onexception, ex, arguments, completeCallback); 5291 } 5292 }, 5293 onexception: onexception 5294 })); 5295 return this; 5296 }, 5297 5298 // Correct uniqueness for all id attributes and assoc labels. 5299 // Correct uniqueness for all name attributes. 5300 makeIdentifiersUnique: function(makeUnique) 5301 // makeUnique: (optional) function that returns unique identifier given an identifier (string) 5302 { 5303 var descendantOrSelf = this.find("*").andSelf(); 5304 var strUniqueSuffix = Math.floor(Math.random() * 1679616).toString(36); // 4 digit alphanum 5305 // makeUnique must ensure the new unique 'id' continues to match <label for> 5306 makeUnique = ("function" == typeof makeUnique ? makeUnique : function(id) 5307 { 5308 // Remove suffix of "_" 4-digit-alphanum (if it exists), then append new suffix 5309 return id.replace(/_[0-9a-z]{4}$/,"") + "_" + strUniqueSuffix; 5310 }); 5311 5312 descendantOrSelf.filter("[id]").each(function() 5313 {
5314 this.id = makeUnique(this.id); 5315 }); 5316 5317 descendantOrSelf.filter("label").each(function() 5318 { 5319 this.htmlFor = makeUnique(this.htmlFor); 5320 }); 5321 5322 // caution: do not split id & name uniqueness code b/c for <a>, id should equal name, 5323 // which won't be the case if the .random() function is called twice. 5324 5325 descendantOrSelf.filter("[name]").each(function() 5326 { 5327 try 5328 { 5329 if ($ektron.browser.msie) 5330 { 5331 // Microsoft JScript allows the name to be changed at run time. 5332 // HOWEVER! 5333 // This does not cause the name in the programming model to change 5334 // in the collection of elements, but it does change the name used 5335 // for submitting elements. The NAME attribute cannot be set at run time 5336 // on elements dynamically created with the createElement method. 5337 // To create an element with a name attribute, include the attribute 5338 // and value when using the createElement method. 5339 var strHTML = this.outerHTML + ""; 5340 strHTML = strHTML.replace(new RegExp("name=" + this.name, "g"), "name=" + makeUnique(this.name)); 5341 $ektron(this).replaceWith(strHTML); 5342 } 5343 else 5344 { 5345 this.name = makeUnique(this.name); 5346 } 5347 } 5348 catch (ex) 5349 { 5350 // ignore 5351 }; 5352 }); 5353 5354 return this; 5355 } 5356 }); 5357 5358 // Ektron Overrides of the Library 5359 Ektron.Class.overrides("jquery", ["clone"]).call(function() 5360 { 5361 // override methods 5362 /* Usage: 5363 $ektron(selector).clone(true); 5364 $ektron(selector).clone(true).makeIdentifiersUnique(); 5365 */ 5366 this.clone = function(events) 5367 { 5368 var ret = this.jquery_clone.apply(this, arguments); // pass all arguments in case jquery API changes 5369 5370 // Copy .value and .checked attributes of form fields 5371 var dstFormElements = ret.find("*").andSelf().filter(":input"); 5372 if (dstFormElements.length > 0) 5373 { 5374 var srcFormElements = this.find("*").andSelf().filter(":input"); 5375 dstFormElements.each(function(i) 5376 { 5377 $ektron(this).val( srcFormElements.eq(i).val() ); 5378 if ("checkbox" == this.type || "radio" == this.type) 5379 { 5380 this.checked = srcFormElements.get(i).checked; 5381 } 5382 }); 5383 } 5384 return ret; 5385 }; 5386 }, $ektron.fn); 5387 5388 Ektron.Class.overrides("jquery", ["handle"]).call(function() 5389 { 5390 this.handle = function(event) 5391 { 5392 try 5393 { 5394 return $ektron.event.jquery_handle.apply(this, arguments); // pass all arguments in case jquery API changes 5395 } 5396 catch (ex) 5397 { 5398 Ektron.OnException.diagException(ex, arguments, $ektron.event.jquery_handle); 5399 return false; 5400 } 5401 }; 5402 }, $ektron.event); 5403} 5404 5405Ektron.ready(function(event, eventName) 5406{ 5407 if ("localhost" == location.hostname && typeof SymRealOnLoad != "undefined") 5408 { 5409 if (document != null && document.cookie && -1 == document.cookie.indexOf("Ektron.SymantecWarning=")) 5410 { 5411 var msg = "The Symantec ad blocking in your system may prevent some web pages from functioning properly. Please consult your IT administrator if you need to turn it off. "; 5412 msg += "\nFor more information, please read:\n\nhttp://dev.ektron.com/kb_article.aspx?id=24520"; 5413 alert(msg); 5414 var date = new Date(); 5415 var periodInDays = 1; 5416 date.setTime(date.getTime() + (periodInDays * 24 * 60 * 60 * 1000)); 5417 var expires = "expires=" + date.toUTCString(); // use expires attribute, max-age is not supported by IE 5418 document.cookie = "Ektron.SymantecWarning=true; " + expires + "; path=/"; 5419 } 5420 } 5421});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.