//命名规范：单个页面所属函数应该在前面添加：ht前缀；

//定义Dom扩展属性
	function aLeft(d)
		{
			var a=d,b=0;
			while (a) {
				if(a.offsetLeft){
					b=b+a.offsetLeft;
				}
				a=a.offsetParent;
			}
			return b;
		}
	function aRight(a)
		{
			return aLeft(a)+a.offsetWidth;
		}
	function aTop(d)
		{
			var a=d,b=0;
			while (a) {
				if(a.offsetTop){
					b=b+a.offsetTop;
				}
				a=a.offsetParent;
			}
			return b;
		}
	function aBottom(a) {
		return aTop(a)+a.offsetHeight;
	}
	function getStyle(a,styleName)	//获得currentStyle的内容
		{
			if(document.all){
				return a.currentStyle.getAttribute(styleName,0);
			}
			else {
				var re=/([A-Z]+)/g;
				var c=styleName;
				if(c.match(re)!=null){
					c=c.replace(re,'-$1');
					c=c.toLowerCase();
				}
				return window.getComputedStyle(a,'').getPropertyValue(c);
			}
		}
	function htEditorGetZIndex(b)	//获得b对象的子对象中最大的z-index
		{
			var zIndex=0,curIndex=0,cnNode=null;
			for (var i=0; i<b.childNodes.length; i++) {
				cnNode=b.childNodes[i];
				if(cnNode.nodeType==1){
					curIndex=fs(0,$(cnNode).getStyle('zIndex'));
					zIndex=curIndex>zIndex ? curIndex : zIndex;
				}
			}
			return zIndex;
		}
	function childrenByTagName(a,tagName)	//返回a对象第一级子对象中tagName的数组
		{
			var arr=new Array(),b;
			if(a.hasChildNodes()==false){return arr;}
			for (var i=0; i<a.childNodes.length; i++) {
				b=a.childNodes[i];
				if(b.nodeType==1){
					if(b.tagName.toLowerCase()==tagName){arr.push($(b));}
				}
			}
			return arr;
		}
	//返回某对象所包含的文本内容
	function inText(a)
		{
			if(document.all){return a.innerText;}
			else{
				var c=a.innerHTML;
				var re=/<[0-9a-z]+[\s\S]*?>/ig;
				c=c.replace(re,'');
				var re=/<\/[0-9a-z]+>/ig;
				c=c.replace(re,'');
				return c;
			}
		}
	//返回某对象的左右边框宽度＋左右padding宽度＋左右margin宽度
	function propertyWidth(a)
		{
			var n=fs(0,a.getStyle('borderLeftWidth'));
			n=n+fs(0,a.getStyle('borderRightWidth'));
			n=n+fs(0,a.getStyle('paddingLeft'));
			n=n+fs(0,a.getStyle('paddingRight'));
			n=n+fs(0,a.getStyle('marginLeft'));
			n=n+fs(0,a.getStyle('marginRight'));
			return n;
		}
	//返回某对象的上下边框宽度＋上下padding宽度＋上下margin宽度
	function propertyHeight(a)
		{
			var n=fs(0,a.getStyle('borderTopWidth'));
			n=n+fs(0,a.getStyle('borderBottomWidth'));
			n=n+fs(0,a.getStyle('paddingTop'));
			n=n+fs(0,a.getStyle('paddingBottom'));
			n=n+fs(0,a.getStyle('marginTop'));
			n=n+fs(0,a.getStyle('marginBottom'));
			return n;
		}
	//返回某对象的父对象的className为特定值的对象
	function parentClassName(d,cName)
		{
			var a=d,strName;
			while (a) {
				a=a.parentNode;
				if(a){
					strName=document.all ? a.className :a.getAttribute('class',0);
					if(strName==cName){return a;}
				}
			}
			return null;
		}
	//返回某对象的tagName为特定值，className为特定值的对象数组
	function childClassName(a,tagName,cName)
		{
			var arr=new Array();
			var oElements=a.getElementsByTagName(tagName);
			if(oElements){
				for (var i=0; i<oElements.length; i++) {
					var strName=document.all ? oElements[i].className : oElements[i].getAttribute('class',0);
					if(strName==cName){arr.push(oElements[i]);}
				}
			}
			return arr;
		}
	//返回某对象的tagName为特定值，className为特定值的对象数组中的第一个对象
	function childClassNameFirst(a,tagName,cName)
		{
			var arr=childClassName(a,tagName,cName);
			if(arr.length>0){return arr[0]}else{return null;}
		}

//定义Dom扩展方法
	function setStyle(a,styleName,styleValue)
		{
			if(document.all){a.runtimeStyle.setAttribute(styleName,styleValue,0);}
			else{
				var re=/^([a-z]+)([A-Z]+)([a-z]+)$/;
				var c=styleName;
				if(c.match(re)!=null){
					c=c.replace(re,'$1-$2$3');
					c=c.toLowerCase();
				}
				a.style.setProperty(c,styleValue,null);
			}
		}

	function hide(a)
		{
			setStyle(a,'display','none');
		}
	//移除某对象所有子对象
	function removeAllChildren(a)
		{
			while (a.hasChildNodes()) {
				a.removeChild(a.firstChild);
			}
		}
	//等比例缩放图像，宽度缩放到targetWidth，其中rate=图片原始的height/width
	function resize(a,targetWidth,rate)
		{
			a.setAttribute('width',targetWidth);
			a.setAttribute('height',rate*fs(0,a.width));
		}
	//激发click事件
	function performClick(a)
		{
			if(document.all){
				a.fireEvent('onclick');
			}
			else{
				var evt=document.createEvent('MouseEvents');
				evt.initMouseEvent('click', true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);
				a.dispatchEvent(evt);
			}
		}
	//去掉对象value的前后空格
	function trim(a)
		{
			if(a.type.toLowerCase()!=='text'){return;}
			a.value=a.value.trim();
		}
	//等同于innerText，给对象添加文本子对象，替换对象的所有子对象
	function setText(a,c)
		{
			removeAllChildren(a);
			if(c.length>0){
				var oText=document.createTextNode(c);
				a.appendChild(oText);
			}
		}


//定义Dom扩展属性对象组
var __G=
	{
		'aLeft':aLeft,
		'aRight':aRight,
		'aTop':aTop,
		'aBottom':aBottom,
		'propertyWidth':propertyWidth,
		'propertyHeight':propertyHeight,
		'setStyle':setStyle,
		'getStyle':getStyle,
		'hide':hide,
		'childMaxZIndex':htEditorGetZIndex,
		'childrenByTagName':childrenByTagName,
		'inText':inText,
		'setText':setText,
		'removeAllChildren':removeAllChildren,
		'resize':resize,
		'performClick':performClick,
		'parentClassName':parentClassName,
		'childClassName':childClassName,
		'childClassNameFirst':childClassNameFirst,
		'trim':trim
	}

