function zipfile() {
   
	if (document.Form1.HdnSelectedValues.value=="")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event("请勾选多个目录或文件进行压缩！", 'window.close();','','');	
		return;
	}
	Init();
	var currpath;
	if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
	Webdisk.ContentPane.Zip(currpath,document.Form1.HdnSelectedValues.value,IszipfileOpr_callback);
}
function IszipfileOpr_callback(res)
{
	document.all.loading.style.display='none';
	var bRet = res.value;
	if ((bRet.charAt(0) != "0") && (bRet.charAt(0) != "1"))
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
	else
	{
		var rowcount=document.getElementById("rowcount").value;
		var currpath;
		if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
		var ss=bRet.split("`");
		var subtmp=ss[0];
		var txttmp=ss[1];
		var size=ss[2];
		var user=ss[3];
		var cache=ss[4];
		
		AddRow(rowcount,currpath,txttmp,bRet.charAt(0),"1",size,user,cache,"");
				
		var info=document.getElementById("info").innerHTML;
		var first=info.indexOf("：")
		var second=info.indexOf("个")
		document.getElementById("info").innerHTML=info.substring(0,first)+parseInt(parseInt(info.substring(first+1,second))+1)+info.substring(second,info.length);
		rowcount++;
		document.getElementById("rowcount").value=rowcount;
	}
}
function unzipfile()
{
	if (document.Form1.HdnSelectedValues.value=="")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event("请勾选多个目录或文件进行解压！", 'window.close();','','');	
		return;
	}
	Init();
	var currpath;
	if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
	Webdisk.ContentPane.Unzip(currpath,document.Form1.HdnSelectedValues.value,IsunzipfileOpr_callback);
}
function IsunzipfileOpr_callback(res)
{
	document.all.loading.style.display='none';
	var bRet = res.value;
	if ((bRet.charAt(0) != "0") && (bRet.charAt(0) != "1"))
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
	else
	{
		var ss=bRet.split("`");
		for(var i=0;i<ss.length-1;i++)
		{
			var rowcount=document.getElementById("rowcount").value;
			var currpath;
			if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
			var txttmp=ss[i].substring(1,ss[i].length);
			
			AddRow(rowcount,currpath,txttmp,ss[i].charAt(0),"0","","","","");
					
			var info=document.getElementById("info").innerHTML;
			var first=info.indexOf("：")
			var second=info.indexOf("个")
			document.getElementById("info").innerHTML=info.substring(0,first)+parseInt(parseInt(info.substring(first+1,second))+1)+info.substring(second,info.length);
			rowcount++;
			document.getElementById("rowcount").value=rowcount;
		}
	}
}
function shareuser(url)
{
window.open(url,'','scrollbars=yes,resizable=no,status=no,toolbar=no,menubar=no,location=no,width=700,height=500');
}
function cutfile(type) {
	var txttype;
	if (type=="1") 
	{txttype="移动";document.Form1.copytype.value="1";} else {txttype="复制";document.Form1.copytype.value="2";}
	if (document.Form1.HdnSelectedValues.value=="")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event("请勾选多个目录或文件进行"+txttype+"！", 'window.close();','','');	
		return;
	}
	var d = new dialog();d.init();
	d.set('src','');
	d.set('title',txttype+'到……');
	d.event('选择要'+txttype+'到的目标路径：<br><br><select name="vpath" id="vpath" class=kuan onchange="document.all.selpath.value=document.all.vpath.value;"><option>正在读取……</option></select><br><br><a href=\'#\' onclick=\"javascript:shareuser(\'search_user.aspx?sel=1\');\"><u>选择其它位置</u></a>', 'moveto()','','');
	var currpath;
	Webdisk.ContentPane.GetAllPath(get_Result_CallBack);
	document.all.selpath.value="/";
}
function get_Result_CallBack(response)
{
    if (response.value != null)
    {
        document.all("vpath").length=0;
　　　　var ds = response.value;
        if(ds != null && typeof(ds) == "object")
        {         
            for(var i=0; i<ds.Rows.length; i++)
　　　　    {
　　　　        var name=ds.Rows[i].path;
　　　　　　    var id=ds.Rows[i].path;
　　　　　　    document.all("vpath").options.add(new Option(name,id));
　　　　    }
        }
    }                
    return
}
function setvalue(str){
	var name=str;
　　var id=str;
　　document.all("vpath").options.add(new Option(name,id));
　　document.all("vpath").value=str;
	document.all.selpath.value=str;
}
function moveto()
{
	var currpath;
	if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
	if (document.all.selpath.value!=currpath)
	{
		Init();
		Webdisk.ContentPane.MoveTo(currpath,document.Form1.HdnSelectedValues.value,document.all.selpath.value,document.Form1.copytype.value,"",IsOprEnd_callback);
	}
}
function IsOprEnd_callback(res)
{
	var bRet = res.value;
	if ((bRet != "") && (bRet != "1") && (bRet != "2"))
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
	if (bRet == "1")
	{
		if (document.getElementById("DataGrid")!=null)
		{
			var dll=document.getElementById("DataGrid");
			cleanWhitespace(dll);
			objID=document.all.checkbox;
			for (var i=objID.length-2 ;i>=0;i--)
			{
				if(objID[i].checked)
				{
					dll.deleteRow(i+1);
				}
			}
		}
		else
		{
			var dll=document.getElementById("content");
			cleanWhitespace(dll);
			objID=document.all.checkbox;
			for (var i=objID.length-2 ;i>=0;i--)
			{
				if(objID[i].checked)
				{
					dll.removeChild(dll.childNodes[i]);
				}
			}
		}
		document.Form1.HdnSelectedValues.value="";
	}
	document.all.loading.innerHTML=document.all.loading.innerHTML.replace("正在处理，请稍候……","操作已完成");
	window.setTimeout("document.all.loading.style.display='none';document.all.loading.innerHTML=document.all.loading.innerHTML.replace('操作已完成','正在处理，请稍候……');",1000);
}
function IsOpr_callback(res)
{
	document.Form1.HdnSelectedValues.value="";
	document.all.loading.style.display='none';
	var bRet = res.value;
	if (bRet.charAt(0) != "0")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
	else document.getElementById("info").innerHTML=bRet.substring(1,bRet.length);
}
function insertAt(parentNode,newNode,index)
{
	if(!parentNode.hasChildNodes()){
		parentNode.appendChild(newNode);
		return newNode;
	}
	try{
		parentNode.insertBefore(newNode,parentNode.childNodes[index]);
	}catch(e){
		return null;
	}
	return newNode;
}
function deletefile()
{
	if (document.Form1.HdnSelectedValues.value=="")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event("请勾选多个目录或文件删除！", 'window.close();','','');	
		return;
	}
	document.Form1.isshift.value="false";
	try
	{
		document.Form1.isshift.value=event.shiftKey;
	}
	catch(e)
	{
	}
	return confirm('确认删除？');
}
/*function deletefile()
{
	if (document.Form1.HdnSelectedValues.value=="")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event("请勾选多个目录或文件删除！", 'window.close();','','');	
		return;
	}
	if (confirm('确定删除选定的文件？'))
	{
		if (document.getElementById("DataGrid")!=null)
		{
			var dll=document.getElementById("DataGrid");
			cleanWhitespace(dll);
			objID=document.all.checkbox;
			for (var i=objID.length-2 ;i>=0;i--)
			{
				if(objID[i].checked)
				{
					dll.deleteRow(i+1);
				}
			}
		}
		else
		{
			var dll=document.getElementById("content");
			cleanWhitespace(dll);
			objID=document.all.checkbox;
			for (var i=objID.length-2 ;i>=0;i--)
			{
				if(objID[i].checked)
				{
					dll.removeChild(dll.childNodes[i]);
				}
			}
		}
		Init();
		var currpath;
		if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
		var isshift=false;
		try
		{
			isshift=event.shiftKey;
		}
		catch(e)
		{
		}
		Webdisk.ContentPane.Del(currpath,document.Form1.HdnSelectedValues.value,isshift,IsOpr_callback);
	}
}*/
function newdir()
{
	if (document.getElementById("txttmp").value!="")
	{
		Init();
		var currpath;
		if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
		Webdisk.ContentPane.newFolder(currpath,document.getElementById("txttmp").value,document.getElementById("txttmp1").value,Isnewdir_callback);
	}
}
function newdirbox() {
	var d = new dialog();d.init();
	d.set('src','');
	d.set('title','新建目录');
	d.event('<table width="100%" border="0"><tr><td><div align="right">输入新名称：</div></td><td><input name="txt" type="text" class="kuan" id="txt" onchange="document.all.txttmp.value=document.all.txt.value;" size="24" maxlength="96" /></td></tr><tr><td><div align="right">目录描述：</div></td><td><textarea name="txt1" id="txt1" cols="22" rows="3" class="kuan" onchange="document.all.txttmp1.value=document.all.txt1.value;"></textarea></td></tr></table>', 'newdir()','','');
}
function Isnewdir_callback(res)
{
	document.all.loading.style.display='none';
	var bRet = res.value;
	if ((bRet != "0") && (bRet != "1"))
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
	else
	{
		var rowcount=document.getElementById("rowcount").value;
		var currpath;
		if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
		var txttmp=document.getElementById("txttmp").value;
		
		if (document.getElementById("nospace")!=null) document.getElementById("nospace").style.display='none';
		AddRow(rowcount,currpath,txttmp,bRet,"0","","","",document.getElementById("txttmp1").value);
		
		var info=document.getElementById("info").innerHTML;
		var first=info.indexOf("：")
		var second=info.indexOf("个")
		document.getElementById("info").innerHTML=info.substring(0,first)+"："+parseInt(parseInt(info.substring(first+1,second))+1)+info.substring(second,info.length);
		rowcount++;
		document.getElementById("rowcount").value=rowcount;
	}
	document.getElementById("txttmp").value="";document.getElementById("txttmp1").value="";
}
function RenameInit(oldname,spanid,noteid)
{
	document.getElementById("txttmp1").value=oldname;
	var _row=spanid.parentNode.parentNode;
	document.getElementById("spanid").value=_row.id;
	document.getElementById("noteid").value=noteid;
	var d = new dialog();d.init();
	d.set('src','');
	if (oldname.indexOf(".")==-1)
	{
		d.set('title','目录改名');
		d.event('输入新文件夹名：<input name="txt" type="text" class="kuan" id="txt" value=\"'+oldname+'\" maxlength="96" onchange="document.all.txttmp.value=document.all.txt.value;" />', 'Rename()','','');
	}
	else
	{
		var s=oldname.lastIndexOf(".");
		var s1=oldname.substring(0,s);
		d.set('title','文件改名');
		d.event('输入新名称（不包括扩展名）：\r\n<input size=30 name="txt" type="text" class="kuan" id="txt" maxlength="96" value=\"'+s1+'\" onchange="document.all.txttmp.value=document.all.txt.value;" />', 'Rename()','','');
	}
}
function Rename(oldname)
{
	if ((document.getElementById("txttmp1").value!="") && (document.getElementById("txttmp").value!=""))
	{
		if (((document.getElementById("txttmp1").value.indexOf(".")==-1) && (document.getElementById("txttmp1").value!=document.getElementById("txttmp").value)) || ((document.getElementById("txttmp1").value.indexOf(".")!=-1) && (document.getElementById("txttmp1").value.substring(0,document.getElementById("txttmp1").value.lastIndexOf("."))!=document.getElementById("txttmp").value)))
		Init();
		var currpath;
		if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
		Webdisk.ContentPane.RenameFile(currpath,document.getElementById("txttmp1").value,document.getElementById("txttmp").value,IsRename_callback);
	}
}
function IsRename_callback(res)
{
	document.all.loading.style.display='none';
	var bRet = res.value;
	if (bRet != "")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
	else
	{
		var rowcount=document.getElementById("rowcount").value;
		var currpath,txttmp;
		if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
		var oldname=document.getElementById("txttmp1").value;
		if (oldname.indexOf(".")!=-1)
		{
			var s=oldname.lastIndexOf(".");
			var s1=oldname.substring(s,oldname.length);
			txttmp=document.getElementById("txttmp").value+s1;
		}
		else txttmp=document.getElementById("txttmp").value;
		
		if (document.getElementById("DataGrid")!=null)
		{
			var dll=document.getElementById("DataGrid");	
			var row=document.getElementById(document.getElementById("spanid").value);
			for (var i=0;i<row.cells.length;i++)
			{
				if (i==0)
				{
					if (txttmp.indexOf(".")==-1) row.cells[0].innerHTML="<input type=checkbox name=checkbox id=chkSelect onClick='AddRemoveValues(this)' value='"+currpath+txttmp+"/'>";
					else row.cells[0].innerHTML="<input type=checkbox name=checkbox id=chkSelect onClick='AddRemoveValues(this)' value='"+currpath+txttmp+"'>";
				}
				else if (i==2)
				{	
					if (txttmp.indexOf(".")==-1) row.cells[2].innerHTML="<a href=ContentPane.aspx?Path="+currpath+"/"+txttmp+"/ id='a"+rowcount+"'>"+txttmp+"</a><span id=b"+rowcount+">"+document.getElementById(document.getElementById("noteid").value).innerHTML+"</span>";
					else 
					{
						var tmp=row.cells[2].innerHTML;
						var reg=new RegExp(oldname,"gi");
						tmp=tmp.replace(reg,txttmp);
						row.cells[2].innerHTML=tmp;
					}
				}
				else if (i==5)
				{
					row.cells[5].innerHTML="<a href=\"javascript:void(0)\" onclick=\"RenameInit('"+txttmp+"',this,'b"+rowcount+"')\" title='重命名"+txttmp+"'><img src='pics/rename.gif' border=0></a>";
				}
				else if (i==6)
				{
					if (row.cells[6].innerHTML!="") 
					{
						if (txttmp.indexOf(".")==-1) row.cells[6].innerHTML="<a href=javascript:void(0) onclick=\"AddNoteInit('"+txttmp+"','b"+rowcount+"')\" title='添加注释"+txttmp+"'><img src=pics/icon_edit.gif border=0></a>";
						else
						{
							var tmp=row.cells[6].innerHTML;
							var reg=new RegExp(oldname,"gi");
							tmp=tmp.replace(reg,txttmp);
							row.cells[6].innerHTML=tmp;
						}
					}
					
				}
				else if (i==7)
				{
					if (txttmp.indexOf(".")!=-1) 
					{
						var tmp=row.cells[7].innerHTML;
						var reg=new RegExp(oldname,"gi");
						tmp=tmp.replace(reg,txttmp);
						row.cells[7].innerHTML=tmp;
					}
				}			
			}
		}
		else
		{
			var dll=document.getElementById(document.getElementById("noteid").value);

			if (txttmp.indexOf(".")==-1) 
			{
				dll.rows[0].cells[0].innerHTML="<a href='ContentPane.aspx?Path="+currpath+txttmp+"/' title='"+txttmp+"'><img src='pics/folderother.gif' border=0></a>";

				var d = new Date();
				var filetmp="<div align=center><input type=checkbox name=checkbox id=chkSelect onClick='AddRemoveValues(this)' value='"+currpath+txttmp+"'>选择&nbsp;<a href=javascript:void(0) onclick=RenameInit('"+txttmp+"',this,'"+document.getElementById("noteid").value+"') title=重命名"+txttmp+"><img src='pics/rename.gif' border=0></a>";
				filetmp=filetmp+"&nbsp;<a href='#' onclick=AddNoteInit('"+txttmp+"','"+document.getElementById("noteid").value+"') title='添加注释"+txttmp+"'><img src=pics/icon_edit.gif border=0></a>";
				filetmp=filetmp+"&nbsp;<br><a href='ContentPane.aspx?Path="+currpath+txttmp+"/'>"+txttmp+"</a>";
				filetmp=filetmp+"<br>"+parseInt(d.getYear())+"-"+(d.getMonth() + 1)+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+"</div>";
				dll.rows[1].cells[0].innerHTML=filetmp;
			}
			else 
			{
				var tmp=dll.rows[0].cells[0].innerHTML;
				var reg=new RegExp(oldname,"gi");
				tmp=tmp.replace(reg,txttmp);
				dll.rows[0].cells[0].innerHTML=tmp;
				
				var tmp=dll.rows[1].cells[0].innerHTML;
				var reg=new RegExp(oldname,"gi");
				tmp=tmp.replace(reg,txttmp);
				dll.rows[1].cells[0].innerHTML=tmp;
			}
		}
		rowcount++;
		document.getElementById("rowcount").value=rowcount;
	}
	document.getElementById("txttmp").value="";
	document.getElementById("txttmp1").value="";
}
function AddNoteInit(oldname,spanid)
{
	document.getElementById("txttmp1").value=oldname;
	document.getElementById("spanid").value=spanid;
	
	if (document.getElementById("DataGrid")!=null) var notetxt=document.getElementById(document.getElementById("spanid").value).innerHTML;
	else var notetxt=document.getElementById(document.getElementById("spanid").value).title;
	notetxt=notetxt.replace(" <FONT color=#7f7f7f>","");
	notetxt=notetxt.replace(" <FONT color=\"#7f7f7f\">","");
	notetxt=notetxt.replace("&nbsp;<FONT color=#7f7f7f>","");
	notetxt=notetxt.replace("&nbsp;<FONT color=\"#7f7f7f\">","");
	notetxt=notetxt.replace("</FONT>","");
	notetxt=notetxt.replace(" <font color=#7f7f7f>","");
	notetxt=notetxt.replace(" <font color=\"#7f7f7f\">","");
	notetxt=notetxt.replace("&nbsp;<font color=#7f7f7f>","");
	notetxt=notetxt.replace("&nbsp;<font color=\"#7f7f7f\">","");
	notetxt=notetxt.replace("</font>","");
	var d = new dialog();d.init();
	d.set('src','');
	d.set('title','添加/修改注释');
	d.event('请输入注释内容：\r\n<textarea rows="5" cols="34" name="txt" type="text" class="kuan" id="txt" maxlength="250" onchange="document.all.txttmp.value=document.all.txt.value;" />'+notetxt+'</textarea>', 'AddNote()','','');
}
function AddNote()
{
	Init();
	var currpath;
	if (getUrlParam('path')=="") currpath="/";else currpath=getUrlParam('path');
	Webdisk.ContentPane.AddNote(currpath,document.getElementById("txttmp1").value,document.getElementById("txttmp").value,IsAddNote_callback);
}
function IsAddNote_callback(res)
{
	document.all.loading.style.display='none';
	var bRet = res.value;
	if (bRet != "")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
	else
	{
		var bRet = res.value;
		if (document.getElementById("DataGrid")!=null) document.getElementById(document.getElementById("spanid").value).innerHTML="&nbsp;<font color=#7f7f7f>"+document.getElementById("txttmp").value+"</font>";
		else document.getElementById(document.getElementById("spanid").value).title=document.getElementById("txttmp").value;
	}
	document.getElementById("txttmp").value="";
}
function AddRow(rowcount,currpath,txttmp,share,fileordir,size,user,cache,note)
{
	if (currpath.substring(currpath.length-1,currpath.length)!="/") currpath=currpath+"/";
	if (document.getElementById("DataGrid")!=null)
	{		
		var dll=document.getElementById("DataGrid");
		var _tr=dll.insertRow(1);
		_tr.setAttribute("className","GridItem");
		_tr.setAttribute("class","GridItem");
		_tr.setAttribute("id","DataGrid_"+rowcount);
		_tr.onmouseover=function() {over(this);};
		_tr.onmouseout=function() {over(this);};
		
		var _td=_tr.insertCell(0);
		_td.setAttribute("align","Center");
		if (fileordir=="0") _td.innerHTML="<input type=checkbox name=checkbox id=chkSelect onClick='AddRemoveValues(this)' value='"+user+currpath+txttmp+"/'>";
		else _td.innerHTML="<input type=checkbox name=checkbox id=chkSelect onClick='AddRemoveValues(this)' value='"+currpath+txttmp+"'>";
		
		var _td=_tr.insertCell(1);
		_td.setAttribute("align","Center");
		if (share == "0") _td.innerHTML="<img src=pics/folder.gif>"; else _td.innerHTML="<img src=pics/shared.GIF>";
		if (fileordir=="1") _td.innerHTML="<img src=filetype/zip.gif>";
		var _td=_tr.insertCell(2);
		if (fileordir=="0") _td.innerHTML="<a href='ContentPane.aspx?Path="+currpath+txttmp+"/'>"+txttmp+"</a><span id=b"+rowcount+"> <font color=#7F7F7F>"+note+"</font></span>";
		else _td.innerHTML="<a href='ContentPane.aspx?down=ok&filepath="+user+currpath+txttmp+"' id='a"+rowcount+"'>"+txttmp+"</a><span id=b"+rowcount+"></span>";
		
		var _td=_tr.insertCell(3);
		_td.setAttribute("align","right");
		var _tn=document.createTextNode(size);
		_td.appendChild(_tn);
		
		var d = new Date();
		var _td=_tr.insertCell(4);
		_td.setAttribute("align","Center");
		_td.innerHTML=parseInt(d.getYear())+"-"+(d.getMonth() + 1)+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
		
		var _td=_tr.insertCell(5);
		_td.setAttribute("align","Center");
		_td.innerHTML="<a href=\"javascript:void(0)\" onclick=\"RenameInit('"+txttmp+"',this,'b"+rowcount+"')\" title='重命名"+txttmp+"'><img src='pics/rename.gif' border=0></a>";
		
		var _td=_tr.insertCell(6);
		_td.setAttribute("align","Center");
		_td.innerHTML="<a href=\"javascript:void(0)\" onclick=\"AddNoteInit('"+txttmp+"','b"+rowcount+"')\" title='添加注释"+txttmp+"'><img src=pics/icon_edit.gif border=0></a>";
		
		if (dll.rows[0].cells.length==8)
		{
			var _td=_tr.insertCell(7);
			_td.setAttribute("align","Center");
			if ((fileordir=="0")) _td.innerHTML="<a href=javascript:void(0) onclick=showcode('"+currpath+"','"+txttmp+"'); title='添加上传码"+d+"'><img src=pics/outupload.gif border=0></a>";
			else _td.innerHTML="";
		}
	}
	else
	{
		var container=document.getElementById("content");
		var divElement=document.createElement("div");
		divElement.setAttribute("class","divbody");
		divElement.setAttribute("className","divbody");
		insertAt(container,divElement,0);
		
		var _table=document.createElement("table");
		_table.setAttribute("cellpadding","2");
		_table.setAttribute("cellspacing","2");
		_table.setAttribute("class","tableborder1");
		_table.setAttribute("className","tableborder1");
		_table.setAttribute("style","width:100%;word-break:break-all;");
		_table.setAttribute("id","b"+rowcount);
		
		var _tr=_table.insertRow(0);
		var _td=_tr.insertCell(0);
		_tr.setAttribute("className","tablebody1");
		_tr.setAttribute("class","tablebody1");
		_td.setAttribute("align","Center");
		_tr.setAttribute("width","100%");
		_tr.setAttribute("height","130");
		_tr.setAttribute("valign","middle");
		if (fileordir=="0") _td.innerHTML="<a href='ContentPane.aspx?Path="+currpath+txttmp+"/'><img src='pics/folderother.gif' border=0></a>";
		else _td.innerHTML="<a id='a"+rowcount+"' href='ContentPane.aspx?down=ok&filepath="+user+currpath+txttmp+"' target=_blank><img src='filetype/zip.gif' border=0></a>";
		
		var d = new Date();
		var _tr=_table.insertRow(1);
		var _td=_tr.insertCell(0);
		_tr.setAttribute("className","tablebody2");
		_tr.setAttribute("class","tablebody2");
		
		var filetmp;
		if (fileordir=="0") filetmp="<div align=center><input type=checkbox name=checkbox id=chkSelect onClick='AddRemoveValues(this)' value='"+user+currpath+"/"+txttmp+"/'>";
		else filetmp="<div align=center><input type=checkbox name=checkbox id=chkSelect onClick='AddRemoveValues(this)' value='"+currpath+"/"+txttmp+"'>";
		
		filetmp=filetmp+"选择&nbsp;<a href=javascript:void(0) onclick=RenameInit('"+txttmp+"',this,'b"+rowcount+"') title=重命名"+txttmp+"><img src='pics/rename.gif' border=0></a>";

		filetmp=filetmp+"&nbsp;<a href='javascript:void(0)' onclick=AddNoteInit('"+txttmp+"','b"+rowcount+"') title='添加注释"+txttmp+"'><img src=pics/icon_edit.gif border=0></a>";
		
		if (fileordir=="0") filetmp=filetmp+"&nbsp;<br><a href='ContentPane.aspx?Path="+currpath+txttmp+"/'>"+txttmp+"</a>";
		else filetmp=filetmp+"&nbsp;<br><a href='ContentPane.aspx?down=ok&filepath="+user+currpath+"/"+txttmp+"'>"+txttmp+"</a>";
		filetmp=filetmp+"<br>"+size+"&nbsp;&nbsp;"+parseInt(d.getYear())+"-"+(d.getMonth() + 1)+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+"</div>";
		_td.innerHTML=filetmp;
	
		divElement.appendChild(_table);
	}
}
function Init()
{
	document.all.loading.style.top =Math.round((document.body.clientHeight-100)/2)+document.body.scrollTop-50;
	document.all.loading.style.left =Math.round((document.body.clientWidth-100)/2)-100;
	document.all.loading.style.display='';
}
function checkselect()
{
	if (document.Form1.HdnSelectedValues.value=="")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event("请勾选一个或多个文件再操作！", 'window.close();','','');	
		return false;
	}
	return true;
}

