
loadPage=function(){//页面加载, 初始化菜单和工具栏
	loadBodyclick();
	writeFettleLeft(" 提示:在回收站可以找到被删除的内容");
	
	menu.addMain("新建","","建立新的文件或文件夹");
	menu.addMain("修改","","修改栏目和文章,\n如权限,积分规则等");
	menu.addMain("内容","","您要看什么内容");
	menu.addMain("查看","","图标显示方式");
	menu.addMain("排序","","");
	menu.addMain("工具","","");
	menu.addMain("帮助","",null);
	
	menu.addMenu(0,"建立栏目","myWeb.createMenu()","建立一个新的栏目,\n在这个版本中,栏目也称文件夹")
	menu.addMenu(0,"发布信息","myWeb.createData()","新增数据,文章等")

	menu.addMenu(1,"修改栏目","myWeb.modiMenu()","修改栏目的属性")
	menu.addMenu(1,"修改文件","myWeb.modiData()","修改文件的数据")
	menu.addMenu(1,"文件属性","myWeb.setFile()", "设置文件的属性")
	
	

	menu.addMenu(2,"全部","myWeb.setVision('all')",null)
	menu.addMenu(2,"只显示精华","myWeb.setVision('IsEssence')",null)
	menu.addMenu(2,"只显示置顶","myWeb.setVision('top')",null)
	menu.addMenu(2,"只显示隐藏","myWeb.setVision('Hidden')",null)
	menu.addMenu(2,"只显示未审核","myWeb.setVision('ExamineNo')",null)
	menu.addMenu(2,"只显示已审核","myWeb.setVision('Examine')",null)


	menu.addMenu(3,"大图标","maxIco()",null)
	menu.addMenu(3,"小图标","minIco()",null)
	menu.addMenu(3,"详细资料","listIco()",null)
	menu.addMenu(3,"表格","tabIco()",null)
	menu.addMenu(3,"略图","imgIco()",null)
	

	menu.addMenu(4,"按ID升序","order('mid','')",null)
	menu.addMenu(4,"按ID降序","order('mid',' desc')",null)
	menu.addMenu(4,"按更新时间升序","order('mDate','')",null)
	menu.addMenu(4,"按更新时间降序","order('mDate',' desc')",null)
	menu.addMenu(4,"按名称升序","order('mName','')","按名称排序效率不高,不建议使用")
	menu.addMenu(4,"按名称降序","order('mName',' desc')","按名称排序效率不高,不建议使用")
	menu.addMenu(4,"按作者升序","",null)
	menu.addMenu(4,"按作者降序","",null)
	menu.addMenu(4,"按自定义顺序","order('indexNum','')","按栏目或数据中设置的顺序号排序")

	menu.addMenu(5,"导入数据","myWeb.inputData()","从外部批量导入数据");
	menu.addMenu(5,"导入栏目","myWeb.inputMenu()","从外部导入数据,批量建立栏目");
	menu.addMenu(5,"生成静态页","myWeb.createHTML()","生成HTML静态页");
	menu.addMenu(5,"移动栏目","myWeb.moveMenu()","移动栏目到别的栏目下,不能把栏目移到根栏目下");
	menu.addMenu(5,"移动文件","myWeb.moveFile()","移动文件");
	menu.addMenu(5,"删除数据","myWeb.delMenu()","删除文章或栏目");
	menu.addMenu(5,"生成sitemap","myWeb.createSitemap()","生成sitemap.xml,告诉搜索引擎你的站点地图");
	menu.addMenu(5,"签收情况统计","myWeb.signContentNum()","签收情况统计");
	menu.addMenu(5,"文章采用量统计","myWeb.ArticleNum()","文章采用量统计");
	menu.addMenu(5,"备份还原网站","myWeb.Backup()","备份还原网站");
	
	menu.addMenu(6,"使用要点","",null)
	menu.addMenu(6,"关于","",null)
	
	menu.create(menuDiv)
	
	
	tools.add("","向上","myWeb.upRead()","返回上一级栏目")
	tools.add("","新建栏目","myWeb.createMenu()","建立新栏目\n即建立新的文件夹")
	tools.add("","发布信息","myWeb.createData()","发布新信息\n发布新的文章,信息等")
	tools.add("","栏目属性","myWeb.modiMenu()","修改栏目的属性")
	tools.add("","设置","myWeb.setFile()"," ")
	tools.add("","删除","myWeb.delMenu()","删除选定的文章或栏目,\n删除后可以在回收站找到他们")
	tools.add("","刷新","myWeb.readMenu(myWeb.menuid)","刷新当前页面")
	tools.create(toolsDiv)
	
	for (var i =1;i<=3;i++){
		var obj=document.getElementById("titleText"+i);
		obj.onmouseover=function(){
			this.oldclass=this.className;
			this.className=this.className+"_1";
		}
		obj.onmouseout=function(){
			this.className=this.oldclass;
		}
		
		obj.onclick=function(){
			order(this.field)
			for (var x=1;x<=3;x++){
				var o=document.getElementById("titleText"+x);
				if (o==this){
					o.className="fileTitleText_C";
					o.oldclass="fileTitleText_C";
				}else{
					o.className="fileTitleText";
				}
			}
		}
	}
	tree.rootId=myWeb.menuid;
	tree.rootObj=document.getElementById("leftDiv");
	if (myWeb.menuid!=0){
		tree.rootObj.style.width="0px";
	}
	myWeb.readMenu(myWeb.menuid);
	setWH();
	
	fileList.onmouseup=function(){
	  if (myWeb.tempObj!=null){return null;}
	  var button=event.button 
		if (button!=1){
		   rmenu.clear();
		   rmenu.add("向上一级","myWeb.upRead()");
		   rmenu.add("新建栏目","myWeb.createMenu()");
		   rmenu.add("发布信息","myWeb.createData()");
		   rmenu.add("删除选定","myWeb.delMenu()");
		   rmenu.add("|","");
		   rmenu.add("全选","myWeb.selsectAll()");
		   rmenu.add("清除","myWeb.clearAll()");
		   rmenu.add("|","");
		   rmenu.add("大图标","maxIco()");
		   rmenu.add("小图标","minIco()");
		   rmenu.add("详细资料","listIco()");
		   rmenu.add("表格","tabIco()");
		   rmenu.add("略图"," imgIco()");
		   rmenu.add("刷新页面","location.reload()");
		   rmenu.create();
		}else{
			rmenu.clear();
		}
	}
	document.body.focus();
	
}

