var tmpmindt=new Date(('1900-1-1').replace(/-/g,'/'));
var tmpmaxdt=new Date(('2050-1-1').replace(/-/g,'/'));
var DT_resize_nowX=-100;
var DT_fontSize;
var DT_resize_oldcellwidth;
var DT_resize_oldtablewidth;
var DT_SortUpText='COLOR: #000000; FONT-FAMILY: webdings;';
var DT_SortDownText=DT_SortUpText;
var DT_Grid_EnableInert=false;
var DT_Grid_EnableDel=false;
var DT_Grid_EnableEdt=false;
var DTable_rowIndex=0;
var DTable_cellIndex=0;
var blislistdatetime=false;
var isDataGridMode=false;
var DT_gdCtrl = new Object();
var goSelectTag = new Array();
var gcGray = "#808080";
var gcToggle = "#ffff00";
var gcBG = "#eeeeee";
var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();
var DtableinputYY;
var DtableinputMM;
var DtableinputDD;
var Dtableinputhh;
var Dtableinputmm;
var Dtableinputss;

function loadThreadFollow(t_id)
	{		var tmptr=eval('document.all.dtabletr' + t_id);
		var tmpimg=eval('document.all.dtable_childimg' + t_id);
		if(tmptr.style.display=='none')
			{
			tmptr.style.display='';
tmpimg.src=DT_imgpath +  'dtable_close.gif';
}
else
{
	tmptr.style.display='none';
	tmpimg.src=DT_imgpath + 'dtable_open.gif';
	}
	}
var DTableMoveBoxbV = parseInt(navigator.appVersion);var DTableMoveBoxNN4 = document.layers ? true : false;var DTableMoveBoxIE4 = document.all && DTableMoveBoxbV >= 4 ? true : false;

function DTableMoveBoxshowTip(msg){ var DTableMoveBoxobj = 'DTableMoveBoxTip'; 
if (DTableMoveBoxNN4) { 
	if (document.layers[DTableMoveBoxobj] != null)   document.layers[DTableMoveBoxobj].visibility = 'hidden';
	}
	else if(DTableMoveBoxIE4) 
		document.all[DTableMoveBoxobj].style.visibility = 'hidden'; 
	if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut); 
	if (DTableMoveBoxNN4) {  if (document.layers[DTableMoveBoxobj].visibility != 'visible')  { 
		with (document[DTableMoveBoxobj].document)   {  
			open();   
			//alert('ok');
			write('<layer id=DTableMoveBoxTip bgColor=#ffffee style=\"width: 600px; border: 1px solid #000000\" onMouseover=\"DTableMoveBoxkeepTip()\" onMousewheel=\"DTableMoveBoxkeepTip()\" onMouseout=\"DTableMoveBoxhideTip()\">' + msg + '</layer>');   
	close(); 
	}
	var DTableMoveBoxobjp = document.layers.DTableMoveBoxTip;   DTableMoveBoxobjp.moveTo(50, e.y + 6);  
	}
	document.layers[DTableMoveBoxobj].visibility = 'visible';
	}
	else if(DTableMoveBoxIE4)
		{  
		
		if (document.all[DTableMoveBoxobj].style.visibility != 'visible')  
		{ 
		document.all[DTableMoveBoxobj].innerHTML = msg;
		var y = event.y; 
		var DTableMoveBoxobjp = document.all.DTableMoveBoxTip.style;
		var yy = document.body.scrollTop + y + 12; 
		DTableMoveBoxobjp.pixelLeft = event.x + 10; 
		DTableMoveBoxobjp.pixelTop = yy; 
//document.all[DTableMoveBoxobj].top=yy;
//document.all[DTableMoveBoxobj].left=event.x + 10;
	//	alert(yy);
		}  document.all[DTableMoveBoxobj].style.visibility = 'visible'; 
		}
		}

function DTableMoveBoxkeepTip(){ var DTableMoveBoxobj = 'DTableMoveBoxTip'; if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut); if (DTableMoveBoxNN4)  document.layers[DTableMoveBoxobj].visibility = 'visible'; else if(DTableMoveBoxIE4)  document.all[DTableMoveBoxobj].style.visibility = 'visible';}function DTableMoveBoxhideTip(){ hideTimeOut = setTimeout('DTableMoveBoxdelayHide()', 180);}

function DTableMoveBoxdelayHide(){ var DTableMoveBoxobj = 'DTableMoveBoxTip';  if (DTableMoveBoxNN4) {  if (document.layers[DTableMoveBoxobj] != null)   document.layers[DTableMoveBoxobj].visibility = 'hidden'; } else if(DTableMoveBoxIE4)  document.all[DTableMoveBoxobj].style.visibility = 'hidden'; if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);}

if (DTableMoveBoxIE4){
	
	document.write('<div id=DTableMoveBoxTip style=\"width: 400px; position: absolute; visibility: hidden; padding: 5px 5px 5px 5px; background-Color: #ffffee; filter: progid:DXImageTransform.Microsoft.Shadow(Color=#333333,Direction=120,strength=5); border: 1px solid #000000; z-index: 99\" onMouseover=\"DTableMoveBoxkeepTip()\" onMousewheel=\"DTableMoveBoxkeepTip()\" onMouseout=\"DTableMoveBoxhideTip()\"></div>');}
else if (DTableMoveBoxNN4)
	{ document.write('<div id=DTableMoveBoxTip style=\"position: absolute; visibility: hidden; background-Color: #ffffee; filter: alpha(Opacity=80); border: 1px solid #000000; z-index: 99\"></div>'); 
	setTimeout('window.onResize=setReload', 500);}


	function showdtablesearchlay(){if (document.getElementById('dtablesearch')){var x=window.screen.width;var y=window.screen.height;dtablesearch.style.left=(x-550)/2;dtablesearch.style.top=(y-400)/2;dtablesearch.style.visibility='visible';}}
	
	
	
	function hiddendtablesearchlay(){if (document.getElementById('dtablesearch')){dtablesearch.style.visibility='hidden';}}function checksearchform(){var strtmp='';for(var i=0;i<19;i++){var tmpnowvalue='';if(eval(document.getElementById('dtableautomakesearch' + i))!=null){tmpnowvalue='';var objtype='';if (eval('document.all.dtableautomakesearch' + i + '.type')==null){objtype='radio';}else{objtype=eval('document.all.dtableautomakesearch' + i + '.type');}if (objtype.indexOf('radio')>-1){for(var tmpii=0;tmpii<2;tmpii++){if(document.all('dtableautomakesearch' + i)[tmpii].checked){tmpnowvalue=document.all('dtableautomakesearch' + i)[tmpii].value;}}}else if(objtype.indexOf('text')>-1){tmpnowvalue=eval('document.all.dtableautomakesearch' + i + '.value');}else if(objtype.indexOf('select')>-1){for(var iii=0;iii<document.all('dtableautomakesearch' + i).options.length;iii++){if(document.all('dtableautomakesearch' + i).options[iii].selected==true){tmpnowvalue=document.all('dtableautomakesearch' + i).options[iii].value;}}}if(tmpnowvalue!='' || tmpnowvalue!='undefined'){strtmp+='&dtableautomakesearch' + i + '=' + escape(tmpnowvalue);}}}window.open('?active=send' + strtmp,'_self','');}


function DT_fPopCalendar(popCtrl, dateCtrl,YY,MM,DD,hh,mm,ss){ event.cancelBubble=true; 
DtableinputYY=YY;
DtableinputMM=MM;
DtableinputDD=DD;
Dtableinputhh=hh;
Dtableinputmm=mm;
Dtableinputss=ss;DT_gdCtrl = dateCtrl;
DT_fSetYearMon(DtableinputYY, DtableinputMM);
DT_fSetHms(Dtableinputhh,Dtableinputmm,Dtableinputss); 
var point = DT_fGetXY(popCtrl);
//scrollTop
var divtop=0;
if(document.getElementById('DTable_SettledTableTitle'))
	{
	divtop=DTable_SettledTableTitle.scrollTop;
	}//DTable_SettledTableTitle.scrollTop;



with (VicPopCal.style) { 
	//left = point.x;	
	//top=event.clientY;
	left=event.clientX;
	
//	point.y=point.y + divtop;
	width = VicPopCal.offsetWidth;	
	height = VicPopCal.offsetHeight;	
	top=event.clientY;//divtop;
	//point.x=event.clientX;
	//point.y=event.clientY;
	fToggleTags(left,top,width,height);
	
	visibility = 'visible';
	} VicPopCal.focus();}

function DT_fSetHms(hh,mm,ss){
Dtablehour.selectedIndex=hh;
Dtableminute.selectedIndex=mm;
Dtablesecond.selectedIndex=ss;
}

function DT_fSetDate(iYear,iMonth,iDay,ihour,iminute,isecond)	 { var themonth=new String(iMonth); var theday=new String(iDay); if (themonth.length ==1 ) { iMonth="0" + themonth;	 } if (theday.length ==1) { iDay="0" + theday; } var dihour=new String(ihour); var diminute=new String(iminute); var disecond=new String(isecond); var tmpdatetime=new String(); if(dihour=="0" && diminute=="0" && disecond=="0") {tmpdatetime = iYear+"-"+iMonth+"-"+iDay; } else { if(dihour.length==1) { dihour="0" + dihour; } if(diminute.length==1) { diminute="0" + diminute; } if(disecond.length==1) { disecond="0" + disecond; } tmpdatetime = iYear+"-"+iMonth+"-"+iDay + " " + dihour + ":" + diminute + ":" + disecond; } 
var tmpselectdt=Date.parse(tmpdatetime.replace(/-/g,"/")); 

if (tmpselectdt<tmpmindt)
{ 
	alert('您选择的日期/时间不能小于' + tmpmindt.toLocaleString());
	return;
	} 
	if(tmpselectdt>tmpmaxdt) 
	{ 
		//alert('您选择的日期/时间不能大于' + tmpmaxdt.toLocaleString());
		return; 
		} 
		DT_gdCtrl.value =tmpdatetime; 
		DT_fHideCalendar(); 
		}

function DT_fHideCalendar(){


if(blislistdatetime==true && DTable_rowIndex>0 && DTable_cellIndex>0)//如果是listdatetime
{

DT_Listfun_setTdinnerHtml(DTable_rowIndex,DTable_cellIndex,'dt');//把控件的值赋予td
blislistdatetime=false;
DTable_rowIndex=0;
DTable_cellIndex=0;

}
 VicPopCal.style.visibility = "hidden";
DT_ShowallSelect();

			/*
			if ((item(i).Victor!="Won")&&DT_fTagInBound(item(i)))
			{
			item(i).style.visibility = "visible"; 
			goSelectTag[goSelectTag.length] = item(i); 
			}
*/
	



  } 
  
  
  function DT_ShowallSelect()
  {
with (document.all.tags("SELECT")){ 
		for (i=0; i<length; i++) 
	{
		var obj=item(i);
		if(obj.name.indexOf('se_')>-1)
		{item(i).style.visibility = "visible"; 
		}
		}
}
  }
  function DT_fGetSelected(aCell)
  { 
 
var iihour=Dtablehour.value; 
var iiminute=Dtableminute.value;
var iisecond=Dtablesecond.value; 
var iOffset = 0;
var iYear = parseInt(tbSelYear.value); 
var iMonth = parseInt(tbSelMonth.value); 
aCell.bgColor = gcBG;
 with (aCell.children["cellText"])
  { 
 var iDay = parseInt(innerText);
  if (color==gcGray) iOffset = (Victor<10)?-1:1;
  	 iMonth += iOffset; 
  	 if (iMonth<1) { iYear--; iMonth = 12; } 
  	 else if(iMonth>12){iYear++; iMonth = 1;}
  	 }
  	  if(iihour.length==1)
  	  {
  	  iihour='0' + iihour;
  	  }
  	   if(iiminute.length==1)
  	  {
  	  iiminute='0' + iiminute;
  	  }
  	  if(iisecond.length==1)
  	  {
  	  iisecond='0' + iisecond;
  	  }
  	  
  	  
  	   if(iDay.toString().length==1)
  	  {
  	  iDay='0' + iDay;
  	  }
  	   if(iMonth.toString().length==1)
  	  {
  	  iMonth='0' + iMonth;
  	  }
  	  
  	    return '【' + iYear + '-' + iMonth + '-' + iDay + ' ' + iihour + ':' + iiminute + ':' + iisecond + '】';

  	  }
