var Utilities = (function ()
{
	var window = this,
		utilities =
		{
			QueryString: (function (
				queryString)
			{
				var queryStringKeyValues = [];
				var keyValueRegex = /([\w-]+)=([\w-]+)/;

				var match = keyValueRegex.exec(
					queryString);

				queryStringKeyValues.length = 0;

				while ((match) &&
					(match.length > 0))
				{
					queryStringKeyValues[match[1]] = match[2];

					queryStringKeyValues.length++;

					match = keyValueRegex.exec(RegExp.rightContext);
				}

				return queryStringKeyValues;
			})(document.location.search),
			QueryStringDataBuilder: function ()
			{
				var queryStringData = [];

				this.length = function ()
				{
					return queryStringData.length;
				}

				this.append = function (
					key,
					value)
				{
					queryStringData.push(
						encodeURIComponent(
							key) +
						'=' +
						encodeURIComponent(
							value));
				};

				this.toString = function ()
				{
					return (
						queryStringData.join('&'));
				};
			},
			Base64:
			{
				e: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_|",
				encode: function (input)
				{
					var output = '';
					var chr1, chr2, chr3;
					var enc1, enc2, enc3, enc4;
					var i = 0;

					do
					{
						chr1 = input.charCodeAt(i++);
						chr2 = input.charCodeAt(i++);
						chr3 = input.charCodeAt(i++);
						enc1 = chr1 >> 2;
						enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
						enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
						enc4 = chr3 & 63;

						if (isNaN(chr2))
						{
							enc3 = enc4 = 64;
						}
						else if (isNaN(chr3))
						{
							enc4 = 64;
						}

						output = (
							output +
							utilities.Base64.e.charAt(enc1) +
							utilities.Base64.e.charAt(enc2) +
							utilities.Base64.e.charAt(enc3) +
							utilities.Base64.e.charAt(enc4));
					}
					while (i < input.length);

					return output;
				}
			}
		};

	utilities.ToggleOverlay = function ()
	{
		$('body').toggleClass(
			'showOverlay');

		if (($.browser.msie) &&
			($.browser.version < 7))
		{
			var bodyHeight = $('body').height();
			var windowHeight = $(window).height();

			if (bodyHeight > windowHeight)
			{
				$('#bbs_page_overlay').height(
				bodyHeight);
			}
			else
			{
				$('#bbs_page_overlay').height(
				windowHeight);
			}

			$('select').toggle();
		}
	};

	return utilities;
})();

if(!this.JSON)this.JSON={};(function(){function l(b){return b<10?"0"+b:b}function o(b){p.lastIndex=0;return p.test(b)?'"'+b.replace(p,function(f){var c=r[f];return typeof c==="string"?c:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function m(b,f){var c,d,g,j,i=h,e,a=f[b];if(a&&typeof a==="object"&&typeof a.toJSON==="function")a=a.toJSON(b);if(typeof k==="function")a=k.call(f,b,a);switch(typeof a){case "string":return o(a);case "number":return isFinite(a)?String(a):"null";case "boolean":case "null":return String(a);
case "object":if(!a)return"null";h+=n;e=[];if(Object.prototype.toString.apply(a)==="[object Array]"){j=a.length;for(c=0;c<j;c+=1)e[c]=m(c,a)||"null";g=e.length===0?"[]":h?"[\n"+h+e.join(",\n"+h)+"\n"+i+"]":"["+e.join(",")+"]";h=i;return g}if(k&&typeof k==="object"){j=k.length;for(c=0;c<j;c+=1){d=k[c];if(typeof d==="string")if(g=m(d,a))e.push(o(d)+(h?": ":":")+g)}}else for(d in a)if(Object.hasOwnProperty.call(a,d))if(g=m(d,a))e.push(o(d)+(h?": ":":")+g);g=e.length===0?"{}":h?"{\n"+h+e.join(",\n"+h)+
"\n"+i+"}":"{"+e.join(",")+"}";h=i;return g}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+l(this.getUTCMonth()+1)+"-"+l(this.getUTCDate())+"T"+l(this.getUTCHours())+":"+l(this.getUTCMinutes())+":"+l(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,n,r={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;if(typeof JSON.stringify!=="function")JSON.stringify=function(b,f,c){var d;n=h="";if(typeof c==="number")for(d=0;d<c;d+=1)n+=" ";else if(typeof c==="string")n=c;if((k=f)&&typeof f!=="function"&&(typeof f!=="object"||typeof f.length!=="number"))throw new Error("JSON.stringify");return m("",
{"":b})};if(typeof JSON.parse!=="function")JSON.parse=function(b,f){function c(g,j){var i,e,a=g[j];if(a&&typeof a==="object")for(i in a)if(Object.hasOwnProperty.call(a,i)){e=c(a,i);if(e!==undefined)a[i]=e;else delete a[i]}return f.call(g,j,a)}var d;b=String(b);q.lastIndex=0;if(q.test(b))b=b.replace(q,function(g){return"\\u"+("0000"+g.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+b+")");return typeof f==="function"?c({"":d},""):d}throw new SyntaxError("JSON.parse");}})();