function makeQueryInfo() {

		var rparam = /[^?#]*\?([^#]*&)?q=([^&#]*)(&|#|$)/,
			rquote = /[.?*+|(){}\[\]\\]/g,
			match = rparam.exec(document.URL) || rparam.exec(document.referrer),
			qterms = match && decodeURIComponent(match[2].replace(/\+/g, " ")).split(/\s+/g),
			classes,i,t;

		if ( qterms ) {

			// create a styles map and regexp from the non-empty query terms
			classes = {};
			for (i = 0; i < qterms.length; ) {
				t = qterms[i].toLowerCase();
				if ( t && !classes.hasOwnProperty(t) ) { // ignore duplicates and empty terms
					classes[t] = 'queryterm' + (1 + i % N_STYLES);
					qterms[i] = t.replace(rquote, "\\$&"); // quote special regex chars;
					i++;
				} else {
					// remove empty or redundant search terms
					qterms.splice(i, 1);
				}
			}

			// if there are terms, return an info object with regex and style map
			if ( qterms.length > 0 ) {
				return {
					regexp: new RegExp(qterms.join("|"), 'gi'),
					classes: classes
				};
			}

		}

		// return undefined
	}
/*
	 * Search the query parameters of the document URL and the referrer URL for Google-like query terms
	 * (parameter name 'q'). If found, create a regular expression to find occurrences of any of the terms
	 * and a map of CSS classes to be applied to each match. The map uses the lower case version of each term as key.
	 *
	 * @returns {{regexp:RegExp, classes:object}} info object
	 */
Search the query parameters of the document URL and the referrer URL for Google-like query terms
(parameter name 'q'). If found, create a regular expression to find occurrences of any of the terms
and a map of CSS classes to be applied to each match. The map uses the lower case version of each term as key.

@returns {{regexp:RegExp, classes:object}} info object
Search the query parameters of the document URL and the referrer URL for Google - like query terms ( parameter name ' q ' ) . If found create a regular expression to find occurrences of any of the terms and a map of CSS classes to be applied to each match . The map uses the lower case version of each term as key . @returns {{ regexp : RegExp classes : object }} info object
function makeQueryInfo() {
		var rparam = /[^?#]*\?([^#]*&)?q=([^&#]*)(&|#|$)/,
			rquote = /[.?*+|(){}\[\]\\]/g,
			match = rparam.exec(document.URL) || rparam.exec(document.referrer),
			qterms = match && decodeURIComponent(match[2].replace(/\+/g, " ")).split(/\s+/g),
			classes,i,t;
		if ( qterms ) {
			classes = {};
			for (i = 0; i < qterms.length; ) {
				t = qterms[i].toLowerCase();
				if ( t && !classes.hasOwnProperty(t) ) { 
					classes[t] = 'queryterm' + (1 + i % N_STYLES);
					qterms[i] = t.replace(rquote, "\\$&"); 
					i++;
				} else {
					qterms.splice(i, 1);
				}
			}
			if ( qterms.length > 0 ) {
				return {
					regexp: new RegExp(qterms.join("|"), 'gi'),
					classes: classes
				};
			}
		}
	}
function makeQueryInfo ( ) { var rparam = / [^?#]*\?([^#]*&)?q=([^&#]*)(&|#|$) / , rquote = / [.?*+|(){}\[\]\\] / g , match = rparam . exec ( document . URL ) || rparam . exec ( document . referrer ) , qterms = match && decodeURIComponent ( match [ 2 ] . replace ( / \+ / g , " " ) ) . split ( / \s+ / g ) , classes , i , t ; if ( qterms ) { classes = { } ; for ( i = 0 ; i < qterms . length ; ) { t = qterms [ i ] . toLowerCase ( ) ; if ( t && ! classes . hasOwnProperty ( t ) ) { classes [ t ] = 'queryterm' + ( 1 + i % N_STYLES ) ; qterms [ i ] = t . replace ( rquote , "\\$&" ) ; i ++ ; } else { qterms . splice ( i , 1 ) ; } } if ( qterms . length > 0 ) { return { regexp : new RegExp ( qterms . join ( "|" ) , 'gi' ) , classes : classes } ; } } }
Search the query parameters of the document URL and the referrer URL for Google-like query terms
 (parameter name 'q').
Search the query parameters of the document URL and the referrer URL for Google - like query terms ( parameter name ' q ' ) .
// create a styles map and regexp from the non-empty query terms // ignore duplicates and empty terms // quote special regex chars; // remove empty or redundant search terms // if there are terms, return an info object with regex and style map // return undefined