function DT_fSetSelected(aCell){ 
var iihour=Dtablehour.value; 
var iiminute=Dtableminute.value;
var iisecond=Dtablesecond.value; 
var iOffset = 0;
var iYear = parseInt(tbSelYear.value); 
var iMonth = parseInt(tbSelMonth.value); 
aCell.bgColor = gcBG;
 with (aCell.children["cellText"]) { 
 var iDay = parseInt(innerText);
  if (color==gcGray) iOffset = (Victor<10)?-1:1;
  	 iMonth += iOffset; 
  	 if (iMonth<1) { iYear--; iMonth = 12; } else if(iMonth>12){iYear++; iMonth = 1;}} DT_fSetDate(iYear, iMonth, iDay, iihour, iiminute, iisecond);}


function Point(iX, iY){
	//alert(this);
	this.x = iX;	
	this.y = iY;
	//this.x=event.clientX;
	//this.y=event.clientY;
	}


function fBuildCal(iYear, iMonth) { var aMonth=new Array(); for(i=1;i<7;i++) 	aMonth[i]=new Array(i); var dCalDate=new Date(iYear, iMonth-1, 1); var iDayOfFirst=dCalDate.getDay(); var iDaysInMonth=new Date(iYear, iMonth, 0).getDate(); var iOffsetLast=new Date(iYear, iMonth-1, 0).getDate()-iDayOfFirst+1; var iDate = 1; var iNext = 1; for (d = 0; d < 7; d++)	aMonth[1][d] = (d<iDayOfFirst)?-(iOffsetLast+d):iDate++; for (w = 2; w < 7; w++) 	for (d = 0; d < 7; d++)		aMonth[w][d] = (iDate<=iDaysInMonth)?iDate++:-(iNext++); return aMonth;}

function DT_fDrawCal(iYear, iMonth, iCellHeight, iDateTextSize) 
	{
	var WeekDay=new Array('日','一','二','三','四','五','六');
	var styleTD = " bgcolor='"+gcBG+"' bordercolor='"+gcBG+"' VALIGN='middle' align='center' height='"+iCellHeight+"' style='font:bold "+iDateTextSize+" 宋体;";
	
	with (document) 
		{	
		write("<tr>");	
	for(i=0; i<7; i++)	
		write("<TD "+styleTD+" color:#990000' >" + WeekDay[i] + "</td>");	
	write("</tr>"); 	
	for (w = 1; w < 7; w++) 
		{
		write("<tr>");	
	for (d = 0; d < 7; d++)
		{

write("<TD id=calCell "+styleTD+"cursor:hand;' onMouseOver=\"this.bgColor=gcToggle;document.all.DT_ct_ShowTD.innerHTML=DT_fGetSelected(this);\" onMouseOut='this.bgColor=gcBG' onclick='DT_fSetSelected(this)'>");write("<font id=cellText Victor='Liming Weng'> </font>");
write("</td>")}write("</tr>");
}
}
}

function DT_fUpdateCal(iYear, iMonth) 
{
 myMonth = fBuildCal(iYear, iMonth);
 var i = 0;
  for (w = 0; w < 6; w++)
  	 for (d = 0; d < 7; d++)
with (cellText[(7*w)+d])
{
Victor = i++;
if (myMonth[w+1][d]<0)
 {
 color = gcGray;
 innerText = -myMonth[w+1][d];
 			}
 			else
 			{
 			color = ((d==0)||(d==6))?"red":"black";
 			innerText = myMonth[w+1][d];
 			if(innerText==DtableinputDD){
 			color = "blue";
 			}
 			}
 			
 			 				}
 				}
 				

 function DT_fSetYearMon(iYear, iMon){ tbSelMonth.options[iMon-1].selected = true; for (i = 0; i < tbSelYear.length; i++)
 	if (tbSelYear.options[i].value == iYear)
 	tbSelYear.options[i].selected = true; 
 	DT_fUpdateCal(iYear, iMon);
 	} 
 	
 	function DT_fPrevMonth() {
 	 var iMon = tbSelMonth.value; 
 	 var iYear = tbSelYear.value; 
 	 if (--iMon<1) {	
 	  iMon = 12;
 	  	 iYear--; 
 	  	 } 
 	  	 DT_fSetYearMon(iYear, iMon);
 	  	 }

function DT_fNextMonth(){ var iMon = tbSelMonth.value; var iYear = tbSelYear.value; if (++iMon>12) {	 iMon = 1;	 	 iYear++; } 	 DT_fSetYearMon(iYear, iMon);}	

//fToggleTags(left,top,width,height);
function fToggleTags(left1,top1,width1,height1){

if(left1==null || top1==null || width1==null || height1==null)
	{
	return false;
	}

	var theleft=left1;
	var thewidth=parseInt(replace(width1.toString(),'px',''));
	theleft=(replace(theleft.toString(),'px','')).toString();

	with (document.all.tags("SELECT")){ 
		for (i=0; i<length; i++) 
		{
			var obj=item(i);
			var thistop=DT_getPosition(obj).top;
			var thisleft=DT_getPosition(obj).left;
			if(thisleft>theleft && thisleft<(theleft + thewidth) && obj.name.indexOf('se_')>-1)
			{
				
item(i).style.visibility = "hidden"; 
			//goSelectTag[goSelectTag.length] = item(i); 
			}

		
			/*
			if ((item(i).Victor!="Won")&&DT_fTagInBound(item(i)))
			{

			item(i).style.visibility = "hidden"; 
			goSelectTag[goSelectTag.length] = item(i); 
			}
			*/
		}

			}
			}



function DT_fTagInBound(aTag){ with (VicPopCal.style){ 	var l = parseInt(left); 	var t = parseInt(top); 	var r = l+parseInt(width); 	var b = t+parseInt(height);	var ptLT = DT_fGetXY(aTag);	return !((ptLT.x>r)||(ptLT.x+aTag.offsetWidth<l)||(ptLT.y>b)||(ptLT.y+aTag.offsetHeight<t)); }}


 function DT_fGetXY(aTag){
 var oTmp = aTag;
 var pt = new Point(0,0); 
 var divtop=0;
 /*
if(document.getElementById('DTable_SettledTableTitle'))
	{
	divtop=DTable_SettledTableTitle.scrollTop;
	}
	*/
 do { 
pt.x += oTmp.offsetLeft; 
pt.y += oTmp.offsetTop; 
oTmp = oTmp.offsetParent; }
 while(oTmp.tagName!="BODY"); 
 return pt;}


 
 var gMonths=new  Array("&nbsp;一月","&nbsp;二月","&nbsp;三月","&nbsp;四月","&nbsp;五月","&nbsp;六月","&nbsp;七月","&nbsp;八月","&nbsp;九月","&nbsp;十月","十一月","十二月");
 
 with (document) 
	 {
		 write("<Div id='VicPopCal' onclick='event.cancelBubble=true' style='POSITION:absolute;visibility:hidden;border:0px ridge;width:10;z-index:999;FILTER: progid:DXImageTransform.Microsoft.Shadow(Color=#333333,Direction=120,strength=5)'>");
		 
		 write("<table border='1' bgcolor='cccccc' cellspacing=\"1\" cellpadding=\"0\">");
		 
		 write("<tr>");
		 
		 write("<TD VALIGN='middle' align='center'><input type='button' name='PrevMonth' value='<' onClick='DT_fPrevMonth()'>");
		 
		 write("&nbsp;<SELECT name='tbSelYear' onChange='DT_fUpdateCal(tbSelYear.value, tbSelMonth.value)' Victor='Won'>");
 
 for(i=parseInt(tmpmindt.getFullYear().toString());i<=parseInt(tmpmaxdt.getFullYear().toString());i++)	write("<OPTION value='"+i+"'>"+i+"年</OPTION>");write("</SELECT>"); write("&nbsp;<select name='tbSelMonth' onChange='DT_fUpdateCal(tbSelYear.value, tbSelMonth.value)' Victor='Won'>");
 
 for (i=0; i<12; i++)write("<option value='"+(i+1)+"'>"+gMonths[i]+"</option>");write("</SELECT>");write("&nbsp;<input type='button' name='PrevMonth' value='>' onclick='DT_fNextMonth()'>");write("</td>");write("</tr><tr>");write("<TD align='center'>");write("<DIV style='background-color:teal'><table width='100%' border='0' cellspacing=\"1\" cellpadding=\"0\">");DT_fDrawCal(giYear, giMonth, 12, 12);write("</table></DIV>");write("</td>");write("</tr><TR align='center'>");write("<td>");write ("&nbsp;<select name='Dtablehour' Victor='Won' >");
 
 for(i=0;i<24;i++){write("<option value='" + i + "'>" + i + "</option>");}write("</select>");write("时&nbsp;<select name='Dtableminute' Victor='Won'>");
 
 for(i=0;i<60;i++){write("<option value='" + i + "'>" + i + "</option>");}write("</select>");write("分&nbsp;<select name='Dtablesecond'  Victor='Won'>");
 
 for(i=0;i<60;i++){write("<option value='" + i + "'>" + i + "</option>");}
 
 write("</select>");write(" 秒</td></tr><tr><td id='DT_ct_ShowTD' align='center' style='cursor:hand;font:bold 12 宋体;color:#990000' bgcolor=#EEEEEE>&nbsp;</td></tr><tr><TD align='center'>");
 
 write("<span style='cursor:hand;font:bold 12 宋体' onclick='DT_fSetDate(giYear,giMonth,giDay,Dtablehour.value,Dtableminute.value,Dtablesecond.value)' onMouseOver=\"this.style.color=gcToggle;document.all.DT_ct_ShowTD.innerHTML='【" + giYear +"-" + giMonth + "-" + giDay + " ' + document.all.Dtablehour.value + ':' + document.all.Dtableminute.value + ':' + document.all.Dtablesecond.value + '】'\" onMouseOut='this.style.color=0'>今天："+giYear+"年"+giMonth+"月"+giDay+"日</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='font-family: wingdings' title='关闭' onclick='DT_fHideCalendar();' style='cursor:hand;'>x</span>");
 
 write("</td></tr>");write("</TABLE></Div>");
 
 }
 var DT_resize_CurState=false;
var DT_resize_CurDown=false; 
var DT_resize_CurId; 
var DT_resize_OldPlace,DT_resize_NewPlace; 
var DT_resize_isre=false;

function DT_resize_MoveCol(MyColId) {var DT_the_td = DT_get_Element(event.srcElement,'td');
if(EnableAdjustCellWidth_init==false)
{return false;}
if( DT_resize_CurDown==false)
{
if((window.event.x + window.document.body.scrollLeft) > (DT_thisTable.offsetLeft + MyColId.offsetLeft + (MyColId.offsetWidth-3)))
{
DT_resize_CurState=true; 
window.document.body.style.cursor="e-resize";
DT_resize_nowX=window.event.x + window.document.body.scrollLeft;
}
else 
{
DT_resize_CurState=false ;
window.document.body.style.cursor="Default" ;

} 
DT_resize_CurId=MyColId ;

}
}
function getLength(s){
 var n=0;
 for(var i=0;i<s.length;i++){
   if(s.charCodeAt(i)<256){ n=n+1; } else{ n=n+2; }
 }
 return n;
}
function getNstring(sStr,nLen){
	var nStrLen	= sStr.length;
	
	var nCountLen	= 0;
	var nCharLen	= 0;
	var sCutStr	= '';
	for (var nTempCount = 0; nTempCount < nStrLen; nTempCount++){
		nCharLen = Math.abs(sStr.charCodeAt(nTempCount));
		nCountLen = (nCharLen > 255) ? nCountLen += 2 : nCountLen += 1;
		if (nCountLen > nLen){
			sCutStr = sStr.substring(0,nTempCount-2) + "..";
			break;
		}

		else
		{
			sCutStr = sStr;
		}
	}
	return sCutStr.replace(/\n/,"，");
}
function getCellWidth(cellIndex,type)
{
var tmpwidth=0;
for(var i=DTable_minrowIndex-1;i<DT_Main_Tab.rows.length;i++){

var tmpstr;
if(type=='now')
{
tmpstr=DT_Main_Tab.rows[i].cells[cellIndex].innerHTML;
}
else if(type=='old')
{
tmpstr=DT_TableText[i][cellIndex].toString();
}
else
{
tmpstr=DT_TableText[i][cellIndex].toString();

}
var tmpNL=getLength(tmpstr);
if(tmpNL>tmpwidth)
{
tmpwidth=tmpNL
}
}
return tmpwidth ;
}

