$(document).ready(function(){$.event.props=$.event.props.join("|").replace("layerX|layerY|","").split("|");global.taskListObj=$("#taskList")});window.onload=function(){onLoadOk()};document.oncontextmenu=new Function("return false;");var global={taskListObj:""};function onLoadOk(){document.getElementById("installSeledApk").className="menu-nav disable";document.getElementById("deleteTask").className="menu-nav disable";document.getElementById("taskList").innerHTML="";parent.apkDownedLoadOk()}function refreshList(a){if(a==""||a==null){document.getElementById("taskList").innerHTML=" "}else{var c={list:a,num:0};template.helper("setNum",function(e){c.num=e});var b=template("task_list_template",c);document.getElementById("taskList").innerHTML=b}connectSuccess()}function startTask(a){if($("#startTask").hasClass("disable")){return}}function delTask(a){if($(a).hasClass("disable")){return}var c=$(a).parent().parent().attr("id");parent.deleteDownedapk(c);$(a).parent().parent().remove();var b=global.taskListObj.find("li").length;parent.document.getElementById("apkDownedNum").innerText="应用("+b+")";refreshTopMenu()}function deleteTask(a){if($(a).hasClass("disable")){return}var b="";global.taskListObj.find("li").each(function(){if($(this).find(".select_on").length>0){b=b+$(this).attr("id");b=b+"_";$(this).remove()}});parent.deleteDownedapk(b);var c=global.taskListObj.find("li").length;parent.document.getElementById("apkDownedNum").innerText="应用("+c+")";refreshTopMenu()}function installApk(a){if($(a).hasClass("disable")){return}$(a).addClass("disable");var b=$(a).parent().parent().attr("id");parent.installApks(b);refreshTopMenu()}function installApks(a){if($(a).hasClass("disable")){return}var b="";global.taskListObj.find(".select_on").each(function(){$(this).parent().parent().find(".task_op_li_install").each(function(){if($(this).hasClass("disable")){}else{b=b+$(this).parent().parent().attr("id");b=b+"_";$(this).addClass("disable")}})});parent.installApks(b);refreshTopMenu()}function openApkPath(){if($("#openApkPath").hasClass("disable")){return}parent.openApkPath()}function h(a){a.style.backgroundColor="#B7DBEA";a.focus()}function o(a){a.style.backgroundColor="transparent"}function d(b){var c=$(b);var f=event||window.event;var a=global.taskListObj.find("li");a.css("background","")}function sd(a){var c=$(a);if(c.hasClass("select_on")){a.className="sn"}else{a.className="sn select_on"}refreshTopMenu();var b=event||window.event;stopBubble(b)}function allSd(c){var b=$(c);var a=global.taskListObj.find("li");if(a.length<=0){b.removeClass("select_on");return}if(b.hasClass("select_on")){c.className="sn";a.find(".select_on").removeClass("select_on")}else{c.className="sn select_on";a.find(".sn").addClass("select_on")}refreshTopMenu()}function refreshTopMenu(){var a=global.taskListObj.find(".sn").length;var b=global.taskListObj.find(".select_on").length;var c=0;global.taskListObj.find(".select_on").each(function(){$(this).parent().parent().find(".task_op_li_install").each(function(){if($(this).hasClass("disable")){c=c+1}})});if(a==b&&a!=0){document.getElementById("allSelect").className="sn select_on"}else{document.getElementById("allSelect").className="sn"}if(b>0){if(c==b){$("#installSeledApk").addClass("disable")}else{$("#installSeledApk").removeClass("disable")}$("#deleteTask").removeClass("disable")}else{$("#installSeledApk").addClass("disable");$("#deleteTask").addClass("disable")}parent.document.getElementById("apkDownedNum").innerText="应用("+a+")"}function updateTaskItem(a){if(a==""&&a==null){return}var j=a.id;var f=a.content;var c=$("#"+j);if(f==null||f==""){c.remove();refreshTopMenu();return}var g={list:f,num:0};var i=template("task_content_template",g);if(c.length==0){var b='<li id="'+j+'" onmouseover="h(this)" onmouseout="o(this)" onmousedown="d(this)">'+i+"</li>";global.taskListObj.append(b);return}var e=c.find(".select_on").length;c.html(i);if(e){c.find(".sn").addClass("select_on")}refreshTopMenu()}function connectSuccess(){if(parent.checkConnectPhone()!="1"){global.taskListObj.find(".task_op_li_install").each(function(){$(this).addClass("disable")})}else{global.taskListObj.find(".task_op_li_install").each(function(){$(this).removeClass("disable")})}refreshTopMenu()};