var customTab = {
     aIndex : "",
		 aStyles:"",
		 key:"index",
     get_aIndex : function() 
		 {
         return this.aIndex;
     },
     set_aIndex : function(aIndex) 
		 {
         this.aIndex = aIndex;
    },
     get_aStyles : function(index) 
		 {//alert(this.aStyles.length+","+this.key+","+index);
         return queryObjsByKeyVal(this.aStyles,this.key,index);
     },
     set_aStyles : function(aStyles) 
		 {
         this.aStyles = aStyles;
    },
     get_aIndex : function() 
		 {
         return this.aIndex;
     },
     set_aHeaders : function(v) 
		 {
         this.v1 = v;
    },
     get_aIndex : function() 
		 {
         return this.aIndex;
     },
     set_aData : function(v) 
		 {
         this.v1 = v;
    }
 };


function sortByaKeyVal(objs,aKeys,key,isAsc)
{
	var nObjs = [];
	if(isAsc)
	{
		for(var i = 0; i < aKeys.length; i++)
		{
			for(var j = 0; j < objs.length; j++)
			{
				if(	objs[j][key] != undefined)
				{
					if(objs[j][key] == aKeys[i])
						nObjs.push(objs[j]);
				}
			}
		}
	}
	else
	{
		for(var i =  aKeys.length - 1; i >= 0; i--)
		{
			if(	objs[j][key] != undefined)
				{
					if(objs[j][key] == aKeyVals[i])
						nObjs.push(objs[j]);
				}
		}
	}
	for(var i = 0; i < objs.length; i++)
	{
		if(	objs[i][key] == undefined)	
						nObjs.push(objs[i]);
	}
	return nObjs;
}
////////////////////////////////////////////////
var TABLE_ROW_EDIT_ID = "tab_row_edit";
var TABLE_ROW_LIST_ID = "tab_row_list";
var POP_TAB = "pop_tab";
var TABLE_EDIT_MODE = 1;
var TABLE_QUERY_MODE = 2;
var TABLE_STATUS_LIST_MODE = 3;
var TABLE_STATUS_LIST_CLOSE_MODE = 4;

var TABLE_STATUS_LIST_MAX_ROWS_AMOUNT = 50;


var DEVICE_SEARCH_TAB_COL_NAME_INDEX = 1;//设备搜索列表的设备名称列index
var DEVICE_SEARCH_TAB_COL_IP_INDEX = 3;//设备搜索列表的设备名称列index
var DEVICE_SEARCH_TAB_COL_MAC_INDEX = 6;//设备搜索列表的设备名称列index
var ADDED_DEVICE_TAB_COL_NAME_INDEX = 1;//设备搜索列表的设备名称列index
var ADDED_DEVICE_TAB_IP_NAME_INDEX = 3;//设备搜索列表的设备名称列index
var ADDED_DEVICE_TAB_VER_NAME_INDEX = 8;//设备搜索列表的设备名称列index

var EMP_TAB_COL_OPERATE_INDEX = 0;//设备搜索列表的设备名称列index
var g_currentTabListId = "";//当前设备列表
/*
删除row的cell元素，index从1开始,最后一个不移除，清空TD里内容就可以
*/
function delRowCellsById(row,index)
{
	if(index  == -1)
	{
		for(var i = row.cells.length - 1; i >=0 ;i--)
		{
			if(i != 0)
				row.removeChild(row.cells[i]);	
			else
				row.cells[i].innerHTML = "";
		}
	}
	else
	{
		row.removeChild(row.cells[index]);	
	}
}
/*表格行的onmouseover onmouseout响应*/
function responseTabRowsStyle(row,isOver)
{
	for(var i=0;i<row.cells.length;i++)
	{
		if(isOver)
			(row.cells[i]).style.backgroundColor="#e9f3fa";
		else
			(row.cells[i]).style.backgroundColor="transparent";
	}
}
var maxTabVisibleRows = 10;
function createTabeByHeader(pObj,aStyles,idStr,percent,aIndex,tabW)
{
	g_currentTabListId = "";
		pObj.innerHTML = "";
		g_aTabColWidth = null;
		aStyles = sortByaKeyVal(aStyles,aIndex,"index",true);
		var tab = document.createElement("table");
		if(aStyles[0]["fwidth"] != undefined)
			tab.colsScale = setFixedColWidthByStyle(aStyles,pObj.scrollWidth);
		tab.selfstyles = aStyles;
		tab.style.cssText = "margin-top:0px;";
		if(tabW != undefined)
			tab.width = tabW+"px";
		
		if(idStr != "")
		{
			tab.id = idStr;
			g_currentTabListId = tab.id;
		}
		tab.className = (aStyles[0]["fwidth"] == undefined)?"tab_list tab_list_class":"scroll_tab_list custom_scroll_style tab_list_class";
		if(percent > 0)
			tab.width = (percent > 100)?percent:(percent + "%");
		
		tab.cellPadding = "0";
		tab.cellSpacing = "0";
		var thead = document.createElement("thead");
		var row = document.createElement("tr");
		var obj = new Object();
		var str = "",colStr = "";
		for(var i = 0,j=0; i < aStyles.length; i++)
		{		
			var th = document.createElement("th");
			th.id = idStr + "_th_" + i;
		
			var pannel = document.createElement("div");
			pannel.className = "div_cut_string";
			pannel.style.width = ((tab.colsScale)[i]-12) + "px";
			if(tab.colsScale != null)
			{	th.style.width = (tab.colsScale)[i] + "px";str+= i+")"+th.style.width+", ";}
			if(aStyles[i]["setMode"] != undefined)
			{
				if(aStyles[i]["setMode"] == UI_MODE_CHECKBOX)
				{
					th.align = "center";
				
					//pannel.appendChild(aStyles[i]["name"]);		
					pannel = aStyles[i]["name"];
					obj.mode = aStyles[i]["setMode"];
					obj.obj = aStyles[i]["name"];
				}
			}
			else
				pannel.innerHTML  = aStyles[i]["name"];
			
			if(aStyles[i]["isDisplay"])
			{
				if(aStyles[i]["isSort"] != undefined && (aStyles[i]["isSort"]))
				{	pannel.innerHTML  += '<span class="icon_sort_list" style="font-size:1em;color:#ccc;"></span>';colStr += i + " -- "; }
			}
			th.appendChild(pannel);
			if(aStyles[i]["noWrap"] == "nowrap")
				th.noWrap = "nowrap";
		
			if(!aStyles[i]["isDisplay"])
				th.style.display = "none";
			th.isSort = aStyles[i]["isSort"];
			row.appendChild(th);
		}
		//alert(colStr);
		//alert(str);
		thead.appendChild(row);
		tab.appendChild(thead);
		
		pObj.appendChild(tab);
		if(obj.mode != undefined)
			setCellObjMode(obj.mode,obj.obj);
}
var g_aTabColWidth = null;

function setFixedColWidthByStyle(aStyles,maxWidth)
{
	g_aTabColWidth = new Array();
	var totalScaleVal = 0;
	var lastCellNotZeroIndex = -1;
	for(var i = aStyles.length - 1; i >= 0; i--)
	{
		if(aStyles[i]["fwidth"] != 0)
		{
			lastCellNotZeroIndex = i;
			break;	
		}
	}
	for(var i = 0; i < aStyles.length; i++)
	{
		totalScaleVal += aStyles[i]["fwidth"];
	}
	var countWidth = 0;
	for(var i = 0; i < aStyles.length; i++)
	{
		var cWidth = parseInt(aStyles[i]["fwidth"]/totalScaleVal*maxWidth,10);
		g_aTabColWidth.push(cWidth);
		countWidth += cWidth;
	}	
	g_aTabColWidth[lastCellNotZeroIndex] += (maxWidth - countWidth) - 1;
	return g_aTabColWidth;
}
/*插入数据到表格
tabId,amount,cols,aData,isInsertTop
*/
function initInsertRows(tabId,amount,aStyles,aData,isInsertTop,aIndex)
{
	var tab = document.getElementById(tabId);
	for(var i = 0; i < tab.childNodes.length; i++)
	{
		if(((tab.childNodes[i]).nodeName).toUpperCase() == "TBODY")	
				tab.removeChild(tab.childNodes[i]);
	}
	var tbody = document.createElement("tbody");		
	tab.appendChild(tbody);		
	for(var i = tab.rows.length - 1; i > 0; i--)
		tab.deleteRow(i);	
	var index = (isInsertTop)?1:tab.rows.length;	
	
	if(aData == null)
	{
		for(var i = 0; i < amount; i++)
		{
			//var row = tab.insertRow(index++);
			var row = document.createElement("tr");		
			tbody.appendChild(row);
			for(var j = 0; j < getColsByHeaderStyles(aStyles); j++)
			{
				//var cell = row.insertCell();		
				var cell = document.createElement("cell");		
				row.appendChild(cell);	
				cell.innerHTML = "&nbsp;";
			}
		}	
	}
	else
	{	var str = "";	
		var aDivIds = new Array();
		for(var i = 0; i < aData.length; i++)
		{	
			aData[i] = sortByaKeyVal(aData[i],aIndex,"index",true);	
			var obj = aData[i][aData[i].length - 1];	
			var row = document.createElement("tr");		
			//row.style.display = "none";
			tbody.appendChild(row);
			index++;
			row.hideContent = obj["obj"];
			row.id = tabId+"_tr_"+i;
			var cell = null;
			var objStyle = getObjStyle(aData[i][aData[i].length - 1]);
			
			if(aData[i][aData[i].length - 1].trBkColor != undefined && aData[i][aData[i].length - 1].trBkColor != "")
				row.style.backgroundColor = (aData[i][aData[i].length - 1].trBkColor);
			if(aData[i][aData[i].length - 1].trColor != undefined && aData[i][aData[i].length - 1].trColor != "")
				row.style.color = (aData[i][aData[i].length - 1].trColor);
			
			if(aData[i][aData[i].length - 1].tips != "")
			{
				row.tips = aData[i][aData[i].length - 1].tips;	
				setEasyUITooltips(row);
			}
			//2020-06-22: 测试批量删除
			if(row.className == undefined | row.className === "" | row.className == null)
				row.className = "tr_unselected";
			else
				row.className += " tr_unselected";
			var callBackRowMethod = (aData[i][aData[i].length - 1].callbackmethod != undefined)?aData[i][aData[i].length - 1].callbackmethod:"";
			str += "row:"+i+"-col:";
			
			for(var j = 0; j < aData[i].length - 1; j++)
			{	
					cell = document.createElement("td");	
					cell.id = tabId+"_td_"+i+"_"+j;	
					cell.vAlign = "middle";
					if(j < 3)
					{
						cell.onclick = cellToRowSelect;
						//console.log(cell.id);
					}	
					row.appendChild(cell);	
					
					cell.style.border = "#d4d4d5 solid 1px";						
					cell.style.height = "2.5rem";
					if((tab.colsScale) != null)
					{	cell.style.width = (tab.colsScale)[j] + "px";str += j+")"+cell.style.width+", ";}
					if(tab.selfstyles[j]["addBtnMode"] == VAR_MODE_STRING)	
					{		
						var pannel = document.createElement("div");
						pannel.className = "div_cut_string";
						pannel.id = tabId+"_"+i+"_"+j;
						aDivIds.push(pannel.id);
						//pannel.style.backgroundColor = "#37c6fa";
						pannel.innerHTML = aData[i][j]["val"];	
						pannel.style.width = ((tab.colsScale)[j]-12) + "px";
						
						cell.appendChild(pannel);
						//console.log((tab.colsScale)[j]+",,"+pannel.style.width);
						//console.log(i+"**"+j+")"+aData[i][j]["val"] );
						if(isEllipsis(pannel))
						{//console.log(i+"--"+j+")"+aData[i][j]["val"]);						
							pannel.tips = aData[i][j]["val"];	
							setEasyUITooltips(pannel);	
							pushTipsIdToStockTips({"key":pannel.id,"identify":tabId});						
						}
						
						if(checkMethodName(callBackRowMethod))
						{
							cell.onmouseover = function(){eval(callBackRowMethod + "(this.parentNode,true);")};
							cell.onmouseout = function(){eval(callBackRowMethod + "(this.parentNode,false);")};
						}
					}
					else
					{
						cell.appendChild(aData[i][j]["val"]);
						if(aData[i][j]["val"].tips != undefined)
						{
							if(aData[i][j]["val"].tips != "")
							{
								aData[i][j]["val"].id = tabId+"_obj_"+i+"_"+j; 
								setEasyUITooltips(aData[i][j]["val"]);
							}
						}
						if(tab.selfstyles[j]["setMode"] != undefined)
							setCellObjMode(tab.selfstyles[j]["setMode"],aData[i][j]["val"]);
					}
					cell.align = tab.selfstyles[j]["align"];
					cell.valign = "middle";
					if(tab.selfstyles[j]["padding"] != -1)
						cell.style.padding = tab.selfstyles[j]["padding"]+"px";
					if(tab.selfstyles[j]["noWrap"] == "nowrap")
						cell.noWrap = "nowrap";	
					if(!tab.selfstyles[j]["isDisplay"])
						cell.style.display = "none";				
				
					if(tab.selfstyles[j]["clickmethod"] != undefined)
					{
						if(tab.selfstyles[j]["clickmethod"] != "")	
						{	
							cell.newMethod = tab.selfstyles[j]["clickmethod"];
							cell.onclick = function(){eval(cell.newMethod+"(this);");};					
							cell.style.cssText = "cursor:pointer;";
							cell.onmouseover = function(){eval(callBackRowMethod + "(this.parentNode,true);")};
							cell.onmouseout = function(){eval(callBackRowMethod + "(this.parentNode,false);")};
						}
					}	
					
			}
			str += "\r\n";
		}	
		//alert(str);
		//for(var i = 0; i < tab.rows.length; i++)
		//	(tab.rows)[i].style.display = "";
	}
	
	return setSortColsTab(tabId,tab.selfstyles,aIndex);
}
var g_isFisrtExecuteCellToRowSelect = false;
var g_aEmpIDs = null;
function cellToRowSelect()
{
	if(!g_bDebugMode)
		return;
	if(g_isFisrtExecuteCellToRowSelect | g_aEmpIDs == null)
		g_aEmpIDs = [];	
	
	var row = this.parentElement;
	if(this.parentElement.className.indexOf("tr_unselected") > -1)
	{
		this.parentElement.className = this.parentElement.className.replace("tr_unselected","tr_selected");
		console.log("现在加入id="+(this.parentElement.hideContent).nID);
		g_aEmpIDs.push((this.parentElement.hideContent).nID);
	}
	else
	{
		this.parentElement.className = this.parentElement.className.replace("tr_selected","tr_unselected");
		console.log("现在移除id="+(this.parentElement.hideContent).nID);
		//console.log(g_aEmpIDs);
		for(var i = 0; i <  g_aEmpIDs.length; i++){
			if((this.parentElement.hideContent).nID === g_aEmpIDs[i])
				g_aEmpIDs.splice(i,1);
		}
		
	}
	
}
function setSortColsTab(tabId,aStyles,aIndexArr)
{
		var paraStr = '"' + tabId + '"';
		var aIndex = 0;
		aStyles = sortByaKeyVal(aStyles,aIndexArr,"index",true);
		var amount = 1;
		for(var i = 0; i < aStyles.length; i++)
		{
			if(aStyles[i]["isDisplay"] == 1 && aStyles[i]["isSort"])
				paraStr +=  ',' + i;
			if(aStyles[i]["isDisplay"] == 1)
				amount++;
		}
		//alert("new TableSorter("+ paraStr +");");
		if(amount > 0)
		{
			eval("var ret = (new TableSorter("+ paraStr +"));");
			return ret;
		}
		return null;
}
function insertContentToCell(cell,content)
{
	var pannel = getFirstChildObjByTag(cell,"div");
	pannel.innerHTML = content;		
	if(isEllipsis(pannel))
	{	
		hideEasyUITooltips(pannel);
		pannel.tips = content;	
		setEasyUITooltips(pannel);	
		pushTipsIdToStockTips({"key":pannel.id,"identify":(getFirstParentObjByTag(cell,"table")).id});						
	}	
	else
		hideEasyUITooltips(pannel);
}
//设置表格中某单元格的文件并用DIV包，根据列宽设置锁定长度
//cell单元格对像TD
//val要放入的文件
//colIpIndex列的index
function setCellInnerHTML(cell,val,colIpIndex)
{
	var tab = getFirstParentObjByTag(cell,"table");
	var pannel = document.createElement("div");
	pannel.className = "div_cut_string";
	pannel.innerHTML = val;
	pannel.style.width = ((tab.colsScale)[colIpIndex]-12) + "px";	
	cell.innerHTML = "";
	
	cell.appendChild(pannel);
	if(isEllipsis(pannel))
	{
		pannel.tips = val;	
		setEasyUITooltips(pannel);
	}
	else
		hideEasyUITooltips(pannel);
	
}
function deleteRowsToIndexByTab(tab,index)
{
	var typeName = (typeof(tab)).toString().toUpperCase();
	if(typeName != "OBJECT")
		tab = document.getElementById(tab);
	for(var i = tab.rows.length -1; i > index; i--)
	{
		(tab.rows[i].parentNode).removeChild(tab.rows[i]);
	}
}
function getColsByHeaderStyles(aStyles)
{
	var cols = "";
	for(var i = 0; i<aStyles.length; i++)
		if(aStyles[i]["isDisplay"] == 1)
			cols++;
	return cols;
}
function getColIndexByaIndex(indexVal, aIndex)
{
	for(var i = 0; i < aIndex.length; i++)
	{
		if(indexVal == aIndex[i])
			return i;
	}
	
	return -1;
}
function getColIndexByStyle(indexVal, aStyles,aIndex)
{
	var count = 0;
	var cPos = -1;
	for(var i = 0; i < aIndex.length; i++)
	{//alert(i + ")" + indexVal + " == " + aIndex[i] + ",aStyles[i].isDisplay="+aStyles[i].isDisplay+"\r\ncount="+count);
		if(indexVal == aIndex[i])
		{
			cPos = i;
			break;
		}
		if(!aStyles[i].isDisplay)
			count++;
	}
	//alert(cPos+" - "+count+" = "+(cPos - count));
	return cPos;// - count + 1;//
}
function setCellObjMode(mode,obj)
{
	switch(mode)
	{
		case UI_MODE_CHECKBOX:
			setEasyUICheckBox(obj);
			break;	
		default:
			break;
	}	
}

function getObjStyle(aRelationJson)
{
	var obj = new Object();
	obj.color = "";
	obj.tips = "";
	for(var i = 0; i < aRelationJson.length; i++)
	{
		if(aRelationJson[i]["condition"])
		{
			obj.color = (obj.color == "")?aRelationJson[i]["trBkColor"]:"";
			obj.tips += (aRelationJson[i]["tips"]+"\r\n");//&#13&#10
		}
	}
	return obj;
}
function insertTabRow(tab,tr,isBefore)
{
	var typeName = (typeof(tab)).toString().toUpperCase();
	if(typeName != "OBJECT")
		tab = document.getElementById(tab);
	var index = tr.rowIndex;
	var row = null;
	if(isBefore)
		row = tab.insertRow(index);
	else
		row = tab.insertRow(index+1);	
	return row;
}
function removeEditRow(trId)
{
	var tr = document.getElementById(trId);
	if(tr == null)
		return;
	(tr.parentNode).removeChild(tr);
}
function removeEditRowByBtn(btn)
{
	var tab = getFirstParentObjByTag(btn,"table");
	var tr = getFirstParentObjByTag(tab,"tr");
	(tr.parentNode).removeChild(tr);
	resizeSearchObj("a_add_emp","emp_search");
}
//根据内容查找TD
function searchTdByContent(tab,content,isHTML)
{
	for(var i = 0; i < tab.rows.length; i++)
	{
		for(var j = 0; j < ((tab.rows[i]).cells).length; j++)
		{
			if(isHTML)
			{
				if((tab.rows[i]).cells[j].innerHTML == content)
					return (tab.rows[i]).cells[j];	
			}
			else
			{//alert((tab.rows[i])[j].innerText+" == "+content);
				if((tab.rows[i]).cells[j].innerText == content)
					return (tab.rows[i]).cells[j];	
			}
		}	
	}
	return null
}
/*这是个老方法，不用了，改为createAbtn*/
function createSelfRectBtn(methodName,initX,initY,currentX,currentY,leftMargin,aParas)
{
	var btn  = document.createElement("div");
	btn.onmouseover = function(){modifyObjBkImgPosByOver(this,true,initX,initY,currentX,currentY);};
	btn.onmouseout = function(){modifyObjBkImgPosByOver(this,false,initX,initY,currentX,currentY);};
	btn.onclick = function(){eval(methodName+"(this);")};
	btn.style.cssText = 'float:left;margin-left:'+leftMargin+'px;width:37px;height:28px;background:url(images/btns.png) '+initX+'px '+initY+'px no-repeat;cursor:pointer;';
	btn.hideContent = (aParas == null)?"":aParas;
	return btn;
}
//动态生成编辑行
function initEditRowUI(tdObj,jsons,saveMethodName,aParas)
{//alert(tdObj+","+jsons+","+saveMethodName+","+aParas);
	var tab = document.createElement("table");
	tab.cellPadding = "0";
	tab.cellSpacing = "0";
	tab.border = "0";
	tab.width = "100%";
	var fillDiv = '<div style="width:2px;height:40px;"></div>';
	var maxWidth = 0;
	for(var i = 0;i < jsons.length; i++)
	{
		var div = document.createElement("div");
		div.style.cssText = 'float:left;font-family: '+getLanTextByKey("C_WEB_FONT_FAMILY")+';font-weight: 300;font-size:1.2em;letter-spacing:2px;';
		
		div.innerHTML = jsons[i]["name"];
		tdObj.appendChild(div);
		maxWidth = (maxWidth < div.offsetWidth)?div.offsetWidth:maxWidth;
		tdObj.removeChild(div);
	}
	maxWidth += 10;
	var row = null;
	var cell = null;
	for(var i = 0; i < Math.ceil(jsons.length/2); i++)
	{
		var index = i*2;
		row = tab.insertRow();
		cell = row.insertCell();
		cell.align = "left";
		cell.style.cssText = "border:#ccc solid 0px;padding:2px;";
		cell.width = maxWidth+"px";
		cell.innerText = jsons[index]["name"];
		
		cell = row.insertCell();
		if(jsons.length == 1)
			cell.width = "360px";
		cell.style.cssText = "border:#ccc solid 0px;padding:2px;";
		cell.align = "left";
		
		if(jsons[index]["type"] == 1 & jsons[index]["data"] != null)
		{
			cell.innerHTML = fillDiv;
			cell.id = jsons[index]["id"];
			cell.appendChild(jsons[index]["data"]);
		}
		else
		{//alert(i+" ) "+index+"->"+jsons[index]["maxlen"]+"-->"+jsons[index]["name"]+"==id:"+jsons[index]["id"]);
			if(jsons[index]["maxlen"] == undefined)
				cell.appendChild(initSelfInput(jsons[index]["tips"],jsons[index]["value"],jsons[index]["id"],jsons[index]["type"],-1),-1,-1);
			else
			{//alert(i+" ) "+jsons[index]["maxlen"]+"-->"+jsons[index]["name"]+"==id:"+jsons[index]["id"]);
				cell.appendChild(initSelfInput(jsons[index]["tips"],jsons[index]["value"],jsons[index]["id"],jsons[index]["type"],-1,-1,jsons[index]["maxlen"],jsons[index]["error"]));
			}
		}
		
		if(jsons.length > 1)
		{
			index = i*2+1;
			//alert(i+" ) "+index+"->"+jsons[index]["id"]);
			cell = row.insertCell();
			cell.align = "left";
			cell.style.cssText = "border:#ccc solid 0px;padding:2px;";
			cell.width = maxWidth+"px";
			cell.innerText = (index < jsons.length)?jsons[index]["name"]:"";
			cell = row.insertCell();
			cell.style.cssText = "border:#ccc solid 0px;padding:2px;";
			cell.align = "left";
			
			if(index < jsons.length)
			{
				if(jsons[index]["type"] == 1 & jsons[index]["data"] != null)
				{
					cell.innerHTML = fillDiv;
					cell.id = jsons[index]["id"];
					cell.appendChild(jsons[index]["data"]);
				}
				else
				{ 
					if(jsons[index]["maxlen"] == undefined)
						cell.appendChild(initSelfInput(jsons[index]["tips"],jsons[index]["value"],jsons[index]["id"],jsons[index]["type"],-1));
					else
						cell.appendChild(initSelfInput(jsons[index]["tips"],jsons[index]["value"],jsons[index]["id"],jsons[index]["type"],-1,-1,jsons[index]["maxlen"],jsons[index]["error"]));
				}
			}
		}
		
	}
	if(jsons.length > 1)
		row = tab.insertRow();
	cell = row.insertCell();
	cell.colSpan = (jsons.length > 1)?4:2;
	cell.style.cssText = ((jsons.length > 1)?"border-top:#ccc dotted 1px;border-left:#ccc solid 0px;border-right:#ccc solid 0px;border-bottom:#ccc solid 0px;":"border:#ccc solid 0px;")+"padding:4px;";
	cell.align  = (jsons.length > 1)?"center":"left";
	cell.valign = "middle";
	/*
	var btnSave = '<div onmouseover ="modifyObjBkImgPosByOver(this,true,-251,0,-251,-28);" onclick="'+saveMethodName+'();" onmouseout ="modifyObjBkImgPosByOver(this,false,-251,0,-251,-28);" style="float:left;margin-left:0px;width:37px;height:28px;background:url(images/btns.png) -251px 0px no-repeat;cursor:pointer;"></div>';
	var btnCancel = '<div onmouseover ="modifyObjBkImgPosByOver(this,true,-326,-56,-326,-28);" onclick="removeEditRowByBtn(this);" onmouseout ="modifyObjBkImgPosByOver(this,false,-326,-56,326,-28);" style="float:left;margin-left:30px;width:37px;height:28px;background:url(images/btns.png) -326px -56px no-repeat;cursor:pointer;"></div>';
	var btnStr = '<div style="width:177px;height:28px;">'+btnSave+btnCancel+'</div>';
	
	cell.innerHTML = btnStr;	*/
	
	var btnSave = createSelfRectBtn(saveMethodName,-251,0,-251,-28,0,aParas);
	btnSave.style.marginLeft = "80px";
	var btnCancel = createSelfRectBtn("removeEditRowByBtn",-326,-56,-326,-28,30,null);
	var pack  = document.createElement("div");
	pack.style.marginLeft = "10px";
	pack.appendChild(btnSave);
	pack.appendChild(btnCancel);
	cell.appendChild(pack);
	
	tdObj.appendChild(tab);
}