var $=function(){
		if(arguments.length==1){
			var a=arguments[0];
			var el=typeof(a)=='string' ? document.getElementById(a) : a;
			if(el && !el._extendedByMyScriptName){
				for(var i in __G){
					var _tmpFn=function(_fn,_o){//delegate function
						return function(){
							if(typeof(_fn)=="function"){return _fn.apply(null,[_o].concat(Array.prototype.slice.call(arguments)))}else{return null;}
						}
					};
					el[i]=_tmpFn(__G[i],el);
				}
				//this statement is use to stop from too much recursion
				el._extendedByMyScriptName=true;
			}
			return el;
		}
		else{
			var dataArray=arguments[0],runCode=arguments[1];
			switch (runCode) {

				case 0:		//调用方式：$(Array(a,'span',elementArray),0)，最后将elementArray设置为a对象所有tagName为span的子对象集合；
					var a=dataArray[0],tagName=dataArray[1],elementArray=dataArray[2];
					var b=a;
					if(b){
						if(b.nodeType==1){
							if(b.tagName.toLowerCase()==tagName){elementArray.push(b);}
						}
						if(b.hasChildNodes()){
							for (var i=0; i<b.childNodes.length; i++) {
								$(Array(b.childNodes[i],tagName,elementArray),0);
							}
						}
					}
				break;

				case 1:		//调用方式：$(Array(a,'span'),1)，返回a对象中第一个tagName为span的子对象；
					var a=dataArray[0],tName=dataArray[1],oSpan;
					if(a.hasChildNodes()){
						for (var i=0; i<a.childNodes.length; i++) {
							if(a.childNodes[i].nodeType==1){
								if(a.childNodes[i].tagName.toLowerCase()==tName){
									return a.childNodes[i];
								}
							}
							oSpan=$(Array(a.childNodes[i],tName,oSpan),1);
							if(oSpan){return oSpan;}
						}
					}
				break;

				case 2:		//调用方式：$(Array(a,'left'),2)返回对象a相对原点的绝对距离；
					var a=dataArray[0],direction=dataArray[1],b=0;
					while (a) {
						if(a.nodeType==1){
							b=b+(direction=='left' ? a.offsetLeft : a.offsetTop);
						}
						a=a.offsetParent;
					}
					return b;
				break;

				case 3:		//调用方式：$('checkBoxName',3)，返回当前文档中，name为checkBoxName的对象集合数组；
					var cArray=new Array();
					var a=document.getElementsByTagName('input'),c=arguments[0];
					if(a==null){return cArray;}
					for (var i=0; i<a.length; i++) {
						if(a[i].type.toLowerCase()=='checkbox'){
							if(a[i].name==c){
								cArray.push(a[i]);
							}
						}
					}
					return cArray;
				break;

				case 5:		//调用方式：$(Array(a,'tr'),5)，返回某对象父对象tagName为tr的对象
					var a=dataArray[0],strTg=dataArray[1];
					var b=a.parentNode;
					while (b) {
						if(b.tagName){
							if(b.tagName.toLowerCase()==strTg){return b;}
						}
						b=b.parentNode;
					}
				break;

				case 6:		//调用方式：$(a,6)，返回某对象的privousSibling（其nodeType为1）
					var a=arguments[0];
					var b=a.previousSibling;
					while (b) {
						if(b.nodeType==1){return b;}
						b=b.previousSibling;
					}
				break;

				case 7:		//调用方式：$(a,7)，返回某对象的nextSibling（其nodeType为1）
					var a=arguments[0];
					var b=a.nextSibling;
					while (b) {
						if(b.nodeType==1){return b;}
						b=b.nextSibling;
					}
				break;

				case 8:		//调用方式：$(a,8)，返回对象a的innerText，但不包括对象a的子对象的innerText
					var a=arguments[0],b,c='';
					if(a.hasChildNodes()){
						for (var i=0; i<a.childNodes.length; i++) {
							b=a.childNodes[i];
							if(b.nodeType==3){c=c+b.nodeValue;}
						}
					}
					return c;
				break;

				case 9:		//调用方式：$(c,9)，返回c的文件后缀，如果c是个文件名的话，否则返回空字符串
					var re=/\.([^.\/]+)(\?|$)/ig;
					var arr=re.exec(arguments[0]);
					if(arr){return arr[1];}
				break;

				case 10:	//调用方式：$('',10)，返回当前文件绝对路径
					return self.location.pathname.toLowerCase();
				break;

				case 11:	//调用方式：$(a,11)，返回a对象的第一个nodeType＝1的子对象
					var a=arguments[0];
					if(a.hasChildNodes()){
						a=a.childNodes;
						for (var i=0; i<a.length; i++) {
							if(a[i].nodeType==1){return a[i];}
						}
					}
				break;

				case 12:	//调用方式：$(strSrc,12)，以数组形式返回图片对象的长、宽值；
					var c=arguments[0];
					var oImg=document.createElement('img');
					oImg.setAttribute('src',c,null);
					try {
						return new Array(oImg.width,oImg.height);
					}
					catch (e) {
						alert(e);
						return false;
					}
				break;

				case 13:	//调用方式：$(a,13)，返回a对象最深的frame子对象；
					var a=arguments[0];
					while(a.frames.length>0){
						a=a.frames[0];
					}
					return a;
				break;

				case 14:	//调用方式：$(textArea,14)，将在线编辑器的值赋给给表单对象中a项目value
					var a,b=arguments[0];
					try {
						a=$(self,13);
						a=$(Array(a.document,'body'),1);
						if(b.value!=a.innerHTML){b.value=a.innerHTML;}
					}
					catch (e) {
					}
				break;

				case 15:	//调用方式：$(a,15,input,type)，返回a对象的子对象中，tagName为input，type为type的对象集合
					var a=arguments[0],tagName=arguments[2],typeName=arguments[3];
					var oArray=new Array();
					var oCols=a.getElementsByTagName(tagName);
					for (var i=0; i<oCols.length; i++) {
						if(oCols[i].type.toLowerCase()==typeName.toLowerCase()){oArray.push(oCols[i]);}
					}
					return oArray;
				break;

				default:

			}
		}

	}

var $$=function(b,n)
	{
		switch(n){
			case 1:	//在某文档中的radio中返回checked对象；
				var a=b.getElementsByTagName('input');
				if(a){
					for (var i=0; i<a.length; i++) {
						if(a[i].type.toLowerCase()=='radio'){
							if(a[i].checked){return a[i];}
						}
					}
				}
			break;

			case 2:	//在某文档中的checkbox中返回checked了并且命名了的checkbox对象；
				var a=b.getElementsByTagName('input');
				var cArray=new Array();
				if(a){
					for (var i=0; i<a.length; i++) {
						if(a[i].type.toLowerCase()=='checkbox'){
							if(a[i].checked && a[i].name==arguments[2]){cArray.length++;cArray[cArray.length-1]=a[i];}
						}
					}
					return cArray;
				}
			break;

			case 3:	//在同一级对象中，将a、和b之间的对象remove，调用方式：$$(Array(a,b),3)
				var a=arguments[0][0],b=arguments[0][1],d;
				a=a.nextSibling;
				while (a!=b) {
					d=a.nextSibling;
					a.parentNode.removeChild(a);
					if(d){a=d}else{break;}
				}
			break;
			case 5:	//调用方式：$$(a,5)，返回a对象中子对象最大的z-index；
				var zIndex=0,curIndex,cnNode;
				for (var i=0; i<b.childNodes.length; i++) {
					cnNode=b.childNodes[i];
					if(cnNode.nodeType==1){
						curIndex=fs(0,getStyle(cnNode,document.all ? 'zIndex' : 'z-index'));
						zIndex=curIndex>zIndex ? curIndex : zIndex;
					}
				}
				return zIndex;
			break;
		}
	}