function getUrlParam(paramName){	
	var s=location.search;
	if(s!=null){
	var sarr=s.substr(1).split("&");
	var tarr;
	for(i=0;i<sarr.length;i++){
	tarr=sarr[i].split("=");
	if(tarr.length==2&&tarr[0].toLowerCase()==paramName){
	return tarr[1];
	}
	}
	return "";
	}
}
function cleanWhitespace(element) {
	for (var i = 0; i < element.childNodes.length; i++) {
		var node = element.childNodes[i];
		if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
		node.parentNode.removeChild(node);
	}
}

function show(tips,flag,url){
var my_tips=document.all.mytips;
if(flag){
	if (my_tips.style.display=="none") 
	{
		my_tips.style.display="";
		if (url!=null){my_tips.innerHTML="<div align=center><img src='"+url+"' width=100 height=100 onload=DrawImage(this)><br>"+tips+"</div>";}
		else{ my_tips.innerHTML=tips;}
	}
	my_tips.style.left=event.clientX+10;
	my_tips.style.top=event.clientY+10;
}
else 
{
my_tips.style.display="none";
}
}
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
	flag=true;
		if(image.width/image.height>= 120/80){
			if(image.width>120){  
				ImgD.width=100;
				ImgD.height=(image.height*100)/image.width;
			}else{
				ImgD.width=image.width;  
				ImgD.height=image.height;
			}
		
			}
			else{
				if(image.height>100){  
					ImgD.height=100;
					ImgD.width=(image.width*100)/image.height;     
				}else{
					ImgD.width=image.width;  
					ImgD.height=image.height;
			}
		}
	}
}
function over(obj){
try{
obj.className=(obj.className == "GridMove" ? "GridItem" : "GridMove")
}
catch(e){
}
}
function btnover(obj){
obj.className="butdiv";
}
function btnout(obj){
obj.className="";
}
function showcode(path,dir)
{
var url='uploadcode.aspx?path='+path+'&dir='+dir;
window.open(url,'','scrollbars=yes,resizable=no,status=no,toolbar=no,menubar=no,location=no,width=550,height=300');
}
function AddRemoveValues(oChk) { 
if(oChk.checked)
document.Form1.HdnSelectedValues.value += "`" + oChk.value; 
else
document.Form1.HdnSelectedValues.value = document.Form1.HdnSelectedValues.value.replace("`" + oChk.value,"");
}

function checkAll()
{
   var a = document.getElementsByTagName("input");
   var check = document.getElementById("chkSelect");
   for (var i=0; i<a.length; i++)
   {
      if (a[i].type == "checkbox" && a[i].name=="checkbox") a[i].click();
   }
}