function DT_setCellText(cellIndex,N)
{

for(var i=DTable_minrowIndex-1;i<DT_Main_Tab.rows.length;i++){
var tmpstr=DT_TableText[i][cellIndex].toString();
if(tmpstr=='')
{
return false;
}
var tmpNL=getNstring(tmpstr,N);
DT_Main_Tab.rows[i].cells[cellIndex].innerText=tmpNL;
}
}



function UpBody()
{
var tmpcx=window.event.x + window.document.body.scrollLeft;

if( DT_resize_CurState==true )
{
var cellindex=replace(DT_resize_CurId.id.toString(),'DTableTitle','');
var maxLength;
if(DT_resize_nowX>(tmpcx-3) && DT_resize_nowX<(tmpcx+3))
{
maxLength=getCellWidth(cellindex,'old');

DT_resize_CurId.width =maxLength * (DT_fontSize/2) + 1 ;
//+ 5 +  DT_Main_Tab.cellPadding
DT_thisTable.width=DT_thisTable.offsetWidth  + (DT_resize_CurId.offsetWidth-DT_resize_oldcellwidth) ;
DT_resize_CurId.innertext=DT_resize_CurId.width ;
DT_setCellText(cellindex,maxLength);
}
else
{
maxLength=getCellWidth(cellindex,'now');

DT_resize_OldPlace=window.event.x + window.document.body.scrollLeft ;
DT_resize_oldcellwidth=DT_resize_CurId.offsetWidth;
DT_resize_oldtablewidth=DT_thisTable.offsetWidth;



}
DT_resize_CurState=false ;
DT_resize_CurDown=false ;
window.document.body.style.cursor="Default" ;

}
DT_sort_col=null;
}
function DT_resize_DownBody()
{
if (DT_resize_CurState==true)
{
DT_resize_CurDown=true ;
DT_resize_isre=true;
DT_resize_OldPlace=window.event.x + window.document.body.scrollLeft ;
DT_resize_oldcellwidth=DT_resize_CurId.offsetWidth;
DT_resize_oldtablewidth=DT_thisTable.offsetWidth;

}
}

function DT_resize_MoveBody()
{



if( DT_resize_CurDown==true )
{
var cellindex=replace(DT_resize_CurId.id.toString(),'DTableTitle','');
var maxLength=getCellWidth(cellindex,'now') - DT_Main_Tab.cellPadding;

window.document.body.style.cursor="e-resize" ;
DT_resize_NewPlace=window.event.x + window.document.body.scrollLeft ;
var tmpcidw=window.event.x - DT_resize_CurId.offsetLeft;
if(tmpcidw>4)
{
var strN=parseInt(tmpcidw/(DT_fontSize/2)-1);
DT_setCellText(cellindex,strN);

DT_resize_CurId.width =tmpcidw ;
DT_resize_CurId.innertext=DT_resize_CurId.offsetWidth ;
DT_thisTable.width=DT_resize_oldtablewidth  + (( DT_resize_NewPlace - DT_resize_OldPlace));


DT_sort_col=null;
}
else
{
return false;
}

}

}

function SelectBody() 
{
if (DT_resize_CurDown==true)
{
window.event.returnValue=false ;

}
}

function document.onmousedown()
{
DT_resize_DownBody();
}
function document.onselectstart()
{
SelectBody();
}


var DT_Main_Tab = null; 
var DT_cur_row = null; 
var DT_cur_col = null; 
var DT_cur_cell = null;
var DT_Org_con = ''; 
var DT_sort_col = null;
var DT_show_col = false;
var DT_charMode = true;
var DT_act_fc = ''; 
var DT_cur_bgc = '#ccffcc'; 
var DT_cur_fc = ''; 



function DT_Listfun_initValue(firstrow)
{
if(parseInt(firstrow)==DTable_minrowIndex-1)
{
DT_TableText =new Array(DT_Main_Tab.rows.length);
}

try
	{
for(i=firstrow;i<DT_Main_Tab.rows.length;i++)
{
if(parseInt(firstrow)==DTable_minrowIndex-1)
{

DT_TableText[i]=new Array(DT_Main_Tab.rows.length);
}

for(ii=0;ii<DT_Main_Tab.rows[DT_Main_Tab.rows.length-1].cells.length;ii++)
{



var strsev=new String();
var ishavecellvalue=true;

try
{
strsev=DT_Main_Tab.rows[i].cells[ii].cellText.toString();
}
catch(e)
{
ishavecellvalue=false;
}

if(ishavecellvalue==false)
{
if(i==0)
{
	
strsev=DT_Main_Tab.rows[i].cells[ii].innerHTML.toString();
	


}
else
{
strsev=DT_Main_Tab.rows[i].cells[ii].innerText.toString();

}
}
strsev=Trim(strsev);
DT_Main_Tab.rows[i].cells[ii].cellText=strsev;
DT_TableText[i][ii]=strsev;

}//end for ii
}//end for i
	}//end try
	catch(e)
	{}

DT_arrowUp = document.createElement('SPAN'); 
DT_arrowUp.innerHTML = '5'; 
DT_arrowDown = document.createElement('SPAN');
DT_arrowDown.innerHTML = '6';
DT_arrowUp.style.cssText =DT_SortUpText;
DT_arrowDown.style.cssText =DT_SortDownText;
}



function DT_Listfun_init()
{
DT_cur_row = null; DT_cur_col = null;
DT_cur_cell = null; 
DT_sort_col = null; 
DT_Main_Tab = DT_thisTable;
DT_read_def(DT_Main_Tab);
DT_Main_Tab.onclick = DT_Listfun_clickIt;

DT_fontSize=DT_Main_Tab.style.fontSize;
if(DT_fontSize.length<1)
{
DT_fontSize=9;
}
DT_Org_con = DT_Main_Tab.outerHTML;
DT_arrowUp = document.createElement('SPAN'); 
DT_arrowUp.innerHTML = '5'; 
DT_arrowDown = document.createElement('SPAN');
DT_arrowDown.innerHTML = '6';
DT_arrowUp.style.cssText =DT_SortUpText;
DT_arrowDown.style.cssText =DT_SortDownText;

EnableDragCell_init=EnableDragCell;
EnableSort_init=EnableSort;
EnableAdjustCellWidth_init=EnableAdjustCellWidth;



DT_Listfun_initValue(DTable_minrowIndex-1);
for(i=0;i<DT_Main_Tab.rows.length;i++)
{
try
{
for(ii=0;ii<DT_Main_Tab.rows[DTable_minrowIndex-1].cells.length;ii++)
{
if(i==(DTable_minrowIndex-1) && ii>0)
{
DT_Main_Tab.rows[i].cells[ii].id='DTableTitle' + ii;
DT_Main_Tab.rows[i].cells[ii].onmousemove=function (){DT_resize_MoveCol(this)};


}


if(DT_Main_Tab.rows[i].cells[ii]!=null)
{
DT_Main_Tab.rows[i].cells[ii].className='DT_List_CellStyle';
}
}
}
catch(e)
{
alert(e+ 'i:' + i + ' ii:' + ii);
}
}
}



function document.onclick(){


if(document.getElementById('VicPopCal'))
	{
	DT_fHideCalendar();
	}



var obj = event.srcElement;

if(document.getElementById('dtablejsqc'))
	{
	
	while(obj!=null && typeof(obj.tagName) != 'undefind')
		{
	
	if(obj.id=='dtablejsqc')return;
    obj = obj.parentElement;
         }
		 DT_hidejsq();
    // dtablejsqc.style.visibility='hidden';

    }

try
	{
DT_Listfun_clearcolor(); 
DT_cur_row = null;
DT_cur_col = null;
DT_cur_cell = null; 
	}
catch(e)
		{}
}

function DT_read_def(DT_DT_the_table){

for(var i=0;i<DT_DT_the_table.rows.length;i++){
for(var j=0;j<DT_DT_the_table.rows[i].cells.length;j++)
{
with(DT_DT_the_table.rows[i])
{
cells[j].oBgc = '';
cells[j].oFc ='';


if(i==DTable_minrowIndex-1 ){
cells[j].onmousedown = DT_Listfun_dragstart;
cells[j].onmouseup = DT_Listfun_dragend;
}
}
}
}
}

function DT_get_Element(DT_the_ele,DT_the_tag){
DT_the_tag = DT_the_tag.toLowerCase(); 
if(DT_the_ele.tagName.toLowerCase()==DT_the_tag)
{return DT_the_ele;}

while(DT_the_ele=DT_the_ele.offsetParent)
{ 
if(DT_the_ele.tagName.toLowerCase()==DT_the_tag){return DT_the_ele;}}

return(null);
}
var DT_dragStart= false;
var DT_dragColStart = null;
var DT_dragColEnd = null;


function DT_Listfun_dragstart(){
if(EnableDragCell_init==true)
{

if(DT_resize_CurState==false && DT_resize_CurDown==false)
{

 DT_resize_isre=false;
var DT_the_td = DT_get_Element(event.srcElement,'td');

if(DT_the_td==null)
{
return;
}
if(DT_the_td.cellIndex<1)
	{
return false;
	}


DT_dragStart = true;
DT_dragColStart = DT_the_td.cellIndex; 

DT_drag.style.width = DT_the_td.offsetWidth; 
DT_drag.style.height = DT_the_td.offsetHeight;

DT_drag.innerHTML = DT_the_td.innerHTML; 
DT_drag.style.backgroundColor = DT_the_td.oBgc;
DT_drag.style.color = DT_the_td.oFc;
function document.onmousemove(){

if(event.button==1)
{
if(DT_resize_CurState==false && DT_resize_isre==false && EnableDragCell_init==true)
{
DT_drag.style.display = '';
var thistop=DT_getPosition(DT_the_td).top

DT_drag.style.top = thistop ;
var thisx=window.event.screenX;

DT_drag.style.left = thisx-DT_drag.offsetWidth/2;
DT_drag.style.backgroundColor=DT_act_bgc;

for(var i=1;i<=DT_Main_Tab.rows[DTable_minrowIndex-1].cells.length-1;i++)
{
with(DT_Main_Tab.rows[DTable_minrowIndex-1].cells[i])
{

if((event.x>offsetLeft+parseInt(DT_getPosition(DT_thisTable).left) && event.x<offsetLeft+offsetWidth+ parseInt(DT_getPosition(DT_thisTable).left)))
{

runtimeStyle.backgroundColor=DT_act_bgc;
DT_dragColEnd=cellIndex;

}
else
{
runtimeStyle.backgroundColor=''; }
}// end if
}// end with


}//end for


}
DT_resize_MoveBody();
}//end EnableDragCell_init
}
}
else
{

}
}
function DT_Listfun_dragend(){
if(DT_resize_CurState==false && DT_resize_CurDown==false && DT_resize_isre==false && EnableDragCell_init==true)
{

//

DT_dragStart = false; 
DT_drag.style.display='none'; 
DT_drag.innerHTML = ''; 
DT_drag.style.width = 0;
DT_drag.style.height = 0;


for(var i=1;i<=DT_Main_Tab.rows[DTable_minrowIndex-1].cells.length-1;i++)
{
DT_Main_Tab.rows[DTable_minrowIndex-1].cells[i].runtimeStyle.backgroundColor=''; 
}
if(DT_dragColStart!=null && DT_dragColEnd!=null && DT_dragColStart!=DT_dragColEnd)
{

DT_Listfun_changecol(DT_Main_Tab,DT_dragColStart,DT_dragColEnd);

if(DT_dragColStart==DT_sort_col)
{
DT_sort_col=DT_dragColEnd;
}
else if(DT_dragColEnd==DT_sort_col)
{
DT_sort_col=DT_dragColStart; 
document.onclick();
}


}
if(DT_sort_col!=null)
{ 
with(DT_thisTable.rows[DTable_minrowIndex-1].cells[DT_sort_col])
{
removeChild(lastChild);
}
DT_sort_col=null;
}


DT_Listfun_initValue(DTable_minrowIndex-1);

DT_dragColStart = null;
DT_dragColEnd = null; 
document.onmousemove=null;

}
else if(DT_resize_CurState==true && DT_resize_CurDown==true && DT_resize_isre==true)
{

if(EnableDragCell_init==true)
{
DT_dragStart = false; 
DT_drag.style.display='none'; 
DT_drag.innerHTML = ''; 
DT_drag.style.width = 0;
DT_drag.style.height = 0;
for(var i=0;i<DT_Main_Tab.rows[DTable_minrowIndex-1].cells.length;i++)
{ DT_Main_Tab.rows[DTable_minrowIndex-1].cells[i].runtimeStyle.backgroundColor=''; }
if(DT_dragColStart!=null && DT_dragColEnd!=null && DT_dragColStart!=DT_dragColEnd) {
DT_Listfun_changecol(DT_Main_Tab,DT_dragColStart,DT_dragColEnd);
if(DT_dragColStart==DT_sort_col)
{
DT_sort_col=DT_dragColEnd;
}
else if(DT_dragColEnd==DT_sort_col){
DT_sort_col=DT_dragColStart; 
document.onclick();
}
}


}
DT_dragColStart = null;
DT_dragColEnd = null; 
document.onmousemove=null;
UpBody();

}

}

