function AttachItem(){
//	var isvalid=true;
//	var path,name,type,size,desc;
	this.path="";
	this.name=""
	this.type="";
	this.size=-1;
	this.desc="";
	this.setPath = AttachItem_setPath;
	this.getPath = AttachItem_getPath;

	this.setName = AttachItem_setName;
	this.getName = AttachItem_getName;

	this.setSize = AttachItem_setSize;
	this.getSize = AttachItem_getSize;	
	this.getSizeDesc=AttachItem_getSizeDesc;

	this.setValue = AttachItem_setValue;
	this.getValue = AttachItem_getValue;
	this.doDownload = AttachItem_doDownload;
}
function AttachItem_setPath(value)
{
	this.path=value;
}
function AttachItem_getPath(value)
{
	return this.path;
}

function AttachItem_setSize(value)
{
	this.size=value;
}
function AttachItem_getSize(value)
{
	return this.size;
}
function AttachItem_getSizeDesc(value)
{
	return this.size+"b";
}

function AttachItem_setName(value)
{
	this.name=value;
}
function AttachItem_getName()
{
	return this.name;
}

function AttachItem_setValue(value)
{	
	var n;
	var a = value.split("::");
	n = a.length;	
	if (n<3)
	{
		this.isvalid = false;
		return;
	}
	this.path = a[0];
	this.name = a[1];
	this.type = a[2];
	if (n>3)
		this.size =parseInt(a[3]);

	if (n>4)
		this.desc = a[4];

	this.isvalid = true;
}
function AttachItem_getValue()
{
	return this.path+"::"+this.name+"::"+this.type+"::"+this.size+"::"+this.desc;	
}
function AttachItem_doDownload()
{
	window.open("/aisapi/hywlgetattach.dll?GetAttach?a="+this.path+"&b="+this.name+"&c=application/binary&d=1");
}
