/* * jquery bbq: back button & query library - v1.3pre - 8/26/2010 * http://benalman.com/projects/jquery-bbq-plugin/ * * copyright (c) 2010 "cowboy" ben alman * dual licensed under the mit and gpl licenses. * http://benalman.com/about/license/ */ (function(e){function t(a){return"string"===typeof a}function q(a){var b=b.call(arguments,1);return function(){return a.apply(this,b.concat(b.call(arguments)))}}function c(a,b,c,d,w){var m;d!==g?(b=c.match(a?u:/^([^#?]*)\??([^#]*)(#?.*)/),c=b[3]||"",2===w&&t(d)?d=d.replace(a?v:d,""):(m=j(b[2]),d=t(d)?j[a?h:r](d):d,d=2===w?d:1===w?e.extend({},d,m):e.extend({},m,d),d=e(d),a&&(d=d.replace(f,x))),a=b[1]+(a?y:d||!b[1]?"?":"")+d+c):a=b(c!==g?c:location.href);return a}function g(a,b,c){b===g||"boolean"===typeof b?(c=b,b=s[a?h:r]()):b=t(b)?b.replace(a?v:d,""):b;return j(b,c)}function h(a,b,c,d){!t(c)&&"object"!==typeof c&&(d=c,c=b,b=g);return this.each(function(){var g=e(this),m=b||i()[(this.nodename||"").tolowercase()]||"",f=m&&g.attr(m)||"";g.attr(m,s[a](f,c,d))})}"$:nomunge";var g,b=array.prototype.slice,x=decodeuricomponent,s=e.param,e,p,j,z,a=e.bbq=e.bbq||{},j,k,i,l=e.event.special,r="querystring",h="fragment",d=/^.*\?|#.*$/g,v,u,f,m,y,n={};s[r]=q(c,0,function(a){return a.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});s[h]=p=q(c,1,function(a){return a.replace(u,"$2")});s.sorted=e=function(a,b){var c=[],d={};e.each(s(a,b).split("&"),function(a,b){var f=b.replace(/(?:%5b|=).*$/,""),e=d[f];e||(e=d[f]=[],c.push(f));e.push(b)});return e.map(c.sort(),function(a){return d[a]}).join("&")};p.noescape=function(a){a=e.map((a||"").split(""),encodeuricomponent);f=regexp(a.join("|"),"g")};p.noescape(",/");p.ajaxcrawlable=function(a){a!==g&&(a?(v=/^.*(?:#!|#)/,u=/^([^#]*)(?:#!|#)?(.*)$/,y="#!"):(v=/^.*#/,u=/^([^#]*)#?(.*)$/,y="#"),m=!!a);return m};p.ajaxcrawlable(0);e.deparam=j=function(a,b){var c={},d={"true":!0,"false":!1,"null":null};e.each(a.replace(/\+/g," ").split("&"),function(a,m){var f=m.split("="),l=x(f[0]),j=c,h=0,k=l.split("]["),n=k.length-1;/\[/.test(k[0])&&/\]$/.test(k[n])?(k[n]=k[n].replace(/\]$/,""),k=k.shift().split("[").concat(k),n=k.length-1):n=0;if(2===f.length)if(f=x(f[1]),b&&(f=f&&!isnan(f)?+f:"undefined"===f?g:d[f]!==g?d[f]:f),n)for(;h<=n;h++)l=""===k[h]?j.length:k[h],j=j[l]=h').hide().one("load",function(){h||n(d());p()}).attr("src",h||"javascript:0").insertafter("body")[0].contentwindow,j.onpropertychange=function(){try{"title"===event.propertyname&&(f.document.title=j.title)}catch(a){}})};b.stop=e;s=function(){return d(f.location.href)};n=function(a,b){var d=f.document,e=c.fn.hashchange.domain;a!==b&&(d.title=j.title,d.open(),e&&d.write('