/*
jQuery Compare - 01/06/10
VERSION 0.7a
by Craig Eve <evelution.net>
jQuery Compare is distributed under the MIT License
Read more about the MIT License --> http://www.opensource.org/licenses/mit-license.php
This script is currently a beta test version, download and use it at your own risk.
The jQuery Compare developer shall have no responsibility for data loss or damage of any kind by using this script.
This plugin makes use of parseUri
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
*/
(function(b){b.fn.compare=function(c){var c=b.extend({},b.fn.compare.defaults,c);var d=testCollection=b([]);this.each(function(){$this=b(this);testCollection=testCollection.add($this.is("a")?$this:$this.find("a"))});testCollection.each(function(f){$this=b(this);var h=c;var e=a(h.url);var g=a($this.attr("href"));error=false;b.each(h.query,function(j,i){error=error||((typeof g.get[j]!="string"&&i)||(typeof g.get[j]=="string"&&e.get[j]!=g.get[j]))});b.each(h.compare,function(j,i){error=error||((g[j]==""&&i)||(g[j]!=""&&e[j]!=g[j]))});if(!error){d=d.add(this)}});return(this.pushStack(d,"compare",""))};b.fn.query=function(c){return this.compare({query:c})};b.getUri=function(d){var c=b.extend({},b.fn.compare.defaults);if(typeof d=="string"){c.url=d}return a(c.url)};log=typeof console=="object"?console.log:function(){};function a(g){var f=b.fn.compare.defaults.parseUri,c=f.p[f.s?"s":"l"].exec(g),d={},e=14;while(e--){d[f.k[e]]=c[e]||""}d[f.k[11]]=(d[f.k[2]]==d[f.k[6]]&&d[f.k[11]]=="")?d[f.k[2]]:d[f.k[11]];d[f.q.n]={};d[f.k[12]].replace(f.q.p,function(i,h,j){if(h){d[f.q.n][h]=j}});return d}b.fn.compare.defaults={url:window.location,compare:{},query:{},parseUri:{s:false,k:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{n:"get",p:/(?:^|&)([^&=]*)=?([^&]*)/g},p:{s:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,l:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}}}})(jQuery);

