/*
	Copyright Interactive Co.,Ltd 2005;
	update : 2005-04-24;
*/
function cs_anglil(td,name)
{
	this.vname = name;
	this.vnum = 0;
	this._td = td;
	this.vlang = new Array();
	this.vcode = new Array();
	this.vtitle = new Array();
	this.vbuturl = new Array();
	this.vhide = new Array();
	this.vdelimg = new Array();
	this.vbr = new Array();
	this.vtreearray = new Array();
	this.vcode1 = '';
	this.vtitle1 = '';
	
	this.treecode = function(vcode,vtitle)
	{
		this.vcode1 = vcode;
		this.vtitle1 = vtitle;
		this.vaddinput();
	}
		
	this.vurl = function (vi)
	{
		 var vtop = 300;
		 var vleft = 670;
		 var vwidth = 330;
		 var vheight = 350;
	  
		 window.showModalDialog( "/insys/test.php?vnum=" + vi, "Info","dialogWidth:"+vwidth +"px;dialogHeight:"+vheight+"px;dialogTop:300px;dialogLeft:670px;help:no;scroll:no;status:no" );
	}
	
	this.vaddinput = function ()
	{
		this.vnum++;
		var vtd = document.getElementById( this._td );
		var vsize = 47;
		
		this.vdelimg[this.vnum] = document.createElement( '<img src="/image/b_drop.png" align="absmiddle" alt="Хасах" style="cursor:hand;" class="butpro" onclick="' + this.vname + '.vdelinput(' + this.vnum + ')">' );
		vtd.appendChild(this.vdelimg[this.vnum]);
	
		this.vcode[this.vnum] = document.createElement( '<input id="vtreecode' + this.vnum + '" class="stextbox1" size="10" name="vtreecode' + this.vnum + '" type="text" value="' + this.vcode1 + '">' );
		vtd.appendChild(this.vcode[this.vnum]);
		
		this.vtitle[this.vnum] = document.createElement( '<input id="vtreename' + this.vnum + '" class="stextbox2"  size="' + vsize  + '" name="vtreename' + this.vnum + '" type="text" value="' + this.vtitle1 + '">' );
		vtd.appendChild(this.vtitle[this.vnum]);
		
		//this.vbuturl[this.vnum] = document.createElement( '<input class="butpro" style="cursor:hand;" onclick="return ' + this.vname + '.vurl(' + this.vnum + ') " type="button" value="...">' );
		//vtd.appendChild(this.vbuturl[this.vnum]);
		
		this.vhide[this.vnum] = document.createElement( '<input name="vmaxtree" id="vmaxtree" type="hidden" value="' + this.vnum + '">' );
		vtd.appendChild(this.vhide[this.vnum]);
		
		this.vbr[this.vnum] = document.createElement( '<br/>' );
		vtd.appendChild(this.vbr[this.vnum]);
		this.vcode1 = '';
		this.vtitle1 = '';
	}
	
	this.vdelinput = function (vi)
	{
		var vtd = document.getElementById( this._td );
		vtd.removeChild(this.vdelimg[vi]);
		vtd.removeChild(this.vcode[vi]);
		vtd.removeChild(this.vtitle[vi]);
		//vtd.removeChild(this.vbuturl[vi]);
		vtd.removeChild(this.vhide[vi]);
		vtd.removeChild(this.vbr[vi]);
	}
	
	
}

