﻿// 数据处理函数
var behavior_jbblog = false ; // 操作行为，看工作的时候，是否喜欢阅读详细的工作日志
var flashbackground = null ;
var _page_roles = [] ; // 用来存放每个页面的访问权限
//  [0] = page filename (no extention)
//  [1] = page roles []
//        [1][0] = dom id 
//        [1][1] = 0/1  0:visible 1:hidden    
var _autocompletedblclick = false ;
var _table2xls = false ;
var autochkwinopen = false;
var sys_no_popupmenu = false ;
var _holdctrl = false ;
var _backurls = [] ;
var _apppower_files = [] ;
// 里面是这样存放的
// _apppower_files[0] = aspx/html filename and no extention 
// _apppower_files[1] = ,apname,sdfdsf,fdsfds,
_edit_rowi1 = 0 ;
_edit_coli1 = 0 ;
var _table_format = [] ; 
var _tb_fmt_flds  ; 
var _tb_fmt_fmts  ;  
var _tableflds ;
var _tablefmt1  ; 
var _tmparr1 ;

// 里面存放的是表格的的ID以及aspx名称 // pagefilename + "."+tbname
// 第2条保存的是否可编辑
// 第3条保存的{order}
// 第4条保存的{ordera}
// 第5条是_tb_fmt_flds
// 第6条是_tb_fmt_fmts
// 第7条是details内容
// 第8条是details内容字段对应的index,这样才可能快速查找
// 第9条是字段信息内容

var _icons = [] ; 
var dropdowncache = [] ;
// 第一条存放的是url值，第二条存放的是返回的cache值


if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i ){ //判断Array的原型是否已作indexOf方法的扩展
  i || (i = 0); //初始化起步查询的下标，比较奇特的写法。
  var length = this.length;
  if (i < 0) i = length + i; // 如i为负数，则从数组末端开始。
  for (; i < length; i++)
    if (this[i] === item) return i;  // 使用全等于(===)判断符
  return -1;
};

if (!Array.prototype.indexOf2) Array.prototype.indexOf2 = function(item, i ,j){ //判断Array的原型是否已作indexOf方法的扩展
  i || (i = 0); //初始化起步查询的下标，比较奇特的写法。
  j || (j = 1); //初始化起步查询的下标，比较奇特的写法。
  var length = this.length;
  if (i < 0) i = length + i; // 如i为负数，则从数组末端开始。
  for (; i < length; i+=j)
    if (this[i] === item) return i;  // 使用全等于(===)判断符
  return -1;
};

function _inccode(olds) 
{
	var s = ""+olds.trim();
	if (s=="") return "000001" ;
	
	var s1 = "" ;
	var srear="";
	var smid="";
	var snum = "0123456789" ;
	while (s!="")
	{
		s1 = s.substr(s.length-1) ;
		s = s.substr(0,s.length-1) ;
		if (snum.indexOf(s1)>=0) 
		{
			s = s+s1 ;
			break ;
		} 
		else srear = s1+srear  ;
	} ;
	while (s!="")
	{
		s1 = s.substr(s.length-1) ;
		s = s.substr(0,s.length-1) ;
		if (snum.indexOf(s1)>=0)  smid = s1+smid ;
		else 
		{
			s = s+s1 ;
			break ;
		} ;
	} ;
	if (smid=="")
	{
		return s+smid+srear ;
	} ;
	var i = parseInt(smid) ;
	i++ ;
	var tmps = "00000000000000000000000000"+i ;
	tmps = tmps.substring(tmps.length - smid.length) ;
	return s+tmps+srear ;
};

function _get39code(pobj12,dom1$1,code1,title1,height1)
{
	_run(pobj12,"/sys/aspx/code39.aspx",
	function(msg1)
	{
		dom1$1.html("<img src=\""+msg1+"\" border=0 align=absmiddle>") ;
	},"code="+_tohex(code1)+"&label="+_tohex(title1)+"&height="+height1) ;
} ;
function _nohtmltag(src001)
{
	var s21 = src001.replace(/<[^>].*?>/g,"");
	s21 = s21.replaceAll("&nbsp;","").replaceAll("<","&lt;").replaceAll(">","&gt;") ;
	return s21 ;
};
function _cvtfilesize(size1)
{
	if (size1<1024) return size1+"  bytes" ; else 
	if (size1<1048576) return "<span title=\""+size1+" bytes\">"+fmtfloat(size1/1024.00,"#.##")+"  KB</span>" ; else 
	if (size1<1073741824) return "<span title=\""+size1+" bytes\">"+fmtfloat(size1/1048576.00,"#.##")+"  MB</span>" ; 
	else return "<span title=\""+size1+" bytes\">"+fmtfloat(size1/1073741824.00,"#.##")+"  GB</span>" ; 
};

function _setcustomervalues(pobj001,obj) 
{
	var str1 = "" ;
	var istdcell = (obj.id == "my_cell_edit") ;
	if (istdcell) 
	{
		var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
		if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
		var tdname1 = pobj001.$(obj).attr("tdname") ;
		var tdobj12 = null ;
		
		if ((tdname1=="cccode") || (tdname1=="cccomp") || (tdname1=="ccname")) 
		{
			tdobj12 = pobj001.$("td[name=cccode]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._cc_custusercode]).attr("value",_tohex(pobj001.$f[pobj001._cc_custusercode])) ;
			tdobj12 = pobj001.$("td[name=cccomp]",trobj12) ;
			if (tdobj12.length==1) 
			{
				str1 = pobj001.$f[pobj001._cc_compbrief] ;
				if (str1=="") str1 = pobj001.$f[pobj001._cc_callname] ;
				tdobj12.html(str1).attr("value",_tohex(str1)) ;
			} ;
			tdobj12 = pobj001.$("td[name=ccname]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._cc_callname]).attr("value",_tohex(pobj001.$f[pobj001._cc_callname])) ;
			// 对其它字段进行写值
			var i12 = 0 ; 
			for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			{
				tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			  if (tdobj12.length>0) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			} ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			_runsql("up_ord2_ccid","ord2id="+trobj12.attr("value")+"&ccid="+pobj001.$f[pobj001._cc_id]+
			"&code="+_tohex(pobj001.$f[pobj001._cc_custusercode])+
			"&name="+_tohex(pobj001.$f[pobj001._cc_callname])+
			"&cccomp="+_tohex(pobj001.$f[pobj001._cc_compbrief])) ;
	  } else
	  {
	  	// 不是ord2表，是其它table ,但也是通过这种方法来的
	  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  	if (tdobj12.length>0)
	  	{
	  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
	  		if (comefrom1=="") tdobj12.attr("comefrom","cc_callname") ;
	  		var i12 = 0 ; 
			  for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			  {
				  tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			    if (tdobj12.length>0) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			  } ;
			  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	  	} ;
	  } ; 
	} else 
	{
		var isordcc = ((obj.id=="ord_cccode") || (obj.id=="ord_cccomp")  || (obj.id=="ord_cstname")) ;
		var comefrom1 = "" ;
		if (isordcc) 
		{
			comefrom1 = _isnull(pobj001.$("#ord_cccode").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_cccode").attr("comefrom","cc_custusercode") ;
			comefrom1 = _isnull(pobj001.$("#ord_cccomp").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_cccomp").attr("comefrom","cc_compbrief") ;
			comefrom1 = _isnull(pobj001.$("#ord_cstname").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_cstname").attr("comefrom","cc_callname") ;
		} else 
		{
			comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$(obj).attr("comefrom","cc_callname") ;
		} ;
		
		for (var i=0 ; i<pobj001.$flds.length ;i++)
		{
			if (pobj001.$flds[i]=="cc_compbrief") 
			{
				comefrom1 = pobj001.$f[i] ;
				if (comefrom1=="") comefrom1 = pobj001.$f[pobj001._cc_callname] ;
			} else comefrom1 = pobj001.$f[i] ;
			_$value(pobj001,pobj001.$("#"+pobj001.$flds[i]+",*[comefrom="+pobj001.$flds[i]+"]"), comefrom1,"0");
		} ;
	  
	  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	  
	  if (isordcc) 
	  {
	  	var obj1 = pobj001.$("#ord_ccid") ;
			if ((obj1.length>0)) obj1.val(pobj001.$f[pobj001._cc_id]).attr("modified","0") ;
	  	try { pobj001.ccid = pobj001.$f[pobj001._cc_id] ; } catch(E) {} finally {} ;	
			try { pobj001.loadlxr(true) ; } catch(E) {} finally {} ;
		  try { pobj001.loadcustfees() ; } catch(E) {} finally {} ;	
	  } ;
	} ;
};

function _setbusinessvalues(pobj001,obj,setfordid1) 
{
	var istdcell = (obj.id == "my_cell_edit") ;
	if (istdcell) 
	{
		var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
		if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
		var tdname1 = pobj001.$(obj).attr("tdname") ;
		var tdobj12 = null ;
	  // 不是ord2表，是其它table ,但也是通过这种方法来的
	  tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  if (tdobj12.length>0)
	  {
	  	var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
	  	if (comefrom1=="") 
	  	{
	  		if (tdname1=="title") 
	  		  tdobj12.attr("comefrom","ord_title") ;
	  		else   tdobj12.attr("comefrom","ord_no") ;
	  	};
	  	var i12 = 0 ; 
		  for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
		  {
			  tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			  if (tdobj12.length>0) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			} ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	  } ; 
	} else 
	{
		var comefrom1 = "" ;
		if (obj.id=="ord_title") 
		{
			comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
		  if (comefrom1=="") pobj001.$(obj).attr("comefrom","ord_title") ;
		} else 
		{
			comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
		  if (comefrom1=="") pobj001.$(obj).attr("comefrom","ord_no") ;
		} ;
		
		if (setfordid1)
		{
			for (var i=0 ; i<pobj001.$flds.length ;i++)
			if (pobj001.$flds[i]=="ord_id") 
			try { pobj001.srcordid = pobj001.$f[i] ;} catch (e) { } finally { } ;
		} ;
			
		for (var i=0 ; i<pobj001.$flds.length ;i++)
			_$value(pobj001,pobj001.$("*[comefrom="+pobj001.$flds[i]+"]"), pobj001.$f[i],"0");
	  
	  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	} ;
};

function _setemplyeevalues(pobj001,obj) 
{
	var istdcell = (obj.id == "my_cell_edit") ;
	if (istdcell) 
	{
		var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
		if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
		var tdname1 = pobj001.$(obj).attr("tdname") ;
		var tdobj12 = null ;
		
		if ((tdname1=="cucode") || (tdname1=="cuname")) 
		{
			tdobj12 = pobj001.$("td[name=cucode]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._cu_usercode]).attr("value",_tohex(pobj001.$f[pobj001._cu_usercode])) ;
			tdobj12 = pobj001.$("td[name=cuname]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._cu_callname]).attr("value",_tohex(pobj001.$f[pobj001._cu_callname])) ;
			
			// 对其它字段进行写值
			var i12 = 0 ; 
			for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			{
				tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			  if (tdobj12.length==1) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			} ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			_runsql("up_ord2_cuid","ord2id="+trobj12.attr("value")+"&cuid="+pobj001.$f[pobj001._cu_id]+
			"&code="+_tohex(pobj001.$f[pobj001._cu_usercode])+
			"&name="+_tohex(pobj001.$f[pobj001._cu_callname])) ;
	  } else
	  {
	  	// 不是ord2表，是其它table ,但也是通过这种方法来的
	  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  	if (tdobj12.length>0)
	  	{
	  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
	  		if (comefrom1=="") tdobj12.attr("comefrom","cu_callname") ;
	  		var i12 = 0 ; 
			  for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			  {
				  tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			    if (tdobj12.length>0) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			  } ;
			  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	  	} ;
	  } ; 
	} else 
	{
		var isordcc = ((obj.id=="ord_cucode") || (obj.id=="ord_oaname")) ;
		var comefrom1 = "" ;
		if (isordcc) 
		{
			comefrom1 = _isnull(pobj001.$("#ord_cucode").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_cucode").attr("comefrom","cu_usercode") ;
			comefrom1 = _isnull(pobj001.$("#ord_oaname").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_oaname").attr("comefrom","cu_callname") ;
		} else
		{
			comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$(obj).attr("comefrom","cu_callname") ;
		} ;
		
		for (var i=0 ; i<pobj001.$flds.length ;i++)
			_$value(pobj001,pobj001.$("#"+pobj001.$flds[i]+",*[comefrom="+pobj001.$flds[i]+"]"), pobj001.$f[i],"0");
		try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		if (isordcc) 
	  {
	  	var obj1 = pobj001.$("#ord_cuid") ;
			if ((obj1.length>0)) obj1.val(pobj001.$f[pobj001._cu_id]).attr("modified","0") ;
	  } ;
	} ;
};
function _setequvalues(pobj001,obj) 
{
	var istdcell = (obj.id == "my_cell_edit") ;
	if (istdcell) 
	{
		var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
		if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
		var tdname1 = pobj001.$(obj).attr("tdname") ;
		var tdobj12 = null ;
		
		if ((tdname1=="equcode") || (tdname1=="equtitle")) 
		{
			tdobj12 = pobj001.$("td[name=equcode]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._equ_code]).attr("value",_tohex(pobj001.$f[pobj001._equ_code])) ;
			tdobj12 = pobj001.$("td[name=equtitle]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._equ_title]).attr("value",_tohex(pobj001.$f[pobj001._equ_title])) ;
			
			// 对其它字段进行写值
			var i12 = 0 ; 
			for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			{
				tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			  if (tdobj12.length==1) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			} ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			_runsql("up_ord2_equid","ord2id="+trobj12.attr("value")+"&equid="+pobj001.$f[pobj001._equ_id]+
			"&code="+_tohex(pobj001.$f[pobj001._equ_code])+
			"&name="+_tohex(pobj001.$f[pobj001._equ_title])) ;
	  } else
	  {
	  	// 不是ord2表，是其它table ,但也是通过这种方法来的
	  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  	if (tdobj12.length>0)
	  	{
	  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
	  		if (comefrom1=="") tdobj12.attr("comefrom","equ_title") ;
	  		var i12 = 0 ; 
			  for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			  {
				  tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			    if (tdobj12.length>0) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			  } ;
	  	} ;
	  	try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	  } ; 
	} else 
	{
		var isordcc = ((obj.id=="ord_equcode") || (obj.id=="ord_equtitle")) ;
		var comefrom1 = "" ;
		if (isordcc) 
		{
			comefrom1 = _isnull(pobj001.$("#ord_equcode").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_equcode").attr("comefrom","equ_code") ;
			comefrom1 = _isnull(pobj001.$("#ord_equtitle").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_equtitle").attr("comefrom","equ_title") ;
		} else
		{
			comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$(obj).attr("comefrom","equ_title") ;
		} ;
		
		for (var i=0 ; i<pobj001.$flds.length ;i++)
			_$value(pobj001,pobj001.$("#"+pobj001.$flds[i]+",*[comefrom="+pobj001.$flds[i]+"]"), pobj001.$f[i],"0");
		try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		
		var obj1 = pobj001.$("#ord_equid") ;
		
		if (obj1.length>0) 
	  {
			obj1.val(pobj001.$f[pobj001._equ_id]).attr("modified","0") ;
	  	try { pobj001.ordequid = pobj001.$f[pobj001._equ_id] ; } catch(E) {} finally {} ;	
			try { pobj001.ordequtitle = pobj001.$f[pobj001._equ_title] ; } catch(E) {} finally {} ;	
	  } ;
	} ;
};

function _setproductvalues(pobj001,obj) 
{
	var istdcell = (obj.id == "my_cell_edit") ;
	if (istdcell) 
	{
		var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
		if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
		var tdname1 = pobj001.$(obj).attr("tdname") ;
		var tdobj12 = null ;
		var fldsource1 = "" ;
		
		if ((tdname1=="code") || (tdname1=="title")) 
		{
			var setstr1 = "ord2_prdid="+pobj001.$f[pobj001._prd_id] ;
			var fld1s1 = ['code','title','model','pack','spec','brand','unit','price','expdays',
										'price0','price01','price1','price11','price2','price3',
										'prp01','prp02','prp03','prp04','prp05','prp06','prp07','prp08','prp09','prp10',
										'num01','num02','num03'] ;
			var jk1 = 0 ;
			for (var ij1=0 ; ij1<fld1s1.length ; ij1++) 
			{
			  tdobj12 = pobj001.$("td[name="+fld1s1[ij1]+"]",trobj12) ;
			  if (tdobj12.length==1)
			  {
			    fldsource1 = _isnull(tdobj12.attr("comefrom"),"") ;
			    if (fldsource1=="") tdobj12.attr("comefrom","prd_"+fld1s1[ij1]) ;
			  } ;
			} ;
			for (var ij1=0 ; ij1<pobj001.$flds.length ; ij1++) 
			{
				tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[ij1]+"]",trobj12) ;
				if (tdobj12.length==1)
				{
					tdname1 = tdobj12.attr("name") ;
					jk1 = fld1s1.indexOf(tdname1) ;
					tdobj12.html(_isnull(pobj001.$f[ij1],"&nbsp;")).attr("value",_tohex(pobj001.$f[ij1])) ;
					if (jk1>=0) 
					  setstr1 += ",ord2_"+tdname1+"='"+pobj001.$f[ij1]+"'" ;
					else
						tdobj12.addClass("tbupdatedtr").attr("ident",____ident()) ;
				} ;
			} ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			_runsql("up_ord2_prdinfo",{ord2id:trobj12.attr("value"),setval:setstr1}) ;
	  } else
	  {
	  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  	if (tdobj12.length>0)
	  	{
	  		fldsource1 = _isnull(tdobj12.attr("comefrom"),"") ;
			  if (fldsource1=="") tdobj12.attr("comefrom","prd_title") ;
	    } ;
	    for (var ij1=0 ; ij1<pobj001.$flds.length ; ij1++) 
			{
				tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[ij1]+"]",trobj12) ;
				if (tdobj12.length==1)
					tdobj12.html(_isnull(pobj001.$f[ij1],"&nbsp;")).attr("value",_tohex(pobj001.$f[ij1])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			} ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	  } ; 
	} else 
	{
		var isordcc = ((obj.id=="ord_prdcode") || (obj.id=="ord_prdtitle")) ;
		var comefrom1 = "" ;
		if (isordcc) 
		{
			comefrom1 = _isnull(pobj001.$("#ord_prdcode").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_prdcode").attr("comefrom","prd_code") ;
			comefrom1 = _isnull(pobj001.$("#ord_prdtitle").attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$("#ord_prdtitle").attr("comefrom","prd_title") ;
		} else
		{
			comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
			if (comefrom1=="") pobj001.$(obj).attr("comefrom","prd_title") ;
		} ;
		
		for (var i=0 ; i<pobj001.$flds.length ;i++)
			_$value(pobj001,pobj001.$("#"+pobj001.$flds[i]+",*[comefrom="+pobj001.$flds[i]+"]"), pobj001.$f[i],"0");
		try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		var obj1 = pobj001.$("#ord_prdid") ;
		if (obj1.length>0) 
	  {
			obj1.val(pobj001.$f[pobj001._prd_id]).attr("modified","0") ;
	  	try { pobj001.ordprdid = pobj001.$f[pobj001._prd_id] ; } catch(E) {} finally {} ;	
			try { pobj001.ordprdtitle = pobj001.$f[pobj001._prd_title] ; } catch(E) {} finally {} ;	
	  } ;
	} ;
};

function _setfeectgvalues(pobj001,obj) 
{
	var istdcell = (obj.id == "my_cell_edit") ;
	if (istdcell) 
	{
		var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
		if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
		var tdname1 = pobj001.$(obj).attr("tdname") ;
		var tdobj12 = null ;
		
		if ((tdname1=="ccbicode") || (tdname1=="ccbiname")) 
		{
			tdobj12 = pobj001.$("td[name=ccbicode]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._ccbi_code]).attr("value",_tohex(pobj001.$f[pobj001._ccbi_code])) ;
			tdobj12 = pobj001.$("td[name=ccbiname]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._ccbi_title]).attr("value",_tohex(pobj001.$f[pobj001._ccbi_title])) ;
			
			// 对其它字段进行写值
			var i12 = 0 ; 
			for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			{
				tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			  if (tdobj12.length==1) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			} ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			_runsql("up_ord2_ccbiid","ord2id="+trobj12.attr("value")+"&ccbiid="+pobj001.$f[pobj001._ccbi_id]+
			"&code="+_tohex(pobj001.$f[pobj001._ccbi_code])+
			"&name="+_tohex(pobj001.$f[pobj001._ccbi_title])) ;
	  } else
	  {
	  	// 不是ord2表，是其它table ,但也是通过这种方法来的
	  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  	if (tdobj12.length>0)
	  	{
	  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
	  		if (comefrom1=="") tdobj12.attr("comefrom","ccbi_title") ;
	  		var i12 = 0 ; 
			  for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			  {
				  tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			    if (tdobj12.length>0) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			  } ;
	  	} ;
	  	try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	  } ; 
	} else 
	{
		var isordcc = false ;
		var comefrom1 = "" ;
		var obj1 = null ;
		for (var ilk=1 ; ilk<=5 ; ilk ++ )
		{
			isordcc = ((obj.id=="ord_ccbicode"+ilk) || (obj.id=="ord_ccbititle"+ilk)) ;
			if (obj.id=="ord_ccbicode"+ilk) 
			{
				comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$(obj).attr("comefrom","ccbi_code") ;
				comefrom1 = _isnull(pobj001.$("#ord_ccbititle"+ilk).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_ccbititle"+ilk).attr("comefrom","ccbi_title") ;
			} else 
			if (obj.id=="ord_ccbititle"+ilk) 
			{
				comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$(obj).attr("comefrom","ccbi_title") ;
				comefrom1 = _isnull(pobj001.$("#ord_ccbicode"+ilk).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_ccbicode"+ilk).attr("comefrom","ccbi_code") ;
			} else 
			{
				comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$(obj).attr("comefrom","ccbi_title") ;
			} ;
			
			if (isordcc) 
		  {
		  	obj1 = pobj001.$("#ord_ccbiid"+ilk) ;
				if ((obj1.length>0)) obj1.val(pobj001.$f[pobj001._ccbi_id]).attr("modified","0") ;
				if (ilk==1)
				{
				  try { pobj001.ordccbiid1 = pobj001.$f[pobj001._ccbi_id] ; } catch(E) {} finally {} ;	
			    try { pobj001.ordccbititle1 = pobj001.$f[pobj001._ccbi_title] ; } catch(E) {} finally {} ;	
			  } ;  
			  if (ilk==2)
				{
				  try { pobj001.ordccbiid2 = pobj001.$f[pobj001._ccbi_id] ; } catch(E) {} finally {} ;	
			    try { pobj001.ordccbititle2 = pobj001.$f[pobj001._ccbi_title] ; } catch(E) {} finally {} ;	
			  } ;  
			  if (ilk==3)
				{
				  try { pobj001.ordccbiid3 = pobj001.$f[pobj001._ccbi_id] ; } catch(E) {} finally {} ;	
			    try { pobj001.ordccbititle3 = pobj001.$f[pobj001._ccbi_title] ; } catch(E) {} finally {} ;	
			  } ;  
			  if (ilk==4)
				{
				  try { pobj001.ordccbiid4 = pobj001.$f[pobj001._ccbi_id] ; } catch(E) {} finally {} ;	
			    try { pobj001.ordccbititle4 = pobj001.$f[pobj001._ccbi_title] ; } catch(E) {} finally {} ;	
			  } ;  
			  if (ilk==5)
				{
				  try { pobj001.ordccbiid5 = pobj001.$f[pobj001._ccbi_id] ; } catch(E) {} finally {} ;	
			    try { pobj001.ordccbititle5 = pobj001.$f[pobj001._ccbi_title] ; } catch(E) {} finally {} ;	
			  } ;  
		  } ;
		} ;
	  
		for (var i=0 ; i<pobj001.$flds.length ;i++)
			_$value(pobj001,pobj001.$("#"+pobj001.$flds[i]+",*[comefrom="+pobj001.$flds[i]+"]"), pobj001.$f[i],"0");
		try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
	} ;
};
function _isfeectg(pobj001,obj,ctg1,ctg2)
{
	var s1 = _isnull(pobj001.$(obj).val(),"");//.trim() ;
	//if ((pobj001.document.activeElement!=obj) && (obj.id!="my_cell_edit")) return true ;
	
	if (autochkwinopen) return ;
	autochkwinopen = true ;
	var notfound = false ;
	if (_autocompletedblclick) 
	{
		_slt1feetype3(pobj001,obj,ctg1,ctg2) ;
		return true ;
	} ;
	var nonmandatory = _isnull(pobj001.$(obj).attr("nonmandatory"),"")!="" ;
	if (nonmandatory) return ;
	if (s1.length>=2) 
	{
 
		_runsql4xml(pobj001,"g_feectg_bykey","ctg1="+tohex(ctg1)+"&ctg2="+tohex(ctg2)+"&key="+_tohex(s1),
		function(iseof,data1,dsname1)
		{
			if (!iseof)
			{
				if (pobj001.$f[pobj001._ccbi_id]!=0) 
				{
					_setfeectgvalues(pobj001,obj,pobj001.$f) ;
					pobj001.$(obj).addClass("checked") ;
				} else 
				{
					notfound = true ;
					pobj001.$(obj).removeClass("checked") ;
				} ;
			} else 
			if (!dsname1) 
			{
				if (notfound) _slt1feetype3(pobj001,obj,ctg1,ctg2) ; else autochkwinopen = false ;
			} ;
		});
	} else 
	{
		_slt1feetype3(pobj001,obj,ctg1,ctg2) ;
	} ;
	return true ;
};

function _isbusiness(pobj001,obj,crmid1,setfordid1)
{
	var s1 = _isnull(pobj001.$(obj).val(),"");//.trim() ;
	//if ((pobj001.document.activeElement!=obj) && (obj.id!="my_cell_edit")) return true ;
	if (autochkwinopen) return ;
	autochkwinopen = true ;
	
	var notfound = false ;
	
	if (_autocompletedblclick)
	{
		_slt1biz3(pobj001,obj,"",crmid1,setfordid1) ;
		return true ;
	} ;
	var nonmandatory = _isnull(pobj001.$(obj).attr("nonmandatory"),"")!="" ;
	if (nonmandatory) return ;
	if (s1.length>=4) 
	{
 
		_runsql4xml(pobj001,"g_biz_bykey","crmid1="+crmid1+"&ordno1="+_tohex(s1),
		function(iseof,data1,dsname1)
		{
			if (!iseof)
			{
				if (pobj001.$f[pobj001._ord_id]!=0) 
				{
					_setbusinessvalues(pobj001,obj,setfordid1) ;
					pobj001.$(obj).addClass("checked") ;
				} else 
				{
					notfound = true ;
					pobj001.$(obj).removeClass("checked") ;
				} ;
			} else 
			if (!dsname1) 
			{
				if (s1.length>4) s1 = s1.substr(0,4) ;
				if (notfound) _slt1biz3(pobj001,obj,s1,crmid1,setfordid1) ; else autochkwinopen = false ;
			} ;
		});
	} else 
	{
		_slt1biz3(pobj001,obj,s1,crmid1,setfordid1) ;
	} ;
	return true ;
};

function _iscustomer(pobj001,obj,tag1,ctg1)
{
	var s1 = _isnull(pobj001.$(obj).val(),"");//.trim() ;
	//if ((pobj001.document.activeElement!=obj) && (obj.id!="my_cell_edit")) return true ;
	if (autochkwinopen) return ;
	autochkwinopen = true ;
	var tagctg1 = tag1 ; 
	if (ctg1>0) tagctg1 = "-"+ctg1 ; 
	var notfound = false ;
	
	if (_autocompletedblclick)
	{
		_slt1cst3(pobj001,obj,"",tagctg1) ;
		return true ;
	} ;
	var nonmandatory = _isnull(pobj001.$(obj).attr("nonmandatory"),"")!="" ;
	if (nonmandatory) return ;
	if (s1.length>=2) 
	{
	 
		_runsql4xml(pobj001,"g_customer_bykey","tag="+tag1+"&ctid1="+tagctg1+"&key="+_tohex(s1),
		function(iseof,data1,dsname1)
		{
			if (!iseof)
			{
				if (pobj001.$f[pobj001._cc_id]!=0) 
				{
					_setcustomervalues(pobj001,obj,pobj001.$f) ;
					pobj001.$(obj).addClass("checked") ;
				} else 
				{
					notfound = true ;
					pobj001.$(obj).removeClass("checked") ;
				} ;
			} else 
			if (!dsname1) 
			{
				if (s1.length>4) s1 = s1.substr(0,4) ;
				if (notfound) _slt1cst3(pobj001,obj,s1,tagctg1) ; else autochkwinopen = false ;
			} ;
		});
	} else 
	{
		_slt1cst3(pobj001,obj,s1,tagctg1) ;
	} ;
	return true ;
};

function _isequ(pobj001,obj,tag1,ctg1)
{
	var s1 = _isnull(pobj001.$(obj).val(),"");//.trim() ;
	//if ((pobj001.document.activeElement!=obj) && (obj.id!="my_cell_edit")) return true ;
	if (autochkwinopen) return ;
	autochkwinopen = true ;
	var tagctg1 = tag1 ; 
	if (ctg1>0) tagctg1 = "-"+ctg1 ; 
	var notfound = false ;
	if (_autocompletedblclick)
	{
		_slt1equ3(pobj001,obj,"",tagctg1) ;
		return true ;
	} ;
	var nonmandatory = _isnull(pobj001.$(obj).attr("nonmandatory"),"")!="" ;
	if (nonmandatory) return ;
	if (s1.length>=2) 
	{
 
		_runsql4xml(pobj001,"g_equ_bykey","tag="+tag1+"&ctid1="+tagctg1+"&key="+_tohex(s1),
		function(iseof,data1,dsname1)
		{
			if (!iseof)
			{
				if (pobj001.$f[pobj001._equ_id]!=0) 
				{
					_setequvalues(pobj001,obj,pobj001.$f) ;
					pobj001.$(obj).addClass("checked") ;
				} else 
				{
					notfound = true ;
					pobj001.$(obj).removeClass("checked") ;
				} ;
			} else 
			if (!dsname1) 
			{
				if (s1.length>4) s1 = s1.substr(0,4) ;
				if (notfound) _slt1equ3(pobj001,obj,s1,tagctg1) ; else autochkwinopen = false ;
			} ;
		});
	} else 
	{
		_slt1equ3(pobj001,obj,s1,tagctg1) ;
	} ;
	return true ;
};

function _isprd(pobj001,obj,tag1,ctg1)
{
	var s1 = _isnull(pobj001.$(obj).val(),"");//.trim() ;
	//if ((pobj001.document.activeElement!=obj) && (obj.id!="my_cell_edit")) return true ;
	if (autochkwinopen) return ;
	autochkwinopen = true ;
	var tagctg1 = tag1 ; 
	if (ctg1>0) tagctg1 = "-"+ctg1 ; 
	var notfound = false ;
	if (_autocompletedblclick)
	{
		_slt1prd3(pobj001,obj,"",tagctg1) ;
		return true ;
	} ;
	var nonmandatory = _isnull(pobj001.$(obj).attr("nonmandatory"),"")!="" ;
	if (nonmandatory) return ;
	if (s1.length>=2) 
	{
		_runsql4xml(pobj001,"g_prd_bykey","tag="+tag1+"&ctid1="+tagctg1+"&key="+_tohex(s1),
		function(iseof,data1,dsname1)
		{
			if (!iseof)
			{
				if (pobj001.$f[pobj001._prd_id]!=0) 
				{
					_setproductvalues(pobj001,obj,pobj001.$f) ;
					pobj001.$(obj).addClass("checked") ;
				} else 
				{
					notfound = true ;
					pobj001.$(obj).removeClass("checked") ;
				} ;
			} else 
			if (!dsname1) 
			{
				if (s1.length>4) s1 = s1.substr(0,4) ;
				if (notfound) 
				{
					_slt1prd3(pobj001,obj,s1,tagctg1) ;
				} else autochkwinopen = false ;
			} ;
		});
	} else 
	{
		_slt1prd3(pobj001,obj,s1,tagctg1) ;
	} ;
	return true ;
};

function _slt1cst3(pobj001,obj,key1,tagctg12)
{
	pobj001.slt1cst2arr(
	function(ccid1,ccuserid1,cccode1,ccname1,ccbrief1,ccflds1,ccfldvs1)
	{
		
		var istdcell = obj.id == "my_cell_edit" ;
		pobj001.$(obj).addClass("checked") ;
		if (istdcell) 
		{
			var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
			if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
			var tdname1 = pobj001.$(obj).attr("tdname") ;
			var tdobj12 = null ;
			if ((tdname1=="cccode") || (tdname1=="cccomp") || (tdname1=="ccname")) 
			{
				tdobj12 = pobj001.$("td[name=cccode]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(cccode1).attr("value",_tohex(cccode1)) ;
				tdobj12 = pobj001.$("td[name=cccomp]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(ccbrief1).attr("value",_tohex(ccbrief1)) ;
				tdobj12 = pobj001.$("td[name=ccname]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(ccname1).attr("value",_tohex(ccname1)) ;
				
				// 对其它字段进行写值
				var i12 = 0 ; 
				for (i12 = 0 ; i12 < ccflds1.length ; i12 ++)
				{
					tdobj12 = pobj001.$("td[comefrom="+ccflds1[i12]+"]",trobj12) ;
				  if (tdobj12.length==1) tdobj12.html(ccfldvs1[i12]).attr("value",_tohex(ccfldvs1[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				} ;
			  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
				_runsql("up_ord2_ccid","ord2id="+trobj12.attr("value")+"&ccid="+ccid1+
				"&code="+_tohex(cccode1)+
				"&name="+_tohex(ccname1)+
				"&cccomp="+_tohex(ccbrief1)) ;
		  } else
		  {
		  	// 不是ord2表，是其它table ,但也是通过这种方法来的
		  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
		  	if (tdobj12.length>0)
		  	{
		  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
		  		if (comefrom1=="") tdobj12.attr("comefrom","cc_callname") ;
		  		var i12 = 0 ; 
				  for (i12 = 0 ; i12 < ccflds1.length ; i12 ++)
				  {
					  tdobj12 = pobj001.$("td[comefrom="+ccflds1[i12]+"]",trobj12) ;
				    if (tdobj12.length>0) tdobj12.html(ccfldvs1[i12]).attr("value",_tohex(ccfldvs1[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				  } ;
		  	} ;
		  	try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		  } ; 
		} else 
		{
			var isordcc = ((obj.id=="ord_cccode") || (obj.id=="ord_cccomp")  || (obj.id=="ord_cstname")) ;
			var comefrom1 = "" ;
			if (isordcc) 
			{
				comefrom1 = _isnull(pobj001.$("#ord_cccode").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_cccode").attr("comefrom","cc_custusercode") ;
				comefrom1 = _isnull(pobj001.$("#ord_cccomp").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_cccomp").attr("comefrom","cc_compbrief") ;
				comefrom1 = _isnull(pobj001.$("#ord_cstname").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_cstname").attr("comefrom","cc_callname") ;
			} else 
			{
				comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$(obj).attr("comefrom","cc_callname") ;
			} ;
			
			for (var i=0 ; i<ccflds1.length ;i++)
			{
				  _$value(pobj001,pobj001.$("#"+ccflds1[i]+",*[comefrom="+ccflds1[i]+"]"), ccfldvs1[i],"0");
		  } ;
	    try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		  if (isordcc) 
		  {
		  	var obj1 = pobj001.$("#ord_ccid") ;
				if ((obj1.length>0)) obj1.val(ccid1).attr("modified","0") ;
		  	try { pobj001.ccid = ccid1 ; } catch(E) {} finally {} ;	
				try { pobj001.loadlxr(true) ; } catch(E) {} finally {} ;
			  try { pobj001.loadcustfees() ; } catch(E) {} finally {} ;	
		  } ;
		  pobj001.$(obj).change() ;
		} ;
		_tonextinput(pobj001,obj) ;
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	},_tohex(key1),tagctg12,'',
	function()
	{
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	}) ;
};
function _slt1biz3(pobj001,obj,key1,crmid1,setfordid1)
{
	pobj001.slt1biz2arr(
	function(ordid1,ordcrmid1,ordcode1,ordtitle1,ordtype1,ccflds1,ccfldvs1)
	{
		var istdcell = obj.id == "my_cell_edit" ;
		pobj001.$(obj).addClass("checked") ;
		if (istdcell) 
		{
			var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
			if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
			var tdname1 = pobj001.$(obj).attr("tdname") ;
			var tdobj12 = null ;
			
	  	// 不是ord2表，是其它table ,但也是通过这种方法来的
	  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  	if (tdobj12.length>0)
	  	{
	  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
	  		if (comefrom1=="") 
	  		{
	  			if (tdname1=="title")
	  			  tdobj12.attr("comefrom","ord_title") ;
	  			else   tdobj12.attr("comefrom","ord_no") ;
	  		} ;
	  		var i12 = 0 ; 
			  for (i12 = 0 ; i12 < ccflds1.length ; i12 ++)
			  {
				  tdobj12 = pobj001.$("td[comefrom="+ccflds1[i12]+"]",trobj12) ;
			    if (tdobj12.length>0) tdobj12.html(ccfldvs1[i12]).attr("value",_tohex(ccfldvs1[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			  } ;
	  	} ;
	  	try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		} else 
		{
			if (setfordid1)
			{
				for (var i=0 ; i<ccflds1.length ;i++)
				try {if (ccflds1[i]=="ord_id") pobj001.srcordid = ccfldvs1[i] ;} catch (e) { } finally { } ;
			} ;
			var comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
			if (comefrom1=="")
			{
				if (obj.id=="ord_title") pobj001.$(obj).attr("comefrom","ord_title") ;
				else pobj001.$(obj).attr("comefrom","ord_no") ;
			} ;
			
			for (var i=0 ; i<ccflds1.length ;i++)
			{
				  _$value(pobj001,pobj001.$("*[comefrom="+ccflds1[i]+"]"), ccfldvs1[i],"0");
		  } ;
		  pobj001.$(obj).change() ;
	    try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		} ;
		_tonextinput(pobj001,obj) ;
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	},_tohex(key1),crmid1,'',
	function()
	{
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	}) ;
};
function _slt1emp3(pobj001,obj,key1)
{
	pobj001.slt1emp2arr(
	function(cuid1,cuuserid1,cucode1,cuname1,cuflds1,cufldvs1)
	{
		var istdcell = obj.id == "my_cell_edit" ;
		pobj001.$(obj).addClass("checked") ;
		if (istdcell) 
		{
			var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
			if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
			var tdname1 = pobj001.$(obj).attr("tdname") ;
			var tdobj12 = null ;
			if ((tdname1=="cucode") || (tdname1=="cuname")) 
			{
				tdobj12 = pobj001.$("td[name=cucode]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(cucode1).attr("value",_tohex(cucode1)) ;
				tdobj12 = pobj001.$("td[name=cuname]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(cuname1).attr("value",_tohex(cuname1)) ;
				
				// 对其它字段进行写值
				var i12 = 0 ; 
				for (i12 = 0 ; i12 < cuflds1.length ; i12 ++)
				{
					tdobj12 = pobj001.$("td[comefrom="+cuflds1[i12]+"]",trobj12) ;
				  if (tdobj12.length==1) tdobj12.html(cufldvs1[i12]).attr("value",_tohex(cufldvs1[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				} ;
				try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
				_runsql("up_ord2_cuid","ord2id="+trobj12.attr("value")+"&cuid="+cuid1+
				"&code="+_tohex(cucode1)+
				"&name="+_tohex(cuname1)) ;
		  } else
		  {
		  	// 不是ord2表，是其它table ,但也是通过这种方法来的
		  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
		  	if (tdobj12.length>0)
		  	{
		  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
		  		if (comefrom1=="") tdobj12.attr("comefrom","cu_callname") ;
		  		var i12 = 0 ; 
				  for (i12 = 0 ; i12 < cuflds1.length ; i12 ++)
				  {
					  tdobj12 = pobj001.$("td[comefrom="+cuflds1[i12]+"]",trobj12) ;
				    if (tdobj12.length>0) tdobj12.html(cufldvs1[i12]).attr("value",_tohex(cufldvs1[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				  } ;
				  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		  	} ;
		  	
		  } ; 
			
		} else 
		{
			var isordcc = ((obj.id=="ord_cucode") || (obj.id=="ord_oaname")) ;
			var comefrom1 = "" ;
			if (isordcc) 
			{
				comefrom1 = _isnull(pobj001.$("#ord_cucode").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_cucode").attr("comefrom","cu_usercode") ;
				comefrom1 = _isnull(pobj001.$("#ord_oaname").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_oaname").attr("comefrom","cu_callname") ;
			} else 
			{
				comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$(obj).attr("comefrom","cu_callname") ;
			} ;
			
			for (var i=0 ; i<cuflds1.length ;i++)
				_$value(pobj001,pobj001.$("#"+cuflds1[i]+",*[comefrom="+cuflds1[i]+"]"), cufldvs1[i],"0");
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			if (isordcc) 
		  {
		  	var obj1 = pobj001.$("#ord_cuid") ;
				if ((obj1.length>0)) obj1.val(cuid1).attr("modified","0") ;
		  } ;
		  pobj001.$(obj).change() ;
		} ;
		_tonextinput(pobj001,obj) ;
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	},_tohex(key1),
	function()
	{
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	}) ;
};

function _slt1equ3(pobj001,obj,key1,tagctg12)
{
	pobj001.sltequ2arr(
	function(equid1,equtitle1,equcode1,ccflds1,ccfldvs1)
	{
		var istdcell = obj.id == "my_cell_edit" ;
		pobj001.$(obj).addClass("checked") ;
		if (istdcell) 
		{
			var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
			if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
			var tdname1 = pobj001.$(obj).attr("tdname") ;
			var tdobj12 = null ;
			if ((tdname1=="equcode") || (tdname1=="equtitle")) 
			{
				tdobj12 = pobj001.$("td[name=equcode]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(equcode1).attr("value",_tohex(equcode1)) ;
				tdobj12 = pobj001.$("td[name=equtitle]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(equtitle1).attr("value",_tohex(equtitle1)) ;
				
				// 对其它字段进行写值
				var i12 = 0 ; 
				for (i12 = 0 ; i12 < ccflds1.length ; i12 ++)
				{
					tdobj12 = pobj001.$("td[comefrom="+ccflds1[i12]+"]",trobj12) ;
				  if (tdobj12.length==1) tdobj12.html(ccfldvs1[i12]).attr("value",_tohex(ccfldvs1[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				} ;
				try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
				_runsql("up_ord2_equid","ord2id="+trobj12.attr("value")+"&equid="+equid1+
				"&code="+_tohex(equcode1)+
				"&name="+_tohex(equtitle1)) ;
		  } else
		  {
		  	// 不是ord2表，是其它table ,但也是通过这种方法来的
		  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
		  	if (tdobj12.length>0)
		  	{
		  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
		  		if (comefrom1=="") tdobj12.attr("comefrom","equ_title") ;
		  		var i12 = 0 ; 
				  for (i12 = 0 ; i12 < ccflds1.length ; i12 ++)
				  {
					  tdobj12 = pobj001.$("td[comefrom="+ccflds1[i12]+"]",trobj12) ;
				    if (tdobj12.length>0) tdobj12.html(ccfldvs1[i12]).attr("value",_tohex(ccfldvs1[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				  } ;
				  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		  	} ;
		  } ; 
		} else 
		{
			var isordcc = ((obj.id=="ord_equcode") || (obj.id=="ord_equtitle")) ;
			var comefrom1 = "" ;
			if (isordcc) 
			{
				comefrom1 = _isnull(pobj001.$("#ord_equcode").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_equcode").attr("comefrom","equ_code") ;
				comefrom1 = _isnull(pobj001.$("#ord_equtitle").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_equtitle").attr("comefrom","equ_title") ;
			} else 
			{
				comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$(obj).attr("comefrom","equ_title") ;
			} ;
			
			for (var i=0 ; i<ccflds1.length ;i++)
				_$value(pobj001,pobj001.$("#"+ccflds1[i]+",*[comefrom="+ccflds1[i]+"]"), ccfldvs1[i],"0");
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			var obj1 = pobj001.$("#ord_equid") ;
			if (obj1.length>0) 
		  {
				obj1.val(equid1).attr("modified","0") ;
		  	try { pobj001.ordequid = equid1 ; } catch(E) {} finally {} ;	
				try { pobj001.ordequtitle = equtitle1 ; } catch(E) {} finally {} ;	
		  } ;
		  pobj001.$(obj).change() ;
		} ;
		_tonextinput(pobj001,obj) ;
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	},_tohex(key1),tagctg12,'',
	function()
	{
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	}) ;
};

function _slt1feetype3(pobj001,obj,ctg1,ctg2)
{
	pobj001.slt1feetype(
	function(slti1,ids1,ftitles1,fcodes1,fctgs12,flags1)
	{
		var istdcell = obj.id == "my_cell_edit" ;
		pobj001.$(obj).addClass("checked") ;
		autochkwinopen = false ;
		
		if (istdcell) 
		{
			var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
			if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
			var tdname1 = pobj001.$(obj).attr("tdname") ;
			var tdobj12 = null ;
			if ((tdname1=="ccbicode") || (tdname1=="ccbiname")) 
			{
				tdobj12 = pobj001.$("td[name=ccbicode]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(fcodes1[0]).attr("value",_tohex(fcodes1[0])) ;
				tdobj12 = pobj001.$("td[name=ccbiname]",trobj12) ;
				if (tdobj12.length==1) tdobj12.html(ftitles1[0]).attr("value",_tohex(ftitles1[0])) ;
		
				try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
				_runsql("up_ord2_ccbiid","ord2id="+trobj12.attr("value")+"&ccbiid="+ids1[0]+
				"&code="+_tohex(fcodes1[0])+
				"&name="+_tohex(ftitles1[0])) ;
		  } else
		  {
		  	// 不是ord2表，是其它table ,但也是通过这种方法来的
		  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
		  	if (tdobj12.length>0)
		  	{
		  		var comefrom1 = _isnull(tdobj12.attr("comefrom"),"") ;
		  		if (comefrom1=="") tdobj12.attr("comefrom","ccbi_title") ;
		  		tdobj12 = pobj001.$("td[comefrom=ccbi_title]",trobj12) ;
				  if (tdobj12.length>0) tdobj12.html(ftitles1[0]).attr("value",_tohex(ftitles1[0])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				  tdobj12 = pobj001.$("td[comefrom=ccbi_code]",trobj12) ;
				  if (tdobj12.length>0) tdobj12.html(fcodes1[0]).attr("value",_tohex(fcodes1[0])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				  try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		  	} ;
		  } ; 
		} else 
		{
			var isordcc = false ;
			var comefrom1 = "" ;
			var obj1 = null ;
			for (var ilk=1;ilk<=5;ilk++)
			{
				isordcc = ((obj.id=="ord_ccbicode"+ilk) || (obj.id=="ord_ccbititle"+ilk)) ;
				if (obj.id=="ord_ccbicode"+ilk) 
				{
					comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
					if (comefrom1=="") pobj001.$(obj).attr("comefrom","ccbi_code") ;
					comefrom1 = _isnull(pobj001.$("#ord_ccbititle"+ilk).attr("comefrom"),"") ;
					if (comefrom1=="") pobj001.$("#ord_ccbititle"+ilk).attr("comefrom","ccbi_title") ;
				} else 
				if (obj.id=="ord_ccbititle"+ilk) 
				{
					comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
					if (comefrom1=="") pobj001.$(obj).attr("comefrom","ccbi_title") ;
					comefrom1 = _isnull(pobj001.$("#ord_ccbicode"+ilk).attr("comefrom"),"") ;
					if (comefrom1=="") pobj001.$("#ord_ccbicode"+ilk).attr("comefrom","ccbi_code") ;
				} else 
				{
					comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
					if (comefrom1=="") pobj001.$(obj).attr("comefrom","ccbi_title") ;
				} ;
				
				_$value(pobj001,pobj001.$("#ord_ccbititle"+ilk+",*[comefrom=ccbi_title]"), ftitles1[0],"0");
				_$value(pobj001,pobj001.$("#ord_ccbicode"+ilk+",*[comefrom=ccbi_code]"), fcodes1[0],"0");
				
				obj1 = pobj001.$("#ord_ccbiid"+ilk) ;
				if ((obj1.length>0)) obj1.val(ids1[0]).attr("modified","0") ;
				
				if ((isordcc) && (ilk==1)) 
				{
					try { pobj001.ordccbiid1 = ids1[0] ; } catch(E) {} finally {} ;	
					try { pobj001.ordccbititle1 = ftitles1[0] ; } catch(E) {} finally {} ;	
				} ;	
				if ((isordcc) && (ilk==2)) 
				{
					try { pobj001.ordccbiid2 = ids1[0] ; } catch(E) {} finally {} ;	
					try { pobj001.ordccbititle2 = ftitles1[0] ; } catch(E) {} finally {} ;	
				} ;	
				if ((isordcc) && (ilk==3))
				{
					try { pobj001.ordccbiid3 = ids1[0] ; } catch(E) {} finally {} ;	
					try { pobj001.ordccbititle3 = ftitles1[0] ; } catch(E) {} finally {} ;	
				} ;	
				if ((isordcc) && (ilk==4)) 
				{
					try { pobj001.ordccbiid4 = ids1[0] ; } catch(E) {} finally {} ;	
					try { pobj001.ordccbititle4 = ftitles1[0] ; } catch(E) {} finally {} ;	
				} ;	
				if ((isordcc) && (ilk==5)) 
				{
					try { pobj001.ordccbiid5 = ids1[0] ; } catch(E) {} finally {} ;	
					try { pobj001.ordccbititle5 = ftitles1[0] ; } catch(E) {} finally {} ;	
				} ;	
			} ;	
			pobj001.$(obj).change() ;
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		} ;
		_tonextinput(pobj001,obj) ;
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	},ctg1,ctg2,
	function()
	{
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	}) ;
};

function _slt1prd3(pobj001,obj,key1,tagctg12)
{
	var key2 = _tohex(_isnull(key1,"")) ;
	pobj001.slt1prd2arr(
	function(prdtype1,prdid1,prdname1,prdcode1,prdflds1,prdfldvals1)
	{
		var istdcell = obj.id == "my_cell_edit" ;
		pobj001.$(obj).addClass("checked") ;
		if (istdcell) 
		{
			var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
			if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
			var tdname1 = pobj001.$(obj).attr("tdname") ;
			var tdobj12 = null ;
			var fldsource1 = "" ;
			
			if ((tdname1=="code") || (tdname1=="title")) 
			{
				var setstr1 = "ord2_prdid="+prdid1 ;
				var fld1s1 = ['code','title','model','pack','spec','brand','unit','price','expdays',
											'price0','price01','price1','price11','price2','price3',
											'prp01','prp02','prp03','prp04','prp05','prp06','prp07','prp08','prp09','prp10',
											'num01','num02','num03'] ;
				var jk1 = 0 ;
				
				for (var ij1=0 ; ij1<fld1s1.length ; ij1++) 
				{
				  tdobj12 = pobj001.$("td[name="+fld1s1[ij1]+"]",trobj12) ;
				  if (tdobj12.length==1)
				  {
				    fldsource1 = _isnull(tdobj12.attr("comefrom"),"") ;
				    if (fldsource1=="") tdobj12.attr("comefrom","prd_"+fld1s1[ij1]) ;
				  } ;
				} ;
				
				for (var ij1=0 ; ij1<prdflds1.length ; ij1++) 
				{
					tdobj12 = pobj001.$("td[comefrom="+prdflds1[ij1]+"]",trobj12) ;
					if (tdobj12.length==1)
					{
						tdname1 = tdobj12.attr("name") ;
						jk1 = fld1s1.indexOf(tdname1) ;
						tdobj12.html(_isnull(prdfldvals1[ij1],"&nbsp;")).attr("value",_tohex(prdfldvals1[ij1])) ;
						if (jk1>=0) 
						  setstr1 += ",ord2_"+tdname1+"='"+prdfldvals1[ij1]+"'" ;
						else
							tdobj12.addClass("tbupdatedtr").attr("ident",____ident()) ;
					} ;
				} ;
				try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
				_runsql("up_ord2_prdinfo",{ord2id:trobj12.attr("value"),setval:setstr1}) ;
		  } else
		  {
		  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
		  	if (tdobj12.length>0)
		  	{
		  		fldsource1 = _isnull(tdobj12.attr("comefrom"),"") ;
				  if (fldsource1=="") tdobj12.attr("comefrom","prd_title") ;
		    } ;
		    for (var ij1=0 ; ij1<prdflds1.length ; ij1++) 
				{
					tdobj12 = pobj001.$("td[comefrom="+prdflds1[ij1]+"]",trobj12) ;
					if (tdobj12.length==1)
						tdobj12.html(_isnull(prdfldvals1[ij1],"&nbsp;")).attr("value",_tohex(prdfldvals1[ij1])).addClass("tbupdatedtr").attr("ident",____ident()) ;
				} ;
				try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
		  } ; 
		} else 
		{
			var isordcc = ((obj.id=="ord_prdcode") || (obj.id=="ord_prdtitle")) ;
			var comefrom1 = "" ;
			if (isordcc) 
			{
				comefrom1 = _isnull(pobj001.$("#ord_prdcode").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_prdcode").attr("comefrom","prd_code") ;
				comefrom1 = _isnull(pobj001.$("#ord_prdtitle").attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$("#ord_prdtitle").attr("comefrom","prd_title") ;
			} else 
			{
				comefrom1 = _isnull(pobj001.$(obj).attr("comefrom"),"") ;
				if (comefrom1=="") pobj001.$(obj).attr("comefrom","prd_title") ;
			} ;
			
			for (var i=0 ; i<prdflds1.length ;i++)
				_$value(pobj001,pobj001.$("#"+prdflds1[i]+",*[comefrom="+prdflds1[i]+"]"), prdfldvals1[i],"0");
			
			try { pobj001.needautoframeheight() ;} catch (e) { } finally { } ;
			
			var obj1 = pobj001.$("#ord_prdid") ;
			if (obj1.length>0) 
		  {
				obj1.val(prdid1).attr("modified","0") ;
		  	try { pobj001.ordprdid = prdid1 ; } catch(E) {} finally {} ;	
				try { pobj001.ordprdtitle = prdname1 ; } catch(E) {} finally {} ;	
		  } ;
		  pobj001.$(obj).change() ;
		} ;
		_tonextinput(pobj001,obj) ;
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	},key2,tagctg12,null,'',
	function()
	{
		autochkwinopen = false ;
		pobj001.$(obj).removeClass("checked") ;
	}) ;
};

function _tonextinput(pobj001,obj1)
{
	var nexto1 = pobj001.$("input:text:visible:enabled,select:visible:enabled,textarea:visible:enabled") ;
	var nexto2 = null ;
	for (var i=0 ; i<nexto1.length-1 ; i++)
	{
		if (nexto1[i].id==obj1.id)
		{
			nexto2 = nexto1[i+1] ;
			break ;
		} ;
	} ;
	if (nexto2==null) return false;
	try {pobj001.$(nexto2).click() ;} catch(E){} finally {};
	try {nexto2.focus() ;} catch(E){} finally {};
	try {pobj001.selectall(nexto2) ;} catch(E){} finally {};
	try {pobj001.v18 = nexto2;pobj001.f22() ;} catch(E){} finally {} ;
};

function _setemplyeevalues(pobj001,obj) 
{
	var istdcell = (obj.id == "my_cell_edit") ;
	if (istdcell) 
	{
		var trobj12 = pobj001.$("#ord2id_"+pobj001.$(obj).attr("ord2id")) ;
		if (trobj12.length<=0) trobj12 = pobj001.$(obj).parents("tr:first") ;
		var tdname1 = pobj001.$(obj).attr("tdname") ;
		var tdobj12 = null ;
		
		if ((tdname1=="cucode") || (tdname1=="cuname")) 
		{
			tdobj12 = pobj001.$("td[name=cucode]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._cu_usercode]).attr("value",_tohex(pobj001.$f[pobj001._cu_usercode])) ;
			tdobj12 = pobj001.$("td[name=cuname]",trobj12) ;
			if (tdobj12.length==1) tdobj12.html(pobj001.$f[pobj001._cu_callname]).attr("value",_tohex(pobj001.$f[pobj001._cu_callname])) ;
			
			// 对其它字段进行写值
			var i12 = 0 ; 
			for (i12 = 0 ; i12 < pobj001.$flds.length ; i12 ++)
			{
				tdobj12 = pobj001.$("td[comefrom="+pobj001.$flds[i12]+"]",trobj12) ;
			  if (tdobj12.length==1) tdobj12.html(pobj001.$f[i12]).attr("value",_tohex(pobj001.$f[i12])).addClass("tbupdatedtr").attr("ident",____ident()) ;
			} ;
			
			_runsql("up_ord2_cuid","ord2id="+trobj12.attr("value")+"&cuid="+pobj001.$f[pobj001._cu_id]+
			"&code="+_tohex(pobj001.$f[pobj001._cu_usercode])+
			"&name="+_tohex(pobj001.$f[pobj001._cu_callname])) ;
	  } else
	  {
	  	tdobj12 = pobj001.$("td[name="+tdname1+"]",trobj12) ;
	  	if (tdobj12.length>0)
	  	tdobj12.html(pobj001.$f[pobj001._cu_callname])
	  	.attr("value",_tohex(pobj001.$f[pobj001._cu_callname])) ;
	  } ; 
	} else 
	{
		if ((obj.id!="ord_cucode") && (obj.id!="ord_oaname")) 
		{
		  pobj001.$(obj).val(pobj001.$f[pobj001._cu_callname]).attr("modified","0") ;
    } else
    {
			var obj1 = pobj001.$("#ord_oaname") ;
			if (obj1.length>0) _$value(pobj001,obj1,pobj001.$f[pobj001._cu_callname],"0");
			obj1 = pobj001.$("#ord_cuid") ;
			if ((obj1.length>0)) obj1.val(pobj001.$f[pobj001._cu_id]).attr("modified","0") ;
			obj1 = pobj001.$("#ord_cucode") ;
			if (obj1.length>0) _$value(pobj001,obj1,pobj001.$f[pobj001._cu_usercode],"0");
			for (var i=0 ; i<pobj001.$flds.length ;i++)
				_$value(pobj001,pobj001.$("#"+pobj001.$flds[i]+",input[comefrom="+pobj001.$flds[i]+"]"), pobj001.$f[i],"0");
		} ;		
	} ;
};

function _isemployee(pobj001,obj)
{
	var s1 = _isnull(pobj001.$(obj).val(),"");//.trim() ;
	if ((pobj001.document.activeElement!=obj) && (obj.id!="my_cell_edit")) return true ;
	if (autochkwinopen) return ;
	autochkwinopen = true ;
	var notfound = false ;
	
	if (_autocompletedblclick)
	{
		_slt1emp3(pobj001,obj,"") ;
		return true ;
	} ;
	if (s1.length>=3) 
	{
		_runsql4xml(pobj001,"g_employee_bykey","key="+_tohex(s1),
		function(iseof,data1,dsname1)
		{
			if (!iseof)
			{
				if (pobj001.$f[pobj001._cu_id]!=0) 
				{
					_setemplyeevalues(pobj001,obj,pobj001.$f) ;
					pobj001.$(obj).addClass("checked") ;
				} else 
				{
					notfound = true ;
					pobj001.$(obj).removeClass("checked") ;
				} ;
			} else 
			if (!dsname1) 
			{
				if (s1.length>4) s1 = s1.substr(0,4) ;
				if (notfound) _slt1emp3(pobj001,obj,s1) ; else autochkwinopen = false ;
			} ;
		});
	} else 
	{
		_slt1emp3(pobj001,obj,s1) ;
	} ;
	return true ;
};


function _formulatime(time1,fullformat1)
{
	var sDate = time1 ;
	sDate = "_"+sDate ;
	sDate = sDate.trim().toLowerCase() ; 
	
	var add12 = 0 ;
	
	sDate = sDate.replaceAll("　","") ; 
	sDate = sDate.replaceAll(" ","") ; 
	sDate = sDate.replaceAll("点钟",":") ; 
	sDate = sDate.replaceAll("分钟",":") ; 
	sDate = sDate.replaceAll("小时",":") ; 
	sDate = sDate.replaceAll("时",":") ; 
	sDate = sDate.replaceAll("秒",":") ; 
	sDate = sDate.replaceAll("：",":") ; 
	sDate = sDate.replaceAll("：",":") ; 
	sDate = sDate.replaceAll("：",":") ; 
	sDate = sDate.replace("-",":") ; 
	sDate = sDate.replace("-",":") ; 
	sDate = sDate.replace("-",":") ; 
	sDate = sDate.replaceAll("。",";") ; 
	sDate = sDate.replace(".",":") ; 
	sDate = sDate.replace(".",":") ; 
	sDate = sDate.replace(".",":") ; 
	sDate = sDate.replace("/",":") ; 
	sDate = sDate.replace("/",":") ; 
	sDate = sDate.replace("/",":") ; 
	sDate = sDate.replace("\\",":") ; 
	sDate = sDate.replace("\\",":") ; 
	sDate = sDate.replace("\\",":") ; 
	sDate = sDate.replaceAll("－",":") ; 
	sDate = sDate.replaceAll("０","0") ; 
	sDate = sDate.replaceAll("１","1") ; 
	sDate = sDate.replaceAll("２","2") ; 
	sDate = sDate.replaceAll("３","3") ; 
	sDate = sDate.replaceAll("４","4") ; 
	sDate = sDate.replaceAll("５","5") ; 
	sDate = sDate.replaceAll("６","6") ; 
	sDate = sDate.replaceAll("７","7") ; 
	sDate = sDate.replaceAll("８","8") ; 
	sDate = sDate.replaceAll("９","9") ; 
	
	sDate = sDate.replaceAll("am","") ; // ante meridiem 
	sDate = sDate.replaceAll("上午","") ; 
	sDate = sDate.replaceAll("上","") ; 
	sDate = sDate.replaceAll("a","") ; // ante meridiem 
	
	sDate = sDate.replaceAll("sw","") ; // ante meridiem 
	sDate = sDate.replaceAll("s","") ; 
	
	sDate = sDate.replaceAll("xw","pm") ; // ante meridiem 
	sDate = sDate.replaceAll("x","pm") ; 
	sDate = sDate.replaceAll("下午","pm") ; 
	sDate = sDate.replaceAll("下","pm") ; 
	sDate = sDate.replaceAll("pm","p") ;
	
	var i = sDate.indexOf("p") ;// post meridiem 
	if (i>=0) add12 = 12 ;
	sDate = sDate.replaceAll("p","") ; // post meridiem 
	
	sDate = sDate.substr(1) ;
	 
  var iaDate = new Array(3) ;
  
  var now = new Date();
  if (iaDate.length>8) iaDate = iaDate.substr(0,8) ;
  iaDate = sDate.toString().split(":") ;
  iaDate[0]=_myparseInt(iaDate[0],now.getHours()) ; 
  iaDate[1]=_myparseInt(iaDate[1],0) ;
  iaDate[2]=_myparseInt(iaDate[2],0) ;
  if (add12==12) iaDate[0] = iaDate[0] + 12 ;
  if (iaDate[0]<0) iaDate[0] = now.getHours() ;
  if (iaDate[0]>23) iaDate[0] = 23 ;
  if (iaDate[1]<0) iaDate[1] = now.getMinutes() ;
  if (iaDate[1]>59) iaDate[1] = 59 ;
  if (iaDate[2]<0) iaDate[2] = now.getSeconds() ;
  if (iaDate[2]>59) iaDate[2] = 59 ;
  if (fullformat1) return iaDate[0]+":"+iaDate[1]+":"+iaDate[2] ; else 
  {
	  if (iaDate[2]==0) 
	    return  iaDate[0]+":"+iaDate[1] ;
	  else  return iaDate[0]+":"+iaDate[1]+":"+iaDate[2] ; 
	} ;  	
}
function _addsourceitem(pobj3,obj1,itemtxt1,itemval1)
{
	if (!obj1) return ;
	var src211 = _isnull(pobj3.$(obj1).attr("source"),"") ;
	var s12 = itemtxt1+"="+_isnull(itemval1,itemtxt1) ;
	if (src211!="") src211 += "|" ;
	src211 +=  s12 ;
	pobj3.$(obj1).attr("source",src211) ;
};
function _addsourceitems(pobj3,obj1,itemtxtval1)
{
	if (!obj1) return ;
	var src211 = _isnull(pobj3.$(obj1).attr("source"),"") ;
	if (src211!="") src211 += "|" ;
	src211 +=  itemtxtval1 ;
	pobj3.$(obj1).attr("source",src211) ;
};
function _isexclusivity(obj)
{
	var val12 = $(obj).val(); 
	var src1s = _isnull($(obj).attr("source"),""); 
	var ii1 = 0 ;
	var ss1 = "" ;
	var srcvals = []  ;
	while (src1s!="") 
	{
		ii1 = src1s.indexOf("|") ;
		if (ii1>=0) 
		{
			ss1 = src1s.substr(0,ii1) ;
			src1s = src1s.substr(ii1+1) ;
		} else 
		{
			ss1 = src1s ;
			src1s = "" ;
		} ;
		ss1 = ss1.trim() ;
		ii1 = ss1.indexOf("=") ;
		if (ii1>0) 
		{
			ss1 = ss1.substr(ii1+1) ;
		} ;
		if (ss1!="") srcvals.push(ss1) ;
	};
	ii1 = srcvals.indexOf(val12) ;
	if (ii1<0) 
	{
		ss1="" ;
		for (var i=0; i < srcvals.length ; i++) 
		{
			if (srcvals[i].indexOf(val12)==0) 
			{
				ss1 = srcvals[i] ;
				break ;
			} ;
		} ;
		if (ss1=="") 
		{
			for (var i=0; i < srcvals.length ; i++) 
			{
				if (srcvals[i].indexOf(val12)>0) 
				{
					ss1 = srcvals[i] ;
					break ;
				} ;
			} ;
		} ;
		$(obj).val(ss1); 
		return ss1!="" ;
	} else
	{
		return true ;
	} ;
}
function _isdatetime(obj)
{
	var s1 = "" ;
	var s2 = "" ;
	s1 = obj.value.trim() ;
	var i = s1.indexOf(" ") ;
	if (i>0) 
	{
		s2 = s1.substr(i+1) ;
		s1 = s1.substr(0,i) ;
		obj.value = s1 ;
		_isdate(obj) ;
		s1 = obj.value ;
		s2 = _formulatime(s2,false) ;
		obj.value = s1+" "+s2 ;
		return true ;
	} else 
	{
		if ((s1.indexOf(":")>=0) || (s1.indexOf("h")>=0) || (s1.indexOf("点")>=0) ||  
		      (s1.indexOf("时")>=0) || (s1.indexOf("分")>=0)
		    || (s1.indexOf("秒")>=0))
		{
			s2 =  _formulatime(s1,false) ;
			obj.value = "" ;
			_isdate(obj) ;
		  s1 = obj.value ;
		  obj.value = s1+" "+s2 ;
		  return true ;
		} else 
		{    
		  return _isdate(obj) ;
		} ;
	} ;
}
function _istime(obj)
{
	obj.value = _formulatime(obj.value,false) ;
  return true ;
}
function _isdate(obj)
{
	var sDate = obj.value ;
	var sTime = "" ;
	sDate = "_"+sDate ;
	sDate = sDate.trim().toLowerCase() ; 
			  
	sDate = sDate.replaceAll("　"," ") ; 
	sDate = sDate.replaceAll("  "," ") ; 
	sDate = sDate.replaceAll("  "," ") ;
	sDate = sDate.replaceAll("  "," ") ;
	var i = 0 ;
	i = sDate.indexOf(" ") ;
	if (i==0) 
	{ 
		sDate = sDate.substr(1) ;
	  i = sDate.indexOf(" ") ;
	  if (i==0) sDate = sDate.substr(1) ;
	} ;  
	i = sDate.indexOf(" ") ;
	if (i<0) i = sDate.indexOf("号") ;
	if (i<0) i = sDate.indexOf("日") ;
	if (i<0) i = sDate.indexOf(",") ;
	if (i<0) i = sDate.indexOf("，") ;
	if (i<0) i = sDate.indexOf("t") ;
	if (i<0) i = sDate.indexOf("T") ;
	if (i>=0)
	{
		sTime = sDate.substr(i+1) ;
		sDate = sDate.substr(0,i) ;
	} else
	{
		sTime = "" ;
		i = sDate.indexOf(":") ;
		if (i<0) i = sDate.indexOf("：") ;
		if (i<0) i = sDate.indexOf("点") ;
		if (i<0) i = sDate.indexOf("时") ;
		if (i<0) i = sDate.indexOf("分") ;
		if (i<0) i = sDate.indexOf("秒") ;
		if (i<0) i = sDate.indexOf("a") ;
		if (i<0) i = sDate.indexOf("x") ;
		if (i<0) i = sDate.indexOf("上") ;
		if (i<0) i = sDate.indexOf("下") ;
		if (i>=0) { sTime = sDate.substr(1) ; sDate = "" ;} ;
	} ;
	sDate = sDate.replaceAll("号","") ; 
	sDate = sDate.replaceAll("日","") ; 
	sDate = sDate.replaceAll("月","-") ; 
	sDate = sDate.replaceAll("年","-") ; 
	sDate = sDate.replaceAll("。","-") ; 
	sDate = sDate.replace(".","-") ; 
	sDate = sDate.replace(".","-") ; 
	sDate = sDate.replace(".","-") ; 
	sDate = sDate.replaceAll("，","-") ; 
	sDate = sDate.replace("/","-") ; 
	sDate = sDate.replace("\\","-") ; 
	sDate = sDate.replace("\\","-") ; 
	sDate = sDate.replace("\\","-") ; 
	sDate = sDate.replace("/","-") ; 
	sDate = sDate.replace("/","-") ; 
	sDate = sDate.replaceAll("／","-") ; 
	sDate = sDate.replaceAll("－","-") ; 
	sDate = sDate.replaceAll("０","0") ; 
	sDate = sDate.replaceAll("１","1") ; 
	sDate = sDate.replaceAll("２","2") ; 
	sDate = sDate.replaceAll("３","3") ; 
	sDate = sDate.replaceAll("４","4") ; 
	sDate = sDate.replaceAll("５","5") ; 
	sDate = sDate.replaceAll("６","6") ; 
	sDate = sDate.replaceAll("７","7") ; 
	sDate = sDate.replaceAll("８","8") ; 
	sDate = sDate.replaceAll("９","9") ; 
	sDate = sDate.substr(1) ;
	 
  var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31]
  var iaDate = new Array(3)
  var year, month, day ;
  var year1, month1, day1 ;
  
  var now = new Date();
  year1 = now.getYear() ;
  month1 = now.getMonth() + 1 ;
  day1 =  now.getDate() ;
  
  if (arguments.length != 1) return false ;
  iaDate = sDate.toString().split("-") ;
  
  if (iaDate.length==0) 
  {
  	iaDate[0] = year1 ;
  	iaDate[1] = month1 ;
  	iaDate[2] = day1 ;
  } ;
  if (iaDate.length==1) 
  {
  	iaDate[2] = iaDate[0] ;
  	iaDate[0] = year1 ;
  	iaDate[1] = month1 ;
  } else 
  if (iaDate.length==2) 
  {
  	iaDate[2] = iaDate[1] ;
  	iaDate[1] = iaDate[0] ;
  	iaDate[0] = year1 ;
  } ; 	
  

  year = _myparseInt(iaDate[0],year1) ;
  month = _myparseInt(iaDate[1],month1) ;
  day=_myparseInt(iaDate[2],day1) ;
  
  if (year<100) year += 2000 ;
  
  if (year < 1900 || year > 2500) year = year1 ;
  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
  if (month < 1 || month > 12) month = month1 ;
  if (day < 1 || day > iaMonthDays[month - 1]) day = day1 ;
  var fmt1 = _isnull($(obj).attr("fmt"),"") ;
  if (fmt1.indexOf("h")<0) 
    obj.value = year+"-"+month+"-"+day;
  else   obj.value = year+"-"+month+"-"+day+" "+_formulatime(sTime,true) ;
  return true ;
}

function _parseexp(str1) 
{
	 var str11 = "_"+str1 ;
   str11 = str11.replaceAll("１","1") ;
   str11 = str11.replaceAll("２","2") ;
   str11 = str11.replaceAll("３","3") ;
   str11 = str11.replaceAll("４","4") ;
   str11 = str11.replaceAll("５","5") ;
   str11 = str11.replaceAll("６","6") ;
   str11 = str11.replaceAll("７","7") ;
   str11 = str11.replaceAll("８","8") ;
   str11 = str11.replaceAll("９","9") ;
   str11 = str11.replaceAll("０","0") ;
   str11 = str11.replaceAll("，","") ;
   str11 = str11.replaceAll("；","") ;
   str11 = str11.replaceAll("＋","+") ;
   str11 = str11.replaceAll("（","(") ;
   str11 = str11.replaceAll("）",")") ;
   str11 = str11.replaceAll("－","-") ;
   str11 = str11.replaceAll("＊","*") ;
   str11 = str11.replaceAll("％","%") ;
   str11 = str11.replaceAll("%","/100.00") ;
   str11 = str11.replaceAll("／","/") ;
   str11 = str11.replaceAll(",","") ;
   str11 = str11.replaceAll(";","") ;
   str11 = str11.replaceAll("。",".") ;
   str11 = str11.replaceAll(" ","") ;
   str11 = str11.replaceAll("　","") ;
   
   var i11 = -1 ;
   i11 = str11.indexOf("(") ;
   if (i11<0) i11 = str11.indexOf("+") ;
   if (i11<0) i11 = str11.indexOf("-") ;
   if (i11<0) i11 = str11.indexOf("*") ;
   if (i11<0) i11 = str11.indexOf("/") ;
   str11 = str11.substr(1) ;
   
   if (i11>=0) 
   {
   	 var strv1 = "0" ;
   	 try {eval("strv1="+str11) ;} catch (E) { } finally { } ;
   	 str11 = strv1 ; 
   } ;
   return str11 ;
};
function _isintg0(obj)
{
	_isint(obj) ;
	var sv1 = "" ;
	if (obj.tagName=="TD") sv1 = _gettdvalue($(obj)) ; else sv1 = $(obj).val() ;
	if (_myparseInt(sv1,0)<=0) return false ; else return true ;
};
function _isintl0(obj)
{
	_isint(obj) ;
	var sv1 = "" ;
	if (obj.tagName=="TD") sv1 = _gettdvalue($(obj)) ; else sv1 = $(obj).val() ;
	if (_myparseInt(sv1,0)>=0) return false ; else return true ;
};
function _isintne0(obj)
{
	_isint(obj) ;
	var sv1 = "" ;
	if (obj.tagName=="TD") sv1 = _gettdvalue($(obj)) ; else sv1 = $(obj).val() ;
	if (_myparseInt(sv1,0)==0) return false ; else return true ;
};
function _isint(obj)
{
   var str11 = "" ;
	 if (obj.tagName=="TD") str11 = _gettdvalue($(obj)) ; else str11 = $(obj).val() ;
	 	
   if (str11==null) str11="" ;
   var str111 = str11 ;
   str11 = str11.replace(/(^\s*)|(\s*$)/g,   "");
   
   if (str11=="0")
   {
   	  if (obj.tagName=="TD")
   	  {
   	  	return true ;
   	  } else
   	  {
   	    $(obj).val("0") ;
        return true ;
      } ;  
   };
   
   str11 = "_"+_parseexp(str11) ;
      
   var i11 = str11.indexOf(".") ;
   if (i11>=0) str11 = str11.substr(0,i11) ;
   str11 = str11.substr(1) ;
   if (obj.tagName=="TD")
   {
   	 str11 = _myparseInt(str11,0) ;
   	 if ((str11+"")!=str111) 
   	 $(obj).attr("value",str11).html(str11).addClass("tbupdatedtr").attr("ident",____ident()) ;
   	 return true ;
   } else 
   {
     $(obj).val(_myparseInt(str11,0)).attr("rawvalue",_tohex(str111)) ;
     return true ;
   } ;  
};
function _isfloatg0(obj)
{
	_isfloat(obj) ;
	var sv1 = "" ;
	if (obj.tagName=="TD") sv1 = _gettdvalue($(obj)) ; else sv1 = $(obj).val() ;
	if (_myparseFloat(sv1,0)<=0) return false ; else return true ;
};
function _isfloatl0(obj)
{
	_isfloat(obj) ;
	var sv1 = "" ;
	if (obj.tagName=="TD") sv1 = _gettdvalue($(obj)) ; else sv1 = $(obj).val() ;
	if (_myparseFloat(sv1,0)>=0) return false ; else return true ;
};
function _isfloatne0(obj)
{
	_isfloat(obj) ;
	var sv1 = "" ;
	if (obj.tagName=="TD") sv1 = _gettdvalue($(obj)) ; else sv1 = $(obj).val() ;
	if (_myparseFloat(sv1,0)==0) return false ; else return true ;
};
function _isfloat(obj)
{
   var str11 = "" ;
	 if (obj.tagName=="TD") str11 = _gettdvalue($(obj)) ; else str11 = $(obj).val() ;
   if (str11==null) str11="" ;
   var str111 = str11 ;
   str11 = str11.replace(/(^\s*)|(\s*$)/g,   "");
   if (str11=="")
   {
   	  if (obj.tagName=="TD") return false ; else  return true ;
   };
   
   str11 = _parseexp(str11) ;
   str11 = _myparseFloat(str11,0) ;
   var objfmt = "" ;
   objfmt = _isnull($(obj).attr("fmt"),"") ;
   if (obj.tagName=="TD")
   {
   	 if ((str11+"")!=str111) 
   	 $(obj).attr("value",str11).html(str11).addClass("tbupdatedtr").attr("ident",____ident()) ;
   	 return true ;
   } else
   {
     if (objfmt!="") str11 = _fmtfloat(str11,objfmt) ;
     $(obj).val(str11).attr("rawvalue",_tohex(str111)) ;
   } ;  
   return true ;
}
function _isemail(obj)
{
   var str11 = "" ;
	 if (obj.tagName=="TD") str11 = _gettdvalue($(obj)) ; else str11 = $(obj).val() ;
   if (str11==null) str11="" ;
   str11 = str11.replace(/(^\s*)|(\s*$)/g,   "");
   if (str11!="")
   {
      if ((str11.indexOf("@")<=0) || (str11.indexOf(".")<5))
      {
         return false ;
      }
      else return true;
   }
   else
   {
      return true ;
   }
   ;
}
function _ismobile(obj)
{
   var str11 = "" ;
   if (typeof(obj)=="string")
   {
   	str11 = obj ;
   } else 
  	{
  		if (obj.tagName=="TD") str11 = _gettdvalue($(obj))+"_" ; else str11 = $(obj).val()+"_" ;
  	} ;
   if (str11==null) str11="" ;
   str11 = str11.replace(/(^\s*)|(\s*$)/g,   "");
   if (str11!="")
   {
      if ((str11.indexOf("1")==0) && (str11.length>=11))
      {
         return true ;
      }
      else
      {
         return false ;
      }
      ;
   }
   else
   {
      return true ;
   }
   ;
}
function _isphoneno(obj)
{
   var str11 = "" ;
	 if (obj.tagName=="TD") str11 = _gettdvalue($(obj))+"_" ; else str11 = $(obj).val()+"_" ;
   if (str11==null) str11="" ;
   str11 = str11.replace(/(^\s*)|(\s*$)/g,   "");
   if (str11!="")
   {
      if (((str11.indexOf("0")==0) || (str11.indexOf("1")==0)) && (str11.length>=11))
      {
         return true ;
      }
      else
      {
         return false ;
      }
      ;
   }
   else
   {
      return true ;
   }
}

function _isempty(obj)
{
   var str11 = "" ;
   
	 if (obj.tagName=="TD") str11 = _gettdvalue($(obj)) ; else str11 = $(obj).val() ;
   if (str11==null) str11="" ;
   if (str11==String.fromCharCode(160)) str11 = "" ;
   if (str11=="&nbsp;") str11 = "" ;
   if (str11=="&#160;") str11 = "" ;
   str11 = str11.replace(/(^\s*)|(\s*$)/g,   "");
   return (str11=="")  ;
}
function _isnotempty(obj)
{
   return !_isempty(obj) ;
}
function _lengthx(obj,lenx01)
{
   var str11 = "" ;
	 if (obj.tagName=="TD") str11 = _gettdvalue($(obj)) ; else str11 = $(obj).val() ;
   if (str11==null) str11="" ;
   if (str11==String.fromCharCode(160)) str11 = "" ;
   if (str11=="&nbsp;") str11 = "" ;
   if (str11=="&#160;") str11 = "" ;
   str11 = str11.replace(/(^\s*)|(\s*$)/g,   "");
   return str11.length>=lenx01 ;
}
function _myparseInt(oi1_,def1_)
{
   var ov11 = oi1_+"_" ;var def01 ;
   if (def1_) def01 = def1_ ; else def01 = 0 ;
   var oir1 = def01 ;
   while (ov11.substr(0,1)=="0") ov11 = ov11.substr(1) ;
   ov11 = ov11.substr(0,ov11.length-1) ;
   try
   {
      oir1 = parseInt(ov11) ;
      if (oir1=="NaN") oir1 = def01 ;
      if (isNaN(oir1)) oir1 = def01 ;
   }
   catch (e)
   {
      oir1 = def01 ;
   }
   finally
   {
   }
   ;
   return oir1 ;

}
function _myparseFloat(oi1_,def1_)
{
   var ov11 = oi1_ ;
   var def01 ;
   if (def1_) def01 = def1_ ; else def01 = 0 ;
   var oir1 = def01 ;
   try
   {
   	  var ods1 = "_"+oir1 ;
   	  var i = ods1.indexOf("</font>") ;
   	  if (i>0) 
   	  {
   	  	oir1 = ods1.substr(i+7) ;
   	  } ;
   	  //while (ov11.substr(0,1)=="0") ov11 = ov11.substr(1) ;
      oir1 = parseFloat(ov11) ;
      if (oir1=="NaN") oir1 = def01 ;
      if (isNaN(oir1)) oir1 = def01 ;
   }
   catch (e)
   {
      oir1 = def01 ;
   }
   finally
   {
   }
   ;
   return oir1 ;
}

		
function _assigndate(pobj001,obj1,date111)
{
   var obj001 = pobj001.$("#"+obj1) ;
   obj001.val(date111.getFullYear()+"-"+(date111.getMonth()+1)+"-"+date111.getDate()) ;
}
function _todate(date111)
{
	var mii = parseInt(_fmtdate(date111,"m"))-1 ;
	if (mii>=12) mii = 0 ;
	var date11 = new Date(_fmtdate(date111,"yyyy"),mii,_fmtdate(date111,"d"),
		_fmtdate(date111,"h"),_fmtdate(date111,"n"),_fmtdate(date111,"s")) ;
  return date11 ;
}
function _dateadd(date111,num1)
{
   var date11 = new Date(Date.parse(date111)+(1*1000*60*60*24)*num1) ;
   return date11 ;
}
function _today()
{
   var now = new Date();
   var date00 = new Date(now.getYear(),now.getMonth(),now.getDate()) ;
   return date00 ;
}
function _monday()
{
   var now = new Date();
   var date00 = new Date(now.getYear(),now.getMonth(),now.getDate()) ;
   var week001=date00.getDay() ;
   if ((week001)==0) week001 = 6 ; else week001 = week001 - 1 ;
   var date11 = new Date(Date.parse(date00)-(1*1000*60*60*24)*week001) ;
   return date11 ;
}
function _yearstart()
{
   var now = new Date();
   var date00 = new Date(now.getYear(),0,1) ;
   return date00 ;
}
function _yearend()
{
   var now = new Date();
   var date00 = new Date(now.getYear(),11,31) ;
   return date00 ;
}
function _lastyearstart()
{
   var now = new Date();
   var date00 = new Date(now.getYear()-1,0,1) ;
   return date00 ;
}
function _lastyearend()
{
   var now = new Date();
   var date00 = new Date(now.getYear()-1,11,31) ;
   return date00 ;
}
function _monthstart()
{
   var now = new Date();
   var date00 = new Date(now.getYear(),now.getMonth(),1) ;
   return date00 ;
}
function _monthend()
{
   var now = new Date();
   var date00 = new Date(now.getYear(),now.getMonth(),1) ;
   var oldmth = date00.getMonth() ;
   var date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*31) ;
   if (date11.getMonth()!=oldmth) date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*30) ;
   if (date11.getMonth()!=oldmth) date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*29) ;
   if (date11.getMonth()!=oldmth) date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*28) ;
   return date11 ;
}
function _lastmonthstart(td1)
{
   var now = new Date();
   if (td1) now = td1 ;
   var date00 = new Date(now.getYear(),now.getMonth(),1) ;
   var oldmth = date00.getMonth() ;
   var year1  = date00.getYear() ;
   oldmth -- ;
   if (oldmth<0) 
   {
   	oldmth = 11 ;
   	year1 -- ;
   } ;
   var date11 = new Date(year1,oldmth,1) ;
   
   return date11 ;
}
function _lastmonthend(td1)
{
   var now = new Date();
   if (td1) now = td1 ;
   var date00 = new Date(now.getYear(),now.getMonth(),1) ;
   var oldmth = date00.getMonth() ;
   var date11 = new Date(Date.parse(date00)-(1*1000*60*60*24)*1) ;
   return date11 ;
}
function _nextmonthstart(td1)
{
   var now = new Date();
   if (td1) now = td1 ;
   var date00 = new Date(now.getYear(),now.getMonth(),1) ;
   var oldmth = date00.getMonth() ;
   var date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*28) ;
   if (date11.getMonth()==oldmth) date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*29) ;
   if (date11.getMonth()==oldmth) date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*30) ;
   if (date11.getMonth()==oldmth) date11 = new Date(Date.parse(date00)+(1*1000*60*60*24)*31) ;
   return date11 ;
}
function _nextmonthend(td1)
{
   var now = new Date();
   if (td1) now = td1 ;
   now = _nextmonthstart(now) ;
   now = _nextmonthstart(now) ;
   var date11 = new Date(Date.parse(now)-(1*1000*60*60*24)*1) ;
   return date11 ;
}
function _fmtdate(date22,fmt1) 
{
	var date1 = "" ;
	var i1 = 0 ;
  if (typeof(date22)=="object") 
  {
  	date1 = date22.getYear()+"-"+(date22.getMonth()+1)+"-"+date22.getDate()+" "+
  	date22.getHours()+":"+date22.getMinutes()+":"+date22.getSeconds() ;
  } else 
  {
  	date1 = _isnull(date22,"") ;
  	if (date1=="") return "&nbsp;" ;
  	var date11 = "" ;
  	i1 = date1.indexOf(" ") ;
  	if (i1>0) 
  	{
  		date11 = date1.substr(0,i1) ;
  		date1 = date1.substr(i1+1) ;
  	} else 
  	{
  		date11 = date1 ;
  		date1 = "" ;
  	} ;
  	if ((date11.length==8) && 
  	    ((date11.substr(0,1)=="2") || (date11.substr(0,1)=="1"))) 
  	{
  		date1 = date11.substr(0,4)+"-"+date11.substr(4,2)+"-"+date11.substr(6,2)+" "+date1 ;
  	} else 
  	{
  		date1 = date11 +" "+ date1 ;
  	} ;    
  	if ((date1+"_").indexOf("<")>=0) return date1 ;
  	if ((date1+"_").indexOf("&")>=0) return date1 ;
  	date1 = date1.trim() ;
  } ;
  
	if (_isnull(date1,"")=="") return "&nbsp;" ;
  
	// fmt1 : yy y m d h n s : yy:2位年 /p表示人性化 今天 昨天 前天 明天 后天
	var src11 = date1+" 00:00:00" ;
	var sep1 = "-" ;
	if (src11.indexOf(sep1)<0) sep1 = "." ;
	if (src11.indexOf(sep1)<0) sep1 = "/" ;
	
	i1 = src11.indexOf(sep1) ;
	var year1 = _myparseInt(src11.substr(0,i1)) ;
	src11 = src11.substr(i1+1) ;
	
	i1 = src11.indexOf(sep1) ;
	var month1 = src11.substr(0,i1) ;
	
	var month1 = _myparseInt(src11.substr(0,i1)) ;
	src11 = src11.substr(i1+1) ;
	
	if (year1<=1900) return "&nbsp;" ;
	//2008-10-13T22:35:01.7630000+08:00
	
	i1 = src11.indexOf("T") ;
	if (i1<0) i1 = src11.indexOf(" ") ;
	
	var day1 = (src11.substr(0,i1)) ;
	if (day1.substr(0,1)=="0") day1 = day1.substr(1) ;
	src11 = src11.substr(i1+1) ;
	
	i1 = src11.indexOf(":") ;
	var hour1 = (src11.substr(0,i1)) ;
	if (hour1.substr(0,1)=="0") hour1 = hour1.substr(1) ;
	src11 = src11.substr(i1+1) ; 
	
	i1 = src11.indexOf(":") ;
	var minute1 = (src11.substr(0,i1)) ;
	if (minute1.substr(0,1)=="0") minute1 = minute1.substr(1) ;
	src11 = src11.substr(i1+1) ;
	
	i1 = src11.indexOf(".") ;
	var second1 = src11 ;
	if (i1>0) second1 = src11.substr(0,i1) ;
	if (second1.substr(0,1)=="0") second1 = second1.substr(1) ;
	var res1 = fmt1 ;
	var res111 = fmt1 ;
	i1 = res1.indexOf("/p") ;
	
	
	var now = new Date();
	
	var now_hour = now.getHours() ;
	var now_minute = now.getMinutes() ;
	
  var thisy2 = now.getYear() ;
  var ii1 = 0 ;
  var thism1 = now.getMonth()+1 ;
  var res11 = "" ;
  if (i1>0)
  {
  	i1 = res1.indexOf("m") ;
  	if (i1>0)
  	{
	  	if (thisy2==year1)  
	  	{
	  		ii1 = res1.indexOf("d") ;
	  		if (ii1>0) 
	  		{
	  		  if (thism1==month1)
	  		  {
	  		  	res11 = "<span class=fontalternate><b>本月</b></span>";
	  		  	res1 = res1.substr(ii1) ;
	  	    } else 
	  	    if (thism1==(month1+1))
	  		  {
	  		  	res11 = "<span class=fontalternate>上个月</span>";
	  		  	res1 = res1.substr(ii1) ;
	  	    } else	
	  	    if (thism1==(month1-1))
	  		  {
	  		  	res11 = "<span class=fontalternate>下个月</span>";
	  		  	res1 = res1.substr(ii1) ;
	  	    }	else 
	  	    if (thism1==(month1-1))
	  		  {
	  		  	res11 = "<span class=fontalternate>二个月后</span>";
	  		  	res1 = res1.substr(ii1) ;
	  	    }	
	  	  } else 
	  	  	{
	  	  		res11 = "<span class=fontalternate><b>今年</b></span>";
	  	  		res1 = res1.substr(i1) ;
	  	  	} ;	
	  	} else
	  	if (thisy2==(year1+1))
	  	{
	  		res11 = "<span class=fontalternate>去年</span>";
	  		res1 = res1.substr(i1) ;
	    } else
	  	if (thisy2==(year1+2))
	  	{
	  		res11 = "<span class=fontalternate>前年</span>";
	  		res1 = res1.substr(i1) ;
	    }  else
	  	if (thisy2==(year1-1))
	  	{
	  		res11 = "<span class=fontalternate>明年</span>";
	  		res1 = res1.substr(i1) ;
	    } else
	  	if (thisy2==(year1-2))
	  	{
	  		res11 = "<span class=fontalternate>后年</span>";
	  		res1 = res1.substr(i1) ;
	    };
    } ;
  } ;
  
  res1 = res1.replace("yyyy",year1) ;
  res111 = res111.replace("yyyy",year1) ;
	res1 = res1.replace("yy",(year1+"").substr(2,2)) ;
	res111 = res111.replace("yy",(year1+"").substr(2,2)) ;
	res1 = res1.replace("y",year1) ;
	res111 = res111.replace("y",(year1+"").substr(2,2)) ;
	var aa1 = "00"+month1 ;
	res1 = res1.replace("mm",aa1.substr(aa1.length-2,2)) ;
	res111 = res111.replace("mm",aa1.substr(aa1.length-2,2)) ;
	res1 = res1.replace("m",month1) ;
	res111 = res111.replace("m",month1) ;
	aa1 = "00"+day1 ;
	res1 = res1.replace("dd",aa1.substr(aa1.length-2,2)) ;
	res111 = res111.replace("dd",aa1.substr(aa1.length-2,2)) ;
	res1 = res1.replace("d",day1) ;
	res111 = res111.replace("d",day1) ;
	aa1 = "00"+hour1 ;
	res1 = res1.replace("hh",aa1.substr(aa1.length-2,2)) ;
	res111 = res111.replace("hh",aa1.substr(aa1.length-2,2)) ;
	res1 = res1.replace("h",hour1) ;
	res111 = res111.replace("h",hour1) ;
	aa1 = "00"+minute1 ;
	res1 = res1.replace("nn",aa1.substr(aa1.length-2,2)) ;
	res111 = res111.replace("nn",aa1.substr(aa1.length-2,2)) ;
	res1 = res1.replace("n",minute1) ;
	res111 = res111.replace("n",minute1) ;
	aa1 = "00"+second1 ;
	res1 = res1.replace("ss",aa1.substr(aa1.length-2,2)) ;
	res111 = res111.replace("ss",aa1.substr(aa1.length-2,2)) ;
	res1 = res1.replace("s",second1) ;
	res111 = res111.replace("s",second1) ;
	res111 = res111.replace("/p","") ;
	
	var res2 = "" ;
	i1 = res1.indexOf("/p") ;
	var hasp = i1>0 ;
	// "y/m/d/p hh:mm"
	if (i1>0) 
	{
		res2 = res1.substr(0,i1) ;
		res1 = res1.substr(i1+2) ;
		i1 = _today_date(year1+"-"+month1+"-"+day1) ;
		if (i1==0) {res2 = "<span class='fontalternate fb'>今天</span>" ;res11 = "" ;};
		if (i1==1) {res2 = "<span class=fontalternate>昨天</span>" ;res11 = "" ;};
		if (i1==2) {res2 = "<span class=fontalternate>前天</span>" ;res11 = "" ;};
		if (i1==3) {res2 = "<span class=fontalternate>三天前</span>" ;res11 = "" ;};
		if (i1==4) {res2 = "<span class=fontalternate>四天前</span>" ;res11 = "" ;};
		if (i1==5) {res2 = "<span class=fontalternate>五天前</span>" ;res11 = "" ;};
		if (i1==6) {res2 = "<span class=fontalternate>六天前</span>" ;res11 = "" ;};
		if (i1==7) {res2 = "<span class=fontalternate>一周前</span>" ;res11 = "" ;};
		if (i1==8) {res2 = "<span class=fontalternate>八天前</span>" ;res11 = "" ;};
		if (i1==9) {res2 = "<span class=fontalternate>九天前</span>" ;res11 = "" ;};
		if (i1==10) {res2 = "<span class=fontalternate>十天前</span>" ;res11 = "" ;};
		if (i1==14) {res2 = "<span class=fontalternate>二周前</span>" ;res11 = "" ;};
		if (i1==15) {res2 = "<span class=fontalternate>半月前</span>" ;res11 = "" ;};
		if (i1==-1) {res2 = "<span class=fontalternate>明天</span>" ;res11 = "" ;};
		if (i1==-2) {res2 = "<span class=fontalternate>后天</span>" ;res11 = "" ;};
		if (i1==-3) {res2 = "<span class=fontalternate>三天后</span>" ;res11 = "" ;};
		if (i1==-4) {res2 = "<span class=fontalternate>四天后</span>" ;res11 = "" ;};
		if (i1==-5) {res2 = "<span class=fontalternate>五天后</span>" ;res11 = "" ;};
		if (i1==-6) {res2 = "<span class=fontalternate>六天后</span>" ;res11 = "" ;};
		if (i1==-7) {res2 = "<span class=fontalternate>一周后</span>" ;res11 = "" ;};
		if (i1==-8) {res2 = "<span class=fontalternate>八天后</span>" ;res11 = "" ;};
		if (i1==-9) {res2 = "<span class=fontalternate>九天后</span>" ;res11 = "" ;};
		if (i1==-10) {res2 = "<span class=fontalternate>十天后</span>" ;res11 = "" ;};
		if (i1==-14) {res2 = "<span class=fontalternate>二周后</span>" ;res11 = "" ;};
		if (i1==-15) {res2 = "<span class=fontalternate>半月后</span>" ;res11 = "" ;};
	} ;
	//if (res2!="") res11 = "" ;
	if ((hasp) && ((res2.indexOf("今天")>0) || (res2.indexOf("昨天")>0) || (res2.indexOf("明天")>0)))
	{
		if (res2.indexOf("昨天")>0) hour1 = myparseInt(hour1,0)-24 ;
		if (res2.indexOf("明天")>0) hour1 = myparseInt(hour1,0)+24 ;
		if (now_hour==hour1) 
		{
			var mi1 = myparseInt(now_minute,0) - myparseInt(minute1,0) ;
			if (mi1==0) 
			{
				res11 = "" ;res2="" ; res1 = "<span class=fontalternate>1分钟前</span>" ;
			} else  
			if (mi1>0) 
			{
				res11 = "" ;res2="" ; 
				if (mi1<=2) res1 = "<span class=fontalternate>2分钟前</span>" ;
				else if (mi1<=3) res1 = "<span class=fontalternate>3分钟前</span>" ;
				else if (mi1<=4) res1 = "<span class=fontalternate>4分钟前</span>" ;
				else if (mi1<=5) res1 = "<span class=fontalternate>5分钟前</span>" ;
				else if (mi1<=10) res1 = "<span class=fontalternate>约10分钟前</span>" ;
				else if (mi1<=15) res1 = "<span class=fontalternate>约15分钟前</span>" ;
				else if (mi1<=30) res1 = "<span class=fontalternate>约半小时前</span>" ;
				else if (mi1<=45) res1 = "<span class=fontalternate>约45分钟前</span>" ;
				else res1 = "<span class=fontalternate>约1小时前</span>" ;
			} else  
			{
				res11 = "" ;res2="" ; 
				if (mi1>=-2) res1 = "<span class=fontalternate>2分钟后</span>" ;
				else if (mi1>=-3) res1 = "<span class=fontalternate>3分钟后</span>" ;
				else if (mi1>=-4) res1 = "<span class=fontalternate>4分钟后</span>" ;
				else if (mi1>=-5) res1 = "<span class=fontalternate>5分钟后</span>" ;
				else if (mi1>=-10) res1 = "<span class=fontalternate>约10分钟后</span>" ;
				else if (mi1>=-15) res1 = "<span class=fontalternate>约15分钟后</span>" ;
				else if (mi1>=-30) res1 = "<span class=fontalternate>约半小时后</span>" ;
				else if (mi1>=-45) res1 = "<span class=fontalternate>约45分钟后</span>" ;
				else res1 = "<span class=fontalternate>约1小时后</span>" ;
			} ;
		} else 
		{
			var mi1 = myparseInt(now_hour,0) - myparseInt(hour1,0) ;
			if (mi1>0) 
			{
				res11 = "" ;res2="" ; 
				if (mi1<=1) res1 = "<span class=fontalternate>约1小时前</span>" ;
				else if (mi1<=2) res1 = "<span class=fontalternate>约2小时前</span>" ;
				else if (mi1<=3) res1 = "<span class=fontalternate>约3小时前</span>" ;
				else if (mi1<=4) res1 = "<span class=fontalternate>约4小时前</span>" ;
				else if (mi1<=5) res1 = "<span class=fontalternate>约5小时前</span>" ;
				else if (mi1<=6) res1 = "<span class=fontalternate>约6小时前</span>" ;
				else if (mi1<=7) res1 = "<span class=fontalternate>约7小时前</span>" ;
				else if (mi1<=8) res1 = "<span class=fontalternate>约8小时前</span>" ;
				else if (mi1<=9) res1 = "<span class=fontalternate>约9小时前</span>" ;
				else if (mi1<=10) res1 = "<span class=fontalternate>约10小时前</span>" ;
				else if (mi1<=12) res1 = "<span class=fontalternate>约半天前</span>" ;
				else if (mi1<=15) res1 = "<span class=fontalternate>约15小时前</span>" ;
				else if (mi1<=18) res1 = "<span class=fontalternate>约18小时前</span>" ;
				else 	res1 = "<span class=fontalternate>约一天前</span>" ;
			} else  
			{
				res11 = "" ;res2="" ; 
				if (mi1>=-1) res1 = "<span class=fontalternate>约1小时后</span>" ;
				else if (mi1>=-2) res1 = "<span class=fontalternate>约2小时后</span>" ;
				else if (mi1>=-3) res1 = "<span class=fontalternate>约3小时后</span>" ;
				else if (mi1>=-4) res1 = "<span class=fontalternate>约4小时后</span>" ;
				else if (mi1>=-5) res1 = "<span class=fontalternate>约5小时后</span>" ;
				else if (mi1>=-6) res1 = "<span class=fontalternate>约6小时后</span>" ;
				else if (mi1>=-7) res1 = "<span class=fontalternate>约7小时后</span>" ;
				else if (mi1>=-8) res1 = "<span class=fontalternate>约8小时后</span>" ;
				else if (mi1>=-9) res1 = "<span class=fontalternate>约9小时后</span>" ;
				else if (mi1>=-10) res1 = "<span class=fontalternate>约10小时后</span>" ;
				else if (mi1>=-12) res1 = "<span class=fontalternate>约半天后</span>" ;
				else if (mi1>=-15) res1 = "<span class=fontalternate>约15小时后</span>" ;
				else if (mi1>=-18) res1 = "<span class=fontalternate>约18小时后</span>" ;
				else 	res1 = "<span class=fontalternate>约一天前</span>" ;
			} ;
		} ;
	} ;
	if (hasp) return "<span class=mypsndate title='"+res111+"'>"+res11+res2+res1+"</span>" ;
	else return res11+res2+res1 ;
}

function _today_date(date1) 
{
	var src11 = date1+" 00:00:00" ;
	var sep1 = "-" ;
	if (src11.indexOf(sep1)<0) sep1 = "." ;
	if (src11.indexOf(sep1)<0) sep1 = "/" ;
	var i1 = 0 ;
	i1 = src11.indexOf(sep1) ;
	var year1 = src11.substr(0,i1) ;
	src11 = src11.substr(i1+1) ;
	
	i1 = src11.indexOf(sep1) ;
	var month1 = src11.substr(0,i1) ;
	src11 = src11.substr(i1+1) ;
	
	//2008-10-13T22:35:01.7630000+08:00
	i1 = src11.indexOf("T") ;
	if (i1<0) i1 = src11.indexOf(" ") ;
	
	var day1 = src11.substr(0,i1) ;
	
	var now = new Date();
  var date00 = new Date(now.getYear(),now.getMonth(),now.getDate()) ;
  var date11 = new Date(year1,(parseInt(month1)-1),day1) ;
  return parseInt(date00 - date11)/86400000 ; 
};
function _datetitle(date11)
{
	var tp1 = _today_date(date11) ;
	if (tp1==0) return "今天" ; else
	if (tp1>0) 
	{	 
		if (tp1==1) return "昨天" ; else
		if (tp1==2) return "前天" ; else 
		if (tp1<7) return "三天前" ; else 
		if (tp1<30) return "一周前" ; else 
		if (tp1<180) return "一个月前" ;
		else return "半年前" ;
  } else  
  {	
		if (tp1==-1) return "明天" ; else 
		if (tp1==-2) return "后天" ; else 
		if (tp1>-7) return "三天后" ; else 
		if (tp1>-30) return "一周后" ; else 
		if (tp1>-180) return "一个月后" ; else
		return "半年后" ;	
  }; 
};
function FormatNumber(value,precision)
{
 var strErr;
 var num;
 var f_value,s_value;
 var strArr;

 if(Trim(value)=="")   //数据为空时返回
  return "";
 if (isNaN(value))   //数据非法时提示，并返回空串
 {
  strErr = "数据"+value+"非法！"
  throw new Error(strErr);
  return "0";
 }
 if (precision==-1)   //只作检查时精度为-1
  return value;
 try
 {
  s_value = (Number(value)).toFixed(parseInt(precision));
  return s_value;    //成功时返回格式化后的值
 }
 catch(err)
 {
  throw new Error(err.description);
  return value;      //若失败则返回原值
 }
}

function _fmtfloat(flt1, fmt12)
{
   var fmt123 = fmt12.toLowerCase() ;
   var val001 = flt1 ;
   try
   {
   	  var hasflag = false ;
   	  var haszero = false ;
      var fmti = fmt123.indexOf("0") ;
      haszero = fmti >= 0 ;
      fmt123 = fmt123.replace("0","") ;
      fmti = fmt123.indexOf(".") ;
      if (fmti<0) 
      {
      	fmti = fmt123.indexOf(",") ;
      	if (fmti>=0) hasflag = true ;
      } ;	
      if (fmti >= 0) fmti = fmt123.substr(fmti + 1).length ;
      else fmti = 0 ;
      val001 = parseFloat(val001) ;
      if ((val001==0) && (haszero))
      {
      	return "&nbsp;" ;
      } ;
      val001 = (Number(val001)).toFixed(parseInt(fmti));
      if (hasflag)
      {
        fmti = val001.indexOf(".") ;
        if ((fmti>3) && (fmti<=6))
        {
        	val001 = val001.substr(0,fmti-3)+","+val001.substr(fmti-3) ;
        } else 
        if ((fmti>6) && (fmti<=9))
        {
        	val001 = val001.substr(0,fmti-6)+","+val001.substr(fmti-6,3)+","+val001.substr(fmti-3) ;
        } else 
        if ((fmti>9) && (fmti<=12)) 
        {
        	val001 = val001.substr(0,fmti-9)+","+val001.substr(fmti-9,3)+","+val001.substr(fmti-6,3)+","+val001.substr(fmti-3) ;
        } else 
        if ((fmti>12)) 
        {
        	val001 = val001.substr(0,fmti-12)+","+val001.substr(fmti-12,3)+","+val001.substr(fmti-9,3)+","+val001.substr(fmti-6,3)+","+val001.substr(fmti-3) ;
        }  ;
      } ;
   }
   catch (e)
   {
   	
   }
   finally
   {
   }
   ;
   return val001 ;
}

function _tohex(str1)
{
	 var str = _isnull(""+str1,"") ;
   if ('' != str)
   {
      if (str.indexOf('~h`') == 0)
      {
         return str ;
      }
      ;
      var t, i,tl=0,t0="",rs=[],t1="";
      for (i = 0; i < str.length; i ++ )
      {
         t = str.charCodeAt(i).toString(16);
         tl = t.length ;
         if (tl==4) t0 = "" ; else
         if (tl==2) t0 = "00" ; else	
         if (tl==1) t0 = "000" ; else 
         if (tl==3) t0 = "0" ;else t0 = "0000" ;
         t1 = t0+t ;
         rs[i] = t1.slice(2, 4)+t1.slice(0, 2) ;	
      }
      return('~h`' + rs.join(""));
   }
   else
   {
      return('');
   }
}

function _tostr(str)
{
   var str2 = _isnull(""+str,"") ;
   if (str2.indexOf('~h`') == 0)
   {
      str2 = str2.substr(3) ;
      if (str2 != '')
      {
         var st, t, i,rs=[] ;
         st = '';
         for (i = 1; i <= str2.length / 4; i ++ )
         {
         	  rs[i*3-3] = "%u" ;
         	  rs[i*3-2] = str2.slice(4 * i - 2, 4 * i) ;
         	  rs[i*3-1] = str2.slice(4 * i - 4, 4 * i - 2);
         } ;
         st = rs.join("") ;
         st = unescape(st);
         return(st);
         }
      else return('');
   }
   else return str2 ;
}


function _vscroll(pobj003,objname1,height1,step1)
{
	 eval("pobj003."+objname1+"_scrollheight="+height1) ;
   objstr1 = pobj003.$("#"+objname1).html() ;
   objstr1 =
   "<DIV id=mpscr1_"+objname1+" style=\"OVERFLOW: hidden; HEIGHT: "+height1+"px\">"+
   "<DIV id=mpscr2_"+objname1+">"+objstr1+"</DIV>"+
   "<DIV id=mpscr3_"+objname1+"></DIV></DIV>"+
   "<SCRIPT language=javascript>"+
   "function mpsscr0_"+objname1+"()"+
   "{"+
   "$('#mpscr1_"+objname1+"').css('height',"+objname1+"_scrollheight);"+
   "try {"+
   "if(mpscr3_"+objname1+".offsetTop-mpscr1_"+objname1+".scrollTop<=0)"+
   "{"+
   "mpscr1_"+objname1+".scrollTop-=mpscr2_"+objname1+".offsetHeight;"+
   "mpsscr6_"+objname1+"=window.setTimeout(\"mpsscr0_"+objname1+"()\",sp_"+objname1+");"+
   "}"+
   "else"+
   "{"+
   "mpscr1_"+objname1+".scrollTop+="+step1+";"+
   "oi_"+objname1+" += "+step1+" ;"+
   "if (oi_"+objname1+" >= mh_"+objname1+") "+
   "{"+
   "oi_"+objname1+" = 0 ;"+
   "mpsscr6_"+objname1+"=window.setTimeout(\"mpsscr0_"+objname1+"()\",pu_"+objname1+") ;"+
   "} else mpsscr6_"+objname1+"=window.setTimeout(\"mpsscr0_"+objname1+"()\",sp_"+objname1+");"+
   "}"+
   "} catch (e) {} finally {} ;"+
   "};"+
   "</SCRIPT>" ;
   pobj003.$("#"+objname1).html(objstr1) ;
}

function _hscroll(pobj003,objname1,width1,step1)
{
	 eval("pobj003."+objname1+"_scrollwidth="+width1) ;
   objstr1 = pobj003.$("#"+objname1).html() ;
   objstr1 =
   "<DIV id=mpscr1_"+objname1+" style=\"OVERFLOW: hidden; WIDTH: "+width1+"px\">"+
   "<table border=0 cellspacing=0 cellpadding=0 height=100% width=100%>"+
   "<tr>"+
   "<td valign=top id=mpscr2_"+objname1+" nowrap=true>"+objstr1+"</td>"+
   "<td valign=top id=mpscr3_"+objname1+"  nowrap=true>&nbsp;</td>"+
   "</tr></table></div>"+
   "<SCRIPT language=javascript>"+
   "function mpsscr0_"+objname1+"()"+
   "{"+
   "$('#mpscr1_"+objname1+"').css('width',"+objname1+"_scrollwidth);"+
   "try {"+
   "if(mpscr3_"+objname1+".offsetLeft-mpscr1_"+objname1+".scrollLeft<=0)"+
   "{"+
   "mpscr1_"+objname1+".scrollLeft-=mpscr2_"+objname1+".offsetWidth;"+
   "mpsscr6_"+objname1+"=window.setTimeout(\"mpsscr0_"+objname1+"()\",sp_"+objname1+");"+
   "}"+
   "else"+
   "{"+
   "mpscr1_"+objname1+".scrollLeft+="+step1+";"+
   "oi_"+objname1+" += "+step1+" ;"+
   "if (oi_"+objname1+" >= mh_"+objname1+") "+
   "{"+
   "oi_"+objname1+" = 0 ;"+
   "mpsscr6_"+objname1+"=window.setTimeout(\"mpsscr0_"+objname1+"()\",pu_"+objname1+") ;"+
   "} else mpsscr6_"+objname1+"=window.setTimeout(\"mpsscr0_"+objname1+"()\",sp_"+objname1+");"+
   "};"+
   "} catch (e) {} finally {} ;"+
   "};"+
   "</SCRIPT>" ;
   pobj003.$("#"+objname1).html(objstr1) ;
}

function _isnull(strs1,def1)
{
	 var defa2 = "" ;
   if ((def1!=undefined) && (def1!=null)) defa2 = def1 ;
   
   if ((strs1 == undefined) || (strs1 == null) || (strs1=="undefined") 
   || (strs1=="NaN") || (strs1=="Infinity") || (strs1==String.fromCharCode(160)) || (strs1=="&nbsp;") 
   || (strs1=="&#160;")) return defa2 ;
   
   if ((strs1=="")) return defa2 ; else 	return strs1 ;
}

function _QueryParams(pname1,src1)
{
	 var pval1 = src1 ;
   if (src1) pval1 = src1 ;
   else pval1 = document.location.href ;
   var pi01 = pval1.indexOf("?"+pname1 + "=") ;
   if (pi01 < 0) pi01 = pval1.indexOf("&"+pname1 + "=") ;
   if (pi01 < 0) pi01 = pval1.indexOf("&amp;"+pname1 + "=") ;
   if (pi01<0) return "" ;
   pval1 = pval1.substr(pi01 + 1) ;
   pi01 = pval1.indexOf("=") ;
   pval1 = pval1.substr(pi01 + 1) ;

   pi01 = pval1.indexOf("&amp;") ;
   if (pi01<0) pi01 = pval1.indexOf("&") ;
   if (pi01 >= 0)
   {
      pval1 = pval1.substr(0, pi01) ;
   }
   ;
   pval1 = _tostr(pval1) ;
   return pval1 ;
}

function _existsParam(pname1,src1)
{
	 var pval1 = src1 ;
   if (src1) pval1 = src1 ;
   else pval1 = document.location.href ;
   var pi01 = pval1.indexOf("?"+pname1 + "=") ;
   if (pi01 >= 0) return true ;
   pi01 = pval1.indexOf("&amp;"+pname1 + "=") ;
   if (pi01<0) pi01 = pval1.indexOf("&"+pname1 + "=") ;
   return (pi01 >= 0);
}


function ____ident()
{
   var myDate = new Date();
   return myDate.getTime();
}

// 以上是数据处理函数

function __getcachedataseturlindex(pobj001,url10,onlyget1)
{
   var cachei03 = url10.indexOf("&cache=") ;
   if (cachei03<0) cachei03 = url10.indexOf("?cache=") ;
   var cachei02 = url10.indexOf("&publiccache=") ;
   if (cachei02<0) cachei02 = url10.indexOf("?publiccache=") ;
   var cachei01 = cachei03;
   var public1 = false ;
   if (cachei02>=0) { cachei01 = cachei02; public1=true ;};
   if (cachei01<0) return -100 ;

   var urlindex1 = - 1 ;
   var url111 = url10.substr(0,cachei01) ;
   url111 = url111.toLowerCase() ;
   var lasti01 = url111.lastIndexOf("/") ;
   if (lasti01>=0) url111 = url111.substr(lasti01+1) ;
   if (public1)
   {
     try {urlindex1 = _pobj.dataseturllogs.indexOf(url111) ;} catch (e)   
     {_pobj.dataseturllogs = [];} finally  {};
   } else 
   {
     try {urlindex1 = pobj001.dataseturllogs.indexOf(url111) ;} catch (e)   
     {pobj001.dataseturllogs = [] ;} finally  {};
   };	  
   if (!onlyget1)
   {
      if (urlindex1 < 0)
      {
      	 if (public1)
      	 {
           //_pobj.dataseturllogs = _pobj.dataseturllogs + ";;" + url111 + ";;" ;
           _pobj.dataseturllogs.push(url111) ;
           urlindex1 = _pobj.dataseturllogs.length - 1 ;//indexOf(";;" + url111 + ";;") ;
         } else
         {
           //pobj001.dataseturllogs = pobj001.dataseturllogs + ";;" + url111 + ";;" ;
           pobj001.dataseturllogs.push(url111) ;
           urlindex1 = pobj001.dataseturllogs.length - 1  ;//pobj001.dataseturllogs.indexOf(";;" + url111 + ";;") ;
         } ;	  
      }
      ;
   }
   ;
   return urlindex1 ;
}
function _patchaspx(url1)
{
	 var url111 = url1 ;
   if (url111.toLowerCase().indexOf(".asp")<0)
   {
      url111 = "/sys/aspx/execsql.aspx?sqlname="+url111 ;
      url111 = url111 +"&id03_="+____ident() ;
   }
   else
   {
      if (url1.indexOf('?') > 0) url111 = url1 + '&noidd=' + ____ident() ;
      else url111 = url1 + '?noidd=' + ____ident() ;
   }
   ;
   return url111 ;
}
function _patchaspxnoid(url1)
{
	 var url111 = url1 ;
   if (url111.toLowerCase().indexOf(".asp")<0)
   {
      url111 = "/sys/aspx/execsql.aspx?sqlname="+url111 
   }
   ;
   if (url111.indexOf("?")<0) url111 += "?nonono12=1" ;
   return url111 ;
}
function _run(pobj001,url1,_call1,param1)
{
	 var param2 = param1 ;
	 if (!param2) param2 = "";
   $.ajax(
      {
         url : _patchaspx(url1), async : true ,data:param2 , 
         success:function(msg)
         {
           if (_call1) _call1(msg) ;
         }
      }
      );
}

function _runandreturn_(pobj001,url1,datatype1,param1)
{
	 var param2 = param1 ;
	 if (!param2) param2 = "";
   var url111 = _patchaspx(url1) ;
   var sv11 = "" ;
   var parstr =  __jqueryparams(param1) ;
   var newurl1 = url111 ;
   if (parstr!="")
   {
     if (newurl1.indexOf("?")>0) newurl1 += "&"+parstr ; else newurl1 += "?"+parstr ;
   } ;  
   var urlidx1 = __getcachedataseturlindex(pobj001,newurl1,true) ;
   var public1 = newurl1.indexOf("publiccache=")>=0 ;
   if ((urlidx1<0) || (newurl1.indexOf("reload=")>=0))
   {
   	  if (datatype1=="xml") 
        sv11 = $.ajax(
        {
         url : url111, async : false,dataType : "xml" , data:param2    
        }
        ).responseXML;
      else   
      	sv11 = $.ajax(
        {
         url : url111, async : false , data:param2    
        }
        ).responseText; 
      if (urlidx1!=-100)
      {
         urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
         try
         {
         	  if (public1)
              eval("_sys_ca_urldataset_"+urlidx1+"=sv11") ;
            else   eval("pobj001._sys_ca_urldataset_"+urlidx1+"=sv11") ;
         }
         catch (e)
         {
         }
         finally
         {
         }
         ;
      }
      ;
   }
   else
   {
      try
      {
      	 if (public1) 
           eval("sv11 = _sys_ca_urldataset_"+urlidx1) ;
         else   eval("sv11 = pobj001._sys_ca_urldataset_"+urlidx1) ;
      }
      catch (e)
      {
      }
      finally
      {
      }
      ;
   }
   ;
   return  _isnull(sv11) ;
}
function __jqueryparams(params1)
{
   if (typeof(params1)=="object") return "lodfkd="+____ident() ;
   else return params1 ;
}
function _parseRow_fld(pobj001,row11)
{
	 var cmds1 = [] ;
   pobj001.$flds = [] ; pobj001.$f = [] ; var tmpii = 0 ;
   pobj001.$(row11).children().each(function()
   {
      if (this.nodeName)
      {
         //eval("pobj001._"+this.nodeName+" = "+tmpii) ;
         cmds1.push("pobj001._"+this.nodeName+" = "+tmpii) ;
         pobj001.$f[tmpii] = cvtvalue(this.text) ;//cvtvalue($(this).text()) ;
         pobj001.$flds[tmpii] = this.nodeName ; tmpii++;
      }
      ;
   }
   ) ;
   if (cmds1.length>0) 
   {
   	 eval(cmds1.join(";")) ;
   } ;
}
function _parseRow(pobj001,row11)
{
   pobj001.$f = [] ; 
   var i = 0 ;
   pobj001.$(row11).children().each(function()
   {
      if (this.nodeName)
      {
      	 i = pobj001.$flds.indexOf(this.nodeName) ;
      	 if (i>=0) pobj001.$f[i] = cvtvalue(this.text) ; else 
      	 {
      	 	 i = pobj001.$flds.length ;
      	 	 eval("pobj001._"+this.nodeName+"="+i) ;
      	 	 pobj001.$flds.push(this.nodeName) ;
           pobj001.$f[i] = cvtvalue(this.text)  ;//cvtvalue($(this).text())) ;
         } ;  
      }
      ;
   }
   )
}
function _runandreturn(pobj001,url1,param1) {return _runandreturn_(pobj001,url1,"",param1);} ;
function _runandreturnxml(pobj001,url1,param1) {return _runandreturn_(pobj001,url1,"xml",param1);} ;
function _runsql(sqlname1,params1,call1cb,call1cberror)
{
	 var url111 = _patchaspxnoid(sqlname1);

   if (typeof(params1)=="object")
   {
      $.post(url111+"&id091="+____ident(),
      params1,function(data1)
      {
      	 if ((data1!="0") && (data1.indexOf("´ë(")==0))
         {
         	if (call1cberror)
         	{
         		call1cberror(data1) ;
         	} else 
         	{
         		alert("运行SQL时发生了错误：\n\n"+data1) ;
         	} ;
         } if (call1cb)  call1cb();
      } ) ;
   }
   else
   {
      $.get(url111+"&"+params1+"&id091="+____ident(),function(data1)
      {
      	if ((data1!="0") && (data1.indexOf("错误码(")==0))
        {
        	if (call1cberror)
         	{
         		call1cberror(data1) ;
         	} else 
         	{
         		alert("运行SQL时发生了错误：\n\n"+data1) ;
         	} ;
        } if (call1cb)  call1cb();
      }
      ) ;
   }
   ;
}
function _runsqlandreturn(pobj001,sqlname1,params1)
{
   var sv11 = "" ;
   var url111  = _patchaspxnoid(sqlname1) ;
   
   var parstr =  __jqueryparams(params1) ;
   var newurl1 = url111 ;
   if (parstr!="")
   {
     if (newurl1.indexOf("?")>0) newurl1 += "&"+parstr ; else newurl1 += "?"+parstr ;
   } ;
   
   var urlidx1 = __getcachedataseturlindex(pobj001,newurl1,true) ;
   var public1 = false ;
   var reload1 = false ;
   public1 = newurl1.indexOf("publiccache=")>=0 ;
   reload1 = newurl1.indexOf("reload=")>=0 ;
   if ((urlidx1<0) || (reload1))
   {
      sv11 = $.ajax(
      {
         type: "POST",
         url: url111+"&rtn=1&id091="+____ident(),
         data:params1,
         async: false
      }
      ).responseText;
      if (urlidx1!=-100)
      {
         urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
         try
         {
         	  if (public1) 
              eval("_sys_ca_urldataset_"+urlidx1+"=sv11") ;
            else   eval("pobj001._sys_ca_urldataset_"+urlidx1+"=sv11") ;
         }
         catch (e)
         {
         }
         finally
         {
         }
         ;
      }
      ;
   }
   else
   {
      try
      {
      	 if (public1) 
           eval("sv11 = _sys_ca_urldataset_"+urlidx1) ;
         else eval("sv11 = pobj001._sys_ca_urldataset_"+urlidx1) ;  
      }
      catch (e)
      {
      }
      finally
      {
      }
      ;
   }
   ;
   return sv11 ;
}
function _runwebservice4text(pobj001,method1,params1,call1cb)
{
	 if (typeof(params1)=="object")
   {
      if (call1cb)
      $.post("/sys/aspx/execservice.aspx?methodname="+method1+"&id091="+____ident(),params1,function(data1)
         {
         	  if ((typeof(data1)=="string") && (data1.indexOf("__error__:")==0)) 
         	  {
         	  	alert("发现了错误：\n\n"+data1.substr(10)) ;
         	  } else  call1cb(data1)
         }
         ) ;
      else $.post("/sys/aspx/execservice.aspx?methodname="+method1+"&id091="+____ident(),params1,function(data1)
      	{
      		if ((typeof(data1)=="string") && (data1.indexOf("__error__:")==0)) alert("·¢Ж´£º\n\n"+data1.substr(10)) ;
      	});
   }
   else
   {
      if (call1cb)
         $.get("/sys/aspx/execservice.aspx?methodname="+method1+"&"+params1+"&id091="+____ident(),function(data1)
         {
            if ((typeof(data1)=="string") && (data1.indexOf("__error__:")==0)) 
         	  {
         	  	alert("发现了错误：\n\n"+data1.substr(10)) ;
         	  } else  call1cb(data1)
         }
         ) ;
         else   $.get("/sys/aspx/execservice.aspx?methodname="+method1+"&"+params1+"&id091="+____ident(),function(data1)
      	{
      		if ((typeof(data1)=="string") && (data1.indexOf("__error__:")==0)) alert("发现了错误：\n\n"+data1.substr(10)) ;
      	});
   };
};
function _webservicexmlcall(pobj001,data11,call1cb) 
{
	var cld1 = pobj001.$(data11).children() ;
	var cld1i = cld1.length ;
	if (cld1i<=0) return false; 
	var cld2 = null ;
	var dsname1 = "" ;
	var s1  = "" ;
	var nofinalcall1 = false ;
	for (var i=0 ; i<cld1i ; i++) 
	{
		cld2 = cld1[i] ;
		s1 = cld2.nodeName ;
		if (s1.toLowerCase()=="newdataset") // 只是针对数组这种情况,一维数组和二维数组
		{
			nofinalcall1 = true ;
			_sqlxmlcall(pobj001,cld2,call1cb,false) ;
		} else 
		{
		  _webservicexmlcall1(pobj001,cld2,call1cb,s1,s1) ;
		} ;  
	} ;
	if (!nofinalcall1) call1cb(true,null,null) ;
};
function _webservicexmlcall1(pobj001,data11,call1cb,fds1,vars1) 
{
	var cld1 = pobj001.$(data11).children() ;
	var cld1i = cld1.length ;
	if (cld1i<=0) return false; 
	var cld2 = null ;
	var cld22 = null ;
	var dsname1 = "" ;
	var s1  = "" ;
	var objs2 = [] ;
	var objs2name = [] ;
	var ij = 0 ; 
	for (var i=0 ; i<cld1i ; i++) 
	{
		cld2 = cld1[i] ;
		s1 = cld2.nodeName ;
		cld22 = pobj001.$(cld2).children() ;
		if (cld22.length<=0) 
		{
			eval("pobj001.$"+vars1+"_"+s1+"=cld2.text") ;
			ij ++ ;
		} else
		{
			if (objs2name.indexOf(s1)<0)
			{
			  objs2.push(cld2) ;
			  objs2name.push(s1) ;
			} ;  
	  } ;
	} ;
	
	for (var i=0 ; i<objs2.length ; i ++)
	{
		cld2 = pobj001.$(data11).children(objs2name[i]) ;
		for (var ii=0;ii<cld2.length;ii++)
		{
			_webservicexmlcall1(pobj001,cld2[ii],call1cb,fds1+"."+objs2name[i],vars1+"_"+objs2name[i]) ;
		} ;
		if (cld2.length>0) call1cb(true,cld2,fds1+"."+objs2name[i]) ;
	} ;
	
	if (ij>0) call1cb(false,data11,fds1) ;
	
};
function _runwebservice4xml(pobj001,method1,params1,call1cb)
{
	 if (typeof(params1)=="object")
   {
      if (call1cb)
      $.post("/sys/aspx/execservice.aspx?methodname="+method1+"&id091="+____ident(),params1,function(data1)
         {
         	  if (typeof(data1)=="string")
         	  {
         	  	if (data1.indexOf("__error__:")==0) alert(data1.substr(10)) ;
         	  } else _webservicexmlcall(pobj001,data1,call1cb) ;
         }
         ) ;
      else $.post("/sys/aspx/execservice.aspx?methodname="+method1+"&id091="+____ident(),params1,
      	function(data1)
      	{
      		if ((typeof(data1)=="string") && (data1.indexOf("__error__:")==0)) alert(data1.substr(10)) ;
      	});
   }
   else
   {
      if (call1cb)
         $.get("/sys/aspx/execservice.aspx?methodname="+method1+"&"+params1+"&id091="+____ident(),function(data1)
         {
            if (typeof(data1)=="string")
         	  {
         	  	if (data1.indexOf("__error__:")==0) alert(data1.substr(10)) ;
         	  } else _webservicexmlcall(pobj001,data1,call1cb) ;
         }
         ) ;
         else   $.get("/sys/aspx/execservice.aspx?methodname="+method1+"&"+params1+"&id091="+____ident(),
         	function(data1)
	      	{
	      		if ((typeof(data1)=="string") && (data1.indexOf("__error__:")==0)) alert(data1.substr(10)) ;
	      	});
   };
};
function _sqlxmlcall(pobj001,data1,call1cb,nofinalcall1)
{
	pobj001._datasetcount = 0 ;
	var dsname = "" ;
	for (var i=20 ; i>=0 ; i--)
	{
		if (i==0) dsname = "ds1" ; else dsname = "ds1"+i ;
		if ($(dsname,data1).length>0) 
		{
			pobj001._datasetcount = i + 1 ;
			break ;
		} ;
	} ;	 	
	var ds1 = null ;
	for (var i=0 ; i<pobj001._datasetcount ; i++)
	{
		if (i==0) dsname = "ds1" ; else dsname = "ds1"+i ;
		ds1 = $(dsname,data1) ; 
		pobj001._recno = 0 ;
		pobj001._recindex = 0 ;
		pobj001._recordcount = ds1.length ;
		pobj001._reccount = ds1.length ;
		pobj001._datasetname = dsname;
		if (pobj001._recordcount>0)
		{
			ds1.each(function()
			{
				pobj001._recno ++ ;
				pobj001._recindex ++ ;
				if (pobj001._recno==1) _parseRow_fld(pobj001,this) ; else _parseRow(pobj001,this) ;
				try {call1cb(false,this,dsname) ;} catch (e) { } finally { } ;
			}
			) ;
		};
		try {call1cb(true,ds1,dsname) ;} catch (e) {} finally { } ;
	};
	if (!nofinalcall1) try {call1cb(true,data1,null) ;} catch (e) {} finally { } ;
};
function _runsql4xml(pobj001,sqlname1,params1,call1cb)
{
	 var url111  = _patchaspxnoid(sqlname1) ;
	 var parstr =  __jqueryparams(params1) ;
   var newurl1 = url111 ;
   if (parstr!="")
   {
     if (newurl1.indexOf("?")>0) newurl1 += "&"+parstr ; else newurl1 += "?"+parstr ;
   } ;
   var urlidx1 = __getcachedataseturlindex(pobj001,newurl1,true) ;
   var public1 = false ;
   var reload1 = false ;
   public1 = newurl1.indexOf("publiccache=")>=0 ;
   reload1 = newurl1.indexOf("reload=")>=0 ;
   var workingurl = "" ;
   var i0901 = newurl1.indexOf("globle=")  ;
   if (i0901>0) 
   {
   	 workingurl = newurl1.substr(i0901+7) ;
   	 i0901 = workingurl.indexOf("&")  ;
   	 if (i0901>0) workingurl = workingurl.substr(0,i0901) ;
   	 workingurl = workingurl.trim() ;
   	 workingurl = workingurl.replace("^","/") ;
   	 workingurl = workingurl.replace("^","/") ;
   	 workingurl = workingurl.replace("^","/") ;
   	 try { workingurl = "/data/"+cmpid+"/"+workingurl+".xml" ;} catch (e) {} finally { };
   } ;
	 
   var ds1 = null ;var dsname = "ds1" ;
   if ((urlidx1<0) || (reload1))
   {
      // 如果有xml，则直接取xml,这样就会快很多
      if ((workingurl!="") && (call1cb))
      {
      	$.ajax({
         type: "GET",
				 url:workingurl,
				 data:"",
				 success:
         function(data1)
         {
            if (urlidx1!=-100)
            {
               urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
               try
               {
               	  if (public1)
                    eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
                  else eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
               }
               catch (e)
               {
               }
               finally
               {
               }
               ;
            }
            ;
            _sqlxmlcall(pobj001,data1,call1cb,false) ;
         },
         error:
         function()
         {
         	 //重新运行aspx，取数据
         	 //////////////////////
         	 if (typeof(params1)=="object")
			      {
			         if (call1cb)
			         $.post(url111+"&xml=1&id091="+____ident(),params1,
			         function(data1)
			         {
			            if (urlidx1!=-100)
			            {
			               urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
			               try
			               {
			               	  if (public1)
			                    eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
			                  else eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
			               }
			               catch (e)
			               {
			               }
			               finally
			               {
			               }
			               ;
			            }
			            ;
			            _sqlxmlcall(pobj001,data1,call1cb,false) ;
			         }
			         ) ;
			         else   $.post(url111+"&id091="+____ident(),params1) ;
			      }
			      else
			      {
			      	
			         if (call1cb)
			         $.get(url111+"&"+params1+"&xml=1&id091="+____ident(),
			         function(data1)
			         {
			         	
			            if (urlidx1!=-100)
			            {
			               urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
			               try
			               {
			               	  if (public1)
			                    eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
			                  else 
			                  	eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
			               }
			               catch (e)
			               {
			               }
			               finally
			               {
			               }
			               ;
			            }
			            ;
			            _sqlxmlcall(pobj001,data1,call1cb,false) ;
			         }
			         ) ;
			         else   $.get(url111+"&"+params1+"&id091="+____ident()) ;
			      }
			      ;
         	 //////////////////////
         }}
         ) ;
      } else
      {
      	//////////
      	if (typeof(params1)=="object")
	      {
	         if (call1cb)
	         $.post(url111+"&xml=1&id091="+____ident(),params1,
	         function(data1)
	         {
	            if (urlidx1!=-100)
	            {
	               urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
	               try
	               {
	               	  if (public1)
	                    eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
	                  else eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
	               }
	               catch (e)
	               {
	               }
	               finally
	               {
	               }
	               ;
	            }
	            ;
	            _sqlxmlcall(pobj001,data1,call1cb,false) ;
	         }
	         ) ;
	         else   $.post(url111+"&id091="+____ident(),params1) ;
	      }
	      else
	      {
	      	
	         if (call1cb)
	         $.get(url111+"&"+params1+"&xml=1&id091="+____ident(),
	         function(data1)
	         {
	         	
	            if (urlidx1!=-100)
	            {
	               urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
	               try
	               {
	               	  if (public1)
	                    eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
	                  else 
	                  	eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
	               }
	               catch (e)
	               {
	               }
	               finally
	               {
	               }
	               ;
	            }
	            ;
	            _sqlxmlcall(pobj001,data1,call1cb,false) ;
	         }
	         ) ;
	         else   $.get(url111+"&"+params1+"&id091="+____ident()) ;
	      }
	      ;
      	//////////
      } ;
   }
   else
   {
      var data11 = null ;
      try
      {
      	 if (public1) 
           eval("data11 = _sys_ca_urldataset_"+urlidx1) ;
         else eval("data11 = pobj001._sys_ca_urldataset_"+urlidx1) ;  
      }
      catch (e)
      {
      }
      finally
      {
      }
      ;
      _sqlxmlcall(pobj001,data11,call1cb,false) ;
   }
   ;
}

function _runsql4text(pobj001,sqlname1,params1,call1cb)
{
	 var url111  = _patchaspxnoid(sqlname1) ;
	 var parstr =  __jqueryparams(params1) ;
   var newurl1 = url111 ;
   if (parstr!="")
   {
     if (newurl1.indexOf("?")>0) newurl1 += "&"+parstr ; else newurl1 += "?"+parstr ;
   } ;
   var urlidx1 = __getcachedataseturlindex(pobj001,newurl1,true) ;
   var public1 = false ;
   var reload1 = false ;
   public1 = newurl1.indexOf("publiccache=")>=0 ;
   reload1 = newurl1.indexOf("reload=")>=0 ;
   if ((urlidx1<0) || (reload1))
   {
      if (typeof(params1)=="object")
      {
         if (call1cb)
         $.post(url111+"&rtn=1&id091="+____ident(),params1,function(data1)
         {
            if (urlidx1!=-100)
            {
               urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
               try
               {
               	  if (public1) 
                    eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
                  else eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
               }
               catch (e)
               {
               }
               finally
               {
               }
               ;
            }
            ;
            call1cb(data1)
         }
         ) ;
         else   $.post(url111+"&id091="+____ident(),params1) ;
      }
      else
      {
         if (call1cb)
         $.get(url111+"&"+params1+"&rtn=1&id091="+____ident(),function(data1)
         {
            if (urlidx1!=-100)
            {
               urlidx1 = __getcachedataseturlindex(pobj001,newurl1,false) ;
               try
               {
               	  if (public1) 
                    eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
                  else eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
               }
               catch (e)
               {
               }
               finally
               {
               }
               ;
            }
            ;
            call1cb(data1)
         }
         ) ;
         else   $.get(url111+"&"+params1+"&id091="+____ident()) ;
      }
      ;
   }
   else
   {
      var data11 = "" ;
      try
      {
      	 if (public1)
           eval("data11 = _sys_ca_urldataset_"+urlidx1) ;
         else   eval("data11 = pobj001._sys_ca_urldataset_"+urlidx1) ;
      }
      catch (e)
      {
      }
      finally
      {
      }
      ;
      call1cb(data11) ;
   }
   ;
}
function _datarow_foreach(pobj001,$dataset1,cnd1,rowfunc1)
{
	var tmpii = 0 ;
	var newcnd = cnd1 ;
	var cndres1 = false ;
	$dataset1.each(
		function()
		{
			row1 = this ;
			tmpii = 0 ;
			newcnd = cnd1 ;
			cndres1 = false ;

			$(row1).children().each(function()
      {
      	fld1 = this ;
      	if (fld1.nodeName)
     		{
         eval("pobj001._"+fld1.nodeName+" = "+tmpii) ;
         pobj001.$s[tmpii] = cvtvalue(fld1.text) ;
         pobj001.$sflds[tmpii] = fld1.nodeName ; tmpii++;
         newcnd = newcnd.replaceAll("{"+fld1.nodeName+"}",cvtvalue(fld1.text)) ;
        }
        ;
   		}) ;
   		if (cnd1=="") cndres1 = true ; else 
   		{
        newcnd = "cndres1 = ("+newcnd+")" ;
        eval(newcnd) ;
      } ;  
      if (cndres1) rowfunc1(false,row1) ;
		});
		rowfunc1(true,$dataset1) ;
}

function _datarow_search(pobj001,$dataset1,cnd1)
{
	var tmpii = 0 ;
	var newcnd = cnd1 ;
	var cndres1 = false ;
	pobj001.$s = [] ;pobj001.$sflds=[] ;
	var row1 = null ;
	$dataset1.each(
		function()
		{
			if (!(cndres1))
			{
				row1 = this ;
				tmpii = 0 ;
				newcnd = cnd1 ;
				cndres1 = false ;
	
				$(row1).children().each(function()
	      {
	      	fld1 = this ;
	      	if (fld1.nodeName)
	     		{
	         eval("pobj001._"+fld1.nodeName+" = "+tmpii) ;
	         pobj001.$s[tmpii] = cvtvalue(fld1.text) ;
	         pobj001.$sflds[tmpii] = fld1.nodeName ; tmpii++;
	         newcnd = newcnd.replaceAll("{"+fld1.nodeName+"}",cvtvalue(fld1.text)) ;
	        }
	        ;
	   		}) ;
	   		if (newcnd=="") cndres1=true ;
	   		{
	        newcnd = "cndres1 = ("+newcnd+")" ;
	        eval(newcnd) ;
	      } ;  
    	};
		});
	if (!(cndres1)) 
	{
		pobj001.$s = [] ;pobj001.$sflds=[] ;
	} ;	
	return cndres1 ;
}
function _getxmltb(pobj001,sqlnameandparam1, pagesize)
{
   var sql1 = sqlnameandparam1 ;
   var sqli1 = 0 ;
   sqli1 = sql1.indexOf("&cache=") ;
   if (sqli1<0) sqli1 = sql1.indexOf("&publiccache=") ;
   if (sqli1>=0)  sql1 = sql1.substr(0,sqli1)+"&pagesize="+pagesize+"&pageindex=1&qry=1"+sql1.substr(sqli1) ;
   else sql1 += "&pagesize="+pagesize+"&pageindex=1&qry=1" ;
   sqli1 = sql1.indexOf("&") ;
   return _getxml(pobj001,sql1.substr(0,sqli1),sql1.substr(sqli1+1)) ;
}
function _getxml(pobj001,sqlname1,params1)
{
	 var url111  = _patchaspxnoid(sqlname1) ;
	 var parstr =  __jqueryparams(params1) ;
   var newurl1 = url111 ;
   var resdata = null ;
   if (parstr!="")
   {
     if (newurl1.indexOf("?")>0) newurl1 += "&"+parstr ; else newurl1 += "?"+parstr ;
   } ;
   var urlidx1 = __getcachedataseturlindex(pobj001,newurl1,true) ;
   var public1 = false ;
   public1 = newurl1.indexOf("publiccache=")>=0 ;
   try
   {
       if (public1)
         eval("resdata = _sys_ca_urldataset_"+urlidx1) ;
       else eval("resdata = pobj001._sys_ca_urldataset_"+urlidx1) ;  
   }  catch (e){ } finally { } ;
   return resdata ;
}
function _cachexml(pobj001,sqlname1,params1,data1)
{
	 var url111  = _patchaspxnoid(sqlname1) ;
	 var parstr =  __jqueryparams(params1) ;
   var newurl1 = url111 ;
   if (parstr!="")
   {
     if (newurl1.indexOf("?")>0) newurl1 += "&"+parstr ; else newurl1 += "?"+parstr ;
   } ;
   var urlidx1 = __getcachedataseturlindex(pobj001,newurl1,true) ;
   var public1 = false ;
   public1 = newurl1.indexOf("publiccache=")>=0 ;
   try
   {
       if (public1)
         eval("_sys_ca_urldataset_"+urlidx1+"=data1") ;
       else eval("pobj001._sys_ca_urldataset_"+urlidx1+"=data1") ;  
   }  catch (e){ } finally { } ;
}
function _xmleach(pobj001,data1,call1cb)
{
						pobj001._datasetcount = 0 ;
						var ds1 = null ;var dsname = "ds1" ;
            for (var i=20 ; i>=0 ; i--)
            {
            	 if (i==0) dsname = "ds1" ; else dsname = "ds1"+i ;
            	 if ($(dsname,data1).length>0) 
            	 {
            	 	 pobj001._datasetcount = i + 1 ;
            	 	 break ;
            	 } ;
            } ;	 	
            for (var i=0 ; i<pobj001._datasetcount ; i++)
            {
            	 if (i==0) dsname = "ds1" ; else dsname = "ds1"+i ;
               ds1 = $(dsname,data1) ; 
               pobj001._recno = 0 ;
               pobj001._recindex = 0 ;
               pobj001._recordcount = ds1.length ;
               pobj001._reccount = ds1.length ;
               pobj001._datasetname = dsname;
               if (pobj001._recordcount>0)
               {
                  ds1.each(function()
                  {
                     pobj001._recno ++ ;pobj001._recindex ++ ;
                     if (pobj001._recno==1) _parseRow_fld(pobj001,this) ; else _parseRow(pobj001,this) ;
                     call1cb(false,this,dsname) ;
                  }
                  ) ;
               };
               call1cb(true,ds1,dsname) ;
            };
            call1cb(true,data1,null) ;
}
function _dataseteach(pobj001,dataset1,call1cb)
{
	pobj001._recno = 0 ;
	pobj001._recindex = 0 ;
  pobj001._recordcount = dataset1.length ;
  pobj001._reccount = dataset1.length ;
  if (pobj001._recordcount>0)
  {
     dataset1.each(function()
     {
        pobj001._recno ++ ;pobj001._recindex ++ ;
        if (pobj001._recno==1) _parseRow_fld(pobj001,this) ; else _parseRow(pobj001,this) ;
        call1cb(false,this) ;
     }) ;
  };
  call1cb(true,dataset1) ;
};  
// deal with xml
function _delrecs(pobj001,varname1,dsname11,cnd1)  // cnd1 = "ord2_id=='12' || ord2_ford2id=='12'"
{
	var tmpds = [] ;
  var tmpflds = [] ;
  var tmparr = [] ;
  var evstr = "tmpds = pobj001."+varname1+"_ds;" ;
	eval(evstr) ;
	evstr = "tmparr = pobj001."+varname1+";" ;
	eval(evstr) ;
	var dslen1 = tmpds.length ;
	var fldlen1 = 0 ;
	var reclen1 = 0 ;
	var fltok = false ;
	var fltstr = "" ;
	for (var i=dslen1-1;i>=0;i--)
	{
    if (dsname11==tmpds[i]) 
    {
			tmpflds = [] ;
			evstr = "tmpflds = pobj001."+varname1+"_ds"+i+"flds;" ;
			eval(evstr) ;
			fldlen1 = tmpflds.length ;
	
			reclen1 = tmparr[i].length ;
		  for (var k=reclen1-1;k>=0;k--)
		  {
		  	fltstr = cnd1 ;
		    for (var l=0;l<fldlen1;l++) 
		    {
		    	fltstr = fltstr.replaceAll("{"+tmpflds[l]+"}",tmparr[i][k][l]) ;
		    } ;
		    fltok = false ;
		    fltstr = "fltok=("+fltstr+");" ;
		    eval(fltstr) ;
		    if (fltok)
		    {
		    	tmparr[i].splice(k,1) ;
		    } ;
		  } ;
		} ;  
	} ;
}

function _modrecs(pobj001,varname1,dsname11,fldval1,cnd1)  
// cnd1 = "ord2_id=='12' || ord2_ford2id=='12'"
// fldval1 : "fldname='dsasa',flds='dss'...." ;
{
	var tmpds = [] ;
  var tmpflds = [] ;
  var tmparr = [] ;
  var evstr = "tmpds = pobj001."+varname1+"_ds;" ;
	eval(evstr) ;
	evstr = "tmparr = pobj001."+varname1+";" ;
	eval(evstr) ;
	var dslen1 = tmpds.length ;
	var fldlen1 = 0 ;
	var reclen1 = 0 ;
	var fltok = false ;
	var fltstr = "" ;
	var str111 = "" ;
	var str222 = "" ;
	var str333 = "" ;
	var tmpi = 0 ;
	for (var i=dslen1-1;i>=0;i--)
	{
    if (dsname11==tmpds[i]) 
    {
			tmpflds = [] ;
			evstr = "tmpflds = pobj001."+varname1+"_ds"+i+"flds;" ;
			eval(evstr) ;
			fldlen1 = tmpflds.length ;
	
			reclen1 = tmparr[i].length ;
		  for (var k=reclen1-1;k>=0;k--)
		  {
		  	fltstr = cnd1 ;
		    for (var l=0;l<fldlen1;l++) 
		    {
		    	fltstr = fltstr.replaceAll("{"+tmpflds[l]+"}",tmparr[i][k][l]) ;
		    } ;
		    fltok = false ;
		    fltstr = "fltok=("+fltstr+");" ;
		    eval(fltstr) ;
		    if (fltok)
		    {
		    	str111 = fldval1+"," ;
		    	tmpi = str111.indexOf(",") ;
		    	while (tmpi>=0) 
		    	{
		    		str222 = str111.substr(0,tmpi) ;
		    		str111 = str111.substr(tmpi+1) ;
		    		tmpi = str222.indexOf("=") ;
		    		str333 = str222.substr(0,tmpi).trim();
		    		str222 = str222.substr(tmpi+1).trim() ;
		    		if (str222.substr(0,1)=="'") str222 = str222.substr(1) ;
		    		if (str222.substr(0,1)=='"') str222 = str222.substr(1) ;
		    		if (str222.substr(str222.length-1)=="'") str222 = str222.substr(0,str222.length-1) ;
		    		if (str222.substr(str222.length-1)=='"') str222 = str222.substr(0,str222.length-1) ;
		    		tmpi = tmpflds.indexOf(str333) ;
		    		if (tmpi>=0) 
		    		{
		    			tmparr[i][k][tmpi] = _tostr(str222) ;
		    		}  ;
		    		tmpi = str111.indexOf(",") ;
		    	} ;
		    } ;
		  } ;
		} ;  
	} ;
}
function _mergerecs(pobj001,varname1,dsname11,$dataset1)  
{
	var tmpds = [] ;
  var tmpflds = [] ;
  var tmparr = [] ;
  var evstr = "tmpds = pobj001."+varname1+"_ds;" ;
	eval(evstr) ;
	evstr = "tmparr = pobj001."+varname1+";" ;
	eval(evstr) ;
	var dslen1 = tmpds.length ;
	var fldlen1 = 0 ;
	var reclen1 = 0 ;
	var arow = null ;
	var afld = null ;
	var tmparr3 = [] ;
	var fldi = 0 ;
	var exists1 = false ;
	var tmplen1 = 0 ;
	for (var i=dslen1-1;i>=0;i--)
	{
    if (dsname11==tmpds[i]) 
    {
			tmpflds = [] ;
			evstr = "tmpflds = pobj001."+varname1+"_ds"+i+"flds;" ;
			eval(evstr) ;
			fldlen1 = tmpflds.length ;
			reclen1 = tmparr[i].length ;
			$dataset1.each(function()
			{
				arow = this ;
				tmparr3 = [] ;
				$(arow).children().each(function()
				{
					afld = this ;
					fldi = tmpflds.indexOf(afld.nodeName) ;
					if (fldi>=0)
					{
						tmparr3[fldi] = cvtvalue($(afld).text()) ;
					} ;
				}) ;
				// 看看存在否
				tmplen1 = tmparr[i].length ;
				exists1 = false ;
				for (var j=0;j<tmplen1;j++)
				{
					if (tmparr3[0]==tmparr[i][j][0]) 
					{
						tmplen1 = j ;
						exists1 = true ;
						break ;
					} ;
				} ;
				if (exists1)
				{
					for (var j=0;j<tmparr3;j++) tmparr[i][tmplen1][j]=tmparr3[j] ;
				} else 
				{
				  tmparr[i][reclen1] = tmparr3 ;
				  reclen1 ++ ;
				};  
			}) ;
			evstr = "pobj001."+varname1+"=tmparr;" ;
			eval(evstr) ;
		} ;  
	} ;
}
function _insrecs(pobj001,varname1,dsname11,$dataset1)  
{
	var tmpds = [] ;
  var tmpflds = [] ;
  var tmparr = [] ;
  var evstr = "tmpds = pobj001."+varname1+"_ds;" ;
	eval(evstr) ;
	evstr = "tmparr = pobj001."+varname1+";" ;
	eval(evstr) ;
	var dslen1 = tmpds.length ;
	var fldlen1 = 0 ;
	var reclen1 = 0 ;
	var arow = null ;
	var afld = null ;
	var tmparr3 = [] ;
	var fldi = 0 ;
	for (var i=dslen1-1;i>=0;i--)
	{
    if (dsname11==tmpds[i]) 
    {
			tmpflds = [] ;
			evstr = "tmpflds = pobj001."+varname1+"_ds"+i+"flds;" ;
			eval(evstr) ;
			fldlen1 = tmpflds.length ;
			reclen1 = tmparr[i].length ;
			$dataset1.each(function()
			{
				arow = this ;
				tmparr3 = [] ;
				$(arow).children().each(function()
				{
					afld = this ;
					fldi = tmpflds.indexOf(afld.nodeName) ;
					if (fldi>=0)
					{
						tmparr3[fldi] = cvtvalue($(afld).text()) ;
					} ;
				}) ;
				tmparr[i][reclen1] = tmparr3 ;reclen1 ++ ;
			}) ;
			evstr = "pobj001."+varname1+"=tmparr;" ;
			eval(evstr) ;
		} ;  
	} ;
}

function cvtvalue(s1111)
{
	if ((s1111=="undefined") || (s1111=="NaN") || (s1111=="Infinity")) return  "0" ; else return  s1111 ;
}
function _get_fathervalue(pobj3,$selectorstr)
{
	//<tr class="_{ord2_ford2id}" id="ord2id_{ord2_id}" onclick="slt1tr('{ord2_id}')" value="{ord2_id}">
	//<span class=fromfather name=spec ford2id={ord2_ford2id}></span>
	var $sltor111 = $selectorstr ;
	if ($sltor111.indexOf(".fromfather")<0) 
	{
		if ($sltor111=="") $sltor111 = $sltor111 +" .fromfather"  ;
		else $sltor111 = "tbody[name=details_auto] *.fromfather"  ;
	} ;	
	var spanfatherobjs = pobj3.$($selectorstr) ;

	if (spanfatherobjs.length<=0) return ;
	var trobj111 = null ;
	var name111 = "" ;
	var ford2id111 = 0 ;
	spanfatherobjs.each(
	function()
	{
		name111 = pobj3.$(this).attr("name") ;
		ford2id111 = pobj3.$(this).attr("ford2id") ;
		trobj111 = pobj3.$("#ord2id_"+ford2id111+" *[name="+name111+"]") ;
		if (trobj111.length>0) 
		{
			_$value(pobj3,pobj3.$(this), trobj111.html()) ;
		} ;
	}) ;
}


function _data_foreach(pobj001,varname1,func1)
{
	// func1(iseof,data1,dsname1)
	//newi2 = ____ident() ;
  var tmpds = [] ;
  var tmpflds = [] ;
  var tmparr = [] ;
  var evstr = "tmpds = pobj001."+varname1+"_ds;" ;
	eval(evstr) ;
	evstr = "tmparr = pobj001."+varname1+";" ;
	eval(evstr) ;
	var dslen1 = tmpds.length ;
	var fldlen1 = 0 ;
	var reclen1 = 0 ;
	for (var i=dslen1-1;i>=0;i--)
	{
		_preparedata(pobj001,varname1,tmpds[i]) ;
		tmpflds = [] ;
		evstr = "tmpflds = pobj001."+varname1+"_ds"+i+"flds;" ;
		eval(evstr) ;
		fldlen1 = tmpflds.length ;
		pobj001.$flds = [] ;
		for (var j=0 ; j<fldlen1;j++) pobj001.$flds.push(tmpflds[j]) ;

		reclen1 = tmparr[i].length ;
	  for (var k=0;k<reclen1;k++)
	  {
	  	pobj001.$f=[];
	    for (var l=0;l<fldlen1;l++) 
	    {
	    	pobj001.$f[l] = tmparr[i][k][l] ;
	    } ;
	    if (func1) func1(false,null,tmpds[i]) ;
	  } ;
	  if (func1) func1(true,null,tmpds[i]) ;
	} ;
	if (func1) func1(true,null,null) ;

  // var newi1 = ____ident() ;
  
 //alert("genages:" + (newi1-newi2)) ;
}
function _preparedata(pobj001,varname1,dsname1)
{
	var ds111="";
	var tmpds = [] ;
	var tmpflds = [] ;
	var evstr = "tmpds = pobj001."+varname1+"_ds;" ;
	eval(evstr) ;
	var dslen1 = tmpds.length;
	var fldlen1 = 0 ;
	for (var i=0 ; i<dslen1 ; i++) 
	{
		ds111 = tmpds[i] ;
		evstr = "pobj001._"+ds111+" = "+i+";" ;
		eval(evstr) ;
		if (ds111==dsname1)
		{
		  evstr = "tmpflds = pobj001."+varname1+"_ds"+i+"flds;" ;
		  eval(evstr) ;
		  fldlen1 = tmpflds.length;
		  for (var j=0 ; j<fldlen1 ; j++)
		  {
			  evstr = "pobj001._"+tmpflds[j]+" = "+j+";" ;
		    eval(evstr) ;
		  } ;
		};  
	} ;
};
function _xmltodata(pobj001,data1,varname1,call1cb)
{
	var new1 = ____ident() ;
	var evstr = "pobj001."+varname1+"_ds=[];" ;
	var str1 = "" ;
	var adata = null ;
	var arow = null ;
	var afld = null ;
	var fldi = 0 ;
	eval(evstr) ;
	var tmpflds = [] ;
	var tmparr = [] ;
	var tmparr2 = [] ;
	var tmparr3 = [] ;
	var dsi = 0 ;
	var rowi = 0;
	var tmpfldslen = 0;
	for (var i=20 ; i>=0 ; i--)
  {
    if (i==0) str1 = "ds1" ; else str1 = "ds1"+i ;
    evstr = "pobj001."+varname1+"_ds.push('"+str1+"');" ; 
    adata = $(str1,data1) ;
    if (adata.length>0) 
    {
    	eval(evstr) ;
    	tmpflds = [] ;
    	$(adata[0]).children().each(
    	function()
    	{
    		tmpflds.push(this.nodeName) ;
    	}) ;
    	evstr = "pobj001."+varname1+"_ds"+dsi+"flds = tmpflds;" ;
    	eval(evstr) ;
    	rowi = 0 ;
    	tmparr2 = [] ;
    	tmpfldslen = tmpflds.length;
    	adata.each(
    	function()
    	{
    		arow = $(this) ;
    		tmparr3 = [] ;
    		//for (var i=0 ; i<tmpfldslen;i++) tmparr3[i]="";
    		arow.children().each(
    		function()
    		{
    			afld = this ;
    			fldi = tmpflds.indexOf(this.nodeName) ;
    			tmparr3[fldi]=cvtvalue($(this).text()) ;
    		}) ;
    		tmparr2[rowi] = tmparr3 ;
    		rowi ++ ;
    	});
    	tmparr[dsi] = tmparr2 ;
    	dsi ++ ;
    } ;	
  } ;
  evstr = "pobj001."+varname1+" = tmparr;" ;
  eval(evstr) ;
  if (call1cb) call1cb() ;  
  var new2 = ____ident() ;
  //alert("gen="+(new2 - new1)) ;
};

function _runsql4data(pobj001,varname1,sqlname1,params1,call1cb)
{
	var url111  = _patchaspxnoid(sqlname1) ;
	 var parstr =  __jqueryparams(params1) ;
   var newurl1 = url111 ;
   if (parstr!="")
   {
     if (newurl1.indexOf("?")>0) newurl1 += "&"+parstr ; else newurl1 += "?"+parstr ;
   } ;   
   if (typeof(params1)=="object")
   {
     $.post(url111+"&xml=1&id091="+____ident(),params1,
     function(data1)
     {
     	 _xmltodata(pobj001,data1,varname1,call1cb) ;
     });
   }
   else
   {
   	  $.get(url111+"&"+params1+"&xml=1&id091="+____ident(),
      function(data1)
      {
        _xmltodata(pobj001,data1,varname1,call1cb) ;
      }) ;
   } ;    
}


function _clearselect(docp001,sltname1)
{
   var objdlv11 = docp001.getElementById(sltname1) ;
   if (!objdlv11) return ;
   if (objdlv11.tagName!="SELECT") return ;
   for (var ii90=objdlv11.options.length-1; ii90>=0; ii90--) objdlv11.options.remove(ii90);
}
function _add1selectoption(docp001,sltname1,cap1,val1)
{
   var objdlv11 = docp001.getElementById(sltname1) ;
   if (!objdlv11) return ;
   if (objdlv11.tagName!="SELECT") return ;
   var oOption = docp001.createElement("OPTION");
   objdlv11.options.add(oOption);
   oOption.innerText = cap1;
   oOption.value = val1;
   return oOption ;
}
function _assignselect(objp001,sltname1,url11,defa111,callback11)
{
   var objdlv11 = objp001.document.getElementById(sltname1) ;
   if (!objdlv11) return ;
   if (objdlv11.tagName!="SELECT") return ;
   var urli1 = 0 ;
   urli1 = url11.indexOf("&") ;
   var url1 , param1 ;
   if (urli1>0) 
   {
    url1 = url11.substr(0,urli1) ;
    param1 = url11.substr(urli1+1) ;
   } else 
   {
	url1 = url11 ;
	param1 = "" ;
   } ;
   _runsql4xml(objp001,url1,param1,
   function(iseof,data1,dsname1)
   {
   	if (!iseof)
   	{
	   	var optiontext = objp001.$f[0] ;
	   	var optionvalue = optiontext ;
	   	if (objp001.$flds.length>1) optionvalue = objp001.$f[1] ;
	   	var oOption = objp001.document.createElement("OPTION");
	    objdlv11.options.add(oOption);
	    oOption.innerText = optiontext;
	    oOption.value = optionvalue;
	    if (defa111) oOption.selected = defa111==optionvalue ;
	  } else 
	  	{
	  		if ((iseof) && (!dsname1) && (callback11)) callback11() ;
	  	} ;
   });
}

// 以下与WINDOW有关的

function getgloble()
{
	 _screenw = screen.width ;
	 _screenh = screen.height ;
   _scrlx = 0 ;
   if(_pdoc.documentElement)
   _scrlx = _pdoc.documentElement.scrollLeft ;
   if (_scrlx <= 0) _scrlx = _pdoc.body.scrollLeft ;
   _scrly = 0 ;
   if(_pdoc.documentElement)
   _scrly = _pdoc.documentElement.scrollTop ;
   if (_scrly <= 0) _scrly = _pdoc.body.scrollTop ;
   _cltw = (window.innerWidth) ? window.innerWidth : (_pdoc.documentElement && _pdoc.documentElement.clientWidth) ? _pdoc.documentElement.clientWidth : _pdoc.body.offsetWidth;
   _clth = (window.innerHeight) ? window.innerHeight : (_pdoc.documentElement && _pdoc.documentElement.clientHeight) ? _pdoc.documentElement.clientHeight : _pdoc.body.offsetHeight;
   _dlgw = _cltw ;
   _dlgh = _clth ;
   if (parseInt(_dlgw) < parseInt(_pdoc.body.clientWidth)) _dlgw = _pdoc.body.clientWidth ;
   if (parseInt(_dlgh) < (parseInt(_pdoc.body.clientHeight) + 40)) _dlgh = parseInt(_pdoc.body.clientHeight) + 40 ;
}

function mousex(evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return 0;
   if (evt.pageX) return evt.pageX;
   else if (evt.clientX)
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
   else return 0;
}
function mousey(evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return 0;
   if (evt.pageY) return evt.pageY;
   else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
   else return 0;
}

function _resizewin(src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   var winid1 = _isnull(winid1) ;
   if (winid1 == "") return false ;
   resizebg2(winid1,true) ;
}
function _urlnohttpnopath(url01)
{
	var i = url01.indexOf("http://") ;
	if (i>=0) url01 = url01.substr(i+7) ;
	i = url01.indexOf("/") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("/") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("/") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("/") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("/") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("\\") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("\\") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("\\") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("\\") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	i = url01.indexOf("\\") ;
	if (i>=0) url01 = url01.substr(i+1) ;
	return url01 ;
};
function _winvisible(src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   var winid1 = _isnull(winid1) ;
   
   if (winid1 == "") 
   {
	   var url1_ = src1 ;
	   var thi1 = url1_.indexOf("html:") ;
	   if (thi1>=0)
	   {
	      url1_ = url1_.substr(0,thi1);//+"__" ;
	   }
	   ;
	   var winindex = url1_.indexOf("nocache=") ;
	   if (winindex > 0) url1_ = url1_.substr(0, winindex - 1) ;
	   url1_ = _urlnohttpnopath(url1_) ;
	   winindex = _pobj.winurls.indexOf(url1_) ;
	   if (winindex < 0) return  false ;
	   winid1 = "_w" + winindex + "w2_" ;
	 } ;  
   var win = _pdoc.getElementById("xMsg2" + winid1) ;
   if ( ! (win)) return ;
   var wrk = win.previousSibling;
   var wrkst = wrk.innerHTML ;
   return ((wrkst=="0") || (wrkst=="1")) ;
}
function _winwidth(src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return false ;
   var win = _pdoc.getElementById("xMsg2" + winid1) ;
   if ( ! (win)) return ;
   return parseInt(win.style.width) ;
}
function _winheight(src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return false ;
   var win = _pdoc.getElementById("xMsg2" + winid1) ;
   if ( ! (win)) return ;
   return parseInt(win.style.height) ;
}
function _winhandle(src1)
{
   var winid1 = "" ;
   if (	src1.indexOf(".")>=0 ) 
    winid1 = _QueryParams("mywinid",src1) ;
   else winid1 = src1 ; 
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return null ;
   return _pdoc.frames("xMsg2" + winid1+"_frame") ;
}

function _dialogreturn(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return ;
   try
   {
      eval("_pobj.gfunc_" + winid1 + "(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15)") ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   closewin2(winid1,false) ;
}
function _dialogreturnnoclose(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return ;
   try
   {
      eval("_pobj.gfunc_" + winid1 + "(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15)") ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
}

function _domywinfunc1(fv1,fv2,fv3,fv4,fv5,fv6,fv7,vf8,fv9,fv10,r11,r12,r13,r14,r15,src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return "";
   var rtv = ""
   try
   {
      eval("rtv = _pobj." + winid1 + "_f1(fv1,fv2,fv3,fv4,fv5,fv6,fv7,vf8,fv9,fv10,r11,r12,r13,r14,r15)") ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   return rtv ;
}
function _domywinfunc2(fv1,fv2,fv3,fv4,fv5,fv6,fv7,vf8,fv9,fv10,r11,r12,r13,r14,r15,src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return "";
   var rtv=  "" ;
   try
   {
      eval("rtv = _pobj." + winid1 + "_f2(fv1,fv2,fv3,fv4,fv5,fv6,fv7,vf8,fv9,fv10,r11,r12,r13,r14,r15)") ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   return rtv ;
}

function _myclosewin(src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return false;
   closewin2(winid1,true) ;
}

function startresize(obj,winid1, evt)
{
   if (_pdoc.getElementById("xMsg2" + winid1+"_fixed")) return  false;
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if(evt.button != 1) return  false ;
   obj.setCapture();
   _sysx0 = mousex(evt); _sysy0 = mousey(evt);
   _sysmoveable = true;
}

function resizew(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   
   var winf = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg" );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML != "0") return  false ;
   if ((parseInt(org.style.width) - mousex(evt) + _sysx0)<47) return  false ;
   win.style.width = parseInt(org.style.width) - mousex(evt) + _sysx0 ;
   if (ie6) wrk.style.left = parseInt(org.style.left) - _sysx0 + mousex(evt) ;
   else win.style.left = parseInt(org.style.left) - _sysx0 + mousex(evt) ;
   winf.style.top = win.style.top ;	
   winf.style.left = win.style.left ;
   winf.style.width = win.style.width ;
   
}

function resizenw(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   
   var winf = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg" );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML != "0") return  false ;
   if ((parseInt(org.style.width) - mousex(evt) + _sysx0)<47) return  false ;
   win.style.width = parseInt(org.style.width) - mousex(evt) + _sysx0 ;
   if (ie6) wrk.style.left = parseInt(org.style.left) - _sysx0 + mousex(evt) ;
   else win.style.left = parseInt(org.style.left) - _sysx0 + mousex(evt) ;
   if ((parseInt(org.style.height) - mousey(evt) + _sysy0)<47) return  false ;
   win.style.height = parseInt(org.style.height) - mousey(evt) + _sysy0 ;
   var frm = _pdoc.getElementById("xMsg2" + winid1 + "_main") ;
   frm.style.height = parseInt(win.style.height) - 28 ;
   var pTar2 = null;
   if (_pdoc.getElementById) pTar2 = _pdoc.getElementById("xMsg2" + winid1 + "_html");
   else eval('pTar2 = xMsg2' + winid1 + '_html;');
   if (pTar2) pTar2.style.height = parseInt(frm.style.height) - 4;
   var pTar = null;
   if (_pdoc.getElementById) pTar = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   else eval('pTar = xMsg2' + winid1 + '_frame;');
   if (pTar && ! window.opera)
   {
      pTar.height = parseInt(frm.style.height) - 4;
   }
   ;
   if (ie6) wrk.style.top = parseInt(org.style.top) - _sysy0 + mousey(evt) ;
   else win.style.top = parseInt(org.style.top) - _sysy0 + mousey(evt) ;
   winf.style.top = win.style.top ;	
   winf.style.left = win.style.left ;
   winf.style.width = win.style.width ;
   
   
}


function stopresize(obj,winid1,evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   obj.releaseCapture();
   _sysmoveable = false;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML != "0") return  false ;
   wrk.style.height = win.style.height ;
   org.style.height = win.style.height ;
   wrk.style.width = win.style.width ;
   org.style.width = win.style.width ;
   if (ie6)
   {
      org.style.top = wrk.style.top ;
      org.style.left = wrk.style.left ;
   }
   else
   {
      org.style.top = win.style.top ;
      org.style.left = win.style.left ;
   }
   ;
   _runresizefunc(winid1) ;
}

function resizee(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var winf = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg" );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML != "0") return  false ;
   if ((parseInt(org.style.width) + mousex(evt) - _sysx0)<47) return  false ;
   win.style.width = parseInt(org.style.width) + mousex(evt) - _sysx0 ;
   winf.style.width = win.style.width ;
   
}

function resizes(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var winf = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg" );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML != "0") return  false ;
   if ((parseInt(org.style.height) + mousey(evt) - _sysy0)<47) return  false ;
   win.style.height = parseInt(org.style.height) + mousey(evt) - _sysy0 ;

   var frm = _pdoc.getElementById("xMsg2" + winid1 + "_main") ;
   frm.style.height = parseInt(win.style.height) - 28 ;
   var pTar = null;
   if (_pdoc.getElementById) pTar = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   else eval('pTar = xMsg2' + winid1 + '_frame;');
   if (pTar && ! window.opera)
   {
      pTar.height = parseInt(frm.style.height) - 4;
   }
   var pTar2 = null;
   if (_pdoc.getElementById) pTar2 = _pdoc.getElementById("xMsg2" + winid1 + "_html");
   else eval('pTar2 = xMsg2' + winid1 + '_html;');
   if (pTar2) pTar2.style.height = parseInt(frm.style.height) - 4;
   
 
}

function resizesw(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var winf = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg" );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML != "0") return  false ;
   if ((parseInt(org.style.width) - mousex(evt) + _sysx0)<47) return  false ;
   win.style.width = parseInt(org.style.width) - mousex(evt) + _sysx0 ;
   if ((parseInt(org.style.height) + mousey(evt) - _sysy0)<47) return  false ;
   win.style.height = parseInt(org.style.height) + mousey(evt) - _sysy0 ;

   if (ie6) wrk.style.left = parseInt(org.style.left) - _sysx0 + mousex(evt) ;
   else win.style.left = parseInt(org.style.left) - _sysx0 + mousex(evt) ;
   var frm = _pdoc.getElementById("xMsg2" + winid1 + "_main") ;
   frm.style.height = parseInt(win.style.height) - 28 ;
   var pTar = null;
   if (_pdoc.getElementById) pTar = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   else eval('pTar = xMsg2' + winid1 + '_frame;');
   if (pTar && ! window.opera)
   {
      pTar.height = parseInt(frm.style.height) - 4;
   }
   var pTar2 = null;
   if (_pdoc.getElementById) pTar2 = _pdoc.getElementById("xMsg2" + winid1 + "_html");
   else eval('pTar2 = xMsg2' + winid1 + '_html;');
   if (pTar2) pTar2.style.height = parseInt(frm.style.height) - 4;
   winf.style.width = win.style.width ;
   winf.style.left = win.style.left ;
   
}
function resizese(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var winf = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg" );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML != "0") return  false ;
   if ((parseInt(org.style.width) + mousex(evt) - _sysx0)<47) return  false ;
   win.style.width = parseInt(org.style.width) + mousex(evt) - _sysx0 ;
   if ((parseInt(org.style.height) + mousey(evt) - _sysy0)<47) return  false ;
   win.style.height = parseInt(org.style.height) + mousey(evt) - _sysy0 ;

   var frm = _pdoc.getElementById("xMsg2" + winid1 + "_main") ;
   frm.style.height = parseInt(win.style.height) - 28 ;
   var pTar = null;
   if (_pdoc.getElementById) pTar = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   else eval('pTar = xMsg2' + winid1 + '_frame;');
   if (pTar && ! window.opera)
   {
      pTar.height = parseInt(frm.style.height) - 4;
   }
   var pTar2 = null;
   if (_pdoc.getElementById) pTar2 = _pdoc.getElementById("xMsg2" + winid1 + "_html");
   else eval('pTar2 = xMsg2' + winid1 + '_html;');
   if (pTar2) pTar2.style.height = parseInt(frm.style.height) - 4;
   
   winf.style.width = win.style.width ;
   
}
function startDrag2(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if(evt.button != 1) return  false ;
   obj.setCapture();
   // 定义对象;
   var winmain = _pdoc.getElementById("xMsg2" + winid1 +"_tdmain" );
   var wintitle0 = _pdoc.getElementById("xMsg2" + winid1 +"_title0" );
   $(winmain).css("filter","alpha(opacity=15)").css("-moz-opacity","0.15")  ;
   $(wintitle0).css("filter","alpha(opacity=85)").css("-moz-opacity","0.85") ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var wrk = win.previousSibling;
   
   if (wrk.innerHTML != "2") 
   {
   	 var bgobj1=_pdoc.getElementById("xMsg2" + winid1 +"bg") ;
   	 if ($(bgobj1).attr("dialog")=="0") 
   	 {
       $(bgobj1).attr("firstover","1") ;
       hidebackground(bgobj1,100) ;
     } ;
   } ;
   _sysx0 = mousex(evt);
   _sysy0 = mousey(evt);
   if (ie6)
   {
      _sysx1 = parseInt(wrk.style.left);
      _sysy1 = parseInt(wrk.style.top);
   }
   else
   {
      _sysx1 = parseInt(win.style.left);
      _sysy1 = parseInt(win.style.top);
   }
   ;
   _sysnormal = obj.style.backgroundColor;
   _sysmoveable = true;
   
}
// 拖动;
function drag2(obj, winid1,evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   getgloble() ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var winf = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg" );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   if (wrk.innerHTML == "1") return  false ;

   //if (win.filters.alpha.opacity) win.filters.alpha.opacity = 62;
   //if (win.style.MozOpacity) win.style.MozOpacity = 0.62 ;
   obj.style.cursor = "move" ;
   var deltax,deltay;
   if (ie6)
   {
      deltax = _sysx1 + mousex(evt) - _sysx0 - parseInt(wrk.style.left) ;
      deltay = _sysy1 + mousey(evt) - _sysy0 - parseInt(wrk.style.top);
      if ((parseInt(wrk.style.left) + deltax) < 0) wrk.style.left = 0 ;
      else wrk.style.left = parseInt(wrk.style.left) + deltax ;
      if ((parseInt(wrk.style.top) + deltay) < 0) wrk.style.top = 0 ;
      else wrk.style.top = parseInt(wrk.style.top) + deltay ;
      if (wrk.innerHTML=="0")
      {
         org.style.top = wrk.style.top ;
         org.style.left = wrk.style.left ;
      }
      ;
   }
   else
   {
      deltax = _sysx1 + mousex(evt) - _sysx0 - parseInt(win.style.left) ;
      deltay = _sysy1 + mousey(evt) - _sysy0 - parseInt(win.style.top);
      if ((parseInt(win.style.left) + deltax) < 0) win.style.left = 0 ;
      else win.style.left = parseInt(win.style.left) + deltax ;
      if ((parseInt(win.style.top) + deltay) < 0) win.style.top = 0 ;
      else win.style.top = parseInt(win.style.top) + deltay ;
      winf.style.top = win.style.top ;
      winf.style.left = win.style.left ;
      if (wrk.innerHTML=="0")
      {
         org.style.top = win.style.top ;
         org.style.left = win.style.left ;
      }
      ;
      
   }
   ;

}
// 停止拖动;
function stopDrag2(obj,winid1, evt)
{
   evt = evt || window.event;
   if ( ! (evt)) return  false ;
   if( ! (_sysmoveable)) return  false ;
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   obj.style.cursor = "default" ;
   var winmain = _pdoc.getElementById("xMsg2" + winid1 +"_tdmain" );
   $(winmain).css("filter","alpha(opacity=100)").css("-moz-opacity","1") ;
   var wintitle0 = _pdoc.getElementById("xMsg2" + winid1 +"_title0" );
   $(wintitle0).css("filter","").css("-moz-opacity","null") ;
   if (wrk.innerHTML != "2") 
   {
   	 var bgobj1 = _pdoc.getElementById("xMsg2" + winid1 +"bg") ;
   	 if ($(bgobj1).attr("dialog")=="0") 
   	 {
	     $(bgobj1).attr("firstover","1") ;
	     showbackground(bgobj1) ;
	   } ;
   } ;
   obj.releaseCapture();
   _sysmoveable = false;
}

function getFocus2(obj)
{
   _sysindex = _sysindex + 10;
   var idx = _sysindex;
   obj.style.zIndex = idx;
   obj.nextSibling.style.zIndex = idx - 1;
}

// 创建一个对象;
function xWin2(_w_id, _w_l, _w_t, _w_w, _w_h, _w_tit, _w_msg, _w_scroll1, _w_modal,_ldfun,_fun,_clsf,_func1,_func2,_whfixed,_simple)
{
   _sysindex = _sysindex + 500;
   this.simple = isnull(_simple,"") ; // here 2 means simple-style 
   this.id = _w_id;
   this.width = _w_w;
   this.height = _w_h;
   this.left = _w_l;
   this.top = _w_t;
   this.zIndex = _sysindex+13;
   this.title = _w_tit;
   this.fixedall = _whfixed;
   this.message = _w_msg ;
   var thi1 = this.message.indexOf("html:") ;
   if (thi1>=0)
   {
      this.url = this.message.substr(0,thi1);//+"__" ;
      this.message = this.message.substr(thi1+5) ;
   }
   else
   {
      this.url = this.message ;
      this.message = "" ;
   }
   ;
   if (this.url.indexOf("?") > 0)
   this.url = this.url + "&mywinid=" + _w_id ;
   else   this.url = this.url + "?mywinid=" + _w_id ;
   if (_whfixed) this.scroll="no"; else this.scroll = _w_scroll1 ;
   this.modal = _w_modal ;
   this.obj = null;
   this.bulid2 = bulid2;
   this.bulid2();
   var tmpstr = "" ;
   if (_fun)
   {
      tmpstr = "_pobj.gfunc_" + this.id + " = _fun" ;
      eval(tmpstr) ;
   }
   ;
   if (_ldfun)
   {
      tmpstr = "_pobj.gloadfunc_" + this.id + " = _ldfun" ;
      eval(tmpstr) ;
   }
   ;
   if (_clsf)
   {
      tmpstr = "_pobj.gclsfunc_" + this.id + " = _clsf" ;
      eval(tmpstr) ;
   }
   ;
   if (_func1)
   {
      tmpstr = "_pobj."+this.id + "_f1 = _func1" ;
      eval(tmpstr) ;
   }
   ;
   if (_func2)
   {
      tmpstr = "_pobj."+this.id + "_f2 = _func2" ;
      eval(tmpstr) ;
   }
   ;
}
function _runresizefunc(winid1)
{
   try
   {
      _pdoc.frames("xMsg2" + winid1+"_frame").autorunwhileresized();
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
}
function _runloadfunc(winid1)
{
   try
   {
      eval("_pobj.gloadfunc_" + winid1 + "('"+winid1+"')") ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   try
   {
      _pdoc.frames("xMsg2" + winid1+"_frame").autorunwhileloaded();
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
};

function bulid2()
{
   var str = "" ;
   str = str
   + "<iframe " ;
   if (ie6) str = str + " class='FixedWin' " ;
   str += "style='display:block;";
   if ( ! (ie6)) str  += "position:fixed;"
   str += "filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);"
   + " left:" + this.left + "px; "
   + " height:30px;"
   + " width:" + this.width + "px;"
   + " top:" + this.top + "px;' "
   + " id=xMsg2" + this.id + "_frame_bg   frameborder=0 scrolling='no'></iframe>" 
   + "<div id=xMsg2" + this.id + "org "
   + "style='"
   + "position:absolute; "
   + "left:" + this.left + "px;"
   + "top:" + this.top + "px;"
   + "width:" + this.width + "px;"
   + "height:" + this.height + "px;"
   + "display:none;'>s"+this.scroll+"m"+this.modal
   + "</div>"
   + "<div id=xMsg2" + this.id + "wking "
   + "style='"
   + "position:absolute;"
   + "left:" + this.left + "px;"
   + "top:" + this.top + "px;"
   + "width:" + this.width + "px;"
   + "height:" + this.height + "px;"
   + "display:none;'>a"
   + "</div>"
   + "<div id=xMsg2" + this.id + " ";
   if (ie6) str += " class='FixedWin' " ;
   str += "style='  "
   + "z-index:" + this.zIndex + ";"
   + "width:" + this.width + "px;"
   + "height:" + this.height + "px;"
   + "color:" + _sysnormal + ";"
   + "font-size:12px;" ;
   if ( ! (ie6)) str += "position:fixed;"
	   + "left:" + (this.left) + "px;"
	   + "top:" + (this.top) + "px;" ;
   str +="cursor:default;display:none;"
   + "' "
   + "onmousedown='getFocus2(this)'>"
   + "<div id='xMsg2"+this.id+"_title0' "
   + "style='"
   + "width:100%;"
   + "height:28px;"
   + "color:white;"
   + "' "
   + ">"
   + "<table cellspacing=0 cellpadding=0 width='100%' border=0 height='100%'><tr>"
   + "<td  nowrap onmousedown='startDrag2(this,\""+this.id+"\",event)' onmouseup='stopDrag2(this,\""+this.id+"\",event)'"
   + " onmousemove='drag2(this,\""+this.id+"\",event)' class=win_icon"+this.simple+">"
   + "</td>"
   + "<td nowrap valign=middle width=99% onmousedown='startDrag2(this,\""+this.id+"\",event)' "
   + " onmouseup='stopDrag2(this,\""+this.id+"\",event)' onmousemove='drag2(this,\""+this.id+"\",event)'"
   + " class=win_title"+this.simple+"><b><span id=xMsg2" + this.id + "_titlevalue "
   + "style='padding-top:5px;color:#333333;font-size:13px;'>" + this.title + "</span></b></td>" ;
   var minstr = "block" ; maxstr = "block" ;
   if (this.fixedall) {minstr="none"; maxstr="none";} else
   {
   	 if (this.scroll == "tool") maxstr = "none" ;
   };
   str += "<td nowrap id=xMsg2"+this.id+"_bt_min  class=win_min"+this.simple 
   + " style='display:"+minstr+"' onclick='minwin2(\""+this.id+"\")' title='最小化'></td>"
   + "<td nowrap id=xMsg2"+this.id+"_bt_max  class=win_max"+this.simple 
   + " style='display:"+maxstr+"' onclick='maxwin2(\""+this.id+"\")' title='窗口缩放'></td>"
   + "<td nowrap id=xMsg2"+this.id+"_bt_refresh class=win_refresh"+this.simple 
   + " title='刷新' onclick='refreshme2(\""+this.id+"\",\"\")'></td>"
   + "<td nowrap id=xMsg2"+this.id+"_bt_close class=win_close"+this.simple 
   + " title='关闭' onclick='closewin2(\""+this.id+"\",true)'>" ;
   
   if (this.fixedall) str += "<span id=xMsg2"+this.id+"_fixed style='display:none;'></span>" ;
   
   str +="</td>" 
   + "</tr></table></div>"
   + "<div simple=1"+this.simple+" id='xMsg2"+this.id+"_main'  style='"
   + "width:100%;display:none;"
   + "height:" + (this.height - 28) + "px;"
   + "word-break:break-all;"
   + "'>"
   + "<table cellspacing=0 cellpadding=0 width='100%' border=0 height=100% ><tr>"
   + "<td id='xMsg2"+this.id+"_td' class=win_left"+this.simple 
   + " onmousedown='startresize(this,\""+this.id+"\",event)' onmouseup='stopresize(this,\""
   + this.id+"\",event)' onmousemove='resizew(this,\""+this.id
   +"\",event)'></td>"
   +"<td align=left valign=top id='xMsg2"+this.id+"_tdmain' style='background-color:#ffffff'>" ;
   if (this.message!="")
   {
      str +="<div id='xMsg2"+this.id+"_html' style='width:100%;height:"+(this.height - 46) 
      + "px;overflow:auto;'>"+this.message+"</div></td>" ;
   }
   else
   {
      str += "<iframe id='xMsg2"+this.id+"_frame'  marginwidth=0 "
      + "marginheight=0 margin=0 src='"+this.url+"' frameborder=0 width='100%'  "
      +  " onload='javascript:{resizebg2(\""+this.id+"\");_runloadfunc(\""+this.id+"\");_runresizefunc(\""+this.id+"\")}' "
      + " scrolling=" + this.scroll + " height='"+(this.height-46)+"px'></iframe></td>" ;
   }
   ;
   str += "<td id='xMsg2"+this.id+"_td_right' class=win_right"+this.simple
   + " onmousedown='startresize(this,\""+this.id+"\",event)' onmouseup='stopresize(this,\""+this.id+"\",event)' onmousemove='resizee(this,\""+this.id+"\",event)'></td></tr>"
   + "<tr><td id='xMsg2"+this.id+"_td_bl' class=win_leftbottom"+this.simple+" onmousedown='startresize(this,\""+this.id+"\",event)' onmouseup='stopresize(this,\""+this.id+"\",event)' onmousemove='resizesw(this,\""+this.id+"\",event)' ></td>"
   + "<td id='xMsg2"+this.id+"_td_b' class=win_bottom"+this.simple+" onmousedown='startresize(this,\""+this.id+"\",event)' onmouseup='stopresize(this,\""+this.id+"\",event)' onmousemove='resizes(this,\""+this.id+"\",event)'></td>"
   + "<td id='xMsg2"+this.id+"_td_br' class=win_rightbottom"+this.simple+" onmousedown='startresize(this,\""+this.id+"\",event)' onmouseup='stopresize(this,\""+this.id+"\",event)' onmousemove='resizese(this,\""+this.id+"\",event)'></td></tr></table> "
   + "</div>"
   + "</div>" ;
   if (this.modal == "yes")
   {
      str = str 
      + "<div dialog=0 id=xMsg2" + this.id + "bg " 
      + " firstover=0 style='"
      + "width:" + (_dlgw) + "px;"
      + "height:" + (_dlgh) + "px;"
      + "z-index:" + (this.zIndex - 1) + ";"
      + "position:absolute;cursor:wait;display:none;"
      + "left:0px;"
      + "top:0px;"
      + "background-color:#152D57;" //152D57
      + "filter:alpha(opacity=20);-moz-opacity:0.2;"
      + "' onmouseover=hidebackground(this) onmousedown=hidedialogwin(this) onmouseup=showdialogwin(this) onmouseout=showbackground(this)></div>";
   }
   else
   {
      str = str
      + "<div id=xMsg2" + this.id + "bg "
      + " style='"
      + "width:0px;"
      + "height:0px;"
      + "'></div>";
   }
   ;

   $(_pdoc.body).append(str) ;

}
function showdialogwin(bgobj1)
{
	bgobj1.releaseCapture();
	var winid1 = bgobj1.id.substr(5) ;
	winid1 = winid1.substr(0,winid1.length-2) ;
	var winmain = _pdoc.getElementById("xMsg2" + winid1 +"_tdmain" );
  $(winmain).css("filter","alpha(opacity=100)").css("-moz-opacity","1") ;
  //$(winmain).css("filter","").css("-moz-opacity","null") ;
  var wintitle0 = _pdoc.getElementById("xMsg2" + winid1 +"_title0" );
  $(wintitle0).css("filter","").css("-moz-opacity","null") ;
} 
function hidedialogwin(bgobj1,opacity11)
{
	 var opacity12 = _myparseInt(opacity11,2) ;
	 var opacity123 = opacity12 * 1.0000001 / 100.000000 ;
	 bgobj1.setCapture();
	 var winid1 = bgobj1.id.substr(5) ;
	 winid1 = winid1.substr(0,winid1.length-2) ;
   var winmain = _pdoc.getElementById("xMsg2" + winid1 +"_tdmain" );
   var wintitle0 = _pdoc.getElementById("xMsg2" + winid1 +"_title0" );
   $(winmain).css("filter","alpha(opacity="+opacity12+")").css("-moz-opacity",opacity123)  ;
   $(wintitle0).css("filter","alpha(opacity=65)").css("-moz-opacity","0.65") ;	
} ;
function hidebackground(bgobj1,time1)
{
	var time12 = myparseInt(time1,400) ;
	 
		if (flashbackground!=null) 
		{
			flashbackground.stop(true) ;
			flashbackground = null ;
		} ;
		$(bgobj1).stop(true) ;
		flashbackground = $(bgobj1) ;
		$(bgobj1).fadeTo(time12,0.01,function()
		{
			$(bgobj1).stop(true) ;
			flashbackground = null ;
		}) ;
	
} ;
function showbackground(bgobj1)
{
	
		if (flashbackground!=null) 
		{
			flashbackground.stop(true) ;
			flashbackground = null ;
		} ;
		$(bgobj1).stop(true) ;
		//$(bgobj1).fadeTo(1,0.1) ;
		flashbackground = $(bgobj1) ;
		$(bgobj1).fadeTo(1000,0.2,function()
		{
			$(bgobj1).stop(true) ;
			flashbackground = null ;
		}) ;
	
	//$(bgobj1).animate({opacity:'+=1'},800) ;
} ;
function resizebg2(winid1,force1)
{
	 var force2 = false ;
   if (force1) force2 = force1 ; 
   getgloble() ;
   var frameh =  0 ;
   var pTar = null;

   if (_pdoc.getElementById) pTar = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   else eval('pTar = xMsg2' + winid1 + '_frame;');
   if (pTar && ! window.opera)
   {
      pTar.style.display = "block" ;
      if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight)
      {
         frameh = parseInt(pTar.contentDocument.body.offsetHeight) + parseInt(FFextraHeight);
      }
      else if (pTar.Document && pTar.Document.body.scrollHeight)
      {
         frameh = parseInt(pTar.Document.body.scrollHeight);
      }
      ;

   }
   ;

   if (parseInt(frameh) > 0)
   {
      if (parseInt(_clth) <= (parseInt(frameh) + 37)) frameh = parseInt(_clth) - 37 ;

      frameh = parseInt(frameh) + 37 ;
      var org = _pdoc.getElementById("xMsg2" + winid1 + "org") ;
      var wrk = org.nextSibling ;
      var win = wrk.nextSibling ;
      var oldh = parseInt(wrk.style.height) ;
      if (oldh >= parseInt(frameh)) frameh = oldh  ;
      if ((force2==false) && (org.innerHTML.indexOf("sno") < 0)) frameh = oldh ;
      wrk.style.height = frameh ;
      win.style.height = frameh ;
      org.style.height = frameh ;
      pTar.height = parseInt(frameh) - 37 ;

			var oldt = parseInt(wrk.style.top) ;
      if(!ie6) oldt = parseInt(win.style.top) ; 

      var deft = 0 ;
      if ((oldt + parseInt(frameh)) > (_clth)) deft = _clth - parseInt(frameh) -  oldt ;

      if ((wrk.innerHTML == "0") && (deft != 0))
      {
         wrk.style.top = parseInt(wrk.style.top) + deft ;
         org.style.top = parseInt(org.style.top) + deft ;
         win = wrk.nextSibling ;
         if(!ie6) win.style.top = parseInt(org.style.top); // + _scrly ;
      }
      ;
      _runresizefunc(winid1) ;
   }
   ;
}
function refreshme2(winid1, url1)
{
   var win = _pdoc.getElementById("xMsg2" + winid1 );
   var wrk = win.previousSibling;
   if (wrk.innerHTML=="2") return  false  ;//min
   var frm = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   if (!frm) return  false ;
  
   // 以下代码就不再运行了 
   var objid1 = frm.src ;

   var ij1 = objid1.indexOf("rtms=") ;
   var tms = "0" ;
   if (ij1 > 0)
   {
      tms = objid1.substr(ij1 + 5) ;
      objid1 = objid1.substr(0, ij1 - 1) ;
   }
   ;
   if ((url1 == "") || (url1.indexOf("always=") > 0))
   {
      if (objid1.indexOf("about:blank") >= 0)
      {
         frm.src = url1 ;
      }
      else
      {
         if ((objid1 == url1) || (url1 == ""))
         {
         	 // 为了防止有CACHELOADED之类的操作，刷新是再重载页面，而只是运行reload函数,
				   try
				   {
				   	 if (frm.contentDocument) 
				   	 {
				   	 	 $(frm.contentDocument.body).fadeOut("normal") ;
				   	 } else 
				   	 {
				   	 	 $(frm.Document.body).fadeOut("normal") ;
				   	 } ;
				     try
				     {
				     	 _pdoc.frames("xMsg2" + winid1+"_frame").reload();
				     }
					   catch (e)
					   {
					   }
					   finally
					   {
					   }
					   ;	 
				     if (frm.contentDocument) 
				   	 {
				   	 	 $(frm.contentDocument.body).fadeIn("slow") ;
				   	 } else 
				   	 {
				   	 	 $(frm.Document.body).fadeIn("slow") ;
				   	 } ;
				   }
				   catch (e)
				   {
				   }
				   finally
				   {
				   }
				   ;
         }
         else   frm.src = url1 ;
      }
      ;
   }
   else
   {
      if (url1 != objid1) frm.src = url1 ;
      else
      {
         _runloadfunc(winid1) ;
      }
      ;
   }
   ;
}
function autosha(winobj)
{
   var org = winobj.previousSibling.previousSibling ;
   if (org.innerHTML.indexOf("mno") < 0)
   {
      var sha = winobj.nextSibling ;
      getgloble() ;
      if (parseInt(sha.style.height) < parseInt(_dlgh)) sha.style.height = _dlgh ;
      if (parseInt(sha.style.width) < parseInt(_dlgw)) sha.style.width = _dlgw ;
      return  false ;
   }
   ;
}
function __winbackcolor(color1,src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return  false ;
   _winbackcolor(winid1,color1) ;
}
function _winbackcolor(winid1, color1)
{
	 var cl1 = isnull(color1,"#ffffff") ;
   $("#xMsg2"+winid1+"_title0,#xMsg2"+winid1+"_main").css("background-color",cl1) ;
}
function __wintitle(val,src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return  false ;
   _wintitle(winid1,val) ;
}
function _wintitle(winid1, val)
{
   var tit = _pdoc.getElementById("xMsg2" + winid1 + "_titlevalue") ;
   if ( ! (tit)) return  false ;
   tit.innerHTML = val ;
}
function closewin2(winid1,clsfunc1)
{
   var win = _pdoc.getElementById("xMsg2" + winid1) ;
   if ( ! (win)) return  false ;
   $("#xMsg2" + winid1 + "bg").clearQueue().stop(true).attr("firstover","0").hide() ;
   var winframe = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg") ;
   var wrk = win.previousSibling;
   var org = wrk.previousSibling;
   var sha = win.nextSibling ;
   if (wrk.innerHTML == "9") return  false ;
   if (wrk.innerHTML == "0")
   {
      if (ie6)
      {
         org.style.left = wrk.style.left ;
         org.style.top = wrk.style.top ;
      }
      else
      {
         org.style.left = win.style.left ;
         org.style.top  = win.style.top ;
      }
      ;
   }
   ;
   //win.style.display = "none" ;
   //sha.style.display = "none" ;
   //$(win).fadeOut("normal") ;
   //$(sha).fadeOut("normal") ;
   $(win).fadeOut(200) ;//fadeOut("normal") ;
   $(sha).hide() ;//(500) ;//fadeOut("normal") ;
   $(winframe).hide() ;
   wrk.innerHTML = "9" ;
   var frmobj = _pdoc.getElementById("xMsg2" + winid1 + "_frame") ;
   if ((frmobj) && (frmobj.src.indexOf("nocache=") > 0)) frmobj.src = "about:blank" ;
   if (clsfunc1)
   try
   {
      eval("_pobj.gclsfunc_" + winid1 + "('"+winid1+"')") ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   try
   {
      _pdoc.frames("xMsg2" + winid1+"_frame").autorunwhileclosed();
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
}

function normalwin2(winid1)
{
   var win = _pdoc.getElementById("xMsg2" + winid1) ;
   if ( ! (win)) return  false ;
   $("#xMsg2" + winid1 + "bg").clearQueue().stop(true) ;
   var winframe = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg") ;
   var sha = win.nextSibling ;
   var wrk = win.previousSibling;
   var org = wrk.previousSibling ;
   var frm = _pdoc.getElementById("xMsg2" + winid1 + "_main") ;
   
   
   _sysindex = _sysindex + 10 ;
   win.style.zIndex = _sysindex+100  ;
   sha.style.zIndex = _sysindex +90 ;
   
   if (wrk.innerHTML == "0") return  false ;
   
   getgloble() ;
   if (parseInt(org.style.top)>(parseInt(_clth)-parseInt(org.style.height))) org.style.top = parseInt(_clth) - parseInt(org.style.height) ;
   if (parseInt(org.style.left)>(parseInt(_cltw)-parseInt(org.style.width))) org.style.left = parseInt(_cltw) - parseInt(org.style.width) ;
   wrk.style.top = org.style.top ;
   wrk.style.left = org.style.left ;
   win.style.width = org.style.width ;
   win.style.height = org.style.height ;
   winframe.style.width = org.style.width ;
   
   if (!ie6)
   {
      win.style.top = parseInt(org.style.top) ; //+ _scrly;
      win.style.left = parseInt(org.style.left) ; //+ _scrlx ;
      winframe.style.top = parseInt(org.style.top) ; //+ _scrly;
      winframe.style.left = parseInt(org.style.left) ; //+ _scrlx ;
      
   }
   ;
   frm.style.height = parseInt(win.style.height) - 28 - 5 ;

   var tools = org.innerHTML ;
   frm.style.display = "block" ;
   //$(win).fadeIn("normal") ;//.style.display = "block" ;
   //$(sha).fadeIn(800) ;//.style.display = "block" ;
   
   $(win).show() ;
   $(sha).show() ;//fadeIn(500) ;//fadeIn(800) ;//.style.display = "block" ;
   $(winframe).show() ;//show() ;

   var pTar = null;

   if (_pdoc.getElementById) pTar = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   else eval('pTar = xMsg2' + winid1 + '_frame;');
   if (pTar && ! window.opera)
   {
      pTar.height = parseInt(frm.style.height) - 4;
   }
   ;

   var pTar2 = null;
   if (_pdoc.getElementById) pTar2 = _pdoc.getElementById("xMsg2" + winid1 + "_html");
   else eval('pTar2 = xMsg2' + winid1 + '_html;');
   if (pTar2) pTar2.style.height = parseInt(frm.style.height) - 4;


   if (_pdoc.getElementById("xMsg2" + winid1+"_fixed"))
   {
      if (tools.indexOf("mno") >= 0)
      {
      	_pdoc.getElementById("xMsg2" + winid1+"_bt_min").style.display = "none" ;
      }
      ;
      if (tools.indexOf("syes") >= 0)
      {
      	_pdoc.getElementById("xMsg2" + winid1+"_bt_max").style.display = "none" ;
      }
      ;
   }
   else
   {
      if (tools.indexOf("mno") >= 0)
      {
      	 $(_pdoc.getElementById("xMsg2" + winid1+"_bt_min")).show();
      	 //.unbind("click").click(function(){minwin2(winid1)}) ;
      }
      ;
      if (tools.indexOf("syes") >= 0)
      {
      	 if (_isnull($("#xMsg2"+winid1+"_main").attr("simple"),"")=="1")
      	   $("#xMsg2" + winid1+"_bt_max").show().removeClass("win_restore").addClass("win_max");
      	 else  $("#xMsg2" + winid1+"_bt_max").show().removeClass("win_restore2").addClass("win_max2");
      	 //.unbind("click").click(function(){maxwin2(winid1)}) ;
      }
      ;
   }
   ;
   wrk.innerHTML = "0" ;
   // resizebg2(winid1) ;
   autosha(win) ;
   _runresizefunc(winid1) ;
   var frame1 = null ;
   try
   {
      frame1 = _pdoc.frames("xMsg2" + winid1+"_frame") ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   try
   {
      if (frame1) frame1.focus();
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
}
function maxwin2(winid1)
{
   var win = _pdoc.getElementById("xMsg2" + winid1) ;
   if ( ! (win)) return  false ;
   $("#xMsg2" + winid1 + "bg").clearQueue().stop(true) ;
   var winframe = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg") ;
   var wrk = win.previousSibling;
   var org = wrk.previousSibling ;
   var frm = _pdoc.getElementById("xMsg2" + winid1 + "_main") ;
   if (wrk.innerHTML == "1") //max
   {
   	 normalwin2(winid1) ;
   	 return  false ;
   } ;
   if (wrk.innerHTML == "2") //min
   {
   	 normalwin2(winid1) ;
   	 return  false ;
   } ;
   getgloble() ;

   if (ie6)
   {
      org.style.left = parseInt(wrk.style.left); //-_scrlx ;
      org.style.top = parseInt(wrk.style.top); //-_scrly ;
      wrk.style.top = 0 ;
      wrk.style.left = 0 ;
   }
   else
   {
      org.style.left = parseInt(win.style.left); //; -_scrlx ;
      org.style.top = parseInt(win.style.top); //-_scrly ;
      win.style.top = 0 ;
      win.style.left = 0 ;
      winframe.style.top = 0 ;
      winframe.style.left = 0 ;
   }
   ;


   win.style.display = "block" ;
   winframe.style.display = "block" ;

   win.style.height = _clth ;
   win.style.width = _cltw ;
   winframe.style.width = _cltw ;
   
   
   var tools = org.innerHTML ;
   frm.style.display = "block" ;
   frm.style.height = parseInt(win.style.height) - 28 ;

   if (tools.indexOf("mno") >= 0)
   {
   	  $("#xMsg2" + winid1+"_bt_min").show();
   	  //.unbind("click").click(function(){normalwin2(winid1);minwin2(winid1)}) ;
   }
   ;
   if (tools.indexOf("syes") >= 0)
   {
   	if (_isnull($("#xMsg2"+winid1+"_main").attr("simple"),"")=="1")
   	  $("#xMsg2" + winid1+"_bt_max").show().removeClass("win_max").addClass("win_restore");
   	else   $("#xMsg2" + winid1+"_bt_max").show().removeClass("win_max2").addClass("win_restore2");
   	///.unbind("click").click(function(){normalwin2(winid1)}) ;
   }
   ;

   wrk.innerHTML = "1" ;

   var pTar = null;

   if (_pdoc.getElementById) pTar = _pdoc.getElementById("xMsg2" + winid1 + "_frame");
   else eval('pTar = xMsg2' + winid1 + '_frame;');
   if (pTar && ! window.opera)
   {
      pTar.height = parseInt(frm.style.height) - 4;
   }
   ;
   var pTar2 = null;
   if (_pdoc.getElementById) pTar2 = _pdoc.getElementById("xMsg2" + winid1 + "_html");
   else eval('pTar2 = xMsg2' + winid1 + '_html;');
   if (pTar2) pTar2.style.height = parseInt(frm.style.height) - 4;
   autosha(win) ;
   _runresizefunc(winid1) ;
}
function minwin2(winid1)
{
   var tit = _pdoc.getElementById("xMsg2" + winid1 + "_title0") ;
   if ( ! (tit)) return  false ;
   $("#xMsg2" + winid1 + "bg").clearQueue().stop(true).attr("firstover","0").hide() ;
   var winframe = _pdoc.getElementById("xMsg2" + winid1+"_frame_bg") ;
   var win = tit.parentNode ;
   var frm = tit.nextSibling ;
   var wrk = win.previousSibling;
   var sha = win.nextSibling ;
   var org = wrk.previousSibling ;
   if (wrk.innerHTML == "2") return  false ;
   if (wrk.innerHTML == "1") 
   {
   	  normalwin2(winid1) ;
   } ;	  
   if (!ie6)
   {
      org.style.left = parseInt(win.style.left); //-_scrlx ;
      org.style.top = parseInt(win.style.top); //-_scrly ;
      win.style.top = parseInt(win.style.top) + parseInt(win.style.height) - 28 ;
      if ((parseInt(win.style.top))>(parseInt(_clth) + _scrly - 28))
      win.style.top = (parseInt(_clth) + _scrly - 28) ;
      winframe.style.top = (parseInt(_clth) + _scrly - 28) ;
   }
   else
   {
      org.style.left = parseInt(wrk.style.left); //-_scrlx ;
      org.style.top = parseInt(wrk.style.top); //-_scrly ;
      wrk.style.top = parseInt(wrk.style.top) + parseInt(win.style.height) - 28 ;
      if ((parseInt(wrk.style.top))>(parseInt(_clth)  - 28))
      wrk.style.top = (parseInt(_clth)  - 28) ;
   }
   ;
   //frm.style.display = "none" ;
   //sha.style.display = "none" ;
   //$(sha).fadeOut("normal") ;
   $(frm).hide() ;//fadeOut(300) ;
   $(sha).hide() ;//fadeOut(300) ;//fadeOut("normal") ;
   win.style.height = 28 ;
   wrk.innerHTML = "2" ;
   //$(_pdoc.getElementById("xMsg2" + winid1+"_bt_min")).hide() ;
   if (_isnull($("#xMsg2"+winid1+"_main").attr("simple"),"")=="1")
     $("#xMsg2" + winid1+"_bt_max").show().removeClass("win_max").addClass("win_restore") ;
   else   $("#xMsg2" + winid1+"_bt_max").show().removeClass("win_max2").addClass("win_restore2") ;
   //.unbind("click").click(function(){normalwin2(winid1)}) ;
   var titv = _pdoc.getElementById("xMsg2" + winid1 + "_titlevalue") ;
   win.style.width = 130 + parseInt(titv.offsetWidth) ;
   winframe.style.width = 130 + parseInt(titv.offsetWidth) ;
   //_runresizefunc(winid1) ;
}

function _mywin2(x, y, width1, height1, tit1, url1, scroll, modal1, ldfun,rfun,cfun,fun1,fun2,simple1)
{
   //  height1 : ^ Vv = 100 = 70 % width1 : = > < 100 30 %
   var w1 = "" ;
   var h1 = "" ;
   var height11 =   height1 ;
   var width11 =   width1 ;
   var xstyle = "" ;
   // < 居左 > 居右
   var ystyle = "" ;
   // ^ 向向 v 向下
   var wfixed = false ;
   var hfixed = false ;
   var whfixed = false ; // 不允许改变窗口大小
   var whi = -1 ;
   whi = width11.indexOf("<") ;
   if (whi >= 0)
   {
      width11 = width11.substr(0,whi)+width11.substr(whi+1) ;
      xstyle = "left" ;
   }
   ;
   whi = width11.indexOf("==") ;
   if (whi >= 0)
   {
      width11 = width11.substr(0,whi)+width11.substr(whi+2) ;
      whfixed = true ;
   }
   ;

   whi = width11.indexOf("+") ;
   if (whi >= 0)
   {
      width11 = width11.substr(0,whi)+width11.substr(whi+1) ;
      xstyle = "center" ;
   }
   ;
   whi = width11.indexOf("=") ;
   if (whi >= 0)
   {
      width11 = width11.substr(0,whi)+width11.substr(whi+1) ;
      wfixed = true ;
   }
   ;
   whi = width11.indexOf(">") ;
   if (whi >= 0)
   {
      width11 = width11.substr(0,whi)+width11.substr(whi+1) ;
      xstyle = "right" ;
   }
   ;
   whi = height11.indexOf("==") ;
   if (whi >= 0)
   {
      height11 = height11.substr(0,whi)+height11.substr(whi+2) ;
      whfixed = true ;
   }
   ;
   whi = height11.indexOf("^") ;
   if (whi >= 0)
   {
      height11 = height11.substr(0,whi)+height11.substr(whi+1) ;
      ystyle = "top" ;
   }
   ;
   whi = height11.indexOf("+") ;
   if (whi >= 0)
   {
      height11 = height11.substr(0,whi)+height11.substr(whi+1) ;
      ystyle = "middle" ;
   }
   ;
   whi = height11.indexOf("=") ;
   if (whi >= 0)
   {
      height11 = height11.substr(0,whi)+height11.substr(whi+1) ;
      hfixed = true ;
   }
   ;
   whi = height11.indexOf("v") ;
   if (whi >= 0)
   {
      height11 = height11.substr(0,whi)+height11.substr(whi+1) ;
      ystyle = "bottom" ;
   }
   ;
   whi = height11.indexOf("V") ;
   if (whi >= 0)
   {
      height11 = height11.substr(0,whi)+height11.substr(whi+1) ;
      ystyle = "bottom" ;
   }
   ;
   getgloble();
   if (width11 != "0")
   {
      if (width11.indexOf("%") >= 0)
      {
         s2 = width11.replace("%", "");
         w1 = (_cltw * s2 / 100) ;
      }
      else w1 = parseInt(width11) ;
   }
   else w1 = (_cltw * 80 / 100) ;
   if (height11 != "0")
   {
      if (height11.indexOf("%") >= 0)
      {
         s2 = height11.replace("%", "");
         h1 = (_clth * parseInt(s2) / 100) ;
      }
      else h1 = parseInt(height11) ;
   }
   else h1 = (_clth * 70 / 100) ;

   if ((parseInt(h1)) > (_clth - 30))	h1 = _clth - 30 ;
   if ((parseInt(x) + parseInt(y)) == 0)
   {
      x = (_cltw - w1) / 2 ;
      y = (_clth - h1) / 2 - 3 ;
      if (x < 0) x = 0 ;
      if (y < 0) y = 0 ;
   }
   ;

   // 找一个最适合的位置
   if ((parseInt(x) + parseInt(w1)) > parseInt(_cltw - 5))
   {
      if (x > w1) x = x - w1 ;
      else x = 0 ;
   }
   ;
   if ((parseInt(y) + parseInt(h1)) > (parseInt(_clth - 10)))
   {
      if (y > h1) y = y - h1 ;
      else y = 0 ;
   }
   ;
   if (xstyle == "left") x = 0 ;
   if (xstyle == "right") x = _cltw - w1 ;
   if (xstyle == "center") x = (_cltw - w1) / 2 ;
   if (ystyle == "top") y = 0 ;
   if (ystyle == "bottom") y = _clth - h1 ;
   if (ystyle == "middle") y = (_clth - h1) / 2 ;


   var scroll123 = scroll ;
   if (whfixed) scroll123 = "no" ;

   if ( ! (_pobj.winurls)) _pobj.winurls = "" ;

   var url1_ = url1 ;
   var thi1 = url1_.indexOf("html:") ;
   var mess1 = "" ;
   if (thi1>=0)
   {
      mess1 = url1_.substr(thi1+5) ;
      url1_ = url1_.substr(0,thi1);//+"__" ;
   }
   ;
   var winindex = url1_.indexOf("nocache=") ;

   if (winindex > 0) url1_ = url1_.substr(0, winindex - 1) ;

   url1_ = _urlnohttpnopath(url1_) ;
   
   winindex = _pobj.winurls.indexOf(url1_) ;
   if (winindex < 0) _pobj.winurls = _pobj.winurls + ";;" + url1_ + ";;" ;
   winindex = _pobj.winurls.indexOf(url1_) ;

   var winid = "_w" + winindex + "w2_" ;
   var winobj12 = _pdoc.getElementById("xMsg2" + winid) ;
   if (winobj12)
   {

      var winsha = winobj12.nextSibling ;
      _sysindex = _sysindex + 500 ;
      winobj12.style.zIndex = _sysindex+13  ;
      winsha.style.zIndex = _sysindex  + 12 ;

      //////////
      if (mess1!="") _pdoc.getElementById("xMsg2" + winid + "_html").innerHTML = "" ;
      var wrk = winobj12.previousSibling;
      var org = wrk.previousSibling;
      if (wfixed)
      {
         winobj12.style.width = parseInt(w1) ;
         wrk.style.width = winobj12.style.width ;
         org.style.width = winobj12.style.width ;
         if (ie6)
         {
            wrk.style.left = parseInt(x) ;
            org.style.left = wrk.style.left ;
         }
         else
         {
            winobj12.style.left = parseInt(x) ;
            org.style.left = winobj12.style.left ;
         }
         ;
      }
      ;
      if (hfixed)
      {
         winobj12.style.height = parseInt(h1) ;
         wrk.style.height = winobj12.style.height ;
         org.style.height = winobj12.style.height ;
         if (ie6)
         {
            wrk.style.top = parseInt(y) ;
            org.style.top = wrk.style.top ;
         }
         else
         {
            winobj12.style.top = parseInt(y) ;
            org.style.top = winobj12.style.top ;
         }
         ;
      }
      ;
      normalwin2(winid) ;
      url1_ = url1 ;
      if (url1_.indexOf("?") > 0)
      url1_  = url1_ + "&mywinid=" + winid ;
      else   url1_  = url1_ + "?mywinid=" + winid ;

      _pdoc.getElementById("xMsg2" + winid + "_titlevalue").innerHTML = tit1 ;
      if (mess1!="") _pdoc.getElementById("xMsg2" + winid + "_html").innerHTML = mess1 ;
      var tmpstr= "";
      if (rfun)
      {
         tmpstr = "_pobj.gfunc_" + winid + " = rfun" ;
         eval(tmpstr) ;
      }
      ;
      if (ldfun)
      {
         tmpstr = "_pobj.gloadfunc_" + winid + " = ldfun" ;
         eval(tmpstr) ;
      }
      ;
      if (cfun)
      {
         tmpstr = "_pobj.gclsfunc_" + winid + " = cfun" ;
         eval(tmpstr) ;
      }
      ;
      if (fun1)
      {
         tmpstr = "_pobj."+winid + "_f1 = fun1" ;
         eval(tmpstr) ;
      }
      ;
      if (fun2)
      {
         tmpstr = "_pobj."+winid + "_f2 = fun2" ;
         eval(tmpstr) ;
      }
      ;
      refreshme2(winid, url1_) ;
      //_runloadfunc(winid) ;
      _runresizefunc(winid) ;
   }
   else
   {
      var tam = new xWin2(winid, parseInt(x), parseInt(y), parseInt(w1), parseInt(h1), tit1, url1, scroll123, modal1, ldfun,rfun,cfun,fun1,fun2,whfixed,simple1) ;
      normalwin2(winid) ;
      autosha(_pdoc.getElementById("xMsg2" + winid)) ;
   }
   ;
   return "xMsg2" + winid ;
}


function __winfocus(src1)
{
   var winid1 = _QueryParams("mywinid",src1) ;
   winid1 = _isnull(winid1) ;
   if (winid1 == "") return  false ;
   var winobj12 = _pdoc.getElementById("xMsg2" + winid1) ;
   if (!winobj12) return  false ;
   //if ((winobj12.style.zIndex==_sysindex)) return  false ;
   var winsha = winobj12.nextSibling ;
   _sysindex = _sysindex + 10 ;
   winobj12.style.zIndex = _sysindex  ;
   winsha.style.zIndex = _sysindex - 1 ;
}
function _showmywin(url1)
{
	 var winindex = _myparseInt(url1,0) ; 
	 if (winindex<=0) 
	 {
		 if ( ! (_pobj.winurls)) _pobj.winurls = "" ;
	   var url1_ = url1 ;
	   var thi1 = url1_.indexOf("html:") ;
	   if (thi1>=0)
	   {
	      url1_ = url1_.substr(0,thi1);//+"__" ;
	   }
	   ;
	   winindex = url1_.indexOf("nocache=") ;
	   if (winindex > 0) url1_ = url1_.substr(0, winindex - 1) ;
	   url1_ = _urlnohttpnopath(url1_) ;
	   winindex = _pobj.winurls.indexOf(url1_) ;
	 } ;
   if (winindex < 0) return  false ;
   var winid = "_w" + winindex + "w2_" ;
   normalwin2(winid) ;
} ;
function _hidemywin(url1)
{
	 var winindex = _myparseInt(url1,0) ;
	 if (winindex<=0) 
	 {
	   if ( ! (_pobj.winurls)) _pobj.winurls = "" ;
	   var url1_ = url1 ;
	   var thi1 = url1_.indexOf("html:") ;
	   if (thi1>=0)
	   {
	      url1_ = url1_.substr(0,thi1);//+"__" ;
	   }
	   ;
	   winindex = url1_.indexOf("nocache=") ;
	   if (winindex > 0) url1_ = url1_.substr(0, winindex - 1) ;
	   url1_ = _urlnohttpnopath(url1_) ;
	   winindex = _pobj.winurls.indexOf(url1_) ;
	 } ;
   if (winindex < 0) return  false ;
   var winid = "_w" + winindex + "w2_" ;
   if (_pdoc.getElementById("xMsg2" + winid + "_html")) _pdoc.getElementById("xMsg2" + winid + "_html").innerHTML = "" ;
   closewin2(winid,false) ;
}
function _minmywin(url1)
{
	 var winindex = _myparseInt(url1,0) ;
	 if (winindex<=0) 
	 {
	   if ( ! (_pobj.winurls)) _pobj.winurls = "" ;
	   var url1_ = url1 ;
	   var thi1 = url1_.indexOf("html:") ;
	   if (thi1>=0)
	   {
	      url1_ = url1_.substr(0,thi1);//+"__" ;
	   }
	   ;
	   winindex = url1_.indexOf("nocache=") ;
	   if (winindex > 0) url1_ = url1_.substr(0, winindex - 1) ;
	   url1_ = _urlnohttpnopath(url1_) ;
	   winindex = _pobj.winurls.indexOf(url1_) ;
	 } ;
   if (winindex < 0) return  false ;
   var winid = "_w" + winindex + "w2_" ;
   minwin2(winid) ;
}
function _toolwin(_w_w, _w_h, url1, title1,_lfun,_cfun,_fun1,_fun2,_simple)
{
   _mywin2(mousex(null), mousey(null), _w_w, _w_h, _tostr(title1), url1, "tool", "no", _lfun,null,_cfun,_fun1,_fun2,_simple);
}

function _popwin(_w_w, _w_h, url1, title1,_lfun,_cfun,_fun1,_fun2,_simple)
{
   _mywin2(mousex(null), mousey(null), _w_w, _w_h, _tostr(title1), url1, "yes", "no", _lfun,null,_cfun,_fun1,_fun2,_simple);
}

function _popwin2(_w_w, _w_h, url1, title1,_lfun,_cfun,_fun1,_fun2,_simple)
{
   _mywin2(mousex(null), mousey(null), _w_w, _w_h, _tostr(title1), url1, "no", "no", _lfun,null,_cfun,_fun1,_fun2,_simple);
}
function _dialog(_w_w, _w_h, url1, title1, _lfun,rfun,_cfun,_fun1,_fun2,_simple)
{
   _mywin2(mousex(null), mousey(null), _w_w, _w_h, _tostr(title1), url1, "yes", "yes", _lfun,rfun,_cfun,_fun1,_fun2,_simple);
}

function _dialog2(_w_w, _w_h, url1, title1, _lfun,rfun,_cfun,_fun1,_fun2,_simple)
{
   _mywin2(mousex(null), mousey(null), _w_w, _w_h, _tostr(title1), url1, "no", "yes", _lfun,rfun,_cfun,_fun1,_fun2,_simple);
}

function _dyniframesize(pobj11,iframename)
{
   if (!pobj11) return 0 ;
   var pdoc11 = pobj11.document ;
   var pTar = null;
   var defalth1 = 0 ;
   try
   {
      if (pdoc11.getElementById(iframename))
      {
      	 
         try
         {
            if (pdoc11.getElementById)
            {
               pTar = pdoc11.getElementById(iframename);
            }
            else
            {
               eval('pTar = pobj11.' + iframename + ';');
            }
            ;
            defalth1 = _isnull($(pTar).attr("defaultheight"),"0") ;
            defalth1 = defalth1.toLowerCase().replace("px","") ;
            defalth1 = _myparseInt(defalth1,0) ;
            var ht1 = 0 ;
            if (pTar && !window.opera)
            {
               pTar.style.display="block" ;
               
               if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight)
               {
                  //ns6 syntax
                  ht1 = pTar.contentDocument.body.offsetHeight+FFextraHeight  ;
               }
               else if (pTar.Document && pTar.Document.body.scrollHeight)
               {
                  //ie5+ syntax
                  ht1 = pTar.Document.body.scrollHeight  ;
               }
               ;
               if (defalth1)
               {
               	  if ((defalth1>20) && (defalth1>ht1)) ht1 = defalth1 ;
               } ;
               pTar.height = ht1  ;
               return pTar.height  ;
            }
            ;
         }
         catch (e)
         {
         }
         finally
         {
         }
         ;
      }
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
}

// 以上与WINDOW有关的


// 以下是与TABLE有关的
function _getpagestrs(num__,maxnum__,rect__,tbname,aspxn,tburl,pagesize,tbfldfunc,afterloadfc,currpagei,tbsndkey1)
{
   var tbv = "pobj3 = _"+aspxn+"_"+tbname+"_pobj" ; eval(tbv) ;  
   var num__old = num__ ;
   var pstr__=[];
   var plen__=9;
   pstr__[0]=1;
   var drct1 = rect__ ;
   if (num__<=plen__) drct1 = false ;
   if ((maxnum__-plen__)<=1)
   {
      plen__=maxnum__;
      for (var i=1; i<plen__; i++)
      {
         pstr__.push(i+1);
      }
      ;
   }
   else
   {
      if (!drct1)//
      {
         if ((num__-plen__)>2)
         {
            pstr__[1]=-1;
         }
         else if ((num__-plen__)==2)
         {
            plen__ += 1;
         }
         else
         {
            plen__ += 1; num__=plen__+1;
         }
         ;
         for (var i=1; i<=plen__; i++)
         {
            pstr__.push(num__+i-plen__);
         }
         ;
         pstr__.push(-2);
         pstr__.push(maxnum__);
      }
      else
      {
         pstr__[1]=-1;
         if ((maxnum__-num__-plen__)<1)
         {
            plen__ +=1; num__=maxnum__-plen__;
         }
         else if ((maxnum__-num__-plen__)==1) plen__ +=1;
         for (var i=0; i<plen__; i++)
         {
            pstr__.push(num__+i);
         }
         ;
         if ((maxnum__-num__-plen__)>1) pstr__.push(-2);
         pstr__.push(maxnum__);
      }
      ;
   }
   ;  
   var pstr2__ = [] ;
   for (var i=0; i<pstr__.length; i++)
   {
      if (pstr__[i]==currpagei)
      {
         pstr2__[i] = "<span class='fontalternate f15 tabletitle' style='border-left:1px solid #ff8800;border-bottom:1px solid #ff8800;border-top:1px solid #ff8800;border-right:1px solid #ff8800;'>&nbsp;<b>"+
         pstr__[i]+"</b>&nbsp;</span>" ;
      }
      else
      if (pstr__[i]==1)
      {
         pstr2__[i] = "<span id="+tbname+"_pglink_"+pstr__[i]+" onclick='_pobj2._getpagestrs(1,"+maxnum__+",false,\""+tbname+"\",\""+
         aspxn+"\",\""+tburl+"\","+pagesize+","+tbfldfunc+","+afterloadfc+",1,\""+tbsndkey1+"\"); _pobj2._tablenextpage(\""+aspxn+"\",\""+tburl+"\","+
         tbfldfunc+",\""+tbname+"\","+pagesize+","+pstr__[i]+","+
         afterloadfc+",\""+tbsndkey1+"\")' style='cursor:hand' title='第一页'>[1]</span>" ;
      }
      else
      if (pstr__[i]==maxnum__)
      {
         pstr2__[i] = "<span id="+tbname+"_pglink_"+pstr__[i]+" onclick='_pobj2._getpagestrs("+
         maxnum__+","+maxnum__+",true,\""+tbname+"\",\""+
         aspxn+"\",\""+tburl+"\","+pagesize+","+tbfldfunc+","+afterloadfc+","+maxnum__+",\""+tbsndkey1+"\"); _pobj2._tablenextpage(\""+aspxn+"\",\""+tburl+"\","+
         tbfldfunc+",\""+tbname+"\","+pagesize+","+pstr__[i]+","+
         afterloadfc+",\""+tbsndkey1+"\")' style='cursor:hand' title='最后一页'>["+maxnum__+"]</span>" ;
			}
      else
      if (pstr__[i]==-1)
      {
         pstr2__[i] = "<span  onclick='_pobj2._getpagestrs("+
         (parseInt(pstr__[i+1])-1)+","+maxnum__+",false,\""+tbname+"\",\""+
         aspxn+"\",\""+tburl+"\","+pagesize+","+tbfldfunc+","+afterloadfc+","+currpagei+",\""+tbsndkey1+"\")' style='cursor:hand' title='前"+plen__+"页'>...</span>" ;
      }
      else
      if (pstr__[i]==-2)
      {
         pstr2__[i] = "<span  onclick='_pobj2._getpagestrs("+
         (parseInt(pstr__[i-1])+1)+","+maxnum__+",true,\""+tbname+"\",\""+
         aspxn+"\",\""+tburl+"\","+pagesize+","+tbfldfunc+","+afterloadfc+","+currpagei+",\""+tbsndkey1+"\")' style='cursor:hand' title='后"+plen__+"页'>...</span>" ;
      }
      else
      {
         pstr2__[i] = "<span id="+tbname+"_pglink_"+pstr__[i]+" onclick='_pobj2._getpagestrs("+
         num__old+","+maxnum__+","+drct1+",\""+tbname+"\",\""+
         aspxn+"\",\""+tburl+"\","+pagesize+","+tbfldfunc+","+afterloadfc+","+pstr__[i]+",\""+tbsndkey1+"\"); _pobj2._tablenextpage(\""+aspxn+"\",\""+tburl+"\","+
         tbfldfunc+",\""+tbname+"\","+pagesize+","+pstr__[i]+","+
         afterloadfc+",\""+tbsndkey1+"\")' style='cursor:hand'>["+pstr__[i]+"]</span>" ;
      }
      ;
   }
//alert(tbname+"  "+pstr2__.join("&nbsp;")) ;
   var prev1 = "" ;
   var next1 = "" ;
   if (currpagei>1) prev1 = "<span id="+tbname+"_pglink_"+(currpagei-1)+" onclick='_pobj2._getpagestrs("+
         num__old+","+maxnum__+","+drct1+",\""+tbname+"\",\""+
         aspxn+"\",\""+tburl+"\","+pagesize+","+tbfldfunc+","+afterloadfc+","+(currpagei-1)+",\""+tbsndkey1+"\"); _pobj2._tablenextpage(\""+aspxn+"\",\""+tburl+"\","+
         tbfldfunc+",\""+tbname+"\","+pagesize+","+(currpagei-1)+","+
         afterloadfc+",\""+tbsndkey1+"\")' style='cursor:hand' title='上一页'>上一页</span>&nbsp;" ;
         
   if (currpagei<maxnum__) next1="&nbsp;<span id="+tbname+"_pglink_"+(currpagei+1)+" onclick='_pobj2._getpagestrs("+
         num__old+","+maxnum__+","+drct1+",\""+tbname+"\",\""+
         aspxn+"\",\""+tburl+"\","+pagesize+","+tbfldfunc+","+afterloadfc+","+(currpagei+1)+",\""+tbsndkey1+"\"); _pobj2._tablenextpage(\""+aspxn+"\",\""+tburl+"\","+
         tbfldfunc+",\""+tbname+"\","+pagesize+","+(currpagei+1)+","+
         afterloadfc+",\""+tbsndkey1+"\")' style='cursor:hand' title='下一页'>下一页</span>" ;
   pobj3.$("#"+tbname+"_pageinfo,#"+tbname+"_pageinfo2").html(prev1+pstr2__.join("&nbsp;")+next1).show() ;
}

function _tablenextpage(aspxn,sqlnameandparam1, tbfldfunc, tbname, pagesize,pageindex,afterloadfc,tbsndkey1)
{
	 var qry1 = "0" ;
	 if (pageindex==1) qry1 = "1" ;
	 
	 var tbv = "pobj3 = _"+aspxn+"_"+tbname+"_pobj" ; eval(tbv) ;
	 eval("pobj3."+tbname+"_pageindex="+pageindex) ;
	 
	 pobj3.currenttableid = tbname ;
	 
   _loading(true) ;
   try
   {
      pobj3.beforeloadnextpage(tbname,pageindex) ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   var sql1 = sqlnameandparam1.replaceAll("{pageindex}",pageindex) ;
   sql1 = sql1.replaceAll("{pagesize}",pagesize) ;
   sql1 = sql1.replaceAll("{qry}",qry1) ;
   var sqli1 = 0 ;
   sqli1 = sql1.indexOf("&cache=") ;
   if (sqli1<0) sqli1 = sql1.indexOf("&publiccache=") ;
   if (sqli1>=0)  sql1 = sql1.substr(0,sqli1)+"&pagesize="+pagesize+"&pageindex="+pageindex+"&qry="+qry1+sql1.substr(sqli1) ;
   else sql1 = sql1+"&pagesize="+pagesize+"&pageindex="+pageindex+"&qry="+qry1 ;
   _runsql4xml(pobj3,sql1,"",
   function(iseof,data1,dsname1)
   {
   	 if (iseof)
   	 {
   	 	 if (!dsname1) 
   	 	 {
   	 	 	 if (afterloadfc) afterloadfc(pageindex,data1) ;
   	 	 	 _loading(false);
   	 	 } ;	 
   	 	 if (pageindex==1) 
   	 	 {
   	 	 	 if ((dsname1=="ds11") && (data1)) 
   	 	 	   _set_tabledetails(aspxn,$(data1), tbfldfunc, tbname,pagesize, pageindex,"",false,tbsndkey1) ;
   	 	 } else
   	 	 {	
   	 	   if ((dsname1=="ds1") && (data1)) 
   	 	 	   _set_tabledetails(aspxn,$(data1), tbfldfunc, tbname,pagesize, pageindex,"",false,tbsndkey1) ;
   	 	 } ;	   
   	 } ;	
   })
   ;
}

function _mytablecacheremove(pobj3,sqlnameandparam1)
{
   var sql1 = _patchaspxnoid(sqlnameandparam1) ;
   var sqli1 = 0 ;
   
   sql1 = sql1.toLowerCase() ;
   sqli1 = sql1.lastIndexOf("/") ;
   if (sqli1>=0) sql1 = sql1.substr(sqli1+1) ;
   
   for (sqli1=_pobj.dataseturllogs.length-1 ; sqli1>=0 ; sqli1 --)
   	{
   		if (_pobj.dataseturllogs[sqli1].indexOf(sql1)==0)
   		{
        eval("_sys_ca_urldataset_"+sqli1+"=null") ;
				_pobj.dataseturllogs[sqli1]="" ;//.splice(sqli1,1) ; 
   		} ;
    };	
   
    for (sqli1=pobj3.dataseturllogs.length-1 ; sqli1>=0 ; sqli1 --)
   	{
   		if (pobj3.dataseturllogs[sqli1].indexOf(sql1)==0)
   		{
        eval("pobj3._sys_ca_urldataset_"+sqli1+"=null") ;
				pobj3.dataseturllogs[sqli1]="" ;//.splice(sqli1,1) ; 
   		} ;
    };

}
function _$value(pobj001,$obj1, val1,editable1)
{
	 if ($obj1.length<=0) return  false ;
	 var edit1 = isnull(editable1,"") ;
   var val2 = "",tag1="",type1="",val3="" ;
   
   var fmt = "" ;
   
   $obj1.each(function()
   {
   	  tag1 = this.tagName ;
   	  if ((tag1=="INPUT") || (tag1=="SELECT") || (tag1=="TEXTAREA"))
   	  {
   	  	if (tag1=="INPUT") type1 = this.type.toLowerCase() ; else type1 = "";
   	  	if ((type1=="checkbox") || (type1=="radio"))
   	  	{
   	  		val3 = _isnull(pobj001.$(this).attr("value"),"") ;
   	  		if ((val3=="") || (val3=="on"))
   	  		{
   	  			this.checked = val1=="0" ;
   	  		} else 
   	  		{
   	  			this.checked = val3 == val1 ;
   	  		} ;
   	  	} else 
	      try
	      {
	      	 if (tag1=="SELECT") 
	      	 {
	      	 	val3 = "_"+val1 ;
	      	 	val3 = val3.replace(".0000","") ;
	      	 	val3 = val3.replace(".000","") ;
	      	 	val3 = val3.replace(".00","") ;
	      	 	val3 = val3.replace(".0","") ;
	      	 	val3 = val3.substr(1) ;
	      	 	var hasval01 = false ;
		      	for (var io1 = 0 ; io1 < this.options.length ; io1 ++) 
		      	{
		      	 	  if (this.options[io1].value == val3) 
		      	 	  {
		      	 	  	this.options[io1].selected = true ;
		      	 	  	hasval01 = true; 
		      	 	  } else this.options[io1].selected = false ;
		      	} ;
		      	if (!hasval01) 
		      	{
		      		 if (val3!="") 
		      		 {
							   var oOption = pobj001.document.createElement("OPTION");
							   this.options.add(oOption);
							   oOption.innerText = val3;
							   oOption.value = val3;
							   oOption.selected = true ;
							 } ;  
		      	} ;
	      	 } else
	      	 {
	      	 	 fmt = _isnull(pobj001.$(this).attr("fmt"),"") ;
	      	 	 val3 = val1 ;
	      	 	 if (val3==NaN) val3 = "0" ;
	      	 	 if (fmt=="") val3 = val1  ; else
	      	 	 if ((fmt=="money") || (fmt=="money0")) val3 = _fmtfloat(val1,"#.##") ;else
	      	 	 if (fmt.substr(0,1)=="#") val3 = _fmtfloat(val1,fmt) ;else 
	           val3 = _fmtdate(val1,fmt) ;
	      	 	 $(this).val(val3) ;
	      	 } ;
	      	 
	      	 pobj001.$(this).attr("orgvalue",val3); 
	      }
	      catch (e)
	      {
	      }
	      finally
	      {
	      }
	      ;
	      if (edit1=="0") $(this).attr("modified","0") ;
      } else
      if (tag1=="IMG")
      {
      	this.src = val1 ;
      } else
      {	
      	if (val1 == "") val2 = "&nbsp;" ;
	      else val2 = val1 ;
      	fmt = _isnull(pobj001.$(this).attr("fmt"),"") ;
      	if (fmt!="")
      	{
	        if ((fmt=="money") || (fmt=="money0")) val2 = "<font color='#a8a8a8'>￥</font>"+_fmtfloat(val2,"#,##") ;else
	        if (fmt.substr(0,1)=="#") val2 = _fmtfloat(val1,fmt) ; else 
	        if (fmt.indexOf("39codenolabel")==0) 
	        {
	        	_get39code(pobj001,pobj001.$(this),val1,"",fmt.substr(13)) ;
	        } else
	        if (fmt.indexOf("39codelabel")==0) 
	        {
	        	_get39code(pobj001,pobj001.$(this),val1,val1,fmt.substr(11)) ;
	        }  else val2 = _fmtdate(val2,fmt) ;
	      } ;
	      if (fmt.indexOf("39code")!=0)
	        try {pobj001.$(this).html(val2);} catch (e) {} finally {} ;
      };
   }
   ) ;
};
function _arearefresh(pobj001,$objs,url1,fldv,assignf,aftld)
{
	var fldn1 = "" ;
	var fldv1 = "" ;
	var ii = 0 ;
	_runsql4xml(pobj001,url1,'',
	function(iseof1,data11,dsname11)
	{
		if (!iseof1)
		{
			for (ii=0;ii<pobj001.$flds.length;ii++)
			{
				fldn1 = pobj001.$flds[ii] ;
				if (fldn1=="order") continue ;
				fldv1 = pobj001.$f[ii] ;
				if (fldv) fldv1 = fldv(fldn1,fldv1) ;
				if (assignf)
				{
					pobj001.$("*[name="+fldn1+"]",$objs).each(
					function()
					{assignf(this,fldn1,fldv1)}) ;
				} else
				{
					_$value(pobj001,pobj001.$("*[name="+fldn1+"]",$objs), fldv1) ;
				} ;	
			} ;
		} else
		{
			if (!dsname11) 
			{
				if (aftld) aftld() ;
				try
			   {
			     pobj001.needautoframeheight()  ;
			   }
			   catch (e)
			   {
			   }
			   finally
			   {
			   }
			   ;
			} ;
		} ;
	}) ;
}
function _getdnfilename(pobj001,$ff)
{
  return "/sys/dn.aspx?id="+$ff[pobj001._da_id];  
};
function _getattach(pobj001,$ds1,canedit1)
{
	var iii = 1 ;
	var attachstr  = "" ;
	if (!$ds1) return "" ;
  $ds1.each(function()
  {
    _parseRow(pobj001,this) ;
    if (pobj001.$f[pobj001._da_id]!="-1")
    {
    	
    	if (attachstr !="") attachstr +=  "<span id=da_"+pobj001.$f[pobj001._da_id]+"><br>" ;
    	else attachstr +=  "<span id=da_"+pobj001.$f[pobj001._da_id]+">" ;
			attachstr += ""+iii ;
			attachstr += "、" ;
			attachstr += pobj001.$f[pobj001._da_filename] ;
			if (pobj001.$f[pobj001._da_status]=="上传...") 
			attachstr += "<span class=fontalternate>(上传中)</span>";
			attachstr += "&nbsp;&nbsp;";
			attachstr += _cvtfilesize(pobj001.$f[pobj001._da_size]);
			attachstr += "&nbsp;&nbsp;";
			attachstr += "<span class=hidewhenprint><a href=javascript:g0() onclick=popwin('80%','88%','/sys/view.aspx?nocache=1&id=";
			attachstr += pobj001.$f[pobj001._da_id];
			attachstr += "','";
			attachstr +=_tohex(pobj001.$f[pobj001._da_filename]);
			attachstr +="')>[查看]</a>&nbsp;&nbsp;" ;
			//attachstr += "<a href='/sys/dn.aspx?id=";
			//attachstr += pobj001.$f[pobj001._da_id];
			attachstr += "<a href='"+_getdnfilename(pobj001,pobj001.$f);
			attachstr += "'>[下载]</a>" ;
			if (canedit1) attachstr += "&nbsp;&nbsp;<a href=javascript:g0() "+
			"onclick=removeattach("+pobj001.$f[pobj001._da_id]+",'"+
			_tohex(pobj001.$f[pobj001._da_filename])+"') title='删除附件'>[删]</a>" ;
			attachstr += "</span></span>" ;
			iii++ ;
    } ;
  }) ;
  return attachstr ;
} ;
function _parsetablefmt(pobj3,tbname,tbsndkey1)
{
		 
		 var tbobj = pobj3.$("#" + tbname) ;
	 	 var dtobj = pobj3.$("tbody[name=details]:first",tbobj) ;
	 	 var ftobj = pobj3.$("tbody[name=foot]:last",tbobj) ;
	 	 if (ftobj.length>0) ftobj[0].id = "_"+tbname+"_foot_" ;
   	 var dtobjhtml1 = _isnull(dtobj.html(),"") ;
   	 var dtobjhtml2 = "" ;
   	 
   	 if (dtobjhtml1.length<=20) 
   	 {
   	 	 alert("无正确的显示格式，请重新刷新") ;
   	 	 return -1 ;
   	 } else
   	 {
   	 	 pobj3.$(":hidden",dtobj).remove() ;
   	 	 pobj3.$("input,select,textarea",dtobj).remove() ;
   	 	 pobj3.$("*[removeinxls=0]",dtobj).remove() ;
   	 	 dtobjhtml2 = _isnull(dtobj.html(),"") ;
   	 	 dtobj.html(dtobjhtml1) ;
   	 } ;
   	 _table_format.push(pobj3.pagefilename+"."+tbname+"."+tbsndkey1) ;
		 var fmtindex2 = _table_format.length - 1 ;
   	 
   	 var i01 = dtobjhtml1.indexOf("{order}") ;
   	 if (i01>=0) _table_format.push(0) ; else _table_format.push(1) ;
   	 	
   	 i01 = dtobjhtml1.indexOf("{ordera}") ;
   	 if (i01>=0) _table_format.push(0) ; else _table_format.push(1) ;
   	 	
   	 i01 = dtobjhtml1.indexOf("editable") ;
   	 if (i01>=0) _table_format.push(0) ; else _table_format.push(1) ;
     var _editcolindex = 0 ;
     var dtobjhtml = "" ;
     while (i01>=0)
     {
         _editcolindex ++ ;
         dtobjhtml += dtobjhtml1.substr(0,i01)+" rowij={__rowi__}_"+_editcolindex+
         " rowi={__rowi__} coli="+ _editcolindex + " edit" ;
         dtobjhtml1 = dtobjhtml1.substr(i01+8) ;
         i01 = dtobjhtml1.indexOf("editable") ;
     };
     dtobjhtml += dtobjhtml1 ;
     _tablefmt1 = new Array() ;
     _tmparr1 = new Array() ;
     
   	 while (dtobjhtml!="")
   	 {
   	 	 i01 = dtobjhtml.indexOf("{") ;
   	 	 if (i01>=0) 
   	 	 {
   	 	 	 _tablefmt1.push(dtobjhtml.substr(0,i01)) ;
   	 	 	 dtobjhtml = dtobjhtml.substr(i01) ;
   	 	 	 i01 = dtobjhtml.indexOf("}") ;
   	 	 	 if (i01>=0)
   	 	 	 {
   	 	 	 	 _tablefmt1.push(dtobjhtml.substr(0,i01+1)) ;
   	 	 	 	 dtobjhtml = dtobjhtml.substr(i01+1);
   	 	 	 } else
   	 	 	 {
   	 	 	 	 _tablefmt1.push(dtobjhtml) ;
   	 	 	 	 dtobjhtml = "";
   	 	 	 } ;
   	 	 } else
   	 	 {
   	 	 	 _tablefmt1.push(dtobjhtml) ;
   	 	 	 dtobjhtml = "" ;
   	 	 } ; 
   	 } ;
   	 
   	 for (i01=0;i01<_tablefmt1.length;i01++)
   	 {
	   	 if (_tablefmt1[i01]=="{cmpid}") _tablefmt1[i01]=cmpid;
	   	 if (_tablefmt1[i01]=="{userid}") _tablefmt1[i01]=userid;
	   	 if (_tablefmt1[i01]=="{useruid}") _tablefmt1[i01]=useruid;
	   	 if (_tablefmt1[i01]=="{abspath}") _tablefmt1[i01]=abspath;
	   	 if (_tablefmt1[i01]=="{useradmin}") _tablefmt1[i01]=useradmin;
	   	 if (_tablefmt1[i01]=="{usercode}") _tablefmt1[i01]=usercode;
	   	 if (_tablefmt1[i01]=="{userrealname}") _tablefmt1[i01]=userrealname;
	   	 if (_tablefmt1[i01]=="{comp}") _tablefmt1[i01]=comp;
		 } ;  
		 
		 // 这段代码处理导出数据
		 _tablefmt2 = new Array() ;
     
   	 while (dtobjhtml2!="")
   	 {
   	 	 i01 = dtobjhtml2.indexOf("{") ;
   	 	 if (i01>=0) 
   	 	 {
   	 	 	 _tablefmt2.push(dtobjhtml2.substr(0,i01)) ;
   	 	 	 dtobjhtml2 = dtobjhtml2.substr(i01) ;
   	 	 	 i01 = dtobjhtml2.indexOf("}") ;
   	 	 	 if (i01>=0)
   	 	 	 {
   	 	 	 	 _tablefmt2.push(dtobjhtml2.substr(0,i01+1)) ;
   	 	 	 	 dtobjhtml2 = dtobjhtml2.substr(i01+1);
   	 	 	 } else
   	 	 	 {
   	 	 	 	 _tablefmt2.push(dtobjhtml2) ;
   	 	 	 	 dtobjhtml2 = "";
   	 	 	 } ;
   	 	 } else
   	 	 {
   	 	 	 _tablefmt2.push(dtobjhtml2) ;
   	 	 	 dtobjhtml2 = "" ;
   	 	 } ; 
   	 } ;
   	 
   	 for (i01=0;i01<_tablefmt2.length;i01++)
   	 {
	   	 if (_tablefmt2[i01]=="{cmpid}") _tablefmt2[i01]=cmpid;
	   	 if (_tablefmt2[i01]=="{userid}") _tablefmt2[i01]=userid;
	   	 if (_tablefmt2[i01]=="{useruid}") _tablefmt2[i01]=useruid;
	   	 if (_tablefmt2[i01]=="{abspath}") _tablefmt2[i01]=abspath;
	   	 if (_tablefmt2[i01]=="{useradmin}") _tablefmt2[i01]=useradmin;
	   	 if (_tablefmt2[i01]=="{usercode}") _tablefmt2[i01]=usercode;
	   	 if (_tablefmt2[i01]=="{userrealname}") _tablefmt2[i01]=userrealname;
	   	 if (_tablefmt2[i01]=="{comp}") _tablefmt2[i01]=comp;
		 } ;  
		 
		 
	 	 _tb_fmt_flds = new Array() ;
     _tb_fmt_fmts = new Array() ;
     var s1 = "" ;
	 	 var objs1 = pobj3.$("#"+tbname+" td[fmt][name]") ;
	   var obji1 = objs1.length ;
	   var obj1 = null ;
	   while (obji1>=0) 
	   {
	   	 obj1 = pobj3.$(objs1[obji1]) ;
	   	 s1 = obj1.attr("name") ;
	   	 if ((s1=="sum") || (s1=="avg") || (s1=="min") || (s1=="max") || (s1=="count")) 
	   	 {
	   	   s1 = obj1.html().replace("{","").replace("}","") ;
	   	 }  ;  
	   	 s2 = obj1.attr("fmt") ;
	   	 if ((_isnull(s1,"")!="") && (_isnull(s2,"")!=""))
	   	 {
	   	   _tb_fmt_flds.push(s1) ;
	   	   _tb_fmt_fmts.push(s2) ;
	   	 } ;  
	   	 obji1 -- ;
	   } ;
	   
	   _table_format.push(_tb_fmt_flds) ;
	   _table_format.push(_tb_fmt_fmts) ;
	   _table_format.push(_tablefmt1) ;
	   
	   for (i01=0;i01<_tablefmt1.length;i01++) 
	     _tmparr1.push(-1) ;
	   _table_format.push(_tmparr1) ;
	   
	   _tableflds = new Array() ;
	   for (i01=0;i01<_tablefmt1.length;i01++) 
	   {
	   	 s1 = _tablefmt1[i01] ;
	   	 if (s1.indexOf("{")==0) 
	   	 {
	   	 	 if ((s1!="{order}") && (s1!="{ordera}") && (s1.substr(1,1)!="_") && (s1.indexOf("_raw}")<0) && (s1.indexOf("_org}")<0)) 
	   	 	 {
	   	 	 	 _tableflds.push(s1.substr(1,s1.length-2)) ;
	   	 	 } ;
	   	 } ;
	   } ;
	   _table_format.push(_tableflds) ;
	   _table_format.push(_tablefmt2) ;
	   _table_format.push("") ;
	   _table_format.push(null) ;
	   return fmtindex2 ;
};
function _replacefieldvalue(pobj3,orgvalue1,tbfldfunc)
{
	var domhtml1 = orgvalue1 ;
	var hasfldv1 = false ;
  var tmps1 = "" ;
  var tmps2 = "" ;
  var i = 0 ;
  var thisobj1 = null ;
  if (tbfldfunc) hasfldv1 = true ;
	for (var sqli1 = 0 ; sqli1 < pobj3.$flds.length ; sqli1++) 
  {
  	if (hasfldv1) tmps1 = tbfldfunc(pobj3.$flds[sqli1],pobj3.$f[sqli1]) ;
  	else tmps1 = pobj3.$f[sqli1] ;
    domhtml1 = domhtml1.replaceAll("{"+pobj3.$flds[sqli1]+"}",tmps1) ;  
    for (i=1 ; i<=13 ; i++) 
    {
    	try
    	{
    		tmps2 = "l_023~~18^&*2" ;
    		eval("tmps2 = pobj3._"+pobj3.$flds[sqli1]+"_s"+i) ;
    		if (tmps2 != "l_023~~18^&*2") 
    		  domhtml1 = domhtml1.replaceAll("{_"+pobj3.$flds[sqli1]+"_s"+i+"}",tmps2) ;  
      } catch(E){} finally {} ;
    } ;
  } ; 
  return domhtml1 ;
}
function _replacefieldvaluebyidorname(pobj3,tbfldfunc,$obj01)
{
	var hasfldv1 = false ;
  var tmps1 = "" ;
  var thisobj1 = null ;
  var fmt="" ;
  if (tbfldfunc) hasfldv1 = true ;
	for (var sqli1 = 0 ; sqli1 < pobj3.$flds.length ; sqli1++) 
  {
  	if (hasfldv1) tmps1 = tbfldfunc(pobj3.$flds[sqli1],pobj3.$f[sqli1]) ;
  	else tmps1 = pobj3.$f[sqli1] ;
    if ($obj01.length>0) 
    {
    	$obj01.find("#"+pobj3.$flds[sqli1]+",*[name="+pobj3.$flds[sqli1]+"]")
    	.each(
    	 function()
    	 {
    	 	  thisobj1 = this ;
    	 	  fmt = _isnull(pobj3.$(this).attr("fmt"),"") ;
	      	if (fmt=="") tmps1 = tmps1  ; else
	      	if ((fmt=="money")) tmps1 = fmtmoney(tmps1) ;else
	      	if ((fmt=="money0")) tmps1 = fmtmoneyno0(tmps1) ;else
	      	if (fmt.substr(0,1)=="#") tmps1 = _fmtfloat(tmps1,fmt) ;
	      	else tmps1 = _fmtdate(tmps1,fmt) ;
    	 	  if ((thisobj1.tagName=="INPUT") || (thisobj1.tagName=="TEXTAREA") || (thisobj1.tagName=="SELECT"))
    	 	  {
    	 	  	try
    	 	  	 {
    	 	  	 	 pobj3.$(thisobj1).val(tmps1) ;
    	 	  	 } catch(E){} finally {} ;	 
    	 	  } else 
    	 	  {
    	 	  	try
    	 	  	{
    	 	  		tmps1 = isnull(tmps1,"&nbsp;") ;
    	 	  	  pobj3.$(thisobj1).html(tmps1);
    	 	  	} catch(E){} finally {} ;	 
    	 	  } ;
    	 }
    	) ;
    } ;
  } ; 
}
function _mydatalist(pobj3,sqlnameandparam1, tbfldfunc,$obj1,afterloadfc,sqlparam21)
{
	if ($obj1.length<=0) return false ;
	if ($obj1.length>0) pobj3.currentobjid = $obj1[0].id ; else pobj3.currentobjid = "" ;
	var needreplace = false ;
	var sqli1 = 0 ;
	var sql1 = sqlnameandparam1.replaceAll("{pageindex}","1") ;
  sqli1 = sql1.indexOf("&cache=") ;
  if (sqli1<0) sqli1 = sql1.indexOf("&publiccache=") ;
  if (sqli1>=0)  sql1 = sql1.substr(0,sqli1)+"&pagesize="+pagesize+"&pageindex=1&qry=1"+sql1.substr(sqli1) ;
  else sql1 += "&pagesize=1&pageindex=1&qry=1" ;
  sqli1 = sql1.indexOf("&") ;
  var adom1 = null ;
  var domhtml1 = "" ;
  
  $obj1.each(
	function()
	{
		adom1 = this ;
		domhtml1 = _isnull(pobj3.$(adom1).attr("oldform_sys_only"),"") ;
		if (domhtml1=="") 
		{ 
			domhtml1 = pobj3.$(adom1).html() ;
			pobj3.$(adom1).attr("oldform_sys_only",_tohex(domhtml1)) ;
		} else 
		{
			domhtml1 = _tostr(domhtml1) ;
			pobj3.$(adom1).html(domhtml1) ;
		} ;
	}) ;
  		
  //_runsql4xml(pobj3,sql1.substr(0,sqli1),sql1.substr(sqli1+1),
  _runsql4xml(pobj3,sql1,sqlparam21,
  function(iseof,data1,dsname1)
  {
  	if (!iseof) 
  	{
  		pobj3.$v = pobj3.$f ;
  		$obj1.each(
  		function()
  		{
  			adom1 = this ;
  			domhtml1 = pobj3.$(adom1).html() ;
  			needreplace = domhtml1.indexOf("{")>=0 ;
  			if (needreplace)  
  			{
  				domhtml1 = _replacefieldvalue(pobj3,domhtml1,tbfldfunc) ;
  				pobj3.$(adom1).html(domhtml1) ;
  			} ;
  		}) ;
  		_replacefieldvaluebyidorname(pobj3,tbfldfunc,$obj1) ;
  	} ;
  	if (afterloadfc) 
  	{
  		afterloadfc(iseof,data1,dsname1) ;
  	} ;
  	if ((!iseof) && (!dsname1)) 
  	{
  		$obj1.removeClass("hidden") ;
  	} ;
  	if ((iseof) && (!dsname1))
  	{
  		try { pobj3.needautoframeheight() ;} catch (e) { } finally { } ;
  	} ;
  }) ; 
};
function _addtablepopmenu(pobj3,tbname)
{
	if (pobj3.$("#"+tbname+"[popmenuok]").length>0) return ;
	if (pobj3.$("#"+tbname+"[nopopmenu]").length>0) return ;
	var tbttobj = pobj3.$("#"+tbname+" tbody:not([name=details],[name=foot],[name=details_auto])") ;
	tbttobj.attr("popmenu","gentablepopmenu(\""+tbname+"\")") ;
	pobj3.$("#"+tbname).attr("popmenuok","0") ;
};
function _removetableformat(pobj3,tbname, tbsndkey2)
{
	var tbsndkey1 = isnull(tbsndkey2,"") ;
	var fmtindex1 = _table_format.indexOf2(pobj3.pagefilename+"."+tbname+"."+tbsndkey1,0,12) ;
	if (fmtindex1>=0) 
	{
	 	 _table_format.splice( fmtindex1 , 12) ;
	} ;
};
function _mytable(pobj3,aspxn,sqlnameandparam1, tbfldfunc, tbname, pagesize1,afterloadfc,filter1,append2,tbsndkey2)
{
	 //*处理一下格式
	 pobj3.currenttableid = tbname ;
	 _addtablepopmenu(pobj3,tbname) ;
	 var i01 = 0 ;
	 var tbsndkey1 = isnull(tbsndkey2,"") ;
	 
	 if (pagesize1<200000) 
	   pobj3.$("#"+tbname).attr("tablefmtkey",pobj3.pagefilename+"."+tbname+"."+tbsndkey1) ;
	 
	 var fmtindex1 = _table_format.indexOf2(pobj3.pagefilename+"."+tbname+"."+tbsndkey1,0,12) ;
	 if (fmtindex1<0) 
	 {
	 	  fmtindex1= _parsetablefmt(pobj3,tbname,tbsndkey1) ;
	 	  _table_format[fmtindex1+10] = tbfldfunc ;
	 } ;
	 
	 if (pagesize1<200000) 
	   _table_format[fmtindex1+10] = sqlnameandparam1 ;
	 
   eval("pobj3."+tbname+"_pageindex=1") ;
 
   var pagesize = _isnull(pobj3.$("#"+tbname).attr("topn"),pagesize1) ; 
   
	 var tabledone = false ;
	 var filter2 = _isnull(filter1,"") ;
   eval(aspxn+tbname+"_fldv___=tbfldfunc") ;
   var tbv = "_"+aspxn+"_"+tbname+"_pobj = pobj3" ;
   eval(tbv) ;
   var sql1 = sqlnameandparam1.replaceAll("{pageindex}","1") ;
   sql1 = sql1.replaceAll("{pagesize}",pagesize) ;
   sql1 = sql1.replaceAll("{qry}","1") ;
   //if (sql1.indexOf("publiccache")<0) sql1 += "&cache=1" ;
   var sqli1 = 0 ;
   sqli1 = sql1.indexOf("&cache=") ;
   if (sqli1<0) sqli1 = sql1.indexOf("&publiccache=") ;
   if (sqli1>=0)  sql1 = sql1.substr(0,sqli1)+"&pagesize="+pagesize+"&pageindex=1&qry=1"+sql1.substr(sqli1) ;
   else sql1 += "&pagesize="+pagesize+"&pageindex=1&qry=1" ;
   sqli1 = sql1.indexOf("&") ;
   pobj3.reccount = 0 ;pobj3.pagecount=0 ;pobj3.reccount_real = 0 ;
   var runafterld = false ;
   var resdata = "";
   _runsql4xml(pobj3,sql1.substr(0,sqli1),sql1.substr(sqli1+1),
   function(iseof,data1,dsname1)
   {
   	 if (iseof)
   	 {
   	 	 if (!dsname1)
   	 	 {
   	 	 	if (runafterld==false) 
   	 	 	{
   	 	 		 runafterld = true ;
   	 	 		 if (pagesize1<100000)
   	 	 		 {
   	 	 		   pobj3.reccount = 0 ;pobj3.pagecount=0 ; 
   	 	 		   pobj3.$("#"+tbname+">tbody[name=details_auto]").html("") ;
   	 	 		   _showgroup(aspxn,tbname,tbfldfunc) ;
   	 	 		 } ;  
   	 	 	} ;	 
   	 	 	if ((afterloadfc)) 
   	 	 	{
   	 	 		if ((pagesize!=100000) && (pagesize!=200000)) afterloadfc(1,data1) ;
   	 	 		else 
   	 	 		{
   	 	 				afterloadfc(resdata) ;
   	 	 				if (pagesize1<100000)
   	 	 				{
   	 	 				  _showgroup(aspxn,tbname,tbfldfunc) ;
							  try { pobj3.needautoframeheight() ;} catch (e) { } finally { } ;
							  try { if (_editable) pobj3.autobindeditparams(tbname);} catch (e) { } finally { } ;
							} ;  
   	 	 		} ;
   	 	 	} ;	
   	 	 	
   	 	 } ;
   	 	 if (!dsname1) _loading(false);
   	 	 
   	 	 if (dsname1=="ds1") // 共多少条记录
   	 	 {
   	 	 	 if (pagesize1<100000)
   	 	 	 {
	   	 	 	 pobj3.reccount = 0 ;pobj3.pagecount=0 ;
	   	 	 	 if (pobj3._datasetcount==1) 
	   	 	 	 {
	   	 	 	 	 if ((pobj3._recordcount==1) && (pobj3.$flds.length==1))
	   	 	 	 	 {
	   	 	 	 	 	pobj3.reccount = parseInt(pobj3.$f[0]);
	   	 	 	 	 } else pobj3.reccount = pobj3._recordcount ;
	   	 	 	 } 	 else 
	   	 	 	 {
	   	 	 	 	  if (pobj3.$flds.length==1) pobj3.reccount = parseInt(pobj3.$f[0]);
	   	 	 	 	  else pobj3.reccount = pobj3._recordcount ;
	   	 	 	 } ;		
	   	 	 	 pobj3.pagecount = pobj3.reccount % pagesize ;
	         if (pobj3.pagecount != 0) pobj3.pagecount = (pobj3.reccount - pobj3.pagecount) / pagesize + 1;
	         else pobj3.pagecount = pobj3.reccount / pagesize ;
	         pobj3.$("#"+tbname+"_recordcount,#"+tbname+"_recordcount2").html(""+pobj3.reccount+"") ;
	         pobj3.$("#"+tbname+"_pagecount,#"+tbname+"_pagecount2").html(""+pobj3.pagecount+"") ;
	         pobj3.$("#"+tbname+"_pageindex,#"+tbname+"_pageindex2").html("1") ;
	         var pageinfo = pobj3.$("#"+tbname+"_pageinfo") ;
	         if (pageinfo.length>0)
	         {
	           if (pobj3.pagecount > 1) 
	           {
	           	 pobj3.$("#"+tbname+"_page").show() ;
	             _getpagestrs(1,pobj3.pagecount,false,tbname,aspxn,sqlnameandparam1,pagesize,tbfldfunc,afterloadfc,1,tbsndkey1) ;
	           }  
	           else 
	           	{
	           		pobj3.$("#"+tbname+"_page").hide() ;
	           		pageinfo.hide() ;
	           	} ;	
	         } ;  
	       } ;  
   	 	 } ;  
   	 	 if ((data1) && (((dsname1=="ds1") && (pobj3._datasetcount==1)) 
   	 	      || ((dsname1=="ds1") && (pobj3._datasetcount>1) && (pobj3.$flds.length>1))
   	 	 			|| (dsname1=="ds11")))
   	 	 {
	 	 	
   	 	 	if (tabledone==false)
   	 	 	{
   	 	 		tabledone = true ;
   	 	 	  runafterld = true ;
   	 	    resdata = _set_tabledetails(aspxn,$(data1), tbfldfunc, tbname,pagesize, 1,filter2,append2,tbsndkey1) ;
   	 	  } ;
   	 	 } ;//else {pobj3.reccount = 0 ;pobj3.pagecount=0 ;};
   	 } ;
   });
   return false ;
}


function _mytablebyds(pobj3,aspxn,$data1, tbfldfunc, tbname, pagesize,filter1,append2,tbsndkey2)
{
	 var tbsndkey1 = isnull(tbsndkey2,"") ;
	 var fmtindex1 = _table_format.indexOf2(pobj3.pagefilename+"."+tbname+"."+tbsndkey1,0,12) ;
	 if (fmtindex1<0) fmtindex1 = _parsetablefmt(pobj3,tbname,tbsndkey1) ;
   eval(aspxn+tbname+"_fldv___=tbfldfunc") ;
   var tbv = "_"+aspxn+"_"+tbname+"_pobj = pobj3" ;
   eval(tbv) ;
   pobj3.reccount = 0 ;pobj3.pagecount=0 ;pobj3.reccount_real = 0 ;
   return _set_tabledetails(aspxn,$data1, tbfldfunc, tbname,pagesize, 1,filter1,append2,tbsndkey1) ;
}

function _set_tabledetails(aspxn,$dataset, tbfldfunc, tbname,pagesize, pageindex,filter2,ins1,tbsndkey1)
{
	
	 _table2xls =  pagesize >= 200000 ;
	 
	 var tfmiii = 0 ;
	 var insert1 = _isnull(ins1,"") ;
	 // insert1=0 表示，是否添加新记录
	 var filter1 = _isnull(filter2,"") ;
	 
	 // pagesize>=200000 表示只取数据到XLS
	 
	// alert(____ident()) ;
	 
	 var duplicate1 = false ;
	 var old1 = ____ident() ;
   var tbv = "pobj3 = _"+aspxn+"_"+tbname+"_pobj" ; 
   eval(tbv) ;
   //pobj3._edit_table = "";
   
   pobj3.currenttableid = tbname ;
   
   var fmtindex1 = _table_format.indexOf2(pobj3.pagefilename+"."+tbname+"."+tbsndkey1,0,12) ;
   
   pobj3.reccount_real = 0 ;
   pobj3._recno = 0 ;
   pobj3._recindex = 0 ;
   pobj3._reccount = 0 ;
   pobj3._recordcount = 0 ;
   
   var order = parseInt(pagesize) * (parseInt(pageindex) - 1) ;
   var dttexts = [] ;
   
   var fldnv = [] ; pobj3.$o = [] ;
   var isfirst = true ;
   var hasorder=false;
   var hasordera=false;
   var irec = 0 ;
   var tmpi = 0 ;
   var tmpi2 = 0 ;
   var tmpic = 0 ;
   var tmpic2 = 0 ;
   var s1 = "" ;
   var s2 = "" ;
   var s3 = "" ;
   var s4 = "" ;
   var val1 = "" ;
   
   var thisorder = 0 ;
   
   if (insert1=="0") 
   {
   	 thisorder = pobj3.$("#" + tbname + ">tbody[name=details_auto]>tr:not(#"+tbname+"nouseforsystem)").length ;
   	 var ddb1 = pobj3.$("#" + tbname + ">tbody[name=details]>tr").length ;
   	 thisorder = thisorder / ddb1 ;
   	 //if (thisorder>0) thisorder = thisorder -1  ;
   };
   
   order = order + thisorder ;
   
   
   hasorder= _table_format[fmtindex1+1]==0;
   hasordera=_table_format[fmtindex1+2]==0;
   _editable = _table_format[fmtindex1+3]==0;
   
   var filterok = true ;
   var tmpflt1 = "" ;
   pobj3.$v1 = [] ;var dttext = "";var ads = null ;
   var fldoks=[] ;
   var fldval=[] ;
   var fmtflds = _table_format[fmtindex1+4] ;
   var fmtfmts = _table_format[fmtindex1+5] ;
   var tablefmt = _table_format[fmtindex1+6] ;
   if (pagesize>=200000) tablefmt2 = _table_format[fmtindex1+9] ; // 如果只是取数据到xls,则用另外的一种格式
   var tablefmtflds = _table_format[fmtindex1+7] ;
   var tableflds = _table_format[fmtindex1+8] ;
   
   var fltarr1 = [] ;// 分解filterstr 
   var fltval1 = [] ;
   var hasfilter = filter1!="" ;
   var hasfldv = false ;
   if (tbfldfunc) hasfldv = true ;
   var tablefmtlen = tablefmt.length ;
   var fldslen = 0 ;
   var fltlen = 0 ;
   var hasspecifyflds = false ;
   var useflds1 = "" ;
   if (hasfldv)  useflds1 = tbfldfunc("useful_fields","--") ;
   var hasold$v = false ;
   if (hasfldv) hasold$v = tbfldfunc("use_$o","--")!="--" ;
   
   hasspecifyflds = useflds1!="--" ;

   if (!hasspecifyflds) useflds1 = "" ;
   
   while (useflds1!="")
   {
   	 	tmpi = useflds1.indexOf(",") ;
   	 	if (tmpi>=0) 
   	 	{
   	 		s1 = useflds1.substr(0,tmpi) ;
   	 		useflds1 = useflds1.substr(tmpi+1) ;
   	 	} else
   	 	{
   	 		s1 = useflds1 ;
   	 		useflds1 = "" ;
   	 	} ;
   	 	if (s1!="") tableflds.push(s1) ;
   } ;
   useflds1 = filter1 ;
   while (useflds1!="")
   {
   	 	tmpi = useflds1.indexOf("{") ;
   	 	if (tmpi>=0) useflds1 = useflds1.substr(tmpi+1) ;
   	 	else useflds1 = "" ;
   	 	tmpi = useflds1.indexOf("}") ;
   	 	if (tmpi>0)
   	 	{
   	 		s1 = useflds1.substr(0,tmpi) ;
   	 		useflds1 = useflds1.substr(tmpi+1) ;
   	 	} else
   	 	{
   	 		s1 = "" ;
   	 		useflds1 = "" ;
   	 	} ;
   	 	if (s1!="") tableflds.push(s1) ;
   } ;
   
   var dscount = $dataset.length ;
   if (dscount==1) 
   {
     s1 = 	_isnull($dataset.text(),"") ;
     if (s1.length<=1) dscount=0;
   } ;
   var ads21 = null ;
   var obj21 = null ;
   
   pobj3._reccount = dscount ;
   pobj3._recordcount = dscount ;
    
   for (var i0111=0 ; i0111<dscount ; i0111 ++) //$dataset.each(function(i)
   {
   	  ads = $($dataset[i0111]) ;
   	  ads21 = ads.children() ;
	    tmpic = ads21.length ;
	    if (isfirst)
	    {
	    	isfirst = false ;
	    	fltval1 = [] ;
	    	tmpi2 = 0 ;
	    	for (tmpi=0;tmpi<tmpic;tmpi++)
	      {
	      	obj21 = ads21[tmpi] ;
	       	fldn = obj21.nodeName ;
	       	if (hasspecifyflds) 
	       	{
	       		if (tableflds.indexOf(fldn)>=0) 
	       		{
	       			fltval1.push("pobj3._") ;
		       	  fltval1.push(fldn) ;
		       	  fltval1.push(" = ") ;
		       	  fltval1.push(tmpi2);
		       	  fltval1.push(";") ;
	       			fldnv.push(fldn) ;
	       			tmpi2 ++ ;
	       		} ;	
	       	} else
	       	{
	       	  fltval1.push("pobj3._") ;
	       	  fltval1.push(fldn) ;
	       	  fltval1.push(" = ") ;
	       	  fltval1.push(tmpi2);
	       	  fltval1.push(";") ;
	       	  fldnv.push(fldn) ;
	       	  tmpi2 ++ ;
	       	} ;  
	      } ;
	      eval(fltval1.join("")) ;
	      fldslen = fldnv.length ;
	      if (hasfilter)
	      {
	        fltarr1 = [] ;
	        tmpflt1 = filter1 ;
	        while (tmpflt1!="")
	        {
	        	tmpi = tmpflt1.indexOf("{") ;
	        	if (tmpi>=0)
	        	{
	        		fltarr1.push(tmpflt1.substr(0,tmpi)) ;
	        		tmpflt1 = tmpflt1.substr(tmpi+1) ;
	        		tmpi = tmpflt1.indexOf("}") ;
	        		fltarr1.push("'") ;
	        		tmpi2 = fldnv.indexOf(tmpflt1.substr(0,tmpi)) ;
	        		fltarr1.push("{"+tmpi2+"}") ;
	        		tmpflt1 = tmpflt1.substr(tmpi+1) ;
	        		fltarr1.push("'") ;
	        	} else 
	        	{
	        		fltarr1.push(tmpflt1) ;
	        		tmpflt1 = "";
	        	} ;
	        } ;
	        fltlen = fltarr1.length ;
	      } ;  
	      // 处理tablefmt = _table_format[fmtindex1+6] ;
   			//  var tablefmtflds = _table
   			for (tmpi=0;tmpi<fldslen;tmpi++)
   			{
   				s3 = fldnv[tmpi] ;
   				for (tmpi2=0;tmpi2<tablefmtlen;tmpi2++)
   				{
   					s4 =  tablefmt[tmpi2] ;
   					if (s4.substr(0,1)=="{")
   					{
	   					if (s4=="{"+s3+"}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{"+s3+"_raw}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{"+s3+"_org}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s1}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s2}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s3}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s4}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s5}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s6}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s7}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s8}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s9}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s10}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s11}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s12}")  tablefmtflds[tmpi2] = tmpi ;else 
	   					if (s4=="{_"+s3+"_s13}")  tablefmtflds[tmpi2] = tmpi ;
	   				} ;	
   				} ;	
   			} ;
	    } ;
	    if (!hasspecifyflds)
	    {
		    if (tmpic==fldslen) 
		    {
			    for (tmpi=0;tmpi<tmpic;tmpi++)
	          pobj3.$v[tmpi]=cvtvalue(ads21[tmpi].text) ;
		    } else 
		    {
		    	for (tmpi=0;tmpi<fldslen;tmpi++) pobj3.$v[tmpi] = "" ;
			    for (tmpi=0;tmpi<tmpic;tmpi++)
			    {
			    	for (var i=tmpi ; i<fldslen ; i++)
			    	{
			    		if (fldnv[i]==ads21[tmpi].nodeName)
			      	{
			           pobj3.$v[i]=cvtvalue(ads21[tmpi].text) ;
			           break ;
			        } ;  
			    	} ;
			    } ;
		    } ;
		  } else
		  {
		  	//for (tmpi=0;tmpi<fldslen;tmpi++) pobj3.$v[tmpi] = "" ;
		  	tmpi = 0 ;
		  	for (tmpi2=0;tmpi2<fldslen;tmpi2++) 
		  	{
		  	  for (;tmpi<tmpic;tmpi++)
		  	  {
		  		  if (ads21[tmpi].nodeName==fldnv[tmpi2])
		  		  {
	            pobj3.$v[tmpi2]=cvtvalue(ads21[tmpi].text) ;
	            break ;
	          } ;  
	        } ; 
	      } ;   
		  } ;  
   	  if (!hasfilter) filterok = true ; else 
   	  {
   	  	  fltval1 = [] ;
   	  	  for (tmpi=0;tmpi<fltlen;tmpi++) 
   	  	  {
   	  	  	s4 =fltarr1[tmpi] ; 
   	  	  	if (s4=="{-1}") fltval1.push("") ;else
   	  	  	if (s4.substr(0,1)=="{")
   	  	  	{
   	  	  		s4 = s4.substr(1,s4.length-2) ;
   	  	  		fltval1.push(pobj3.$v[parseInt(s4)]) ;
   	  	  	} else fltval1.push(s4) ; 
   	  	  } ;
   	  	  tmpflt1 = "filterok=("+fltval1.join("")+")" ;
   	  	  try { eval(tmpflt1) ;} catch (e) {} finally {} ;  
   	  	
   	  } ;
   	  if (filterok) 
   	  {
	      if (thisorder==0) for (var i=0;i<fldslen;i++) pobj3.$v1[i]=pobj3.$v[i] ;
	      
	      if (hasfldv) 
	      {
	      	duplicate1 = tbfldfunc("duplicate","nodup_001") ;
	      	if (duplicate1=="nodup_001") duplicate1 = false ;
	      } ;
	      if (!duplicate1) 
	      {
	      	pobj3.reccount_real ++ ;
	      	
	        order ++ ; thisorder++ ; 
	        pobj3._recno = thisorder ;
	        pobj3._recindex = thisorder ;
	        
	        s1 = "" ; s2 = "" ;
	        if (hasorder) 
	        {
	        	if (hasfldv)  s1 = tbfldfunc("order", order,$dataset,pobj3); else s1 = order ;
	        } ;
	        if (hasordera) s2 = String.fromCharCode(order+64);
	        
	        fldoks=[] ;fldval=[] ;
	        for (tmpi=0;tmpi<tablefmtlen;tmpi++)
	        {
	        	irec ++ ;
	        	s3 = tablefmt[tmpi] ;
	        	if (s3.substr(0,1)!="{") dttexts.push(s3) ; else 
	        	if (s3=="{order}") dttexts.push(s1) ;  else 
	        	if (s3=="{order_raw}") dttexts.push(order) ; else  
	        	if (s3=="{order_org}") dttexts.push(order) ; else  
	        	if (s3=="{ordera}") dttexts.push(s2) ;  else 
	        	if (s3=="{__rowi__}") dttexts.push(order) ; else  
	        	if (s3.indexOf("_org}")>0) 
	        	{
	        		dttexts.push(pobj3.$v[tablefmtflds[tmpi]]) ;
	        	} else 	
	        	if (s3.indexOf("_raw}")>0) 
	        	{
	        		dttexts.push(_tohex(_isnull(pobj3.$v[tablefmtflds[tmpi]],""))) ;
	        	} else 
	        	{
	        		  s4 = fldnv[tablefmtflds[tmpi]] ;
	        		  tmpi2 = fldoks.indexOf(s4) ;
		        		if (tmpi2<0) 
		        		{
		        			if (hasfldv) val1 = tbfldfunc(s4, pobj3.$v[tablefmtflds[tmpi]],$dataset,pobj3) ;
		        			else val1 = pobj3.$v[tablefmtflds[tmpi]] ;
		        			
		        			tmpi2 = fmtflds.indexOf(s4) ;
				      		if ((tmpi2>=0) && (fmtfmts[tmpi2]!=""))
				      		{
				      			if (fmtfmts[tmpi2]=="money")  
				      			{
				      				if (pagesize>=200000) 
				      				  val1 = _fmtfloat(val1,"#.##") ;
				      				else   val1 = "<font color='#a8a8a8'>￥</font>"+_fmtfloat(val1,"#,##") ;
				      			} else
				      			if (fmtfmts[tmpi2]=="money0")  
				      			{
				      				if (_myparseFloat(val1,0)==0) 
				      				{
				      					if (pagesize>=200000) val1 = '' ;
				      					else val1 = '&nbsp;' ;
				      				}	
				      				else 
				      				{
				      					if (pagesize>=200000) 
				      					  val1 = _fmtfloat(val1,"#.##") ;
				      					else  val1 = "<font color='#a8a8a8'>￥</font>"+_fmtfloat(val1,"#.##") ;
				      				} ;
				      			}	else 
				      			if (fmtfmts[tmpi2].substr(0,1)=="#") 
				      			{
				      				val1 = _fmtfloat(val1,fmtfmts[tmpi2]) ; 
				      			}	else 
				      			{
				      				if (pagesize>=200000) 
				      			    val1 = _fmtdate(val1,fmtfmts[tmpi2].replace("/p","")) ;  
				      			  else   val1 = _fmtdate(val1,fmtfmts[tmpi2]) ;   
				      			} ;  	
				      		} ; 
			      		
		        			fldoks.push(s4) ;
		        			fldval.push(val1) ;
		        			tmpi2 = fldoks.length - 1 ;
		        		} ;
		        		if (s3.substr(0,2)=="{_") 
		        		{
		        			val1 = "" ;
		        			s4  =  s3.substr(1,s3.length-2) ;
			            eval("val1=pobj3."+s4);
			            dttexts.push(val1) ;
		        		} else
		        		{
		        			val1 = fldval[tmpi2] ;
		        			dttexts.push(isnull(val1,"&nbsp;")) ;
		        		} ;
		        	//} ;	
	        	} ;
	        } ;
		      if (hasold$v) for (tmpi2=0;tmpi2<fldslen;tmpi2++) pobj3.$o[tmpi2] = pobj3.$v[tmpi2] ;
		    } ;  
	    } ;  
   };
   for (tmpi=0;tmpi<fldslen;tmpi++) pobj3.$v2[tmpi]=pobj3.$v[tmpi] ;
   //alert(dttexts.toString()) ;
   var newi1 = ____ident() ;
   //alert("genages:" + (newi1-old1)) ;
   pobj3._edit_table = "";
   if ((pagesize!=100000) && (pagesize!=200000))
   {
   	 var tbobj1 = pobj3.$("#"+tbname) ;
   	 pobj3.$("#"+tbname+"_pageindex,#"+tbname+"_pageindex2").html(pageindex) ;
	   if (irec==0) 
	   {
	   	tbobj1.addClass("zerorecord") ;
	   } else  tbobj1.removeClass("zerorecord") ;	
	   newobj = tbobj1.find("tbody[name=details_auto]:first") ;
	   if (newobj.length==0) 
	   {
	     newobj = pobj3.$("<tbody name=details_auto id=_"+tbname+"_details_auto_></tbody>").insertBefore("#" + tbname + ">tbody[name=foot]") ;
	   } ;  
	   if (insert1=="0")
	   { 
	   	 newobj.append(dttexts.join("")).show() ; 
	   } else
	   {
	   	 var animate1 = _isnull(tbobj1.attr("animate"),"none") ;
	   	  if (animate1=="") 
	    	 {
	   	 	 if (pobj3.$("#"+tbname+"_pageinfo").length>0) animate1 = "show" ;
	    	 } ;
	   	 if (irec>0) tbobj1.hide() ;
	   	 newobj.replaceWith("<tbody name=details_auto id=_"+tbname+"_details_auto_><tr id="+tbname+"nouseforsystem class=nouseforsystem style='display:none'></tr>"+dttexts.join("")+"</tbody>");
	   	 if (irec>0) 
	   	 {
		   	 if (animate1=="fade")
		    	   tbobj1.fadeIn("slow");
		   	 else   if (animate1=="slide")
		   	 	 tbobj1.slideDown("slow") ;
		   	 else 	if (animate1=="show") 
		   	 	 tbobj1.show("slow") ;
		   	 else 	 tbobj1.show() ;
	   	 } ;	
	   };	 
	
	   if ((insert1!="0") && (irec==0)) newobj.hide() ;
	   var newi2 = ____ident() ;
	   //alert("genages:" + (newi1-old1)+"  "+(newi2-old1)) ;
	   _showgroup(aspxn,tbname,tbfldfunc) ;
	   	   
	   try { pobj3.needautoframeheight() ;} catch (e) {} finally {} ;
	   	   
	   try
	   {
	      if (_editable) pobj3.autobindeditparams(tbname);
	   }
	   catch (e)
	   {
	   }
	   finally
	   {
	   }
	   ;
   } ;
   _loading(false) ;
   return dttexts.join("");
   //newi6 = ____ident() ;
   //alert((newi1-oldi)+","+(newi2-oldi)+","+(newi3-oldi)+","+(newi4-oldi)+","+(newi5-oldi)+","+(newi6-oldi)) ;
}

function _showgroup(aspxn,tbname, tbfldfunc)
{	 
   oldi = ____ident() ;
   var tbv = "pobj3 = _"+aspxn+"_"+tbname+"_pobj" ; try { eval(tbv) ;} catch (e)  { }  finally  { } ;
   if (pobj3._edit_table_manul_calc_group) pobj3._edit_table_manul_calc_group.html("&nbsp;") ;
   var groupold = "" ;
   var groupnames = ",," ;
   var trobjs__ = [] ;
   trobjs__[0] =
   {
      count:0,name:"foot",trobj:pobj3.$("#" + tbname + " tbody[name='foot']"),names:[],nameindex:0
   }
   ;
   var trindex1_ = 0 ;
   _grp_ident2 = ____ident();
   thepagetrs = pobj3.$("#" + tbname + ">tbody[name=details_auto]") ;
   pobj3.$("tr[name^='group']",thepagetrs).each(function()
   {
      trobj1 = pobj3.$(this) ;
      grpidt = _isnull(trobj1.attr('order_mcrmx'),'') ;
      trname = trobj1.attr("name") ;
      if (grpidt!='')
      {
         trindex1_ ++ ;
         if (groupnames.indexOf(","+trname+",")<0)
         groupnames = groupnames + trname+"," ;
         trobjs__[trindex1_] =
         {
            count:0,name:trname,trobj:trobj1,names:[],nameindex:groupnames.indexOf(","+trname+",")
         }
         ;
      }
      else
      {
         groupold = "" ;
         if (groupnames.indexOf(","+trname+",")>=0)
         try
         {
            eval("groupold="+trname+"_groupold") ;
         }
         catch (e)
         {
         }
         finally
         {
         }
         else
         {
            groupold = "034243--=2__)" ;
            groupnames = groupnames + trname+"," ;
         }
         ;
         groupold = _isnull(groupold,"") ;
         val1 = trobj1.html() ;
         if (groupold == val1)
         {
            trobj1.remove() ;
         }
         else
         {
            try
            {
               eval(trname+"_groupold=val1") ;
            }
            catch (e)
            {
            }
            finally
            {
            }
            ;
            trobj1.attr("order_mcrmx",_grp_ident2) ; _grp_ident2 ++ ;
            trindex1_ ++ ;
            trobjs__[trindex1_] =
            {
               count:0,name:trname,trobj:trobj1,names:[],nameindex:groupnames.indexOf(","+trname+",")
            }
            ;
         }
         ;
      }
      ;
   }
   ) ;
   newi1 = ____ident() ;

   if (trobjs__.length==1)
   {
      trobjs__[trobjs__.length] =
      {
         count:0,name:tbname+"nouseforsystem",trobj:pobj3.$("#"+tbname+"nouseforsystem"),names:[],nameindex:1
      }
      ;
   }
   ;
   iiii = 0; iiiii=0;
   for (iiii=0; iiii<trobjs__.length; iiii++)
   {
      iiiii=0;
      pobj3.$("*[name]",trobjs__[iiii].trobj).each(function()
      {
         fmt = this.name ;
         fmt = _isnull(fmt,"") ;
         fmt1 = fmt.indexOf("_") ;
         if (fmt1>0)
         {
            method1 = fmt.substr(0, fmt1) ;
            fmt = fmt.substr(fmt1 + 1) ;
            if ((method1=="sum") || (method1=="count") || (method1=="avg"))
            {
               trobjs__[iiii].names[iiiii] =
               {
                  name:fmt,method:method1,count:0,value:0,tdobj:this
               }
               ;
               iiiii ++ ;
            }
            ;
         }
         else
         {
            if (fmt=="count")
            {
               trobjs__[iiii].names[iiiii] =
               {
                  name:"count",method:"count",count:0,value:0,tdobj:this
               }
               ;
               iiiii ++ ;
            }
            ;
         }
         ;
      }
      ) ;

   }
   ;
   newi2 = ____ident() ;
   trindex1_ = 0 ;
   var i0921 = 0 ;
   pobj3.$("tr",thepagetrs).each(function()
   {
      trobj2 = $(this) ;
      grpidt = _isnull(trobj2.attr('order_mcrmx'),'') ;
      if (grpidt!='')
      {
         for (trindex1_=0; trindex1_<trobjs__.length ; trindex1_++)
         if (trobjs__[trindex1_].trobj.attr('order_mcrmx')==grpidt)
         break ;
      }
      else
      {
         tri01 = 1 ;
         pobj3.$("td[name]:not('.tbdeletedtr')",trobj2).each(function()
         {
            tdobj = pobj3.$(this) ;
            tdobjname = tdobj.attr("name") ;
            val12 = tostr(_isnull(tdobj.attr("value"),"_090)32_0")) ;
            if (val12=="_090)32_0")
            {
               val12 = tdobj.html().toLowerCase() ;
               if (val12.indexOf(",")>=0) val12 = val12.replaceAll(",","") ;
               i0921 = val12.indexOf(">") ;
               if (i0921>=0) val12 = val12.substr(i0921+1) ;
               if ((val12=="") ||  (val12.indexOf("&")>=0)) val12 = tdobj.attr("title") ;
               val12 = _isnull(val12,"0") ;
            }
            ;
            if ((val12) && (val12 != '') && (val12 != '&nbsp;'))
            {
               doindex0 = 10000 ;
               for (var kiki = trindex1_ ; kiki>=0 ; kiki--)
               {
                  if (doindex0==trobjs__[kiki].nameindex) continue ;
                  if (doindex0<trobjs__[kiki].nameindex) continue ;
                  if (doindex0!=trobjs__[kiki].nameindex)
                  {
                     for (iiii=0; iiii<trobjs__[kiki].names.length; iiii++)
                     if (trobjs__[kiki].names[iiii].name==tdobjname)
                     break ;
                     if (iiii<trobjs__[kiki].names.length)
                     {
                        try
                        {
                           trobjs__[kiki].names[iiii].count = trobjs__[kiki].names[iiii].count + 1;
                           trobjs__[kiki].names[iiii].value = trobjs__[kiki].names[iiii].value + parseFloat(_tostr(val12)) ;  
                           
                        }
                        catch (e)
                        {

                        }
                        finally
                        {
                        }
                        ;
                     }
                     ;
                     doindex0=trobjs__[kiki].nameindex ;
                     trobjs__[kiki].count = trobjs__[kiki].count + tri01;
                  }
                  ;
               }
               ;
            }
            ;
            tri01 = 0 ;
         }
         );
         ///
      }
      ;
   }
   ) ;
   newi3 = ____ident() ;
   var obj12 = null ;
   var fmt1 = "" ;
   for (var i = 0 ; i<=trindex1_ ; i++)
   {
      cval = 0 ;
      for (var j = 0 ; j<trobjs__[i].names.length ; j++)
      {

         if ((trobjs__[i].names[j].method=="count") &&
         (trobjs__[i].names[j].count>0)) cval = trobjs__[i].names[j].count ;
         else
         if ((trobjs__[i].names[j].method=="avg") &&
         (trobjs__[i].names[j].count>0)) cval = trobjs__[i].names[j].value / trobjs__[i].names[j].count ;
         else cval = trobjs__[i].names[j].value ;
         	
                           	
         if (tbfldfunc) cval1 = tbfldfunc(trobjs__[i].names[j].method+"_"+trobjs__[i].names[j].name,cval,null,pobj3) ;
         else cval1 = cval;
         	
         	

         if (trobjs__[i].names[j].name=="count") cval1 = trobjs__[i].count ;
         if ((trobjs__[i].names[j].method=="avg") ||
         (trobjs__[i].names[j].method=="sum") ||
         (trobjs__[i].names[j].method=="count"))
         {
         	  
         	  fmt1 = _isnull(pobj3.$(trobjs__[i].names[j].tdobj).attr("fmt"),"")
         	  
         	  if (fmt1!="") 
         	  {
         	  	if (fmt1=="money") cval1 = "<font color='#a8a8a8'>￥</font>"+_fmtfloat(cval1,"#,##") ; else 
         	  	if (fmt1=="money0") 
         	  	{
         	  		if (_myparseFloat(cval1,0)==0) cval1 = "&nbsp;" ;
         	  		else cval1 = "<font color='#a8a8a8'>￥</font>"+_fmtfloat(cval1,"#,##") ;
         	  	} 	
         	  	else 
         	  	{
         	  		cval1 = _fmtfloat(cval1,fmt1) ;
         	  	} ;	
         	  } ;	
         	  obj12 = pobj3.$("span.noaccount",trobjs__[i].names[j].tdobj) ;
         	  if (obj12.length==1) obj12.html(_isnull(cval1,"&nbsp;")) ;
            else pobj3.$(trobjs__[i].names[j].tdobj).html(_isnull(cval1,"&nbsp;")) ;
         }
         ;
      }
      ;
   }
   ;
   var newi4 = ____ident() ;
   //alert((newi1-oldi)+" , "+(newi2-oldi)+" , "+(newi3-oldi)+" , "+(newi4-oldi)) ;
   //alert("group="+(newi4-oldi)) ;
}

// 以上是与TABLE有关的

// 以下是与TABLEEDIT有关的

function _togglegroup(pobj3,trobj100)
{
   if (typeof(trobj100)=="object") trobj1 = trobj100 ; else
   trobj1 = pobj3.document.getElementById(trobj100) ;
   trobj0 = trobj1 ;
   meetfirst = true;
   block1 = "" ;
   while (true)
   {
      trobj0 = trobj0.nextSibling ;
      if (trobj0==null)
      break ;
      if (trobj0==undefined)
      break ;
      trobj00 = pobj3.$(trobj0)  ;
      grpidt = _isnull(trobj00.attr('order_mcrmx'),'') ;
      if (grpidt!="")
      break ;
      if (meetfirst)
      {
         block1 = _isnull(trobj00.css("display"),"") ;
         block1 = block1.toLowerCase() ;
         if (block1!="none") block1 = "block" ;
         if (block1=="block") block1 = "none" ; else block1 = "block" ;
         meetfirst = false ;
      }
      ;
      trobj00.css("display",block1) ;
   }
   ;

   if (block1=="block")
   {
      pobj3.$("*.plus",pobj3.$(trobj1)).removeClass("plus").addClass("minus") ;
      try
      {
         pobj3.needautoframeheight() ;
      }
      catch (e)
      {
      }
      finally
      {
      }
      ;
   }
   else
   {
     pobj3.$("*.minus",pobj3.$(trobj1)).removeClass("minus").addClass("plus") ;
   }
   ;
   return block1=="block" ;
}
function _togglegroup_son(pobj3,tdobj100)
{
   if (typeof(tdobj100)=="object") trobj1 = tdobj100 ; else
   trobj1 = pobj3.document.getElementById(tdobj100) ;
   return _togglegroup(pobj3,pobj3.$(trobj1).parent()[0])
}
function _togglegroup_son_son(pobj3,obj100)
{
   if (typeof(obj100)=="object") trobj1 = obj100 ; else
   trobj1 = pobj3.document.getElementById(obj100) ;
   return _togglegroup(pobj3,pobj3.$(trobj1).parent().parent()[0])
}
function _groupeachtr(pobj3,trobj100,funccb1)
{
   if (typeof(trobj100)=="object") trobj1 = trobj100 ; else
   trobj1 = pobj3.document.getElementById(trobj100) ;
   trobj0 = trobj1 ;
   while (true)
   {
      trobj0 = trobj0.nextSibling ;
      if (trobj0==null)
      break ;
      if (trobj0==undefined)
      break ;
      trobj00 = pobj3.$(trobj0)  ;
      grpidt = _isnull(trobj00.attr('order_mcrmx'),'') ;
      if (grpidt!="")
      break ;
      funccb1(trobj00) ;
   }
   ;
}
function _groupeachtr_son(pobj3,tdobj100,funccb1)
{
   if (typeof(tdobj100)=="object") trobj1 = tdobj100 ; else
   trobj1 = pobj3.document.getElementById(tdobj100) ;
   return _groupeachtr(pobj3,pobj3.$(trobj1).parent()[0],funccb1)
}
function _groupeachtr_son_son(pobj3,obj100,funccb1)
{
   if (typeof(obj100)=="object") trobj1 = obj100 ; else
   trobj1 = pobj3.document.getElementById(obj100) ;
   return _groupeachtr(pobj3,pobj3.$(trobj1).parent().parent()[0],funccb1)
}


// edit table

function _removelastfocus(pobj3)
{
   if (pobj3._edit_table=="") return  false ;
   if (pobj3._edit_td==null) return  false ;
   
   tdobj1 = pobj3.$(pobj3._edit_td) ;
   if (tdobj1.hasClass("tdb")) 
     tdobj1.removeClass("editacell").removeClass("editingacell").removeClass("editacellreadonly").css("border-bottom","1px solid #BBC8C8");
   else  tdobj1.removeClass("editacell").removeClass("editingacell").removeClass("editacellreadonly").css("border-bottom","none"); 
   pobj3._edit_td = null ;    
}
function _restorevalue(pobj3)
{
   if (pobj3._edit_table=="") return  false ;
   tdobj01 = pobj3.$(pobj3._edit_td) ;
   if (tdobj01.length<=0) return  false ;
   tdoldval = _isnull(tdobj01.attr("oldvalue"),"~~~~") ;
   if (tdoldval=="~~~~") return  false ;
   tdoldhtml = _isnull(tdobj01.attr("oldhtml"),"~~~~") ;
   if (tdoldhtml=="~~~~") return  false ;
   tdobj01.attr("value",_tohex(tdoldval)) ;
   tdobj01.html(_tostr(tdoldhtml)).removeClass("tbupdatedtr") ;
}
function _unfocustable(pobj3,tbobj)
{
   _removelastfocus(pobj3) ;
   pobj3._edit_pageindex = 0 ;
   pobj3._edit_rowi = 0 ;
   pobj3._edit_table	= "";
}
function _focuseditcell(pobj3,edit112)
{
	 var editit11 = _isnull(edit112,"1") ;
   if (pobj3._edit_table=="") return  false ;

   currtd = pobj3.$("tr td[rowij="+pobj3._edit_rowi+"_"+pobj3._edit_coli+"]",pobj3._edit_currpage) ;
   if (currtd.length<=0) 
   {
   	 return  false ;
   } ;	
   if (currtd.length>1) 
   {
   	 var itd1 = 0 ;var cutd1 = -1 ;
   	 currtd.each(
   	 function()
   	 {
   	 	 itd1 ++ ;
   	 	 if ($(this).parent().parent().parent()[0].id==pobj3._edit_table) 
   	 	 {
   	 	 	 cutd1 = itd1 - 1 ;
   	 	 } ;
   	 }) ;
   	 if (cutd1>=0) 
   	 {
   	 	 currtd = $(currtd[cutd1]) ;
   	 } else return  false ;
   } ;
   if (currtd.html().indexOf("my_cell_edit")<0)
   {
   	  var obj12 = pobj3.$("#my_cell_edit") ;
      if (obj12.length>0) 
      {
      	_editedacell(pobj3,obj12[0]) ;
      	currtd = pobj3.$("tr td[rowij="+pobj3._edit_rowi+"_"+pobj3._edit_coli+"]",pobj3._edit_currpage) ;
      	if (currtd.length>1) 
			   {
			   	 var itd1 = 0 ;var cutd1 = -1 ;
			   	 currtd.each(
			   	 function()
			   	 {
			   	 	 itd1 ++ ;
			   	 	 if ($(this).parent().parent().parent()[0].id==pobj3._edit_table) 
			   	 	 {
			   	 	 	 cutd1 = itd1 - 1 ;
			   	 	 } ;
			   	 }) ;
			   	 if (cutd1>=0) 
			   	 {
			   	 	 currtd = $(currtd[cutd1]) ;
			   	 }  ;
			   } ;
      } ;	
      if (currtd.attr("edit")=="0")
      {
      	 pobj3._edit_td = currtd[0] ;
         currtd.addClass("editacell").removeClass("editingacell").css("border-bottom","2px solid black");
      }
      else
      {
      	 pobj3._edit_td = null ;
      	 if (currtd.hasClass("tdb"))
           currtd.addClass("editacellreadonly").removeClass("editingacell").css("border-bottom","1px solid #BBC8C8");
         else   
         	 currtd.addClass("editacellreadonly").removeClass("editingacell").css("border-bottom","none");
         
      }
      ;
   }
   ;
   try
   {
      if (currtd[0]==pobj3._tooltip_father)
      {
         pobj3._tooltip_father = null ;
         pobj3.hidefloattooltip() ;
      }
      ;
   }
   catch (e)
   {
   }
   finally
   {
   }
   ;
   if (editit11=="0") _editacell(pobj3,currtd[0]) ;
}

function _focuscellxy(pobj3,tdobj)
{
   if (pobj3._edit_table=="") return  false ;
   //var _edit_coli11 = parseInt(pobj3.$(tdobj).attr("coli")) ;
   //var _edit_rowi11 = parseInt(pobj3.$(tdobj).attr("rowi")) ;
   //if ((_edit_coli1==_edit_coli11) && (_edit_rowi1==_edit_rowi11)) return ; 
   
   _edit_coli1 = parseInt(pobj3.$(tdobj).attr("coli")) ;
   _edit_rowi1 = parseInt(pobj3.$(tdobj).attr("rowi")) ;
   
   if ((pobj3._edit_coli==_edit_coli1) && (pobj3._edit_rowi==_edit_rowi1))
   {
      if (pobj3.document.getElementById("my_cell_edit"))
      {
         _focuseditcell(pobj3);
         return  false ;
      }
      ;
      if (pobj3.editacell(tdobj)) pobj3.$("#"+"my_cell_edit").focus() ;
      _focuseditcell(pobj3);
   }
   else
   {
   	  _removelastfocus(pobj3) ;
      pobj3._edit_coli = _edit_coli1 ;
      pobj3._edit_rowi = _edit_rowi1 ;
      _focuseditcell(pobj3);
   }
   ;
}


function _focustable(pobj3,tbobj1)
{
   if (!tbobj1) return  false ;
   if (tbobj1.id==pobj3._edit_table) return  false ;
   _removelastfocus(pobj3) ;
   pobj3._edit_table	= tbobj1.id ;
   var objs1 = pobj3.$("tbody[name=foot] tr td[name=calc]") ;
   if (objs1.length>0) 
   {
   	pobj3._edit_table_manul_calc_group = pobj3.$(objs1[0]) ;
   }   else pobj3._edit_table_manul_calc_group = null ;
   pobj3._edit_coli = _edit_col0 ;
   pobj3._edit_rowi = _edit_row0 ;

   pobj3._edit_pageindex = 1 ;
   pobj3._edit_currpage  =pobj3.$("#"+pobj3._edit_table+" tbody[name=details_auto]:first") ;
   obj11 = pobj3.$(" tr td[rowij]",pobj3._edit_currpage) ;
   lastrow_ = obj11.eq(obj11.length-1);
   //alert(obj11.length) ;
   pobj3._edit_maxrow = parseInt(lastrow_.attr("rowi")) ;
   pobj3._edit_maxcol = parseInt(lastrow_.attr("coli")) ;
   lastrow_ = obj11.eq(0);
   pobj3._edit_row0 = parseInt(lastrow_.attr("rowi")) ;
   pobj3._edit_col0 = parseInt(lastrow_.attr("coli")) ;
   pobj3._edit_rowi = pobj3._edit_row0 ;
   pobj3._edit_coli = pobj3._edit_col0 ;
   
   _focuseditcell(pobj3);
}
function _parsetrobj(pobj3,trobj)
{
   pobj3.$f = [] ;
   orderi00 = -1 ;
   trobj.find("td[name]").each(function()
   {
      tdname01 = _isnull($(this).attr("name"),"") ;
      tdname01 = tdname01.trim() ;
      tdvalue01 = _tostr(_isnull($(this).attr("value"),"_0_0_90_")) ;
      if (tdvalue01=="_0_0_90_")
      {
         tdvalue01 = _isnull($(this).html(),"") ;
         tdvalue01 = tdvalue01.trim() ;
         if (tdvalue01=="&nbsp;") tdvalue01 = "" ;
      }
      ;
      if (tdname01!="")
      {
         orderi00 ++ ;
         try {eval("_"+tdname01+"="+orderi00) ;} catch(E) {} finally {} ;
         try {pobj3.$f[orderi00] = tdvalue01 ;} catch(E) {} finally {} ;
      }
      ;
   }
   ) ;
}
function _editacell(pobj3,tdobj)
{
   if (pobj3._edit_table=="") return  false ;
   if (tdobj==null) return  false ;
   if (tdobj==undefined) return  false ;
   
   var tdvalue = _tostr(_isnull(pobj3.$(tdobj).attr("value"),"lx_p_nul_l")) ;
   if (tdvalue=="lx_p_nul_l")
   {
      tdvalue = tdobj.innerHTML ;
      if (tdvalue.toLowerCase()=="&nbsp;") tdvalue = "" ;
      pobj3.$(tdobj).attr("value",_tohex(tdvalue));
   }
   ;
   var tdhtml = _isnull(pobj3.$(tdobj).attr("oldhtml"),"lx_p_nul_l") ;
   if (tdhtml=="lx_p_nul_l")
   {
      tdhtml = tdobj.innerHTML ;
      pobj3.$(tdobj).attr("oldhtml",_tohex(tdhtml)) ;
   }
   ;
   var canedit =_isnull(pobj3.$(tdobj).attr("edit"),"1") ;
   if (canedit!="0") return false ;
   var oldvalue = _isnull(pobj3.$(tdobj).attr("oldvalue"),"~~~~~~~") ;
   if (oldvalue=="~~~~~~~")
   {
      pobj3.$(tdobj).attr("oldvalue",tdvalue) ;
   }
   ;
   var trobj1 = pobj3.$(tdobj).parent()[0] ;
   _parsetrobj(pobj3,pobj3.$(trobj1)) ;
   var trord2id1 = pobj3.$(trobj1).attr("value") ;
   var tdname1 = _isnull(pobj3.$(tdobj).attr("name"),"") ;
   var tdtype1 = _isnull(pobj3.$(tdobj).attr("type"),"text").trim().toLowerCase() ;
   var tdformat1 = _isnull(pobj3.$(tdobj).attr("format"),"").trim().toLowerCase() ;
   var tdfmt1 = _isnull(pobj3.$(tdobj).attr("fmt"),"").trim().toLowerCase() ;
   
   var tdsource1 = _isnull(pobj3.$(tdobj).attr("source"),"") ;
   var tdpick1 = _isnull(pobj3.$(tdobj).attr("pick"),"") ;
   
   if (tdpick1!="")  tdpick1 = " pick=1 " ;
   if (tdfmt1!="")   tdfmt1 = " fmt="+tdfmt1 ;

   var tdmulti = _isnull(pobj3.$(tdobj).attr("multi"),"") ;
   if (tdmulti!="") tdmulti = " multi=0 " ;
   var tddetailsid = _isnull(pobj3.$(tdobj).attr("details"),"") ;
   var tddetailssrc = _isnull(pobj3.$(tdobj).attr("detailssource"),"") ;

   if (tddetailsid!="") tddetailsid = " details="+tddetailsid+" " ;
   if (tddetailssrc!="") tddetailssrc = " detailssource="+tddetailssrc+" " ;

   var tdonvalid = _isnull(pobj3.$(tdobj).attr("onvalid"),"") ;
   var tdinvalid = _isnull(pobj3.$(tdobj).attr("invalid"),"") ;

   if (tdonvalid!="") tdonvalid = " onvalid="+tdonvalid+" " ;
   if (tdinvalid!="") tdinvalid = " invalid=\""+tdinvalid+"\" " ;

   var readonly1 =  _isnull(pobj3.$(tdobj).attr("myreadonly"),"") ;
   if (readonly1!="") readonly1 = " readOnly=readOnly " ;
   
   var nonmandatory1 =  _isnull(pobj3.$(tdobj).attr("nonmandatory"),"") ;
   if (nonmandatory1!="") nonmandatory1 = " nonmandatory=1 " ;
   
   
   if (tdsource1!="") tdsource1 = " source=\""+_tohex(tdsource1)+"\" " ;
   if (tdformat1!="") tdformat1=" onkeypress=defaultkeypress(event,'"+tdformat1+"') " ;
 
   eval("if (pobj3."+pobj3._edit_table+"_beforeedit__) tdvalue=pobj3."+pobj3._edit_table+"_beforeedit__(tdname1,tdvalue,tdobj,trobj1)") ;
   tdvalue = "_"+tdvalue ;
   tdvalue = tdvalue.trim() ;
   if ((tdvalue.substr(1,1)=="<") && (tdvalue.substr(tdvalue.length-1,1)==">"))
   {
   	  tdvalue = tdvalue.substr(1) ;
      pobj3.$(tdobj).html(tdvalue) ;
   }
   else
   {
   	  var i1 = tdvalue.indexOf("T") ;
   	  var i2 = tdvalue.indexOf(":") ;
   	  if ((i1>0) && (i2>i1)) 
   	  {
   	  	if ((tdfmt1=="") || (tdfmt1.indexOf("h")>=0)) 
   	  	{
   	  		var tfv1 = tdvalue.substr(i1+1) ;
   	  		tfv1 = tfv1.substr(0,8) ;
   	  		tdvalue = tdvalue.substr(0,i1)+" "+tfv1 ;
   	  	} else
   	  	{
   	  		tdvalue = tdvalue.substr(0,i1) ;
   	  	} ;	
   	  }
   	  tdvalue = tdvalue.substr(1) ;
      if (tdtype1=="date")
      {
         pobj3.$(tdobj).html("<input ord2id="+trord2id1+" tdname="+tdname1+" onkeydown=cellkeydown() onkeyup=cellkeyup() type=text name='celledit' id=my_cell_edit class=ednone onblur='editonblur(this)'  "+nonmandatory1+readonly1+tdfmt1+tdpick1+tdinvalid+tdonvalid+tdmulti+tdformat1+tddetailsid+tddetailssrc+"  style='width:100%' oldvalue=\""+_tohex(tdvalue)+"\" value=\""+tdvalue+"\">") ; //onblur='editedacell(this)'  //editonblur
      }
      else
      {
         pobj3.$(tdobj).html("<input ord2id="+trord2id1+" tdname="+tdname1+" onkeydown=cellkeydown() onkeyup=cellkeyup() type=text name='celledit' "+tdsource1+"id=my_cell_edit onblur='editonblur(this)'  "+nonmandatory1+readonly1+tdfmt1+tdpick1+tdinvalid+tdonvalid+tdmulti+tdformat1+tddetailsid+tddetailssrc+" class=ednone  style='width:100%' oldvalue=\""+_tohex(tdvalue)+"\" value=\""+tdvalue+"\">") ;//onblur='editedacell(this)'
      }
      ;
      pobj3._edit_input = pobj3.$("#my_cell_edit")[0] ;
      selectall(pobj3._edit_input) ;
   }
   ;
   pobj3.$(tdobj).addClass("editingacell").removeClass("editacell").removeClass("editacellreadonly").css("border-bottom","2px solid black");
   //alert("<input type=text "+tdsource1+"id=my_cell_edit "+tdformat1+tddetailsid+tddetailssrc+" class=ednone onblur='editedacell(this)' style='width:100%' value=\""+tdvalue+"\">") ;
   return true ;
}
function _checkpost1row(pobj3,trdomobj1,url1,callb1)
{
	_checkpost1row__(pobj3,trdomobj1,url1,false,callb1) ;
}
function _checkpost1row_return(pobj3,trdomobj1,url1)
{
	return _checkpost1row__(pobj3,trdomobj1,url1,true) ;
}
function _gettdvalue($tdobj1)
{
	if (!$tdobj1) return "" ;
	var tdv1 =_tostr(_isnull($tdobj1.attr("value"),"_09_)90_")) ;
  if (tdv1=="_09_)90_")
  {
      tdv1 =_isnull($tdobj1.html(),"") ;
      if (tdv1==String.fromCharCode(160)) tdv1 = "" ;
   		if (tdv1=="&nbsp;") tdv1 = "" ;
   		if (tdv1=="&#160;") tdv1 = "" ;
   		if (tdv1.indexOf("my_cell_edit")>0) 
   		{
   			var obj123 = $tdobj1.find("#my_cell_edit") ;
   			if (obj123.length>0)
   			  tdv1 = obj123[0].value ;
   			else tdv1 = "" ;
   			if (tdv1=="") 
   			{
   				$tdobj1.html("&nbsp;") ;
   			} else 
   			{
   				$tdobj1.html(tdv1) ;
   			} ;   
   		} ;
  };
  return tdv1 ;
};
function _checkpost1row__(pobj3,trdomobj1,url1,ret1,callb1)
{
   //if (pobj3._edit_table=="") return  false ;
   var tdfmt = "" ;
   var isformula = false;
   var oldv1 = "" ;
   var url11 = url1 ;
   var qmark1 = url11.indexOf("?") ;
   var haschange = false ;
   if (url1.indexOf(".asp")>=0) 
   {
   	url11 = url1 ;
   } else 
   {
     if (qmark1>0) url11 = "&"+url11.substr(qmark1+1) ; 
     else url11 = "" ;
     url11 = "modify_"+pobj3._edit_table+url11 ;
   } ;  	

   var haserror1 = false ;
   
   var hasbpost = false ;
   eval("if (pobj3."+pobj3._edit_table+"_beforepost__) hasbpost = true ;") ;
   var params1 = "{ord2_id:"+_isnull(pobj3.$(trdomobj1).attr("value"),"0")+
   					 ",id:"+_isnull(pobj3.$(trdomobj1).attr("value"),"0")+"," ;
   _parsetrobj(pobj3,pobj3.$(trdomobj1)) ;
   var tdfldextobj1 = null ;
   
   var _ord2flds_ = ["ord2_foreign_id","ord2_ford2id","ord2_caption","ord2_tag","ord2_prdid",
		"ord2_code","ord2_brand","ord2_title","ord2_model","ord2_pack","ord2_spec","ord2_unit","ord2_price",
		"ord2_amount","ord2_amount0","ord2_fee","ord2_batch","ord2_mdate","ord2_expdays","ord2_location",
		"ord2_prp01","ord2_prp02","ord2_prp03","ord2_prp04","ord2_prp05","ord2_prp06","ord2_prp07","ord2_prp08",
		"ord2_prp09","ord2_prp10","ord2_num01","ord2_num02","ord2_num03","ord2_amount1","ord2_amount2",
		"ord2_fee1","ord2_fee2","ord2_note","ord2_bid","ord2_bname","ord2_discount","ord2_tmpid","ord2_tmpidordid",
		"ord2_prdpoolid","ord2_status","ord2_equid","ord2_equcode","ord2_equtitle","ord2_ccid","ord2_cccode",
		"ord2_cccomp","ord2_ccname","ord2_cuid","ord2_cucode","ord2_cuname","ord2_ccbiid","ord2_ccbicode",
		"ord2_ccbiname","ord2_price0","ord2_price01","ord2_price2","ord2_price3","ord2_price1","ord2_price11",
		"ord2_amount3","ord2_amount4","ord2_fee3","ord2_fee4","ord2_amount5","ord2_amount6","ord2_fee5",
		"ord2_fee6","ord2_nouse","ord2_expdate"] ;
	 for (var ijo = 0 ; ijo<_ord2flds_.length ; ijo++) 
	 {
	 	 oldv1 = _isnull(pobj3.$(trdomobj1).attr("updated_"+_ord2flds_[ijo]),"32123ewd34") ;
	 	 if (oldv1!="32123ewd34") 
	 	 {
	 	 	 try { eval(_ord2flds_[ijo]+"_v_s_1=oldv1") ;} catch(E) {} finally {} ;
       params1 += _ord2flds_[ijo] +":"+_ord2flds_[ijo]+"_v_s_1," ;
	 	 } ;
	 } ;
   pobj3.$("td.tbupdatedtr[name],td.tbinsertedtr[name],td[formula]",trdomobj1).each(function()
   {
      tdname1 =pobj3.$(this).attr("name") ;
      tdfldextobj1 = pobj3.$("input[fieldext="+tdname1+"]",trdomobj1) ;
      tdobj =  pobj3.$(this) ;
      oldv1 = _tostr(_isnull(tdobj.attr("oldvalue"),"+-232d938dxad1~~")) ;
      tdfmt = _isnull(tdobj.attr("fmt"),"") ;
      tdvalue1 =_gettdvalue(tdobj) ;
      if (tdfldextobj1.length==1) 
      {
      	try 
      	{
      		tdvalue1 = pobj3.fldextension(tdname1,tdvalue1,tdfldextobj1) ;
      	} catch(E) {} finally {} ;
      } ;
      isformula = _isnull(tdobj.attr("formula"),"")!="" ;
      //alert(tdname1+"\n"+tdvalue1+"\n"+oldv1) ;
      if ((tdname1!="")) //if ((tdname1!="") && ((tdvalue1!=oldv1) || (isformula)))
      {
           if (hasbpost) eval("tdvalue1=pobj3."+pobj3._edit_table+"_beforepost__(tdname1,tdvalue1,tdobj[0],trdomobj1)") ;
           params1 += tdname1 ;
           params1 +=":" ;
           tdvalue1 = _isnull(tdvalue1,"") ;
           
           if ((tdfmt=="money") || (tdfmt=="money0")) tdvalue1 = _fmtfloat(tdvalue1,"#.##") ;
           if (tdfmt.substr(0,1)=="#") tdvalue1 = _fmtfloat(tdvalue1,tdfmt.replaceAll("0","")) ;
           if (tdname1=="note") 
           {
           	 if (tdvalue1.length>7000) 
           	 {
           	 	 alert("某项内容太多，系统规定不能超过7000个字符，请重新调整内容.\n\n"+
           	 	 "具体内容如下：\n"+tdvalue1) ;
               haserror1 = true ;
           	 } ;  
           } ;
           tdvalue1 = _tohex(tdvalue1) ;
           try { eval(tdname1+"_v_s_=tdvalue1") ;} catch(E)
           {
           	 haserror1 = true ;
           	 alert("系统分析分析时，发现以下数据错误：\n"+
           	 E.message+"\n\n"+
           	 "对应数据项为"+tdname1+"\n"+_tostr(tdvalue1)) ;
           } finally {} ;
           params1 +=tdname1+"_v_s_," ;
      }
         ;
   }
   ) ;
   params1 += "idd0190:'0' }" ;

   if (haserror1) return false ;
   
   eval("params2 = "+params1) ;
        //clipboardData.setData("Text",params1);
         haschange = true ;
         if (ret1) 
         {
         	pobj3.$("td.tbupdatedtr,td.tbinsertedtr",pobj3.$(trdomobj1)).removeClass("tbupdatedtr").removeClass("tbinsertedtr") ;
         	return _runsqlandreturn(pobj3,url11, params2);
         }	
         else 
         	{
            if (callb1) 
            {
            	pobj3.$("td.tbupdatedtr,td.tbinsertedtr",pobj3.$(trdomobj1))
            	.removeClass("tbupdatedtr").removeClass("tbinsertedtr").addClass("___saving") ;
         		  _runsql(url11,params2,function()
         		  {
         		  	callb1() ;
         		  	pobj3.$(".___saving",pobj3.$(trdomobj1)).removeClass("___saving") ;
         		  },
         		  function(err1)
         		  {
         		  	alert("提交数据的时候出错了：\n"+err1) ;
         		  	pobj3.$(".___saving",pobj3.$(trdomobj1)).removeClass("___saving").addClass("tbupdatedtr") ;
         		  }) ;
						}         		  
         		else   
         		{
         			pobj3.$("td.tbupdatedtr,td.tbinsertedtr",pobj3.$(trdomobj1)).removeClass("tbupdatedtr").removeClass("tbinsertedtr").addClass("___saving") ;
         			_runsql(url11,params2,
         			function()
         			{
         				pobj3.$(".___saving",pobj3.$(trdomobj1)).removeClass("___saving") ;
         			},
         			function(err1)
         			{
         				alert("提交数据的时候出错了：\n"+err1) ;
         		  	pobj3.$(".___saving",pobj3.$(trdomobj1)).removeClass("___saving").addClass("tbupdatedtr") ;
         			}) ;
         		} ;
         	} ;	

}

function _checkpost(pobj3,url1)
{
   if (pobj3._edit_table=="") return  false ;
   var url11 = url1 ;
   _loadingtitle = "正在提交数据..." ;
   _loading(true) ;
 
   var qmark1 = url11.indexOf("?") ;
   var haschange = false ;
   var params1 = "" ;
   var tdname1 = "" ;
   var tdobj = null ;
   var tdvalue1 = "" ;
   var trobj1 = null ;
   
   if (qmark1>0) url11 = "&"+url11.substr(qmark1+1) ; else url11 = "" ;
   pobj3.$("tr",pobj3._edit_currpage).each(function()
   {
      params1 = "{ " ;
      pobj3.$(this).find("td[name]").each(function()
      {
         tdname1 =_isnull(pobj3.$(this).attr("name"),"").trim() ;
         tdobj =  pobj3.$(this) ;
         tdvalue1 =_tostr(_isnull(tdobj.attr("value"),"_09_)90_")) ;
         if (tdvalue1=="_09_)90_")
         {
            tdvalue1 =_isnull(pobj3.$(this).html(),"") ;
            if ((tdvalue1.toLowerCase()=="&nbsp;")) tdvalue1 = "" ;
         }
         ;
         trobj1 = pobj3.$(this).parent()[0] ;
         _parsetrobj(pobj3,pobj3.$(trobj1)) ;
         if (tdname1!="")
         {
            eval("if (pobj3."+pobj3._edit_table+"_beforepost__) tdvalue1=pobj3."+pobj3._edit_table+"_beforepost__(tdname1,tdvalue1,tdobj[0],trobj1)") ;
            params1 += tdname1 ;
            params1 +=":'" ;
            tdvalue1 = _tohex(tdvalue1) ;
            if ((tdvalue1=="~h`A000") || (tdvalue1=="~h`a000")) tdvalue1 ="" ;
            params1 +=tdvalue1+"'," ;
         }
         ;
      }
      ) ;
      params1 += "idd0190:'0' }" ;
      eval("params2 = "+params1) ;
			
      if (pobj3.$(this).find("td.tbupdatedtr").length>0)
      {
         haschange = true ;
         _runsqlandreturn(pobj3,"modify_"+pobj3._edit_table+url11,params2) ;
      }
      ;
   }
   ) ;
   if (haschange) alert("数据保存完毕。") ;
   _loadingtitle = "Loading..." ;
   _loading(false) ;
}
function _setformulavalues(pobj3,fmt11,tbid1)
{
	 if (fmt11=="") return  false ;
	 var tbid2 = tbid1 ;
	 tbid2 = isnull(tbid2,"formula_changed") ;
	 if (tbid2!="formula_changed") tbid2 = "#"+tbid2 ;
	 var fmt1 = fmt11 ;
	 var jqstr1 = fmt1 ;
	 var i= 0 ;
   var s1 = "" ;
   var obj212 = null ;
	 while (jqstr1!="")
	 {
	 	 i = jqstr1.indexOf("<") ;
	 	 if (i<0) jqstr1 = "" ;
	 	 else jqstr1 = jqstr1.substr(i+1) ;
	 	 i = jqstr1.indexOf(">") ;
	 	 if (i<0) jqstr1 = "" ;
	 	 else 
	 	 {
	 	 	 s1 = jqstr1.substr(0,i) ;
	 	 	 if ((s1.indexOf(".")>0) && (s1.indexOf("f.")!=0))
	 	 	 {
		 	 	 i = pobj3.rootstr_forformula.indexOf(s1) ;
		 	 	 if (i<0) 
		 	 	 {
		 	 	   pobj3.rootstr_forformula.push(s1) ;
		 	 	   i = s1.indexOf(".foot.") ;
				 	 if (i>0) s1 = "#"+s1.replace(".foot."," tbody[name=foot] tr td[name=")+"]" ;
				 	 else 
				 	 {	
				 	 	 if (s1.indexOf("g.")>=0) 
				 	 	 {
				 	 	 	 s1 = "input[name="+s1.substr(2)+"]" ;
				 	 	 } else 
				 	 	 {
				 	 	   s1 = "#"+s1.replace("r.","") ;
				 	 	 } ;
				 	 } ;
				 	 obj212 = pobj3.$(s1) ;
				 	 pobj3.rootobj_forformula.push(obj212) ;
				 	 
		 	 	 } else
		 	 	 {
		 	 	 	 obj212 = pobj3.rootobj_forformula[i] ;
		 	 	 } ;
		 	 	 if (obj212.length>0) obj212.addClass(tbid2) ;
	 	 	 } else 
	 	 	 {
	 	 	 	 i = pobj3.rootstr_forformula.indexOf(s1) ;
		 	 	 if (i<0) 
		 	 	 {
		 	 	   pobj3.rootstr_forformula.push(s1) ;
		 	 	   s1 = "#"+s1;
				 	 obj212 = pobj3.$(s1) ;
				 	 pobj3.rootobj_forformula.push(obj212) ;
		 	 	 } else
		 	 	 {
		 	 	 	 obj212 = pobj3.rootobj_forformula[i] ;
		 	 	 } ;
		 	 	 if (obj212.length>0) obj212.addClass(tbid2) ;
	 	 	 } ;
	 	 	 jqstr1 = jqstr1.substr(i+1) ;
	 	 } ;	
	 } ;
	 
	 var j=0 ;
	 var jj = 0 ;
	 var val12 = "" ;
	 var f001 = 0 ;
	 for (i=0;i<pobj3.rootstr_forformula.length;i++)
	 {
	 	 j = fmt1.indexOf(pobj3.rootstr_forformula[i]) ;
	 	 if ((j>=0) && (pobj3.rootobj_forformula[i].length>0))
	 	 {
	 	 	 if (pobj3.rootobj_forformula[i].length>1)
	 	 	 {
	 	 	 	 val12 = 1 ;
	 	 	 	 pobj3.rootobj_forformula[i].each(
	 	 	 	 function()
	 	 	 	 {
	 	 	 	 	 if (this.checked) val12 = $(this).val() ;
	 	 	 	 }) ;
	 	 	 } else
	 	 	 {
		 	 	 val12 = _tostr(_isnull(pobj3.rootobj_forformula[i].attr("value"),"_90-9)2_")) ;
	       if (val12=="_90-9)2_")
	       {
	           val12 = pobj3.rootobj_forformula[i].html().toLowerCase() ;
	           val12 = (">"+val12).replaceAll(",","") ;
	           jj = val12.lastIndexOf(">") ;
	           if (jj>=0) val12 = val12.substr(jj+1) ;
	           if ((val12=="") || (val12.indexOf("<")>=0) || (val12.indexOf("&")>=0)) 
	           val12 = pobj3.rootobj_forformula[i].attr("title") ;
	       };
	     } ;  
       val12 = (""+val12).trim() ;
       f001 = _myparseFloat(val12,-90909090) ;
       if (f001==-90909090) val12 = "0" ;
       if (val12) fmt1 = fmt1.replaceAll("<"+pobj3.rootstr_forformula[i]+">","("+val12+")") ;
       else fmt1.replaceAll("<"+pobj3.rootstr_forformula[i]+">","(0)") ;
	 	 } ;
	 } ;
	return fmt1 ;
}
function _formulobj(pobj3,obj1,editable1)
{
	  var obj1111 = obj1 ;
	  var fmt1 = _isnull(pobj3.$(obj1).attr("formula"),"") ;
	  if (fmt1=="") return  false ;
	  var i091 =  fmt1.indexOf("val(") ;
      	 while (i091>=0) 
      	 {
      	 	  fmt1 = fmt1.replace("val(","pobj30val0(") ;
      	 	  i091 =  fmt1.indexOf("val(") ;
      	 } ;
	  fmt1 = fmt1.replaceAll("pobj30val0","pobj3.val") ;
	  if (fmt1.indexOf("myval$")>=0) 
	  {
	  	i091 =  fmt1.indexOf("myval$") ;
      	 while (i091>=0) 
      	 {
      	 	  fmt1 = fmt1.replace("myval$","pobj3000vasl$") ;
      	 	  i091 =  fmt1.indexOf("myval$") ;
      	 } ; 
		  fmt1 = fmt1.replaceAll("pobj3000vasl","pobj3.myval") ;
		  i091 =  fmt1.indexOf("(this,") ;
      while (i091>=0) 
      {
      	  fmt1 = fmt1.replace("(this,","(obj1111,") ;
      	  i091 =  fmt1.indexOf("(this,") ;
      } ;
      i091 =  fmt1.indexOf("(this)") ;
      while (i091>=0) 
      {
      	  fmt1 = fmt1.replace("(this)","(obj1111)") ;
      	  i091 =  fmt1.indexOf("(this)") ;
      } ;
		  fmt1 = fmt1.replaceAll("pobj3.pobj3.","pobj3.") ;
		} ;  
	  fmt1 = _setformulavalues(pobj3,fmt1,"") ;
	  
		var val12 = "" ;
		var error1 = "" ;
	  try
		{
			eval("val12="+fmt1);
		}
		catch (ee)
		{
			alert("公式计算有错，检查数据录入是否正确。\n\n"+ee.message+"\n\n"+fmt1) ;
			error1 = "有错" ;
		} finally	{	}	;
		if ((val12==undefined) || (val12==NaN) || (val12==Infinity)) val12 =  "0" ; else 
		if ((val12=="undefined") || (val12=="NaN") || (val12=="Infinity")) val12 =  "0" ; else 
		if (isNaN(val12)) val12=  "0" ; 
		val12 = _isnull(val12,"0") ;
		
		fmt1 = _isnull(pobj3.$(obj1).attr("fmt"),"") ;
		if (fmt1!="") 
		{
		if ((fmt1=="money") || (fmt1=="money0")) val12 = _fmtfloat(val12, "#.##") ;
		else if (fmt1.substr(0,1)=="#") val12 = _fmtfloat(val12, fmt1.replaceAll("0","")) ;  
		} ;
		
		if (error1=="") error1 = val12 ;
		var edit1111 = "1" ;
		if (editable1==true)  edit1111 = "0" ;
		if (obj1.tagName=="INPUT") pobj3.$(obj1).attr("modified",edit1111).val(error1) ;
		else  pobj3.$(obj1).html(error1) ;
}
function _formulatr(pobj3,trjq1)
{

	 var fmt1 = "" ;
	 var error1 = "";
	 var f001 = 0 ;
	 var obj12 = null ;
   var tbfldfunc1 = null ;
   var tdname1 = "" ;
   
   var obj12 = trjq1.parents("table:first") ;
   var tbid112 = "" ;
   if (obj12.length>0) tbid112 = _isnull(trjq1.parents("table:first")[0].id,"") ;
   if (tbid112==pobj3._edit_table) 
     eval("if ("+pobj3._myident+pobj3._edit_table+"_fldv___) tbfldfunc1="+pobj3._myident+pobj3._edit_table+"_fldv___") ;
   else  tbfldfunc1 = null ;
   var ftrjq1 = null ;
   var cls01 = _isnull(trjq1[0].className,"") ;
   var clsi = 0 ;
   clsi = cls01.indexOf("_") ;
   if (clsi>=0)  cls01 = cls01.substr(clsi) ; else cls01 = "" ;
   clsi = cls01.indexOf(" ") ;
   if (clsi>=0) cls01 = cls01.substr(0,clsi) ;
   if (cls01!="") cls01 = cls01.substr(1) ; // here cls01 = ord2_ford2id 
   if (cls01!="") 
   {
   	 ftrjq1 = pobj3.$("#ord2id_"+cls01) ;
   	 if (ftrjq1.length<=0) ftrjq1 = null ;
   } ;	 
   var hasfather = false ;
   var formulastr = "" ;
   var thistdname = "" ;
   var val12 = "" ;
   var i091  = 0 ;
   var thidtdobj = null ;
   pobj3.$("td[formula]",trjq1).each(function()
   {
   	  hasfather = false ;
      formulastr = pobj3.$(this).attr("formula");
      hasfather = formulastr.indexOf("<f.")>=0 ;
      if (formulastr!="")
      {
      	 thidtdobj = this ;
      	 i091 =  formulastr.indexOf("val(") ;
      	 while (i091>=0) 
      	 {
      	 	  formulastr = formulastr.replace("val(","pobj30val0(") ;
      	 	  i091 =  formulastr.indexOf("val(") ;
      	 } ;
      	 formulastr = formulastr.replaceAll("pobj30val0","pobj3.val") ;
      	 
      	 if (formulastr.indexOf("myval$")>=0) 
				 {
				 	 i091 =  formulastr.indexOf("myval$") ;
	      	 while (i091>=0) 
	      	 {
	      	 	  formulastr = formulastr.replace("myval$","pobj3000mdds$") ;
	      	 	  i091 =  formulastr.indexOf("myval$") ;
	      	 } ;
					 formulastr = formulastr.replaceAll("pobj3000mdds","pobj3.myval") ;
					 i091 =  formulastr.indexOf("(this,") ;
	      	 while (i091>=0) 
	      	 {
	      	 	  formulastr = formulastr.replace("(this,","(thidtdobj,") ;
	      	 	  i091 =  formulastr.indexOf("(this,") ;
	      	 } ;
	      	 i091 =  formulastr.indexOf("(this)") ;
	      	 while (i091>=0) 
	      	 {
	      	 	  formulastr = formulastr.replace("(this)","(thidtdobj)") ;
	      	 	  i091 =  formulastr.indexOf("(this)") ;
	      	 } ;
					 formulastr = formulastr.replaceAll("pobj3.pobj3.","pobj3.") ;
				 } ;  

      	 formulastr = _setformulavalues(pobj3,formulastr,tbid112) ;
         thistdname = _isnull(pobj3.$(this).attr("name"),"") ;
         
         pobj3.$("td[name]",trjq1).each(function()
         { 
         	  tdname1 = pobj3.$(this).attr("name") ;
         	  if (formulastr.indexOf("<"+tdname1+">")>=0) 
         	  {
	            val12 = _tostr(_isnull(pobj3.$(this).attr("value"),"_90-9)2_")) ;
	            if (val12=="_90-9)2_")
	            {
	               val12 = pobj3.$(this).html().toLowerCase() ;
	               if ((val12=="") || (val12.indexOf("<")>=0) || (val12.indexOf("&")>=0)) val12 = pobj3.$(this).attr("title") ;
	            }
	            ;
	            val12 = (""+val12).trim() ;
	            f001 = _myparseFloat(val12,-90909090) ;
	            if (f001==-90909090) val12 = "0" ;
	            if ((val12)) 
	            formulastr = formulastr.replaceAll("<"+tdname1+">","("+val12+")") ;
	            else   formulastr = formulastr.replaceAll("<"+tdname1+">","(0)") ;
	          } ;  	
         }
         ) ;
         if ((hasfather) && (ftrjq1!=null))
         {
         	   // 计算father tr 中的值
         	   pobj3.$("td[name]",ftrjq1).each(function()
		         { 
		         	  tdname1 = pobj3.$(this).attr("name") ;
		         	  if (formulastr.indexOf("<f."+tdname1+">")>=0) 
		         	  {
			            val12 = _tostr(_isnull(pobj3.$(this).attr("value"),"_90-9)2_")) ;
			            if (val12=="_90-9)2_")
			            {
			               val12 = pobj3.$(this).html().toLowerCase() ;
			               if ((val12=="") || (val12.indexOf("<")>=0) || (val12.indexOf("&")>=0)) val12 = pobj3.$(this).attr("title") ;
			            }
			            ;
			            val12 = (""+val12).trim() ;
			            f001 = _myparseFloat(val12,-90909090) ;
			            if (f001==-90909090) val12 = "0" ;
			            if ((val12)) 
			            formulastr = formulastr.replaceAll("<f."+tdname1+">","("+val12+")") ;
			            else   formulastr = formulastr.replaceAll("<f."+tdname1+">","(0)") ;
			          } ;  	
		         }
		         ) ;
         } ;
         val12 = "0" ;
         error1 = "" ;
     
         try
         {
            eval("val12="+formulastr);
         }
         catch (ee)
         {
         	  alert("公式计算有错，检查数据录入是否正确。\n\n"+ee.message+"\n\n"+formulastr) ;
         	  error1 = "有错" ;
         }
         finally
         {
         }
         ;
          
         if ((val12==undefined) || (val12==NaN) || (val12==Infinity)) val12 =  "0" ; else 
				 if ((val12=="undefined") || (val12=="NaN") || (val12=="Infinity")) val12 =  "0" ; else 
				 if (isNaN(val12)) val12=  "0" ; 
         val12 = _isnull(val12,"0") ;
         if ((thistdname!="") && (tbfldfunc1)) val12 = tbfldfunc1(thistdname, val12,null,pobj3) ;
         val12 = _isnull(val12,"0") ;
         fmt1 = _isnull(pobj3.$(this).attr("fmt"),"") ;
         if (fmt1!="") 
         {
         	 if ((fmt1=="money") || (fmt1=="money0")) val12 = _fmtfloat(val12, "#.##") ;
         	 else if (fmt1.substr(0,1)=="#") val12 = _fmtfloat(val12, fmt1.replaceAll("0","")) ;  
         } ;
         if (error1=="") error1 = val12 ;
         obj12 = pobj3.$("span.noaccount",this) ;
         if (obj12.length==1) 
         {
         	 pobj3.$(this).attr("value",_tohex(val12)) ;
         	 obj12.html(error1) ;
         } else 
         {
           pobj3.$(this).html(error1).attr("value",_tohex(val12)) ;
         } ;  
      }
      ;
   }
   ) ;
}
function _fmtvalue(val11,fmt1) 
{
	var val1 = val11 ;
	if (val1==NaN) val1 = 0 ;
	else val1 = isnull(val1,"") ;
	var fmt2 = isnull(fmt1,"") ;
	if (fmt2=="") return val1 ;
	if (fmt2=="money") return  "<font color='#a8a8a8'>￥</font>"+_fmtfloat(val1,"#,##") ; 
	if (fmt2=="money0") 
  {
    if (_myparseFloat(val1,0)==0) return "&nbsp;" ;
    else return "<font color='#a8a8a8'>￥</font>"+_fmtfloat(val1,"#,##") ;
  } ;
  if (fmt2.indexOf("#")>=0) 
  {
  	return _fmtfloat(val1,fmt2) ;
  } else
  {
  	return _fmtdate(val1,fmt2) ;
  } ;
}
function _editedacell(pobj3,edobj)
{
   if (pobj3._edit_table=="") return  false ;
   var onvalid1 = isnull(pobj3.$(edobj).attr("onvalid"),"") ;
  
       
   var src11 = isnull(pobj3.$(edobj).attr("pick"),"") ;
	 

   var ord2id01 = 	pobj3.$(edobj).attr("ord2id") ;
   var tdname1 = 	pobj3.$(edobj).attr("tdname") ;
   var validres = isnull(pobj3.$(edobj).attr("validresult"),"").trim() ;
   
   var tdobj = null ;
   var trobj1 = null ;
   var tbfldfunc1 = null ;
   
   var tdvalue = _isnull(edobj.value,"&nbsp;") ;
   
   var trobj1$ = pobj3.$("#ord2id_"+ord2id01)  ;
    
   if (trobj1$.length<=0) 
   	 trobj1$ = pobj3.$(edobj).parents("tr:first") ;
   if (trobj1$.length>0) trobj1 = trobj1$[0] ;
   
   tdobj = pobj3.$("td[name="+tdname1+"]",pobj3.$(trobj1)) ;
   
   // 在这里来处理 . .. .x 问题
   var trnewobj1 = null ;
   if (tdvalue.substr(0,1)==".") 
   {
	   if (tdvalue==".") // prev
	   {
	   	 trnewobj1 = trobj1$.prev() ;
			 for (var n=0;n<=3;n++) 
			 {
			 	if ((trnewobj1) && (isnull(trnewobj1.css("display"),"").toLowerCase()=="none"))  
			 	trnewobj1 = trnewobj1.prev() ;
			 } ;
	   } else if (tdvalue=="..") // next
	   {
	   	 trnewobj1 = trobj1$.next() ;
			 for (var n=0;n<=3;n++) 
			 {
			 	 if ((trnewobj1) && (isnull(trnewobj1.css("display"),"").toLowerCase()=="none"))  
			 	 trnewobj1 = trnewobj1.next() ;
			 };	 
	   } else 
	   if (tdvalue.substr(0,1)==".") // .x
	   {
			 var tri = myparseInt(tdvalue.substr(1),0) ;
			 if (tri>0)
			 {
				 var trobjs = trobj1$.parent().find("tr:visible:not(.nouseforsystem)") ;
				 if (trobjs.length>=tri) trnewobj1 = pobj3.$(trobjs[tri-1]) ;
			} ;
	   } ;  
	   if ((trnewobj1) && (trnewobj1.length>0))
	   {
	   	 tdvalue = isnull(trnewobj1.find("td[name="+tdname1+"]").attr("value"),"") ;
			 tdvalue = tostr(tdvalue) ;
			 pobj3.$(edobj).val(tdvalue) ;
			 tdvalue = _isnull(edobj.value,"&nbsp;") ;
		 } ;
	 } ;
	 
	 // 在这里来处理 , ,, ,x 问题
   var tdnewobj1 = null ;
   if (tdvalue.substr(0,1)==",") 
   {
	   if (tdvalue==",") // prev
	   {
	   	 tdnewobj1 = tdobj.prev() ;
			 for (var n=0;n<=3;n++) 
			 {
			 	if ((tdnewobj1) && (isnull(tdnewobj1.css("display"),"").toLowerCase()=="none"))  
			 	tdnewobj1 = tdnewobj1.prev() ;
			 } ;
	   } else if (tdvalue==",,") // next
	   {
	   	 tdnewobj1 = tdobj.next() ;
			 for (var n=0;n<=3;n++) 
			 {
			 	 if ((tdnewobj1) && (isnull(tdnewobj1.css("display"),"").toLowerCase()=="none"))  
			 	 tdnewobj1 = tdnewobj1.next() ;
			 };	 
	   } else 
	   if (tdvalue.substr(0,1)==",") // .x
	   {
			 var tri = myparseInt(tdvalue.substr(1),0) ;
			 if (tri>0)
			 {
				 var tdobjs = trobj1$.find("td:visible") ;
				 if (tdobjs.length>=tri) tdnewobj1 = pobj3.$(tdobjs[tri-1]) ;
			} ;
	   } ;  
	   if ((tdnewobj1) && (tdnewobj1.length>0))
	   {
	   	 tdvalue = isnull(tdnewobj1.attr("value"),"") ;
			 tdvalue = tostr(tdvalue) ;
			 pobj3.$(edobj).val(tdvalue) ;
			 tdvalue = _isnull(edobj.value,"&nbsp;") ;
		 } ;
	 } ;
	 
	 if ((onvalid1!="") && (src11=="")) 
	 {
			onvalid1 = onvalid1.replace("(this)","(edobj)") ;
			eval(onvalid1) ;
	 } ;
	
	 
	 tdvalue = _isnull(edobj.value,"&nbsp;") ;
	 
   if (validres=="1")
   {
      tdobj.attr("value",_tohex(tdobj.attr("oldvalue"))) ;
      tdobj.html(_tostr(tdobj.attr("oldhtml"))) ;
      _formulatr(pobj3,$(tdobj.parent()[0])) ;
      tbfldfunc1 = null ;
      eval("if ("+pobj3._myident+pobj3._edit_table+"_fldv___) tbfldfunc1="+pobj3._myident+pobj3._edit_table+"_fldv___") ;
      if (pobj3._edit_table_manul_calc_group==null)
      {
        _showgroup(pobj3._myident,pobj3._edit_table, tbfldfunc1) ;
      } else
      {
      	pobj3._edit_table_manul_calc_group.html(pobj3._edit_table_manul_calc_group.attr("prompt")) ;
      } ;  
      pobj3._edit_input = null ;
      return  false ;
   }
   ;
   var autocmphlp = pobj3.$("#autocompleteHelper") ;
   if (autocmphlp.length>0)
   {
      if (autocmphlp[0].style.display.toLowerCase()=="block") return  false ;
   }
   ;

   _parsetrobj(pobj3,pobj3.$(trobj1)) ;
   tdobj.attr("value",_tostr(tdvalue)).html(_tostr(tdobj.attr("oldhtml"))) ;
   if (pobj3.$("*[name="+tdname1+"]",tdobj).length>0)
   pobj3.$("*[name="+tdname1+"]",tdobj).html(tdvalue) ;
   else   tdobj.html(tdvalue) ;
   eval("if (pobj3."+pobj3._edit_table+"_afteredit__) pobj3."+pobj3._edit_table+"_afteredit__(tdname1,tdvalue,edobj,tdobj[0],trobj1,false)") ;
   var oldvalue = _isnull(pobj3.$(tdobj).attr("oldvalue"),"") ;
   tdvalue = _tostr(_isnull(pobj3.$(tdobj).attr("value"),"")) ;
   if ((oldvalue!=tdvalue) || (tdobj.hasClass("tbupdatedtr")) || (tdobj.hasClass("tbinsertedtr")))
   {
      eval("if (pobj3."+pobj3._edit_table+"_onchange__) pobj3."+pobj3._edit_table+"_onchange__(tdname1,tdvalue,edobj,tdobj[0],trobj1,false)") ;
   }
   ;
   // 我以为下面二句是没有用的，并且还有可能导致掉数据 , 因此去之
   // 为什么会掉数据呢，自己想去吧
   if (tdobj.filter(".tbinsertedtr").length<=0)
   {
   	  if (!tdobj.hasClass("tbupdatedtr"))
   	  {
        if (oldvalue!=tdvalue) tdobj.addClass("tbupdatedtr").attr("ident",____ident()) ;
      } ;  
   }
   //;
   tbfldfunc1 = null ;
   eval("if ("+pobj3._myident+pobj3._edit_table+"_fldv___) tbfldfunc1="+pobj3._myident+pobj3._edit_table+"_fldv___") ;
   //if (oldvalue!=tdvalue)
   //{
      _formulatr(pobj3,$(trobj1)) ;
      if (pobj3._edit_table_manul_calc_group==null)
      {
        _showgroup(pobj3._myident,pobj3._edit_table, tbfldfunc1) ;
      } else 
      {
      	pobj3._edit_table_manul_calc_group.html(pobj3._edit_table_manul_calc_group.attr("prompt")) ;
      } ;  
   //}
   //;
   eval("if (pobj3."+pobj3._edit_table+"_afteredit__) pobj3."+pobj3._edit_table+"_afteredit__(tdname1,tdvalue,edobj,tdobj[0],trobj1,true)") ;
   pobj3._edit_input = null ;
}
function _tryfocustable(pobj3)
{
	//return ;
   try {pobj3.focus() ;} catch (e) {} finally { };
   try {pobj3.document.body.focus() ;} catch (e) {} finally { };
   try {pobj3.document.getElementById(pobj3._edit_table).click();} catch (e) {} finally { };
   try {pobj3.document.getElementById(pobj3._edit_table).focus();} catch (e) {} finally { };

   if (pobj3.document.activeElement.id != pobj3._edit_table)
   {
      try {pobj3.focus() ;} catch (e) {} finally { };
      try {pobj3.document.body.focus() ;} catch (e) {} finally { };
      try {pobj3.document.getElementById(pobj3._edit_table).click();} catch (e) {} finally { };
      try {pobj3.document.getElementById(pobj3._edit_table).focus();} catch (e) {} finally { };
      //pobj3.setTimeout("pobj3.tryfocustable()",40) ;
   }
   ;
}


// 以上是与TABLEEDIT有关的

function _loading(working11,prompt1)
{
	 var prompt2 = _isnull(prompt1,"") ;
	 if (prompt2!="") _loadingtitle = prompt2 ;
   loadobj = _pdoc.getElementById("_lxpsysloding_") ;
   if (loadobj)
   {
      if ( working11 )
      {
         getgloble();
         loadobj.style.left = parseInt(_cltw/2-100+_scrlx) ;
         loadobj.style.top = parseInt(_clth/2-20+_scrly) ;
         loadobj.innerHTML = "<img src=/images/workingm.gif border=0 align=absmiddle>"+_loadingtitle ;
         loadobj.style.display = "block"  ;
         _pdoc.getElementById("_lxpsyslodingbg_").style.display = "block"  ;
      }
      else
      {
         loadobj.style.display = "none" ;
         _pdoc.getElementById("_lxpsyslodingbg_").style.display = "none"  ;
         _loadingtitle = "Loading..." ;
      }
      ;
      return  false ;
   }
   ;
   if ( !working11 ) return  false ;
   getgloble();
   $(_pdoc.body).append(
   "<div id=_lxpsyslodingbg_ "
   + " style='"
   + "width:" + (_dlgw) + "px;"
   + "height:" + (_dlgh) + "px;"
   + "z-index:800000000;"
   + "position:absolute;cursor:wait;"
   + "left:0px;"
   + "top:0px;"
   + "background-color:black;"
   + "filter:alpha(opacity=1);-moz-opacity:0.01;"
   + "'></div>"
   + "<div id=_lxpsysloding_ "
   + " onclick='_loading(false)' "
   + " style='"
   + "width:200px;"
   + "height:35px;"
   + "z-index:800001000;"
   + "position:absolute;cursor:wait;"
   + "padding:8px;"
   + "left:"+(_cltw/2-100+_scrlx)+"px;"
   + "top:"+(_clth/2-20+_scrly)+"px;"
   + "border:1px solid black;"
   + "background-color:#ffffee;"
   + "' align=center valign=middle><img src=/images/workingm.gif border=0 align=absmiddle>"+_loadingtitle+"</div>"
   ) ;
}

function _urlindex(url1)
{
   var urlindex1 = - 1 ;
   var url111 = url1 ;
   url111 = url111.toLowerCase() ;
   if (url111.indexOf("nocache=")>=0) return -100 ;
   var lasti01 = url111.lastIndexOf("/") ;
   if (lasti01>=0) url111 = url111.substr(lasti01+1) ;
   lasti01 = url111.indexOf("cache=") ;
   if (lasti01>0) url111 = url111.substr(0,lasti01) ;
   //if ( ! (_pobj.urllogs)) _pobj.urllogs = "" ;
   urlindex1 = _pobj.urllogs.indexOf(url111) ;
   if (urlindex1 < 0)
   {
      _pobj.urllogs.push(url111) ;// = _pobj.urllogs + ";;" + url111 + ";;" ;
      urlindex1 = _pobj.urllogs.length-1 ;//indexOf(";;" + url111 + ";;") ;
   }
   ;
   return urlindex1 ;
}
function __gotoandcache(selfwin,cachename1,frmname1, url1111)
{
	 var oldsrc1 = "" ;
	 var url1 = url1111 ; 
	  
	 var i010 = url1.indexOf("&oldsrc=") ;
	 if (i010>=0)
	 {
	 	oldsrc1 = url1.substr(i010+8) ;
	 	url1 = url1.substr(0,i010) ;
	 	i010 = oldsrc1.indexOf("&") ;
	 	if (i010>0) oldsrc1 = oldsrc1.substr(0,i010) ;
	 } else 
	 {
	 	oldsrc1 = "" ;
	 } ; 
	 
	 
	 if (_holdctrl)
	 {
	 	 var url01 = url1 ;
	 	 if (url01.indexOf("?")<0) url01+="?" ; else url01 += "&" ;
	 	 url01 += "nobackurl=0" ;
	 	 var title12 = url1 ;
	 	 var ii12 = title12.indexOf("?") ;
	 	 if (ii12>0) title12 = title12.substr(0,ii12) ;
	 	 ii12 = title12.lastIndexOf("/") ;
	 	 if (ii12>0) title12 = title12.substr(ii12+1) ;
	 	 _holdctrl = false ;
	 	 _popwin("78%", "90%", url01, title12) ;
	 	 return  false ;
	 } ;
	 var ts1 = url1 ;
	 i010 = ts1.indexOf("idtfcawl") ;
	 if (i010>0) ts1 = ts1.substr(0,i010) ;
	 i010 = ts1.lastIndexOf("/") ;
	 if (i010>=0) ts1 = ts1.substr(i010+1) ;
	 i010 = _backurls.indexOf(ts1) ;
	 if (i010<0) 
	 {
	 	_backurls.push("___"+ts1) ;
	 	_backurls.push(oldsrc1) ;
	 } ;
   var docp = null ;
   var objp = null ;
   var aftercache1 = "" ;
   var oldaftercache1 = "";
   var runit = false ;
   var always1 = (url1.indexOf("always=")>=0) ;
   if (url1.indexOf("nocache=")<0) 
   {
   	  var cai1 = url1.indexOf("cache=") ;
   	  if (cai1>0) aftercache1 = url1.substr(cai1) ;
   	  cai1 = url1.indexOf("&") ;
   	  if (cai1>0) aftercache1 = url1.substr(cai1+1) ;
   } ;
   if (selfwin.document.getElementById(cachename1))
   {
      docp = selfwin.document ; objp = selfwin ;
   }
   else
   {
      if (selfwin.parent.document.getElementById(cachename1))
      {
         docp = selfwin.parent.document ;
         objp = selfwin.parent ;
      }
      else
      {
         if (selfwin.parent.parent.document.getElementById(cachename1))
         {
            docp = selfwin.parent.parent.document ;
            objp = selfwin.parent.parent ;
         }
         else
         {
            docp = selfwin.document ;
            objp = selfwin ;
         }
         ;
      }
      ;
   }
   ;
   if (docp.getElementById(cachename1))
   {
      try
      {
         if ((objp.frmhtml__==undefined) || (objp.frmhtml__==null))
         {
            objp.frmhtml__ = null;
            objp.frmhtml__1 = null ;
         }
         ;
      }
      catch (e)
      {
         objp.frmhtml__ = null;
         objp.frmhtml__1 = null ;
      }
      finally
      {
      }
      ;
      if ((objp.frmhtml__==undefined) || (objp.frmhtml__==null))
      {
         objp.frmhtml__ = docp.getElementById(cachename1).innerHTML ;
         objp.frmhtml__ = objp.frmhtml__.toLowerCase() ;
         var frmsrc1i = objp.frmhtml__.toLowerCase().indexOf("src=") ;
         objp.frmhtml__1 = objp.frmhtml__.substr(0,frmsrc1i) ;
         objp.frmhtml__ = "old"+objp.frmhtml__.substr(frmsrc1i+1) ;
      }
      ;
      if (docp.getElementById(frmname1))
      {
         var url22 = docp.getElementById(frmname1).src ;
         oldurlneedcache = false ;
         try {oldurlneedcache = docp.frames(frmname1).documentloaded ; }catch (e) {} finally { };
         if (oldurlneedcache==false) 
         { 
         	 docp.getElementById(frmname1).src = "about:blank";
           url22 = "" ;
         } ;  
         var oldurlindex = urlindex(url22) ;
         if ((oldurlindex == urlindex(url1)) && (oldurlindex!=-100))
         {
         	  oldaftercache1 = "";
         	  try
            {
            	oldaftercache1 = docp.frames(frmname1)._aftercache_str_ ;
            }
            catch (e)
            {
            }
            finally
            {
            }
            ;	
            oldaftercache1 = _isnull(oldaftercache1,"") ;
            if ((always1) || (oldaftercache1!=aftercache1))
            {
            	if (always1)
            	{
            		try
		            {
		               if (!runit) 
		               {
		               	 runit = true ;
		               	 docp.frames(frmname1).autorunwhilecacheloaded(url1) ;
		               } ;	 
		            }
		            catch (e)
		            {
		            }
		            finally
		            {
		            }
		            ;
            	} else
            	{
	            	docp.frames(frmname1)._aftercache_str_ = aftercache1 ;
		            try
		            {
		            	 if (!runit) 
		               {
		               	 runit = true ;
		                 docp.frames(frmname1).autorunwhilecacheloaded(aftercache1) ;
		               } ;  
		            }
		            catch (e)
		            {
		            }
		            finally
		            {
		            }
		            ;
	            } ;
            } ;
            try   { docp.frames(frmname1).document.body.focus() ; } catch (e) { }  finally { } ;
            try   { docp.frames(frmname1).body.focus() ; } catch (e) { }  finally { } ;
            try   { docp.frames(frmname1).needautoframeheight() ; } catch (e) { }  finally { } ;
            try   { objp.needautoframeheight() ; } catch (e) { }  finally { } ;
            
            return  false ;
         }
         ;
         if (oldurlindex >= 0)
         {
            if ( ! (docp.getElementById(frmname1 + "_" + oldurlindex + "_")))
            {
               oldurlneedcache = false ;
               try {oldurlneedcache = docp.frames(frmname1).documentloaded ; }catch (e) {} finally { };
               //eval("if (_pobj2._"+oldurlindex+"_cache_ok_) try {oldurlneedcache=_pobj2._"+oldurlindex+"_cache_ok_==100;}catch (e) {} finally { };") ;
               obj321 = docp.getElementById(frmname1) ;
               obj321.style.display = "none" ;
               if (oldurlneedcache) obj321.id = frmname1 + "_" + oldurlindex + "_" ;
               else
               {
                  obj321.id = frmname1 + "_" + oldurlindex + "_no_" ;
                  obj321.src = "about:blank" ;
                  
               }
               ;
              // try {objp.needautoframeheight() ; }catch (e) {} finally { };
            }
            ;
         }
         ;
      }
      ;
      newurlindex = urlindex(url1) ;
      if ( ! (docp.getElementById(frmname1 + "_" + newurlindex + "_"))) // nocache
      {
         if (docp.getElementById(frmname1))
         {
            docp.getElementById(frmname1).src = url1;
             
            try   { docp.frames(frmname1).document.body.focus() ; } catch (e) { }  finally { } ;
            try   { docp.frames(frmname1).body.focus() ; } catch (e) { }  finally { } ;
            
            //docp.getElementById(frmname1).style.display = "block" ;
            $("#frmname1").fadeIn(600) ;
            try {docp.frames(frmname1)._aftercache_str_ = aftercache1 ;}catch (e) {} finally { };
            try {docp.frames(frmname1).needautoframeheight() ; }catch (e) {} finally { };
            try {objp.needautoframeheight() ; }catch (e) {} finally { };
         }
         else
         {
            var   newSpan = docp.createElement("span");
            newSpan.id = "temp_span_" + newurlindex + "__";
            newSpan.innerHTML =
            objp.frmhtml__1+" src='"+url1+"'  "+objp.frmhtml__ ;
            docp.getElementById(cachename1).appendChild(newSpan);
            try   { docp.frames(frmname1).document.body.focus() ; } catch (e) { }  finally { } ;
            try   { docp.frames(frmname1).body.focus() ; } catch (e) { }  finally { } ;
            try {docp.frames(frmname1)._aftercache_str_ = aftercache1 ;}catch (e) {} finally { };
            try {docp.frames(frmname1).needautoframeheight() ; }catch (e) {} finally { };
            try {objp.needautoframeheight() ; }catch (e) {} finally { };
         }
         ;
      }
      else
      {
         if (docp.getElementById(frmname1))
         {
            obj321 = docp.getElementById(frmname1) ;
            obj321.style.display = "none" ;
            obj321.id = frmname1 + "_0000_" ;
         }
         ;
         obj123 = docp.getElementById(frmname1 + "_" + newurlindex + "_") ;
         //obj123.style.display = "block" ;
         //$(obj321).show(500) ;
         $(obj123).fadeIn(600) ;
         obj123.id = frmname1 ;
         
         oldaftercache1  ="" ;
         try
            {
            	oldaftercache1 = docp.frames(frmname1)._aftercache_str_ ;
            }
            catch (e)
            {
            }
            finally
            {
            }
            ;	
            oldaftercache1 = _isnull(oldaftercache1,"") ;
            
            if ((always1) || (oldaftercache1!=aftercache1))
            {
            	if (always1)
            	{
            		try
		            {
		            	 if (!runit) 
		               {
		               	 runit = true ;
		                 docp.frames(frmname1).autorunwhilecacheloaded(url1) ;
		               } ;  
		            }
		            catch (e)
		            {
		            }
		            finally
		            {
		            }
		            ;
            	} else
            	{
	            	docp.frames(frmname1)._aftercache_str_ = aftercache1 ;
		            try
		            {
		            	 if (!runit) 
		               {
		               	 runit = true ;
		                 docp.frames(frmname1).autorunwhilecacheloaded(aftercache1) ;
		               } ;  
		            }
		            catch (e)
		            {
		            }
		            finally
		            {
		            }
		            ;
	            } ;
            } ;
           try   { docp.frames(frmname1).document.body.focus() ; } catch (e) { }  finally { } ;
           try   { docp.frames(frmname1).body.focus() ; } catch (e) { }  finally { } ;
           try {docp.frames(frmname1).needautoframeheight() ; }catch (e) {} finally { };
           try {objp.needautoframeheight() ; }catch (e) {} finally { };
         
      }
      ;
      return  false ;
   }
   ;


   if (selfwin.document.getElementById(frmname1))
   {
      selfwin.document.getElementById(frmname1).src = url1;
      return  false ;
   }
   ;

   if (selfwin.document.getElementById("mainarea"))
   {
      selfwin.document.getElementById("mainarea").innerHTML =
      "<iframe id=\""+frmname1+"\" onload=\"javascript : {dyniframesize('"+frmname1+"'); }\" " +
      "marginwidth=0 marginheight=0 frameborder=0 " +
      "scrolling=no src='"+url1+"'  " +
      "width=\"100 % \" height=300></iframe>" ;
   }
   else
   {
      selfwin.document.location.href = url1 ;
   }
}

function _gotoandcache(selfwin,frmname1, url1)
{
   __gotoandcache(selfwin,"cacheframes",frmname1, url1)
}
function _gotoframeandcache(selfwin,frmname1, url1)
{
   __gotoandcache(selfwin,frmname1+"_cache",frmname1, url1)
}
function _autoframeheight(pobj001,frmid)
{
   if (frmid) frmid1 = frmid ;
   else frmid1 = "mainframe" ;
   if (frmid1=="") frmid1 = "mainframe" ;
   _dyniframesize(pobj001,frmid1) ;
   _dyniframesize(pobj001.parent,frmid1) ;
   _dyniframesize(pobj001.parent.parent,frmid1) ;
   _dyniframesize(pobj001.parent.parent.parent,frmid1) ;
}
function _refreshaspx(prgvars)
{
	// like this : business=1;flowlists=2 
	// like this : business~h`009ji9202921=2;
	var i = 0 ;
	var str1 = "" ;
	var str2 = prgvars+";" ;
	var str3 ="" ;
	i = str2.indexOf(";") ;
	while (i>0)
	{
		str3 = str2.substr(0,i) ;
		str2 = str2.substr(i+1) ;
		str3 = str3.trim() ;
		if (str3!="")
		{
			str1 += "newmsg_" ;
		  str1 += str3.replaceAll("~h`","");
		  str1 += ";" ;
		} ;  
		i = str2.indexOf(";") ;
	};
	if (str1!="") try {eval(str1) ;} catch (e) {} finally {}  ;
}
function _autorefreshpage(pobj001)
{
   var s1 = pobj001.refreshident  ;
   var theva = "" ;
   s1 = " try {if ("+s1+") theva = "+s1 +" ;} catch (e) {} finally	{};" ;
   eval(s1) ;
   if (theva!="")
   {
   	  var oldtheva = theva ;
      var res1 = false ;
      try
      {
      	 eval( pobj001.refreshident+" = '' ");
         res1 = pobj001.refreshpage(theva)
      }
      catch (e)
      {
      }
      finally
      {
      }
      ;
      if (res1==false) eval( pobj001.refreshident+" = '"+oldtheva+"' ");
   }
   ;
}
;
function rootparent()
{
   if (self.window.parent.parent.parent.parent.parent)
   return self.window.parent.parent.parent.parent.parent ;
   else
   if (self.window.parent.parent.parent.parent)
   return self.window.parent.parent.parent.parent ;
   else
   if (self.window.parent.parent.parent)
   return self.window.parent.parent.parent ;
   else
   if (self.window.parent.parent)
   return self.window.parent.parent ;
   else
   if (self.window.parent)
   return self.window.parent ;
   else 	return self.window ;
};

// global variable
var dataseturllogs = [] ;
var urllogs = [] ;
var _loadingtitle = "Loading..." ;
var getFFVersion = navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1] ;
var FFextraHeight = getFFVersion >= 0.1 ? 16 : 0 ;
var _pobj = rootparent() ;
var _pdoc = _pobj.document ;
var _screenw = screen.width ;
var _screenh = screen.height ;
var _scrlx = 0 , _scrly = 0 , _clth = 0 , _cltw = 0 , _scrlh = 0, _scrlw = 0, _dlgw = 0, _dlgh = 0;
var ie6 = ((jQuery.browser.msie) && (parseInt(jQuery.browser.version.substr(0, 1)) < 7)) ;
var _sysmoveable = false;
var _sysx0 = 0 , _sysy0 = 0 , _sysx1 = 0 , _sysy1 = 0 ;
var _syshover = 'orange', _sysnormal = '#336688' ;
// '#336688'; // color;
var _sysindex = 10000;
// z - index;
var __currfileid = 0 ;
function _splitmoney(pobj3,fldname1,val1)
{
   val002 = _fmtfloat(val1,"#.##") ;
   val002 = _isnull(val002,"0.00") ;
   if (val002=="0") val002 = "0.00" ;
   dotindex = val002.indexOf(".") ;
   val0021 = val002.substr(dotindex+1) ;
   val0020 = val002.substr(0,dotindex) ;
   val0021 = _isnull(val0021,"00") ;
   if (val0021=="0") val0021 = "00" ;
   eval("pobj3._"+fldname1+"_s2="+val0021.substr(1,1)) ;
   eval("pobj3._"+fldname1+"_s1="+val0021.substr(0,1)) ;
   eval("pobj3._"+fldname1+"_s3='0'") ;
   eval("pobj3._"+fldname1+"_s4='&nbsp;'") ;
   eval("pobj3._"+fldname1+"_s5='&nbsp;'") ;
   eval("pobj3._"+fldname1+"_s6='&nbsp;'") ;
   eval("pobj3._"+fldname1+"_s7='&nbsp;'") ;
   eval("pobj3._"+fldname1+"_s8='&nbsp;'") ;
   eval("pobj3._"+fldname1+"_s9='&nbsp;'") ;
   eval("pobj3._"+fldname1+"_s10='&nbsp;'") ;
   eval("pobj3._"+fldname1+"_s11='&nbsp;'") ;
   dotorder = 2 ;
   if (val0020=="0") val0020="" ;
   for (dotindex=val0020.length-1 ; dotindex>=0; dotindex--)
   {
      dotorder ++ ;
      eval("pobj3._"+fldname1+"_s"+dotorder+"="+val0020.substr(dotindex,1)) ;
   }
   ;
}
function _convertCurrency(currencyDigits)
{
   // Constants:
   var MAXIMUM_NUMBER = 99999999999.99;
   // Predefine the radix characters and currency symbols for output:
   var CN_ZERO = "零";
   var CN_ONE = "壹";
   var CN_TWO = "贰";
   var CN_THREE = "叁";
   var CN_FOUR = "肆";
   var CN_FIVE = "伍";
   var CN_SIX = "陆";
   var CN_SEVEN = "柒";
   var CN_EIGHT = "捌";
   var CN_NINE = "玖";
   var CN_TEN = "拾";
   var CN_HUNDRED = "佰";
   var CN_THOUSAND = "仟";
   var CN_TEN_THOUSAND = "万";
   var CN_HUNDRED_MILLION = "亿";
   var CN_SYMBOL = "(大写): 人民币";
   var CN_DOLLAR = "元";
   var CN_TEN_CENT = "角";
   var CN_CENT = "分";
   var CN_INTEGER = "整";

   // Variables:
   var integral;    // Represent integral part of digit number.
   var decimal;    // Represent decimal part of digit number.
   var outputCharacters;    // The output result.
   var parts;
   var digits, radices, bigRadices, decimals;
   var zeroCount;
   var i, p, d;
   var quotient, modulus;

   // Validate input string:
   currencyDigits = currencyDigits.toString();
   if (currencyDigits == "")
   {
      //alert("Empty input!");
      return "";
   }
   if (currencyDigits.match(/[^,.\d]/) != null)
   {
      //alert("Invalid characters in the input string!");
      return "";
   }
   if ((currencyDigits).match(/^((\d{1,3}(,\d{3})*(.((\d{3},)*\d{1,3}))?)|(\d+(.\d+)?))$/) == null)
   {
      //alert("Illegal format of digit number!");
      return "";
   }

   // Normalize the format of input digits:
   currencyDigits = currencyDigits.replace(/,/g, "");    // Remove comma delimiters.
   currencyDigits = currencyDigits.replace(/^0+/, "");    // Trim zeros at the beginning.
   // Assert the number is not greater than the maximum number.
   if (Number(currencyDigits) > MAXIMUM_NUMBER)
   {
      alert("Too large a number to convert!");
      return "";
   }

   // Process the coversion from currency digits to characters:
   // Separate integral and decimal parts before processing coversion:
   parts = currencyDigits.split(".");
   if (parts.length > 1)
   {
      integral = parts[0];
      decimal = parts[1];
      // Cut down redundant decimal digits that are after the second.
      decimal = decimal.substr(0, 2);
   }
   else
   {
      integral = parts[0];
      decimal = "";
   }
   // Prepare the characters corresponding to the digits:
   digits = new Array(CN_ZERO, CN_ONE, CN_TWO, CN_THREE, CN_FOUR, CN_FIVE, CN_SIX, CN_SEVEN, CN_EIGHT, CN_NINE);
   radices = new Array("", CN_TEN, CN_HUNDRED, CN_THOUSAND);
   bigRadices = new Array("", CN_TEN_THOUSAND, CN_HUNDRED_MILLION);
   decimals = new Array(CN_TEN_CENT, CN_CENT);
   // Start processing:
   outputCharacters = "";
   // Process integral part if it is larger than 0:
   if (Number(integral) > 0)
   {
      zeroCount = 0;
      for (i = 0; i < integral.length; i++)
      {
         p = integral.length - i - 1;
         d = integral.substr(i, 1);
         quotient = p / 4;
         modulus = p % 4;
         if (d == "0")
         {
            zeroCount++;
         }
         else
         {
            if (zeroCount > 0)
            {
               outputCharacters += digits[0];
            }
            zeroCount = 0;
            outputCharacters += digits[Number(d)] + radices[modulus];
         }
         if (modulus == 0 && zeroCount < 4)
         {
            outputCharacters += bigRadices[quotient];
         }
      }
      outputCharacters += CN_DOLLAR;
   }
   // Process decimal part if there is:
   if (decimal != "")
   {
      for (i = 0; i < decimal.length; i++)
      {
         d = decimal.substr(i, 1);
         if (d != "0")
         {
            outputCharacters += digits[Number(d)] + decimals[i];
         }
      }
   }
   // Confirm and return the final output string:
   if (outputCharacters == "")
   {
      outputCharacters = CN_ZERO + CN_DOLLAR;
   }
   if (decimal == "")
   {
      outputCharacters += CN_INTEGER;
   }
   outputCharacters = CN_SYMBOL + outputCharacters;
   return outputCharacters;
} ;

// 以下代码是从EBS中移过来的
function _doctitle(title1,decoration1)
{
	var dec1 = isnull(decoration1,"") ;
	if (dec1=="") return title1 ;
	dec1 = dec1 + "0000" ;
	var dec2 = title1 ;
	if (dec1.substr(1,1)=="1") dec2 = "<b>"+dec2+"</b>" ;
	if (dec1.substr(2,1)=="1") dec2 = "<font color=red>"+dec2+"</font>" ;
	if (dec1.substr(2,1)=="2") dec2 = "<font color=black>"+dec2+"</font>" ;
	if (dec1.substr(2,1)=="3") dec2 = "<font color=green>"+dec2+"</font>" ;
	if (dec1.substr(2,1)=="4") dec2 = "<font color=yellow>"+dec2+"</font>" ;
	if (dec1.substr(0,1)=="1") dec2 += "<span class=quintessence></span>" ;
	if (dec1.substr(0,1)=="2") dec2 += "<span class=new></span>" ;
	if (dec1.substr(0,1)=="3") dec2 += "<span class=hot></span>" ;
	return dec2 ;
};

function __remove_xls_useless_tag(pobj3,$obj11)
{
	var fmt = "" ;
	pobj3.$(".mypsndate",$obj11).each(
	function()
	{
		pobj3.$(this).html(pobj3.$(this).attr("title")) ;
	}) ;
	pobj3.$("*[contenteditable=true]",$obj11).each(
	function()
	{
		this.contentEditable = false ;
	}) ;
	
	pobj3.$("td.tools",$obj11).remove() ;
	 
	pobj3.$("td[disabled]",$obj11).removeAttr("disabled") ;
	try {pobj3.$("*.hidewhenprint0.zerorecord",$obj11).remove() ;}  catch (E) { } finally { } ;
	try {pobj3.$("*[donotprintme=0]:not(td)",$obj11).remove() ;}  catch (E) { } finally { } ;
	try {pobj3.$("tr[donotprintme=0],span[donotprintme=0],div[donotprintme=0],tbody[donotprintme=0],table[donotprintme=0]",$obj11).remove() ;}  catch (E) { } finally { } ;
	try {pobj3.$("tr.hidewhenprint0,tr.hidewhenprint,span.hidewhenprint0,span.hidewhenprint,div.hidewhenprint0,div.hidewhenprint,table.hidewhenprint0,table.hidewhenprint,tbody.hidewhenprint0,tbody.hidewhenprint",$obj11).remove() ;}  catch (E) { } finally { } ;

	try {pobj3.$("td[donotprintme=0]",$obj11).html("&nbsp;") ;}  catch (E) { } finally { } ;
	//$("td[donotprintme=0]").html("&nbsp;") ;
	pobj3.$("td[func=recs],td[func=prds],td[func=multi],td[name=ord2_id]",$obj11).html("&nbsp;") ;
	pobj3.$(".menu_clickit,.menu_clickitgray").removeClass("menu_clickit",$obj11).removeClass("menu_clickitgray");
	pobj3.$(".editacellreadonly,.editrowcoltop,.editrowcolleft,.editacell,.editingacell",$obj11)
	.removeClass("editacellreadonly")
	.removeClass("editrowcolleft")
	.removeClass("editacell")
	.removeClass("editingacell")
	.removeClass("editrowcoltop");
	// 隐藏button
	
	pobj3.$(":button",$obj11).remove() ;
	var obj9 = null ;
	pobj3.$(":text:not('.hidden,.hidewhenprint,[donotprintme=0]'),textarea:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).each(function(){
		  obj9 = pobj3.$("#"+this.id) ;
			val11 = obj9.val() ;
			fmt = _isnull(obj9.attr("fmt"),"") ;
			if (fmt!="") 
			{
				if (fmt=="money") val11 = _fmtfloat(val11,"#,##") ;
				else if (fmt.substr(0,1)=="#") val11 = _fmtfloat(val11,fmt) ;
				else val11 = _fmtdate(val11,fmt.replace("/p","")) ;
			} ;
			if (val11=="") val11 = "" ;
			val11 = val11.replaceAll("\n","<br>") ;
			pobj3.$(this).after(val11) ;
	    }) ;
	pobj3.$(":text:not('.hidden,.hidewhenprint,[donotprintme=0]'),textarea:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).remove() ;
	pobj3.$("select:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).each(function(){
		  obj9 = pobj3.$("#"+this.id) ;
		  if (obj9[0].selectedIndex>=0) val11 = obj9[0].options[obj9[0].selectedIndex].text ; 
		  else  val11 = "" ;
			if (val11!="") val11 = val11.trim().replaceAll("　","") ;
			pobj3.$(this).after(val11) ;
	    }) ;
	pobj3.$("select:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).remove() ;
	pobj3.$(":radio:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).each(function(){
		  obj9 = pobj3.$("#"+this.id) ;
			if (obj9[0].checked) val11 = "<span style='font-family:Wingdings'>þ</span>" ; else val11="<span style='font-family:Wingdings;color:#cccccc;'>¨</span>";
			pobj3.$(this).after(val11) ;
	    }) ;
	pobj3.$(":radio:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).remove() ;
	pobj3.$(":checkbox:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).each(function(){
		  obj9 = pobj3.$("#"+this.id) ;
			if (obj9[0].checked) val11 = "<span style='font-family:Wingdings'>þ</span>" ; else val11="<span style='font-family:Wingdings;color:#cccccc;'>¨</span>";//•
			pobj3.$(this).after(val11) ;
	    }) ;
	pobj3.$(":checkbox:not('.hidden,.hidewhenprint,[donotprintme=0]')",$obj11).remove() ;
	
	pobj3.$("a:not(.rsv_link_11)",$obj11).removeAttr("href").removeAttr("click") ;
	pobj3.$(".hidden,:input,*[removeinxls=0]",$obj11).remove() ; 
	pobj3.$("*",$obj11).unbind() ;
};

function _$get(pobj3,objname1,defa1)
{
	var obj1 = null ;
	if (typeof(objname1)=="object") obj1 = pobj3.$(objname1) ; else obj1 = pobj3.$("#"+objname1) ;
	if (obj1.length<=0) return defa1 ;
	if (obj1[0].tagName=="SELECT") return _isnull(obj1.val(),defa1) ;
	if (obj1[0].tagName=="TEXTAREA") return _isnull(obj1.val(),defa1) ;
	if (obj1[0].tagName=="INPUT")
	{
		var type1 = obj1[0].type.toLowerCase() ;
		if (type1=="text") return _isnull(obj1.val(),defa1) ;
		if ((type1=="checkbox") || (type1=="radio"))
		{
			var val023 = _isnull(obj1.attr("value"),"l09020020202023e") ;
			if (obj1[0].checked)
			{
				if (val023!='l09020020202023e') return val023 ; else return "0" ;
		  } else 
		  {
		  	return "1" ;
		  } ;
		} ;	
		return _isnull(obj1.val(),defa1) ;
	} ;	 
	var ste12 = _isnull(obj1.attr("value"),"fds32422edwafcdsz") ;
	if (ste12=="fds32422edwafcdsz") ste12 = obj1.html() ;
	ste12 = _isnull(ste12,defa1) ;
	return _tostr(ste12) ;
} ;

function _$settdvalue(pobj3,trobj1,tdobj1,val1) // tdobj 是一个dom 或 一个$selector
{
	var obj1 = pobj3.$(tdobj1) ;
	if (obj1.length<=0) 
	{
		var trobj1 = pobj3.$(trobj1) ;
		if (trobj1.length<=0) return false ;
		trobj1.attr("updated_"+tdobj1,_tohex(val1)) ;
	} else 
	{
		obj1.html(_isnull(val1,"&nbsp;")).attr("value",_tohex(val1)).addClass("tbupdatedtr").attr("ident",____ident()) ;
	} ;
};
function _$getint(pobj3,objname1)
{
	var obj1 = null ;
	if (typeof(objname1)=="object") obj1 = pobj3.$(objname1) ; else obj1 = pobj3.$("#"+objname1) ;
	if (obj1.length<=0) return 0 ;
	var strv1 = "0" ;
	if (obj1[0].tagName=="SPAN") strv1 =obj1.html() ;
	else strv1 = obj1.val() ;
	return _myparseInt(strv1,0) ;
};
function _$getstr(pobj3,objname1)
{
	var obj1 = null ;
	if (typeof(objname1)=="object") obj1 = pobj3.$(objname1) ; else obj1 = pobj3.$("#"+objname1) ;
	if (obj1.length<=0) return "" ;
	var strv1 = "" ;
	if (obj1[0].tagName=="SPAN") strv1 = obj1.html() ;
	else strv1 = obj1.val() ;
	return strv1 ;
};
function _$getmoney(pobj3,obj1name1)
{
	var obj1 = null ;
	if (typeof(objname1)=="object") obj1 = pobj3.$(objname1) ; else obj1 = pobj3.$("#"+objname1) ;
	if (obj1.length<=0) return "" ;
	var strv1 = "" ;
	if (obj1[0].tagName=="SPAN") strv1 = obj1.html() ;
	else strv1 = obj1.val() ;
	strv1 = _fmtfloat(strv1,"#.##") ;
	return _myparseFloat(strv1);
};

function _$getfloat(pobj3,obj1name1,dotnum1)
{
	var strv1 = "" ;
	var obj1 = null ;
	if (typeof(objname1)=="object") obj1 = pobj3.$(objname1) ; else obj1 = pobj3.$("#"+objname1) ;
	if (obj1.length<=0) strv1 = "0" ;
	else 
	{
		if (obj1[0].tagName=="SPAN") strv1 = obj1.html() ;
		else strv1 = obj1.val() ;
	} ;		
	var fmt1 = "#.##" ;
	var dtn1 = _isnull(dotnum1,10) ;
	if (dtn1==0) fmt1 = "#" ; else 
	if (dtn1==1) fmt1 = "#.#" ; else
	if (dtn1==2) fmt1 = "#.##" ; else
	if (dtn1==3) fmt1 = "#.###" ; else
	if (dtn1==4) fmt1 = "#.####" ; else
	if (dtn1==5) fmt1 = "#.#####" ; else
	if (dtn1==6) fmt1 = "#.######" ; else 
	if (dtn1==7) fmt1 = "#.#######" ; else 
	if (dtn1==8) fmt1 = "#.########" ; else 
	if (dtn1==9) fmt1 = "#.#########" ; else 
	fmt1 = "#.##########" ;  
	strv1 = _fmtfloat(strv1,fmt1) ;
	return _myparseFloat(strv1);
};
function _replacesearchkey(pobj3,val1) 
{
	var res12 = _isnull(val1,"&nbsp;") ;
	if (res12!="&nbsp;")
	{
		if (pobj3.searchv_3[0]!="") res12 = (""+res12).replaceAll(pobj3.searchv_3[0],"<font color=\"red\"><b>"+pobj3.searchv_3[0]+"</b></font>") ;
		if (pobj3.searchv_3[1]!="") res12 = (""+res12).replaceAll(pobj3.searchv_3[1],"<font color=\"red\"><b>"+pobj3.searchv_3[1]+"</b></font>") ;
		if (pobj3.searchv_3[2]!="") res12 = (""+res12).replaceAll(pobj3.searchv_3[2],"<font color=\"red\"><b>"+pobj3.searchv_3[2]+"</b></font>") ;
	} ;	
	return res12 ;
};
function _parsesearchkey(pobj3,str1)
{
	pobj3.searchv_3 = [] ;
	var str2 = str1.trim() ;
	str2 = str2.replaceAll(","," ") ;
	str2 = str2.replaceAll("　"," ") ;
	str2 = str2.replaceAll("，"," ") ;
	while (str2.indexOf("  ")>=0) 
	{
		str2 = str2.replace("  "," ") ;
	} ;
	str2 = str2.trim() ;
	var i = str2.indexOf(" ") ;
	if (i<0)
	{
		pobj3.searchv_3.push(str2) ;
		pobj3.searchv_3.push("") ;
		pobj3.searchv_3.push("") ;
	} else 
	{
		pobj3.searchv_3.push(str2.substr(0,i)) ;
		str2 = str2.substr(i+1) ;
		i = str2.indexOf(" ") ;
		if (i<0) 
		{
			pobj3.searchv_3.push(str2) ;
		  pobj3.searchv_3.push("") ;
		} else 
		{
			pobj3.searchv_3.push(str2.substr(0,i)) ;
		  str2 = str2.substr(i+1) ;
		  i = str2.indexOf(" ") ;
		  if (i>=0) str2 = str2.substr(0,i) ;
		  pobj3.searchv_3.push(str2) ;
		} ;
	} ;
	return pobj3.searchv_3 ;
};
function _percentbar(percent1,width1)
{
	var width2 = _myparseInt(width1,100) ;
	return "<span align=center style=\"height:13px;width:"+width2+
				 "px;border:1px solid #aaaaaa;BACKGROUND-IMAGE: url(/images/progresscl.gif) ;"+
				 "BACKGROUND-REPEAT: repeat-y; background-color:#F9EB9B; BACKGROUND-POSITION-X: "+
				 (percent1*width2/100)+"px;\" class=f9><p align=center><FONT face=\"Courier\">"+percent1+"%</font></p></span>" ;
};
function _array2set(arr1)
{
	var set1 = "(" ;
	if (arr1.length<=0) return "(-9999999)" ;
	for (var i=0 ; i<arr1.length;i++) 
	{
		if (set1!="(") set1 += "," ;
		if (arr1[i].substr(0,1)=="_") set1 += "-"+arr1[i].substr(1) ;
		else set1 += arr1[i] ; 
	} ;
	set1 += ")" ;
	return set1 ;
};

function _convertbutton(pobj3,qrybtobj)
{
   var id11 = qrybtobj[0].id ;
   var width11 = qrybtobj.width() ;
   var noborder = _isnull(qrybtobj.attr("noborder"),"1") ;
   if (noborder=="0") noborder="2" ; else noborder="" ;

   var height11 = qrybtobj.height() ;
   if (height11 <= 24) height11 = 24 ;
   var style1 = qrybtobj.attr("style") ;
   style1 = _isnull(style1, "") ;
   style1 = style1 + "; width:" + width11 ;
   style1 = style1.toLowerCase() ;
   style1 = style1 + "; ";
   var img1 = qrybtobj.attr("img") ;
   img1 = _isnull(img1, "") ;
   var text11 = qrybtobj.attr("value") ;
   text11 = _isnull(text11, "") ;
   if (text11 == "") text11 = qrybtobj.html() ;
   text11 = _isnull(text11, "") ;
   var title11 = qrybtobj.attr("title") ;
   title11 = _isnull(title11, "") ;
   var disable11 = qrybtobj.attr("disabled") ;
   disable11 = _isnull(disable11, "") ;
   if (disable11 == true)  disable11 = "disabled='disabled' " ;
   if (style1.indexOf("background-image") >= 0) return  false ;
   var class1 = isnull(qrybtobj[0].className, "") ;
   if (class1 != "") return  false ;

   var res2 = _gentbbutton(height11, id11, img1+text11, title11, disable11, style1,null,noborder) ;
   
   qrybtobj.hide().after(res2) ;

   var ht1 = pobj3.document.getElementById("tbbttb_" + id11).clientHeight ;
   if (ht1<=13) ht1 = 20 ;
   pobj3.document.getElementById("tbbt_" + id11).style.height =ht1 + 2;
};
function _gentbbutton(height11, id1, text1, title1, disable1, style1, click1,noborder1)
{
   var res1 = "<button donotprintme=0 id=tbbt_" + id1 + " " + disable1 + " title='"+title1+"' style=\"border : 0px; padding : 0px; background : none; CURSOR : hand; "+style1+" \" " ;
   //" onmouseover=overtbbutton"+noborder1+"('"+id1+"')" +
   //" onmouseout=outtbbutton"+noborder1+"('"+id1+"') " ;
   if (click1) res1 = res1 + "	onclick=" + click1 + ">" ;
   else res1 = res1 + "	onclick='fatherclick(this)'>" ;
   res1 = res1 + "<table style='table-layout:auto;' id=tbbttb_" + id1 + " border=0 cellspacing=0 cellpadding=0  align=center " +
   " width='100%' ><tr height=3px>" +
   "<td id=tbbttb_" + id1 + "_11 width=3px class=tb_button_lt"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "<td id=tbbttb_" + id1 + "_12 class=tb_button_mt"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "<td id=tbbttb_" + id1 + "_13 width=3px class=tb_button_rt"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "</tr><tr>" +
   "<td id=tbbttb_" + id1 + "_21 width=3px class=tb_button_lm"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "<td id=tbbttb_" + id1 + "_22 class=tb_button_mm"+noborder1+
   " onmouseover=overtbbutton"+noborder1+"('"+id1+"')" +
   " onmouseout=outtbbutton"+noborder1+"('"+id1+"') " +
   " align=center valign=middle style=\"padding - left : 0px; padding - right : 0px; padding - top : 0px; " ;
   if (height11 > 0) res1 = res1 + " height:" + (height11 - 11) + ";" ;
   res1 = res1 + " line-height:120%; padding-bottom:0px;" + style1.replaceAll("width", "wold").replaceAll("height", "hold") + "\" nowrap > "+
   text1+"</td> "+
   "<td id=tbbttb_" + id1 + "_23 width=3px class=tb_button_rm"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "</tr><tr height=3px>" +
   "<td id=tbbttb_" + id1 + "_31 width=3px class=tb_button_lb"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "<td id=tbbttb_" + id1 + "_32 class=tb_button_mb"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "<td id=tbbttb_" + id1 + "_33 width=3px class=tb_button_rb"+noborder1+" style='padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;'></td>" +
   "</tr></table></button>" ;
   // alert(res1) ;
   return res1 ;
};
function _checkapppowerbycode(pobj3,apcode1)
{
	if (_apppower_files.length<=0) return false ;
	var i1 = _apppower_files.indexOf2(pobj3.pagefilename,0,2) ;
	if (i1>=0)
	{
		if (_apppower_files[i1+1].indexOf(","+apcode1+",")>=0) return true ; else return false ;
	} else return false ; 
} ;
function _checkapppower(pobj3)
{
	if (_apppower_files.length<=0) 
	{
		var i1 = 0 ;
		_runsql4xml(pobj3,"g_apppower_file_users","",
		function(iseof,data1,dsname1)
		{
			if (!iseof)
			{
				if (dsname1=="ds1") 
				{
					_apppower_files.push(pobj3.$f[pobj3._ap_filename]) ;
					_apppower_files.push("") ;
				} else 
				{
					i1 = _apppower_files.indexOf2(pobj3.$f[pobj3._ap_filename],0,2) ;
					_apppower_files[i1+1] = _apppower_files[i1+1] + ","+pobj3.$f[pobj3._ap_name]+"," ;
				} ;
			} else 
			if (!dsname1)
			{
				if (_apppower_files.length<=0) 
				{
					_apppower_files.push("") ;_apppower_files.push("") ;
				} ;
				_checkapppower(pobj3) ;
			} ;
		}) ;
		return true ;
	} else 
	{
		var i1 = _apppower_files.indexOf2(pobj3.pagefilename,0,2) ;
		if (i1>=0)
		{
			if (_apppower_files[i1+1]!="") return true ; else return false ;
		} else return true ; 
	} ;
} ;