function addUploadItem(type,path,path2,t,size)
{
	//var s=true;
	if (t=='Img')
	{
		document.all.img.value=path;
		return;
	}
	else if (t=='Logo')
	{
		document.all.logo.value=path;
		return;
	}
	else if (t=='Banner')
	{
		document.all.banner.value=path;
		return;
	}
	else
	{
		if (t=='File')
		{
			if (type=='gif'||type=='jpg'||type=='jpeg'||type=='jpe'||type=='bmp'||type=='png') {
			//s=false;
			//document.form1.indexpiclist.options[document.form1.indexpiclist.length]=new Option(path2,path);
			//document.form1.indexpiclist.selectedIndex+=1;
			//document.getElementById('vImg').innerHTML='<img src=' + path + ' height=95 width=150 />';
			document.all.img.value=path;
			}
		}
		
		var s="content";
		if(document.getElementById('intro')!=null)
		{
			s="intro";
		}
		
		if(document.getElementById('lnk')!=null)
		{
			if (document.getElementById("lnk").style.display!='none')
			{
				//if (s==true)
				//{
					document.all.dir.value=path;

					if(document.getElementById('filesize')!=null)
					{
						document.all.filesize.value=GetSize(size);
					}
						
				//}
				//return;
			}//'content'
		}

		var oEditor = FCKeditorAPI.GetInstance(s)
		type=type.toLowerCase()
		switch(type){
		case 'gif':
		oEditor.InsertHtml('<img src="' + path + '" />')
		break;
		case 'jpg':
		oEditor.InsertHtml('<img src="' + path + '" />')
		break;
		case 'png':
		oEditor.InsertHtml('<img src="' + path + '" />')
		break;
		case 'bmp':
		oEditor.InsertHtml('<img src="' + path + '" />')
		break;
		case 'jpeg':
		oEditor.InsertHtml('<img src="' + path + '" />')
		break;
		case 'mp3':
		oEditor.InsertHtml('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+path+'"></object>')
		break;
		case 'wma':
		oEditor.InsertHtml('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+path+'"></object>')
		break;
		case 'rm':
		oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="300"><param name="SRC" value="'+path+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+path+'" nojava="true" controls="ImageWindow" console="one" width="400" height="300"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="StatusBar" console="one" width="400" height="24" /></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="ControlPanel" console="one" width="400" height="24" autostart="true" loop="false" /></object>')
		break;
		case 'rmvb':
		oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="300"><param name="SRC" value="'+path+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+path+'" nojava="true" controls="ImageWindow" console="one" width="400" height="300"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="StatusBar" console="one" width="400" height="24" /></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="ControlPanel" console="one" width="400" height="24" autostart="true" loop="false" /></object>')
		break;
		case 'ra':
		oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" id="RAOCX" width="450" height="60"><param name="_ExtentX" value="6694"><param name="_ExtentY" value="1588"><param name="AUTOSTART" value="true"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="SRC" value="'+path+'"><param name="CONTROLS" value="StatusBar,ControlPanel"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><embed src="'+path+'" width="450" autostart="true" height="60"></embed></object>')
		break;
		case 'asf':
		oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
		break;
		case 'avi':
		oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
		break;
		case 'wmv':
		oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
		break;
		case 'swf':
		oEditor.InsertHtml('<embed src="'+path+'" width="400" height="300" scale="exactfit" play="true" loop="true" menu="true" wmode="Window" quality="1" type="application/x-shockwave-flash"></embed>')
		break;
		default :
		oEditor.InsertHtml('<a href="'+path+'"><img border="0" src="/images/download.gif" alt="" style="margin:0px 2px -4px 0px"/>点击下载此文件</a>')
		break;
		}
	}
}
function GetSize(size) {
  var s = "";
  var t = "";
  if (size && size < 1000)
        s =  size + "字节";
  else {
    t = FormatNumber(size.toString());
    if(t.length <= 5)
      t = t+ "字节";
    else if(t.length == 6 )
      t = t.slice(0,2) + "." + t.slice(3,-1) + "KB";
    else
      t = t.slice(0, -4) + "KB";
    s = t;
  }
  return s;
}

function FormatNumber(n) {
var s = "";
var i, j = 0;
for (i = n.length - 1; i >= 0; i--) {
  s = n.charAt(i) + s;
  if (i && ((++j % 3) == 0))
        s ="" + s;
  }
return s;
}
