var menujson=null;var datajson=null;var iconjson=null;var totalnum=null;var DATA=new Object();var iconCookieKey="iconCookieKey";var iconCookieKeyForSlider="iconCookieKeyForSlider";var cookieParam={expires:30};var defaultIconForSlider=[];function dataFlush(){$.ajax({url:"loginController.do?getPrimaryMenuForWebos",datatype:"json",async:false,type:"post",success:function(data){var menu;menu=eval("("+data+")");var array=menu.msg.split("$$");menujson=array[0];menujson=eval("("+menujson+")");iconjson=array[1];iconjson=eval("("+iconjson+")");datajson=array[2];datajson=eval("("+datajson+")");var totalnum1=array[3];totalnum=totalnum1-1;calcuIconJson()}})}function calcuIconJson(){var l=$.cookie(iconCookieKey);var q=$.cookie(iconCookieKeyForSlider);if(l){var t=new Array();var n={};for(var r in iconjson){n[r]=new Array()}var p=l.split("|");$.each(p,function(d,c){var a=c.split(":")[0];var b=c.split(":")[1]?c.split(":")[1].split("@"):"";$.each(b,function(f,e){if(e){n[a].push(e);t.push(e)}})});if(q){DATA.sApp={};defaultIconForSlider=new Array();var s=q.split("@");$.each(s,function(b,c){if(c){for(var a in datajson.app){if(c==a){DATA.sApp[a]=datajson.app[a];break}}defaultIconForSlider.push(c);t.push(c)}})}for(var o in iconjson){for(var k in iconjson[o]){var m=iconjson[o][k];if(t.indexOf(m)==-1){n[o].push(m)}}}iconjson=n}}Util={formatmodel:function(e,g){for(var h in g){var f=new RegExp("{"+h+"}","g");e=e.replace(f,g[h])}return e}};Panel=function(){return me={hitTest:function(f,g,h){var j,i;return !(g<(j=f.offset().left)||h<(i=f.offset().top)||g>j+f.width()||h>i+f.height())},getIdx:function(d){var c=0;while(d=d.prev()){c++}return c},unSelecte:function(){return window.getSelection?function(){window.getSelection().removeAllRanges()}:function(){document.selection.empty()}}()}}();Body=function(b){dataFlush();return b={init:function(){b.create();b.bindEvent()},create:function(){b.box=$("body");b.setStyle()},bindEvent:function(){function d(c){window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}function a(c){$(document).unbind("mousemove",d).unbind("mouseup",a)}$(document).bind("mousedown",function(){$(document).bind("mousemove",d).bind("mouseup",a)})},addPanel:function(a){b.box.append(a)},setStyle:function(){b.box.css({backgroud:"none repeat scroll 0 0 transparent",display:"block",height:"500px"})}}}();Desktop=function(b){return b={init:function(){b.create();return b},create:function(){b.box=$("<div id='desktop'  style='position: static;'></div>");Body.addPanel(b.box)},addPanel:function(a){b.box.append(a)},show:function(){b.box.show()},hide:function(){b.box.hide()},setMenu:function(){var a=[[{text:"显示桌面",func:function(){}},{text:"关闭所有",func:function(){Windows.closeAllWindow()}},{text:"锁屏",func:function(){}}],[{text:"系统设置",func:function(){}},{text:"主题设置",func:function(){Windows.openSys({id:"themSetting",title:"设置主题",width:650,height:500,content:document.getElementById("themeSetting_wrap")})}},{text:"图标设置",data:[[{text:"大图标",func:function(){Deskpanel.desktopsContainer.removeClass("desktopSmallIcon")}},{text:"小图标",func:function(){Deskpanel.desktopsContainer.addClass("desktopSmallIcon")}}]]}],[{text:"注销",func:function(){}}]];b.box.smartMenu(a,{name:"image"})}}}();Deskpanel=function(o){var p="<div id='desktopWrapper'></div>";var i="<div id='desktopsContainer' class='desktopsContainer'	>";var n="<div class='desktopContainer' index='{index}' >";var k="<div class='appListContainer' customacceptdrop='{index}' index='{index}' _olddisplay='block' >";var m=0,j=15,l={left:0,top:0,right:0,bottom:120};return o={init:function(b,a){o.create();o.addIcons(b);o.space(l);o.refresh(a);o.bindEvent();o.addCurrnet(m);return o},create:function(){o.box=$(p);o.desktopsContainer=$(i);o.createDesktopsContainer(j);o.box.append(o.desktopsContainer);o.box.css({left:"73px",right:"0px"});o.desktopsContainer.css("left",73);Desktop.addPanel(o.box);o.Icon=[]},bindEvent:function(){o.desktopsContainer.find(".appListContainer").each(function(){var b=$(this);var a=b.attr("index");b.sortable({items:".appButton",connectWith:".dock_middle",opacity:"0.6",start:function(d,c){},stop:function(e,d){var c=d.item.parent();if(c.hasClass("dock_middle")){d.item.removeAttr("style")}Deskpanel.switchCurrent(a);Deskpanel.refreshIcon()}}).disableSelection()});$(window).resize(o.refresh)},createDesktopsContainer:function(a){if(a&&a!=0){for(var b=1;b<=a;b++){o.desktopsContainer.append(o.addContainer(b))}}},addContainer:function(a){var c=o.createDesktopContainer(a);var b=o.createDesktopAppListener(a);c.append(b);return c},createDesktopContainer:function(a){return $(Util.formatmodel(n,{index:a-1}))},createDesktopAppListener:function(a){return $(Util.formatmodel(k,{index:a-1}))},addIcons:function(c){for(var a in c){var b=a.substring(a.length-1,a.length);o.addIcon(c[a],b)}},addIcon:function(c,b){if(c){if($.isArray(c)){$.each(c,function(){o.addIcon(this.valueOf(),b)});return o}var a=typeof c=="string"?appIcon_t1(c):c;o.Icon.push(a);o.box.find("div[customacceptdrop='"+parseInt(b-1)+"']").append(a.box)}},addCurrnet:function(a){o.desktopsContainer.find(".desktopContainer[index='"+a+"']").addClass("desktop_current")},removeCurrent:function(a){o.desktopsContainer.find(".desktopContainer[index='"+a+"']").removeClass("desktop_current")},switchCurrent:function(a){var b=o.desktopsContainer;b.find(".desktopContainer[index='"+a+"']").addClass("desktop_current").siblings().removeClass("desktop_current")},space:function(a){("top" in a)&&(typeof a.top=="string"?o.spaceTop+=a.top:o.spaceTop=+a.top||0);("left" in a)&&(typeof a.left=="string"?o.spaceLeft+=a.top:o.spaceLeft=+a.left||0);("right" in a)&&(typeof a.right=="string"?o.spaceRight+=a.top:o.spaceRight=+a.right||0);("bottom" in a)&&(typeof a.bottom=="string"?o.spaceBottom+=a.top:o.spaceBottom=+a.bottom||0);return o},refresh:function(c){var d=$(window).width(),b=$(window).height();o.width=d-o.spaceRight-o.spaceLeft;o.height=b-o.spaceTop-o.spaceBottom;var e=o.desktopsContainer.find(".desktopContainer");var f=e.find(".appListContainer");$(e).each(function(g){$(this).css({left:o.width*g,height:o.height-o.spaceBottom})});$("#zoomWallpaperGrid,#zoomWallpaper").width(d).height(b);var a=o.row=~~(o.height/112);o.desktopsContainer.css({left:o.spaceLeft,top:o.spaceTop,width:o.width,height:o.height});f.each(function(){$(this).css({width:o.width,height:o.height,"margin-left":28,"margin-top":46,display:"block"})});o.refreshIcon(c)},refreshIcon:function(b){var d=~~(o.height/112);var e=1;var c="";o.desktopsContainer.find(".appListContainer").each(function(){c+="Icon"+e+":";var h=$(this).children();for(var t=0;t<h.length;t++){var f=~~(t/d),g=t%d;$(h[t]).css({left:f*142,top:g*112});var s=$(h[t]).attr("id").replace("icon_app_","");s=s.substring(0,s.indexOf("_"));c+=s+"@"}c+="|";e++});if(!b){$.cookie(iconCookieKey,c,cookieParam);var a="";$("#dockContainer").find(".dock_middle").each(function(){var f=$(this).children();for(var h=0;h<f.length;h++){var g=$(f[h]).attr("id").replace("icon_app_","");g=g.substring(0,g.indexOf("_"));a+=g+"@"}});$.cookie(iconCookieKeyForSlider,a,cookieParam)}},moveIconTo:function(c,b){var a=(Panel.getIdx(c.box));if(idx>b){o.box.children(".appListContainer[index='1']").append(c.box,b)}else{if(idx<b){o.box.children(".appListContainer[index='1']").append(c.box,b+1)}}o.Icon.splice(idx,1);o.Icon.splice(b,0,c);o.refresh()},removeIcon:function(a){var b=(Panel.getIdx(a.box));o.Icon.splice(b,1);a.box.remove();o.refresh()},getIdx:function(a,b){a-=o.spaceLeft+o.spaceRight;b-=o.spaceTop+o.spaceBottom;return(~~(a/142))*o.row+(~~(b/112))}}}();Sidebar=function(h){var i="<div class='dock_tool_list' id='dockToolList' >";var j="<div class='dock_tool_item'></div>";var g="<a title='{title}' cmd='{cmd}'	class='dock_tool_icon dock_tool_{key}' href='###'></a>";var f=$.Class({init:function(a){this.create(a.location)},create:function(a){this.box=$("<div id='"+a+"Bar'></div>");Desktop.addPanel(this.box)},addPanel:function(a){this.box.append(a.pbox)}});return h={init:function(a){h.create(a.location);h.movePanel();h.addIcon(a.Icon);h.addToolList();h.initDrag()},create:function(a){h.leftPanel=f({location:"left"});h.rightPanel=f({location:"right"});h.topPanel=f({location:"top"});h.box=$('<div class="dock_middle"></div>');h.pbox=$('<div id="dockContainer" class="dock_container " style="z-index: 10;"> </div>');h[a+"Panel"].addPanel(h.pbox);h.location=a;h.Icon=[];h.pbox.addClass("dock_pos_"+a);h.pbox.append(h.box);h.leftPanel.box.append(h.pbox);Desktop.addPanel(h.leftPanel.box);Desktop.addPanel(h.rightPanel.box);Desktop.addPanel(h.topPanel.box);h.createStartTool();h.createPinyinTool();h.createSoundTool();h.createSettingTool();h.createThemeTool()},movePanel:function(){dockEffectBox.init();h.pbox.bind("mousedown",function(k){if($(k.target).css("cursor")=="pointer"){return}$(document).bind({mousemove:e,mouseup:a});k.preventDefault();k.stopPropagation()});var l=0,d,b,c;function e(o){Panel.unSelecte();if(!l){l=1;d=Desktop.box.outerWidth();b=Desktop.box.outerHeight();dockEffectBox.show()}var p=o.pageX;var k=o.pageY;if(k<b*0.2){c="top"}else{if(p<d*0.5){c="left"}else{c="right"}}}function a(){$(document).unbind("mousemove",e).unbind("mouseup",a);l=0;dockEffectBox.hide();h[c+"Panel"].addPanel(h);h.location=c;h.addStyle();Deskpanel.refreshIcon()}},addToolList:function(){var b=$(i);var c=$(j);var d=$(j);var a=$(j);c.append(h.pinyin).append(h.sound);d.append(h.settingtool).append(h.theme);a.append(h.start);b.append(c).append(d).append(a);h.box.append(b)},createStartTool:function(){h.start=$("<a title='点击这里开始' class='dock_tool_icon dock_tool_start'	href='javascript:void(0);'></a>");h.start.powerFloat({eventType:"click",offsets:{x:a,y:-100},target:$("#startMenuContainer")});function a(){var c=h.pbox.parent();var b=c.attr("id");var d=b.substring(0,b.length-3);if(d=="left"){if(c.css("height").replace("px","")<=825){return -60}else{return 60}}else{if(d=="top"){return 0}else{return 60}}}},createPinyinTool:function(){h.pinyin=$(Util.formatmodel(g,{cmd:"Pinyin",title:"输入法",key:"pinyin"}))},createSoundTool:function(){var a=h.sound=$(Util.formatmodel(g,{cmd:"Sound",title:"静音",key:"sound"}));a.toggle(function(){$(this).addClass("dock_tool_sound_mute").attr("title","取消静音")},function(){$(this).removeClass("dock_tool_sound_mute").attr("titile","静音")})},createSettingTool:function(){h.settingtool=$(Util.formatmodel(g,{cmd:"Setting",title:"系统设置",key:"setting"}))},createThemeTool:function(){var a=h.theme=$(Util.formatmodel(g,{cmd:"Theme",title:"主题设置",key:"theme"}));h.bindTheme()},bindTheme:function(){var a=$("#themeSetting_wrap");h.theme.click(function(){Windows.openSys({id:"themSetting",title:"设置主题",width:650,height:500,content:document.getElementById("themeSetting_wrap")})});$("a",a).live("click",function(){var d=$(this);var e=d.attr("themeid");var l=e.substring(e.indexOf("_")+1,e.length);var c=$(window).height();var b=$(window).width();$("#zoomWallpaper").attr("src","plug-in/sliding/images/bg/"+l+".jpg").width(b).height(c);$.cookie("myskin","plug-in/sliding/images/bg/"+l+".jpg",cookieParam);$("#zoomWallpaperGrid").width(b).height(c);$("a",a).removeClass("themeSetting_selected");d.addClass("themeSetting_selected")})},addIcon:function(d,b){if(d){if($.isArray(d)){$.each(d,function(){h.addIcon(this.valueOf())});return h}if(h.Icon.length==6){var c=h.Icon[5];h.Icon.length=6;$(c.box).remove();return}var a=typeof d=="string"?appIcon_t2(d):d;if(b!=undefined){h.Icon.splice(b,0,a);h.box.append(a.box,b)}else{h.Icon.push(a);h.box.append(a.box)}}},removeIcon:function(a){var b=(Panel.getIdx(a.box));h.Icon.splice(b,1);$(a.box).remove()},getIdx:function(a,b){var c=h.pbox.offset();switch(h.location){case"top":return ~~((a-c.left)/142);case"left":case"right":return ~~((b-c.top)/112)}},addStyle:function(){h.pbox.removeClass().addClass("dock_container dock_pos_"+h.location);switch(h.location){case"top":h.topPanel.box.css({width:"100%",height:"73px"}).show();h.leftPanel.box.css({width:"0",height:"0"}).hide();h.rightPanel.box.css({width:"0%",height:"0"}).hide();Deskpanel.box.css({left:0,right:0});Deskpanel.desktopsContainer.css("top",73);break;case"left":h.leftPanel.box.css({width:"73px",height:"100%"}).show();h.topPanel.box.css({width:"0",height:"0"}).hide();h.rightPanel.box.css({width:"0%",height:"0"}).hide();Deskpanel.box.css({left:"73px",right:"0px"});Deskpanel.desktopsContainer.css("left",73);break;case"right":h.rightPanel.box.css({width:"73px",height:"100%"}).show();h.leftPanel.box.css({width:"0",height:"0"}).hide();h.topPanel.box.css({width:"0",height:"0"}).hide();Deskpanel.box.css({left:0,right:73});Deskpanel.desktopsContainer.css("top",0);break}},initDrag:function(){var a=Deskpanel.desktopsContainer.find(".appListContainer");h.box.sortable({connectWith:a,items:".appButton",opacity:"0.6",scroll:true,start:function(b,c){},stop:function(c,b){var d=b.item;var e=d.parent();if(e.hasClass("appListContainer")){d.css("position","absolute")}Deskpanel.refreshIcon()}}).disableSelection()}}}();Navbar=function(p){var q="<div  id='navbar' class='no_sysbtn' ></div>";var o="<div class='indicator_container nav_current_{index}'	id='indicatorContainer'></div>";var m="<div class='indicator indicator_header' id='navbarHeaderImg' cmd='user' title='{title}'><img src='{url}' alt='{title}' class='indicator_header_img' ></div>";var k="<a class='indicator indicator_{num}' href='###' cmd='switch' index='{index}'	title='{name}'><span class='indicator_icon_bg'></span><span class='indicatorhover indicator_icon_{num}'>{num}</span></a>";var s="<a class='indicator indicator_{key}' href='###' cmd='{key}' title='{title}'></a>";var r=totalnum+1,l=1,n="请登录",t="plug-in/sliding/images/jeecg.png";return p={init:function(){p.create();p.bindEvent();p.setPosition()},bindEvent:function(){p.innerbox.find("a[cmd='switch']").click(function(){var d=$(this);var a=d.attr("cmd[switch]");var e=$.trim(p.innerbox.attr("class"));var b=parseInt(e.substring(e.lastIndexOf("_")+1));var c=parseInt(d.attr("index"));p.bindSwitchDesktopAnimate(c,b);p.innerbox.removeClass().addClass("indicator_container nav_current_"+parseInt(c+1))});p.box.draggable()},bindSwitchDesktopAnimate:function(a,d){var e=0;var d=parseInt(d-1);if(a<d){e=-2000}else{e=2000}var c=Deskpanel.desktopsContainer.find(".desktopContainer[index="+d+"]");c.removeClass("desktop_current");c.stop().animate({left:e},"normal",function(){});var b=Deskpanel.desktopsContainer.find(".desktopContainer[index="+a+"]");b.removeClass("desktop_current").addClass("desktop_current");b.stop().animate({left:0},"normal",function(){})},create:function(){p.box=$(q);p.box.append("<div class='indicator_wrapper'></div>");p.box.find(".indicator_wrapper").append(p.createInnerbox());Desktop.addPanel(p.box)},createInnerbox:function(){var a=p.innerbox=$(Util.formatmodel(o,{index:l}));a.append(p.createUser());p.createIndicator();a.append(p.createSearch());a.append(p.createManage());return a},createUser:function(){var a=p.userbox=$(Util.formatmodel(m,{url:t,title:n}));a.click(function(){alert("It's  xiaofan ")});return a},createIndicator:function(){var a=0;$.each(menujson,function(c,b){var d=Util.formatmodel(k,{num:a+1,id:b.id,index:a,name:b.name});a++;p.innerbox.append(d)})},createSearch:function(){var d=p.search=$(Util.formatmodel(s,{key:"search",title:"搜索"}));var h=$("<div class='pagelet_search_bar' style='display: none; '></div>");var a=$("<input>",{"class":"pagelet_search_input",value:"搜索功能模块和应用..."});var g=$("<input>",{id:"pageletSearchButton","class":"pagelet_search_button",title:"搜索..."});var b=$("<div class='pagelet_search_suggest' id='pagelet_search_suggest'style='display: none;' ></div>");var i=$("<ul id='sb_resultBox'  style='display: block;'></ul>");var e=$("<div idx='-1' class='sb_resultList fsb_resultList sb_page'><a href='#'><span class='sb_pageTxt'><span id='sb_resultBox_key' class='sb_resultBox_key'>s</span>-在“百度”搜索...</span></a>  </div>");var f=$("<div idx='-2' class='sb_resultList fsb_resultList sb_app'><a href='#'><span class='sb_appTxt'><span id='sb_resultBox_key'  class='sb_resultBox_key'>s</span>-去系统应用搜搜...</span></a></div>");b.append(i).append(e).append(f);h.append(a).append(g);Body.addPanel(h);Body.addPanel(b);d.powerFloat({width:h.width(),eventType:"click",offsets:{x:5,y:20},position:"3-1",target:h,showCall:function(){var j=h.offset();b.offset({top:j.top+32,left:j.left})}});a.focus(function(){$(this).val("")}).blur(function(){c();var j=$(this).val();$(this).val("搜索功能模块和应用...");$(".fsb_resultList").show()}).keyup(function(){var j=$(this);var v=j.val();$(".sb_resultBox_key").html(v);if(v=="o"){$("#sb_resultBox").append("<li class='sb_resultList' idx='2232'><a href='#' title='owlhr'><div class='listInner'>新奥尔</div></a></li>").show();b.show()}if(v==""){b.hide()}});var c=function(){var j=a.val();if(j==""){b.hide()}else{b.show()}};return d},createManage:function(){var a=p.manage=$(Util.formatmodel(s,{key:"manage",title:"全局视图"}));a.click(function(){if(appManagerPanel){appManagerPanel.show();appManagerPanel.showItemsTurn();appManagerPanel.resize();Desktop.hide()}});return a},setPosition:function(){var b=$(window).width();var a=p.box.width();p.box.css("left",parseInt(b/2)-parseInt(a/2))}}}();appManagerPanel=function(n){var r="<div id='appManagerPanel' class='appManagerPanel' style='display: none; '></div>";var l="<a class='aMg_close' href='###'></a>";var k="<div class='aMg_dock_container' index='{totalnum}' customacceptdrop='1'></div>";var q="<div class='aMg_line_x'></div>";var s="<div class='aMg_line_y'></div>";var p="<div class='aMg_folder_container'></div>";var m="<div class='folderItem'><div class='folder_bg folder_bg{key}'></div><div class='folderOuter' index='{index}' customacceptdrop='{key}'></div></div>";var o="<div class='folderInner' style='height: 90%; overflow-x: hidden; overflow-y: hidden; ' index='{index}' customacceptdrop='{key}'></div>";var t="<div class='scrollBar' style='margin-top: 0px; height: 0px; display: none;' _olddisplay='block'></div>";return n={init:function(){n.create();n.bindEvent();n.resize()},create:function(){n.box=$(r);n.aMg_close=$(l);n.box.append(n.aMg_close).append(n.cSidebarApp()).append(q).append(n.cDeskApp());Body.addPanel(n.box)},cSidebarApp:function(){n.aMg_dock_container=$(k);n.loadSidebarData();return n.aMg_dock_container},loadSidebarData:function(){var a=Sidebar.box.find(".appButton").clone().appendTo(n.aMg_dock_container)},cDeskApp:function(){n.aMg_App_container=$(p);n.loadDeskData();return n.aMg_App_container},loadDeskData:function(){Deskpanel.desktopsContainer.find(".appListContainer").each(function(){var d=$(this);var e=parseInt(d.attr("index"));var a=$(Util.formatmodel(m,{index:e,key:e+1}));var c=$(Util.formatmodel(o,{index:e,key:e+1}));var b=a.find(".folderOuter");d.children().each(function(){c.append(appIcon_amg1($(this).attr("fid")).box)});b.append(c);b.append(t);if(e!=0){b.after(s)}n.aMg_App_container.append(a)})},bindEvent:function(){var b=$(".folderItem",n.box);n.aMg_close.click(function(){n.hide();b.removeClass("folderItem_turn");Desktop.show()});var a=b.find(".folderInner");a.sortable({items:".appButton",connectWith:[a,n.aMg_dock_container],opacity:"0.6",stop:function(c,f){var d=f.item;var e=d.parent();if(d.parent().hasClass("aMg_dock_container")){d.removeClass("amg_folder_appbutton")}}}).disableSelection();n.aMg_dock_container.sortable({items:".appButton",connectWith:".folderInner",opacity:"0.6",stop:function(e,d){a=d.item;var c=a.parent();if(c.hasClass("folderInner")){a.addClass("amg_folder_appbutton")}}}).disableSelection()},showItemsTurn:function(){$(".folderItem",n.box).show().addClass("folderItem_turn")},show:function(){n.box.show()},hide:function(){n.box.hide()},resize:function(){var a=$(window).height()-60;n.aMg_App_container.height(a)}}}();dockEffectBox=function(j){var h="<div id='docktop' class='dock_drap_effect dock_drap_effect_top ' style='display: none;' _olddisplay='block'></div>";var g="<div id='dockleft' class='dock_drap_effect dock_drap_effect_left' style='display: none;'></div>";var k="<div id='dockright' class='dock_drap_effect dock_drap_effect_right' style='display: none;'></div>";var i="<div class='dock_drap_proxy' style='display: none; left: -79px; top: -260px;'></div>";var l="<div id='dockmask' class='dock_drap_mask' style='display: none;'><div class='dock_drop_region_top' cmd='region'name='top'></div><div class='dock_drop_region_left' cmd='region' name='left'></div><div class='dock_drop_region_right' cmd='region' name='right'></div></div>";return j={init:function(){j.create()},create:function(){j.tbox=$(h);j.lbox=$(g);j.rbox=$(k);j.proxybox=$(i);j.maskbox=$(l);j.addDesktop()},addDesktop:function(){Desktop.addPanel(j.tbox);Desktop.addPanel(j.lbox);Desktop.addPanel(j.rbox);Desktop.addPanel(j.proxybox);Desktop.addPanel(j.maskbox)},show:function(){j.tbox.show();j.lbox.show();j.rbox.show();j.maskbox.show()},hide:function(){j.tbox.hide();j.lbox.hide();j.rbox.hide();j.maskbox.hide()}}}();BottomBar=function(m){var l="<div id='bottomBar' class='bottomBar' style='z-index: 12;'></div>";var k="<div id='taskNextBox' class='taskNextBox' _olddisplay='' style='display: none;'><a id='taskNext' class='taskNext' hidefocus='true' href='#'></a></div>";var j="<div id='taskPreBox' class='taskPreBox' _olddisplay='' style='display: none;'><a id='taskPre' class='taskPre' hidefocus='true' href='#'></a></div>";var n="<div id='taskContainer' class='taskContainer' style=''></div>";var i="<div class='bottomBarBg'></div>";var h="<div class='bottomBarBgTask'></div>";return m={init:function(){m.create();Desktop.addPanel(m.box);Desktop.addPanel(i);Desktop.addPanel(h)},create:function(){var a=m.box=$(l);m.innerbox=$("<div id='taskContainerInner' class='taskContainerInner' style=''></div>");m.taskContainner=$(n);m.taskContainner.append(m.innerbox);a.append(k);a.append(m.taskContainner);a.append(j)},addItem:function(d){m.innerbox.append(d);var b=m.innerbox.children().length;var c=d.attr("id");var a=d.width()*b+20;m.taskContainner.width(a);m.innerbox.css({"margin-right":0,width:(a)});m.setCurrent(c)},getItem:function(a){return m.innerbox.find("a[tid='"+a+"']")},getItemNum:function(){return m.innerbox.children().size()},setCurrent:function(a){m.addCurrent(a);m.removeItemSibling(a)},addCurrent:function(a){m.innerbox.find("#"+a).addClass("taskCurrent")},removeItemSibling:function(a){m.innerbox.find("#"+a).siblings().removeClass("taskCurrent")},getALLItemID:function(){var b=m.innerbox.children();var a=[];b.each(function(){var c=$(this).attr("id");c=c.substring(c.lastIndexOf("_")+1,c.length);a.push(c)});return a}}}();Task=$.Class({init:function(b){this.create(b);this.rightMenu()},create:function(g){var l=$("<div>",{"class":"taskGroup taskGroupAnaWidth",id:"taskGroup_"+g.id+"_"+g.id});var i=$("<div>",{"class":"taskItemIcon"});$("<img src='plug-in/sliding/icon/"+g.icon+"'/><div class='taskItemIconState'></div>").appendTo(i);var h=$("<div>",{"class":"taskItemTxt",text:g.title});var k=$("<div>",{"class":"taskItemBox",});var j=$("<a>",{"class":"taskItem fistTaskItem",href:"#",id:"taskItem_"+g.id,title:g.title,tid:g.id,appid:g.id+"_"+g.id});j.append(i).append(h);k.append(j);l.append(k);this.box=l},rightMenu:function(){var b=[[{text:"最大化",func:function(){var a=$(this).attr("id");wid=a.substring(a.lastIndexOf("_")+1,a.length);$.dialog.list[wid].show().max()}},{text:"最小化",func:function(){}}],[{text:"关闭",func:function(){var a=$(this).attr("id");wid=a.substring(a.lastIndexOf("_")+1,a.length);$.dialog.list[wid].close();$("#"+a).remove()}}]];this.box.smartMenu(b,{name:"taskmenu",offsetX:-100,offsetY:-100})}});Windows=function(b){return b={showWindow:function(n){var o=$.dialog.list;var m=BottomBar.getALLItemID();var a=m.length;var j=o[n];function k(){var e=null;for(var c in $.dialog.list){c=$.dialog.list[c];var d=c.DOM.wrap;var f=$(d);if(f.css("visibility")=="visible"){if(e==null){e=c}else{e=f[0].style.zIndex>e.DOM.wrap[0].style.zIndex?c:e}}}if(e){$.dialog.focus.DOM.border.removeClass("ui_state_focus");$.dialog.focus=e;e.DOM.border.addClass("ui_state_focus")}}var l=j.DOM.wrap;var p=$(l);if(a>1){if(p.css("visibility")=="hidden"){j.show().zindex()}else{if(!j.DOM.border.hasClass("ui_state_focus")){j.zindex()}else{j.hide();k()}}}else{if(p.css("visibility")=="visible"){j.hide()}else{j.show()}}},hideWindow:function(a){$.dialog.list[a].hide()},closeMinTask:function(a){$("#taskGroup_"+a+"_"+a).remove()},closeAllWindow:function(){var d=$.dialog.list;for(var a in d){d[a].close()}},openSys:function(a){$.dialog({id:a.id,title:a.title,width:a.width,height:a.height,max:false,min:false,content:a.content})},openApp:function(s,n,t,o,r,l){var m=BottomBar.innerbox;var a=BottomBar.getItem(s);if(a.length==1){return}else{var p=BottomBar.getItemNum();if(p>7&&p!=0){return false}var q=Task({id:s,title:n,icon:o});BottomBar.addItem(q.box);q.box.click(function(){b.showWindow(s);BottomBar.setCurrent(q.box.attr("id"))});$.dialog({id:s,lock:false,zIndex:1000+getDialogLength(),width:r,height:l,title:n,opacity:0.3,min:false,content:"url:"+t,close:function(){b.closeMinTask(s)}}).zindex()}}}}();function getDialogLength(){var c=0;for(var d in $.dialog.list){c++}return c}appIcon_amg=$.Class({create:function(b){this.box=$("<div  type='"+b+"'  class='appButton amg_folder_appbutton' ></div>")}});appIcon_t0=$.Class({create:function(b){this.box=$("<div type='"+b+"'  class='appButton'></div>");this.setRightMenu()},setRightMenu:function(){}});appIcon_amg1=appIcon_amg.extend({init:function(b){this.fid=b;this.app=datajson.app[b];this.tx="app";this.create();this.bindEvent()},create:function(){this._super(1);this.box.attr({id:"icon_app_"+this.app.appid+"_"+this.app.asc,appid:this.app.appid,fileid:this.app.appid,title:this.app.name,url:this.app.url,uid:"app_"+this.app.appid});var i=$("<div>",{id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_icon_div","class":"appButton_appIcon"});i.append($("<img>",{alt:this.app.name,src:this.app.icon,"class":"appButton_appIconImg",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_img"}));var k=$("<div class='appButton_appName'></div>");var l=$("<div>",{"class":"appButton_appName_inner",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_name",text:this.app.name});var j=$("<div class='appButton_appName_inner_right'></div>");k.append(l).append(j);var g=$("<div>",{"class":"appButton_notify",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_notify",});$("<span class='appButton_notify_inner'></span>").appendTo(g);var h=$("<div>",{title:"卸载应用",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_delete","class":"appButton_delete"});this.box.append(i).append(k).append(g).append(h)},bindEvent:function(){this.box.click(function(j){j.preventDefault();j.stopPropagation();var e=$(this);var h=e.attr("appid");var i=$.trim(e.text());var l=e.attr("url");var k=e.find("img").attr("src").split("/")[3];Windows.openApp(h,i,l,k,1000,500);appManagerPanel.hide();Desktop.show()})}});appIcon_t1=appIcon_t0.extend({init:function(b){this.fid=b;this.app=datajson.app[b];this.tx=1;this.create(b);this.bindEvent()},create:function(k){this._super(1);this.box.attr({id:"icon_app_"+this.app.appid+"_"+this.app.asc,appid:this.app.appid,fileid:this.app.appid,title:this.app.name,uid:"app_"+this.app.appid,fid:k,url:this.app.url});var n=$("<div>",{id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_icon_div","class":"appButton_appIcon"});n.append($("<img>",{alt:this.app.name,src:this.app.icon,"class":"appButton_appIconImg",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_img"}));var i=$("<div class='appButton_appName'></div>");var j=$("<div>",{"class":"appButton_appName_inner",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_name",text:this.app.name});var h=$("<div class='appButton_appName_inner_right'></div>");i.append(j).append(h);var l=$("<div>",{"class":"appButton_notify",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_notify"});$("<span class='appButton_notify_inner'></span>").appendTo(l);var m=$("<div>",{title:"卸载应用",id:"icon_app_"+this.app.appid+"_"+this.app.asc+"_delete","class":"appButton_delete"});this.box.append(n).append(i).append(l).append(m)},bindEvent:function(){this.box.click(function(j){j.preventDefault();j.stopPropagation();var e=$(this);var h=e.attr("appid");var i=$.trim(e.text());var l=e.attr("url");var k=e.find("img").attr("src").split("/")[3];Windows.openApp(h,i,l,k,1400,600)})}});appIcon_t2=appIcon_t0.extend({init:function(b){this.fid=b;this.sApp=DATA.sApp[b];this.tx=2;this.create();this.bindEvent()},create:function(){this._super(2);this.box.attr({id:"icon_app_"+this.sApp.appid+"_"+this.sApp.asc,appid:this.sApp.appid,fileid:this.sApp.appid,title:this.sApp.name,uid:"app_"+this.sApp.appid,url:this.sApp.url});var i=$("<div>",{id:"icon_app_"+this.sApp.appid+"_"+this.sApp.asc+"_icon_div","class":"appButton_appIcon"});i.append($("<img>",{alt:this.sApp.name,src:this.sApp.icon,"class":"appButton_appIconImg",id:"icon_app_"+this.sApp.appid+"_"+this.sApp.asc+"_img"}));var f=$("<div class='appButton_appName'></div>");var g=$("<div>",{"class":"appButton_appName_inner",id:"icon_app_"+this.sApp.appid+"_"+this.sApp.asc+"_name",text:this.sApp.name});var j=$("<div class='appButton_appName_inner_right'></div>");f.append(g).append(j);var h=$("<div",{title:"卸载应用",id:"icon_app_"+this.sApp.appid+"_"+this.sApp.asc+"_delete","class":"appButton_delete"});this.box.append(i).append(f).append(h)},bindEvent:function(){this.box.click(function(j){j.preventDefault();j.stopPropagation();var e=$(this);var h=e.attr("appid");var i=$.trim(e.text());var l=e.attr("url");var k=e.find("img").attr("src").split("/")[3];Windows.openApp(h,i,l,k,1000,500)})}});$(function(){Body.init();Desktop.init();Deskpanel.init(iconjson,true);Sidebar.init({location:"left",Icon:defaultIconForSlider});Navbar.init();BottomBar.init();appManagerPanel.init()});$(function(){$(".fsb_resultList").live("click",function(){var a=$(this).attr("idx");var d=$(this).find(".sb_resultBox_key").html();if(a=="-1"){Windows.openApp("","百度搜索","http://www.baidu.com/s?tn=13081079_1_pg&ie=utf-8&bs=fda&f=8&rsv_bp=1&rsv_spt=1&wd="+d,"default.png",1000,500)}else{if(a=="-2"){Windows.openApp("","应用搜索","functionController.do?searchApp&name="+d,"default.png",800,400)}}$(".fsb_resultList").hide()});var b=$.cookie("myskin");if(b){$("#zoomWallpaper").attr("src",b);$.cookie("myskin",b,cookieParam)}});