var $s=function (runCode)
	{
		switch (arguments[0]) {
			case 0:		//调用方式$s(0,a,'abc')，类似a.innerText='abc'功能;
					var a=arguments[1],oText=arguments[2];
					oText=document.createTextNode(oText);
					while(a.hasChildNodes()){a.removeChild(a.firstChild);}
					a.insertBefore(oText,null);
				break;

			case 1:		//调用方式$s(1,a,'aaaa','bbb')，在a对象的子对象序列中插入<input type="hidden" name="aaa" value="bbb">
					var a=arguments[1],strName=arguments[2],strValue=arguments[3],oHidden;
					oHidden=document.createElement('input');
					oHidden.setAttribute('type','hidden',0);
					oHidden.setAttribute('name',strName,0);
					oHidden.setAttribute('value',strValue,0);
					a.insertBefore(oHidden,null);
				break;

			case 2:		//调用方式：$s(2,a,'http://www.hitau.com','海涛科技','htUpdate(this);')，前四项必须有，在a对象的子对象序列中插入<a></a>
					var a=arguments[1],strHref=arguments[2],strText=arguments[3],strOnClick=arguments.length>=4 ? arguments[4] : '';
					var oA=document.createElement('a');
					oA.setAttribute('href',strHref,0);
					if(strOnClick.length>0){oA.setAttribute('onclick',strOnClick,0);}
					var oText=document.createTextNode(strText);
					oA.insertBefore(oText,null);
					a.insertBefore(oA,null);
				break;

			case 3:		//调用方式：$s(3,cookieName)，返回cookie值，如果该cookie不存在，则返回null，不适用于类似Cookies("hitau")("name")的cookie
				var arr=document.cookie.split(';');
				for (var i=0; i<arr.length; i++) {
					var c=arr[i];
					var sPos=c.indexOf('=');
					var cName=c.substring(0,sPos).trim();
					if(cName==arguments[1]){return c.substring(sPos+1,c.length);}
				}
				return null;
			break;

			case 5:		//调用方式：$s(5,cookieName,cookieValue)，设置cookie值
				//debugger;
				/*var arr=document.cookie.split(';');
				/var strCookie='';
				/var bln=false;
				for (var i=0; i<arr.length; i++) {
					var c=arr[i];
					var sPos=c.indexOf('=');
					if(sPos>0){
						var cName=c.substring(0,sPos).trim();
						var cValue=c.substring(sPos+1,c.length);
						if(cName==arguments[1]){c=cName+'='+arguments[2];bln=true;}
					}
					strCookie=strCookie.length>0 ? strCookie+'; '+c : c;
				}
				if(bln==false){
					strCookie=strCookie.length>0 ? strCookie+'; '+arguments[1]+'='+arguments[2] : arguments[1]+'='+arguments[2];
				}
				document.cookie=strCookie;*/
				document.cookie=arguments[1]+'='+escape(arguments[2]);
			break;

			default:
		}
	}

var $c=function ()		//进行check，一般返回true或者false
	{
		switch (arguments[0]) {
			case 0:		//调用方式$c(0,a)，a为特定的radio集合，如果有某一项被选中，则返回true，否则返回false
				var a=arguments[1];
				for (var i=0; i<a.length; i++) {
					if(a[i].checked){return true;}
				}
				return false;
			break;
			default:

		}
	}

var $f=function ()		//各种功能
	{
		switch (arguments[0]) {

			case 1:		//调用方式：$f(1,a,b)计算a项目中的字数，并反馈到b项目中
				var a=arguments[1],b=arguments[2];
				var c=a.value.length;
				$s(0,b,c);
			break;

			case 2:		//调用方式：$f(2)，持续连接/action/times_update.asp，定时更新某些内容
				try {
					tao.getHtpText('get','/action/times_update.asp');
				}
				catch (e) {
					alert(e);
				}
				setTimeout('$f(2)',1740000);
			break;

			case 3:		//调用方式：$f(3,c)，将输入的价格进行简单加密
				var c=arguments[1];
				var n=Math.floor((9999-1000+1)*Math.random()+1000);
				return n.toString()+c.toString();
			break;

			default:

		}
	}

var dd={
		sw:document.documentElement.scrollWidth,
		ow:document.documentElement.offsetWidth,
		cw:document.documentElement.clientWidth,
		sh:document.documentElement.scrollHeight,
		oh:document.documentElement.offsetHeight,
		ch:document.documentElement.clientHeight,
		sl:document.documentElement.scrollLeft,
		st:document.documentElement.scrollTop,
		cl:document.documentElement.clientLeft
	}

var Form={		//form工具，check：检查表单内容是否正确
	check:function(){
		/*
			调用方法类似：
			if(Form.check(f,
				{itemName:'subject',minLength:2,maxLength:8,strAlert:'请正确填写帮助标题，字数不少于2个字符，不大于8个字符；'},
				{itemName:'helpKindID',valueNoEmpty:true,strAlert:'请选择所属主题；'},
				{itemName:'content',minLength:10,strAlert:'请正确填写帮助信息，字数不能少于10个字符；'}
			)==false)return false;
		*/
		var a,f=arguments[0],strErr='',objFocus=null;
		for (var i=1; i<arguments.length; i++) {
			a=arguments[i];
			b=f.elements[a.itemName];
			if(b.type){
				switch(b.type.toLowerCase()){
					case 'text':		//调用方法：Form.check(f,{itemName:'subject',minLength:2,maxLength:8,strAlert:'请正确填写帮助标题，字数不少于2个字符，谢谢。'});
							if (a.minLength){
								if(b.value.length<a.minLength){strErr=strErr+a.strAlert+'\n';if(objFocus==null)objFocus=b;}
							}
							if (a.maxLength){
								if(b.value.length>a.maxLength){strErr=strErr+a.strAlert+'\n';if(objFocus==null)objFocus=b;}
							}
						break;
					case 'textarea':
							if (a.minLength){
								if(b.value.length<a.minLength){strErr=strErr+a.strAlert+'\n';if(objFocus==null)objFocus=b;}
							}
							if (a.maxLength){
								if(b.value.length>a.maxLength){strErr=strErr+a.strAlert+'\n';if(objFocus==null)objFocus=b;}
							}
							break;
					case 'select-one':
						if(a.valueNoEmpty){	//如果是select项，值不能为空
							if(b[b.selectedIndex].value.length==0){strErr+=a.strAlert+'\n';if(objFocus==null)objFocus=b;}
						}
						break;
					case 'checkbox':
						alert('aaa');
				}
			}
			else{
				if(b.length){
					switch(b[0].type.toLowerCase()){
						case 'checkbox':
							if(a.mustCheckedOne){
								var bln=false;
								for(var j=0;j<b.length;j++){if(b[j].checked){bln=true;break;}}
								if(bln==false){strErr+=a.strAlert+'\n';}
							}
							break;
					}
				}
			}
		}
		if(strErr.length>0){
			alert(strErr);
			if (objFocus) {objFocus.focus();}
			return false;
		}
		else{
			return true;
		}
	}
}

var center=function()	//把对象在当前文档中居中
	{
		var a=arguments[0];
		a.style.left=((document.documentElement.clientWidth-a.clientWidth)/2+document.documentElement.scrollLeft)+'px';
		a.style.top=((document.documentElement.clientHeight-a.clientHeight)/2+document.documentElement.scrollTop)+'px';
	}
function pageSearch(o)	//点击页面浏览条旁边的搜索按钮后指向的搜索函数，原代码类似：<input type="text" value="" class="itSearchKey" onkeypress="pageSearch(this);"> <input type="button" value="搜索" class="buttonSearchKey"onclick="pageSearch(this);">
	{
		var a=null;
		if(o.type.toLowerCase()=='text' && event.keyCode==13){a=o;}else{if(o.type.toLowerCase()=='button'){a=o.previousSibling;while(a){if(a.type){if(a.type.toLowerCase()=='text'){break;}else{a=a.previousSibling;}}else{a=a.previousSibling;}}}}
		if(a==null)return;
		a.value=a.value.trim();

		var b=a;
		var searchBound='';
		while(b){
			if(b.tagName){if(b.tagName.toLowerCase()=='select'){if(b.className=='selectSearchKey'){searchBound=b[b.selectedIndex].value;}}}
			b=b.previousSibling;
		}


		if(a.value!=''){self.location=self.location.pathname+'?searchKey='+encodeURIComponent(a.value)+'&searchBound='+encodeURIComponent(searchBound);}else{alert('请填写您要搜索的关键词，谢谢。');a.focus();}
	}
