﻿function ViewImage(FormName,FieldName)
{
	if (document[FormName][FieldName].value==""){
		alert("先上传后，再查看!")
	}else{
		window.open(UpPath+"/Preview.asp?UpPath="+FilePath+"&FileName="+document[FormName][FieldName].value,"","top=100,left=100,width=500,height=500")
	}
}

function DelFile(FormName,FieldName)
{
	if (document[FormName][FieldName].value==""){
		alert("没有文件，无法删除!")
	}else{
		window.open(UpPath+'/FileDel.asp?FormName='+FormName+'&EditName='+FieldName+'&UpPath='+FilePath+'&FileName='+document[FormName][FieldName].value,'','status=no,scrollbars=no,top=200,left=310,width=400,height=60')
	}
}

function UpFile(FormName,FieldName,FileType,FileSort,FileSize)
{
	if (typeof(FileSize)=="undefined"){FileSize=0}
	if ( FileType=="jpg" ){
	window.open(UpPath+'/FileSel.asp?FormName='+FormName+'&EditName='+FieldName+'&UpPath='+FilePath+'&FileType='+FileType+'&FileSort='+FileSort+'&FileSize='+FileSize+'',FieldName,'status=no,scrollbars=no,top=200,left=310,width=400,height=400')
	}else{
		window.open(UpPath+'/FileSel.asp?FormName='+FormName+'&EditName='+FieldName+'&UpPath='+FilePath+'&FileType='+FileType+'&FileSort='+FileSort+'&FileSize='+FileSize+'',FieldName,'status=no,scrollbars=no,top=200,left=310,width=400,height=80')
		}
}


function SelFile(FormName,FieldName,FileSort)
{
	window.open(UpPath+'/FileList.asp?FormName='+FormName+'&EditName='+FieldName+'&UpPath='+FilePath+'&FileSort='+FileSort+'&FileName='+document[FormName][FieldName].value+'',FileSort,'status=no,scrollbars=no,top=100,left=150,width=550,height=473')
}

function Readonly(FormName,FieldName)
{ 
	if (document[FormName][FieldName].readOnly==false){
		document[FormName][FieldName].readOnly=true;
	}else{
		document[FormName][FieldName].readOnly=false;
	}
} 
