var Mustache=function(){function s(n){return String(n).replace(/&(?!#?\w+;)|[<>"']/g,function(n){return e[n]||n})}var o=Object.prototype.toString,f,n,r,u,e,t,i;return Array.isArray=Array.isArray||function(n){return o.call(n)=="[object Array]"},f=String.prototype.trim,f?n=function(n){return n==null?"":f.call(n)}:(/\S/.test(" ")?(r=/^[\s\xA0]+/,u=/[\s\xA0]+$/):(r=/^\s+/,u=/\s+$/),n=function(n){return n==null?"":n.toString().replace(r,"").replace(u,"")}),e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},t={},i=function(){},i.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(n,t,i,r){if(r||(this.context=t,this.buffer=[]),!this.includes("",n)){if(r)return n;this.send(n);return}n=this.render_pragmas(n);var u=this.render_section(n,t,i);if(u===!1&&(u=this.render_tags(n,t,i,r)),r)return u;this.sendLines(u)},send:function(n){n!==""&&this.buffer.push(n)},sendLines:function(n){var i,t;if(n)for(i=n.split("\n"),t=0;t<i.length;t++)this.send(i[t])},render_pragmas:function(n){if(!this.includes("%",n))return n;var t=this,i=this.getCachedRegex("render_pragmas",function(n,t){return new RegExp(n+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+t,"g")});return n.replace(i,function(n,i,r){if(!t.pragmas_implemented[i])throw{message:"This implementation of mustache doesn't understand the '"+i+"' pragma"};if(t.pragmas[i]={},r){var u=r.split("=");t.pragmas[i][u[0]]=u[1]}return""})},render_partial:function(t,i,r){if(t=n(t),!r||r[t]===undefined)throw{message:"unknown_partial '"+t+"'"};return!i||typeof i[t]!="object"?this.render(r[t],i,r,!0):this.render(r[t],i[t],r,!0)},render_section:function(n,t,i){if(!this.includes("#",n)&&!this.includes("^",n))return!1;var r=this,u=this.getCachedRegex("render_section",function(n,t){return new RegExp("^([\\s\\S]*?)"+n+"(\\^|\\#)\\s*(.+?)\\s*"+t+"\n*([\\s\\S]*?)"+n+"\\/\\s*\\3\\s*"+t+"\\s*([\\s\\S]*)$","g")});return n.replace(u,function(n,u,f,e,o,s){var a=u?r.render_tags(u,t,i,!0):"",l=s?r.render(s,t,i,!0):"",c,h=r.find(e,t);return f==="^"?c=!h||Array.isArray(h)&&h.length===0?r.render(o,t,i,!0):"":f==="#"&&(c=Array.isArray(h)?r.map(h,function(n){return r.render(o,r.create_context(n),i,!0)}).join(""):r.is_object(h)?r.render(o,r.create_context(h),i,!0):typeof h=="function"?h.call(t,o,function(n){return r.render(n,t,i,!0)}):h?r.render(o,t,i,!0):""),a+c+l})},render_tags:function(n,t,i,r){for(var e=this,o=function(){return e.getCachedRegex("render_tags",function(n,t){return new RegExp(n+"(=|!|>|&|\\{|%)?([^#\\^]+?)\\1?"+t+"+","g")})},h=o(),c=function(n,r,u){switch(r){case"!":return"";case"=":return e.set_delimiters(u),h=o(),"";case">":return e.render_partial(u,t,i);case"{":case"&":return e.find(u,t);default:return s(e.find(u,t))}},f=n.split("\n"),u=0;u<f.length;u++)f[u]=f[u].replace(h,c,this),r||this.send(f[u]);if(r)return f.join("\n")},set_delimiters:function(n){var t=n.split(" ");this.otag=this.escape_regex(t[0]),this.ctag=this.escape_regex(t[1])},escape_regex:function(n){if(!arguments.callee.sRE){var t=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+t.join("|\\")+")","g")}return n.replace(arguments.callee.sRE,"\\$1")},find:function(t,i){function f(n){return n===!1||n===0||n}var r,u;return(t=n(t),t.match(/([a-z_]+)\./ig)?(u=this.walk_context(t,i),f(u)&&(r=u)):f(i[t])?r=i[t]:f(this.context[t])&&(r=this.context[t]),typeof r=="function")?r.apply(i):r!==undefined?r:""},walk_context:function(n,t){for(var r=n.split("."),u=t[r[0]]!=undefined?t:this.context,i=u[r.shift()];i!=undefined&&r.length>0;)u=i,i=i[r.shift()];return typeof i=="function"?i.apply(u):i},includes:function(n,t){return t.indexOf(this.otag+n)!=-1},create_context:function(n){var i,t;return this.is_object(n)?n:(i=".",this.pragmas["IMPLICIT-ITERATOR"]&&(i=this.pragmas["IMPLICIT-ITERATOR"].iterator),t={},t[i]=n,t)},is_object:function(n){return n&&typeof n=="object"},map:function(n,t){var r,u,i;if(typeof n.map=="function")return n.map(t);for(r=[],u=n.length,i=0;i<u;i++)r.push(t(n[i]));return r},getCachedRegex:function(n,i){var f=t[this.otag],r,u;return f||(f=t[this.otag]={}),r=f[this.ctag],r||(r=f[this.ctag]={}),u=r[n],u||(u=r[n]=i(this.otag,this.ctag)),u}},{name:"mustache.js",version:"0.4.1",to_html:function(n,t,r,u){var f=new i;return u&&(f.send=u),f.render(n,t||{},r),u?void 0:f.buffer.join("\n")}}}(),loadNewsRoomBox=function(n){var t=$(n).attr("src"),i=$(n).attr("mode");$.ajax({type:"POST",url:"/Data/GetNewsroomBox.aspx?mode="+i,data:"",cache:!1,beforeSend:function(){$("ul#"+t).append("<div id='waiter'></div>")},success:function(n){$("ul#"+t+" div#waiter").remove(),$("ul#"+t).html(n)}})},sections="",getting_old=!1,fromId="0",newroomItem='<li class="fn_news_item" itm="{{amId}}"><div class="topicTime"><span class="timeLabel" style="font-weight: normal;">{{formatDate}}</span></div> <div class="topicInfo"><a href=\'{{newsLink}}\'><strong>{{& brandFocus}}{{amTitle}}</strong></a></div> <div class="clear"></div></li>',needMoreNews=function(){var n=$("#newsroomBox #nrb_1b>.newsList li").length*25;return $("#newsroomBox #nrb_1b>.newsList").scrollTop()>=n-$("#newsroomBox #nrb_1b>.newsList").height()},lastItem=function(){return $(".fn_news_item:last")},lastAssetItem=function(){return $(".fn_news_item").length>0?$(".fn_news_item:last").attr("itm"):0},newsroomHomeDataMode=1,GetMoreNews=function(){if(!getting_old){getting_old=!0,fromId=lastAssetItem();var n={fromId:fromId,sections:sections,mode:newsroomHomeDataMode};$.ajax({type:"GET",url:"/Data/Newsroom.ashx",data:n,contentType:"application/json; charset=utf-8",dataType:"json",async:!0,cache:!1,error:function(){fromId=="0"&&$(".newsWaiter:visible").fadeOut()},beforeSend:function(){$(".newsWaiter:hidden").fadeIn()},success:function(n){$.each(n,function(n,t){$("#newsroomBox #nrb_1b>.newsList").append(Mustache.to_html(newroomItem,t))}),getting_old=!1},complete:function(){fromId=="0"&&$(".newsWaiter:visible").fadeOut()}})}},HandleNewroomBoxDataScroll=function(){needMoreNews()&&GetMoreNews()};$(function(){$("#newsroomBox #nrb_1b>.newsList").scroll(HandleNewroomBoxDataScroll)})