function maskBackground(bln)
	{
		var a=document.getElementById('divMask');
		if(a==null){
			a=document.createElement('div');
			var d=document.createAttribute('id');
			a.setAttributeNode(d);
			a.setAttribute('id','divMask');
			document.body.appendChild(a);
		}
		if(bln){
			a.style.position='absolute';
			a.style.left=0;
			a.style.top=0;
			a.style.width=document.body.scrollWidth+'px';
			a.style.height=document.body.scrollHeight+'px';
			a.style.backgroundImage='url(/common/images/site/tc.png)';
			a.style.zIndex=98;
			a.style.visibility='visible';
		}
		else{
			a.style.visibility='hidden';
		}
	}
function maskWaite(bln)	//遮罩当前网页，z-index小于99的对象
	{
		var a=$('divMaskWaite');
		if(a==null){
			a=document.createElement('div');
			var at=document.createAttribute('id');
			a.setAttributeNode(at);
			a.setAttribute('id','divMaskWaite');
			var img=document.createElement('img');
			var imgSrc=document.createAttribute('src');
			img.setAttributeNode(imgSrc);
			a=document.body.appendChild(a);
			img=a.appendChild(img);
			img.setAttribute('src','/common/images/site/wait.gif');
		}
		if(bln){
			a.style.position='absolute';
			a.style.zIndex='99';
			a.style.left=0;
			a.style.top=0;
			a.style.width=document.documentElement.clientWidth+'px';
			a.style.height=document.documentElement.clientHeight+'px';
			a.style.backgroundImage='url(/common/images/site/wait.gif)';
			a.style.visibility='visible';
		}
		else{
			a.style.visibility='hidden';
		}
	}
function raisError(str,n)
	{
		var a=$('divError');
		if(a==null)return;
		if(n){
			a.firstChild.innerText=str;a.style.width=document.documentElement.clientWidth+'px';a.style.height=document.documentElement.clientHeight+'px';a.style.visibility='visible';
		}
		if(n==false){a.style.visibility='hidden';}
	}

function mask()			//遮罩
	{
		//如果没有输入参数
		if(arguments.length==0){
			var a=$('divMask');
			if(a==null){
				a=document.createElement('div');
				a.setAttribute('id','divMask',0);
				a.style.width=document.body.scrollWidth+'px';
				a.style.height=document.body.scrollHeight+'px';
				a.style.backgroundColor='#FFF';
				a.style.position='absolute';
				a.style.left=0;
				a.style.top=0;
				a.style.filter='alpha(opacity=80)';
				a.style.opacity='0.5';
				//a.style.mozOpacity='0.2';
				document.body.insertBefore(a,null);
			}
		}
		//如果输入参数数量为1，则在当前document创建绝对遮罩，输入参数应当为mask的id，如果该id已经存在，则remove
		if(arguments.length==1){
			var idName=arguments[0];
			var oMask=$(idName);
			if(oMask){oMask.parentNode.removeChild(oMask);return;}
			oMask=$(document.createElement('div'));
			oMask.setAttribute('id',idName,0);
			oMask.style.position='absolute';
			oMask.style.left=0;
			oMask.style.top=0;
			oMask.setStyle('width',document.documentElement.scrollWidth+'px');
			oMask.setStyle('height',(document.documentElement.scrollHeight>document.documentElement.clientHeight ? document.documentElement.scrollHeight : document.documentElement.offsetHeight)+'px');
			oMask.style.filter='Alpha(Opacity=62)';
			oMask.style.opacity='0.62';
			oMask.style.backgroundColor='#FFF';
			oMask.setStyle('zIndex',$(document.body).childMaxZIndex()+1);
			document.body.appendChild(oMask);
			//oMask.focus();
		}
	}

function openDiv(url)
	{
		maskBackground(true);
		var a=document.getElementById('divOpen');
		if(a==null){
			a=document.createElement('div');
			var d=document.createAttribute('id');
			a.setAttributeNode(d);
			a.setAttribute('id','divOpen');
			document.body.appendChild(a);
		}
		a.style.position='absolute';
		a.style.width=dd.cw*0.7+'px';
		a.style.height=dd.ch*0.7+'px';
		a.style.left=(dd.sl+dd.cw*0.3/2)+'px';
		a.style.top=(document.documentElement.scrollTop+dd.ch*0.3/2)+'px';
		a.style.border='3px solid #999';
		a.style.backgroundColor='#F90';
		a.style.overflow='auto';
		a.style.zIndex=99;
		a.style.visibility='visible';
		var str=tao.getHtpText('get',url);
		str='<div id="divClose" onclick="closeDiv();"></div>'+str;
		a.innerHTML=str;
		var b=a.getElementsByTagName('input');
		if(b){
			for(var i=0;i<b.length;i++){
				if(b[i].type.toLowerCase()!='hidden')b[i].focus();break;
			}
		}
		a.onkeyup=function(event)
			{
				numKey=document.all ? window.event.keyCode : event.which;
				if(numKey==27){closeDiv();}
			}
	}

function openDivNew(runCode,url)	//调用方式：openDivNew(0,url,idMask,idDiv)，类似dialog功能，runCode留作扩展用，一般为0；
	{
		var idMask=arguments.length>=3 ? arguments[2] : '';
		var idDiv=arguments.length>=4 ? arguments[3] : '';
		var oMask=document.createElement('div'),preIndex;
		if(idMask.length>0){
			oMask.setAttribute('id',idMask,0);
		}
		oMask.style.position='absolute';
		oMask.style.left=0;
		oMask.style.top=0;
		oMask.style.width=document.documentElement.scrollWidth>document.documentElement.clientWidth ? document.body.scrollWidth : document.documentElement.clientWidth+'px';
		oMask.style.height=document.documentElement.scrollHeight>document.documentElement.clientHeight ? document.body.scrollHeight : document.documentElement.clientHeight+'px';
		oMask.style.filter='Alpha(Opacity=62)';
		oMask.style.opacity='0.62';
		oMask.style.backgroundColor='#FFF';
		preIndex=$$(document.body,5)
		oMask.style.zIndex=preIndex+1;
		document.body.appendChild(oMask);
		oMask.focus();
		var oDiv=document.createElement('div');
		if(idDiv.length>0){
			oDiv.setAttribute('id',idDiv,0);
		}
		oDiv.style.position='absolute';
		var width=document.documentElement.clientWidth*0.8;
		var height=document.documentElement.clientHeight*0.8;
		oDiv.style.width=width+'px';
		oDiv.style.height=height+'px';
		oDiv.style.left=document.documentElement.scrollLeft+(document.documentElement.clientWidth-width)/2+'px';
		oDiv.style.top=document.documentElement.scrollTop+(document.documentElement.clientHeight-height)/2+'px';
		oDiv.style.backgroundColor='#AAA';
		oDiv.style.border='1px solid #666';
		oDiv.style.zIndex=preIndex+2;
		document.body.appendChild(oDiv);
		var oDivClose=document.createElement('div');
		oDivClose.style.position='absolute';
		oDivClose.style.left=0;
		oDivClose.style.top=0;
		oDivClose.style.width=oDiv.clientWidth+'px';
		oDivClose.style.height='20px';
		oDivClose.style.borderBottom='1px solid #666';
		oDivClose.style.backgroundImage='url(/common/images/site/button_close.png)';
		oDivClose.style.backgroundRepeat='no-repeat';
		oDivClose.style.backgroundPosition='99.9% 50%';
		oDivClose.style.cursor='pointer';
		oDivClose.onclick=function(){
			oDiv.parentNode.removeChild(oDiv);
			oMask.parentNode.removeChild(oMask);
		}
		oDiv.appendChild(oDivClose);
		var oDivContent=document.createElement('div');
		oDivContent.style.position='absolute';
		oDivContent.style.left='12px';
		oDivContent.style.top=(oDivClose.offsetHeight+12)+'px';
		oDivContent.style.width=(oDiv.clientWidth-48)+'px';
		oDivContent.style.height=(oDiv.clientHeight-oDivClose.offsetHeight-48)+'px';
		oDivContent.style.padding='12px';
		oDivContent.style.border='1px solid #666';
		oDivContent.style.backgroundColor='#CCC';
		oDivContent.style.overflow='auto';
		oDiv.appendChild(oDivContent);


		//添加内容
		var str=tao.getHtpText('get',url);
		oDivContent.innerHTML=str;
		var b=oDivContent.getElementsByTagName('input');
		if(b){
			for(var i=0;i<b.length;i++){
				if(b[i].type.toLowerCase()!='hidden')b[i].focus();break;
			}
		}
	}