function setWH(){ 
	var w=Element.getWidth(winDiv)
	var h=Element.getHeight(winDiv)
	var h1=Element.getHeight(document.getElementById("address"))
	var h2=Element.getHeight(document.getElementById("menuDiv"))
	var h3=Element.getHeight(document.getElementById("toolsDiv"))
	var h4=Element.getHeight(document.getElementById("fileTitle"))
	var h5=Element.getHeight(document.getElementById("page"))
	var w1=Element.getWidth(document.getElementById("leftDiv"))
	
	var f=document.getElementById("fileList");
	var r=document.getElementById("rightDiv");
	var l=document.getElementById("leftDiv");
	//r.style.width=(w-w1)+"px";
	//alert("h:"+h+"h1:"+h1+"h2:"+h2+"h3:"+h3+"h4:"+h4+"h5"+h5)
	f.style.width=(w-w1)+"px";
	f.style.height=(h-h1-h2-h3-h4-h5)+"px";
	l.style.height=(h-h1-h2-h3)+"px";
	rmenu.Xmax=w;
	rmenu.Ymax=h;
	
	
}

function maxIco(){
	 myWeb.mode=0;
	 myWeb.modiDisplayMode();
	 myWeb.display();
	 myWeb.DisplayFiles();
}

function minIco(){
	 myWeb.mode=1;
	 myWeb.modiDisplayMode();
	 myWeb.display();
	 myWeb.DisplayFiles();
}

function listIco(){
	 myWeb.mode=2;
	 myWeb.modiDisplayMode();
	 myWeb.display();
	 myWeb.DisplayFiles();
}

function tabIco(){
	 myWeb.mode=3;
	  myWeb.modiDisplayMode();
	 myWeb.display();
	 myWeb.DisplayFiles();
}

function imgIco(){
	 myWeb.mode=4;
	 myWeb.modiDisplayMode();
	 myWeb.display();
	 myWeb.DisplayFiles();
}



function order(field,orderType){
	if (orderType==null){
		if (myWeb.orderField==field){
			if (myWeb.orderType==""){
				myWeb.orderType=" desc";
				myWeb.orderTypeb=" desc";
			}else{
				myWeb.orderType="";
				myWeb.orderTypeb="";
			}
		}else{
			myWeb.orderType="";
			myWeb.orderField=field;
		}
	}else{
		myWeb.orderType=orderType;
		myWeb.orderField=field;
		for (var x=1;x<=3;x++){
			var o=document.getElementById("titleText"+x);
			if (o.field==field){
				o.className="fileTitleText_C";
				o.oldclass="fileTitleText_C";
			}else{
				o.className="fileTitleText";
			}
		}

	}
	myWeb.readMenu(myWeb.menuid)
}