function DT_Listfun_clearcolor(){ 
DT_the_table=DT_Main_Tab;
if(DT_cur_col!=null){ 
for(i=DTable_minrowIndex;i<DT_the_table.rows.length;i++){
with(DT_the_table.rows[i].cells[DT_cur_col]){
style.backgroundColor=''; 
style.color=''; } } }
if(DT_cur_row!=null){ 
for(i=0;i<DT_the_table.rows[DT_cur_row].cells.length;i++){
with(DT_the_table.rows[DT_cur_row].cells[i]){
style.backgroundColor=''; style.color=''; } } } 
if(DT_cur_cell!=null){
if(DT_cur_cell.children[0]!=null)
{
DT_cur_cell.children[0].contentEditable = false; 

with(DT_cur_cell.children[0].runtimeStyle)
{
borderLeft=borderTop='';
borderRight=borderBottom=''; 
backgroundColor=''; 
paddingLeft='';
textAlign=''; 
}
}
}}
function DT_Listfun_EditReCheckBox(strTFvalue,i,ii)
{
var strtmpv=strTFvalue.split('$$');
var obj=new Object();

obj=eval('document.all.ch_' + i.toString() + '_' + ii.toString());

if(obj.checked==true)
{
eval('document.all.DT_Edit_CBTEXT_' + i.toString() + '_' + ii.toString() + '.innerText=\"' + strtmpv[0] + '\"');
}
else
{
eval('document.all.DT_Edit_CBTEXT_' + i.toString() + '_' + ii.toString() + '.innerText=\"' + strtmpv[1] + '\"');

}
}
function LTrim(str)

{

    var whitespace = new String(" \t\n\r");

    var s = new String(str);

    

    if (whitespace.indexOf(s.charAt(0)) != -1)

    {

        var j=0, i = s.length;

        while (j < i && whitespace.indexOf(s.charAt(j)) != -1)

        {

            j++;

        }

        s = s.substring(j, i);

    }

    return s;

}



function RTrim(str)

{

    var whitespace = new String(" \t\n\r");

    var s = new String(str);

 

    if (whitespace.indexOf(s.charAt(s.length-1)) != -1)

    {

        var i = s.length - 1;

        while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)

        {

            i--;

        }

        s = s.substring(0, i+1);

    }

    return s;

}

 


function Trim(str)

{

    return RTrim(LTrim(str));

}


function DT_Listfun_SetTDContral(i,ii,isaddnew)
{
var strreadonly=new String();
if((ii<DTable_mincellIndex || ii>DTable_maxcellIndex) && isaddnew!='1')
	{
		
		strreadonly=' readonly';
		
	}
else
	{
strreadonly='';
	}

var strtype='';
var strreturntext=new String();
var strtv= replace(DT_TableText[i][ii].toString(),'&nbsp;','');
DT_inputBackground=DT_Main_Tab.rows[i].style.Background;
strtv=Trim(strtv);

try
{//DT_Fieldtype6
strtype=eval('DT_Fieldtype' + ii.toString());
}
catch(e)
{
}
if(strtype=='numeric')
{blislistnumeric=true;
var strnumset=eval('DT_Fieldvalue' + ii.toString() + '.split("$$")');
var strms=strnumset[3].toString();

strv=replace(replace(strtv,strms,''),',','');
if(strreadonly=='')
	{
strreturntext='<input name=\"nb_' + i.toString() + '_' + ii.toString() + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border:0;\"    ondblclick=\"showjsq(this);\" value=\"' + strv + '\" title=\"点击选择数字\"' + strreadonly + '>';
	}
	else
	{
		strreturntext='<input name=\"nb_' + i.toString() + '_' + ii.toString() + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border:0;\"  value=\"' + strv + '\" readonly>';
	}

blislistnumeric=true;
}
else if(strtype=='checkbox')
{
var strtmpv1=eval('DT_Fieldvalue' + ii.toString());
var strtxtv=strtmpv1.split("$$");
if(strtv==strtxtv[0])
{
	if(strreadonly=='')
	{
strreturntext='<input type=\"checkbox\" name=\"ch_' + i.toString() + '_' + ii.toString() + '\" checked value=\"1\" onclick=\"DT_Listfun_EditReCheckBox(\'' + strtxtv[0] + '$$' + strtxtv[1] + '\',\'' + i.toString() + '\',\'' + ii.toString() + '\');\"><span id=\"DT_Edit_CBTEXT_' + i.toString() + '_' + ii.toString() + '\">' + strtv + '</span>';
	}
	else
	{
strreturntext='<input type=\"checkbox\" name=\"ch_' + i.toString() + '_' + ii.toString() + '\" checked value=\"1\" style=\"width=0;height=1;\"><span id=\"DT_Edit_CBTEXT_' + i.toString() + '_' + ii.toString() + '\">' + strtv + '</span>';
	}
}
else
{
	if(strreadonly=='')
	{
strreturntext='<input type=\"checkbox\" name=\"ch_' + i.toString() + '_' + ii.toString() + '\" value=\"1\" onclick=\"DT_Listfun_EditReCheckBox(\'' + strtxtv[0] + '$$' + strtxtv[1] + '\',\'' + i.toString() + '\',\'' + ii.toString() + '\');\"><span id=\"DT_Edit_CBTEXT_' + i.toString() + '_' + ii.toString() + '\">' + strtv + '</span>';
	}
	else
	{
		strreturntext='<input type=\"checkbox\" name=\"ch_' + i.toString() + '_' + ii.toString() + '\" value=\"1\" style=\"width=0;height=1;\"><span id=\"DT_Edit_CBTEXT_' + i.toString() + '_' + ii.toString() + '\">' + strtv + '</span>';
	}
}
}
else if(strtype=='select')
{
strtv=Trim(replace(strtv,'&nbsp;',''));
strreturntext=eval('DT_Fieldvalue' + ii.toString());
strreturntext=replace(replace(strreturntext,'<select','<select style=\"Background:' + DT_inputBackground + ';border:0;\" name=\"se_' + i.toString() + '_' + ii.toString() + '\" '),'>' + strtv + '<',' selected>' + strtv + '<');

if(strreadonly!='')
	{
	strtmpse=strreturntext;
strreturntext=replace(strreturntext,'<select','<select style=\"width:0;height:1;\"');

strreturntext=strreturntext + replace(replace(strtmpse,'se_' + i.toString() + '_' + ii.toString(),'se_' + i.toString() + ii.toString()),'<select','<select disabled');
	}

}
else if(strtype=='datetime')
{blislistdatetime=true;
var dtthis=new Date();
if(strtv.length>5)
{
dtthis=DT_Date_Ex(strtv);

}
else
{
dtthis=new Date();
dtthis=DT_Date_Ex(dtthis.getFullYear() + '-' + (parseInt(dtthis.getMonth()) + 1).toString() + '-' + dtthis.getDate().toString());
}
var stry=dtthis.getFullYear().toString();
var strmon=new String(parseInt(dtthis.getMonth()) + 1);
if(strmon.length==1)
{
strmon='0' + strmon;
}
var strdate=dtthis.getDate().toString();
if(strdate.length==1)
{
strdate='0' + strdate;
}
var strhour=dtthis.getHours().toString();
if(strhour.length==1)
{
strhour='0' + strhour;
}
var strminute=dtthis.getMinutes().toString();
if(strminute.length==1)
{
strminute='0' + strminute;
}
var strsecond=dtthis.getSeconds().toString();
if(strsecond.length==1)
{
strsecond='0' + strsecond;
}
if(strreadonly!='')
	{
strreturntext='<input name=\"dt_' + i.toString() + '_' + ii.toString() + '\"  style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border:0;\" value=\"' + strtv + '\" readonly>';
	}
	else
	{
strreturntext='<input name=\"dt_' + i.toString() + '_' + ii.toString() + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border:0;\"  ondblclick=\"DT_fPopCalendar(this,this,' + stry + ',' + strmon + ',' + strdate + ',' + strhour + ',' + strminute +  ',' + strsecond + ');\" value=\"' + strtv + '\" title=\"双击选择日期（时间）\">';
	}
blislistdatetime=true;
}
else if(strtype=='text')
{
var strtmp004=eval('DT_Fieldvalue' + ii.toString());


strreturntext='<input name=\"tx_' + i.toString() + '_' + ii.toString() + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border:0;\"  value=\"' + strtv + '\" title=\"' + strtmp004.split('$$')[3].toString() + '\"' + strreadonly + '>';
}
else
{


strreturntext='<input name=\"txt_' + i.toString() + '_' + ii.toString() + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border:0;\"  value=\"' + strtv + '\"' + strreadonly + '>';
}
DT_Main_Tab.rows[i].cells[ii].innerHTML=strreturntext;

}
function DT_Listfun_EditMode()
{
	if(DT_Grid_EnableEdt==false)
	{
		alert('禁止记录更新操作');
		DT_info.innerHTML='禁止记录更新..';
	}
DT_info.innerHTML='更新模式..';
for(var i=DTable_minrowIndex;i<=DT_Main_Tab.rows.length-1;i++)
{
for(var ii=1;ii<=DT_Main_Tab.rows[DTable_minrowIndex-1].cells.length-1;ii++)
{
if(DT_Main_Tab.rows[i].cells[ii].firstChild!=undefined && DT_Main_Tab.rows[i].cells[ii].firstChild.value!=undefined)
{
}
else
{
DT_Listfun_SetTDContral(i,ii,'0')
}
}
}
DTable_State='edit';
EnableDragCell_init=false;
EnableSort_init=false;
EnableAdjustCellWidth_init=false;
}



function DT_Listfun_clickIt()
{

if(DT_resize_CurState==false && DT_resize_CurDown==false && DT_resize_isre==false)
{

if(event.button==0){
if(document.getElementById('ie5menu')){
document.all.ie5menu.style.left='-1000';}}

event.cancelBubble=true;

var DT_the_obj = event.srcElement;
var DT_the_td;

if(DT_the_obj.tagName.toLowerCase() != 'table' && DT_the_obj.tagName.toLowerCase() != 'tbody' && DT_the_obj.tagName.toLowerCase() != 'tr'){

DT_the_td= DT_get_Element(DT_the_obj,'td');
}
else
{
return;
}
var i = 0 ,j = 0;



if(DT_the_td==null) 
{return; }

var DT_the_tr = DT_the_td.parentElement;
var DT_DT_the_table = DT_get_Element(DT_the_td,'table'); 

var i = 0; DT_Listfun_clearcolor(); 
DT_cur_row = DT_the_tr.rowIndex; 
DT_cur_col = DT_the_td.cellIndex;

if(DT_cur_col==0){return true;}
if(DT_cur_row!=DTable_minrowIndex-1)
{
}

else if(EnableSort_init==true)
{
DT_the_td.mode = !DT_the_td.mode;

if(DT_sort_col!=null)
{ 

with(DT_thisTable.rows[DTable_minrowIndex-1].cells[DT_sort_col])
{
{
removeChild(lastChild);
}
}
}


with(DT_thisTable.rows[DTable_minrowIndex-1].cells[DT_cur_col])

appendChild(DT_the_td.mode?DT_arrowUp:DT_arrowDown);
DT_Listfun_sorttab(DT_thisTable,DT_cur_col,DT_the_td.mode); 

DT_sort_col=DT_cur_col; 

}
DT_Listfun_initValue(DTable_minrowIndex);

}
else
{
}
}


