(function(){ /* * jquery 1.2.6 - 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-05-24 14:22:17 -0400 (sat, 24 may 2008) $ * $rev: 5685 $ */ // map over jquery in case of overwrite var _jquery = window.jquery, // map over the $ in case of overwrite _$ = window.$; var jquery = window.jquery = window.$ = function( selector, context ) { // the jquery object is actually just the init constructor 'enhanced' return new jquery.fn.init( selector, context ); }; // 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 issimple = /^.[^:#\[\.]*$/, // will speed up references to undefined, and allows munging its name. undefined; 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 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 return jquery( elem ); } selector = []; } // handle: $(expr, [context]) // (which is just equivalent to: $(content).find(expr) } else return jquery( context ).find( selector ); // handle: $(function) // shortcut for document ready } else if ( jquery.isfunction( selector ) ) return jquery( document )[ jquery.fn.ready ? "ready" : "load" ]( selector ); return this.setarray(jquery.makearray(selector)); }, // the current version of jquery being used jquery: "1.2.6", // the number of elements contained in the matched element set size: function() { 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 ) { return num == undefined ? // 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 ) { return jquery.each( this, callback, args ); }, // determine the position of an element within // the matched set of elements index: function( elem ) { var ret = -1; // locate the position of the desired element return jquery.inarray( // if it receives a jquery object, the first element is used elem && elem.jquery ? elem[0] : elem , this ); }, attr: function( name, value, type ) { var options = name; // look for the case where we're accessing a style value if ( name.constructor == string ) if ( value === undefined ) return this[0] && jquery[ type || "attr" ]( this[0], name ); 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 ) { // ignore negative width and height values if ( (key == 'width' || key == 'height') && parsefloat(value) < 0 ) value = undefined; return this.attr( key, value, "curcss" ); }, text: function( text ) { if ( typeof text != "object" && text != null ) return this.empty().append( (this[0] && this[0].ownerdocument || document).createtextnode( text ) ); var ret = ""; jquery.each( text || this, function(){ jquery.each( this.childnodes, function(){ if ( this.nodetype != 8 ) ret += this.nodetype != 1 ? this.nodevalue : jquery.fn.text( [ this ] ); }); }); return ret; }, wrapall: function( html ) { if ( this[0] ) // the elements to wrap the target around jquery( html, this[0].ownerdocument ) .clone() .insertbefore( this[0] ) .map(function(){ var elem = this; while ( elem.firstchild ) elem = elem.firstchild; return elem; }) .append(this); return this; }, wrapinner: function( html ) { return this.each(function(){ jquery( this ).contents().wrapall( html ); }); }, wrap: function( html ) { return this.each(function(){ jquery( this ).wrapall( html ); }); }, append: function() { return this.dommanip(arguments, true, false, function(elem){ if (this.nodetype == 1) this.appendchild( elem ); }); }, prepend: function() { return this.dommanip(arguments, true, true, function(elem){ if (this.nodetype == 1) this.insertbefore( elem, this.firstchild ); }); }, before: function() { return this.dommanip(arguments, false, false, function(elem){ this.parentnode.insertbefore( elem, this ); }); }, after: function() { return this.dommanip(arguments, false, true, function(elem){ this.parentnode.insertbefore( elem, this.nextsibling ); }); }, end: function() { return this.prevobject || jquery( [] ); }, find: function( selector ) { var elems = jquery.map(this, function(elem){ return jquery.find( selector, elem ); }); return this.pushstack( /[^+>] [^+>]/.test( selector ) || selector.indexof("..") > -1 ? jquery.unique( elems ) : elems ); }, clone: function( events ) { // do the clone var ret = this.map(function(){ if ( jquery.browser.msie && !jquery.isxmldoc(this) ) { // ie copies events bound via attachevent when // using clonenode. calling detachevent on the // clone will also remove the events from the orignal // in order to get around this, we use innerhtml. // unfortunately, this means some modifications to // attributes in ie that are actually only stored // as properties will not be copied (such as the // the name attribute on an input). var clone = this.clonenode(true), container = document.createelement("div"); container.appendchild(clone); return jquery.clean([container.innerhtml])[0]; } else return this.clonenode(true); }); // need to set the expando to null on the cloned set if it exists // removedata doesn't work here, ie removes it from the original as well // this is primarily for ie but the data expando shouldn't be copied over in any browser var clone = ret.find("*").andself().each(function(){ if ( this[ expando ] != undefined ) this[ expando ] = null; }); // copy the events from the original to the clone if ( events === true ) this.find("*").andself().each(function(i){ if (this.nodetype == 3) return; var events = jquery.data( this, "events" ); for ( var type in events ) for ( var handler in events[ type ] ) jquery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); }); // return the cloned set return ret; }, filter: function( selector ) { return this.pushstack( jquery.isfunction( selector ) && jquery.grep(this, function(elem, i){ return selector.call( elem, i ); }) || jquery.multifilter( selector, this ) ); }, not: function( selector ) { if ( selector.constructor == string ) // test special case where just one selector is passed in if ( issimple.test( selector ) ) return this.pushstack( jquery.multifilter( selector, this, true ) ); else selector = jquery.multifilter( selector, this ); var isarraylike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodetype; return this.filter(function() { return isarraylike ? jquery.inarray( this, selector ) < 0 : this != selector; }); }, add: function( selector ) { return this.pushstack( jquery.unique( jquery.merge( this.get(), typeof selector == 'string' ? jquery( selector ) : jquery.makearray( selector ) ))); }, is: function( selector ) { return !!selector && jquery.multifilter( selector, this ).length > 0; }, hasclass: function( selector ) { return this.is( "." + selector ); }, val: function( value ) { if ( value == undefined ) { if ( this.length ) { var elem = this[0]; // we need to handle select boxes special if ( jquery.nodename( elem, "select" ) ) { var index = elem.selectedindex, values = [], options = elem.options, one = elem.type == "select-one"; // nothing was selected if ( index < 0 ) return null; // loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; if ( option.selected ) { // get the specifc value for the option value = jquery.browser.msie && !option.attributes.value.specified ? option.text : option.value; // we don't need an array for one selects if ( one ) return value; // multi-selects return an array values.push( value ); } } return values; // everything else, we just grab the value } else return (this[0].value || "").replace(/\r/g, ""); } return undefined; } if( value.constructor == number ) value += ''; return this.each(function(){ if ( this.nodetype != 1 ) return; if ( value.constructor == array && /radio|checkbox/.test( this.type ) ) this.checked = (jquery.inarray(this.value, value) >= 0 || jquery.inarray(this.name, value) >= 0); else if ( jquery.nodename( this, "select" ) ) { var values = jquery.makearray(value); jquery( "option", this ).each(function(){ this.selected = (jquery.inarray( this.value, values ) >= 0 || jquery.inarray( this.text, values ) >= 0); }); if ( !values.length ) this.selectedindex = -1; } else this.value = value; }); }, html: function( value ) { return value == undefined ? (this[0] ? this[0].innerhtml : null) : this.empty().append( value ); }, replacewith: function( value ) { return this.after( value ).remove(); }, eq: function( i ) { return this.slice( i, i + 1 ); }, slice: function() { return this.pushstack( array.prototype.slice.apply( this, arguments ) ); }, map: function( callback ) { return this.pushstack( jquery.map(this, function(elem, i){ return callback.call( elem, i, elem ); })); }, andself: function() { return this.add( this.prevobject ); }, data: function( key, value ){ var parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value === undefined ) { var data = this.triggerhandler("getdata" + parts[1] + "!", [parts[0]]); if ( data === undefined && this.length ) data = jquery.data( this[0], key ); return data === undefined && parts[1] ? this.data( parts[0] ) : data; } else return this.trigger("setdata" + parts[1] + "!", [parts[0], value]).each(function(){ jquery.data( this, key, value ); }); }, removedata: function( key ){ return this.each(function(){ jquery.removedata( this, key ); }); }, dommanip: function( args, table, reverse, callback ) { var clone = this.length > 1, elems; return this.each(function(){ if ( !elems ) { elems = jquery.clean( args, this.ownerdocument ); if ( reverse ) elems.reverse(); } var obj = this; if ( table && jquery.nodename( this, "table" ) && jquery.nodename( elems[0], "tr" ) ) obj = this.getelementsbytagname("tbody")[0] || this.appendchild( this.ownerdocument.createelement("tbody") ); var scripts = jquery( [] ); jquery.each(elems, function(){ var elem = clone ? jquery( this ).clone( true )[0] : this; // execute all scripts after the elements have been injected if ( jquery.nodename( elem, "script" ) ) scripts = scripts.add( elem ); else { // remove any inner scripts for later evaluation if ( elem.nodetype == 1 ) scripts = scripts.add( jquery( "script", elem ).remove() ); // inject the elements into the document callback.call( obj, elem ); } }); scripts.each( evalscript ); }); } }; // give the init function the jquery prototype for later instantiation jquery.fn.init.prototype = jquery.fn; function evalscript( i, elem ) { if ( elem.src ) jquery.ajax({ url: elem.src, async: false, datatype: "script" }); else jquery.globaleval( elem.text || elem.textcontent || elem.innerhtml || "" ); if ( elem.parentnode ) elem.parentnode.removechild( elem ); } function now(){ return +new date; } jquery.extend = jquery.fn.extend = function() { // copy reference to target object var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; // handle a deep copy situation if ( target.constructor == boolean ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // handle case when target is a string or something (possible in deep copy) if ( typeof target != "object" && typeof target != "function" ) target = {}; // extend jquery itself if only one argument is passed if ( length == i ) { target = this; --i; } for ( ; i < length; i++ ) // only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) // extend the base object for ( var name in options ) { var src = target[ name ], copy = options[ name ]; // prevent never-ending loop if ( target === copy ) continue; // recurse if we're merging object values if ( deep && copy && typeof copy == "object" && !copy.nodetype ) target[ name ] = jquery.extend( deep, // never move original objects, clone them src || ( copy.length != null ? [ ] : { } ) , copy ); // don't bring in undefined values else if ( copy !== undefined ) target[ name ] = copy; } // return the modified object return target; }; var expando = "jquery" + now(), uuid = 0, windowdata = {}, // exclude the following css properties to add px exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, // cache defaultview defaultview = document.defaultview || {}; jquery.extend({ noconflict: function( deep ) { window.$ = _$; if ( deep ) window.jquery = _jquery; return jquery; }, // see test/unit/core.js for details concerning this function. isfunction: function( fn ) { return !!fn && typeof fn != "string" && !fn.nodename && fn.constructor != array && /^[\s[]?function/.test( fn + "" ); }, // check if an element is in a (or is an) xml document isxmldoc: function( elem ) { return elem.documentelement && !elem.body || elem.tagname && elem.ownerdocument && !elem.ownerdocument.body; }, // evalulates a script in a global context globaleval: function( data ) { data = jquery.trim( data ); if ( data ) { // inspired by code by andrea giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getelementsbytagname("head")[0] || document.documentelement, script = document.createelement("script"); script.type = "text/javascript"; if ( jquery.browser.msie ) script.text = data; else script.appendchild( document.createtextnode( data ) ); // use insertbefore instead of appendchild to circumvent an ie6 bug. // this arises when a base node is used (#2709). head.insertbefore( script, head.firstchild ); head.removechild( script ); } }, nodename: function( elem, name ) { return elem.nodename && elem.nodename.touppercase() == name.touppercase(); }, cache: {}, data: function( elem, name, data ) { elem = elem == window ? windowdata : elem; var id = elem[ expando ]; // compute a unique id for the element if ( !id ) id = elem[ expando ] = ++uuid; // only generate the data cache if we're // trying to access or manipulate it if ( name && !jquery.cache[ id ] ) jquery.cache[ id ] = {}; // prevent overriding the named cache with undefined values if ( data !== undefined ) jquery.cache[ id ][ name ] = data; // return the named cache data, or the id for the element return name ? jquery.cache[ id ][ name ] : id; }, removedata: function( elem, name ) { elem = elem == window ? windowdata : elem; var id = elem[ expando ]; // if we want to remove a specific section of the element's data if ( name ) { if ( jquery.cache[ id ] ) { // remove the section of cache data delete jquery.cache[ id ][ name ]; // if we've removed all the data, remove the element's cache name = ""; for ( name in jquery.cache[ id ] ) break; if ( !name ) jquery.removedata( elem ); } // otherwise, we want to remove all of the element's data } else { // clean up the element expando try { delete elem[ expando ]; } catch(e){ // ie has trouble directly removing the expando // but it's ok with using removeattribute if ( elem.removeattribute ) elem.removeattribute( expando ); } // completely remove the data cache delete jquery.cache[ id ]; } }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length; if ( args ) { if ( length == undefined ) { for ( name in object ) if ( callback.apply( object[ name ], args ) === false ) break; } else for ( ; i < length; ) if ( callback.apply( object[ i++ ], args ) === false ) break; // a special, fast, case for the most common use of each } else { if ( length == undefined ) { for ( name in object ) if ( callback.call( object[ name ], name, object[ name ] ) === false ) break; } else for ( var value = object[0]; i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} } return object; }, prop: function( elem, value, type, i, name ) { // handle executable functions if ( jquery.isfunction( value ) ) value = value.call( elem, i ); // handle passing in a number to a css property return value && value.constructor == number && type == "curcss" && !exclude.test( name ) ? value + "px" : value; }, classname: { // internal only, use addclass("class") add: function( elem, classnames ) { jquery.each((classnames || "").split(/\s+/), function(i, classname){ if ( elem.nodetype == 1 && !jquery.classname.has( elem.classname, classname ) ) elem.classname += (elem.classname ? " " : "") + classname; }); }, // internal only, use removeclass("class") remove: function( elem, classnames ) { if (elem.nodetype == 1) elem.classname = classnames != undefined ? jquery.grep(elem.classname.split(/\s+/), function(classname){ return !jquery.classname.has( classnames, classname ); }).join(" ") : ""; }, // internal only, use hasclass("class") has: function( elem, classname ) { return jquery.inarray( classname, (elem.classname || elem).tostring().split(/\s+/) ) > -1; } }, // a method for quickly swapping in/out css properties to get correct calculations swap: function( elem, options, callback ) { var old = {}; // remember the old values, and insert the new ones for ( var name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } callback.call( elem ); // revert the old values for ( var name in options ) elem.style[ name ] = old[ name ]; }, css: function( elem, name, force ) { if ( name == "width" || name == "height" ) { var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "left", "right" ] : [ "top", "bottom" ]; function getwh() { val = name == "width" ? elem.offsetwidth : elem.offsetheight; var padding = 0, border = 0; jquery.each( which, function() { padding += parsefloat(jquery.curcss( elem, "padding" + this, true)) || 0; border += parsefloat(jquery.curcss( elem, "border" + this + "width", true)) || 0; }); val -= math.round(padding + border); } if ( jquery(elem).is(":visible") ) getwh(); else jquery.swap( elem, props, getwh ); return math.max(0, val); } return jquery.curcss( elem, name, force ); }, curcss: function( elem, name, force ) { var ret, style = elem.style; // a helper method for determining if an element's values are broken function color( elem ) { if ( !jquery.browser.safari ) return false; // defaultview is cached var ret = defaultview.getcomputedstyle( elem, null ); return !ret || ret.getpropertyvalue("color") == ""; } // we need to handle opacity special in ie if ( name == "opacity" && jquery.browser.msie ) { ret = jquery.attr( style, "opacity" ); return ret == "" ? "1" : ret; } // opera sometimes will give the wrong display answer, this fixes it, see #2037 if ( jquery.browser.opera && name == "display" ) { var save = style.outline; style.outline = "0 solid black"; style.outline = save; } // make sure we're using the right name for getting the float value if ( name.match( /float/i ) ) name = stylefloat; if ( !force && style && style[ name ] ) ret = style[ name ]; else if ( defaultview.getcomputedstyle ) { // only "float" is needed here if ( name.match( /float/i ) ) name = "float"; name = name.replace( /([a-z])/g, "-$1" ).tolowercase(); var computedstyle = defaultview.getcomputedstyle( elem, null ); if ( computedstyle && !color( elem ) ) ret = computedstyle.getpropertyvalue( name ); // if the element isn't reporting its values properly in safari // then some display: none elements are involved else { var swap = [], stack = [], a = elem, i = 0; // locate all of the parent display: none elements for ( ; a && color(a); a = a.parentnode ) stack.unshift(a); // go through and make them visible, but in reverse // (it would be better if we knew the exact display type that they had) for ( ; i < stack.length; i++ ) if ( color( stack[ i ] ) ) { swap[ i ] = stack[ i ].style.display; stack[ i ].style.display = "block"; } // since we flip the display style, we have to handle that // one special, otherwise get the value ret = name == "display" && swap[ stack.length - 1 ] != null ? "none" : ( computedstyle && computedstyle.getpropertyvalue( name ) ) || ""; // finally, revert the display styles back for ( i = 0; i < swap.length; i++ ) if ( swap[ i ] != null ) stack[ i ].style.display = swap[ i ]; } // we should always get a number back from opacity if ( name == "opacity" && ret == "" ) ret = "1"; } else if ( elem.currentstyle ) { var camelcase = name.replace(/\-(\w)/g, function(all, letter){ return letter.touppercase(); }); ret = elem.currentstyle[ name ] || elem.currentstyle[ camelcase ]; // from the awesome hack by dean edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // if we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { // remember the original values var left = style.left, rsleft = elem.runtimestyle.left; // put in the new values to get a computed value out elem.runtimestyle.left = elem.currentstyle.left; style.left = ret || 0; ret = style.pixelleft + "px"; // revert the changed values style.left = left; elem.runtimestyle.left = rsleft; } } return ret; }, clean: function( elems, context ) { var ret = []; context = context || document; // !context.createelement fails in ie with an error but returns typeof 'object' if (typeof context.createelement == 'undefined') context = context.ownerdocument || context[0] && context[0].ownerdocument || document; jquery.each(elems, function(i, elem){ if ( !elem ) return; if ( elem.constructor == number ) elem += ''; // convert html string into dom nodes if ( typeof elem == "string" ) { // fix "xhtml"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + ">"; }); // trim whitespace, otherwise indexof won't work as expected var tags = jquery.trim( elem ).tolowercase(), div = context.createelement("div"); var wrap = // option or optgroup !tags.indexof("", "" ] || !tags.indexof("", "" ] || tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && [ 1, "", "
" ] || !tags.indexof("", "" ] || // matched above (!tags.indexof("", "" ] || !tags.indexof("", "" ] || // ie can't serialize and