function closeDiv()
	{
		maskBackground(false);
		var a=$('divOpen');
		if(a){a.style.visibility='hidden';}
	}
function isObject(a,c)	//判断是什么
	{
		switch(c){
			case 'a':
				if(a){
					if(a.tagName){
						if(a.tagName.toLowerCase()==c){return true;}
					}
				}
				break;
		}
		return false;
	}
function smd(url,a)		//显示模式窗口
	{
		self.showModalDialog(url);
	}

function moveRow(b,c,r1,r2)		//上移或下移表格中的行
	{
		//b是行中单元格中的某个对象（可以是td对象），r1，从表上部数起，有r1行不能移动；r2，从表下部数起有r2行不能移动
		//c=0，上移；c=1，下移
		var a=tao.parentNodes(b,'tr');
		var t=tao.parentNodes(b,'table');
		var d;
		switch(c){
			case 0:		//上移
				d=$(a,6);
				if(d){if(d.rowIndex>r1-1){d.swapNode(a);}}
				break;
			case 1:		//下移
				d=$(a,7);
				if(d){if(d.rowIndex<t.rows.length-r2){d.swapNode(a);}}
				break;
		}
	}

function fs(runCode,c)			//格式化字符串
	{
		switch (runCode) {
			case 0:		//调用方式：fs(0,c)，将字符串格式化为≥0的整数，如果字符串不能解析为数字或者解析为负数，则格式化为0
				var b=0;
					b=parseInt(c);
					if(isNaN(b)){b=0;}
					if(b<0){b=0;}
					return b;
			break;

			case 1:		//调用方式：fs(1,c)，将在线编辑器里的字符串进行优化
				//去除<br></p>中的<br>
				var c=arguments[1];
				var re=/<br><\/p>/ig;
				c=c.replace(re,'</p>');
				re=/(<[^>]+?)( _[a-z]+="[0-9]+")/ig;
				c=c.replace(re,'$1');
				return c;
			break;

			case 2:		//调用方式：fs(2,c)，将c格式化为数字，如果不能解析为数字，则格式化为0
				var c=parseFloat(arguments[1]);
				if(isNaN(c)){return 0;}else{return c;}
			break;

			case 3:		//调用方式：fs(3,c)，将c进行四舍五入，c<10，保留两位小数,10<=c<100，保留1位销售，c>=100，省略小数
				if(c<10){
					return Math.round(c*100)/100;
				}
				if(c>=10 && c<100){
					return Math.round(c*10)/10;
				}
				if(c>=100){
					return Math.round(c);
				}
			break;

			case 5:		//调用方式：fs(5,c)，主要用于零售价，将c进行四舍五入，c<1，保留1位小数,c>=1 && c<100，不保留小数，c>=100，省略个位数
				if(c<1){
					return Math.round(c*10)/10;
				}
				if(c>=1 && c<100){
					return Math.round(c);
				}
				if(c>=100){
					return Math.round(c/10)*10;
				}
			break;

			case 6:		//调用方式：fs(6,c)，将c进行类似四舍五入的方式，只是均为进位，c<1，保留1位小数,c>=1 && c<100，不保留小数，c>=100，省略个位数
				if(c<1){
					return Math.ceil(c*10)/10;
				}
				if(c>=1 && c<100){
					return Math.ceil(c);
				}
				if(c>=100){
					return Math.ceil(c/10)*10;
				}
			break;

			default:

		}
	}

function getStyle(a,c)			//调用方式：getStyle(a,'z-index')，返回a对象currentStyle中由c指定的内容
	{
		var strValue='';
		if(document.defaultView && document.defaultView.getComputedStyle){
			strValue = document.defaultView.getComputedStyle(a,'').getPropertyValue(c);
		}
		else {
			if(a.currentStyle){
				strValue=a.currentStyle.getAttribute(c,0);
			}
		}
		return strValue;
	}

function resize(runCode)	//改变大小
	{
		switch (runCode) {
			case 0:			//调用方式：resize(0,this)，如果是textarea，则当内容变化后，随动改变高度；
				var a=arguments[1];
				if(a.scrollHeight>a.clientHeight){
					a.style.height=(a.scrollHeight+20)+'px';
				}
				if(a.scrollHeight<a.clientHeight && a.clientHeight>50){
					a.style.height=(a.scrollHeight+20)+'px';
				}
			break;
			default:

		}
	}

function cell(oTable,c,n)		//返回某单元格，c为单元格列名，n为单元格所在的rowIndex
	{
		var x;
		var oCols=oTable.rows[0].cells;
		for (var i=0; i<oCols.length; i++) {
			if($(oCols[i],8)==c){x=oCols[i].cellIndex;break;}
		}
		return oTable.rows[n].cells[x];
	}

//获得需要处理的即时信息
function getInstant()
	{
		var a=g.oHttpContinue;
		if(a.readyState!=4){return;}
		var c=a.responseText;
		var oDivInstant=$('divInstant');
		if(c.length==0){if(oDivInstant){oDivInstant.parentNode.removeChild(oDivInstant);$(document.body).setStyle('marginRight','');}setTimeout('$f(0)',60000);return;}
		if(oDivInstant==null){
		var oDivInstant=document.createElement('div');
			oDivInstant.setAttribute('id','divInstant',0);
			$(document.body).setStyle('marginRight','53px');
			document.body.appendChild(oDivInstant);
		}
		oDivInstant.innerHTML=c;
		setTimeout('$f(0)',60000);
	}

//创建弹出窗口，返回该窗口对象
function createDialog()
	{
		var oDiv=document.createElement('div');
		var numHeight=arguments.length>=1 ? arguments[0] : 0;
		oDiv.setAttribute('id','divDialog',0);
		oDiv.style.position='absolute';
		oDiv.style.width='450px';
		oDiv.style.border='1px solid #666';
		oDiv.style.backgroundColor='#AAA';
		oDiv.style.left=document.documentElement.scrollLeft+(document.documentElement.clientWidth-300)/2+'px';
		if(numHeight>0){oDiv.style.top=document.documentElement.scrollTop+(document.documentElement.clientHeight-numHeight)/2+'px';}
		oDiv.style.zIndex=$(document.body).childMaxZIndex()+1;
		var oClose=document.createElement('a');
		oClose.setAttribute('id','aCloseDialog',0);
		oDiv.appendChild(oClose);
		var oText=document.createTextNode('×');
		oClose.appendChild(oText);
		oClose.style.display='block';
		oClose.style.borderBottom='1px solid #666';
		oClose.style.textAlign='right';
		oClose.style.padding='3px';
		oClose.style.cursor='hand';
		var oDivContent=document.createElement('div');
		oDivContent.setAttribute('id','divDialogContent',0);
		oDivContent.style.padding='12px';
		oText=document.createTextNode('请稍候……');
		var oImg=document.createElement('img');
		oImg.setAttribute('src','/common/images/site/wait2009.gif',0);
		oImg.setAttribute('width','64',0);
		oImg.setAttribute('height','64',0);
		oImg.setAttribute('border','0',0);
		var oBr=document.createElement('br');
		var oP=document.createElement('p');
		oP.appendChild(oText);
		oP.appendChild(oBr);
		oP.appendChild(oImg);
		oP.style.textAlign='center';
		oDivContent.appendChild(oP);
		oDiv.appendChild(oDivContent);
		return new Array(oDiv,oDivContent,oClose);
	}