function replace(str, fromstring, tostring) {

   i = str.indexOf(fromstring);
   r = '';
   if (i == -1) return str;
   r += str.substring(0,i) + tostring;
   if ( i + fromstring.length < str.length)
     r += replace(str.substring(i + fromstring.length, str.length), fromstring, tostring);
   return r;
   }
   
   
   function DT_Listfun_setTdinnerHtml(drowIndex,dcellIndex,type)
   {
   if(type=='tx')
   {
var strtmpvalue=eval('DT_Fieldvalue' + dcellIndex).toString();
var strtmpvararr=strtmpvalue.split('$$');
var intminL=parseInt(strtmpvararr[0].toString());
var intmaxL=parseInt(strtmpvararr[1].toString());
var strstring=strtmpvararr[2].toString();
var strms=strtmpvararr[3].toString();
var strinputvalue=eval('document.all.' + type + '_' + drowIndex + '_' + dcellIndex + '.value');
var intinputlength=strinputvalue.length;

if(intinputlength<intminL)
{
alert('您输入的文字数不能少于' + intminL.toString());


eval('document.all.tx_' + drowIndex + '_' + dcellIndex + '.focus()');

return false;
}
if(intinputlength>intmaxL)
{
alert('您输入的文字数不能多于' + intmaxL.toString());
eval('document.all.tx_' + drowIndex + '_' + dcellIndex + '.focus()');

return false;
}

if(strstring.length>-1)
{
if(strinputvalue.indexOf(strstring)==-1)
{
alert(strms);
return false;
}
}
var strtmpvalue=eval('document.all.' + type + '_' + drowIndex + '_' + dcellIndex + '.value');
DT_cur_cell.innerHTML=strtmpvalue;
DT_TableValue[drowIndex][dcellIndex]=strtmpvalue;
DT_TableText[drowIndex][dcellIndex]=strtmpvalue;

DT_cur_cell=null;
DT_cur_row=null;

}
else if(type=='se')
{

var strtmptext=eval('document.all.' + type + '_' + drowIndex + '_' + dcellIndex + '.options[document.all.' + type + '_' + drowIndex + '_' + dcellIndex + '.selectedIndex].text');

var strtmpvalue=eval('document.all.' + type + '_' + drowIndex + '_' + dcellIndex + '.value');
DT_cur_cell.innerHTML=strtmptext;
DT_TableValue[drowIndex][dcellIndex]=strtmpvalue;
DT_TableText[drowIndex][dcellIndex]=strtmptext;
DT_cur_cell=null;
DT_cur_row=null;

}
else
{
var strtmpvalue=eval('document.all.' + type + '_' + drowIndex + '_' + dcellIndex + '.value');
DT_cur_cell.innerHTML=strtmpvalue;
DT_TableValue[drowIndex][dcellIndex]=strtmpvalue;
DT_TableText[drowIndex][dcellIndex]=strtmpvalue;


DT_cur_cell=null;
DT_cur_row=null;
   }
   }










function DT_setTdCBHtml(rowIndex,cellIndex,strtvv)
{
var strtv=strtvv.split("$$");

if(eval('document.all.ch_' + rowIndex + '_' + cellIndex + '.checked'))
{
DT_cur_cell.innerHTML=strtv[0];
DT_TableValue[rowIndex][cellIndex]='1';
DT_TableText[rowIndex][cellIndex]=strtv[0];

}
else
{
DT_cur_cell.innerHTML=strtv[1];
DT_TableValue[rowIndex][cellIndex]='0';
DT_TableText[rowIndex][cellIndex]=strtv[1];

}
DT_cur_cell=null;
DT_cur_row=null;

}
function DT_Date_Ex(value1)
  {
 var strDate = value1;
 if (strDate.length == 0)
  return false;

 var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/;   
 var r = strDate.match(reg);

 if (r != null)  
   strDate = strDate + " 00:00:00";
 
 reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})/;
 r = strDate.match(reg);
 if (r == null)
 {
  alert("你输入的日期格式有误，正确格式为：2004-12-01 或 2004-12-01 12:23:45");
  return false;
 }

 var d = new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);
 if (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]&&d.getSeconds()== r[7])
 {
  return d;
 }
 else
 {
  alert("你输入的日期或时间超出有效范围，请仔细检查！");
  return false;
 }
  }

function DT_ReturninnerHtml(cellIndex,strhtml,rowIndex)
{
var strreturntext='';
var strv=replace(replace(strhtml,' ',''),'&nbsp;','');

var isok=false;

try
{
var tmp001=eval('DT_Fieldtype' + DT_cur_cell.cellIndex);
isok=true;
}
catch(e)
{
isok=false;
}
finally
{
}

if(isok==true)
{
var strsev=DT_TableValue[rowIndex][cellIndex].toString();

if(eval('DT_Fieldtype' + cellIndex)=='select')
{

strreturntext=eval('DT_Fieldvalue' + cellIndex);


strreturntext=replace(replace(strreturntext,'<select','<select style=\"width:100%;Background:' + DT_inputBackground + ';border=0;\" name=\"se_' + rowIndex + '_' + cellIndex + '\" onBlur=\"DT_Listfun_setTdinnerHtml(' + rowIndex + ',' + cellIndex + ',\'se\');\"'),'<option value=' + strsev + '>' + strv,'<option selected value=' + strsev + '>' + strv);
}
else if(eval('DT_Fieldtype' + cellIndex)=='datetime')
{
strv=strsev;
var dtthis=new Date();
if(strv.length>5)
{
dtthis=DT_Date_Ex(strv);

}
else
{
dtthis=new Date();
dtthis=DT_Date_Ex(dtthis.getFullYear() + '-' + (parseInt(dtthis.getMonth()) + 1).toString() + '-' + dtthis.getDate().toString());
}
var stry=dtthis.getFullYear().toString();
var strmon=new String(parseInt(dtthis.getMonth()) + 1);
if(strmon.length==1)
{
strmon='0' + strmon;
}
var strdate=dtthis.getDate().toString();
if(strdate.length==1)
{
strdate='0' + strdate;
}
var strhour=dtthis.getHours().toString();
if(strhour.length==1)
{
strhour='0' + strhour;
}
var strminute=dtthis.getMinutes().toString();
if(strminute.length==1)
{
strminute='0' + strminute;
}
var strsecond=dtthis.getSeconds().toString();
if(strsecond.length==1)
{
strsecond='0' + strsecond;
}
strreturntext='<input name=\"dt_' + rowIndex + '_' + cellIndex + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border=0;\"  onclick=\"DT_fPopCalendar(this,this,' + stry + ',' + strmon + ',' + strdate + ',' + strhour + ',' + strminute +  ',' + strsecond + ');return false;\" value=\"' + strv + '\" title=\"点击选择日期（时间）\">';
DTable_rowIndex=rowIndex;
DTable_cellIndex=cellIndex;
blislistdatetime=true;

}
else if(eval('DT_Fieldtype' + cellIndex)=='numeric')//如果是数字
{
var strnumset=eval('DT_Fieldvalue' + cellIndex + '.split("$$")');
var strms=strnumset[3].toString();

strv=replace(replace(strsev,strms,''),',','');//取消非数字字符
strreturntext='<input name=\"nb_' + rowIndex + '_' + cellIndex + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border=0;\"    onclick=\"showjsq(this);\" value=\"' + strv + '\" title=\"点击选择数字\">';

blislistnumeric=true;
DTable_rowIndex=rowIndex;
DTable_cellIndex=cellIndex;
}
else if(eval('DT_Fieldtype' + cellIndex)=='checkbox')//如果是布尔
{
var strtmpv1=eval('DT_Fieldvalue' + cellIndex);
var strtv=strtmpv1.split("$$");
strv=strsev;
if(strv==strtv[0])
{
strreturntext='<input type=checkbox name=ch_' + rowIndex + '_' + cellIndex + ' checked onBlur=\"DT_setTdCBHtml(' + rowIndex + ',' + cellIndex + ',\'' + strtmpv1 + '\');\">';
}
else
{
strreturntext='<input type=checkbox name=ch_' + rowIndex + '_' + cellIndex + ' onBlur=\"DT_setTdCBHtml(' + rowIndex + ',' + cellIndex + ',\'' + strtmpv1 + '\');\">';

}
}


else if(eval('DT_Fieldtype' + cellIndex)=='text')//处理文本
{
strv=strsev;

var strtmp004=eval('DT_Fieldvalue' + cellIndex);


strreturntext='<input name=\"tx_' + rowIndex + '_' + cellIndex + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border=0;\"  value=\"' + strv + '\" title=\"' + strtmp004.split('$$')[3].toString() + '\" onBlur=\"DT_Listfun_setTdinnerHtml(' + rowIndex + ',' + cellIndex + ',\'tx\')\">';

}

else
{
strv=strsev;

var strtmp004=eval('DT_Fieldvalue' + cellIndex);


strreturntext='<input name=\"txt_' + rowIndex + '_' + cellIndex + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border=0;\"  value=\"' + strv + '\" title=\"' + strtmp004.split('$$')[3].toString() + '\" onBlur=\"DT_Listfun_setTdinnerHtml(' + rowIndex + ',' + cellIndex + ',\'txt\')\">';
}

}
else
{
var strsev=DT_TableValue[rowIndex][cellIndex].toString();


strreturntext='<input name=\"txt_' + rowIndex + '_' + cellIndex + '\" style=\"height:18;width:100%;Background:' + DT_inputBackground + ';border=0;\"  value=\"' + strv + '\" onBlur=\"DT_Listfun_setTdinnerHtml(' + rowIndex + ',' + cellIndex + ',\'txt\')\">';

}
if(strreturntext.length<1)
{
strv=strsev;
strreturntext=strv;
}

return strreturntext;

}



function DT_Listfun_dblDT_Listfun_clickIt(){ 
} 


