$(document).ready(function(){$.event.props=$.event.props.join("|").replace("layerX|layerY|","").split("|");$("#cateName").text(parent.global.cateName)});var isMore=true;global={count:0,refresh:false};window.onload=function(){global.refresh=true;parent.global.page=1;if(parent.global.cateId=="top10"){parent.iframeGetAllTop10()}else{if(parent.global.cateId=="topGame"){parent.iframeGetAllGameTop()}else{if(parent.global.cateId=="topPopular"){parent.iframeGetAllPopularTop()}}}$("#loadingtip").hide();$("#appList").scroll(function(){if(isAtBottom()&&isMore){$("#loadingtip").show();++parent.global.page;if(parent.global.cateId=="top10"){parent.iframeGetAllTop10()}else{if(parent.global.cateId=="topGame"){parent.iframeGetAllGameTop()}else{if(parent.global.cateId=="topPopular"){parent.iframeGetAllPopularTop()}}}}})};function myfocus(){if(document.activeElement.id!="appSearch"){document.getElementsByTagName("body").select()}}function isAtBottom(){var a=document.getElementById("appList");return a.scrollHeight>(a.scrollTop+a.clientHeight)?false:true}function isScrolled(){var a=document.getElementById("appList");return a.offsetWidth!=a.clientWidth}document.oncontextmenu=new Function("return false;");function arrTypeC(b,a){b=$(b);if(!b.hasClass("arrListOn")){$("#arrType").find(".arrList").removeClass("arrListOn");b.addClass("arrListOn");parent.global.arrayTopType=parseInt(a,10);document.getElementById("appList").innerHTML='<div class="appPrompt">正在加载</div>';parent.getArrayAppList(parent.global.arrayTopType,parent.global.hasSub,1);parent.addHistoryEvent()}}function formatNum(a){if(a>10000){a=a/10000;a=a.toFixed(0);a=a+"万+"}return a}function setAllTop10App(c){var f=$("#appList");var h=0,a="",l="",d,m="",b="-1",k=0;$("#loadingtip").hide();if(c===""||c==null){isMore=false}else{isMore=true}if(c!=""&&c!=null&&c!="0"){var g=c.appList;if(parent.global.page==1||global.refresh){global.refresh=false}if(parent.global.page===1){k=0}else{k=f.find(".app").length}for(var e=0;e<g.length;e++){h=parseInt(g[e]["score"],10);a="";while(h--){a+='<img src="../images/score.png" />'}h=g[e]["status"];m=getButtonStatus(h,g[e]["csPackageName"]);b=g[e]["downloadCount"];if(b!="-1"){b="下载<span>"+formatNum(b)+"</span>次"}else{b="评论<span>"+g[e]["raterCnt"]+"</span>次"}if(parent.global.arrayTopType==1){b="评论<span>"+g[e]["raterCnt"]+"</span>次"}d=k+e+1;l=l+'<div class="app" onclick="appClick(this,'+g[e]["id"]+')">                    <div class="topNum">'+d+'</div>                    <div class="appName">                        <div class="appIcon"><img src="'+g[e]["iconUrl"]+'" onerror="appImgError(this)"/></div>                        <div class="appRealName">'+g[e]["titleCN"]+'</div>                        <div class="appDev">'+g[e]["developer"]+'</div>                    </div>                    <div class="appScore">'+a+'</div>                    <div class="splitEmpty"></div>                    <div class="appInfo" version="'+g[e]["versionName"]+'" downloadUrl="'+g[e]["downloadUrl"]+'" appName="'+g[e]["titleCN"]+'"                     >'+b+"</div>"+m+"                </div>"}if(parent.global.page===1||global.refresh){f.html(l);if(!isScrolled()&&isMore){$("#loadingtip").show();++parent.global.page;if(parent.global.cateId=="top10"){parent.iframeGetAllTop10()}else{if(parent.global.cateId=="topGame"){parent.iframeGetAllGameTop()}else{if(parent.global.cateId=="topPopular"){parent.iframeGetAllPopularTop()}}}}}else{f.append(l)}}else{if(g==null){return}if(g=="0"){l='<div class="appBusy">网络异常，加载失败！</div>'}else{l='<div class="empty">该页面没有相关应用！</div>'}f.html(l)}};