	
	//var logo
	
	//logo = parent.document.all("logo").innerText 
	//==================================
	//函数名：newin
	//参  数：s,t,w,h,status
	//功  能：打开新窗口函数
	//        
	//==================================
	function newin(s,b,w,h,status,res) {
	//输入	s	URL
	//		t	target默认为_blank
	//		w	新窗口宽度默认为400
	//		h	新窗口高度默认为300
	//		status	新窗口状态栏是否显示，默认为不显示(0)
	var hei=(screen.availHeight-300)/2
	var wid=(screen.availWidth-500)/2
	var t
	t=window.open(s,(b)?b:"_blank","status="+(status?1:0)+",left=" +wid+",top="+hei+",menubar=0,resizable="+(res?1:0)+",titlebar="+(res?1:0)+",width="+((w)?w:500)+",height="+((h)?h:280))
	//return (t)
	}

	//==================================
	//函数名：change_tab
	//参  数：target
	//功  能：标签切换用函数
	//        
	//==================================
	function change_tab(target)
	{
		for	(a=0;a<document.all.length;a++){						
			if ((document.all[a].id.substr(0,4)=='htab')||(document.all[a].id=='search_result')){
				document.all[a].className='clsTabBlur';
			}
		}
		document.all["htab"+target].className='clsTabSelected';
	}

	//==================================
	//函数名：std_go
	//参  数：url
	//功  能：标签切换后画面迁移用函数
	//        
	//==================================
	function std_go(url){
		common_frame.location=url;
		//parent.document.all("logo").innerText = logo + " >> " + event.srcElement.innerText
		if (document.all("show")) show.document.location="../inc/blank.asp"
	}
	
	//====================================
	//函数名：_go
	//参  数：a   分页项目标志（有可能在同一画面列表上方和下方都有分页）
	//功  能：单击确定时，列表显示客户指定的数据
	//====================================
	function _go(a)
	{
		var no = parseInt(document.all(a+"page_no").value)
		var skip=parseInt(document.all(a+"page_skip").value)
		var countold=parseInt(document.all(a+"page_count").defaultValue)	
		var count=parseInt(document.all(a+"page_count").value)
		var totalcount=parseInt(document.all(a+"totalcount").value)
		if(count<=0||count>totalcount) count=countold
		if(no<1) no=1
		var icount=totalcount/count
		if(Math.round(icount)<icount){
		   icount=Math.round(icount) + 1
		}
		else {
		   icount=Math.round(icount)
		}
		if(no>icount) no=1
		skip=(no-1)*countold
		if (isNaN(count)) {
			alert("行数要是整型")
			document.all(a+"page_count").focus()
			return
		}
		document.location = "?Skip=" + skip + "&totalcount="+ totalcount +"&Count=" + count + "&" + document.all(a+"querystring").value
		//document.form1.method = "post"
		//document.form1.submit()
	}

	//====================================
	//函数名：_last_page
	//参  数：a   分页项目标志（有可能在同一画面列表上方和下方都有分页）
	//功  能：单击上一页时，列表显示下 X 条数据（X是设定的每行显示多少条纪录）
	//====================================
	function _last_page(a)
	{
		var skip=parseInt(document.all(a+"page_skip").value)
		var countold=parseInt(document.all(a+"page_count").defaultValue)	
		var count=parseInt(document.all(a+"page_count").value)
		var totalcount=parseInt(document.all(a+"totalcount").value)
		skip = skip-count
		if (skip<0) skip=0
		if (isNaN(count)) {
			alert("行数要是整型")
			document.all(a+"page_count").focus()
			return
		}
		document.location = "?Skip=" + skip +"&totalcount="+ totalcount +"&Count=" + count + "&" + document.all(a+"querystring").value
	}

	//====================================
	//函数名：_next_page
	//参  数：a   分页项目标志（有可能在同一画面列表上方和下方都有分页）
	//功  能：单击下一页时，列表显示下 X 条数据（X是设定的每行显示多少条纪录）
	//====================================
	function _next_page(a)
	{
		var skip=parseInt(document.all(a+"page_skip").value)
		var countold=parseInt(document.all(a+"page_count").defaultValue)	
		var count=parseInt(document.all(a+"page_count").value)
		var totalcount=parseInt(document.all(a+"totalcount").value)
		skip = skip+countold
		if (isNaN(count)) {
			alert("行数要是整型")
			document.all(a+"page_count").focus()
			return
		}
		
		document.location = "?Skip=" + skip +"&totalcount="+ totalcount +"&Count=" + count + "&" + document.all(a+"querystring").value
	}


	//====================================
	//函数名：_show_hidden_buMenCengCi_new
	//参  数：obj   发生事件的对象
	//功  能：将有层次的列表收起或展开
	//====================================
	function _show_hidden_buMenCengCi_new(obj){
		try{

				if (obj.src.indexOf("plus_b.gif")>=0){
					obj.src=obj.src.replace(/plus_b.gif/i,"plus_a.gif")
				 }else{
				 	obj.src=obj.src.replace(/plus_a.gif/i,"plus_b.gif")
				 }
				t=obj.parentElement.nextSibling.style;
				if (t.display=="none"){
					t.display="block";
				}else{
					t.display="none"
				}
		}catch(e){
		}		
	}

	//====================================
	//函数名：check
	//参  数：theform   要检查的窗体
	//功  能：在前台对各项目的合法性检查
	//        根据各项目的 leixing 参数做判断
	//====================================
	function check(theform,func)
	{
		var e=theform.elements;
		for (var i=0,lngLeng = e.length;i<lngLeng;i++)
		{
			if (e[i].disabled) continue;
			if (e[i].leixing==null) continue;
			if (e[i].chulibz=='R') continue

			var strValue;
			strValue=e[i].value.replace(/^\s+|\s+$/,"");
			e[i].value=strValue;
			
			if (strValue==""){
				if (e[i].allowNull==null){
				//自己生成的控件
					if (e[i].chulibz=='M'){
					//如果是M则必须输入
							_goError(e[i],func,"该项目不能为空！")
							return false
					}
					//否则允许
					continue
				}
			
				//动态Form自动生成的
				if (e[i].allowNull=='Y'){
				//允许null的总允许空。不可能出现NVC VC C允许null的情况！
					continue
				}
				
				
				//不允许null，e[i].allowNull=='N'
				
				if (e[i].chulibz=='M'){
				//如果是M即使是NVC VC C 也一定要输入
							_goError(e[i],func,"该项目不能为空！")
							return false
				}
				
				//I处理方式允许NVC VC C 为 ""
				switch(e[i].leixing){
					case "NVC":
					case "VC":
					case "C":
						//字符串类型允许不输入
						continue
					default:
							_goError(e[i],func,"该项目不能为空！")
							return false
				}					
			}// end if strValue==""


			//根据 maxlength 判断
		
			
			if (e[i].value.length>e[i].maxlength&&(e[i].tagName=='TEXTAREA')){
				alert (e[i].parentElement.previousSibling.innerText+"长度过长应该小于"+e[i].maxlength);
				e[i].focus();
				return (false);
			}		

			
			//根据 leixing 判断
			switch(e[i].leixing)
			{
				case 'NVC'://nvarchar
						break
				case 'VC': //varchar
						break
				case 'I':			//int型
						
						if (!isintstr(strValue)){
							_goError(e[i],func)
							return false
						}
						break
						
				case 'IP': //检测IP是否合法
						{
						  var filter=/[0-5]{1,3}.[0-5]{1,3}.[0-5]{1,3}.[0-5]{1,3}/;
						  
						  if (!filter.test(strValue))
						  {
							_goError(e[i],func)
							return false
							}
						}
						break

				case 'DA':	//date

						if (!isdatestr(strValue)){
							_goError(e[i],func)
							return false
							
						}
						//alert(e[i].value)
						if (!isValidSmallDate(strValue)){
							_goError(e[i],func,"日期超出了SmallDate的范围（1900-1-1到 2079-6-6）")
							return false
						}
						break

				case 'LDA':	//datetime
						//alert("HI");
						if (!isdatestr_lda(strValue)){
							_goError(e[i],func)
							return false
							
						}
						//alert(e[i].value)
						if (!isValidSmallDate(strValue)){
							_goError(e[i],func,"日期超出了SmallDate的范围（1900-1-1到 2079-6-6）")
							return false
						}
						break
				case 'DE': //decimal
						if (!isDecimal(e[i].value)){
							_goError(e[i],func)
							return false
						}	
						break
						
				case 'R':			//real型
						
						if (!isintstr(strValue)){
							_goError(e[i],func)
							return false
						}
						break

				case 'M': //money
						if (!isMoney(e[i].value)){
							_goError(e[i],func)
							return false
						}	
						break
				case 'SJ':
					//if (!(/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/.test(strValue))){
					
					
					if (!(/^(([0-1][0-9])|([2][0-3])|[0-9]):(([0][0-9]|([1-5][0-9]|[0-9])))$/.test(strValue))){
							_goError(e[i],func)
							return false
					}
				case 'DASJ':	
					if (!isDASJ(e[i].value)){
							_goError(e[i].value,func)
							return false
					}
				case 'LLDA':
					if (!isLLDA(e[i].value)){
						_goError(e[i],func)
						return false
					}	
					break
				case 'Y':
					break
				case 'YM':
					break
			}//end switch
		}//end for
				
	return true
	}

	//====================================
	//函数名：_goError
	//参  数：e    要检查的对象
	//        func 对待错误的处理函数（如果为NULL则就在画面以出现提示框的形式完成）
	//        s    错误提示
	//功  能：错误处理函数
	//====================================
	function _goError(e,func,s){
		if (s!=null) alert(e.parentElement.previousSibling.innerText+s)
			else	alert(e.parentElement.previousSibling.innerText+"类型错误");
		
		if (func!=null) {
			func(e)
		}
		else{
			//alert (e.type)
			e.focus();
			//e.select();
			//如果是select框会出错
		}
	}
	
	//====================================
	//函数名：_selItem
	//参  数：item1 数据源对象
	//        item2 数据目的对象
	//功  能：将数据从一个下拉列表框添加到另一个下拉列表框
	//====================================
	function _selItem(item1,item2)
	{
		var option1 = document.all(item1).options
		var option2 = document.all(item2).options
		
		var arrText = new Array();
		var arrValue = new Array();
		var j;
		j = 0;
		for(var i=option1.length-1;i>=0;i--)
		{
			if (option1(i).selected)
			{
				arrText[j]=option1(i).text;
				arrValue[j]=option1(i).value;
				option1.remove(i);
				j = j + 1;
			}
		}
		for(i=arrText.length-1;i>=0;i--)
		{
			var oOption = document.createElement("OPTION");
			option2.add(oOption);
			oOption.innerText = arrText[i];
			oOption.value = arrValue[i];		
		}
	}
	
	//====================================
	//函数名：rollup
	//参  数：sel_item 数据源对象
	//        
	//功  能：将下拉列表框的数据向上移动
	//====================================
	function _rollup(sel_item)
	{
		var option = document.all(sel_item).options
		var value
		var text
		if (document.all(sel_item).options.length == 0) return false
		if (document.all(sel_item).selectedIndex == 0) return false
		for (var i=0;i<option.length;i++)
		{
			if (option(i).selected)
			{
				value = option(i-1).value
				text  = option(i-1).innerText
				option(i-1).value = option(i).value
				option(i-1).innerText = option(i).innerText
				option(i).value = value
				option(i).innerText = text
				option(i-1).selected=true
				option(i).selected=false
			}
		}
	}
	//====================================
	//函数名：rollup
	//参  数：sel_item 数据源对象
	//        
	//功  能：将下拉列表框的数据向下移动
	//====================================
	function _rolldown(sel_item)
	{
		var option = document.all(sel_item).options
		var value
		var text
		if (document.all(sel_item).selectedIndex == option.length-1) return false
		for (var i=option.length-1;i>=0;i--)
		{
			if (option(i).selected)
			{
				if (i==(option.length-1)) return false
				value = option(i+1).value
				text  = option(i+1).innerText
				option(i+1).value = option(i).value
				option(i+1).innerText = option(i).innerText
				option(i).value = value
				option(i).innerText = text
				option(i+1).selected=true
				option(i).selected=false
			}
		}
	}
	//====================================
	//函数名：_delete
	//参  数：thisform 要提交的Form窗体
	//        
	//功  能：将画面的动作参数设为delete然后提交窗体
	//====================================
	function _delete(thisform)
	{
		var isDel=window.confirm("真的要删除吗？")
		if (isDel){
		document.all.act.value="delete"
		thisform.method="post"
		thisform.submit()
		}
	}

	//====================================
	//函数名：getToday
	//参  数：
	//        
	//功  能：得到当前日期的值，格式化后的（YYYY/MM/DD）
	//====================================
	function getToday()
	{
		var d = new Date()
		return d.getYear()+'/'+(d.getMonth()+1)+'/'+d.getDate()
	}
	
	//====================================
	//函数名：getTotime
	//参  数：
	//        
	//功  能：得到当前时间的值，格式化后的（YYYY/MM/DD HH:MM:SS）
	//====================================
	function getTotime()
	{
		var d = new Date()
		var s= d.getYear()+'/';
		s += formatInt((d.getMonth()+1))+'/';
		s += formatInt(d.getDate())+' ';
		s += formatInt(d.getHours())+':'
		s += formatInt(d.getMinutes())+':'
		s += formatInt(d.getSeconds())
		return s
	}
	
	//====================================
	//函数名：formatInt
	//参  数：
	//        
	//功  能：格式化数值
	//====================================
	function formatInt(value)
	{
		if (value<10)
		{
			return '0'+value
		}
		else
		{
			return ''+value
		}
	}
	
	//====================================
	//函数名：getDateFormat10
	//参  数：d		要格式化的日期的值
	//        
	//功  能：得到格式化后的日期（YYYY-MM-DD）
	//====================================
	function getDateFormat10(d)
	{
		if (d=="") return ''
		var arrDa
		arrDa = d.split("-")
		var s
		s = formatInt(arrDa[0])+'-'+formatInt(arrDa[1])+'-'+formatInt(arrDa[2])
		return s
	}
	
	
	
	//====================================
	//函数名：checkAllItemsISNull
	//参  数：thisform表单对象
	//        
	//功  能：判断是否所有表单项均为空
	//作  者：Peteryu
	//完成日期:2003-6-26
	//====================================
	function checkAllItemsISNull(thisform)	{
		var e=theform.elements;
		var flag = 0;
		for (var i=0,lngLeng = e.length;i<lngLeng;i++)
		{
			if (e[i].type=="text")	{
				alert(e[i].value);
				if (e[i].value!="")
					flag = 1;
			}
		}
		if (flag == 0)	{
			alert("error");
			return false;
		}
		else
			return true;
	
	}
	
	
	
	//====================================
	//函数名：changeHints
	//参  数：thisform表单对象
	//        
	//功  能：在输入框边自动显示输入字符
	//	  （汉字）数目情况
	//作  者：Peteryu
	//完成日期:2003-11-06
	//====================================
	//
	function changeHints(subject,spanid,strlen){
		var l=strlength(subject.value)
		if (l<=strlen) {
			var templen = strlen-l
			if (document.all!=null) document.all(spanid).innerHTML="<font color=blue>还可以输入"+templen+"字符</font>"
		}
		else{
			if (document.all!=null) {
				document.all(spanid).innerHTML="<font color=red>输入的字节数超出"+strlen+"字符</font>"
			}
		}
		return true
	}
	
	
	//====================================
	//函数名：strlength
	//参  数：thisform表单对象
	//        
	//功  能：配合上面的函数，得到输入字符
	//	  （含汉字）的长度
	//作  者：Peteryu
	//完成日期:2003-11-06
	//====================================
	function strlength(str){
		var l=str.length;
		var n=l
		for (var i=0;i<l;i++)
		{
			if (str.charCodeAt(i)<0||str.charCodeAt(i)>255) n++
		}
		return n
	}