function addContentToDialog(a,oDivContent)
	{
		if(a.readyState!=4){return;}
		var c=a.responseText;
		oDivContent.innerHTML=c;
		a=null;
	}

//------------------------------------
var parentNodes=function()
	{
		var b=arguments[0];
		var c=arguments[2];
		var objectArray=Array(c),targetObject;
		if (c.indexOf('/')!=-1){
			var objectArray=c.split('/');
			c=objectArray[0];
		}
		if (arguments[1]=='tagName'){
			while(b){b=b.parentNode;if(b){if(b.tagName){if(b.tagName.toLowerCase()==c){targetObject=b;break;}}}}
			if(objectArray.length>1){
				for (var i=1;i<objectArray.length;i++)
				{
					b=b.getElementsByTagName(objectArray[i])[0];
				}
				targetObject=b;
			}
		}
		return targetObject;
	}

String.prototype.blnReg=function(n)
	{
		switch(n){
			case 1:	//img,must:jpg,gif,png
				var re=/(\\|^)[0-9a-z-_]+\.(jpg|jpeg|gif|png)$/ig;
				//return re.test(this);
				if(this.match(re)==null){return false;}else{return true;}
			break;
			case 2:	//调用方式：instance.blnReg(2,',',c)，返回instance中是否包含由,隔开的c，如果包含，返回true,否则返回false
				var b=arguments[1],c=arguments[2];
				var oReg=new RegExp('(^|'+b.toPatrn()+')'+c.toPatrn()+'($|'+b.toPatrn()+')','ig');
				if(this.match(oReg)==null){return false}else{return true;}
			break;
		}
	}

String.prototype.toPatrn=function()	//将字符串中的正则表达式特殊字符进行替换，以使该字符串符合正则表达式的要求
	{
		var strPatrn=this;
		var c='';
		var d='';
		for (var i=0; i<strPatrn.length; i++) {
			d=strPatrn.charAt(i);
			d=d.replace('\\','\\\\');
			d=d.replace('$','\\$');
			d=d.replace('(','\\(');
			d=d.replace(')','\\)');
			d=d.replace('*','\\*');
			d=d.replace('+','\\+');
			d=d.replace('.','\\.');
			d=d.replace('[','\\[');
			d=d.replace(']','\\]');
			d=d.replace('?','\\?');
			d=d.replace('^','\\^');
			d=d.replace('{','\\{');
			d=d.replace('}','\\}');
			d=d.replace('|','\\|');
			c=c+d;
		}
		return c;
	}

String.prototype.trim = function()
	{
		return this.replace(/(^\s*)|(\s*$)/g,"");
	}

String.prototype.isDigital=function(n)	//是否特定数字
	{
		switch (n) {
			case 1:	//	≥0的正整数，以下未注明的，都不能为空
				var re=/^\+{0,1}[0-9]+$/ig;
				return (this.match(re)==null ? false : true);
				break;
			case 2:		//条形码
				var re=/^[0-9+*/=-]+$/ig;
				return (this.match(re)==null ? false : true);
				break;
			case 3:		//数字，可以为空
				if(this.length==0)return true;
				var re=/^(\+|\-){0,1}[0-9\.]+$/ig;
				if(this.match(re)==null){return false;}
				else{if(this.indexOf('.')!=this.lastIndexOf('.')){return false;}else{return true;}}
				break;
			case 4:		//数字
				var re=/^(\+|\-){0,1}[0-9\.]+$/ig;
				if(this.match(re)==null){return false;}
				else{if(this.indexOf('.')!=this.lastIndexOf('.')){return false;}else{return true;}}
				break;
			case 5:		//≥0的数字
				var re=/^\+{0,1}[0-9\.]+$/ig;
				if(this.match(re)==null){return false;}
				else{if(this.indexOf('.')!=this.lastIndexOf('.')){return false;}else{return true;}}
				break;
			case 6:	//	>0的正整数
				var re=/^\+{0,1}[0-9]+$/ig;
				if(this.match(re)==null){return false;}
				else{if(parseInt(this)>0){return true;}else{return false;}}
				break;
			case 7:		//	<>0的数字
				var re=/^(\+|\-){0,1}[0-9\.]+$/ig;
				if(this.match(re)==null){return false;}
				else{
					if(this.indexOf('.')!=this.lastIndexOf('.')){
						return false;
					}
					else{
						if(parseInt(this)!=0){return true;}else{return false;}
					}
				}
				break;
			case 8:	//	>0的数字
				var re=/^\+?[0-9.]+$/ig;
				if(this.match(re)==null){return false;}
				else{
					if(this.indexOf('.')!=this.lastIndexOf('.')){
						return false;
					}
					else{
						if(this>0){return true;}else{return false;}
					}
				}

			case 9:		//是否有效电子邮件地址
				var re=/^\w+(-\w+|\.\w+)*@[a-z0-9]+((\.|-)[a-z0-9]+)*\.[a-z0-9]+$/ig;
				return this.match(re)==null ? false : true;
			break;
			case 10:	//是否有效域名
				var re=/^[a-z0-9]+((-|\.)[a-z0-9]+)*\.[a-z0-9-]+\.[a-z]+$/ig;
				return this.match(re)==null ? false : true;
			case 11:	//是否有效IP地址
				var re=/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\.[0-9]{1,3}\.[0-9]{1,3}\.)?$/ig;
				return this.match(re)==null ? false : true;
			break;

			case 12:	//是否标准短信号码
				var re=/^\+[0-9]{12,18}$/ig;
				return this.match(re)==null ? false : true;
			break;

			case 15:	//≥0的整数，可以为空
				if(this.length==0){return true;}
				var re=/^\+{0,1}[0-9]+$/ig;
				return this.match(re)==null ? false : true;
			break;

			case 16:	//≥0的数字，可以为空
				if(this.length==0){return true;}
				var re=/^\+{0,1}[0-9\.]+$/ig;
				if(this.match(re)==null){return false;}
				else{if(this.indexOf('.')!=this.lastIndexOf('.')){return false;}else{return true;}}
			break;

			case 17:	//是否正确的文件名，并且后缀为gif、png、jpeg、jpg、swf文件
				var re=/(^|[/\\])[a-z0-9_]+\.(gif|png|jpeg|jpg|swf)$/ig;
				return this.match(re)==null ? false : true;
			break;

			case 18:	//>0，并且≤1的数字
				try {
					var c=parseFloat(this);
					if(c>0 && c<=1){return true;}else{return false;}
				}
				catch (e) {
					return false;
				}
			break;

			case 19:	//是否普通短信号码
				var re=/^[0-9]{11,12}$/ig;
				return this.match(re)==null ? false : true;
			break;

			break;

		}
	}

String.prototype.isDate=function()
	{
		var str=tao.getHtpText('get','/action/javascriptserver.asp?runCode=testDate&data='+this);
		if(str=='-1')return true;
		return false;
	}

if(window.Node){
	Node.prototype.swapNode=function(Node){	// 交换节点
		var nextSibling=this.nextSibling;
		var parentNode=this.parentNode;
		Node.parentNode.replaceChild(this,Node);
		parentNode.insertBefore(Node,nextSibling);
	}
	Node.prototype.replaceNode=function(Node)
		{
			this.parentNode.replaceChild(Node,this);
		}
	Event.prototype.keyCode=function ()
		{
			return this.which;
		}
	Node.prototype.focus=function() {
		var evt=document.createEvent('UIEvents');
		evt.initUIEvent('focus', true, true, window,1);
		this.dispatchEvent(evt);
	}
}
//------------------------------------
var objClass=function(){}

