/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.1.1
build: 47
*/
YUI.add("querystring-parse",function(E){var B=E.namespace("QueryString");B.parse=function(G,H,F){return E.Array.reduce(E.Array.map(G.split(H||"&"),D(F||"=")),{},C);};B.unescape=function(F){return decodeURIComponent(F.replace(/\+/g," "));};var D=function(F){return function G(L,N){if(arguments.length!==2){L=L.split(F);return G(B.unescape(L.shift()),B.unescape(L.join(F)));}L=L.replace(/^\s+|\s+$/g,"");if(E.Lang.isString(N)){N=N.replace(/^\s+|\s+$/g,"");if(!isNaN(N)){var M=+N;if(N===M.toString(10)){N=M;}}}var H=/(.*)\[([^\]]*)\]$/.exec(L);if(!H){var J={};if(L){J[L]=N;}return J;}var I=H[2],K=H[1];if(!I){return G(K,[N]);}var J={};J[I]=N;return G(K,J);};};function C(G,F){return((!G)?F:(E.Lang.isArray(G))?G.concat(F):(!E.Lang.isObject(G)||!E.Lang.isObject(F))?[G].concat(F):A(G,F));}function A(H,F){for(var G in F){if(G&&F.hasOwnProperty(G)){H[G]=C(H[G],F[G]);}}return H;}},"3.1.1",{requires:["collection"]});YUI.add("querystring-stringify",function(D){var B=D.namespace("QueryString");B.escape=encodeURIComponent;var A=[];B.stringify=function(J,N,L,E){N=N||"&";L=L||"=";if(D.Lang.isNull(J)||D.Lang.isUndefined(J)||typeof(J)==="function"){return E?B.escape(E)+L:"";}if(C("Boolean",J)){J=+J;}if(C("Number",J)||C("String",J)){return B.escape(E)+L+B.escape(J);}if(D.Lang.isArray(J)){var M=[];E=E+"[]";for(var K=0,H=J.length;K<H;K++){M.push(B.stringify(J[K],N,L,E));}return M.join(N);}for(var K=A.length-1;K>=0;--K){if(A[K]===J){throw new Error("QueryString.stringify. Cyclical reference");}}A.push(J);var M=[];var G=E?E+"[":"";var I=E?"]":"";for(var K in J){if(J.hasOwnProperty(K)){var F=G+K+I;M.push(B.stringify(J[K],N,L,F));}}A.pop();M=M.join(N);if(!M&&E){return E+"=";}return M;};function C(E,F){return(D.Lang["is"+E](F)||Object.prototype.toString.call(F)==="[object "+E+"]");}},"3.1.1");YUI.add("querystring",function(A){},"3.1.1",{use:["querystring-parse","querystring-stringify"]});