(function(){
/*
* jQuery 1.2.3 - New Wave Javascript
*
* Copyright (c) 2008 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
* $Rev: 4663 $
*/
// Map over jQuery in case of overwrite
if ( window.jQuery )
var _jQuery = window.jQuery;
var jQuery = window.jQuery = function( selector, context ) {
///<summary>
/// This function accepts a string containing a CSS selector which is then used to match a set of elements.
///</summary>
///<param name="selector">
/// 1. An expression to search with.
/// 2. html - Create DOM elements on-the-fly from the provided String of raw HTML.
/// 3. elements - Wrap jQuery functionality around a single or multiple DOM Element(s).
/// 4. callback - A shorthand for $(document).ready().
///</param>
///<param name="context" optional="true">(optional) A DOM Element, Document or jQuery to use as context</param>
///<returns type="jQuery" />
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.prototype.init( selector, context );
};
// Map over the $ in case of overwrite
if ( window.$ )
var _$ = window.$;
// Map the jQuery namespace to the '$' one
window.$ = jQuery;
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
// Is it a simple selector
var isSimple = /^.[^:#\[\.]*$/;
jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
// Make sure that a selection was provided
selector = selector || document;
// Handle $(DOMElement)
if ( selector.nodeType ) {
this[0] = selector;
this.length = 1;
return this;
// Handle HTML strings
} else if ( typeof selector == "string" ) {
// Are we dealing with HTML string or an ID?
var match = quickExpr.exec( selector );
// Verify a match, and that no context was specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] )
selector = jQuery.clean( [ match[1] ], context );
// HANDLE: $("#id")
else {
var elem = document.getElementById( match[3] );
// Make sure an element was located
if ( elem )
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id != match[3] )
return jQuery().find( selector );
// Otherwise, we inject the element directly into the jQuery object
else {
this[0] = elem;
this.length = 1;
return this;
}
else
selector = [];
}
// HANDLE: $(expr, [context])
// (which is just equivalent to: $(content).find(expr)
} else
return new jQuery( context ).find( selector );
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) )
return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );
return this.setArray(
// HANDLE: $(array)
selector.constructor == Array && selector ||
// HANDLE: $(arraylike)
// Watch for when an array-like object, contains DOM nodes, is passed in as the selector
(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
// HANDLE: $(*)
[ selector ] );
},
// The current version of jQuery being used
jquery: "1.2.3",
// The number of elements contained in the matched element set
size: function() {
///<summary>The number of elements in the jQuery object.</summary>
///<returns type="Number" />
return this.length;
},
// The number of elements contained in the matched element set
length: 0,
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
///<summary>note: lookup this function</summary>
///<returns type="jQuery" />
return num == undefined ?
///<summary>Access all matched DOM elements. note: intellisense not working.</summary>
///<param name="num" type="Number" optional="true">(optional) Access the element in the Nth position.</param>
///<returns type="Array" />
// Return a 'clean' array
jQuery.makeArray( this ) :
// Return just the object
this[ num ];
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery( elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
// Return the newly-formed element set
return ret;
},
// Force the current matched set of elements to become
// the specified array of elements (destroying the stack in the process)
// You should use pushStack() in order to do this, but maintain the stack
setArray: function( elems ) {
// Resetting the length to 0, then using the native Array push
// is a super-fast way to populate an object with array-like properties
this.length = 0;
Array.prototype.push.apply( this, elems );
return this;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
///<summary>Execute a function within the context of every matched element.</summary>
///<param name="callback">The callback to execute for each matched element.</param>
///<param name="args">(You can seed the arguments with an array of args, but this is only used internally.)</param>
///<returns type="jQuery" />
return jQuery.each( this, callback, args );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
///<summary>Searches every matched element for the object and returns the index of the element, if found, starting with zero.</summary>
///<param name="elem">Object to search for.</param>
///<returns type="Number" />
var ret = -1;
// Locate the position of the desired element
this.each(function(i){
if ( this == elem )
ret = i;
});
return ret;
},
attr: function( name, value, type ) {
///<summary>
/// 1. attr(name) - Access a property on the first matched element. This method makes it easy to retrieve a property value from the first matched element. If the element does not have an attribute with such a name, undefined is returned. Returns Object.
/// 2. attr(properties) - Set a key/value object as properties to all matched elements.
/// 3. attr(key, value) - Set a single property to a value, on all matched elements.
/// 4. attr(key, fn) - Set a single property to a computed value, on all matched elements.
///</summary>
///<param name="name" optional="true">(optional) The name of the property to access.</param>
///<param name="value" optional="true">(optional) The value to set the property to.</param>
///<param name="type" optional="true">(optional) This method only accepts 2 parameters, see the summary.</param>
///<returns type="jQuery" />
var options = name;
// Look for the case where we're accessing a style value
if ( name.constructor == String )
if ( value == undefined )
return this.length && jQuery[ type || "attr" ]( this[0], name ) || undefined;
else {
options = {};
options[ name ] = value;
}
// Check to see if we're setting style values
return this.each(function(i){
// Set all the styles
for ( name in options )
jQuery.attr(
type ?
this.style :
this,
name, jQuery.prop( this, options[ name ], type, i, name )
);
});
},
css: function( key, value ) {
///<summary>
/// 1. css(key) - Return a style property on the first matched element.
/// 2. css(value) - Set a key/value object as style properties to all matched elements.
/// 3. css(key, value) - Set a single st