var fi=fi||{};fi.models=fi.models||{};fi.models.Blogger=new function(){QUERY_TEMPLATE="http://www.blogger.com/feeds/${blogID}/posts/default/${postID}?alt=json-in-script&callback=fi.models.Blogger.onRequestComplete";CALLBACK_REGEX=/^.*blog\-(\d+)\.post\-(\d+)/i;var _callbacks={};var api={};api.getPost=function(blogID,postID,callback){_callbacks[blogID+"-"+postID]=callback;var query=QUERY_TEMPLATE.replace(/\${blogID}/g,blogID);query=query.replace(/\${postID}/g,postID);var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",query);$("head").append(script);};api.onRequestComplete=function(response){var callbackID=String(response.entry.id.$t).replace(CALLBACK_REGEX,"$1-$2");if(_callbacks.hasOwnProperty(callbackID)){_callbacks[callbackID](response);delete _callbacks[callbackID];}};return api;};