var DT_charPYStr = '啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸尽劲荆兢觉决诀绝均菌钧军君峻俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座';var DT_charBHStr = '一乙丁七乃九了二人儿入八几刀刁力十卜厂又万丈三上下个丫丸久么义乞也习乡于亏亡亿凡刃勺千卫叉口土士夕大女子寸小尸山川工己已巳巾干广弓才门飞马不与丑专中丰丹为之乌书予云互五井亢什仁仅仆仇今介仍从仑仓允元公六内冈冗凤凶分切劝办勾勿匀化匹区升午卞厄厅历及友双反壬天太夫孔少尤尹尺屯巴币幻开引心忆戈户手扎支文斗斤方无日曰月木欠止歹毋比毛氏气水火爪父片牙牛犬王瓦艺见计订讣认讥贝车邓长队韦风且世丘丙业丛东丝主乍乎乏乐仔仕他仗付仙仟代令以仪们兄兰冉册写冬冯凸凹出击刊功加务包匆北匝卉半占卡卢卯厉去发古句另只叫召叭叮可台史右叶号司叹叼囚四圣处外央夯失头奴奶孕宁它对尔尼左巧巨市布帅平幼弗弘归必戊扑扒打扔斥旦旧未末本札术正母民永汀汁汇汉灭犯玄玉瓜甘生用甩田由甲申电白皮皿目矛矢石示礼禾穴立纠艾节讨让讫训议讯记轧边辽闪饥驭鸟龙丢乒乓乔买争亚交亥亦产仰仲件价任份仿企伊伍伎伏伐休众优伙会伞伟传伤伦伪充兆先光全共关兴再军农冰冲决刑划列刘则刚创劣动匈匠匡华协印危压厌吁吃各合吉吊同名后吏吐向吓吕吗回因团在圭地场圾壮多夷夸夹夺奸她好如妄妆妇妈字存孙宅宇守安寺寻导尖尘尧尽屹屿岁岂州巡巩帆师年并庄庆延廷异式弛当忙戌戍戎戏成托扛扣扦执扩扫扬收旨早旬旭曲曳有朱朴朵机朽杀杂权次欢此死毕氖汐汕汗汛汝江池污汤汲灯灰爷牟百祁竹米红纤约级纪纫网羊羽老考而耳肉肋肌臣自至臼舌舟色芋芍芒芝虫血行衣西观讲讳讶许讹论讼讽设访诀贞负轨达迁迂迄迅过迈邢那邦邪闭问闯阮防阳阴阵阶页驮驯驰齐两严串丽乱亨亩伯估伴伶伸伺似佃但位低住佐佑体何余佛作你佣克免兑兵况冶冷冻初删判刨利别助努劫励劲劳匣医卤即却卵县君吝吞吟吠否吧吨吩含听吭吮启吱吴吵吸吹吻吼吾呀呆呈告呐呕员呛呜囤园困囱围址均坊坍坎坏坐坑块坚坛坝坞坟坠声壳妊妒妓妖妙妥妨孜孝宋完宏寿尾尿局屁层岔岗岛希帐庇床序庐库应弃弄弟张形彤役彻忌忍志忘忧快忱忻怀我戒扭扮扯扰扳扶批扼找技抄抉把抑抒抓投抖抗折抚抛抠抡抢护报拒拟改攻旱时旷更杆杉李杏材村杖杜束杠条来杨极步歼每求汞汪汰汹汽汾沁沂沃沈沉沏沙沛沟没沤沥沦沧沪泛灵灶灸灼灾灿牡牢状犹狂狄狈玖玛甫男甸疗皂盯矣社秀私秃究穷系纬纯纱纲纳纵纶纷纸纹纺纽罕羌肖肘肚肛肝肠良芜芥芦芬芭芯花芳芹芽苇苍苏补角言证评诅识诈诉诊诌词译谷豆贡财赤走足身轩辛辰迎运近返还这进远违连迟邑邮邯邱邵邹邻酉里针钉闰闲间闷阻阿陀附际陆陇陈韧饭饮驱驳驴鸡麦龟丧乖乳事些享京佩佬佯佰佳使侄侈例侍侗供依侠侣侥侦侧侨侩兔其具典净凭凯函刮到制刷券刹刺刻刽剁剂势卑卒卓单卖卧卷厕叁参叔取呢周味呵呸呻呼命咀咆咋和咎咏咐咒咕咖咙哎固国图坡坤坦坪坯坷垂垃垄备夜奄奇奈奉奋奔妮妹妻姆始姐姑姓委孟季孤学宗官宙定宛宜宝实宠审尚居屈屉届岩岭岳岸岿巫帕帖帘帚帛帜幸底店庙庚府庞废建弥弦弧录彼往征径忠念忽忿态怂怔怕怖怜性怪怯或房所承抨披抬抱抵抹押抽抿拂拄担拆拇拈拉拌拍拎拐拓拔拖拘拙招拢拣拥拦拧拨择放斧斩旺昂昆昌明昏易昔朋服杭杯杰松板构枉析枕林枚果枝枢枣枪枫柜欣欧武歧殴氓氛沫沮河沸油治沼沽沾沿泄泅泊泌法泞泡波泣泥注泪泳泻泼泽浅炉炊炎炒炔炕炙炬爬爸版牧物狐狗狙狞玩玫环现瓮画畅疙疚疟疡的盂盲直知矽矾矿码祈秆秉空线练组绅细织终绊绍绎经罗者耶肃股肢肤肥肩肪肮肯育肺肾肿胀胁舍艰苑苔苗苛苞苟若苦苫苯英苹茁茂范茄茅茎虎虏虱表衫衬规觅视试诗诚诛话诞诡询诣该详诧责贤败账货质贩贪贫贬购贮贯转轮软轰迢迪迫迭述郁郊郎郑采金钎钒钓闸闹阜陋陌降限陕隶雨青非顶顷饯饰饱饲驶驹驻驼驾鱼鸣齿临举亭亮亲侮侯侵便促俄俊俏俐俗俘保俞信俩俭修兹养冒冠剃削前剐剑勃勇勉勋南卸厘厚受变叙叛咨咬咯咱咳咸咽哀品哄哆哇哈哉响哑哗哟哪型垒垛垢垣垦垫垮城复奎奏契奖姚姜姥姨姻姿威娃娄娇娜孩孪客宣室宦宪宫封将尝屋屎屏峙峡峦差巷帝带帧帮幽度庭弯彦彪待很徊律怎怒思怠急怨总恃恍恒恢恤恨恫恬恼战扁拜括拭拯拱拴拷拼拽拾持挂指按挎挑挖挝挞挟挠挡挣挤挥挪挺政故施既星映春昧昨昭是昼显枯架枷柄柏某柑柒染柔柞柠查柬柯柱柳柿栅标栈栋栏树歪殃殆残段毒毖毗毡氟氢泉泵洁洋洒洗洛洞津洪洱洲活洼洽派浇浊测济浑浓涎炭炮炯炳炸点炼炽烁烂烃牲牵狠狡独狭狮狰狱玲玻珊珍珐甚甭界畏疤疥疫疮疯癸皆皇盅盆盈相盼盾省眉看眨矩砂砌砍砒研砖砚祖祝神禹秋种科秒穿突窃竖竿类籽绑绒结绕绘给绚络绝绞统缸罚美耍耐胃胆背胎胖胚胜胞胡脉茧茨茫茬茵茶茸茹荆草荐荒荔荚荡荣荤荧荫药虐虹虽虾蚀蚁蚂蚤衍袄要览觉诫诬语误诱诲说诵贰贱贴贵贷贸费贺赴赵趴轴轻迷迸迹追退送适逃逆选逊郝郡郧酋重钙钝钞钟钠钡钢钥钦钧钨钩钮闺闻闽阀阁阂陛陡院除陨险面革韭音项顺须食饵饶饺饼首香骂骄骆骇骨鬼鸥鸦乘俯俱俺倍倒倔倘候倚借倡倦倪债值倾健党兼冤凄准凉凋凌剔剖剥剧匪匿卿原哥哦哨哩哭哮哲哺哼唁唆唇唉唐唤啊圃圆埂埃埋埔壶夏套姬娘娟娠娥娩娱宰害宴宵家容宽宾射屑展峨峪峭峰峻席座弱徐徒恋恐恕恩恭息恳恶悄悍悔悟悦悯扇拳拿挚挛挨挫振挽捂捅捆捉捌捍捎捏捐捕捞损捡换捣效敌敖斋料旁旅晃晋晌晒晓晕晚朔朗柴栓栖栗校株样核根格栽桂桃桅框案桌桐桑桓桔档桥桨桩梆梢梧梨殉殊殷毙氦氧氨泰流浆浙浚浦浩浪浮浴海浸涂涅消涉涌涕涛涝涟涡涣涤润涧涨涩烈烘烙烛烟烤烦烧烩烫烬热爱爹特牺狸狼珠班瓶瓷畔留畜疲疹疼疽疾病症痈痉皋皱益盎盏盐监真眠眩砧砰破砷砸砾础祟祥离秘租秤秦秧秩积称窄窍站竞笆笋笑笔粉紊素索紧绢绣绥绦继缺罢羔羞翁翅耕耗耘耙耸耻耽耿聂胯胰胳胶胸胺能脂脆脊脏脐脑脓臭致舀航般舰舱艳荷莆莉莎莫莱莲获莹莽虑蚊蚌蚕蚜衰衷袁袍袒袖袜被请诸诺读诽课谁调谅谆谈谊豹豺贼贾贿赁赂赃资赶起躬载轿较辱透逐递途逗通逛逝逞速造逢部郭郴郸都酌配酒釜钱钳钵钻钾铀铁铂铃铅铆阅陪陵陶陷难顽顾顿颁颂预饿馁骋验骏高鸭鸯鸳鸵乾假偏做停偶偷偿傀兜兽冕减凑凰剪副勒勘匙厢厩唬售唯唱唾啃啄商啡啤啥啦啪啮啸圈域埠培基堂堆堑堕堵够奢娶婆婉婚婪婴婶孰宿寂寄寅密寇尉屠崇崎崔崖崩崭巢常庶康庸廊弹彩彬得徘恿悉悠患您悬悸悼情惊惋惕惜惟惦惧惨惭惮惯戚捧据捶捷捻掀掂掇授掉掏掐排掖掘掠探接控推掩措掳掷掸掺敏救教敛敝敢斜断旋族晤晦晨曹曼望桶梁梅梗梦梭梯械梳检欲毫涪涯液涵涸淀淄淆淋淌淑淖淘淡淤淫淬淮深淳混淹添清渊渍渐渔渗渠烯烷烹烽焉焊焕爽犁猎猖猛猜猪猫率球琅理琉琐甜略畦疵痊痒痔痕皑盒盔盖盗盘盛眯眶眷眺眼着睁矫硅硒硕票祭祷祸秸移秽窑窒竟章笛符笨第笺笼粒粕粗粘累绩绪续绰绳维绵绷绸综绽绿缀羚翌聊聋职脖脚脯脱脸舵舶舷船菇菊菌菏菜菠菩菱菲萄萌萍萎萝萤营萧萨著虚蛀蛆蛇蛊蛋衅衔袋袭袱谋谍谎谐谓谗谚谜象赊赦趾跃距躯辅辆逮逸逻鄂酗酚酝酞野铜铝铡铣铬铭铰铱铲银阉阎阐隅隆隋随隐雀雪颅领颇颈馅馆骑鸽鸿鹿麻黄龚傅傈傍傣储傲凿剩割募博厦厨啼喀喂善喇喉喊喘喜喝喧喳喷喻堡堤堪堰塔壹奠奥婿媒媚嫂富寐寒寓尊就属屡嵌帽幂幅强彭御循悲惑惠惩惫惰惶惹惺愉愤愧慌慨掌掣揉揍描提插揖握揣揩揪揭援揽搀搁搂搅搓搔搜搭搽敞散敦敬斌斑斯普景晰晴晶智晾暂暑曾替最朝期棉棋棍棒棕棘棚棠森棱棵棺椅植椎椒椭椰榔欺款殖毯氮氯氰渝渡渣渤温渭港渴游渺湃湍湖湘湛湾湿溃溅溉滁滋滑滞焙焚焦焰然煮牌犀犊猩猴猾琢琳琴琵琶琼甥番畴疏痘痛痞痢痪登皖短硝硫硬确硷禄禽稀程稍税窖窗窘窜窝竣童等筋筏筐筑筒答策筛粟粤粥粪紫絮缄缅缆缉缎缓缔缕编缘羡翔翘联脾腆腊腋腑腔腕舒舜艇落葛葡董葫葬葱葵蒂蒋蛔蛙蛛蛤蛮蛰蜒街裁裂装裕裙裤谢谣谤谦赋赌赎赏赐赔趁超越趋跋跌跑践辈辉辊辜逼逾遁遂遇遍遏道遗酣酥釉释量铸铺链销锁锄锅锈锋锌锐锑阑阔隔隘隙雁雄雅集雇韩颊馈馋骗骚鲁鹃鹅黍黑鼎催傻像剿勤叠嗅嗓嗜嗡嗣塌塑塘塞填墓媳嫁嫉嫌寝寞幌幕廉廓微想愁愈意愚感慈慎慑搏搐搞搪搬携摄摆摇摈摊摸数斟新暇暖暗椽椿楔楚楞楷楼概榆槐歇歌殿毁源溜溢溪溯溶溺滇滓滔滚满滤滥滦滨滩漓漠煌煎煞煤照献猿瑚瑞瑟瑰甄畸痰痴痹瘁盟睛睡督睦睫睬睹瞄矮硼碉碌碍碎碑碗碘碰禁福稗稚稠窟窥筷筹签简粮粱粳缚缝缠罩罪置署群聘肄肆腥腮腰腹腺腻腾腿舅蒙蒜蒲蒸蓄蓉蓑蓖蓝蓟蓬虞蛹蛾蜂蜕蜗衙裔裸褂解触詹誉誊谨谩谬豢貉赖跟跨跪路跳跺躲辐辑输辞辟遣遥鄙酪酬酮酱鉴锗错锚锡锣锤锥锦锨锭键锯锰障雍雏零雷雹雾靖靳靴靶韵颐频颓颖馏魁魂鲍鹊鹏鼓鼠龄僚僧僳兢凳嗽嘉嘎嘘嘛境墅墒墙嫡嫩孵察寡寥寨廖弊彰愿慕慢慷截摔摘摧摹撂撇敲斡旗榜榨榴榷槛模歉滴漂漆漏演漫漱漳漾潍煽熄熊熏熔熙熬瑶璃疑瘟瘦瘩瞅碟碧碱碳碴磁磋稳竭端箍箔箕算管箩粹精缨缩翟翠聚肇腐膀膊膏膜舆舔舞蔑蔓蔗蔚蔡蔫蔷蔼蔽蜀蜘蜜蜡蝇蝉裳裴裹褐褪誓谭谰谱豪貌赘赚赛赫踊踌辕辖辗辣遭遮酵酶酷酸酿锹锻镀镁隧雌需静韶颗馒骡魄鲜鼻僵僻凛劈嘱嘲嘶嘻嘿噎噶增墟墨墩履幢影德慧慰憋憎憨懂戮摩撅撑撒撕撞撤撩撬播撮撰撵擒敷暮暴槽樊樟横樱橡毅潘潜潦潭潮澄澈澎澜澳熟瘤瘪瘫瞎瞒碾磅磊磐磕稻稼稽稿箭箱篆篇篓糊缮聪膘膛膝艘蔬蕉蕊蕴蝎蝗蝴蝶褒褥谴豌豫趟趣踏踞踢踩踪躺遵醇醉醋镇镊镍镐镑霄震霉靠鞋鞍题颜额飘骸鲤鹤黎儒冀凝嘴器噪噬壁憾懈懊懒撼擂擅操擎擞整橇橙橱潞澡激濒燃燎燕獭瓢瘴瘸瞥磨磺穆窿篙篡篮篱篷糕糖糙缴翰翱耪膨膳臻蕾薄薛薪薯融螟衡赞赠蹄辙辨辩避邀醒醚醛镜雕霍霓霖靛鞘颠餐鲸黔默儡嚎嚏壕孺徽懦戴擦曙檀檄檬燥爵癌瞧瞩瞪瞬瞳磷礁穗簇簧糜糟糠繁翼臀臂臃臆藉藏藐螺襄豁赡赢蹈蹋辫镣霜霞鞠骤魏鳃龋嚣彝戳瀑瞻翻藕藤藩襟覆蹦躇镭镰鞭鬃鹰孽攀攒曝爆瓣疆癣簿羹藻蘑蟹警蹬蹭蹲蹿靡颤鳖麓嚷嚼壤巍攘灌籍糯纂耀蠕譬躁魔鳞蠢赣露霸霹髓囊瓤蘸镶攫罐颧矗';