objClass.prototype.htp=function()
			{
				var a=window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
				return a;
			}

objClass.prototype.ini=function()
	{
		this.setTextArea();	//设置TextArea框，让其高度和内容适应
		this.setAllInputText();
		this.swapSelectText();	//
		if(self.location.pathname.toLowerCase().indexOf('stockupdate.asp')!=-1){	//设置stokupdate.asp页面的内容
			this.setRemote(self.location.pathname+'?runCode=1',$('divTable'),false);
		}
		//this.ctnLoadView();	//持续更新浏览数据
		$f(0);	//持续连接远程服务器，防止Session过期
		$f(2);	//定期更新数据
		switch ($('',10)) {
			case '/manage/login.asp':
				try {
					$('itUserName').select();
					$('itUserName').focus();
				}
				catch (e) {
					alert(e);
				}
			break;
			default:
		}
	}

objClass.prototype.setTextArea=function()
	{
		//if(self.location.pathname.indexOf('-1')!=-1){return;}
		var a=document.getElementsByTagName('textarea');
		if(a===null)return;
		for (var i=0; i<a.length; i++) {
			if(a[i].scrollHeight>a[i].clientHeight)a[i].style.height=a[i].scrollHeight+'px';
		}
	}

objClass.prototype.setBrowser=function()
	{
		var a=$('browser'),catalogName='',b;
		if(a==null){return;}
		var curUrl=self.location.href.toLowerCase();
		a=a.getElementsByTagName('dl');
		if(a==null)return;
		for(var i=0;i<a.length;i++){
			a[i].onmouseover=function(){
				var oElement;
				oElement=$(Array(this,'dt'),1);
				oElement=$(Array(oElement,'a'),1);
				oElement.style.backgroundPosition='0 0';
				oElement.onclick=function(){return false}
				oElement=$(Array(this,'dd'),1);
				if(tao.aPos(oElement,'left')>document.documentElement.clientWidth/2){oElement.style.left='-100px';}
				oElement.style.display='block';
				if(tao.aPos(oElement,'left')>document.documentElement.clientWidth/2){oElement.style.left=this.clientWidth-oElement.clientWidth+'px';}
			}
			a[i].onmouseout=function(){
				var oElement;
				oElement=$(Array(this,'dt'),1);
				oElement=$(Array(oElement,'a'),1);
				oElement.style.backgroundPosition='0 bottom';
				oElement=$(Array(this,'dd'),1);
				oElement.style.display='none';
			}
			b=$(Array(a[i],'dt'),1);
			b=$(Array(b,'a'),1);
			if(curUrl.indexOf(b.href.toLowerCase())!=-1){catalogName=b.firstChild.nodeValue;}
		}
		a=$('browser');
		if (document.title.length>0) {
			$(Array(a,'p'),1).firstChild.nodeValue=document.title;
		}
		a=a.getElementsByTagName('a');
		for(var i=0;i<a.length;i++){
			if(curUrl.indexOf(a[i].href.toLowerCase())!=-1){$('browser1').innerHTML='<span id="spanCurPageName">　　当前位于：</span>'+catalogName+' &gt; '+a[i].firstChild.nodeValue;}
		}
	}

objClass.prototype.oldSetBrowser=function()
	{
		var a=document.getElementById('browser');
		if (a==null){return;}
		if (IE){a.attachEvent('onmouseleave',mouseLeave);}else{a.addEventListener("mouseout",mouseLeave,false);}
		a=a.getElementsByTagName('dt');
		if (a==null){return;}
		for (var i=0;i<a.length;i++){
			a[i].onmouseover=function(){
				var a=this.parentNode.parentNode.getElementsByTagName('dt');
				if(a==null){return;}
				for (var i=0;i<a.length;i++){a[i].style.backgroundColor='transparent';}
				this.style.backgroundColor='#999';
				var a=this.parentNode.parentNode.getElementsByTagName('dd');
				if(a==null){return;}
				for (var i=0;i<a.length;i++){a[i].style.display='none';}
				this.parentNode.getElementsByTagName('dd')[0].style.display='block';
			}
		}
	}

objClass.prototype.setAllInputText=function()
	{
		var a=document.getElementsByTagName('input');
		if(a==null)return;
		for (var i=0; i<a.length; i++) {
			if(a[i].type.toLowerCase()=='text' && a[i].name!='wareSpec' && a[i].name!='wareName' && a[i].name!='wareKeyWord'){a[i].onfocus=function(){this.select();}}
		}
	}

objClass.prototype.ctnLoadView=function()
	{
		return;
		var objHtp=this.htp();
		objHtp.open('get','/action/view.asp',true);
		objHtp.send(null);
		objHtp.onreadystatechange=function(){
			if(objHtp.readyState==4){
				if(objHtp.responseText.indexOf('错误')==-1){setTimeout('tao.ctnLoadView()',1200000);}else{alert('解析IISLog出错，请检查，谢谢。');}
			}
		}
	}

objClass.prototype.submit=function(f,strAlert,windowName,targetUrl)	//提交form数据
			{
				if (confirm(strAlert))
					{
					window.open('about:blank',windowName,'width=300,height=200');
					f.action=targetUrl;
					f.target=windowName;
					return true;
					}
				else
					{
					return false;
					}
			}

objClass.prototype.getHtpText=function(getMethod,url)	//同步获取远程文档内容，返回字符串
			{
				switch (arguments.length) {
					case 2:			//调用方式： tao.getHtpText('get',url)，返回文档内容
						var objHtp=this.htp();
						//alert(objHtp.statusText);
						objHtp.open(getMethod,url,false);
						objHtp.send(null);
						return objHtp.responseText;
					break;
					case 3:			//调用方式：tao.getHtpText(getMethod,url,strAlert);用于简单的向url传值，并返回内容，比如更改某个记录的avail值
									//返回内容第一个字符为状态字符，第一个字符如果为1，则reload本页面；
						var objHtp=this.htp(),result='';
						var url=arguments[1],strAlert=arguments[2];
						if(confirm(strAlert)==false){return false;}
						maskWaite(true);
							objHtp.open('get',url,false);
							objHtp.send(null);
							result=objHtp.responseText;
						maskWaite(false);
						alert(result.substring(1,result.length));
						if(result.substring(0,1)=='1')self.location.reload();
					break;
				}
			}

objClass.prototype.getHtpXML=function(url)				//同步获取远程XML文档，返回XML中的数据子节点对象
	{
				var objHtp=this.htp();
				//alert(objHtp.statusText);
				objHtp.open('get',url,false);
				objHtp.send(null);
				var objXML=objHtp.responseXML;
				//if(objXML.xml){
				//alert(objXML.childNodes[0].childNodes.length);
				//	return objXML.firstChild.lastChild;
					return objXML.firstChild;
				//}
				//else{
				//	alert(objHtp.responseText);
				//}
	}

objClass.prototype.setRemote=function(url,a,bln)		//同步获得数据后，将数据放到对象a里面,bln是否全窗口遮盖
	{
		a.innerHTML='<img src="/common/images/site/wait.gif" width="100" height="100">';
		var str=this.getHtpText('get',url);
		a.innerHTML=str;
	}

objClass.prototype.getHtpBody=function(url)	//同步获取远程文档内容，返回HTML文档
			{
				var objHtp=this.htp();
				objHtp.open('get',url,false);
				objHtp.send(null);
				return objHtp.responseBody;
			}

objClass.prototype.aPos=function(a,strPos)				//获得当前目标的绝对位置
	{
		var b=a;
		var pos=0;
		while(b){pos=(strPos=='left' ? b.offsetLeft : b.offsetTop)+pos;b=b.offsetParent;}
		return pos;
	}

