/**
 * jQuery.query - Query String Modification and Creation for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/8/13
 *
 * @author Blair Mitchelmore
 * @version 2.1.7
 *
 **/
new (function(k){var q=k.separator||"&",o=k.spaces===false?false:true,r=k.prefix===false?false:true,s=r?k.hash===true?"#":"?":"",t=k.numbers===false?false:true;jQuery.query=new (function(){function g(a,b){return a!=undefined&&a!==null&&(b?a.constructor==b:true)}function p(a){for(var b=/\[([^[]*)\]/g,c=/^([^[]+)(\[.*\])?$/.exec(a),e=c[1],d=[];a=b.exec(c[2]);)d.push(a[1]);return[e,d]}function j(a,b,c){var e=b.shift();if(typeof a!="object")a=null;if(e===""){a||(a=[]);if(g(a,Array))a.push(b.length==0?
c:j(null,b.slice(0),c));else if(g(a,Object)){for(e=0;a[e++]!=null;);a[--e]=b.length==0?c:j(a[e],b.slice(0),c)}else{a=[];a.push(b.length==0?c:j(null,b.slice(0),c))}}else if(e&&e.match(/^\s*[0-9]+\s*$/)){var d=parseInt(e,10);a||(a=[]);a[d]=b.length==0?c:j(a[d],b.slice(0),c)}else if(e){d=e.replace(/^\s*|\s*$/g,"");a||(a={});if(g(a,Array)){var f={};for(e=0;e<a.length;++e)f[e]=a[e];a=f}a[d]=b.length==0?c:j(a[d],b.slice(0),c)}else return c;return a}function m(a){var b=this;b.keys={};a.queryObject?jQuery.each(a.get(),
function(c,e){b.SET(c,e)}):jQuery.each(arguments,function(){var c=""+this;c=c.replace(/^[?#]/,"");c=c.replace(/[;&]$/,"");if(o)c=c.replace(/[+]/g," ");jQuery.each(c.split(/[&;]/),function(){var e=decodeURIComponent(this.split("=")[0]||""),d=decodeURIComponent(this.split("=")[1]||"");if(e){if(t)if(/^[+-]?[0-9]+\.[0-9]*$/.test(d))d=parseFloat(d);else if(/^[+-]?[0-9]+$/.test(d))d=parseInt(d,10);d=!d&&d!==0?true:d;if(d!==false&&d!==true&&typeof d!="number")d=d;b.SET(e,d)}})});return b}m.prototype={queryObject:true,
has:function(a,b){a=this.get(a);return g(a,b)},GET:function(a){if(!g(a))return this.keys;var b=p(a);a=b[0];b=b[1];for(a=this.keys[a];a!=null&&b.length!=0;)a=a[b.shift()];return typeof a=="number"?a:a||""},get:function(a){a=this.GET(a);if(g(a,Object))return jQuery.extend(true,{},a);else if(g(a,Array))return a.slice(0);return a},SET:function(a,b){b=!g(b)?null:b;var c=p(a);a=c[0];c=c[1];var e=this.keys[a];this.keys[a]=j(e,c.slice(0),b);return this},set:function(a,b){return this.copy().SET(a,b)},REMOVE:function(a){return this.SET(a,
null).COMPACT()},remove:function(a){return this.copy().REMOVE(a)},EMPTY:function(){var a=this;jQuery.each(a.keys,function(b){delete a.keys[b]});return a},load:function(a){var b=a.replace(/^.*?[#](.+?)(?:\?.+)?$/,"$1"),c=a.replace(/^.*?[?](.+?)(?:#.+)?$/,"$1");return new m(a.length==c.length?"":c,a.length==b.length?"":b)},empty:function(){return this.copy().EMPTY()},copy:function(){return new m(this)},COMPACT:function(){function a(b){var c=typeof b=="object"?g(b,Array)?[]:{}:b;if(typeof b=="object"){function e(d,
f,h){if(g(d,Array))d.push(h);else d[f]=h}jQuery.each(b,function(d,f){if(!g(f))return true;e(c,d,a(f))})}return c}this.keys=a(this.keys);return this},compact:function(){return this.copy().COMPACT()},toString:function(){var a=[],b=[];function c(f){f+="";if(o)f=f.replace(/ /g,"+");return encodeURIComponent(f)}function e(f,h,i){if(!(!g(i)||i===false)){h=[c(h)];if(i!==true){h.push("=");h.push(c(i))}f.push(h.join(""))}}function d(f,h){function i(l){return!h||h==""?""+l:[h,"[",l,"]"].join("")}jQuery.each(f,
function(l,n){typeof n=="object"?d(n,i(l)):e(b,i(l),n)})}d(this.keys);b.length>0&&a.push(s);a.push(b.join(q));return a.join("")}};return new m(location.search,location.hash)})})(jQuery.query||{});