function DT_Listfun_judgeCN(char1,char2,mode){ var DT_charSet=DT_charMode?DT_charPYStr:DT_charBHStr; for(var n=0;n<(char1.length>char2.length?char1.length:char2.length);n++){ if(char1.charAt(n)!=char2.charAt(n)){ if(mode) return(DT_charSet.indexOf(char1.charAt(n))>DT_charSet.indexOf(char2.charAt(n))?1:-1); else return(DT_charSet.indexOf(char1.charAt(n))<DT_charSet.indexOf(char2.charAt(n))?1:-1); break; } } return(0);}

function DT_Listfun_sorttab(DT_the_tab,col,mode){

var DT_tab_arr = new Array(); var i; var start=new Date; for(i=DTable_minrowIndex;i<DT_the_tab.rows.length;i++)
{ 
DT_tab_arr.push(new Array(DT_the_tab.rows[i].cells[col].innerText.toLowerCase(),DT_the_tab.rows[i]));
} 


function DT_Listfun_SortArr(mode) { 

return function (arr1, arr2){ var DT_flag; var a,b; a = arr1[0]; b = arr2[0]; if(/^(\+|-)?\d+($|\.\d+$)/.test(a) && /^(\+|-)?\d+($|\.\d+$)/.test(b)){ a=eval(a); b=eval(b); DT_flag=mode?(a>b?1:(a<b?-1:0)):(a<b?1:(a>b?-1:0)); }else{ a=a.toString(); b=b.toString(); if(a.charCodeAt(0)>=19968 && b.charCodeAt(0)>=19968){ DT_flag = DT_Listfun_judgeCN(a,b,mode); }else{ DT_flag=mode?(a>b?1:(a<b?-1:0)):(a<b?1:(a>b?-1:0)); } } return DT_flag; }; } DT_tab_arr.sort(DT_Listfun_SortArr(mode));

for(i=0;i<DT_tab_arr.length;i++)
{
DT_the_tab.lastChild.appendChild(DT_tab_arr[i][1]); 
}
} 

function DT_Listfun_changerow(DT_the_tab,line1,line2){

DT_the_tab.rows[line1].swapNode(DT_the_tab.rows[line2])}

function DT_Listfun_changecol(DT_the_tab,line1,line2){

for(var i=DTable_minrowIndex-1;i<DT_the_tab.rows.length;i++) DT_the_tab.rows[i].cells[line1].swapNode(DT_the_tab.rows[i].cells[line2]);
}


function DT_Listfun_sortMoveup(DT_DT_the_table){

event.cancelBubble=true; if(DT_cur_row==null || DT_cur_row<=1)return; DT_Listfun_changerow(DT_DT_the_table,DT_cur_row,--DT_cur_row);}

function DT_Listfun_Movedown(DT_DT_the_table){ 

event.cancelBubble=true; if(DT_cur_row==null || DT_cur_row==DT_DT_the_table.rows.length-1 || DT_cur_row==0)return; DT_Listfun_changerow(DT_DT_the_table,DT_cur_row,++DT_cur_row);}

function DT_Listfun_Moveleft(DT_DT_the_table){ event.cancelBubble=true; if(DT_cur_col==null || DT_cur_col==0)return; DT_Listfun_changecol(DT_DT_the_table,DT_cur_col,--DT_cur_col); if(DT_cur_col==DT_sort_col){DT_sort_col=DT_cur_col+1;} else if(DT_cur_col+1==DT_sort_col){DT_sort_col=DT_cur_col;}}



function DT_Listfun_Moveright(DT_DT_the_table){
event.cancelBubble=true; if(DT_cur_col==null || DT_cur_col==DT_DT_the_table.rows[DTable_minrowIndex-1].cells.length-1)return; DT_Listfun_changecol(DT_DT_the_table,DT_cur_col,++DT_cur_col); if(DT_cur_col==DT_sort_col){DT_sort_col=DT_cur_col-1;} else if(DT_cur_col-1==DT_sort_col){DT_sort_col=DT_cur_col;}} 


function DT_Listfun_restab(DT_DT_the_table){

DT_DT_the_table.outerHTML=DT_Org_con; 
DT_Listfun_init();
if(document.getElementById('DTable_Button_Insert')!=null)
{
document.all.DTable_Button_Insert.disabled=false;
}
if(document.getElementById('DTable_Button_EditIt')!=null)
{
document.all.DTable_Button_EditIt.disabled=false;
}
if(document.getElementById('DTable_Button_DT_Listfun_sendit')!=null)
{
document.all.DTable_Button_DT_Listfun_sendit.disabled=false;
}
DTable_State='list';


}


			   function DT_Listfun_addrow(the_table) {
				   if(DT_Grid_EnableInert==false)
				   {
					   alert('禁止增加记录');
					   DT_info.innerHTML='禁止增加记录..';
					   return false;
				   }
			   DT_info.innerHTML='插入新记录..';
	event.cancelBubble=true;
	var the_row,the_cell;
	the_row = DT_cur_row==null?-1:(the_table.rows.length);

	var newrow=the_table.insertRow(the_row);
	for (var i=0;i<the_table.rows[the_table.rows.length-2].cells.length;i++)
	
	{
	
	//33
	if(i>=DTable_mincellIndex)
	//22
	{
var isok=false;
try
{
var tmp001=eval('DT_Fieldtype' + i);
isok=true;
}
catch(e)
{
isok=false;
}
finally
{
}
var strinnertext='';

//11
if(isok==true)
{
if(eval('DT_Fieldtype' + i)=='select')//处理下拉
{
strinnertext='';
}
else if(eval('DT_Fieldtype' + i)=='datetime')//处理下拉
{
dtthis=new Date();
strinnertext=dtthis.getFullYear() + '-' + (parseInt(dtthis.getMonth()) + 1).toString() + '-' + dtthis.getDate().toString();

}
else if(eval('DT_Fieldtype' + i)=='numeric')//处理下拉
{
strinnertext='0';
}
else if(eval('DT_Fieldtype' + i)=='checkbox')//处理下拉
{
var tmpcheckvalue=eval('DT_Fieldvalue' + i).split('$$');
strinnertext=tmpcheckvalue[1].toString();
}
}
//11


		the_cell=newrow.insertCell(i);
		the_cell.innerText=strinnertext;
		the_cell.className='DT_List_CellStyle';
		

		}
		else
		{
		the_cell=newrow.insertCell(i);
		
		the_cell.innerHTML=the_table.rows[the_table.rows.length-2].cells[i].innerHTML.toString();
		the_cell.className='DT_List_CellStyle';
		}
		//22
		
	}
	

//33
	DT_Listfun_initValue(DTable_minrowIndex-1);
for(var ii=1;ii<=the_table.rows[DTable_minrowIndex-1].cells.length-1;ii++)
{
DT_Listfun_SetTDContral(the_table.rows.length-1,ii,'1');
}
DTable_State='insert';

the_table.rows[the_table.rows.length-1].DTable_RID='0';

the_table.rows[the_table.rows.length-1].cells[DTable_mincellIndex].firstChild.focus();
EnableDragCell_init=false;
EnableSort_init=false;
EnableAdjustCellWidth_init=false;
}

function DT_isNumber(NUM)
{
 var i,j,strTemp;
 strTemp="0123456789.";
 if ( NUM.length== 0)
  return false;
 for (i=0;i<NUM.length;i++)
 {
  j=strTemp.indexOf(NUM.charAt(i)); 
  if (j==-1)
  {
   return false;
  }
 }
 return true;
}


function DT_Listfun_sendit()
{
DT_info.innerHTML='正在保存所有操作...';
var objtable=DT_thisTable;
var StrText='';
var intnum=0;
var i=0;
var ii=0;
var intinsert=0;
var intedit=0;
var intdel=0;
var streditid='';
for (i=DTable_minrowIndex;i<objtable.rows.length;i++)
{
	
	if(objtable.rows[i].cells[DTable_mincellIndex].firstChild!=undefined && objtable.rows[i].cells[DTable_mincellIndex].firstChild.value!=undefined)
	{
		if(objtable.rows[i].DTable_RID!=undefined && objtable.rows[i].DTable_RID.toString()!='0')
		{
	StrText=StrText + objtable.rows[i].DTable_RID.toString() + '^^^';
	intedit=intedit +1;
	streditid=streditid + objtable.rows[i].DTable_RID.toString() + ',';
		}
		else
		{
			StrText=StrText + '0' + '^^^';
			intinsert=intinsert +1;
		}

	}


for (ii=1;ii<=objtable.rows[DTable_minrowIndex-1].cells.length-1;ii++) 
{
if(objtable.rows[i].cells[ii].firstChild!=undefined && objtable.rows[i].cells[ii].firstChild.value!=undefined)
{
intnum++;
var strtmpv=objtable.rows[i].cells[ii].firstChild.value;
if(strtmpv.length>0)
{
strtmpv=Trim(strtmpv);
strtmpv=replace(strtmpv,'&nbsp;','');
}


var type='';
var strnotnull='false';
try
{
type=eval('DT_Fieldtype' + ii.toString()).toString();
strnotnull=eval('DT_FieldNotNull' + ii.toString()).toString().toLowerCase();
}
catch(e1)
{
}
if(strnotnull=='true' && strtmpv.length<1)
{
alert('请输入');
objtable.rows[i].cells[ii].firstChild.focus();
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列不允许为空，请输入..';
return false;
}

  if(type=='text' && strtmpv!='')
   {
var strtmpvalue=eval('DT_Fieldvalue' + ii).toString();
var strtmpvararr=strtmpvalue.split('$$');
var intminL=parseInt(strtmpvararr[0].toString());
var intmaxL=parseInt(strtmpvararr[1].toString());
var strstring=strtmpvararr[2].toString();
var strms=strtmpvararr[3].toString();
var strinputvalue=strtmpv;
var intinputlength=strinputvalue.length;

if(intinputlength<intminL)
{
alert('您输入的文字数不能少于' + intminL.toString());

objtable.rows[i].cells[ii].firstChild.focus();
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列输入的文字数不能少于' + intminL.toString() + '..';

return false;
}
if(intinputlength>intmaxL)
{
alert('您输入的文字数不能多于' + intmaxL.toString());
objtable.rows[i].cells[ii].firstChild.focus();
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列输入的文字数不能多于' + intmaxL.toString() + '..';

return false;
}

if(strstring.length>-1)
{
if(strinputvalue.indexOf(strstring)==-1)
{
alert(strms);
objtable.rows[i].cells[ii].firstChild.focus();

return false;
}
}
}
else if(type=='checkbox')
	{//strtmpv
	if (objtable.rows[i].cells[ii].firstChild.checked==true)
		{
	strtmpv='1';
		}
		else
		{
			strtmpv='0';
		}


	}
else if(type=='numeric' && strtmpv!='')
{
var strnbarr=eval('DT_Fieldvalue' + ii + '.split("$$")');
var intminnb=parseInt(strnbarr[0]);
var intmaxnb=parseInt(strnbarr[1]);
var intxsl=parseInt(strnbarr[2]);
var strms=strnbarr[3].toString();
var strreturnvalue=strtmpv;
if(DT_isNumber(strreturnvalue)==false)
{
alert('不是数字');
objtable.rows[i].cells[ii].firstChild.focus();
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列必须输入数字..';
return false;

}
if(parseInt(strreturnvalue)<intminnb)
{
alert('输入的数字不能小于' + intminnb.toString());
objtable.rows[i].cells[ii].firstChild.focus();
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列输入的数字不能小于' + intminnb.toString() + '..';

return false;
}
if(parseInt(strreturnvalue)>intmaxnb)
{
alert('输入的数字不能大于' + intmaxnb.toString());
eval('document.all.nb_' + i + '_' + ii + '.focus()');
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列输入的数字不能大于' + intmaxnb.toString() + '..';

return false;
}

}
else if(type=='datetime' && strtmpv!='')
{
if(DT_Date_Ex(strtmpv)==false)
{
alert('日期格式错误');
eval('document.all.dt_' + i + '_' + ii + '.focus()');
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列必须输入合法的日期或时间，如2005-1-12 21:35:12 ..';

return false;
}
var d1=eval('DT_Fieldvalue' + ii).toString().split('$$')[0];
var d2=eval('DT_Fieldvalue' + ii).toString().split('$$')[1];
d1=d1.replace(/-/g, "/");
d2=d2.replace(/-/g, "/");
strtmpv=strtmpv.replace(/-/g, "/");

if(Date.parse(strtmpv)<Date.parse(d1))
{
alert('日期必须晚于' + d1.toString());
objtable.rows[i].cells[ii].firstChild.focus();
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列日期必须晚于' + d1.toString() + ' ..';

return false;
}
if(Date.parse(strtmpv)>Date.parse(d2))
{
alert('日期必须早于' + d2.toString());
objtable.rows[i].cells[ii].firstChild.focus();
DT_info.innerHTML='错误信息：第' + i + '行' + ii + '列日期必须早于' + d2.toString() + ' ..';

return false;
}
}

StrText=StrText + strtmpv;
	}
if(ii<objtable.rows[DTable_minrowIndex].cells.length-1 && objtable.rows[i].cells[1].firstChild!=undefined && objtable.rows[i].cells[1].firstChild.value!=undefined)
{
StrText=StrText + '^^^';
}


	}
if(i<objtable.rows.length-1 && objtable.rows[i].cells[1].firstChild!=undefined && objtable.rows[i].cells[1].firstChild.value!=undefined)
{
	StrText=StrText + '$$$';
}	

}



var obj = document.getElementsByName('DTCheckselect');
if(obj!=null)
{
var strvalue='';
for(var i=0;i<obj.length;i++)
{
if (obj[i].checked==true)
{
strvalue+=obj[i].value + ',';
intdel=intdel + 1;
}
}
}


if(intnum>0)
{
document.all.DT_GridSendForm_body.value=StrText;
//streditid
streditid=streditid.substr(0,streditid.length-1);
document.all.DT_GridSendForm_Editid.value=streditid;
}
if(strvalue.length>0)
{
strvalue=strvalue.substr(0,strvalue.length-1);
document.all.DT_GridSendForm_DelID.value=strvalue;
}

if(intnum>0 || strvalue.length>0)
	{

if(confirm('您更新了' + intedit + '条记录；插入了' + intinsert + '条记录；删除了' + intdel + '条记录，确定要提交？'))
	{
	}
	else
		{
	return false;
		}
document.all.DT_GridSendForm.submit();
}
else
{
alert('没有任何操作被执行');
DT_info.innerHTML='信息：您没有执行任何操作 ..';

}

}	



