+/*!\r
+ * Sizzle CSS Selector Engine\r
+ * Copyright 2012 jQuery Foundation and other contributors\r
+ * Released under the MIT license\r
+ * http://sizzlejs.com/\r
+ */\r
+(function( window, undefined ) {\r
+\r
+var cachedruns,\r
+ dirruns,\r
+ sortOrder,\r
+ siblingCheck,\r
+ assertGetIdNotName,\r
+\r
+ document = window.document,\r
+ docElem = document.documentElement,\r
+\r
+ strundefined = "undefined",\r
+ hasDuplicate = false,\r
+ baseHasDuplicate = true,\r
+ done = 0,\r
+ slice = [].slice,\r
+ push = [].push,\r
+\r
+ expando = ( "sizcache" + Math.random() ).replace( ".", "" ),\r
+\r
+ // Regex\r
+\r
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\r
+ whitespace = "[\\x20\\t\\r\\n\\f]",\r
+ // http://www.w3.org/TR/css3-syntax/#characters\r
+ characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",\r
+\r
+ // Loosely modeled on CSS identifier characters\r
+ // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)\r
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\r
+ identifier = characterEncoding.replace( "w", "w#" ),\r
+\r
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\r
+ operators = "([*^$|!~]?=)",\r
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +\r
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",\r
+ pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",\r
+ pos = ":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",\r
+ combinators = whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*",\r
+ groups = "(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|" + attributes + "|" + pseudos.replace( 2, 7 ) + "|[^\\\\(),])+",\r
+\r
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\r
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),\r
+\r
+ rcombinators = new RegExp( "^" + combinators ),\r
+\r
+ // All simple (non-comma) selectors, excluding insignifant trailing whitespace\r
+ rgroups = new RegExp( groups + "?(?=" + whitespace + "*,|$)", "g" ),\r
+\r
+ // A selector, or everything after leading whitespace\r
+ // Optionally followed in either case by a ")" for terminating sub-selectors\r
+ rselector = new RegExp( "^(?:(?!,)(?:(?:^|,)" + whitespace + "*" + groups + ")*?|" + whitespace + "*(.*?))(\\)|$)" ),\r
+\r
+ // All combinators and selector components (attribute test, tag, pseudo, etc.), the latter appearing together when consecutive\r
+ rtokens = new RegExp( groups.slice( 19, -6 ) + "\\x20\\t\\r\\n\\f>+~])+|" + combinators, "g" ),\r
+\r
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors\r
+ rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,\r
+\r
+ rsibling = /[\x20\t\r\n\f]*[+~]/,\r
+ rendsWithNot = /:not\($/,\r
+\r
+ rheader = /h\d/i,\r
+ rinputs = /input|select|textarea|button/i,\r
+\r
+ rbackslash = /\\(?!\\)/g,\r
+\r
+ matchExpr = {\r
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),\r
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),\r
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),\r
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "[-", "[-\\*" ) + ")" ),\r
+ "ATTR": new RegExp( "^" + attributes ),\r
+ "PSEUDO": new RegExp( "^" + pseudos ),\r
+ "CHILD": new RegExp( "^:(only|nth|last|first)-child(?:\\(" + whitespace +\r
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +\r
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),\r
+ "POS": new RegExp( pos, "ig" ),\r
+ // For use in libraries implementing .is()\r
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )\r
+ },\r
+\r
+ classCache = {},\r
+ cachedClasses = [],\r
+ compilerCache = {},\r
+ cachedSelectors = [],\r
+\r
+ // Mark a function for use in filtering\r
+ markFunction = function( fn ) {\r
+ fn.sizzleFilter = true;\r
+ return fn;\r
+ },\r
+\r
+ // Returns a function to use in pseudos for input types\r
+ createInputFunction = function( type ) {\r
+ return function( elem ) {\r
+ // Check the input's nodeName and type\r
+ return elem.nodeName.toLowerCase() === "input" && elem.type === type;\r
+ };\r
+ },\r
+\r
+ // Returns a function to use in pseudos for buttons\r
+ createButtonFunction = function( type ) {\r
+ return function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return (name === "input" || name === "button") && elem.type === type;\r
+ };\r
+ },\r
+\r
+ // Used for testing something on an element\r
+ assert = function( fn ) {\r
+ var pass = false,\r
+ div = document.createElement("div");\r
+ try {\r
+ pass = fn( div );\r
+ } catch (e) {}\r
+ // release memory in IE\r
+ div = null;\r
+ return pass;\r
+ },\r
+\r
+ // Check if attributes should be retrieved by attribute nodes\r
+ assertAttributes = assert(function( div ) {\r
+ div.innerHTML = "<select></select>";\r
+ var type = typeof div.lastChild.getAttribute("multiple");\r
+ // IE8 returns a string for some attributes even when not present\r
+ return type !== "boolean" && type !== "string";\r
+ }),\r
+\r
+ // Check if getElementById returns elements by name\r
+ // Check if getElementsByName privileges form controls or returns elements by ID\r
+ assertUsableName = assert(function( div ) {\r
+ // Inject content\r
+ div.id = expando + 0;\r
+ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";\r
+ docElem.insertBefore( div, docElem.firstChild );\r
+\r
+ // Test\r
+ var pass = document.getElementsByName &&\r
+ // buggy browsers will return fewer than the correct 2\r
+ document.getElementsByName( expando ).length ===\r
+ // buggy browsers will return more than the correct 0\r
+ 2 + document.getElementsByName( expando + 0 ).length;\r
+ assertGetIdNotName = !document.getElementById( expando );\r
+\r
+ // Cleanup\r
+ docElem.removeChild( div );\r
+\r
+ return pass;\r
+ }),\r
+\r
+ // Check if the browser returns only elements\r
+ // when doing getElementsByTagName("*")\r
+ assertTagNameNoComments = assert(function( div ) {\r
+ div.appendChild( document.createComment("") );\r
+ return div.getElementsByTagName("*").length === 0;\r
+ }),\r
+\r
+ // Check if getAttribute returns normalized href attributes\r
+ assertHrefNotNormalized = assert(function( div ) {\r
+ div.innerHTML = "<a href='#'></a>";\r
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&\r
+ div.firstChild.getAttribute("href") === "#";\r
+ }),\r
+\r
+ // Check if getElementsByClassName can be trusted\r
+ assertUsableClassName = assert(function( div ) {\r
+ // Opera can't find a second classname (in 9.6)\r
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";\r
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {\r
+ return false;\r
+ }\r
+\r
+ // Safari caches class attributes, doesn't catch changes (in 3.2)\r
+ div.lastChild.className = "e";\r
+ return div.getElementsByClassName("e").length !== 1;\r
+ });\r
+\r
+var Sizzle = function( selector, context, results, seed ) {\r
+ results = results || [];\r
+ context = context || document;\r
+ var match, elem, xml, m,\r
+ nodeType = context.nodeType;\r
+\r
+ if ( nodeType !== 1 && nodeType !== 9 ) {\r
+ return [];\r
+ }\r
+\r
+ if ( !selector || typeof selector !== "string" ) {\r
+ return results;\r
+ }\r
+\r
+ xml = isXML( context );\r
+\r
+ if ( !xml && !seed ) {\r
+ if ( (match = rquickExpr.exec( selector )) ) {\r
+ // Speed-up: Sizzle("#ID")\r
+ if ( (m = match[1]) ) {\r
+ if ( nodeType === 9 ) {\r
+ elem = context.getElementById( m );\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ if ( elem && elem.parentNode ) {\r
+ // Handle the case where IE, Opera, and Webkit return items\r
+ // by name instead of ID\r
+ if ( elem.id === m ) {\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ } else {\r
+ return results;\r
+ }\r
+ } else {\r
+ // Context is not a document\r
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\r
+ contains( context, elem ) && elem.id === m ) {\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ }\r
+\r
+ // Speed-up: Sizzle("TAG")\r
+ } else if ( match[2] ) {\r
+ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );\r
+ return results;\r
+\r
+ // Speed-up: Sizzle(".CLASS")\r
+ } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {\r
+ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );\r
+ return results;\r
+ }\r
+ }\r
+ }\r
+\r
+ // All others\r
+ return select( selector, context, results, seed, xml );\r
+};\r
+\r
+var Expr = Sizzle.selectors = {\r
+\r
+ // Can be adjusted by the user\r
+ cacheLength: 50,\r
+\r
+ match: matchExpr,\r
+\r
+ order: [ "ID", "TAG" ],\r
+\r
+ attrHandle: {},\r
+\r
+ createPseudo: markFunction,\r
+\r
+ find: {\r
+ "ID": assertGetIdNotName ?\r
+ function( id, context, xml ) {\r
+ if ( typeof context.getElementById !== strundefined && !xml ) {\r
+ var m = context.getElementById( id );\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ return m && m.parentNode ? [m] : [];\r
+ }\r
+ } :\r
+ function( id, context, xml ) {\r
+ if ( typeof context.getElementById !== strundefined && !xml ) {\r
+ var m = context.getElementById( id );\r
+\r
+ return m ?\r
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?\r
+ [m] :\r
+ undefined :\r
+ [];\r
+ }\r
+ },\r
+\r
+ "TAG": assertTagNameNoComments ?\r
+ function( tag, context ) {\r
+ if ( typeof context.getElementsByTagName !== strundefined ) {\r
+ return context.getElementsByTagName( tag );\r
+ }\r
+ } :\r
+ function( tag, context ) {\r
+ var results = context.getElementsByTagName( tag );\r
+\r
+ // Filter out possible comments\r
+ if ( tag === "*" ) {\r
+ var elem,\r
+ tmp = [],\r
+ i = 0;\r
+\r
+ for ( ; (elem = results[i]); i++ ) {\r
+ if ( elem.nodeType === 1 ) {\r
+ tmp.push( elem );\r
+ }\r
+ }\r
+\r
+ return tmp;\r
+ }\r
+ return results;\r
+ }\r
+ },\r
+\r
+ relative: {\r
+ ">": { dir: "parentNode", first: true },\r
+ " ": { dir: "parentNode" },\r
+ "+": { dir: "previousSibling", first: true },\r
+ "~": { dir: "previousSibling" }\r
+ },\r
+\r
+ preFilter: {\r
+ "ATTR": function( match ) {\r
+ match[1] = match[1].replace( rbackslash, "" );\r
+\r
+ // Move the given value to match[3] whether quoted or unquoted\r
+ match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );\r
+\r
+ if ( match[2] === "~=" ) {\r
+ match[3] = " " + match[3] + " ";\r
+ }\r
+\r
+ return match.slice( 0, 4 );\r
+ },\r
+\r
+ "CHILD": function( match ) {\r
+ /* matches from matchExpr.CHILD\r
+ 1 type (only|nth|...)\r
+ 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)\r
+ 3 xn-component of xn+y argument ([+-]?\d*n|)\r
+ 4 sign of xn-component\r
+ 5 x of xn-component\r
+ 6 sign of y-component\r
+ 7 y of y-component\r
+ */\r
+ match[1] = match[1].toLowerCase();\r
+\r
+ if ( match[1] === "nth" ) {\r
+ // nth-child requires argument\r
+ if ( !match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
+\r
+ // numeric x and y parameters for Expr.filter.CHILD\r
+ // remember that false/true cast respectively to 0/1\r
+ match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );\r
+ match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );\r
+\r
+ // other types prohibit arguments\r
+ } else if ( match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
+\r
+ return match;\r
+ },\r
+\r
+ "PSEUDO": function( match ) {\r
+ var argument,\r
+ unquoted = match[4];\r
+\r
+ if ( matchExpr["CHILD"].test( match[0] ) ) {\r
+ return null;\r
+ }\r
+\r
+ // Relinquish our claim on characters in `unquoted` from a closing parenthesis on\r
+ if ( unquoted && (argument = rselector.exec( unquoted )) && argument.pop() ) {\r
+\r
+ match[0] = match[0].slice( 0, argument[0].length - unquoted.length - 1 );\r
+ unquoted = argument[0].slice( 0, -1 );\r
+ }\r
+\r
+ // Quoted or unquoted, we have the full argument\r
+ // Return only captures needed by the pseudo filter method (type and argument)\r
+ match.splice( 2, 3, unquoted || match[3] );\r
+ return match;\r
+ }\r
+ },\r
+\r
+ filter: {\r
+ "ID": assertGetIdNotName ?\r
+ function( id ) {\r
+ id = id.replace( rbackslash, "" );\r
+ return function( elem ) {\r
+ return elem.getAttribute("id") === id;\r
+ };\r
+ } :\r
+ function( id ) {\r
+ id = id.replace( rbackslash, "" );\r
+ return function( elem ) {\r
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");\r
+ return node && node.value === id;\r
+ };\r
+ },\r
+\r
+ "TAG": function( nodeName ) {\r
+ if ( nodeName === "*" ) {\r
+ return function() { return true; };\r
+ }\r
+ nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();\r
+\r
+ return function( elem ) {\r
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\r
+ };\r
+ },\r
+\r
+ "CLASS": function( className ) {\r
+ var pattern = classCache[ className ];\r
+ if ( !pattern ) {\r
+ pattern = classCache[ className ] = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" );\r
+ cachedClasses.push( className );\r
+ // Avoid too large of a cache\r
+ if ( cachedClasses.length > Expr.cacheLength ) {\r
+ delete classCache[ cachedClasses.shift() ];\r
+ }\r
+ }\r
+ return function( elem ) {\r
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );\r
+ };\r
+ },\r
+\r
+ "ATTR": function( name, operator, check ) {\r
+ if ( !operator ) {\r
+ return function( elem ) {\r
+ return Sizzle.attr( elem, name ) != null;\r
+ };\r
+ }\r
+\r
+ return function( elem ) {\r
+ var result = Sizzle.attr( elem, name ),\r
+ value = result + "";\r
+\r
+ if ( result == null ) {\r
+ return operator === "!=";\r
+ }\r
+\r
+ switch ( operator ) {\r
+ case "=":\r
+ return value === check;\r
+ case "!=":\r
+ return value !== check;\r
+ case "^=":\r
+ return check && value.indexOf( check ) === 0;\r
+ case "*=":\r
+ return check && value.indexOf( check ) > -1;\r
+ case "$=":\r
+ return check && value.substr( value.length - check.length ) === check;\r
+ case "~=":\r
+ return ( " " + value + " " ).indexOf( check ) > -1;\r
+ case "|=":\r
+ return value === check || value.substr( 0, check.length + 1 ) === check + "-";\r
+ }\r
+ };\r
+ },\r
+\r
+ "CHILD": function( type, argument, first, last ) {\r
+\r
+ if ( type === "nth" ) {\r
+ var doneName = done++;\r
+\r
+ return function( elem ) {\r
+ var parent, diff,\r
+ count = 0,\r
+ node = elem;\r
+\r
+ if ( first === 1 && last === 0 ) {\r
+ return true;\r
+ }\r
+\r
+ parent = elem.parentNode;\r
+\r
+ if ( parent && (parent[ expando ] !== doneName || !elem.sizset) ) {\r
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
+ if ( node.nodeType === 1 ) {\r
+ node.sizset = ++count;\r
+ if ( node === elem ) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ parent[ expando ] = doneName;\r
+ }\r
+\r
+ diff = elem.sizset - last;\r
+\r
+ if ( first === 0 ) {\r
+ return diff === 0;\r
+\r
+ } else {\r
+ return ( diff % first === 0 && diff / first >= 0 );\r
+ }\r
+ };\r
+ }\r
+\r
+ return function( elem ) {\r
+ var node = elem;\r
+\r
+ switch ( type ) {\r
+ case "only":\r
+ case "first":\r
+ while ( (node = node.previousSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ if ( type === "first" ) {\r
+ return true;\r
+ }\r
+\r
+ node = elem;\r
+\r
+ /* falls through */\r
+ case "last":\r
+ while ( (node = node.nextSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return true;\r
+ }\r
+ };\r
+ },\r
+\r
+ "PSEUDO": function( pseudo, argument, context, xml ) {\r
+ // pseudo-class names are case-insensitive\r
+ // http://www.w3.org/TR/selectors/#pseudo-classes\r
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\r
+ var fn = Expr.pseudos[ pseudo ] || Expr.pseudos[ pseudo.toLowerCase() ];\r
+\r
+ if ( !fn ) {\r
+ Sizzle.error( "unsupported pseudo: " + pseudo );\r
+ }\r
+\r
+ // The user may set fn.sizzleFilter to indicate\r
+ // that arguments are needed to create the filter function\r
+ // just as Sizzle does\r
+ if ( !fn.sizzleFilter ) {\r
+ return fn;\r
+ }\r
+\r
+ return fn( argument, context, xml );\r
+ }\r
+ },\r
+\r
+ pseudos: {\r
+ "not": markFunction(function( selector, context, xml ) {\r
+ // Trim the selector passed to compile\r
+ // to avoid treating leading and trailing\r
+ // spaces as combinators\r
+ var matcher = compile( selector.replace( rtrim, "$1" ), context, xml );\r
+ return function( elem ) {\r
+ return !matcher( elem );\r
+ };\r
+ }),\r
+\r
+ "enabled": function( elem ) {\r
+ return elem.disabled === false;\r
+ },\r
+\r
+ "disabled": function( elem ) {\r
+ return elem.disabled === true;\r
+ },\r
+\r
+ "checked": function( elem ) {\r
+ // In CSS3, :checked should return both checked and selected elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ var nodeName = elem.nodeName.toLowerCase();\r
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);\r
+ },\r
+\r
+ "selected": function( elem ) {\r
+ // Accessing this property makes selected-by-default\r
+ // options in Safari work properly\r
+ if ( elem.parentNode ) {\r
+ elem.parentNode.selectedIndex;\r
+ }\r
+\r
+ return elem.selected === true;\r
+ },\r
+\r
+ "parent": function( elem ) {\r
+ return !Expr.pseudos["empty"]( elem );\r
+ },\r
+\r
+ "empty": function( elem ) {\r
+ // http://www.w3.org/TR/selectors/#empty-pseudo\r
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\r
+ // not comment, processing instructions, or others\r
+ // Thanks to Diego Perini for the nodeName shortcut\r
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")\r
+ var nodeType;\r
+ elem = elem.firstChild;\r
+ while ( elem ) {\r
+ if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {\r
+ return false;\r
+ }\r
+ elem = elem.nextSibling;\r
+ }\r
+ return true;\r
+ },\r
+\r
+ "contains": markFunction(function( text ) {\r
+ return function( elem ) {\r
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\r
+ };\r
+ }),\r
+\r
+ "has": markFunction(function( selector ) {\r
+ return function( elem ) {\r
+ return Sizzle( selector, elem ).length > 0;\r
+ };\r
+ }),\r
+\r
+ "header": function( elem ) {\r
+ return rheader.test( elem.nodeName );\r
+ },\r
+\r
+ "text": function( elem ) {\r
+ var type, attr;\r
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\r
+ // use getAttribute instead to test this case\r
+ return elem.nodeName.toLowerCase() === "input" &&\r
+ (type = elem.type) === "text" &&\r
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );\r
+ },\r
+\r
+ // Input types\r
+ "radio": createInputFunction("radio"),\r
+ "checkbox": createInputFunction("checkbox"),\r
+ "file": createInputFunction("file"),\r
+ "password": createInputFunction("password"),\r
+ "image": createInputFunction("image"),\r
+\r
+ "submit": createButtonFunction("submit"),\r
+ "reset": createButtonFunction("reset"),\r
+\r
+ "button": function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && elem.type === "button" || name === "button";\r
+ },\r
+\r
+ "input": function( elem ) {\r
+ return rinputs.test( elem.nodeName );\r
+ },\r
+\r
+ "focus": function( elem ) {\r
+ var doc = elem.ownerDocument;\r
+ return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);\r
+ },\r
+\r
+ "active": function( elem ) {\r
+ return elem === elem.ownerDocument.activeElement;\r
+ }\r
+ },\r
+\r
+ setFilters: {\r
+ "first": function( elements, argument, not ) {\r
+ return not ? elements.slice( 1 ) : [ elements[0] ];\r
+ },\r
+\r
+ "last": function( elements, argument, not ) {\r
+ var elem = elements.pop();\r
+ return not ? elements : [ elem ];\r
+ },\r
+\r
+ "even": function( elements, argument, not ) {\r
+ var results = [],\r
+ i = not ? 1 : 0,\r
+ len = elements.length;\r
+ for ( ; i < len; i = i + 2 ) {\r
+ results.push( elements[i] );\r
+ }\r
+ return results;\r
+ },\r
+\r
+ "odd": function( elements, argument, not ) {\r
+ var results = [],\r
+ i = not ? 0 : 1,\r
+ len = elements.length;\r
+ for ( ; i < len; i = i + 2 ) {\r
+ results.push( elements[i] );\r
+ }\r
+ return results;\r
+ },\r
+\r
+ "lt": function( elements, argument, not ) {\r
+ return not ? elements.slice( +argument ) : elements.slice( 0, +argument );\r
+ },\r
+\r
+ "gt": function( elements, argument, not ) {\r
+ return not ? elements.slice( 0, +argument + 1 ) : elements.slice( +argument + 1 );\r
+ },\r
+\r
+ "eq": function( elements, argument, not ) {\r
+ var elem = elements.splice( +argument, 1 );\r
+ return not ? elements : elem;\r
+ }\r
+ }\r
+};\r
+\r
+// Deprecated\r
+Expr.setFilters["nth"] = Expr.setFilters["eq"];\r
+\r
+// Back-compat\r
+Expr.filters = Expr.pseudos;\r
+\r
+// IE6/7 return a modified href\r
+if ( !assertHrefNotNormalized ) {\r
+ Expr.attrHandle = {\r
+ "href": function( elem ) {\r
+ return elem.getAttribute( "href", 2 );\r
+ },\r
+ "type": function( elem ) {\r
+ return elem.getAttribute("type");\r
+ }\r
+ };\r
+}\r
+\r
+// Add getElementsByName if usable\r
+if ( assertUsableName ) {\r
+ Expr.order.push("NAME");\r
+ Expr.find["NAME"] = function( name, context ) {\r
+ if ( typeof context.getElementsByName !== strundefined ) {\r
+ return context.getElementsByName( name );\r
+ }\r
+ };\r
+}\r
+\r
+// Add getElementsByClassName if usable\r
+if ( assertUsableClassName ) {\r
+ Expr.order.splice( 1, 0, "CLASS" );\r
+ Expr.find["CLASS"] = function( className, context, xml ) {\r
+ if ( typeof context.getElementsByClassName !== strundefined && !xml ) {\r
+ return context.getElementsByClassName( className );\r
+ }\r
+ };\r
+}\r
+\r
+// If slice is not available, provide a backup\r
+try {\r
+ slice.call( docElem.childNodes, 0 )[0].nodeType;\r
+} catch ( e ) {\r
+ slice = function( i ) {\r
+ var elem, results = [];\r
+ for ( ; (elem = this[i]); i++ ) {\r
+ results.push( elem );\r
+ }\r
+ return results;\r
+ };\r
+}\r
+\r
+var isXML = Sizzle.isXML = function( elem ) {\r
+ // documentElement is verified for cases where it doesn't yet exist\r
+ // (such as loading iframes in IE - #4833)\r
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;\r
+ return documentElement ? documentElement.nodeName !== "HTML" : false;\r
+};\r
+\r
+// Element contains another\r
+var contains = Sizzle.contains = docElem.compareDocumentPosition ?\r
+ function( a, b ) {\r
+ return !!( a.compareDocumentPosition( b ) & 16 );\r
+ } :\r
+ docElem.contains ?\r
+ function( a, b ) {\r
+ var adown = a.nodeType === 9 ? a.documentElement : a,\r
+ bup = b.parentNode;\r
+ return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );\r
+ } :\r
+ function( a, b ) {\r
+ while ( (b = b.parentNode) ) {\r
+ if ( b === a ) {\r
+ return true;\r
+ }\r
+ }\r
+ return false;\r
+ };\r
+\r
+/**\r
+ * Utility function for retrieving the text value of an array of DOM nodes\r
+ * @param {Array|Element} elem\r
+ */\r
+var getText = Sizzle.getText = function( elem ) {\r
+ var node,\r
+ ret = "",\r
+ i = 0,\r
+ nodeType = elem.nodeType;\r
+\r
+ if ( nodeType ) {\r
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
+ // Use textContent for elements\r
+ // innerText usage removed for consistency of new lines (see #11153)\r
+ if ( typeof elem.textContent === "string" ) {\r
+ return elem.textContent;\r
+ } else {\r
+ // Traverse its children\r
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
+ ret += getText( elem );\r
+ }\r
+ }\r
+ } else if ( nodeType === 3 || nodeType === 4 ) {\r
+ return elem.nodeValue;\r
+ }\r
+ // Do not include comment or processing instruction nodes\r
+ } else {\r
+\r
+ // If no nodeType, this is expected to be an array\r
+ for ( ; (node = elem[i]); i++ ) {\r
+ // Do not traverse comment nodes\r
+ ret += getText( node );\r
+ }\r
+ }\r
+ return ret;\r
+};\r
+\r
+Sizzle.attr = function( elem, name ) {\r
+ var attr,\r
+ xml = isXML( elem );\r
+\r
+ if ( !xml ) {\r
+ name = name.toLowerCase();\r
+ }\r
+ if ( Expr.attrHandle[ name ] ) {\r
+ return Expr.attrHandle[ name ]( elem );\r
+ }\r
+ if ( assertAttributes || xml ) {\r
+ return elem.getAttribute( name );\r
+ }\r
+ attr = elem.getAttributeNode( name );\r
+ return attr ?\r
+ typeof elem[ name ] === "boolean" ?\r
+ elem[ name ] ? name : null :\r
+ attr.specified ? attr.value : null :\r
+ null;\r
+};\r
+\r
+Sizzle.error = function( msg ) {\r
+ throw new Error( "Syntax error, unrecognized expression: " + msg );\r
+};\r
+\r
+// Check if the JavaScript engine is using some sort of\r
+// optimization where it does not always call our comparision\r
+// function. If that is the case, discard the hasDuplicate value.\r
+// Thus far that includes Google Chrome.\r
+[0, 0].sort(function() {\r
+ return (baseHasDuplicate = 0);\r
+});\r
+\r
+\r
+if ( docElem.compareDocumentPosition ) {\r
+ sortOrder = function( a, b ) {\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+ }\r
+\r
+ return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?\r
+ a.compareDocumentPosition :\r
+ a.compareDocumentPosition(b) & 4\r
+ ) ? -1 : 1;\r
+ };\r
+\r
+} else {\r
+ sortOrder = function( a, b ) {\r
+ // The nodes are identical, we can exit early\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+\r
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes\r
+ } else if ( a.sourceIndex && b.sourceIndex ) {\r
+ return a.sourceIndex - b.sourceIndex;\r
+ }\r
+\r
+ var al, bl,\r
+ ap = [],\r
+ bp = [],\r
+ aup = a.parentNode,\r
+ bup = b.parentNode,\r
+ cur = aup;\r
+\r
+ // If the nodes are siblings (or identical) we can do a quick check\r
+ if ( aup === bup ) {\r
+ return siblingCheck( a, b );\r
+\r
+ // If no parents were found then the nodes are disconnected\r
+ } else if ( !aup ) {\r
+ return -1;\r
+\r
+ } else if ( !bup ) {\r
+ return 1;\r
+ }\r
+\r
+ // Otherwise they're somewhere else in the tree so we need\r
+ // to build up a full list of the parentNodes for comparison\r
+ while ( cur ) {\r
+ ap.unshift( cur );\r
+ cur = cur.parentNode;\r
+ }\r
+\r
+ cur = bup;\r
+\r
+ while ( cur ) {\r
+ bp.unshift( cur );\r
+ cur = cur.parentNode;\r
+ }\r
+\r
+ al = ap.length;\r
+ bl = bp.length;\r
+\r
+ // Start walking down the tree looking for a discrepancy\r
+ for ( var i = 0; i < al && i < bl; i++ ) {\r
+ if ( ap[i] !== bp[i] ) {\r
+ return siblingCheck( ap[i], bp[i] );\r
+ }\r
+ }\r
+\r
+ // We ended someplace up the tree so do a sibling check\r
+ return i === al ?\r
+ siblingCheck( a, bp[i], -1 ) :\r
+ siblingCheck( ap[i], b, 1 );\r
+ };\r
+\r
+ siblingCheck = function( a, b, ret ) {\r
+ if ( a === b ) {\r
+ return ret;\r
+ }\r
+\r
+ var cur = a.nextSibling;\r
+\r
+ while ( cur ) {\r
+ if ( cur === b ) {\r
+ return -1;\r
+ }\r
+\r
+ cur = cur.nextSibling;\r
+ }\r
+\r
+ return 1;\r
+ };\r
+}\r
+\r
+// Document sorting and removing duplicates\r
+Sizzle.uniqueSort = function( results ) {\r
+ var elem,\r
+ i = 1;\r
+\r
+ if ( sortOrder ) {\r
+ hasDuplicate = baseHasDuplicate;\r
+ results.sort( sortOrder );\r
+\r
+ if ( hasDuplicate ) {\r
+ for ( ; (elem = results[i]); i++ ) {\r
+ if ( elem === results[ i - 1 ] ) {\r
+ results.splice( i--, 1 );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return results;\r
+};\r
+\r
+function multipleContexts( selector, contexts, results, seed ) {\r
+ var i = 0,\r
+ len = contexts.length;\r
+ for ( ; i < len; i++ ) {\r
+ Sizzle( selector, contexts[i], results, seed );\r
+ }\r
+}\r
+\r
+function handlePOSGroup( selector, posfilter, argument, contexts, seed, not ) {\r
+ var results,\r
+ fn = Expr.setFilters[ posfilter.toLowerCase() ];\r
+\r
+ if ( !fn ) {\r
+ Sizzle.error( posfilter );\r
+ }\r
+\r
+ if ( selector || !(results = seed) ) {\r
+ multipleContexts( selector || "*", contexts, (results = []), seed );\r
+ }\r
+\r
+ return results.length > 0 ? fn( results, argument, not ) : [];\r
+}\r
+\r
+function handlePOS( selector, context, results, seed, groups ) {\r
+ var match, not, anchor, ret, elements, currentContexts, part, lastIndex,\r
+ i = 0,\r
+ len = groups.length,\r
+ rpos = matchExpr["POS"],\r
+ // This is generated here in case matchExpr["POS"] is extended\r
+ rposgroups = new RegExp( "^" + rpos.source + "(?!" + whitespace + ")", "i" ),\r
+ // This is for making sure non-participating\r
+ // matching groups are represented cross-browser (IE6-8)\r
+ setUndefined = function() {\r
+ var i = 1,\r
+ len = arguments.length - 2;\r
+ for ( ; i < len; i++ ) {\r
+ if ( arguments[i] === undefined ) {\r
+ match[i] = undefined;\r
+ }\r
+ }\r
+ };\r
+\r
+ for ( ; i < len; i++ ) {\r
+ // Reset regex index to 0\r
+ rpos.exec("");\r
+ selector = groups[i];\r
+ ret = [];\r
+ anchor = 0;\r
+ elements = seed;\r
+ while ( (match = rpos.exec( selector )) ) {\r
+ lastIndex = rpos.lastIndex = match.index + match[0].length;\r
+ if ( lastIndex > anchor ) {\r
+ part = selector.slice( anchor, match.index );\r
+ anchor = lastIndex;\r
+ currentContexts = [ context ];\r
+\r
+ if ( rcombinators.test(part) ) {\r
+ if ( elements ) {\r
+ currentContexts = elements;\r
+ }\r
+ elements = seed;\r
+ }\r
+\r
+ if ( (not = rendsWithNot.test( part )) ) {\r
+ part = part.slice( 0, -5 ).replace( rcombinators, "$&*" );\r
+ }\r
+\r
+ if ( match.length > 1 ) {\r
+ match[0].replace( rposgroups, setUndefined );\r
+ }\r
+ elements = handlePOSGroup( part, match[1], match[2], currentContexts, elements, not );\r
+ }\r
+ }\r
+\r
+ if ( elements ) {\r
+ ret = ret.concat( elements );\r
+\r
+ if ( (part = selector.slice( anchor )) && part !== ")" ) {\r
+ if ( rcombinators.test(part) ) {\r
+ multipleContexts( part, ret, results, seed );\r
+ } else {\r
+ Sizzle( part, context, results, seed ? seed.concat(elements) : elements );\r
+ }\r
+ } else {\r
+ push.apply( results, ret );\r
+ }\r
+ } else {\r
+ Sizzle( selector, context, results, seed );\r
+ }\r
+ }\r
+\r
+ // Do not sort if this is a single filter\r
+ return len === 1 ? results : Sizzle.uniqueSort( results );\r
+}\r
+\r
+function tokenize( selector, context, xml ) {\r
+ var tokens, soFar, type,\r
+ groups = [],\r
+ i = 0,\r
+\r
+ // Catch obvious selector issues: terminal ")"; nonempty fallback match\r
+ // rselector never fails to match *something*\r
+ match = rselector.exec( selector ),\r
+ matched = !match.pop() && !match.pop(),\r
+ selectorGroups = matched && selector.match( rgroups ) || [""],\r
+\r
+ preFilters = Expr.preFilter,\r
+ filters = Expr.filter,\r
+ checkContext = !xml && context !== document;\r
+\r
+ for ( ; (soFar = selectorGroups[i]) != null && matched; i++ ) {\r
+ groups.push( tokens = [] );\r
+\r
+ // Need to make sure we're within a narrower context if necessary\r
+ // Adding a descendant combinator will generate what is needed\r
+ if ( checkContext ) {\r
+ soFar = " " + soFar;\r
+ }\r
+\r
+ while ( soFar ) {\r
+ matched = false;\r
+\r
+ // Combinators\r
+ if ( (match = rcombinators.exec( soFar )) ) {\r
+ soFar = soFar.slice( match[0].length );\r
+\r
+ // Cast descendant combinators to space\r
+ matched = tokens.push({ part: match.pop().replace( rtrim, " " ), captures: match });\r
+ }\r
+\r
+ // Filters\r
+ for ( type in filters ) {\r
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\r
+ (match = preFilters[ type ]( match, context, xml )) ) ) {\r
+\r
+ soFar = soFar.slice( match.shift().length );\r
+ matched = tokens.push({ part: type, captures: match });\r
+ }\r
+ }\r
+\r
+ if ( !matched ) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( !matched ) {\r
+ Sizzle.error( selector );\r
+ }\r
+\r
+ return groups;\r
+}\r
+\r
+function addCombinator( matcher, combinator, context ) {\r
+ var dir = combinator.dir,\r
+ doneName = done++;\r
+\r
+ if ( !matcher ) {\r
+ // If there is no matcher to check, check against the context\r
+ matcher = function( elem ) {\r
+ return elem === context;\r
+ };\r
+ }\r
+ return combinator.first ?\r
+ function( elem, context ) {\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( elem.nodeType === 1 ) {\r
+ return matcher( elem, context ) && elem;\r
+ }\r
+ }\r
+ } :\r
+ function( elem, context ) {\r
+ var cache,\r
+ dirkey = doneName + "." + dirruns,\r
+ cachedkey = dirkey + "." + cachedruns;\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( elem.nodeType === 1 ) {\r
+ if ( (cache = elem[ expando ]) === cachedkey ) {\r
+ return elem.sizset;\r
+ } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {\r
+ if ( elem.sizset ) {\r
+ return elem;\r
+ }\r
+ } else {\r
+ elem[ expando ] = cachedkey;\r
+ if ( matcher( elem, context ) ) {\r
+ elem.sizset = true;\r
+ return elem;\r
+ }\r
+ elem.sizset = false;\r
+ }\r
+ }\r
+ }\r
+ };\r
+}\r
+\r
+function addMatcher( higher, deeper ) {\r
+ return higher ?\r
+ function( elem, context ) {\r
+ var result = deeper( elem, context );\r
+ return result && higher( result === true ? elem : result, context );\r
+ } :\r
+ deeper;\r
+}\r
+\r
+// ["TAG", ">", "ID", " ", "CLASS"]\r
+function matcherFromTokens( tokens, context, xml ) {\r
+ var token, matcher,\r
+ i = 0;\r
+\r
+ for ( ; (token = tokens[i]); i++ ) {\r
+ if ( Expr.relative[ token.part ] ) {\r
+ matcher = addCombinator( matcher, Expr.relative[ token.part ], context );\r
+ } else {\r
+ token.captures.push( context, xml );\r
+ matcher = addMatcher( matcher, Expr.filter[ token.part ].apply( null, token.captures ) );\r
+ }\r
+ }\r
+\r
+ return matcher;\r
+}\r
+\r
+function matcherFromGroupMatchers( matchers ) {\r
+ return function( elem, context ) {\r
+ var matcher,\r
+ j = 0;\r
+ for ( ; (matcher = matchers[j]); j++ ) {\r
+ if ( matcher(elem, context) ) {\r
+ return true;\r
+ }\r
+ }\r
+ return false;\r
+ };\r
+}\r
+\r
+var compile = Sizzle.compile = function( selector, context, xml ) {\r
+ var tokens, group, i,\r
+ cached = compilerCache[ selector ];\r
+\r
+ // Return a cached group function if already generated (context dependent)\r
+ if ( cached && cached.context === context ) {\r
+ return cached;\r
+ }\r
+\r
+ // Generate a function of recursive functions that can be used to check each element\r
+ group = tokenize( selector, context, xml );\r
+ for ( i = 0; (tokens = group[i]); i++ ) {\r
+ group[i] = matcherFromTokens( tokens, context, xml );\r
+ }\r
+\r
+ // Cache the compiled function\r
+ cached = compilerCache[ selector ] = matcherFromGroupMatchers( group );\r
+ cached.context = context;\r
+ cached.runs = cached.dirruns = 0;\r
+ cachedSelectors.push( selector );\r
+ // Ensure only the most recent are cached\r
+ if ( cachedSelectors.length > Expr.cacheLength ) {\r
+ delete compilerCache[ cachedSelectors.shift() ];\r
+ }\r
+ return cached;\r
+};\r
+\r
+Sizzle.matches = function( expr, elements ) {\r
+ return Sizzle( expr, null, null, elements );\r
+};\r
+\r
+Sizzle.matchesSelector = function( elem, expr ) {\r
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
+};\r
+\r
+var select = function( selector, context, results, seed, xml ) {\r
+ // Remove excessive whitespace\r
+ selector = selector.replace( rtrim, "$1" );\r
+ var elements, matcher, i, len, elem, token,\r
+ type, findContext, notTokens,\r
+ match = selector.match( rgroups ),\r
+ tokens = selector.match( rtokens ),\r
+ contextNodeType = context.nodeType;\r
+\r
+ // POS handling\r
+ if ( matchExpr["POS"].test(selector) ) {\r
+ return handlePOS( selector, context, results, seed, match );\r
+ }\r
+\r
+ if ( seed ) {\r
+ elements = slice.call( seed, 0 );\r
+\r
+ // To maintain document order, only narrow the\r
+ // set if there is one group\r
+ } else if ( match && match.length === 1 ) {\r
+\r
+ // Take a shortcut and set the context if the root selector is an ID\r
+ if ( tokens.length > 1 && contextNodeType === 9 && !xml &&\r
+ (match = matchExpr["ID"].exec( tokens[0] )) ) {\r
+\r
+ context = Expr.find["ID"]( match[1], context, xml )[0];\r
+ if ( !context ) {\r
+ return results;\r
+ }\r
+\r
+ selector = selector.slice( tokens.shift().length );\r
+ }\r
+\r
+ findContext = ( (match = rsibling.exec( tokens[0] )) && !match.index && context.parentNode ) || context;\r
+\r
+ // Get the last token, excluding :not\r
+ notTokens = tokens.pop();\r
+ token = notTokens.split(":not")[0];\r
+\r
+ for ( i = 0, len = Expr.order.length; i < len; i++ ) {\r
+ type = Expr.order[i];\r
+\r
+ if ( (match = matchExpr[ type ].exec( token )) ) {\r
+ elements = Expr.find[ type ]( (match[1] || "").replace( rbackslash, "" ), findContext, xml );\r
+\r
+ if ( elements == null ) {\r
+ continue;\r
+ }\r
+\r
+ if ( token === notTokens ) {\r
+ selector = selector.slice( 0, selector.length - notTokens.length ) +\r
+ token.replace( matchExpr[ type ], "" );\r
+\r
+ if ( !selector ) {\r
+ push.apply( results, slice.call(elements, 0) );\r
+ }\r
+ }\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Only loop over the given elements once\r
+ // If selector is empty, we're already done\r
+ if ( selector ) {\r
+ matcher = compile( selector, context, xml );\r
+ dirruns = matcher.dirruns++;\r
+\r
+ if ( elements == null ) {\r
+ elements = Expr.find["TAG"]( "*", (rsibling.test( selector ) && context.parentNode) || context );\r
+ }\r
+ for ( i = 0; (elem = elements[i]); i++ ) {\r
+ cachedruns = matcher.runs++;\r
+ if ( matcher(elem, context) ) {\r
+ results.push( elem );\r
+ }\r
+ }\r
+ }\r
+\r
+ return results;\r
+};\r
+\r
+if ( document.querySelectorAll ) {\r
+ (function() {\r
+ var disconnectedMatch,\r
+ oldSelect = select,\r
+ rescape = /'|\\/g,\r
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,\r
+ rbuggyQSA = [],\r
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\r
+ // A support test would require too much code (would include document ready)\r
+ // just skip matchesSelector for :active\r
+ rbuggyMatches = [":active"],\r
+ matches = docElem.matchesSelector ||\r
+ docElem.mozMatchesSelector ||\r
+ docElem.webkitMatchesSelector ||\r
+ docElem.oMatchesSelector ||\r
+ docElem.msMatchesSelector;\r
+\r
+ // Build QSA regex\r
+ // Regex strategy adopted from Diego Perini\r
+ assert(function( div ) {\r
+ div.innerHTML = "<select><option selected></option></select>";\r
+\r
+ // IE8 - Some boolean attributes are not treated correctly\r
+ if ( !div.querySelectorAll("[selected]").length ) {\r
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );\r
+ }\r
+\r
+ // Webkit/Opera - :checked should return selected option elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ // IE8 throws error here (do not put tests after this one)\r
+ if ( !div.querySelectorAll(":checked").length ) {\r
+ rbuggyQSA.push(":checked");\r
+ }\r
+ });\r
+\r
+ assert(function( div ) {\r
+\r
+ // Opera 10-12/IE9 - ^= $= *= and empty values\r
+ // Should not select anything\r
+ div.innerHTML = "<p test=''></p>";\r
+ if ( div.querySelectorAll("[test^='']").length ) {\r
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );\r
+ }\r
+\r
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\r
+ // IE8 throws error here (do not put tests after this one)\r
+ div.innerHTML = "<input type='hidden'>";\r
+ if ( !div.querySelectorAll(":enabled").length ) {\r
+ rbuggyQSA.push(":enabled", ":disabled");\r
+ }\r
+ });\r
+\r
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );\r
+\r
+ select = function( selector, context, results, seed, xml ) {\r
+ // Only use querySelectorAll when not filtering,\r
+ // when this is not xml,\r
+ // and when no QSA bugs apply\r
+ if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\r
+ if ( context.nodeType === 9 ) {\r
+ try {\r
+ push.apply( results, slice.call(context.querySelectorAll( selector ), 0) );\r
+ return results;\r
+ } catch(qsaError) {}\r
+ // qSA works strangely on Element-rooted queries\r
+ // We can work around this by specifying an extra ID on the root\r
+ // and working up from there (Thanks to Andrew Dupont for the technique)\r
+ // IE 8 doesn't work on object elements\r
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {\r
+ var old = context.getAttribute("id"),\r
+ nid = old || expando,\r
+ newContext = rsibling.test( selector ) && context.parentNode || context;\r
+\r
+ if ( old ) {\r
+ nid = nid.replace( rescape, "\\$&" );\r
+ } else {\r
+ context.setAttribute( "id", nid );\r
+ }\r
+\r
+ try {\r
+ push.apply( results, slice.call( newContext.querySelectorAll(\r
+ selector.replace( rgroups, "[id='" + nid + "'] $&" )\r
+ ), 0 ) );\r
+ return results;\r
+ } catch(qsaError) {\r
+ } finally {\r
+ if ( !old ) {\r
+ context.removeAttribute("id");\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return oldSelect( selector, context, results, seed, xml );\r
+ };\r
+\r
+ if ( matches ) {\r
+ assert(function( div ) {\r
+ // Check to see if it's possible to do matchesSelector\r
+ // on a disconnected node (IE 9)\r
+ disconnectedMatch = matches.call( div, "div" );\r
+\r
+ // This should fail with an exception\r
+ // Gecko does not error, returns false instead\r
+ try {\r
+ matches.call( div, "[test!='']:sizzle" );\r
+ rbuggyMatches.push( Expr.match.PSEUDO );\r
+ } catch ( e ) {}\r
+ });\r
+\r
+ // rbuggyMatches always contains :active, so no need for a length check\r
+ rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );\r
+\r
+ Sizzle.matchesSelector = function( elem, expr ) {\r
+ // Make sure that attribute selectors are quoted\r
+ expr = expr.replace( rattributeQuotes, "='$1']" );\r
+\r
+ // rbuggyMatches always contains :active, so no need for an existence check\r
+ if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {\r
+ try {\r
+ var ret = matches.call( elem, expr );\r
+\r
+ // IE 9's matchesSelector returns false on disconnected nodes\r
+ if ( ret || disconnectedMatch ||\r
+ // As well, disconnected nodes are said to be in a document\r
+ // fragment in IE 9\r
+ elem.document && elem.document.nodeType !== 11 ) {\r
+ return ret;\r
+ }\r
+ } catch(e) {}\r
+ }\r
+\r
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
+ };\r
+ }\r
+ })();\r
+}\r
+\r
+// Override sizzle attribute retrieval
+Sizzle.attr = jQuery.attr;
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+\r
+\r
+})( window );\r
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ rneedsContext = jQuery.expr.match.needsContext,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };