// JavaScript Document
//File Name		：	upfile.js
//Description	：	附件上传脚本
//Company		：	PilotSoft
//Programer		：	CODD ZOU
//Make Date		：	2007-10-11
//Change		：	2007-10-11
function outPut(Form_value,InputName){
	var text = Form_value.value;
	var win = window.open('','upfile','scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,top=10,left=10,width=417,height=290');
	win.document.writeln("<title>上传文件</title>");
	win.document.writeln("<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=gb2312\">");
	win.document.writeln("<link rel=\"stylesheet\" href=\"../manner/style.css\" type=\"text/css\">");
	win.document.writeln(text);
	
	win.document.writeln("<scr"+ "ipt lang" + "uage=\"jav"+"ascript\">");
	win.document.writeln("function checkupfile(){");
		win.document.writeln("if (document.forms.upto.src.value==\"\"){");
			win.document.writeln("alert(\"请选择需上传的文件！\");");
			win.document.writeln("document.forms.upto.src.focus();");
			win.document.writeln("return false;");
		win.document.writeln("}else{");
			win.document.writeln("var value_field;");
			win.document.writeln("var value_check;");
			win.document.writeln("var rsNum=0;");
			win.document.writeln("value_check = \".\";");
			win.document.writeln("value_field = document.forms.upto.src.value;");
			win.document.writeln("value_field = value_field.substr(value_field.lastIndexOf(value_check)+1,value_field.length);");
			win.document.writeln("var Check_field =\"rar|zip|txt|pdf|ppt|xls|xlsx|doc|docx|gif|jpg|jpeg|png|bmp|swf|mp3|rm|wmv|wma|mpg|rmvb|asf\";");
			win.document.writeln("var Check_array =Check_field.split(\"|\");");
			win.document.writeln("for(loop=0;loop<Check_array.length;loop++){");
				win.document.writeln("if(value_field==Check_array[loop]){");
					win.document.writeln("rsNum=1;");
					win.document.writeln("break;");
				win.document.writeln("}");
			win.document.writeln("}");
			win.document.writeln("if(rsNum==0){");
				win.document.writeln("alert(\"您上传的文件是不符合格式的的文件！\\n支持上传的文件格式有：\\n*.rar,*.zip,*.txt,*.pdf,*.ppt,*.xls,*.xlsx,*.doc,*.docx\\n*.gif,*.jpg,*.jpeg,*.png,*.bmp,*.swf\\n*.mp3,*.rm,*.wmv,*.wma,*.mpg,*.rmvb,*.asf\");");
				win.document.writeln("return false;");
			win.document.writeln("}");
		win.document.writeln("}");
	win.document.writeln("}");
	win.document.writeln("<\/scr"+ "ipt>");

	win.document.writeln("<form method=\"post\" action=\"sub_upload.asp?temp="+ InputName +"\" name=\"upto\" id=\"upto\" enctype=\"multipart\/form-data\">");
	win.document.writeln("<table border=0 cellspacing=0 cellpadding=0 align=center width=333>");
	win.document.writeln("<tr>");
	win.document.writeln("<td height=20 width=60>&nbsp;文件</TD>");
	win.document.writeln("<td height=16 width=371>");
	win.document.writeln("<input type=\"file\" name=\"src\" id=\"src\" size=\"20\" value=\"浏览\">");
	win.document.writeln("&nbsp;&nbsp;");
	win.document.writeln("<input type=\"submit\" value=\"上传\" onClick=\"return checkupfile()\" name=\"B1\" IsShowProcessBar=\"True\">");
	win.document.writeln("</td>");
	win.document.writeln("</tr>");
	win.document.writeln("</table>");
	win.document.writeln("</form>");
	
	win.document.close();
	win.focus();
}