function DTable_Funcheckclick(){

var obj = document.getElementsByName('DTCheckselect');
var strvalue='';
for(var i=0;i<obj.length;i++)
{
if (obj[i].checked==true)
{
strvalue+=obj[i].value + ',';
}
}
if (strvalue.length>0)
{
strvalue=strvalue.substr(0,strvalue.length-1);
document.DTable_sendcheckform.DTable_checkvalue.value=strvalue;
document.DTable_sendcheckform.submit();
}
else
{
alert('请至少选择一条记录');
return true;
}
}




var jsqthisobj;
function jsqgetvalue(){
if(blislistnumeric=true && DTable_rowIndex>0 && DTable_cellIndex>0)
{
var strnbarr=eval('DT_Fieldvalue' + DTable_cellIndex + '.split("$$")');
var intminnb=parseInt(strnbarr[0]);//最小值
var intmaxnb=parseInt(strnbarr[1]);//最大值
var intxsl=parseInt(strnbarr[2]);//小数点后位数
var strms=strnbarr[3].toString();//货币符号
var strreturnvalue=document.all.ReadOut.value;
if(parseInt(strreturnvalue)<intminnb)
{
alert('输入的数字不能小于' + intminnb.toString());
return false;
}
if(parseInt(strreturnvalue)>intmaxnb)
{
alert('输入的数字不能大于' + intmaxnb.toString());
return false;
}
var intd=strreturnvalue.indexOf('.');
if(intd>-1)
{
var strtmpxsd=strreturnvalue.substring(0,intd + parseInt(intxsl) + 1);
document.all.ReadOut.value=strtmpxsd;
}
else
{
if(parseInt(intxsl)>0)
{
strxsvalue='';
for(i=0;i<intxsl;i++)
{
strxsvalue=strxsvalue + '0';
}
document.all.ReadOut.value=document.all.ReadOut.value + '.' + strxsvalue;
}
}
jsqthisobj.value=document.all.ReadOut.value;


DT_Main_Tab.rows[DTable_rowIndex].cells[DTable_cellIndex].innerHTML=strms + eval('document.all.nb_' + DTable_rowIndex + '_' + DTable_cellIndex + '.value');
if(DT_cur_cell!=null)
{
DT_cur_cell=null;
}
if(DT_cur_row!=null)
{
DT_cur_row=null;
}
DT_hidejsq();
return false;



}
jsqthisobj.value=document.all.ReadOut.value;

dtablejsqc.style.visibility='hidden';
}
function DT_hidejsq()
{
DT_ShowallSelect();
dtablejsqc.style.visibility='hidden';

}
function showjsq(sobjjsj){
jsqthisobj=sobjjsj;
if(jsqthisobj.value!='')
{

document.all.ReadOut.value=jsqthisobj.value;
}
var point = DT_fGetXY(sobjjsj); 
with (dtablejsqc.style) {
	left = point.x;
top=event.clientY;
width = dtablejsqc.offsetWidth;
height = dtablejsqc.offsetHeight;
fToggleTags(left,top,width,height);
visibility = 'visible'; 
}
dtablejsqc.focus();
}

function dtjsq_jsqbtover(obj){var tmpobj=obj;tmpobj.style.backgroundColor='#CC6600';tmpobj.style.color='#FFFFFF';}

function dtjsq_jsqbtout(obj){var tmpobj=obj;tmpobj.style.backgroundColor='#f6f6f6';tmpobj.style.color="#000000";}var FKeyPad = document.all;var Accum = 0;var FlagNewNum = false;var PendingOp = '';

function dtjsq_NumPressed (Num) {if (FlagNewNum) {FKeyPad.ReadOut.value = Num;FlagNewNum = false; }else {if (FKeyPad.ReadOut.value == "0")FKeyPad.ReadOut.value = Num;else{FKeyPad.ReadOut.value += Num; }}}

function dtjsq_Operation (Op) {var Readout = FKeyPad.ReadOut.value;if(FlagNewNum && PendingOp != "=");else{FlagNewNum = true;if ( '+' == PendingOp ){Accum += parseFloat(Readout);}else if ( '-' == PendingOp ){Accum -= parseFloat(Readout);}else if ( '/' == PendingOp ){Accum /= parseFloat(Readout);}else if ( '*' == PendingOp ){Accum *= parseFloat(Readout);}else
Accum = parseFloat(Readout);FKeyPad.ReadOut.value = Accum;PendingOp = Op; }}

function Decimal () {var curReadOut = FKeyPad.ReadOut.value;if (FlagNewNum) {curReadOut = "0.";FlagNewNum = false; }else{if (curReadOut.indexOf(".") == -1)curReadOut += "."; }FKeyPad.ReadOut.value = curReadOut;}

function ClearEntry () {FKeyPad.ReadOut.value = "0";FlagNewNum = true;}

function Clear () {Accum = 0;PendingOp = '';ClearEntry();}

function Neg () {FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;}

function Percent () {FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accum);}


function CheckBoxSelectAll_onclick(){var obj = document.getElementsByName("CheckBoxSelectAll");if (obj[0].checked==true){CheckAll();}else{unCheckAll();}}function unCheckAll(){var obj = document.getElementsByName("DTCheckselect");for(var i=0;i<obj.length;i++){obj[i].checked=false;}}function CheckAll()	{var obj = document.getElementsByName("DTCheckselect");for(var i=0;i<obj.length;i++){obj[i].checked=true;}}


 var DTable_menuskin = 'skin1'; var DTable_display_url = 0; var DTable_DTable_overcolormenu='ADD7FF'; var DTable_clickedcolor='#ffffff'; 
 
 
 var DTable_clickedbgcolor='#639ACE'; var thisname=''; var thisid='';function gotochildurl(theurl,target){window.open(theurl + thisid,target);}function checkselected(){if(thisid==''){window.alert('请选择一条记录');return false;}else{return true;}}
function gotomyurl(theur)
	{
		window.open(theur + thisid,'_self');return document.DTable_returnValue;
}
//
function DTable_tr_onmouseover(element) { 
DT_resize_isre=false;
DT_resize_CurState=false ;
DT_resize_CurDown=false ;

window.document.body.style.cursor="Default" ;

var oTR = getElement(element, 'TR'); 	if (oTR != null && !eval(oTR.active)) { oTR.style.backgroundColor = DTable_DTable_overcolormenu; 		} 		} function DTable_tr_onmouseout(element) { var oTR = getElement(element, 'TR'); if (oTR != null && !eval(oTR.active)) { oTR.style.backgroundColor = '';}} 
//alert('ok');
function DTable_tr_onclick(element,ztname,ztid)
	{

	thisname=ztname; 
	thisid=ztid; 
	var the9909href;
	if(document.getElementById('the9909')){the9909href='?MDeleteID=' + thisid;the9909.href=the9909href;}
	if (document.getElementById('theedit')){theedit.innerHTML='<font face=Wingdings size=3>2</font>[' + thisname + ']';} 
	
	if (document.getElementById('thedelete')){thedelete.innerHTML='×[' + thisname + ']';} 
	if (document.getElementById('theshow')){theshow.innerHTML='查看[' + thisname + ']';}
	var oTR = getElement(element, 'TR');
	var oTABLE = getElement(oTR, 'TABLE');
	if (oTABLE != null) { if (typeof(oTABLE.activeRow) != 'undefined' && oTABLE.activeRow != null) {
		oTABLE.activeRow.style.backgroundColor = ''; 
		oTABLE.activeRow.style.color = '';
		oTABLE.activeRow.active = 'false';
		}

		if (oTR != null) {
			oTR.style.backgroundColor = DTable_clickedbgcolor; 
			oTR.style.color = DTable_clickedcolor;
			oTR.active = 'true';
			oTABLE.activeRow = oTR;
			}
			}
			} 

function getElement(src, tagName) { var obj = src; while (obj != null && obj.tagName != tagName) { obj = obj.parentElement; } return obj; } 


function showmenuie5() { var DTable_rightedge = document.body.clientWidth-event.clientX; var DTable_bottomedge = document.body.clientHeight-event.clientY; if (DTable_rightedge < ie5menu.offsetWidth) ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth; else ie5menu.style.left = document.body.scrollLeft + event.clientX; if (DTable_bottomedge < ie5menu.offsetHeight) ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight; else ie5menu.style.top = document.body.scrollTop + event.clientY; ie5menu.style.visibility = 'visible'; return false; } 


function DTable_hidemenuie5() { ie5menu.style.visibility = 'hidden'; }

function DTable_ctr_onclick(element){var oTR = getElement(element, 'TR'); var oTABLE = getElement(oTR, 'TABLE');if (oTABLE != null){if(typeof(oTABLE.activeRow) != 'undefined' && oTABLE.activeRow != null) { oTABLE.activeRow.style.backgroundColor = '';oTABLE.activeRow.style.color = ''; oTABLE.activeRow.active = 'false';} if (oTR != null){ oTR.style.backgroundColor = DTable_clickedbgcolor;oTR.style.color = DTable_clickedcolor; oTR.active = 'true';oTABLE.activeRow = oTR;}}}


 function DTable_menuover(obj) {  var theobj1=obj; theobj1.style.backgroundColor=DTable_overbg; theobj1.style.color=DTable_overcolormenu; } 

function menuout(obj) {  var theobj=obj; theobj.style.backgroundColor=''; theobj.style.color=''; } function DTable_gotourl() {   var i, args=DTable_gotourl.arguments; document.DTable_returnValue = false;  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");}

function DT_getPosition(el){var l = el.offsetLeft,t = el.offsetTop;

while (el = el.offsetParent){l += el.offsetLeft;	t += el.offsetTop;}return {'left':l,'top':t}}


