bos@574: (function(){ bos@574: /* bos@574: * jQuery 1.2.1 - New Wave Javascript bos@574: * bos@574: * Copyright (c) 2007 John Resig (jquery.com) bos@574: * Dual licensed under the MIT (MIT-LICENSE.txt) bos@574: * and GPL (GPL-LICENSE.txt) licenses. bos@574: * bos@574: * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $ bos@574: * $Rev: 3353 $ bos@574: */ bos@574: bos@574: // Map over jQuery in case of overwrite bos@574: if ( typeof jQuery != "undefined" ) bos@574: var _jQuery = jQuery; bos@574: bos@574: var jQuery = window.jQuery = function(selector, context) { bos@574: // If the context is a namespace object, return a new object bos@574: return this instanceof jQuery ? bos@574: this.init(selector, context) : bos@574: new jQuery(selector, context); bos@574: }; bos@574: bos@574: // Map over the $ in case of overwrite bos@574: if ( typeof $ != "undefined" ) bos@574: var _$ = $; bos@574: bos@574: // Map the jQuery namespace to the '$' one bos@574: window.$ = jQuery; bos@574: bos@574: var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; bos@574: bos@574: jQuery.fn = jQuery.prototype = { bos@574: init: function(selector, context) { bos@574: // Make sure that a selection was provided bos@574: selector = selector || document; bos@574: bos@574: // Handle HTML strings bos@574: if ( typeof selector == "string" ) { bos@574: var m = quickExpr.exec(selector); bos@574: if ( m && (m[1] || !context) ) { bos@574: // HANDLE: $(html) -> $(array) bos@574: if ( m[1] ) bos@574: selector = jQuery.clean( [ m[1] ], context ); bos@574: bos@574: // HANDLE: $("#id") bos@574: else { bos@574: var tmp = document.getElementById( m[3] ); bos@574: if ( tmp ) bos@574: // Handle the case where IE and Opera return items bos@574: // by name instead of ID bos@574: if ( tmp.id != m[3] ) bos@574: return jQuery().find( selector ); bos@574: else { bos@574: this[0] = tmp; bos@574: this.length = 1; bos@574: return this; bos@574: } bos@574: else bos@574: selector = []; bos@574: } bos@574: bos@574: // HANDLE: $(expr) bos@574: } else bos@574: return new jQuery( context ).find( selector ); bos@574: bos@574: // HANDLE: $(function) bos@574: // Shortcut for document ready bos@574: } else if ( jQuery.isFunction(selector) ) bos@574: return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector ); bos@574: bos@574: return this.setArray( bos@574: // HANDLE: $(array) bos@574: selector.constructor == Array && selector || bos@574: bos@574: // HANDLE: $(arraylike) bos@574: // Watch for when an array-like object is passed as the selector bos@574: (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) || bos@574: bos@574: // HANDLE: $(*) bos@574: [ selector ] ); bos@574: }, bos@574: bos@574: jquery: "1.2.1", bos@574: bos@574: size: function() { bos@574: return this.length; bos@574: }, bos@574: bos@574: length: 0, bos@574: bos@574: get: function( num ) { bos@574: return num == undefined ? bos@574: bos@574: // Return a 'clean' array bos@574: jQuery.makeArray( this ) : bos@574: bos@574: // Return just the object bos@574: this[num]; bos@574: }, bos@574: bos@574: pushStack: function( a ) { bos@574: var ret = jQuery(a); bos@574: ret.prevObject = this; bos@574: return ret; bos@574: }, bos@574: bos@574: setArray: function( a ) { bos@574: this.length = 0; bos@574: Array.prototype.push.apply( this, a ); bos@574: return this; bos@574: }, bos@574: bos@574: each: function( fn, args ) { bos@574: return jQuery.each( this, fn, args ); bos@574: }, bos@574: bos@574: index: function( obj ) { bos@574: var pos = -1; bos@574: this.each(function(i){ bos@574: if ( this == obj ) pos = i; bos@574: }); bos@574: return pos; bos@574: }, bos@574: bos@574: attr: function( key, value, type ) { bos@574: var obj = key; bos@574: bos@574: // Look for the case where we're accessing a style value bos@574: if ( key.constructor == String ) bos@574: if ( value == undefined ) bos@574: return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined; bos@574: else { bos@574: obj = {}; bos@574: obj[ key ] = value; bos@574: } bos@574: bos@574: // Check to see if we're setting style values bos@574: return this.each(function(index){ bos@574: // Set all the styles bos@574: for ( var prop in obj ) bos@574: jQuery.attr( bos@574: type ? this.style : this, bos@574: prop, jQuery.prop(this, obj[prop], type, index, prop) bos@574: ); bos@574: }); bos@574: }, bos@574: bos@574: css: function( key, value ) { bos@574: return this.attr( key, value, "curCSS" ); bos@574: }, bos@574: bos@574: text: function(e) { bos@574: if ( typeof e != "object" && e != null ) bos@574: return this.empty().append( document.createTextNode( e ) ); bos@574: bos@574: var t = ""; bos@574: jQuery.each( e || this, function(){ bos@574: jQuery.each( this.childNodes, function(){ bos@574: if ( this.nodeType != 8 ) bos@574: t += this.nodeType != 1 ? bos@574: this.nodeValue : jQuery.fn.text([ this ]); bos@574: }); bos@574: }); bos@574: return t; bos@574: }, bos@574: bos@574: wrapAll: function(html) { bos@574: if ( this[0] ) bos@574: // The elements to wrap the target around bos@574: jQuery(html, this[0].ownerDocument) bos@574: .clone() bos@574: .insertBefore(this[0]) bos@574: .map(function(){ bos@574: var elem = this; bos@574: while ( elem.firstChild ) bos@574: elem = elem.firstChild; bos@574: return elem; bos@574: }) bos@574: .append(this); bos@574: bos@574: return this; bos@574: }, bos@574: bos@574: wrapInner: function(html) { bos@574: return this.each(function(){ bos@574: jQuery(this).contents().wrapAll(html); bos@574: }); bos@574: }, bos@574: bos@574: wrap: function(html) { bos@574: return this.each(function(){ bos@574: jQuery(this).wrapAll(html); bos@574: }); bos@574: }, bos@574: bos@574: append: function() { bos@574: return this.domManip(arguments, true, 1, function(a){ bos@574: this.appendChild( a ); bos@574: }); bos@574: }, bos@574: bos@574: prepend: function() { bos@574: return this.domManip(arguments, true, -1, function(a){ bos@574: this.insertBefore( a, this.firstChild ); bos@574: }); bos@574: }, bos@574: bos@574: before: function() { bos@574: return this.domManip(arguments, false, 1, function(a){ bos@574: this.parentNode.insertBefore( a, this ); bos@574: }); bos@574: }, bos@574: bos@574: after: function() { bos@574: return this.domManip(arguments, false, -1, function(a){ bos@574: this.parentNode.insertBefore( a, this.nextSibling ); bos@574: }); bos@574: }, bos@574: bos@574: end: function() { bos@574: return this.prevObject || jQuery([]); bos@574: }, bos@574: bos@574: find: function(t) { bos@574: var data = jQuery.map(this, function(a){ return jQuery.find(t,a); }); bos@574: return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ? bos@574: jQuery.unique( data ) : data ); bos@574: }, bos@574: bos@574: clone: function(events) { bos@574: // Do the clone bos@574: var ret = this.map(function(){ bos@574: return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true); bos@574: }); bos@574: bos@574: // Need to set the expando to null on the cloned set if it exists bos@574: // removeData doesn't work here, IE removes it from the original as well bos@574: // this is primarily for IE but the data expando shouldn't be copied over in any browser bos@574: var clone = ret.find("*").andSelf().each(function(){ bos@574: if ( this[ expando ] != undefined ) bos@574: this[ expando ] = null; bos@574: }); bos@574: bos@574: // Copy the events from the original to the clone bos@574: if (events === true) bos@574: this.find("*").andSelf().each(function(i) { bos@574: var events = jQuery.data(this, "events"); bos@574: for ( var type in events ) bos@574: for ( var handler in events[type] ) bos@574: jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data); bos@574: }); bos@574: bos@574: // Return the cloned set bos@574: return ret; bos@574: }, bos@574: bos@574: filter: function(t) { bos@574: return this.pushStack( bos@574: jQuery.isFunction( t ) && bos@574: jQuery.grep(this, function(el, index){ bos@574: return t.apply(el, [index]); bos@574: }) || bos@574: bos@574: jQuery.multiFilter(t,this) ); bos@574: }, bos@574: bos@574: not: function(t) { bos@574: return this.pushStack( bos@574: t.constructor == String && bos@574: jQuery.multiFilter(t, this, true) || bos@574: bos@574: jQuery.grep(this, function(a) { bos@574: return ( t.constructor == Array || t.jquery ) bos@574: ? jQuery.inArray( a, t ) < 0 bos@574: : a != t; bos@574: }) bos@574: ); bos@574: }, bos@574: bos@574: add: function(t) { bos@574: return this.pushStack( jQuery.merge( bos@574: this.get(), bos@574: t.constructor == String ? bos@574: jQuery(t).get() : bos@574: t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ? bos@574: t : [t] ) bos@574: ); bos@574: }, bos@574: bos@574: is: function(expr) { bos@574: return expr ? jQuery.multiFilter(expr,this).length > 0 : false; bos@574: }, bos@574: bos@574: hasClass: function(expr) { bos@574: return this.is("." + expr); bos@574: }, bos@574: bos@574: val: function( val ) { bos@574: if ( val == undefined ) { bos@574: if ( this.length ) { bos@574: var elem = this[0]; bos@574: bos@574: // We need to handle select boxes special bos@574: if ( jQuery.nodeName(elem, "select") ) { bos@574: var index = elem.selectedIndex, bos@574: a = [], bos@574: options = elem.options, bos@574: one = elem.type == "select-one"; bos@574: bos@574: // Nothing was selected bos@574: if ( index < 0 ) bos@574: return null; bos@574: bos@574: // Loop through all the selected options bos@574: for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { bos@574: var option = options[i]; bos@574: if ( option.selected ) { bos@574: // Get the specifc value for the option bos@574: var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value; bos@574: bos@574: // We don't need an array for one selects bos@574: if ( one ) bos@574: return val; bos@574: bos@574: // Multi-Selects return an array bos@574: a.push(val); bos@574: } bos@574: } bos@574: bos@574: return a; bos@574: bos@574: // Everything else, we just grab the value bos@574: } else bos@574: return this[0].value.replace(/\r/g, ""); bos@574: } bos@574: } else bos@574: return this.each(function(){ bos@574: if ( val.constructor == Array && /radio|checkbox/.test(this.type) ) bos@574: this.checked = (jQuery.inArray(this.value, val) >= 0 || bos@574: jQuery.inArray(this.name, val) >= 0); bos@574: else if ( jQuery.nodeName(this, "select") ) { bos@574: var tmp = val.constructor == Array ? val : [val]; bos@574: bos@574: jQuery("option", this).each(function(){ bos@574: this.selected = (jQuery.inArray(this.value, tmp) >= 0 || bos@574: jQuery.inArray(this.text, tmp) >= 0); bos@574: }); bos@574: bos@574: if ( !tmp.length ) bos@574: this.selectedIndex = -1; bos@574: } else bos@574: this.value = val; bos@574: }); bos@574: }, bos@574: bos@574: html: function( val ) { bos@574: return val == undefined ? bos@574: ( this.length ? this[0].innerHTML : null ) : bos@574: this.empty().append( val ); bos@574: }, bos@574: bos@574: replaceWith: function( val ) { bos@574: return this.after( val ).remove(); bos@574: }, bos@574: bos@574: eq: function(i){ bos@574: return this.slice(i, i+1); bos@574: }, bos@574: bos@574: slice: function() { bos@574: return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); bos@574: }, bos@574: bos@574: map: function(fn) { bos@574: return this.pushStack(jQuery.map( this, function(elem,i){ bos@574: return fn.call( elem, i, elem ); bos@574: })); bos@574: }, bos@574: bos@574: andSelf: function() { bos@574: return this.add( this.prevObject ); bos@574: }, bos@574: bos@574: domManip: function(args, table, dir, fn) { bos@574: var clone = this.length > 1, a; bos@574: bos@574: return this.each(function(){ bos@574: if ( !a ) { bos@574: a = jQuery.clean(args, this.ownerDocument); bos@574: if ( dir < 0 ) bos@574: a.reverse(); bos@574: } bos@574: bos@574: var obj = this; bos@574: bos@574: if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") ) bos@574: obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody")); bos@574: bos@574: jQuery.each( a, function(){ bos@574: var elem = clone ? this.cloneNode(true) : this; bos@574: if ( !evalScript(0, elem) ) bos@574: fn.call( obj, elem ); bos@574: }); bos@574: }); bos@574: } bos@574: }; bos@574: bos@574: function evalScript(i, elem){ bos@574: var script = jQuery.nodeName(elem, "script"); bos@574: bos@574: if ( script ) { bos@574: if ( elem.src ) bos@574: jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); bos@574: else bos@574: jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); bos@574: bos@574: if ( elem.parentNode ) bos@574: elem.parentNode.removeChild(elem); bos@574: bos@574: } else if ( elem.nodeType == 1 ) bos@574: jQuery("script", elem).each(evalScript); bos@574: bos@574: return script; bos@574: } bos@574: bos@574: jQuery.extend = jQuery.fn.extend = function() { bos@574: // copy reference to target object bos@574: var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false; bos@574: bos@574: // Handle a deep copy situation bos@574: if ( target.constructor == Boolean ) { bos@574: deep = target; bos@574: target = arguments[1] || {}; bos@574: } bos@574: bos@574: // extend jQuery itself if only one argument is passed bos@574: if ( al == 1 ) { bos@574: target = this; bos@574: a = 0; bos@574: } bos@574: bos@574: var prop; bos@574: bos@574: for ( ; a < al; a++ ) bos@574: // Only deal with non-null/undefined values bos@574: if ( (prop = arguments[a]) != null ) bos@574: // Extend the base object bos@574: for ( var i in prop ) { bos@574: // Prevent never-ending loop bos@574: if ( target == prop[i] ) bos@574: continue; bos@574: bos@574: // Recurse if we're merging object values bos@574: if ( deep && typeof prop[i] == 'object' && target[i] ) bos@574: jQuery.extend( target[i], prop[i] ); bos@574: bos@574: // Don't bring in undefined values bos@574: else if ( prop[i] != undefined ) bos@574: target[i] = prop[i]; bos@574: } bos@574: bos@574: // Return the modified object bos@574: return target; bos@574: }; bos@574: bos@574: var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {}; bos@574: bos@574: jQuery.extend({ bos@574: noConflict: function(deep) { bos@574: window.$ = _$; bos@574: if ( deep ) bos@574: window.jQuery = _jQuery; bos@574: return jQuery; bos@574: }, bos@574: bos@574: // This may seem like some crazy code, but trust me when I say that this bos@574: // is the only cross-browser way to do this. --John bos@574: isFunction: function( fn ) { bos@574: return !!fn && typeof fn != "string" && !fn.nodeName && bos@574: fn.constructor != Array && /function/i.test( fn + "" ); bos@574: }, bos@574: bos@574: // check if an element is in a XML document bos@574: isXMLDoc: function(elem) { bos@574: return elem.documentElement && !elem.body || bos@574: elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; bos@574: }, bos@574: bos@574: // Evalulates a script in a global context bos@574: // Evaluates Async. in Safari 2 :-( bos@574: globalEval: function( data ) { bos@574: data = jQuery.trim( data ); bos@574: if ( data ) { bos@574: if ( window.execScript ) bos@574: window.execScript( data ); bos@574: else if ( jQuery.browser.safari ) bos@574: // safari doesn't provide a synchronous global eval bos@574: window.setTimeout( data, 0 ); bos@574: else bos@574: eval.call( window, data ); bos@574: } bos@574: }, bos@574: bos@574: nodeName: function( elem, name ) { bos@574: return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); bos@574: }, bos@574: bos@574: cache: {}, bos@574: bos@574: data: function( elem, name, data ) { bos@574: elem = elem == window ? win : elem; bos@574: bos@574: var id = elem[ expando ]; bos@574: bos@574: // Compute a unique ID for the element bos@574: if ( !id ) bos@574: id = elem[ expando ] = ++uuid; bos@574: bos@574: // Only generate the data cache if we're bos@574: // trying to access or manipulate it bos@574: if ( name && !jQuery.cache[ id ] ) bos@574: jQuery.cache[ id ] = {}; bos@574: bos@574: // Prevent overriding the named cache with undefined values bos@574: if ( data != undefined ) bos@574: jQuery.cache[ id ][ name ] = data; bos@574: bos@574: // Return the named cache data, or the ID for the element bos@574: return name ? jQuery.cache[ id ][ name ] : id; bos@574: }, bos@574: bos@574: removeData: function( elem, name ) { bos@574: elem = elem == window ? win : elem; bos@574: bos@574: var id = elem[ expando ]; bos@574: bos@574: // If we want to remove a specific section of the element's data bos@574: if ( name ) { bos@574: if ( jQuery.cache[ id ] ) { bos@574: // Remove the section of cache data bos@574: delete jQuery.cache[ id ][ name ]; bos@574: bos@574: // If we've removed all the data, remove the element's cache bos@574: name = ""; bos@574: for ( name in jQuery.cache[ id ] ) break; bos@574: if ( !name ) bos@574: jQuery.removeData( elem ); bos@574: } bos@574: bos@574: // Otherwise, we want to remove all of the element's data bos@574: } else { bos@574: // Clean up the element expando bos@574: try { bos@574: delete elem[ expando ]; bos@574: } catch(e){ bos@574: // IE has trouble directly removing the expando bos@574: // but it's ok with using removeAttribute bos@574: if ( elem.removeAttribute ) bos@574: elem.removeAttribute( expando ); bos@574: } bos@574: bos@574: // Completely remove the data cache bos@574: delete jQuery.cache[ id ]; bos@574: } bos@574: }, bos@574: bos@574: // args is for internal usage only bos@574: each: function( obj, fn, args ) { bos@574: if ( args ) { bos@574: if ( obj.length == undefined ) bos@574: for ( var i in obj ) bos@574: fn.apply( obj[i], args ); bos@574: else bos@574: for ( var i = 0, ol = obj.length; i < ol; i++ ) bos@574: if ( fn.apply( obj[i], args ) === false ) break; bos@574: bos@574: // A special, fast, case for the most common use of each bos@574: } else { bos@574: if ( obj.length == undefined ) bos@574: for ( var i in obj ) bos@574: fn.call( obj[i], i, obj[i] ); bos@574: else bos@574: for ( var i = 0, ol = obj.length, val = obj[0]; bos@574: i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){} bos@574: } bos@574: bos@574: return obj; bos@574: }, bos@574: bos@574: prop: function(elem, value, type, index, prop){ bos@574: // Handle executable functions bos@574: if ( jQuery.isFunction( value ) ) bos@574: value = value.call( elem, [index] ); bos@574: bos@574: // exclude the following css properties to add px bos@574: var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; bos@574: bos@574: // Handle passing in a number to a CSS property bos@574: return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ? bos@574: value + "px" : bos@574: value; bos@574: }, bos@574: bos@574: className: { bos@574: // internal only, use addClass("class") bos@574: add: function( elem, c ){ bos@574: jQuery.each( (c || "").split(/\s+/), function(i, cur){ bos@574: if ( !jQuery.className.has( elem.className, cur ) ) bos@574: elem.className += ( elem.className ? " " : "" ) + cur; bos@574: }); bos@574: }, bos@574: bos@574: // internal only, use removeClass("class") bos@574: remove: function( elem, c ){ bos@574: elem.className = c != undefined ? bos@574: jQuery.grep( elem.className.split(/\s+/), function(cur){ bos@574: return !jQuery.className.has( c, cur ); bos@574: }).join(" ") : ""; bos@574: }, bos@574: bos@574: // internal only, use is(".class") bos@574: has: function( t, c ) { bos@574: return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1; bos@574: } bos@574: }, bos@574: bos@574: swap: function(e,o,f) { bos@574: for ( var i in o ) { bos@574: e.style["old"+i] = e.style[i]; bos@574: e.style[i] = o[i]; bos@574: } bos@574: f.apply( e, [] ); bos@574: for ( var i in o ) bos@574: e.style[i] = e.style["old"+i]; bos@574: }, bos@574: bos@574: css: function(e,p) { bos@574: if ( p == "height" || p == "width" ) { bos@574: var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"]; bos@574: bos@574: jQuery.each( d, function(){ bos@574: old["padding" + this] = 0; bos@574: old["border" + this + "Width"] = 0; bos@574: }); bos@574: bos@574: jQuery.swap( e, old, function() { bos@574: if ( jQuery(e).is(':visible') ) { bos@574: oHeight = e.offsetHeight; bos@574: oWidth = e.offsetWidth; bos@574: } else { bos@574: e = jQuery(e.cloneNode(true)) bos@574: .find(":radio").removeAttr("checked").end() bos@574: .css({ bos@574: visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0" bos@574: }).appendTo(e.parentNode)[0]; bos@574: bos@574: var parPos = jQuery.css(e.parentNode,"position") || "static"; bos@574: if ( parPos == "static" ) bos@574: e.parentNode.style.position = "relative"; bos@574: bos@574: oHeight = e.clientHeight; bos@574: oWidth = e.clientWidth; bos@574: bos@574: if ( parPos == "static" ) bos@574: e.parentNode.style.position = "static"; bos@574: bos@574: e.parentNode.removeChild(e); bos@574: } bos@574: }); bos@574: bos@574: return p == "height" ? oHeight : oWidth; bos@574: } bos@574: bos@574: return jQuery.curCSS( e, p ); bos@574: }, bos@574: bos@574: curCSS: function(elem, prop, force) { bos@574: var ret, stack = [], swap = []; bos@574: bos@574: // A helper method for determining if an element's values are broken bos@574: function color(a){ bos@574: if ( !jQuery.browser.safari ) bos@574: return false; bos@574: bos@574: var ret = document.defaultView.getComputedStyle(a,null); bos@574: return !ret || ret.getPropertyValue("color") == ""; bos@574: } bos@574: bos@574: if (prop == "opacity" && jQuery.browser.msie) { bos@574: ret = jQuery.attr(elem.style, "opacity"); bos@574: return ret == "" ? "1" : ret; bos@574: } bos@574: bos@574: if (prop.match(/float/i)) bos@574: prop = styleFloat; bos@574: bos@574: if (!force && elem.style[prop]) bos@574: ret = elem.style[prop]; bos@574: bos@574: else if (document.defaultView && document.defaultView.getComputedStyle) { bos@574: bos@574: if (prop.match(/float/i)) bos@574: prop = "float"; bos@574: bos@574: prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase(); bos@574: var cur = document.defaultView.getComputedStyle(elem, null); bos@574: bos@574: if ( cur && !color(elem) ) bos@574: ret = cur.getPropertyValue(prop); bos@574: bos@574: // If the element isn't reporting its values properly in Safari bos@574: // then some display: none elements are involved bos@574: else { bos@574: // Locate all of the parent display: none elements bos@574: for ( var a = elem; a && color(a); a = a.parentNode ) bos@574: stack.unshift(a); bos@574: bos@574: // Go through and make them visible, but in reverse bos@574: // (It would be better if we knew the exact display type that they had) bos@574: for ( a = 0; a < stack.length; a++ ) bos@574: if ( color(stack[a]) ) { bos@574: swap[a] = stack[a].style.display; bos@574: stack[a].style.display = "block"; bos@574: } bos@574: bos@574: // Since we flip the display style, we have to handle that bos@574: // one special, otherwise get the value bos@574: ret = prop == "display" && swap[stack.length-1] != null ? bos@574: "none" : bos@574: document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || ""; bos@574: bos@574: // Finally, revert the display styles back bos@574: for ( a = 0; a < swap.length; a++ ) bos@574: if ( swap[a] != null ) bos@574: stack[a].style.display = swap[a]; bos@574: } bos@574: bos@574: if ( prop == "opacity" && ret == "" ) bos@574: ret = "1"; bos@574: bos@574: } else if (elem.currentStyle) { bos@574: var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();}); bos@574: ret = elem.currentStyle[prop] || elem.currentStyle[newProp]; bos@574: bos@574: // From the awesome hack by Dean Edwards bos@574: // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 bos@574: bos@574: // If we're not dealing with a regular pixel number bos@574: // but a number that has a weird ending, we need to convert it to pixels bos@574: if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) { bos@574: var style = elem.style.left; bos@574: var runtimeStyle = elem.runtimeStyle.left; bos@574: elem.runtimeStyle.left = elem.currentStyle.left; bos@574: elem.style.left = ret || 0; bos@574: ret = elem.style.pixelLeft + "px"; bos@574: elem.style.left = style; bos@574: elem.runtimeStyle.left = runtimeStyle; bos@574: } bos@574: } bos@574: bos@574: return ret; bos@574: }, bos@574: bos@574: clean: function(a, doc) { bos@574: var r = []; bos@574: doc = doc || document; bos@574: bos@574: jQuery.each( a, function(i,arg){ bos@574: if ( !arg ) return; bos@574: bos@574: if ( arg.constructor == Number ) bos@574: arg = arg.toString(); bos@574: bos@574: // Convert html string into DOM nodes bos@574: if ( typeof arg == "string" ) { bos@574: // Fix "XHTML"-style tags in all browsers bos@574: arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){ bos@574: return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+">"; bos@574: }); bos@574: bos@574: // Trim whitespace, otherwise indexOf won't work as expected bos@574: var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = []; bos@574: bos@574: var wrap = bos@574: // option or optgroup bos@574: !s.indexOf("", ""] || bos@574: bos@574: !s.indexOf("", ""] || bos@574: bos@574: s.match(/^<(thead|tbody|tfoot|colg|cap)/) && bos@574: [1, "", "
"] || bos@574: bos@574: !s.indexOf("", ""] || bos@574: bos@574: // matched above bos@574: (!s.indexOf("", ""] || bos@574: bos@574: !s.indexOf("", ""] || bos@574: bos@574: // IE can't serialize and