var Module={modules:new Array(),addModule:function(module){this.modules[this.modules.length]=module},clearModule:function(){this.modules=new Array()},delModule:function(module){var newModules=new Array();var j=0;for(var i=0;i<this.modules.length;i++){if(this.modules[i].id!=module.id)newModules[j++]=this.modules[i]}this.modules=newModules},initModule:function(){this.clearModule();var moduleTmpArray=initModulesList.split("#");for(var i=0;i<moduleTmpArray.length;i++){var moduleId=moduleTmpArray[i].split("@")[0];var moduleName=moduleTmpArray[i].split("@")[1];var moduleType=moduleTmpArray[i].split("@")[2];var module=new Object();module.id=moduleId;module.name=moduleName;module.type=moduleType;module.dataStr="";module.num=i;module.style="operation";module.flag=false;Module.addModule(module)}},editModule:function(module){for(var i=0;i<this.modules.length;i++){if(this.modules[i].id==module.id){this.modules[i].flag=module.flag;break}}},editModuleName:function(module){for(var i=0;i<this.modules.length;i++){if(this.modules[i].id==module.id){this.modules[i].name=module.name;this.modules[i].dataStr=module.dataStr;break}}},getXMLModulesList:function(xmlDoc){if(xmlDoc==null){return""}var saveUserModulesTmpStr="";for(var i=0;i<3;i++){var modelList=new Array();modelList=getModelListByDiv(xmlDoc,i);for(var j=0;j<modelList.length;j++){try{saveUserModulesTmpStr+=modelList[j].id+"#"}catch(e){}}}modelList=null;saveUserModulesTmpStr=saveUserModulesTmpStr.substring(0,saveUserModulesTmpStr.length-1);return saveUserModulesTmpStr},getCurrModulesListBySaveStr:function(){var modelList=new Array();modelList=saveUserModules.split("#");return modelList},getModuleStr:function(){var str="<table width='80%'>";for(var i=0;i<this.modules.length;i++){if(this.modules[i].flag){str+='<tr nowrap height="20px"><td algin="left" style="magrin-left:10px;">'+this.modules[i].name+'<td><td algin="right" width="30px" style="margin-right:10px;">&nbsp;</td><tr>'}else{if(isIE){str+='<tr height="20px"><td nowrap algin="left" style="magrin-left:10px;">'+this.modules[i].name+'<td><td width="30px" algin="right" style="margin-right:10px;"><span onclick="add(\''+this.modules[i].id+'\',\''+this.modules[i].name+'\',null)" style="cursor:hand;">添加</span></td><tr>'}else{str+='<tr height="20px"><td nowrap algin="left" style="magrin-left:10px;">'+this.modules[i].name+'<td><td width="30px" align="right" style="margin-right:10px;"><a href="javascript:void(0);" onclick="add(\''+this.modules[i].id+'\',\''+this.modules[i].name+'\',null)">添加</a></td><tr>'}}}str+='</table>';return str},setMenuModuleStr:function(){var urlMenuListObj=document.getElementById("urlMenuList");var toolsMenuListObj=document.getElementById("toolsMenuList");var newsMenuListObj=document.getElementById("newsMenuList");var joyMenuListObj=document.getElementById("joyMenuList");var hotMenuListObj=document.getElementById("hotMenuList");var otherMenuListObj=document.getElementById("otherMenuList");var frameMemuListObj=document.getElementById("frameMemuList");var cssMemuListObj=document.getElementById("cssMemuList");var titleStr="";var urlStr="";var onlineStr="";var toolsStr="";var normalStr="";var otherStr="";var newsStr="";var urlUnStr="";var titleUnStr="";var onlineUnStr="";var toolsUnStr="";var normalUnStr="";var otherUnStr="";var newsUnStr="";for(var i=0;i<this.modules.length;i++){if(this.modules[i].type=="img"||this.modules[i].type=="node"||this.modules[i].type=="music"||this.modules[i].type=="flv"){if(this.modules[i].flag){onlineStr+=this.getMenuModuleStr(this.modules[i])}else{onlineUnStr+=this.getMenuModuleStr(this.modules[i])}}else if(this.modules[i].type=="normal"){if(this.modules[i].flag){normalStr+=this.getMenuModuleStr(this.modules[i])}else{normalUnStr+=this.getMenuModuleStr(this.modules[i])}}else if(this.modules[i].type=="url"||this.modules[i].type=="u88"){if(this.modules[i].flag){urlStr+=this.getMenuModuleStr(this.modules[i])}else{urlUnStr+=this.getMenuModuleStr(this.modules[i])}}else if(this.modules[i].type=="news"){if(this.modules[i].flag){newsStr+=this.getMenuModuleStr(this.modules[i])}else{newsUnStr+=this.getMenuModuleStr(this.modules[i])}}else if(this.modules[i].type=="title"){if(this.modules[i].flag){titleStr+=this.getMenuModuleStrs(this.modules[i])}else{titleUnStr+=this.getMenuModuleStrs(this.modules[i])}}else{if(this.modules[i].flag){toolsStr+=this.getMenuModuleStr(this.modules[i])}else{toolsUnStr+=this.getMenuModuleStr(this.modules[i])}}}urlStr="<table class='lanmuNrtable'>\n\r"+urlUnStr+"\n\r"+urlStr+"\n\r</table>\n\r";onlineStr="<table class='lanmuNrtable'>\n\r"+onlineUnStr+"\n\r"+onlineStr+"\n\r</table>\n\r";toolsStr="<table class='lanmuNrtable'>\n\r"+titleStr+"\n\r"+titleUnStr+"\n\r"+toolsUnStr+"\n\r"+toolsStr+"\n\r</table>\n\r";normalStr="<table class='lanmuNrtable'>\n\r"+normalUnStr+"\n\r"+normalStr+"\n\r</table>\n\r";newsStr="<table class='lanmuNrtable'>\n\r"+newsUnStr+"\n\r"+newsStr+"\n\r</table>\n\r";urlMenuListObj.innerHTML=urlStr;toolsMenuListObj.innerHTML=toolsStr;newsMenuListObj.innerHTML=newsStr;joyMenuListObj.innerHTML=onlineStr;hotMenuListObj.innerHTML=normalStr;frameMemuListObj.innerHTML=Skin.getFrameStr();cssMemuListObj.innerHTML=Skin.getTemplateStr()},getMenuModuleStr:function(module){var tmpStr="";if(module.flag){tmpStr="<tr>\n\r<td class=\"functionTa\">\n\r<span title=\"已添加\">"+module.name.substring(0,7)+"</span>\n\r</td>\n\r</tr>\n\r"}else{tmpStr="<tr>\n\r<td>\n\r<span class='s-cursor' title=\"可添加\" onclick=\"add('"+module.id+"','"+module.name+"',null)\"> "+module.name.substring(0,7)+"</span>\n\r</td>\n\r</tr>\n\r"}return tmpStr},getMenuModuleStrs:function(module){var tmpStr="";tmpStr="<tr>\n\r<td class=\"functionTa\" id=\"titleFunctionTa\">\n\r<span onclick='showTitle()'>"+module.name+"</span>\n\r</td>\n\r</tr>\n\r"return tmpStr},getModuleObjById:function(moduleId){var modelObj=null;for(var i=0;i<this.modules.length;i++){if(this.modules[i].id==moduleId){modelObj=this.modules[i];break}}return modelObj},getModuleObjByNum:function(num){var modelObj=new Object();for(var i=0;i<this.modules.length;i++){if(this.modules[i].num==num){modelObj=this.modules[i];break}}return modelObj},setModuleStatByDiv:function(divObj){if(!isChangeStyle){return false}resetAllDivStyle("operation")},matchModule:function(){var len=Module.modules.length;var linkNum=0;for(var i=0;i<len;i++){if(Module.modules[i].type=="link"){Data.moduleIdList[Data.moduleIdList.length]=Module.modules[i].id;Module.modules[i].dataStr="linkArray"+linkNum;linkNum++}}},getModuleArrayStr:function(id){var moduleObj=this.getModuleObjById(id);return moduleObj.dataStr},getModuleDataById:function(moduleId){var modelObj=null;for(var i=0;i<this.modules.length;i++){if(this.modules[i].id==moduleId){modelObj=this.modules[i].dataStr;break}}return modelObj},getModuleToolsBarStr:function(id){var toolBarStr="";var modelType=this.getModuleObjById(id).type;if(id.search("news_")!=-1){modelType="news"}switch(modelType){case'link':toolBarStr=this.getNormalToolBarStr();break;case'news':toolBarStr=this.getNewslToolBarStr(id);break;case'normal':toolBarStr=this.getNormallToolBarStr(id);break;case'wmp':toolBarStr=this.getWmpToolBarStr();break;case'music':toolBarStr=this.getMusicToolBarStr();break;case'tools':toolBarStr=this.getNormalToolBarStr();break;case'myFavorite':toolBarStr=this.getMyFavoriteToolBarStr();break;case'u88':toolBarStr=this.getNormalToolBarStr();break;default:toolBarStr=this.getNormalToolBarStr();break}return toolBarStr},getModuleStrById:function(id){var modelStr="";var modelType=this.getModuleObjById(id).type;if(id.search("news_")!=-1){modelType="news"}switch(modelType){case'myFavorite':modelStr=this.getMyFavoriteModuleStr(id);break;case'url':modelStr=this.getNormalModuleStr(id);break;case'news':modelStr=this.getNewsModuleStr(id);break;case'tools':modelStr=this.getNormalModuleStr(id);break;case'normal':modelStr=this.getNormalModuleStr(id);break;case'wmp':modelStr=this.getMediaPlayerModuleStr();break;case'music':modelStr=this.getMusicPlayerModuleStr();break;case'flv':modelStr=this.getFlvPlayerModuleStr();break;case'img':modelStr=this.getImgPlayerModuleStr();break;case'node':modelStr=this.getNodePlayerModuleStr();break;case'public':modelStr=this.getPublicModuleStr();break;case'world':modelStr=this.getWorldModuleStr();break;case'u88':modelStr=this.getNormalModuleStr(id);break;case'bbsBestShow':modelStr=this.getBbsBestShowModuleStr(id);break;default:modelStr=this.getNewsModuleStr(id);break}return modelStr}}