function myWebClass(){
	this.menuName="根栏目";
	this.menuList=null;
	this.menuid=readPar(location.href,"menuid")
	if(this.menuid==null){this.menuid=0}
	this.upList=null;
	this.layer=null;
	this.mode=3;   //0大图标  1小图标  2 列表 3 表格
	this.orderField="indexNum";
	this.orderType="";
	this.orderTypeb=" desc";
	this.pathCache=new Array();
	this.selectMenu=null;
	this.filesList=null;
	this.page=1;
	this.pageSize=100;  //每页文章数
	this.selectFiles=new Array();
	this.asTab="";
	this.tempObj=null;
	this.isPop=true;
	var visionType="all";
	this.serverPath="";
	this.isReadMode=1;
	
	
	this.modiDisplayMode=function(){
	   // this.menuid;
	   this.isReadMode=0;
	    var objResponse=new JHttpResponse();
	   // alert(this.menuid);
	    objResponse.write("menuid", this.menuid);
	    objResponse.write("mode", this.mode);
	   	var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=modiDisplayMode",objResponse,null);
	    if (out!="1"){
	         alert(out);
	    }   
	    
	}
	
	
	this.keyDown=function(){ //检测键盘
		 // alert("开始准备检测");
	 //上光标 38 左光标37 右光标39   下光标40  回车13  ESC 27 pageup 33 pagedown34  删除键 46
		var key=event.keyCode;
		if (key==46){
		 //   alert("检测到DEL按下");
			//this.delRow();
			this.delMenu();
			return  false;
		}
		
	}
	
	
	this.createSitemap=function(){
		var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=createSitemap",null,null);
		if (out=="1"){
			alert("生成成功");
			return;	
		}else{
			alert(erStr(out));
			return;
		}
	}
	
    this.signContentNum=function(){
    	var objnum=parent.win.objNum;
		par="wNum="+objnum;
		parent.win.pCreate("p-signStatistics",par,"",true);
    }
    this.ArticleNum=function(){
        var objnum=parent.win.objNum;
		par="wNum="+objnum;
		parent.win.pCreate("p-statistics",par,"",true);

    }
    this.Backup=function(){
        var objnum=parent.win.objNum;
		par="wNum="+objnum;
		parent.win.pCreate("p-backup",par,"",true);
    }
	this.moveMenu=function(){
		if (!this.isPop){
			alert("您不具有此权限");
			return;
		}
		if (this.selectMenu==null){
		    alert("请你选择一个栏目") 
			return;
		}
		 if (this.selectMenu.menuid<1000){
				  alert("你选中的栏目是系统栏目,不能移动") 
				  return;
		  }
			var m= openSelectMenu();
			if (m==null | m==""){return;}
			m=m.split(c1);
			if (parseInt(m[1])<1000){
				alert("不能把栏目移动到系统栏目内")
				return;
			}
			//alert(this.selectMenu.menuid+"|"+m[1]+"|"+this.menuid);
			if (parseInt(m[1])==parseInt(this.selectMenu.menuid)){
				alert("目标栏目不能是当前栏目,请另外选择一个栏目")
				return;
			}
			if (!window.confirm("移动栏目\n\n您将要把当前选中的栏目移动到: "+m[0]+",是否继续")){
			   return;
			}
			
			  var objResponse=new JHttpResponse();
			  objResponse.write("inID",this.selectMenu.menuid);
			  objResponse.write("outID",m[1]);
			  objResponse.write("menuID",this.menuid);
			  var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=moveMenu",objResponse,null);
			  if (out=="1"){
				  this.readMenu(this.menuid);
			  }else{
				  alert(erStr(out));
			  }
	}
	
	
	this.moveFile=function(){
		
		if (this.selectFiles.length==0){
			alert("您没有选择任何文章")
			return;	
		}
		var m= openSelectMenu();
		if (m==null | m==""){return;}
		m=m.split(c1);
		if (parseInt(m[1])<1000){
			alert("不能把栏目移动到系统栏目内")
			return;
		}
		//alert(this.selectMenu.menuid+"|"+m[1]+this.menuid);
		if (parseInt(m[1])==parseInt(this.menuid)){
			alert("目标栏目不能是当前栏目,请另外选择一个栏目")
			return;
		}
		if (m[2]!=this.asTab){
			alert("目标栏目和当前栏目所用的数据模型不同,请另外选择")
			return;
		}
		if (!window.confirm("移动文件\n\n您将要把当前选中的文件移动到: "+m[0]+",是否继续")){
		   return;
		}
		var fileList="";
		 var fl=this.selectFiles;
		 var l=fl.length;
		 for (var i=0;i<l;i++){
			 fileList=fileList+fl[i].fileid+",";
		 }
		fileList=fileList.substr(0,fileList.length-1);
		var objResponse=new JHttpResponse();
		objResponse.write("menuid",this.menuid);
		objResponse.write("fileidList",fileList);
		objResponse.write("table",this.asTab);
		objResponse.write("toMenuid",m[1]);
		var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=moveFiles",objResponse,null);
	    if (out=="1"){
		    this.readMenu(this.menuid);
	    }else{
		   alert(erStr(out));
	    }
		
	}
	
	
	this.delMenu=function(){
		if (!this.isPop){
			alert("您不具有此权限");
			return;
		}
		if (this.selectMenu!=null){
			
			  if (this.selectMenu.menuid<1000){
				  alert("你选中的栏目是系统栏目,不能删除") 
			  }else{
				  if (window.confirm("你的删除操作将删除栏目及栏目下的子栏目和数据,是否继续")){
					  var mid=this.selectMenu.menuid;
					  var upList=this.selectMenu.upList;
					  upList=upList.split(",");
					  var u=""
					  for (var i=0;i<=upList.length-2;i++){
						  if (i<upList.length-2){
							u=u+upList[i]+","
						  }else{
							u=u+upList[i]
						  }
					  }
					  var objResponse=new JHttpResponse();
					  objResponse.write("menuid",mid);
					  objResponse.write("upList",u);
					 var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=delMenu",objResponse,null);
					
					 if (out=="OK"){
						 this.selectMenu.removeNode(true);
						 this.selectMenu=null;
						 tree.del(mid);
					 }else{
						  alert(out)
					 }
				   }
			  }
		}
		if (this.selectFiles.length!=0){  //删除文章开始
			 var fileList="";
			 var fl=this.selectFiles;
			 var l=fl.length;
			 for (var i=0;i<l;i++){
				 fileList=fileList+fl[i].fileid+",";
			 }
			 fileList=fileList.substr(0,fileList.length-1);
		     var objResponse=new JHttpResponse();
			 objResponse.write("menuid",this.menuid);
			 objResponse.write("fileidList",fileList);
			 objResponse.write("table",this.asTab);
			
			 var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=delFiles",objResponse,null);
			// var out="OK"
			 if (out=="OK"){
				 l=fl.length;
				  for (i=0;i<l;i++){
					  if (fl[i].id!=null){
						  var obj=document.getElementById(fl[i].id);
						  if (obj!=null){
			  				 //alert(obj.id);
							 obj.removeNode(true);
						  }
					  }
				  }
				  this.clearDelFile();
			}else{
				  alert(out)
			}
			
			
		}
		
		
	}
	
	this.readPath=function(idList){  //根据栏目ID,读出栏目的路径 
		var pCache=this.pathCache;
		var path=""
	//	if (pCache.length==0){
//			path=this.id2Path(idList);
//			var l=pCache.length;
//			pCache[l]=new Array();
//			pCache[l][0]=idList;
//			pCache[l][1]=path;
//			return path;
//		}
		for (var i=0;i<pCache.length;i++){
			if (pCache[i][0]==idList){
				return pCache[i][1];
			}
		}
		path=this.id2Path(idList);
		var l=pCache.length;
		pCache[l]=new Array();
		pCache[l][0]=idList;
		pCache[l][1]=path;
		return path;
		
		
	}
	
	this.id2Path=function(idList){
		var objResponse=new JHttpResponse();
		objResponse.write("idList",idList);
		var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=readPath",objResponse,null);
		//alert(out)
		return out;
	}
	
	this.modiMenu=function(){
		if (!this.isPop){
			alert("您不具有此权限");
			return;
		}
		if (this.selectMenu!=null){
			var objnum=parent.win.objNum;
			par="wNum="+objnum+"&type=modi&menuid="+this.selectMenu.menuid+"&asTab="+this.selectMenu.asTab;
			parent.win.pCreate("P-createMenu",par,"修改栏目属性-"+this.selectMenu.title);
			
		}else if(this.menuid!=0&this.menuid!=null){
			var objnum=parent.win.objNum;
			par="wNum="+objnum+"&type=modi&menuid="+this.menuid+"&asTab="+this.asTab
			parent.win.pCreate("P-createMenu",par,"修改栏目属性-"+this.menuName);
		}
		
	}
	
	
	this.createMenu=function(){
		if (!this.isPop){
			alert("您不具有此权限");
			return;
		}
		var objnum=parent.win.objNum;
		par="wNum="+objnum+"&menuid="+this.menuid+"&asTab="+this.asTab
		parent.win.pCreate("P-createMenu",par,"新增栏目-"+this.menuName);
		
	}
	
	this.createData=function(){
		if (this.menuid==0){
			alert("不能在根目录下发布数据")
			return ;
		}
		if (!this.isPop){
			alert("您不具有此权限");
			return;
		}
		var objnum=parent.win.objNum;
		par="wNum="+objnum+"&menuid="+this.menuid+"&asTab="+this.asTab
		parent.win.pCreate("p-createData",par,"发布信息-"+this.menuName);
		
	}
	
	this.modiData=function(id){
		if (id==null){
			if (this.selectFiles.length!=0){
				var fl=this.selectFiles;
				l=fl.length-1;
				id=fl[l].fileid;
			}
		}
		if (id==null){
			alert("请先选择一篇文章")
			return ;
		}
		
		var objnum=parent.win.objNum;
		par="wNum="+objnum+"&pType=modi&menuid="+this.menuid+"&id="+id+"&asTab="+this.asTab
		parent.win.pCreate("p-createData",par,"编辑信息-"+this.menuName);
		
		
	}
	
	
	this.readMenu=function(menuid){
		//读出栏目列表
		msg.style.display="";
		var objResponse=new JHttpResponse();
		objResponse.write("menuid",menuid);
		
		objResponse.write("order",this.orderField+this.orderType);
		// "id,mName,mid,layer,isDown,uplistid,intro,indexNum,mDate,asTab,displayMode";
		//   0   1    2    3      4        5        6    7      8      9      10
 		var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=read",objResponse,null);
		//第一级※  第二级⊙
		out= comminute(out,c1,c2)
		tree.add(out);
		this.menuList=out;
		this.selectMenu=null;
		this.clearDelFile();
		this.page=1;
		this.display();
		this.readFiels();
		msg.style.display="none";
		
	}
	
	this.upRead=function(){ //读上一级栏目
		
	   if (this.upListid!=""){
			var path=this.upListid.split(",");
			var upid=path[path.length-2]
			if (upid==null){upid=0;this.menuid=0}
			this.readMenu(upid);
	   }else{
		   	alert("您已经处理根栏目,无法再向上");
		}
	}
	
	this.display=function(){ 
		//显示栏目列表 mode 显示的模式 0 略图 1 大图标, 2小图标, 3列表  4 略图
		var mList=this.menuList;
		var div=document.getElementById("fileList");
		var i=0;
		if (this.menuid==0){
			if (mList.length==1){
				div.innerHTML="<div>网站中没有发现任何栏目</div>";
				return false;
			}
			this.menuName="根栏目";
			this.menuid=0;
			this.layer=0;
			this.upListid="";
			this.asTab="";
			this.isDown="1";
			AddressText.value="\\";
		}else{
			AddressText.value=this.readPath(mList[0][5]);
			i=1;
			this.asTab=mList[0][9]
			this.menuName=mList[0][1];
			this.menuid=mList[0][2];
			this.layer=mList[0][3];
			this.upListid=mList[0][5];
			this.isDown=mList[0][4];
			if (mList.length==2){
				div.innerHTML="<div>..</div>";
				return false;
			}
		}
		div.innerHTML="";
		//id,mName,mid,layer,isDown,uplistid,intro,indexNum,mDate,asTab
		
	
		for (i=i;i<mList.length-1;i++){
			
			
			switch (this.mode){
					case 0:  //大图标
						var tempObj=document.createElement("div");
						tempObj.id="webMenu_"+i;
						var newObj=div.appendChild(tempObj);
						newObj.className="M1F";
						newObj.menuid=mList[i][2];
						newObj.title=mList[i][1];
						
						tempObj=document.createElement("div");
						var imgObj=newObj.appendChild(tempObj);
						if (mList[i][4]=="1"){
							imgObj.innerHTML="<img src='img/m1.gif'>";
						}else{
							imgObj.innerHTML="<img src='img/m1_0.gif'>";
						}
						imgObj.className="m1img";
						
						tempObj=document.createElement("div");
						var textObj=newObj.appendChild(tempObj);
						textObj.innerHTML=mList[i][1];
						textObj.className="m1Text";
					    break;
					case 1: //小图标
					case 3: //小图标
					case 4: //小图标
						var tempObj=document.createElement("div");
						tempObj.id="webMenu_"+i;
						var newObj=div.appendChild(tempObj);
						newObj.className="M2F";
						newObj.menuid=mList[i][2];
						newObj.title=mList[i][1];
						
						tempObj=document.createElement("div");
						var imgObj=newObj.appendChild(tempObj);
						if (mList[i][4]=="1"){
							imgObj.innerHTML="<img src='img/m2.gif'>";
						}else{
							imgObj.innerHTML="<img src='img/m2_0.gif'>";
						}
						imgObj.className="m2img";
						
						tempObj=document.createElement("div");
						var textObj=newObj.appendChild(tempObj);
						textObj.innerHTML=mList[i][1];
						textObj.className="m2Text";
					    break;
					case 2:
						var tempObj=document.createElement("div");
						tempObj.id="webMenu_"+i;
						var newObj=div.appendChild(tempObj);
						newObj.className="M3F";
						newObj.menuid=mList[i][2];
						newObj.title=mList[i][1];
						
						tempObj=document.createElement("div");
						var idObj=newObj.appendChild(tempObj);
						if (mList[i][4]=="1"){
							idObj.innerHTML="&nbsp;&nbsp;<img src='img/m3.gif'>&nbsp;"+ mList[i][2];
						}else{
							idObj.innerHTML="&nbsp;&nbsp;<img src='img/m3_0.gif'>&nbsp;"+ mList[i][2];
						}
						idObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var nameObj=newObj.appendChild(tempObj);
						nameObj.innerText=mList[i][1];
						nameObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var dateObj=newObj.appendChild(tempObj);
						dateObj.innerText=mList[i][8];
						dateObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var createObj=newObj.appendChild(tempObj);
						createObj.innerText="";
						createObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var introObj=newObj.appendChild(tempObj);
						introObj.innerText=mList[i][6];
						introObj.className="fileListRow";
						//alert(mList[i][6]);
					    break;
					/*case 3:
						var tempObj=document.createElement("div");
						tempObj.id="webMenu_"+i;
						var newObj=div.appendChild(tempObj);
						newObj.className="M4F";
						newObj.menuid=mList[i][2];
						newObj.title=mList[i][1];
						
						tempObj=document.createElement("div");
						var idObj=newObj.appendChild(tempObj);
						if (mList[i][4]=="1"){
							idObj.innerHTML="&nbsp;&nbsp;<img src='img/m3.gif'>&nbsp;";
						}else{
							idObj.innerHTML="&nbsp;&nbsp;<img src='img/m3_0.gif'>&nbsp;";
						}
						idObj.className="fileTabRow";
						
						tempObj=document.createElement("div");
						var nameObj=newObj.appendChild(tempObj);
						nameObj.innerText=mList[i][1];
						nameObj.className="fileTabTitleRow";
						
			
						tempObj=document.createElement("div");
						var introObj=newObj.appendChild(tempObj);
						introObj.innerText=mList[i][6];
						introObj.className="fileTabRow_R2";


						tempObj=document.createElement("div");
						var createObj=newObj.appendChild(tempObj);
						createObj.innerText="";
						createObj.className="fileTabRow_R1";
						
						//alert(mList[i][6]);
						
						tempObj=document.createElement("div");
						var dateObj=newObj.appendChild(tempObj);
						dateObj.innerText=mList[i][8];
						dateObj.className="fileTabRow_R";
					    break;
*/
			}
			newObj.asTab=mList[i][9];
			newObj.upList=mList[i][5];
			newObj.icoType="M";
			//alert(mList[i][10]);
			newObj.dMode=mList[i][10];
			
			
			
			
			newObj.onmouseover=function(){
				if (myWeb.selectMenu!=this){
					this.oldclass=this.className;
					this.className=this.className+"_1";
				}
				myWeb.tempObj=this;
			}
			
			newObj.onmouseout=function(){
				if (myWeb.selectMenu!=this){
					this.className=this.oldclass;
				}
				myWeb.tempObj=null;
			}
			
			newObj.ondblclick=function(){  //双击图标, 读下级栏目
				myWeb.menuid=parseInt(this.menuid);
				var dMode=this.dMode;
				if(dMode=="" | dMode==null){dMode="3"}
				
				if (isNaN(dMode)){
				    dMode=3;
				}else{
				    dMode=parseInt(dMode);
				}
				myWeb.isReadMode=0;
				myWeb.mode=dMode;
				myWeb.readMenu(this.menuid);
			}
			
			newObj.onmousedown=function(){  //点击鼠标 选定栏目
				rmenu.clear();
				setTimeout("myWeb.selectMenuObj()",10)
			}
			
			newObj.onmouseup=function(){
				var button=event.button 
				
				var menuid=this.menuid;
				
				if (button!=1){
				   rmenu.clear();
				   rmenu.add("属性","myWeb.modiMenu()");
				   rmenu.add("打开栏目","myWeb.menuid="+menuid+";myWeb.readMenu("+menuid+")");
				   rmenu.add("向上一级","myWeb.upRead()");
				   rmenu.add("|","");
				   rmenu.add("发布信息","myWeb.createData()");
				   rmenu.add("删除选定","myWeb.delMenu()");
				   rmenu.add("移动栏目","myWeb.moveMenu()");
				   rmenu.add("|","");
				   rmenu.add("全选","myWeb.selsectAll()");
				   rmenu.add("清除","myWeb.clearAll()");
				   rmenu.add("|","");
				   rmenu.add("大图标","maxIco()");
				   rmenu.add("小图标","minIco()");
				   rmenu.add("详细资料","listIco()");
				   rmenu.add("表格","tabIco()");
				   rmenu.add("略图","imgIco()");
				   rmenu.add("刷新页面","location.reload()");
				   rmenu.create();
				  
				}else{
					rmenu.clear();
				}
				
			}
			
		}
		
	}
	
	this.selectMenuObj=function(){
		obj=this.tempObj;
		if (this.selectMenu==obj){
			return false;
		}
		//alert(obj.outerHTML);
		if (this.selectMenu!=null){
			this.selectMenu.className=this.selectMenu.oldclass;
		}
		this.selectMenu=obj;
	}
	
	
	this.setVision=function(type){ //设置显示哪些内容
		visionType=type;
		this.readFiels();
	}
	
	this.setFile=function(){ //设置文件
		if (this.selectFiles.length<1){
			alert("请选择要作设置的文件");
			return;
		}
		var arr=showModalDialog("setFile.htm?t="+create_id(), window, "dialogWidth:300px; dialogHeight:200px; toolbar=no;location=no;directories=no;status=no;menubar=no;scroll=auto;resizable=0;help=0");
		if (arr!=null){
			this.readMenu(this.menuid);
		}
	}
	
	
	this.readFiels=function(){	//读出当前栏目下的内容_读数据
			
		var objResponse=new JHttpResponse();
		if (this.asTab=="" ){
			return null;
		}
		var order=this.orderField;
		switch (order){
			case "mid":
				order="id";
				break;
			case "mName":
				order="title";
				break;
			case "mDate":
				order="saveDate";
				break;
			case "indexNum":
				order="id";
				break;
		}
		
		objResponse.write("menuid",this.menuid);
		objResponse.write("asTab",this.asTab);
		objResponse.write("page",this.page);
		objResponse.write("pageSize",this.pageSize);
		objResponse.write("order",order+this.orderTypeb);
		objResponse.write("visionType",visionType);
		
		
		
		//alert(order+this.orderType);
		var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=readFiles",objResponse,null);
		if (out=="noPop"){
			this.isPop=false;
			//pageDiv.innerText="";
			$("page").innerText="   此栏目您没有权限管理数据";
			return;
		}
		this.isPop=true;
		//alert(this.asTab+"|"+this.menuid);
		//alert(out);
		//第一级※  第二级⊙
		//id,title,saveDate,saveUser,cbs,IsTop,IsEssence,IsHidden,Examine,IsRemark,TabImage
		//0   1         2        3     4   5     6       7           8     9        10
		out= comminute(out,c1,c2)
		this.filesList=out;
		var pageDiv=document.getElementById("page");
		if (this.page>out[0][1]){
			this.page=out[0][1];
		}
		if (out[0][0]!="0"){
			pageDiv.innerText=" 一共有"+out[0][0]+"条, 分"+out[0][1]+"页,当前是第"+out[0][2]+"页";
			if (out[0][1]>1){
				var tempObj=document.createElement("span");
				var div=pageDiv.appendChild(tempObj);
				div.style.cssText="width:60px;text-align:center;cursor:default "
				div.innerText="上一页";
				if (this.page>1)
				{
				 div.onclick=function(){
						myWeb.page=myWeb.page-1;
						myWeb.readFiels();
						
					}
				}
				
				tempObj=document.createElement("span");
				div=pageDiv.appendChild(tempObj);
				div.style.cssText="width:60px;text-align:center;cursor:default"
				div.innerText="下一页";
				if (this.page<out[0][1])
				{
				 div.onclick=function(){
						myWeb.page=myWeb.page+1;
						myWeb.readFiels();
					}
				}
				
			
			}
			
			tempObj=document.createElement("span");
			div=pageDiv.appendChild(tempObj);
			div.style.cssText="width:60px;text-align:center;cursor:default"
			div.innerText="全选";
			div.onclick=function(){
				myWeb.selsectAll();
			}
			
			tempObj=document.createElement("span");
			div=pageDiv.appendChild(tempObj);
			div.style.cssText="width:60px;text-align:center;cursor:default"
			div.innerText="清除";
			div.onclick=function(){
				myWeb.clearAll();
			}
				
			tempObj=document.createElement("span");
			div=pageDiv.appendChild(tempObj);
			div.style.cssText="width:100px;text-align:center"
			div.innerText=" 读取时间:"+out[0][4]+"ms"
		}else{
			pageDiv.innerText=" 栏目下无数据"
		}
		this.DisplayFiles();
		
		
	}
	
	this.DisplayFiles=function(){
		var files=this.filesList;
		if (files==null){return null; }
		if (files.length==0){return null;}
		if (this.isReadMode==1){
		      var objResponse=new JHttpResponse();
	 //   alert("准备读显示模式");
	            objResponse.write("menuid", this.menuid);
	   	        var out=objAjax.getText("post",this.serverPath+"mywebServer.aspx?type=readDisplayMode",objResponse,null);
	            if (isNaN(out)){
	                 alert(out);
	                 return;
	            }else{
	                this.mode=parseInt(out);
	            }
		}
		var div=document.getElementById("wFiles");
		if (div==null){
			var tempObj=document.createElement("div");
			div=document.getElementById("fileList").appendChild(tempObj);
			div.id="wFiles";
			div.style.cssText="clear:both";
		}else{
			div.innerHTML="";
		}
		var signObj=null;
		//alert(this.mode);
		for (i=1;i<files.length-1;i++){
			switch (this.mode){
					case 0:  //大图标
					
					   //id,title,saveDate,saveUser
						var tempObj=document.createElement("div");
						var newObj=div.appendChild(tempObj);
						newObj.className="M1F";
						
						tempObj=document.createElement("div");
						signObj=newObj.appendChild(tempObj);
						signObj.className="signdiv";
						
						tempObj=document.createElement("div");
						var imgObj=newObj.appendChild(tempObj);
						imgObj.innerHTML="<img src='img/f1.gif'>";
						imgObj.className="m1img";
						tempObj=document.createElement("div");
						var textObj=newObj.appendChild(tempObj);
						textObj.innerText=files[i][1];
						textObj.className="m1Text";
					    break;
					case 1: //小图标
						var tempObj=document.createElement("div");
						var newObj=div.appendChild(tempObj);
						newObj.className="M2F";
						
						tempObj=document.createElement("div");
						signObj=newObj.appendChild(tempObj);
						signObj.className="signdiv";
						
						tempObj=document.createElement("div");
						var imgObj=newObj.appendChild(tempObj);
						imgObj.innerHTML="<img src='img/f2.gif'>";
						imgObj.className="m2img";
						tempObj=document.createElement("div");
						var textObj=newObj.appendChild(tempObj);
						textObj.innerText=files[i][1];
						textObj.className="m2Text";
					    break;
					case 2: //列表　
						var tempObj=document.createElement("div");
						var newObj=div.appendChild(tempObj);
						newObj.className="M3F";
						
						tempObj=document.createElement("div");
						signObj=newObj.appendChild(tempObj);
						signObj.className="signdiv";
						
						tempObj=document.createElement("div");
						var idObj=newObj.appendChild(tempObj);
						idObj.innerHTML="&nbsp;&nbsp;<img src='img/f3.gif'>&nbsp;"+ files[i][0];
						idObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var nameObj=newObj.appendChild(tempObj);
						nameObj.innerText=files[i][1];
						nameObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var dateObj=newObj.appendChild(tempObj);
						dateObj.innerText=files[i][2];
						dateObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var createObj=newObj.appendChild(tempObj);
						createObj.innerText=files[i][3];
						createObj.className="fileListRow";
						
						tempObj=document.createElement("div");
						var introObj=newObj.appendChild(tempObj);
						introObj.innerText=files[i][4];
						introObj.className="fileListRow";
						break;
					case 3: //表格
						var tempObj=document.createElement("div");
						var newObj=div.appendChild(tempObj);
						newObj.className="M4F";
						
						tempObj=document.createElement("div");
						signObj=newObj.appendChild(tempObj);
						signObj.className="signdiv";
						
						tempObj=document.createElement("div");
						var idObj=newObj.appendChild(tempObj);
						idObj.innerHTML="&nbsp;&nbsp;<img src='img/f3.gif'>&nbsp;";
						idObj.className="fileTabRow";
						
						tempObj=document.createElement("div");
						var nameObj=newObj.appendChild(tempObj);
						nameObj.innerText=files[i][1];
						nameObj.className="fileTabTitleRow";
						
												
						tempObj=document.createElement("div"); //简介
						var introObj=newObj.appendChild(tempObj);
						introObj.innerText=files[i][4];
						introObj.className="fileTabRow_R2";

						
						tempObj=document.createElement("div"); //创建人
						var createObj=newObj.appendChild(tempObj);
						createObj.innerText=files[i][3];
						createObj.className="fileTabRow_R1";
						
						tempObj=document.createElement("div");  //创建日期
						var dateObj=newObj.appendChild(tempObj);
						dateObj.innerText=files[i][2];
						dateObj.className="fileTabRow_R";
						break;
					case 4: //略图方式
		//id,title,saveDate,saveUser,cbs,IsTop,IsEssence,IsHidden,Examine,IsRemark,TabImage
		//0   1         2        3     4   5     6       7           8     9        10
						var tempObj=document.createElement("div");
						var newObj=div.appendChild(tempObj);
						newObj.className="M1F";
						
						tempObj=document.createElement("div");
						signObj=newObj.appendChild(tempObj);
						signObj.className="signdiv";
						
						tempObj=document.createElement("div");
						var fileimg=files[i][10];
						fileimg=imgx(fileimg);
						if (fileimg==""){
						    fileimg="img/f1.gif";
						}
						var imgObj=newObj.appendChild(tempObj);
						imgObj.style.cssText="width:98%;height:95px;overflow:hidden;"
						imgObj.innerHTML="<img src='"+fileimg+"' onload='setImgWH(this)'>";
						//alert(fileimg)
						imgObj.className="m1img";
						tempObj=document.createElement("div");
						var textObj=newObj.appendChild(tempObj);
						textObj.innerText=files[i][1];
						textObj.className="m1Text";

		
		

					    
					   break;
						
					
			}
			newObj.icoType="F";
			newObj.id="webFile_"+files[i][0];
			newObj.fileid=files[i][0];
			newObj.title=files[i][1];
			this.isReadMode=1;
			
			if (signObj!=null){
		//id,title,saveDate,saveUser,cbs,IsTop,IsEssence,IsHidden,Examine,IsRemark
		//0   1         2        3     4   5     6       7           8     9 
				if (files[i][5]=="1"){
					signObj.innerHTML=signObj.innerHTML+"<img title='置顶' src='img/top.gif'>";
				}
				if (files[i][6]=="1"){
					signObj.innerHTML=signObj.innerHTML+"<img  title='精华' src='img/Essence.gif'>";
				}
				if (files[i][7]=="1"){
					signObj.innerHTML=signObj.innerHTML+"<img  title='隐藏' src='img/Hidden.gif'>";
				}
				if (files[i][8]!="1"){
					signObj.innerHTML=signObj.innerHTML+"<img  title='未终审' src='img/Examine.gif'>";
				}
				
			}

									
			if (myWeb.isDelFile(newObj)){
				newObj.oldclass=newObj.className;
				newObj.className=newObj.className+"_1";
			}
			
			newObj.onmouseover=function(){
				if (!myWeb.isDelFile(this)){
					this.oldclass=this.className;
					this.className=this.className+"_1";
				}
				myWeb.tempObj=this;
			}
			
			newObj.onmouseout=function(){
				if (!myWeb.isDelFile(this)){
					this.className=this.oldclass;
				}
				myWeb.tempObj=null;
			}
			
			newObj.ondblclick=function(){  //双击图标, 打开文件
				myWeb.modiData(this.fileid);
			}
			
			newObj.onmousedown=function(){  //单击选定文件
				var button=event.button 
 				if (button==1){
					rmenu.clear();
					setTimeout("myWeb.selectFileObj()",10)
				}
			}
			
			newObj.onmouseup=function(){
				var button=event.button 
				var fileid=this.fileid;
				if (button!=1){
				   rmenu.clear();
				   rmenu.add("打开","myWeb.modiData('"+fileid+"')");
				   rmenu.add("设置","myWeb.setFile()");
				   rmenu.add("|","");
				   rmenu.add("发布信息","myWeb.createData()");
				   rmenu.add("删除选定","myWeb.delMenu()");
				   rmenu.add("移动文件","myWeb.moveFile()");
				   rmenu.add("|","");
				   rmenu.add("全选","myWeb.selsectAll()");
				   rmenu.add("清除","myWeb.clearAll()");
				   rmenu.add("|","");
				   rmenu.add("大图标","maxIco()");
				   rmenu.add("小图标","minIco()");
				   rmenu.add("详细资料","listIco()");
				   rmenu.add("表格","tabIco()");
				   rmenu.add("略图","imgIco()");
				   rmenu.add("刷新页面","location.reload()");
				   rmenu.create();
				  
				}else{
					rmenu.clear();
				}
				
			}

			
		}
		
		this.selectFileObj=function(){
			var obj=this.tempObj;
			if (!myWeb.isDelFile(obj)){
					myWeb.addDelFile(obj);
				}else{
					myWeb.moveDelFile(obj);
					obj.className=obj.oldclass;
				}
		}
		
		
	}
	
	this.clearAll=function(){  //取消全部选择
		var fl=this.selectFiles;
		var i=fl.length;
		if (i==0){
			return false;
		}
		
		for (var x=0;x<i;x++){
			var obj=document.getElementById(fl[x].id)
			if (obj!=null){
				obj.className=obj.oldclass;
			}
		}
		this.clearDelFile();
	}
	
	this.selsectAll=function(){  //选择当前页的全部
		var div=document.getElementById("wFiles");
		objList=div.getElementsByTagName("DIV");
		for (var i in objList){
			if (objList[i].id !=null){
				if (objList[i].id.search("webFile_")!=-1){
					if (!this.isDelFile(objList[i])){
						this.addDelFile(objList[i]);
						objList[i].oldclass=objList[i].className;
						objList[i].className=objList[i].className+"_1";
					}
				}
			}
		}
	}
	
	this.isDelFile=function(obj){ //检测是否已保存在删除列表中
		var fl=this.selectFiles;
		var i=fl.length;
		if (i==0){
			return false;
		}
		for (var x=0;x<i;x++){
			if (fl[x].id==obj.id){
				return true;
			}
		}
		return false;
	}
	
	this.clearDelFile=function(){
		this.selectFiles.clear();
	}
	
	this.addDelFile=function(obj){  //增加一个要删除的文件
		if (this.isDelFile(obj)){
			return;
		}
		var fl=this.selectFiles;
		var i=fl.length;
		fl[i]=obj;
		this.selectFiles=fl;
	}
	
	this.moveDelFile=function(obj){  //移除一个要删除的文件
		var fl=this.selectFiles;
		var i=fl.length;
		for (var x=0;x<i;x++){
			if (fl[x].id==obj.id){
				fl.splice(x,1);
				break;	
			}
		}
		this.selectFiles=fl;
	}
	
	
	this.inputData=function(){
		if (!this.isPop){
			alert("您不具有此权限");
			return;
		}
		if (this.menuid==0 | this.asTab==""){
			alert("这里不能导入数据\n请进入某子栏目导入数据");
			return;
		}
		var url= "inputData.htm?menuid="+this.menuid+"&asTab="+this.asTab;
	    var a=showModalDialog(url,window, "dialogWidth:800px; dialogHeight:600px; toolbar=no;location=no;directories=no;status=no;menubar=no;scroll=auto;resizable=0;help=0");
		
	}
	
	this.inputMenu=function(){
		if (!this.isPop){
			alert("您不具有此权限");
			return;
		}
		if (this.menuid==0 | this.asTab==""){
			alert("这里不能导入数据");
			return;
		}
		var url= "inputMenu.aspx?menuid="+this.menuid+"&asTab="+this.asTab;
	    var a=showModalDialog(url,window, "dialogWidth:800px; dialogHeight:600px; toolbar=no;location=no;directories=no;status=no;menubar=no;scroll=auto;resizable=0;help=0");
		
	}
	
	
	
	this.createHTML=function(){
		if (this.menuid==1 ){
			alert("这里不能生成HTML页");
			return;
		}
		
	
		
		var objnum=parent.win.objNum;
		par="wNum="+objnum+"&menuid="+this.menuid+"&asTab="+this.asTab
		parent.win.pCreate("p-createHTML",par,"生成HTML页-"+this.menuName);
		
	}
}