objClass.prototype.trim=function(f)						//将form表单中的input type＝text 的项目的前后空格去掉
	{
		var a;
		switch (f.tagName.toLowerCase()) {
			case 'form':
				for (var i=0; i<f.length; i++) {
					a=f.elements[i];
					if (a.type.toLowerCase()=='text') {
						a.value=a.value.trim();
					}
				}
			break;
			case 'input':
				if(f.type.toLowerCase()=='text'){f.value=f.value.trim();}
			break;
			default:

		}
	}

objClass.prototype.checkCheckBox=function(f,itemName)	//调用方式：tao.checkCheckBox(f,wareID)，检查checkbox是否有选中项
	{
		var a,bln=false;
		if(f.tagName){	//如果是form
			for (var i=0; i<f.length; i++) {
				a=f.elements[i];
				if (a.type.toLowerCase()=='checkbox') {
					if(a.name==itemName && a.checked){bln=true;break;}
				}
			}
		}
		else{		//否则就是input集合
			for (var i=0; i<f.length; i++) {
				if(f[i].type.toLowerCase()=='checkbox'){if(f[i].checked && f[i].name==itemName){bln=true;break;}}
			}
		}
		return bln;
	}

objClass.prototype.checkWareSpec=function(objSpec)
	{
		var str='',result;
		for (var i=0; i<objSpec.length; i++) {
			str=str+objSpec[i].name+'='+encodeURIComponent(objSpec[i].value);
			if (i<objSpec.length-1){str=str+'&';}
		}
		result=tao.getHtpText('get','ware_addcheckwarespec.asp?'+str);
		return parseInt(result);
	}

objClass.prototype.swapSelectText=function()	//
	{
		if(self.location.pathname.indexOf('ware_add.asp')==-1)return;
		var a=document.getElementsByTagName('select');
		if(a==null)return;
		for (var i=0; i<a.length; i++) {
			if(a[i].name=='wareUnion' || a[i].name=='wareSeries' || a[i].name=='warePackUnion'){
				if(a[i].selectedIndex>0){
					var b=$('it'+a[i].id.replace('select',''));
					if(b==null)return;
					b.disabled=true;
				}
				a[i].onchange=function(){
					var b=$('it'+this.id.replace('select',''));
					if(b==null)return;
					if(this.selectedIndex>0){b.disabled=true;}else{b.disabled=false;}
				}
			}
		}
		a=document.getElementsByTagName('input');
		if (a==null)return;
		for (var i=0; i<a.length; i++) {
			if(a[i].name=='wareUnionNew' || a[i].name=='wareSeriesNew' || a[i].name=='warePackUnionNew'){
				a[i].onkeyup=function(){
					var b=$('select'+this.id.replace('it',''));
					if(b==null)return;
					if(this.value.length==0){b.disabled=false;}else{b.disabled=true;}
				}
			}
		}
	}

objClass.prototype.parentNodes=function(a,str)
	{
		var b=a.parentNode;
		while(b){
			if(b.tagName){
				if(b.tagName.toLowerCase()==str){return b;}
			}
			b=b.parentNode;
		}
	}

objClass.prototype.isDigital=function()		//判断按键是否是输入数字
	{
		if (arguments.length>1){
			var n=arguments[1];
			var i=event.keyCode;
			switch(n){
				case 1:		//只能是数字
					if(i>=48 && i<=57)return true;
					if(i==8 || i==9 || i==46)return true;
			}
		}
		else{
			var event=document.all ? window.event : arguments[0];
			var i=document.all ? event.keyCode : event.which;
			if(i>=48 && i<=57)return true;
			if(i==8 || i==9 || i==46 || i==109 || i==189 || i==190)return true;
		}
		return false;
	}

objClass.prototype.round=function(c,n)
	{
		switch(n){
			case 1:
				return Math.round(c*10)/10;
				break;
			case 2:
				return Math.round(c*100)/100;
				break;
			case 3:
				return Math.round(c*1000)/1000;
				break;
			case 4:
				return Math.round(c*10000)/10000;
				break;
			default:
				return Math.round(c);
		}
	}

objClass.prototype.submitForm=function(f,strAlert,url)	//调用方式：tao.submitForm(f,'',url);通过XMLHttp提交Post数据，返回字符串，第一个字符串为状态字符串，如果为1的话，则reload本页面
	{
		var a,c='',state='';
		if(confirm(strAlert)==false){return false;}
		for (var i=0; i<f.length; i++) {
			a=f.elements[i];
			if (a.name.length>0) {
				switch(a.type.toLowerCase()){
					case 'text':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						//c=c+a.name+'='+a.value+'&';
						break;
					case 'password':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						break;
					case 'hidden':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						break;
					case 'checkbox':
						if(a.checked){c=c+a.name+'='+encodeURIComponent(a.value)+'&';}
						break;
					case 'radio':
						if(a.checked){c=c+a.name+'='+encodeURIComponent(a.value)+'&';}
						break;
					case 'select-one':
						c=c+a.name+'='+encodeURIComponent(a[a.selectedIndex].value)+'&';
						break;
					case 'textarea':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						break;
				}
			}
		}
		if (c.length>0) {c=c.substring(0,c.length-1);}
		var objHtp=this.htp();
		objHtp.open('post',url,false);
		objHtp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		maskWaite(true);
		objHtp.send(c);
		c=objHtp.responseText;
		maskWaite(false);
		//如果arguments长度等于3或者4，则执行
		if(arguments.length==3 || arguments.length==4){
			state=c.substring(0,1);
			c=c.substring(1,c.length);
			alert(c);
			if(state=='1'){arguments.length==4 ? self.location=arguments[3] : self.location.reload();}
		}
		else{
			return c;
		}
	}

function submitForm(f,strAlert,url,returnFunction)	//调用方式：submitForm(f,'',url);通过XMLHttp提交Post数据，返回页面内容；submitForm(f,'',url,returnFunction)，异步调用，returnFunction为接收返回值的函数名;
	{
		var a,c='',state='',blnAnyc=false;
		if(arguments.length>=4){blnAnyc=true;}
		if(strAlert.length>0){if(confirm(strAlert)==false){return false;}}
		for (var i=0; i<f.length; i++) {
			a=f.elements[i];
			if (a.name.length>0) {
				switch(a.type.toLowerCase()){
					case 'text':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						//c=c+a.name+'='+a.value+'&';
						break;
					case 'password':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						break;
					case 'hidden':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						break;
					case 'checkbox':
						if(a.checked){c=c+a.name+'='+encodeURIComponent(a.value)+'&';}
						break;
					case 'radio':
						if(a.checked){c=c+a.name+'='+encodeURIComponent(a.value)+'&';}
						break;
					case 'select-one':
						c=c+a.name+'='+encodeURIComponent(a[a.selectedIndex].value)+'&';
						break;
					case 'textarea':
						c=c+a.name+'='+encodeURIComponent(a.value)+'&';
						break;
				}
			}
		}
		if (c.length>0) {c=c.substring(0,c.length-1);}
		var objHtp=window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
		if(blnAnyc){
			objHtp.onreadystatechange=function ()
				{
					if(objHtp.readyState==4){returnFunction(objHtp);}
				}
			objHtp.open('post',url,true);
			objHtp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			objHtp.send(c);
		}
		else{
			objHtp.open('post',url,false);
			objHtp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			objHtp.send(c);
			c=objHtp.responseText;
			//maskWaite(false);
			//state=c.substring(0,1);
			//c=c.substring(1,c.length);
			objHtp=null;
			return c;
		}
	}

//=======================================

var tao=new objClass();
var IE=!!(window.attachEvent && !window.opera);
window.onload=function()
	{
		tao.ini();
		//如果当前页面有启动函数，则执行启动函数
		if(self.htOnLoad){htOnLoad();}
	}