var Utilities=function(){function r(n){var i=[],r,t;n=n||"";if(n!=""){r=/([\w.\-_~%]+)=([\w.\-_~%]+)/,t=r.exec(n),i.length=0;while(t&&t.length>0)i[t[1]]=t[2],i.length++,t=r.exec(RegExp.rightContext)}return i}var u=this,i="",t="",n={QueryString:function(n){return r(n)}(document.location.search),ParseQueryString:function(n){return r(n||"")},QueryStringDataBuilder:function(){var n=[];this.length=function(){return n.length},this.append=function(t,i){n.push(encodeURIComponent(t)+"="+encodeURIComponent(i))},this.toString=function(){return n.join("&")}},Base64:{e:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_|",encode:function(t){var s="",o,f,i,c,h,e,r,u=0;do o=t.charCodeAt(u++),f=t.charCodeAt(u++),i=t.charCodeAt(u++),c=o>>2,h=(o&3)<<4|f>>4,e=(f&15)<<2|i>>6,r=i&63,isNaN(f)?e=r=64:isNaN(i)&&(r=64),s=s+n.Base64.e.charAt(c)+n.Base64.e.charAt(h)+n.Base64.e.charAt(e)+n.Base64.e.charAt(r);while(u<t.length);return s}}};return n.ToggleOverlay=function(){$("body").toggleClass("showOverlay");if($.browser.msie&&$.browser.version<7){var t=$("body").height(),n=$(u).height();t>n?$("#bbs_page_overlay").height(t):$("#bbs_page_overlay").height(n),$("select").toggle()}},n.EnableOnUnloadPopup=function(r,u,f,e){r=r||"",u=u||"",f=f||".bizbuysell.com",e=e||0,r!=""&&$("#topBar table.topBar td.tagline a, #topBar table.topBar td.wsj a, #navContainer #nav ul li a, #footer table.footer tr td a").click(function(){var s=$("#"+r),o;if(s.length>0){o=!0,u!=""&&$.cookie(u)!=null&&(o=!1);if(o)return i=r,t=this.href,n.ToggleOverlay(),s.toggle(),u!=""&&e>0&&$.cookie(u,"true",{domain:f,path:"/",expires:e}),!1}})},n.CancelOnUnloadPopup=function(){if(i!=""){var r=$("#"+i);r.length>0&&(i="",r.toggle(),n.ToggleOverlay())}t!=""&&(u.location=t,t="")},n}();this.JSON||(this.JSON={}),function(){function i(n){return n<10?"0"+n:n}function o(n){return f.lastIndex=0,f.test(n)?'"'+n.replace(f,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function u(i,f){var h,l,c,a,v=n,s,e=f[i];e&&typeof e=="object"&&typeof e.toJSON=="function"&&(e=e.toJSON(i)),typeof t=="function"&&(e=t.call(f,i,e));switch(typeof e){case"string":return o(e);case"number":return isFinite(e)?String(e):"null";case"boolean":case"null":return String(e);case"object":if(!e)return"null";n+=r,s=[];if(Object.prototype.toString.apply(e)==="[object Array]"){for(a=e.length,h=0;h<a;h+=1)s[h]=u(h,e)||"null";return c=s.length===0?"[]":n?"[\n"+n+s.join(",\n"+n)+"\n"+v+"]":"["+s.join(",")+"]",n=v,c}if(t&&typeof t=="object")for(a=t.length,h=0;h<a;h+=1)l=t[h],typeof l=="string"&&(c=u(l,e))&&s.push(o(l)+(n?": ":":")+c);else for(l in e)Object.hasOwnProperty.call(e,l)&&(c=u(l,e))&&s.push(o(l)+(n?": ":":")+c);return c=s.length===0?"{}":n?"{\n"+n+s.join(",\n"+n)+"\n"+v+"}":"{"+s.join(",")+"}",n=v,c}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,r,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;r=n="";if(typeof e=="number")for(o=0;o<e;o+=1)r+=" ";else typeof e=="string"&&(r=e);if((t=f)&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return u("",{"":i})}),typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;n=String(n),e.lastIndex=0,e.test(n)&&(n=n.replace(e,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})}()
