if(!this.JSON)this.JSON={};
(function(){function a(f){return f<10?"0"+f:f}function c(f){d.lastIndex=0;return d.test(f)?'"'+f.replace(d,function(i){var j=q[i];return typeof j==="string"?j:"\\u"+("0000"+i.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function b(f,i){var j,l,p=e,k,h=i[f];if(h&&typeof h==="object"&&typeof h.toJSON==="function")h=h.toJSON(f);if(typeof n==="function")h=n.call(i,f,h);switch(typeof h){case "string":return c(h);case "number":return isFinite(h)?String(h):"null";case "boolean":case "null":return String(h);case "object":if(!h)return"null";
e+=m;k=[];if(Object.prototype.toString.apply(h)==="[object Array]"){l=h.length;for(f=0;f<l;f+=1)k[f]=b(f,h)||"null";i=k.length===0?"[]":e?"[\n"+e+k.join(",\n"+e)+"\n"+p+"]":"["+k.join(",")+"]";e=p;return i}if(n&&typeof n==="object"){l=n.length;for(f=0;f<l;f+=1){j=n[f];if(typeof j==="string")if(i=b(j,h))k.push(c(j)+(e?": ":":")+i)}}else for(j in h)if(Object.hasOwnProperty.call(h,j))if(i=b(j,h))k.push(c(j)+(e?": ":":")+i);i=k.length===0?"{}":e?"{\n"+e+k.join(",\n"+e)+"\n"+p+"}":"{"+k.join(",")+"}";
e=p;return i}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var g=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,m,q={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},n;if(typeof JSON.stringify!=="function")JSON.stringify=function(f,i,j){var l;m=e="";if(typeof j==="number")for(l=0;l<j;l+=1)m+=" ";else if(typeof j==="string")m=j;if((n=i)&&typeof i!=="function"&&(typeof i!=="object"||typeof i.length!=="number"))throw new Error("JSON.stringify");return b("",
{"":f})};if(typeof JSON.parse!=="function")JSON.parse=function(f,i){function j(l,p){var k,h,o=l[p];if(o&&typeof o==="object")for(k in o)if(Object.hasOwnProperty.call(o,k)){h=j(o,k);if(h!==undefined)o[k]=h;else delete o[k]}return i.call(l,p,o)}g.lastIndex=0;if(g.test(f))f=f.replace(g,function(l){return"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(f.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){f=eval("("+f+")");return typeof i==="function"?j({"":f},""):f}throw new SyntaxError("JSON.parse");}})();(function(){var a={};this.template=function c(b,g){b=!/\W/.test(b)?(a[b]=a[b]||c(b)):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+b.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return g?b(g):b}})();
(function(a){a.fn.applyTemplate=function(c){a(this).html(template(c.getTemplateBody(),c.getData()))}})(jQuery);jQuery.cookie=function(a,c,b){if(typeof c!="undefined"){b=b||{};if(c===null){c="";b.expires=-1}var g="";if(b.expires&&(typeof b.expires=="number"||b.expires.toUTCString)){if(typeof b.expires=="number"){g=new Date;g.setTime(g.getTime()+b.expires*24*60*60*1E3)}else g=b.expires;g="; expires="+g.toUTCString()}var d=b.path?"; path="+b.path:"",e=b.domain?"; domain="+b.domain:"";b=b.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(c),g,d,e,b].join("")}else{c=null;if(document.cookie&&document.cookie!=
""){b=document.cookie.split(";");for(g=0;g<b.length;g++){d=jQuery.trim(b[g]);if(d.substring(0,a.length+1)==a+"="){c=decodeURIComponent(d.substring(a.length+1));break}}}return c}};function prettyDate(a){a=new Date((a||"").replace(/-/g,"/").replace(/TZ/g," "));a=((new Date).getTime()-a.getTime())/1E3;var c=Math.floor(a/86400);if(!(isNaN(c)||c<0||c>=31))return c==0&&(a<60&&"just now"||a<120&&"1 minute ago"||a<3600&&Math.floor(a/60)+" minutes ago"||a<7200&&"1 hour ago"||a<86400&&Math.floor(a/3600)+" hours ago")||c==1&&"1 day ago"||c<7&&c+" days ago"||c<31&&Math.ceil(c/7)+" weeks ago"}
if(typeof jQuery!="undefined")jQuery.fn.prettyDate=function(){return this.each(function(){var a=prettyDate(this.title);a&&jQuery(this).text(a)})};(function(a){a.fn.twitterize=function(d){var e=a(this),m=b(e.cookieName()),q={rpp:5,page:1,lang:"en"};m?e.applyTweets(m):a.getJSON("http://search.twitter.com/search.json?callback=?",a.extend(q,d),function(n){c(n,e.cookieName());e.applyTweets(n)})};a.fn.applyTweets=function(d){var e=a(this);e.applyTemplate({getTemplateBody:function(){return a(e.attr("template")).html()},getData:function(){return d}})};a.fn.cookieName=function(){return a(this).attr("id")+"_tweets"};var c=function(d,e){a.cookie(e,g(d),
{expires:1})},b=function(d){return(cookieData=a.cookie(d))?JSON.parse(cookieData):null},g=function(d){return JSON.stringify(d,["results","from_user","text","id","created_at"])}})(jQuery);(function(a){a.fn.feedme=function(){a(this).each(function(d,e){var m=a(e);if(d=b(m.cookieName()))m.applyFeed(d);else{d=new google.feeds.Feed(m.attr("feed"));d.setNumEntries(5);d.load(function(q){c(q,m.cookieName());m.applyFeed(q)})}})};a.fn.applyFeed=function(d){var e=a(this);e.applyTemplate({getTemplateBody:function(){return a(e.attr("template")).html()},getData:function(){return d}})};a.fn.cookieName=function(){return a(this).attr("id")+"_feed"};var c=function(d,e){a.cookie(e,g(d),{expires:1})},
b=function(d){return(cookieData=a.cookie(d))?JSON.parse(cookieData):null},g=function(d){return JSON.stringify(d,["feed","entries","author","title","link","contentSnippet"])}})(jQuery);(function(a){a.googleSearch=function(c,b){var g=a.extend({version:"1.0",type:"web",query:c},b);c=a.extend({v:g.version,q:g.query},g.urlParams);a.getJSON("http://ajax.googleapis.com/ajax/services/search/"+g.type+"?callback=?&",c,function(d){g.callback(d.responseData)})}})(jQuery);(function(a){a.fn.enableSearch=function(){var c=a(this),b=a(c.attr("results")),g=c.attr("cse");c.submit(function(){var d=c.find("input.search_field").attr("value");a.googleSearch(d,{callback:function(e){b.show();b.applySearchResults(e)},urlParams:{cx:g}});return false})};a.fn.applySearchResults=function(c){var b=a(this);b.applyTemplate({getTemplateBody:function(){return a(b.attr("template")).html()},getData:function(){return c}})}})(jQuery);