/*
JScript 文件
开发：半条虫
QQ：466814195
版本:1.0
欢迎使用EtSoft软件，希望能给你带来方便
*/
String.prototype.trim = function(){   
	var re = /^\s+|\s+$/g;   
	return function(){ return this.replace(re, ""); };   
}();
String.prototype.toJsstring = function(val) //　转成合法的js字符串 
	{
		var reValue = '';
		reValue = this.replace(/([\\\'])/gi,'\\$1');
		return reValue;
	}
function $(obj) // 查找对象
	{
	  var reObj = obj;
	  if (typeof reObj == 'object')
	  {
	  }else{
		  if (/^[0-9]$/g.test(obj) == true){
			reObj = document.all[obj];
		  }else{
			reObj = document.all(obj);
		  }
	  }
	  return reObj;
	}

function GetParent(obj,pid)　// 获取对象指定上级Tagename　对象
	{
		var curObj = obj;
		while (curObj.tagName != "HTML"){
			if(typeof(curObj) != 'object'){
				return null;
			}else{
				if (curObj.tagName == "HTML"){return null;}
				if (curObj.name == pid || curObj.id == pid){return curObj;}
				curObj = curObj.parentNode;
			}
		}
		return null;
	}
function GetParentByTagName(obj,pid)　// 获取对象指定上级Tagename　对象
	{
		var curObj = obj.parentNode;
		if(typeof(curObj)!='object'|| typeof(curObj)==null){return null;}
		while (curObj.tagName != "HTML" ){        
			if(typeof(curObj) != 'object'){
				return null;
			}else{
				if (curObj.tagName == "HTML"){return null;}
				if (curObj.tagName == pid){return curObj;}
				curObj = curObj.parentNode;
			}
		}
		return null;
	}
var DivTable = new Array();
function IniDivTable(obj){    
    var tab_title;
    var tab_list = new Array();
    var uls = obj.getElementsByTagName("UL");
    var tab_list_index = 0
    if(DivTable.toString().indexOf(obj.sourceIndex+',') < 0){        
        for(var uls_index=0;uls_index<uls.length;uls_index++){            
            if(uls[uls_index].className=='tab_title'){
                tab_title = uls[uls_index];
            }else{
                if(uls[uls_index].className=='tab_list'){
                    uls[uls_index].onmouseover = obj_onmouseover;
                    uls[uls_index].onmouseout = obj_onmouseout;
                    uls[uls_index].style.width = tab_title.style.width;
                    uls[uls_index].style.height = tab_title.style.height;
                    tab_list[tab_list_index] = uls[uls_index];
                    tab_list_index++;                    
                }
            }
            
        }       
       DivTable[DivTable.length] = obj.sourceIndex;
    }
}
var Move_oldClassName;
function obj_onmouseover() //鼠标移上样式
	{
		Move_oldClassName = this.style.background;
		this.style.background = '#E1E1E1';
	}
function obj_onmouseout() //鼠标移上样式
	{
		this.style.background = Move_oldClassName;
	}
function Wopen(url,wtitle,wWH)　//　对话框方式打开网页
	{
		var result = window.showModalDialog(url,wtitle,wWH);
		return result;
	}
function sltthis(def)
	{
		var obj = event.srcElement;
		return addslt(def,obj);
	}
function addslt(def,obj){
    var tmpIds = ',' + def;    
    if(obj.tagName == 'INPUT' ){
        tmpIds = tmpIds.replace(','+obj.value,"");
        if (obj.checked){tmpIds += ','+ obj.value;}
        tmpIds = tmpIds.replace(",,","");        
    }    
    return tmpIds;
}

function enasc(val)//字符转ASC码 只支持一个字符
	{ 
		var reValue ='';
		reValue = new String(val).charCodeAt(0);
		return reValue; 
	}
function unasc(val)//ASC码转字符
	{
		var reValue='';
		reValue = String.fromCharCode(parseInt(val));
		return reValue;
	}
function EtJSString(val) // 自定义转义字符。即把\a转成以ASC码
	{
		var reValue=val;
		var mc = val.match(/\\./gi);
		for (var i=0;i<mc.length ;i++ )
		{
			var JsChar = mc[i];
			var Char = JsChar.substr(1);
			var CASC = enasc(Char);
			var JsValue = '$et_asc_' +CASC + '$';
			reValue = reValue.replace(JsChar,JsValue)

		}
		return reValue;
	}
function unEtJSString(val) // 反自定义转义字符。即把ASC码转成以\a
	{
		var reValue=val;
		var reg =/\$et_asc_([0-9]+)\$/gi;
		var mc = val.match(reg);
		for (var i=0;i<mc.length ;i++ )
		{
			var JsChar = mc[i];
			var CASC = JsChar.replace(reg,'$1');
			var Char = unasc(CASC);
			var JsValue = '\\' + Char;
			reValue = reValue.replace(JsChar,JsValue)

		}
		return reValue;
	}

// ******************************* 腾讯信息　********************************
// QQ( QQNumber,Text )
//	QQNumber : QQ号码
//	Text	 : 显示的说明文字（可选）
function QQ() //QQ在线生成
	{
		if (arguments.length > 0)
		{
			var qq = arguments[0];
			var txt ='';
			if ( arguments.length>1 ){txt = arguments[1];}
			document.write("<a href=\"javascript:;\" onclick=\"window.open('http://wpa.qq.com/msgrd?V=1&Uin=" + qq + "&Site=EtSoftWare&Menu=yes','QQ','');\">");
			document.write("<img border=\"0\" SRC=http://wpa.qq.com/pa?p=1:" + qq + ":4 alt=\"" + qq + "\" />");
			document.write( txt );
			document.write("</a>");
		}
	}
//	var tQQ = new Tencent();
//	document.write(tQQ.QQ('464644731'));
//	document.write(tQQ.Allbum('464644731'));
//	document.write(tQQ.qzone('464644731'));
//	document.write(tQQ.BBS('464644731'));
//	document.write(tQQ.paipai('464644731'));
//	document.write(tQQ.wenwen('464644731'));
function Tencent(p_retype) // 腾讯信息　
	{
		//	QQ('XXXXXXXX') 生成ＱＱ在线情况		|	Allbum('XXXXXXXX') ＱＱ个人相册
		//	qzone('XXXXXXXX') ＱＱ个人空间		|	BBS('XXXXXXXX') 腾讯ＢＢＳ信息
		//	paipai('XXXXXXXX') paipai信息		|	wenwen('XXXXXXXX') paipai信息
		//	IsOnline('XXXXXXXX') QQ目前是否在线	|	

		this.SoftName = 'EtSoft742'
		this.reType = 0;//返回类型　0返回HTML　1　返回URL
		if(typeof p_retype != 'undefined'){this.reType = p_retype ;}

		// 检测QQ帐号
		this.TestQQNum = function(QQ){
			var QQPattern = /^[0-9]{5,9}$/gi;
			return QQPattern.test(QQ);
		}
		// QQ空间形象照片地址
		this.QzoneLogo = function (QQ){
			var url = 'http://qlogo4.store.qq.com/qzonelogo/{QQ}/1/1260949898';
			url = url.replace('{QQ}',QQ);
			return url;
		}
		// 生成QQ在线状态
		this.QQ = function (QQ){
			var url = 'http://wpa.qq.com/msgrd?V=1&Uin=' + QQ + '&Site=' + this.SoftName + '&Menu=yes';
			var src = "http://wpa.qq.com/pa?p=1:"+QQ+":4";
			var strHtml = "<a href=\"javascript:;\" onclick=\"window.open('" + url + "','QQ','');\" title=\"与 "+QQ+" 对话\">";
			strHtml += "<img id=\"QQ" + QQ + "\" border=\"0\" src=\"" + src + "\" onload=\"this.style.display='';\" style=\"display:none;\" alt=\"与 "+QQ+" 对话\" >";
			strHtml += "</a>";
			if(this.reType == 0){return strHtml;}else{return url;}
		}
		// QQ是否在线状态
		this.IsOnline = function (QQ){
			var reValue = false;
			var src = "http://wpa.qq.com/pa?p=1:"+QQ+":4";
			var obj = $('hqqtestonline');
			if ( obj == null )
			{
				var obj = document.createElement("IMG");
				obj.id = 'hqqtestonline';				
				obj.onload = function(){};
				document.body.appendChild(obj)
			}
			obj.src = src;
			if ( obj.width==23 &&  obj.height==16 ){reValue = true;}

			return reValue;
		}
		//　QQ电子邮箱
		this.Mail =function (QQ){
			var url = '{QQ}@qq.com';
			var val = url.replace('{QQ}',QQ);
			return val;
		}
		//　QQ相册
		this.Allbum =function (QQ){
			var url = 'http://' + QQ + '.photo.qq.com'
			var strHtml = '<a href=\'' + url + '\' target=\'_blank\' title=\'' + QQ + ' 相册\'>Allbum</a>';
			if(this.reType == 0){return strHtml;}else{return url;}
		}
		// QQ空间
		this.qzone = function (QQ){
			var url = 'http://user.qzone.qq.com/{QQ}?ptlang=2052';
			url = url.replace('{QQ}',QQ);
			var strHtml = '<a href=\''+ url + '\'  target=\'_blank\'  title=\'' + QQ + ' 空间/博客\'>QZone</a>';
			if(this.reType == 0){return strHtml;}else{return url;}
		}
		// QQ论坛
		this.BBS = function (QQ){
			var url = 'http://user.bbs.qq.com/' + QQ;
			var strHtml = '<a href=\''+ url + '\'  target=\'_blank\'  title=\'' + QQ + '　BBS信息\'><img src=\'http://bbs.qq.com/favicon.ico\' border=0  alt=\'騰訊BBS信息\' /></a>';
			if(this.reType == 0){return strHtml;}else{return url;}
		}	
		// 拍拍商城
		this.paipai = function (QQ){
			var url = 'http://' + QQ +'.paipai.com/';
			var strHtml = '<a href=\''+ url + '\'  target=\'_blank\'  title=\'' + QQ + '　paipai信息\'><img src=\'http://pics.paipai.com/favicon.ico\' border=0 alt=\'騰訊paipai信息\' /></a>';
			if(this.reType == 0){return strHtml;}else{return url;}
		}		
		//　女人
		this.wenwen = function (QQ){
			var url = 'http://wenwen.soso.com/z/ShowUser.e?sp=S' + QQ;
			var strHtml = '<a href=\''+ url + '\'  target=\'_blank\'  title=\'' + QQ + '　搜搜問問信息\'><img src=\'http://wenwen.soso.com/favicon.ico\' border=0 alt=\'搜搜問問信息\' /></a>';
			if(this.reType == 0){return strHtml;}else{return url;}
		}		
	}

function DelNotHanZi(value) /// 删除非汉字字符
	{
		return value.replace(/[^\u4e00-\u9fa5]+/g,'');
	}

function selectdate() /// 选择日期时间
	{	
		var def='';
		if(arguments.length > 0){def =arguments[0].value;}
		def = def.replace(/([0-9]{4})([-/]+)([0-9]{1,2})([-/]+)([0-9]{1,2})/gi,'$1/$3/$5');
		var result = window.showModalDialog('/inc/wannianli.htm?def='+def,'select','scrollbar=no;dialogWidth=680px;dialogHeight=450px');
		if (typeof result != 'undefined')
		{
			if(arguments.length > 0){selectdate_arguments(arguments[0],result[0]);}
			if(arguments.length > 1){selectdate_arguments(arguments[1],result[1]);}
			if(arguments.length > 2){selectdate_arguments(arguments[2],result[2]);}
			if(arguments.length > 3){selectdate_arguments(arguments[3],result[3]);}
			return result[0];
		}
		return result;
	}

var etCSCObj = null
var etVSCObj = null
function selectcolor(ColorImg,obj) /// 选择 颜色
	{
		var etColorPalette = $('et_ColorPalette');
		if(etColorPalette==null){
		   etColorPalette = document.createElement('iframe');
		   etColorPalette.id = 'et_ColorPalette';
		   etColorPalette.width = 260;
		   etColorPalette.height = 165;
		   etColorPalette.src = '/inc/selcolor.htm';
		   etColorPalette.style.visibility = 'hidden';
		   etColorPalette.style.position = 'absolute';
		   etColorPalette.style.border = '1px gray solid';
		   etColorPalette.frameborder = 0;
		   etColorPalette.scrolling = 'no';
		   document.body.appendChild(etColorPalette);
		}
		if(etColorPalette != null){
			etCSCObj = obj;
			etVSCObj = ColorImg;
			PaletteLeft = getOffsetLeft(ColorImg);
			PaletteTop = (getOffsetTop(ColorImg) + ColorImg.offsetHeight);
			if (PaletteLeft+150 > parseInt(document.body.clientWidth)) PaletteLeft = parseInt(event.clientX)-260;
			etColorPalette.style.left = PaletteLeft + "px";
			etColorPalette.style.top = PaletteTop + "px";
			if (etColorPalette.style.visibility=="hidden")
			{
				etColorPalette.style.visibility="visible";
			}else {
				etColorPalette.style.visibility="hidden";
			}
		}
		
	}
function setColor(color){
	if (etCSCObj!=null){if (color.length >1){etCSCObj.innerText=color;}}
	if (etVSCObj!=null){if (color.length >1){etVSCObj.style.backgroundColor=color ;}}
	var etColorPalette = $('et_ColorPalette');
	if (etColorPalette!=null){etColorPalette.style.visibility="hidden";;}
}
function getOffsetTop(elm) // 获取对象　头陪偏移　实际坐标
	{
		var mOffsetTop = elm.offsetTop;
		var mOffsetParent = elm.offsetParent;
		while(mOffsetParent){
			mOffsetTop += mOffsetParent.offsetTop;
			mOffsetParent = mOffsetParent.offsetParent;
		}
		return mOffsetTop;
	}
function getOffsetLeft(elm) // 获取对象　左边偏移　实际坐标
	{
		var mOffsetLeft = elm.offsetLeft;
		var mOffsetParent = elm.offsetParent;
		while(mOffsetParent) {
			mOffsetLeft += mOffsetParent.offsetLeft;
			mOffsetParent = mOffsetParent.offsetParent;
		}
		return mOffsetLeft;
	}

function selectdate_arguments(obj,val){
	if (typeof obj != 'object'){obj=$(obj);}
	if (typeof obj == 'object'){
		if (obj != null){
			if (typeof obj.value != 'undefined'){obj.value=val;}
			//if (typeof obj.innerText != 'undefined'){obj.innerText=val;}
			//if (typeof obj.innerHTML != 'undefined'){obj.innerHTML=val;}
		}
	}
}
function LimitSize()/// 自动宿放限制图片大小
	{
		var himgShow = document.getElementById( "himgShow");
		var zoom = 100;
		var obj = $("himgShowPic");
		obj.style.zoom=zoom+'%';
		while(himgShow.scrollWidth > 805 ){
			obj.style.zoom=zoom+'%';
			zoom -= 0.1;
		}
		while(himgShow.scrollHeight > 339 ){
			obj.style.zoom=zoom+'%';
			zoom -= 0.1;
		}
		isReset = false;
	}
function ImageSizeLimit(obj,pWidth,pHeight)/// 自动宿放限制图片大小 当大于指定pWidth,pHeight时自动限制 0为不限制
	{
		var zoom = 100;
		obj.style.zoom=zoom+'%';
		var iWidth = obj.width;
		var iHeight = obj.height;
		if(pWidth > 0){                
			while(iWidth > pWidth ){
				iWidth = (obj.width / 100) * zoom;
				iHeight = (obj.height / 100) * zoom;
				obj.style.zoom=zoom+'%';
				zoom --;
				if(zoom < 1){obj.style.zoom='1%';return false;}
			}
		}
		if(pHeight > 0){                
			while(iHeight > pHeight ){
				iHeight = (obj.height / 100) * zoom;
				obj.style.zoom=zoom+'%';
				zoom --;
				if(zoom < 1){obj.style.zoom='1%';return false;}
			}
		}

	}

//	播放图片 img_play(imgDesp,imgSource)
//	播放图片 img_play(img,url,alt)
function img_play()//	播放图片
	{
		var args = img_play.arguments;
		var obj = args[0];
		if (typeof obj != 'object'){obj = event;}
		obj.style.filter = 'revealTrans(duration=2,transition=20)';
		obj.filters.revealTrans.duration = 2;
		obj.filters.revealTrans.Transition = Math.floor(Math.random()*23);
		obj.filters.revealTrans.apply();
		obj.filters.revealTrans.play();
		if (args.length>1)
		{
			if (typeof args[1] == 'object')
			{
				if (args[1].tagName == 'IMG'){obj.src = args[1].src;obj.alt = args[1].alt;}
			}else if (typeof args[1] == 'string' && typeof args[2] == 'string'){
				obj.src = args[1];
				obj.alt = args[2];
			}
		}
	}

var img_onerror_index=0;
function img_onerror()// 图片不存在 默认图片
	{
		var obj = event.srcElement;
		if (obj.tagName=='IMG' && img_onerror_index != obj.sourceIndex)
		{			
			img_onerror_index =obj.sourceIndex;
			obj.src = '/Images/nopic.gif';
		}
	}

function LaunchFull(url, name, features)/// open window by full screeen   全屏最大化打开窗口 
	{
		var str = "left=0,screenX=0,top=0,screenY=0,";
		if (window.screen) {
			var ah = screen.availHeight - 30;
			var aw = screen.availWidth - 10;
			str += ",height=" + ah;
			str += ",innerHeight=" + ah;
			str += ",width=" + aw;
			str += ",innerWidth=" + aw;
			str += ",scrollbars=yes";
			str += ",toolbar=no,menubar=no,resizable=no,location=no, status=no";
		} else {
			str += ",resizable"; // so the user can resize the window manually
		} 
		return window.open(url, name, str + features);
	}
// zoom pic on roll mouse middle button 
// <img src="images/51js.gif" onmousewheel="Img_OnMouseWheel_Zoom(this);">
function Img_OnMouseWheel_Zoom(o) // 鼠标中键
	{                
		var zoom=parseInt(o.style.zoom, 10)||100;
		zoom+=event.wheelDelta/50;
		if (zoom>0) o.style.zoom=zoom+'%';
		return false;
	}

// 进度条  Progress bar 
/* 外观样式 */
// .Progress{background:url(/Images/Progress.jpg);background-repeat:x;}
/* 进度指示样式 */
// .Progress div{background:url(/Images/Progress.jpg);background-repeat:x;color:#555555;}
function Progress(obj,iAll,iIndex)// 进度条  Progress bar 
	{
		var objIndex = obj.sourceIndex;
		var ProgressDiv = 'ProgressDiv_'; //+ objIndex;
		var ProgressSpan = 'ProgressSpan_'; //+ objIndex;
		var iRate = 0;

		if($(ProgressDiv)==null){
			obj.innerHTML += '<div id=\'' + ProgressDiv + '\' class=\'Progress\' style=\'border:1px solid #000;\' ><div id=' + ProgressSpan + '>%</div></div>';
			ProgressDiv = $(ProgressDiv);
			ProgressSpan = $(ProgressSpan);				
			ProgressSpan.style.width='1%';
			ProgressDiv.style.width = '100%';		
			ProgressSpan.innerText = iRate + '%';
		}else{
			iRate = (iIndex / iAll) *100;
			iRate = iRate.toString().split('.')[0] * 1;
			ProgressDiv = obj.all(ProgressDiv);
			ProgressSpan = obj.all(ProgressSpan);
			if(typeof(ProgressDiv)=='object' && typeof(ProgressSpan)=='object' && iRate < 101){
				var ProgressDiv_W = ProgressDiv.style.width;
				iRate = iRate + '%'
				ProgressSpan.style.width = iRate 
				ProgressSpan.innerText = iRate ;
			}				
		}
	}
function etReplace(obj,OldWord,NewWord)/// 替换字符串 无返回。
	{	
		var objs = obj.all;
		var isNext = false;
		for (var i = 0;i < objs.length ; i++)
		{
			if (typeof(objs[i].innerHTML)!='undefind')
			{

				if ((objs[i].innerHTML != '' && objs[i].innerHTML == objs[i].innerText) || (objs[i].innerHTML.indexOf('</') < 0 && objs[i].innerHTML != ''))
				{

					if(OldWord.test(objs[i].innerHTML) == true){
						var tmpValue =objs[i].innerHTML.replace(OldWord,NewWord);
						objs[i].innerHTML = tmpValue;
						isNext = true;
					}
				}
				if (isNext == true){isNext=false;i++;}
			}
		}
	}

/* Et菜单 2.0

		调用：

		var Menu = new Et_Menu();
		Menu.id='etMenu'
		Menu.ClassName = 'EtMenu';	// 菜单样式名，其中主菜单 "MainMenu" 子菜单 "SubMenu"
		Menu.iSTop = 13;
		var MID = Menu.MainMenu('<a href=\'#\'>文件</a>');
		Menu.SubMenu(MID,'<a href=\'#\'>新建</a><br/>');
		var strMenu=Menu.Show(); //生成菜单

		备注：
		Css
		  EtMenu .MainMenu{主菜单}
		  EtMenu a{color:#000;padding:2px;}
		  EtMenu a:link{font-size:12px;}
		  EtMenu a:hover{font-size:13px;}
		  EtMenu .SubMenu{background-color:#e3e3e3;padding:5px;top:50px;}
		  EtMenu .SubMenu div{margin:2px;}
		  EtMenu .SubMenu div A{}
	*/
function Et_Menu() //* Et菜单 2.0
{
		this.id = 'etMenu$' + Math.floor(Math.random() * 1000); // 2.0
		this.ClassName = 'EtMenu';
		this.eMenu = new Array;
		this.iSTop = 15;
		this.TmpID ='';
		this.Menu_onMouseOver = 'MM_showHideLayers(\'{objid}\',\'\',\'show\',{0})';
		this.Menu_onMouseOut  = 'MM_showHideLayers(\'{objid}\',\'\',\'hide\',{0})';
		this.subMenuStyle = 'visibility:hidden;position:absolute;';

		//	重建HTML
		this.Show = function(){
			this.Menu_onMouseOver = this.Menu_onMouseOver.replace('{0}',this.iSTop)
			this.Menu_onMouseOut  = this.Menu_onMouseOut.replace('{0}',this.iSTop)

			var reValue='<div id=\"' + this.id + '\" class=\'' + this.ClassName + '\' >\n';
			for(var i=0;i<this.eMenu.length;i++){
				var MM = this.id + '_M' + i;
				TmpID = MM + '_sm';
				reValue += '	<span id=\'' + MM + '\' class=\'MainMenu\' ';
				reValue += 'onMouseOver=\"' + this.Menu_onMouseOver.replace('{objid}',TmpID)+ '\" ';
				reValue += 'onMouseOut=\"' + this.Menu_onMouseOut.replace('{objid}',TmpID)+ '\" ';

				reValue += '>\n		' + this.eMenu[i] + '\n'; 
				reValue += '	</span>\n';
				reValue += this.CreateMenu(TmpID,i);
			}
			reValue += '</div>';
			return reValue;
		}
		//	建立子菜单
		this.CreateMenu = function(id,iIndex){
			var reValue = '';
			var emIndex = 'M' + iIndex;
			if (typeof this.eMenu[emIndex] != 'undefined')
			{
				reValue = '	<div id=\'' + id + '\' ';
				reValue += 'onMouseOver=\"' + this.Menu_onMouseOver.replace('{objid}',TmpID)+ '\" ';
				reValue += 'onMouseOut=\"' + this.Menu_onMouseOut.replace('{objid}',TmpID)+ '\" ';
				reValue += 'style=\"' + this.subMenuStyle + '\" ';
				reValue += 'class=\"SubMenu\">\n';
				for (var i=0; i < this.eMenu[emIndex].length ; i++)
				{
					reValue += '		';
					reValue += '<div id=\'' + id + '_' + i + '\'>';
					if (this.eMenu[emIndex][i] == '---')
					{
						reValue += "<hr />";
					}else{
						reValue += this.eMenu[emIndex][i] ;
					}
					reValue += '</div>\n';
				}
				reValue += '	</div>\n';
			}
			return reValue;
		}

		// 设定主菜单
		this.MainMenu = function(name){
			var reValue=this.eMenu.length;
			this.eMenu[reValue] = name;
			return reValue;
		}
		// 设定子菜单
		this.SubMenu = function(pid,name){
			var reValue='';
			var MM = 'M';
			if(typeof this.eMenu[pid] != 'undefined'){
				MM += pid.toString();							
				if (typeof this.eMenu[MM] == 'undefined'){this.eMenu[MM]=new Array}
				reValue = this.eMenu[MM].length;
				this.eMenu[MM][reValue] = name;							
			}
			return reValue;
		}
}

function MM_showHideLayers() { //v9.0
	var i,p,v,obj,iSTop,args=MM_showHideLayers.arguments;
	if (document.getElementById && ((obj=document.getElementById(args[0]))!=null)) {
		v=args[0+2];
		if (obj.style){ 
			if(v=='show'){v='visible';}
			if(v=='hide'){v='hidden';}
		}
		var ent = event.srcElement;
		iSTop = arguments[3];
		if(ent != null && obj.style.pixelTop<1){
			if(typeof iSTop =='undefined'){iSTop=ent.offsetHeight;}
			var tmpobj = ent;
			// 获得元素的左偏移量
			var left = tmpobj.offsetLeft;
			// 获得元素的顶端偏移量
			var top = tmpobj.offsetTop;
			// 循环获得元素的父级控件，累加左和顶端偏移量
			while (tmpobj = tmpobj.offsetParent) {
				left += tmpobj.offsetLeft;
				top += tmpobj.offsetTop;
			}
			top += iSTop;
			obj.style.pixelTop=top;obj.style.pixelLeft=left+4;
		}
		obj.style.visibility=v;
	}
}
	

function objActive(obj,IsVisible)	/// Et控件操作函数
	{
		if (IsVisible == obj.all[1].style.display)
		{			
			var defEmpt = '－';
			obj.all[0].style.display=IsVisible;
			if (IsVisible == 'none')
			{
				IsVisible = ''
				if (obj.all[0].innerHTML != defEmpt){obj.all[1].value = obj.all[0].innerHTML;}				
				if (obj.all[1].tagName =='SELECT')
				{
					obj.all[1].selectedIndex = 0;
				}
			}else{
				IsVisible = 'none'
				var obj1val = obj.all[1].value;
				if (obj.all[1].tagName =='SELECT')
				{
					obj1val = obj.all[1].options[obj.all[1].selectedIndex].text;
				}
				if (obj1val ==''){obj1val = defEmpt}
				obj.all[0].innerHTML = obj1val;
			}									
			obj.all[1].style.display=IsVisible;
			if (IsVisible==''){obj.all[1].focus();}
		}
	}
	/// 创建控件 objCreate('hitxtUserName','TEXT','rimke','fun_onblur(this.value)')
	/// 创建控件 objCreate('hsltSex','SELECT','0;女|1;男')
	function objCreate(){
		var defEmpt = '－';
		var strHTML  = '';
		var objId;
		var objType;
		var defVal;
		var funs;
		if (arguments.length > 0){objId = arguments[0]}
		if (arguments.length > 1){objType = arguments[1]}
		if (arguments.length > 2){defVal = arguments[2]}
		if (arguments.length > 3){funs = arguments[3]}

		objType = objType.toLowerCase();
		var objHS = '<label id=\'hlbl' + objId + '\' >{2}</label><{0} {3} id=\'' + objId + '\' name=\'' + objId + '\' style=\"display:none;\" onblur=\"objActive(this.parentNode,\'\');' + funs + '\"  >{1}</{0}>';
		strHTML = "<span onclick=\"objActive(this,'none')\" style=\"\" >";
		if (objType == 'text')
		{			
			objHS = objHS.replace(/\{0\}/gi,'input')
			objHS = objHS.replace('{1}','')			
			objHS = objHS.replace('{3}','type=\'' + objType + '\' id=\'' + objId + '\' name=\'' + objId + '\' value=\'' + defVal + '\' ')
			if (defVal ==''){defVal=defEmpt}
			objHS = objHS.replace('{2}',defVal)

		}else if( objType == 'select' || objType == 'textarea' ){			
			objHS = objHS.replace(/\{0\}/gi,objType)
			defVal = defVal.split('|')
			var option = defVal;
			var defVal0='';
			if (objType == 'select')
			{			
				option = '';
				for (var i=0; i < defVal.length ; i++)
				{
					var tmp = defVal[i] + ';'
					tmp = tmp.split(';')
					if (tmp[0] == ''){tmp[0] = tmp[1];}
					if (tmp[1] == ''){tmp[1] = tmp[0];}
					if (defVal0 == ''){defVal0 = tmp[1];}
					option += '<option value="' + tmp[0] + '">' + tmp[1] + '</option>'

				}
			}
			objHS = objHS.replace('{1}',option)
			if (defVal ==''){defVal0=defEmpt}
			objHS = objHS.replace('{2}',defVal0)
			objHS = objHS.replace('{3}','')
		}
		strHTML += objHS;
		strHTML += "</span>";
		document.write(strHTML);

	}
/* Et菜单 End */

/* Et弹出菜单 1.0

		调用：

		var Menu = new Et_Menu();
		Menu.Id = 'EtContextMenu';
	*/
function Et_ContextMenu()//* Et弹出菜单 1.0
	{
		this.id = 'EtContextMenu$' + Math.floor(Math.random() * 1000);
		this.classname = 'EtContextMenu';
		this.Menu = new Array;
		var _me = this;

		this.ItemAdd = function(parentID,menu){
			if (parentID==''){parentID=0;}
			var MenuIndex = this.Menu.length;
			this.Menu[MenuIndex] = new Array(parentID,menu);
			return MenuIndex;
		}
		// 返回菜单HTML
		this.Show = function(){
			var reValue = '<div id=\'' + this.id  + '\'  >';
			reValue += this.GetMenu(0)
			reValue += "</div>"
			return reValue;
		}
		this.GetMenu = function(pid){
			var reValue = '<div class=\'' + this.classname + '\' id=\'' + this.id + '_' + pid + '\'  ><ul>';
			for (var i=0;i<this.Menu.length ;i++ )
			{
				if (this.Menu[i][0]==pid)
				{
					reValue += '<li >';
					reValue += this.Menu[i][1];
					reValue += '</li>'
				}
			}
			reValue += '</ul></div>';
			return reValue;
		}
		this.ShowMenu = function(pid){
			$(this.id + '_' + pid).style.displany ='';;
			$(this.id + '_' + pid).style.visibility='visible';
			$(this.id ).style.displany ='';
			$(this.id ).style.visibility='visible';
		}
		this.HiddenMenu = function(){
			$(this.id ).style.displany ='none';
			$(this.id ).style.visibility='hidden';
		}
	}



///	鼠标跟随提示框
//	var WTop = new EtTop();
//	WTop.EtWTop_Time		= 3			//指定时间内隐藏单位为秒
//	WTop.EtWTop_ClassName	= 'WTop'	//指定样式
//	WTop.EtClearTimeout()				//清楚停止计时器
//	WTop.Show('你要显示的数据！')

function EtTop()///	鼠标跟随提示框
	{
		this.EtWTop_Time = 5;			
		this.EtWTop_ClassName = '';
		this.bolTimeOut = false;
		this.sto;
		var _me = this;
		this.Show = function(p_Text){
			var EtWTopObj = $("EtWTopObj");
			if (EtWTopObj == null || typeof (EtWTopObj) != 'object')
			{
				EtWTopObj = document.createElement("DIV");
				EtWTopObj.id = 'EtWTopObj';
				EtWTopObj.style.position = 'absolute';
				EtWTopObj.style.index = 9999;
				EtWTopObj.className = this.EtWTop_ClassName;
				EtWTopObj.onmouseout = this.onmouseout;
				EtWTopObj.onmouseover = this.onmouseover;
				if (this.EtWTop_ClassName == '')
				{
					EtWTopObj.style.backgroundColor = '#FFFFFF';
					EtWTopObj.style.border = '1px solid #85783F';
					EtWTopObj.style.padding = '3px';
				}
				EtWTopObj.innerHTML = "正在加载入内请稍等..." ;
				document.body.appendChild(EtWTopObj);

			}	
			if (p_Text != '')
			{
				EtWTopObj.style.display = '';
				EtWTopObj.visibility = 'show';
				EtWTopObj.innerHTML = p_Text;		
				if(event != null)
				{
					EtWTopObj.style.top = event.y + 10;
					EtWTopObj.style.left = event.x;
				}
				this.EtStarTimeout();
			}
		}
		this.onmouseout = function(){
			_me.EtStarTimeout();
		}
		this.onmouseover = function(){
			_me.EtClearTimeout();
		}
		this.EtWTop_Hidden = function(){
			var EtWTopObj = $("EtWTopObj");
			EtWTopObj.style.display = 'none';
			EtWTopObj.visibility = 'hidden';
			this.bolTimeOut = false;
		}
		this.EtClearTimeout = function(){
			if (this.bolTimeOut == true)
			{
				this.bolTimeOut = false;
				clearTimeout(this.sto);
			}
		}
		this.EtStarTimeout = function(){
			if(this.bolTimeOut == false){
				this.sto = setTimeout(function(){_me.EtWTop_Hidden();},this.EtWTop_Time * 1000);
				this.bolTimeOut = true;
			}	
		}
	}
/* 结束 */

/*
不间断滚动 连续滚动 类
var eMarquee = new Et_Marquee();
//eMarquee.id = 'etMarquee';			//默认为系统随机取名
//eMarquee.className = 'etMarqueeCls';	//默认为空
eMarquee.direction = 'left';			//up;down;left;right
eMarquee.scrollamount = 1;				// 步进　单位为xp
eMarquee.scrolldelay = 20;				//毫秒
eMarquee.playinterval = 0;				//播放间隔 毫秒
eMarquee.width = 300;					//不能带单位 px
eMarquee.height = 50;					//不能带单位px
eMarquee.id = 'jxds';
eMarquee.reback = function(){};			// 用于回調指定函數
eMarquee.Building('你的内容');			//可重复应用多次，用于更改显示内容
eMarquee.Move();						//移动
eMarquee.Pause();						//暂停
eMarquee.Stop();						//停止

// .etMarqueeCls
*/
function Et_Marquee()//不间断滚动 连续滚动 类
	{
		this.direction		= 'up';		// 方向 up;down;left;right
		this.scrollamount	= 10;		// 10 像素
		this.scrolldelay	= 20;		// 移动速度为每 200 毫秒

		this.playinterval	= 0;		// 播放间隔 毫秒
		this.playamount		= 0;		// 播放多少像索
		this.palypx			= 0;

		this.width			= 200;		// 宽度
		this.height			= 50;		// 高度
		this.id				= 'etmq$' + Math.floor(Math.random() * 1000);	// 标志
		this.reback			= null;		// 回调程序
		this.className		= null;		// 回调程序
		this.EMsetInterval;
		var _me = this;	

		// 建立标签
		this.Building = function(html){
			this.IniFunction();
			var strHTml = '';
			var obj = $(this.id );
			if(obj==null){
				strHTml += '<div id=\'' + this.id + '\' style=\'width:' + this.width + 'px;';
				strHTml += ' height:' + this.height + 'px;';
				strHTml += ' OVERFLOW: hidden; \' ';
				if(typeof(this.className) == 'string' ){strHTml += 'class=\'' + this.className + '\' ';}
				strHTml += 'onmouseover=\'\' ';
				strHTml += 'onmouseout=\'\' >';
				if (this.direction == 'left' || this.direction == 'right')
				{
					strHTml += this.LHTML()
				}else{
					strHTml += this.UHTML()
				}
				strHTml += '</div>';
				document.write(strHTml);
				obj = $(this.id );
				obj.onmouseover=function() {_me.Pause();}
				obj.onmouseout=function() {_me.Move();}
			}

			var obj1 = $(this.id + '_1' );
			var obj2 = $(this.id + '_2'  );

			if (this.direction == 'left' || this.direction == 'up'){
			}else{
				obj2 = $(this.id + '_1' );
				obj1 = $(this.id + '_2'  );
			}
			while (true)
			{
				obj2.innerHTML = html;

				if (this.direction == 'left' || this.direction == 'right'){					
					if(obj2.offsetWidth < obj.offsetWidth)
					{
						if (this.direction == 'left'){html +='&nbsp;';}else{html ='&nbsp;' + html;}
					}else {
						break;
					}				
				}else{
					if(obj2.offsetHeight < obj.offsetHeight){
						html +='<br />';
					}else{
						break;
					}	
				}
			}			
			if(obj1.innerHTML==''){obj1.innerHTML = html;}
			this.Stop();
			this.Move();
		}
		// 初始化设置
		this.IniFunction = function(){
			if (this.scrollamount ==0){this.scrollamount=1;}
		}
		this.LHTML = function(){
			var strHTML = ''
			strHTML += '	<table style=\'height:' + this.height + 'px;\' cellpadding=\'0\' align=\'left\' border=\'0\' cellspace=\'0\'>';
			strHTML += '	  <tr>';
			strHTML += '		<td nowrap id=\'' + this.id + '_1\' class=\'text\' ></td>';
			strHTML += '		<td nowrap id=\'' + this.id + '_2\' class=\'text\' ></td>';
			strHTML += '	  </tr>';
			strHTML += '	</table>';
			return strHTML;
		}
		this.UHTML = function(){
			var strHTML = ''
			strHTML += '		<div style=\'width:' + this.width + 'px;\' id=\'' + this.id + '_1\' class=\'text\' ></div>';
			strHTML += '		<div style=\'width:' + this.width + 'px;\' id=\'' + this.id + '_2\' class=\'text\' ></div>';
			return strHTML;
		}
		this.Pause=function(){
			clearInterval(this.EMsetInterval);
		}
		this.Stop=function(){
			var obj = $(this.id);
			var obj_2 = $(this.id + '_2');
			this.Pause();
			if (this.direction == 'up' || this.direction == 'left')
			{
				if (this.direction == 'up'){obj.scrollTop =-1;obj.scrollLeft=0;}
				if (this.direction == 'left'){obj.scrollTop =0;obj.scrollLeft=-1;}
			}else{
				if (this.direction == 'down'){
					obj.scrollTop =obj_2.offsetHeight+1;
					obj.scrollLeft=obj_2.offsetWidth;
				}else{
					obj.scrollTop =obj_2.offsetHeight;
					obj.scrollLeft=obj_2.offsetWidth+1;
				}
			}

		}
		this.Move=function(){
			this.Pause();
			this.EMsetInterval = setInterval(function(){_me.Marquee();},this.scrolldelay);
		}
		this.Marquee=function(){
			var obj = $(this.id);
			var obj_1 = $(this.id + '_1');
			var obj_2 = $(this.id + '_2');
			var val = 0 ;
			if (this.direction == 'up'){val = obj_2.offsetTop - obj.scrollTop;}
			if (this.direction == 'down'){val = (obj_1.offsetTop - obj.scrollTop) * -1;}
			if (this.direction == 'left'){val = obj_2.offsetWidth- obj.scrollLeft;}
			if (this.direction == 'right'){val = obj.scrollLeft;}
			if(val <= 0){
				//其实demo.scrollLeft是有最大值的，和demo0.width,引用的图片的width有关系。demo过了一半（每半内容一样的），重新开始循环
				if (this.direction == 'left' || this.direction == 'up'){
					obj_1.innerHTML = obj_2.innerHTML;
				}else{
					obj_2.innerHTML = obj_1.innerHTML;
				}
				if (this.direction == 'up'){obj.scrollTop-=obj_1.offsetHeight;}
				if (this.direction == 'down'){obj.scrollTop+=obj_2.offsetHeight}
				if (this.direction == 'left'){obj.scrollLeft -= obj_1.offsetWidth;}
				if (this.direction == 'right'){obj.scrollLeft += obj_1.offsetWidth;}
				if (typeof this.reback == 'function'){this.reback();}
				this.palypx =0;
			}else{
				//不断的增加，相当于父容器的滚动条不断是缩小；但由于OVERFLOW: hidden; （滚动条不可见）
				if (this.direction == 'up'){obj.scrollTop += this.scrollamount; }
				if (this.direction == 'down'){obj.scrollTop -= this.scrollamount; }
				if (this.direction == 'left'){obj.scrollLeft += this.scrollamount; }
				if (this.direction == 'right'){obj.scrollLeft -= this.scrollamount; }
			}

			this.palypx ++;
			this.palypx %= this.playamount;
			if (this.palypx == 0){
				this.Pause();
				this.EMsetInterval=window.setTimeout(function(){_me.Move();},this.playinterval);
			}
		}

	}
/* 结束 */

 /*
	var eMb = new Et_Messbox();		//初始化
	eMb.id = 'EtMessbox';			// ID
	eMb.opacity	 = 100;				// 透明度
	eMb.className= 'EtMessageBox';	// 樣式名
	eMb.width	 = 500;				// 窗口尺寸
	eMb.height	 = 300;				// 窗口尺寸
	eMb.top		 = 100;				// 窗口位置
	eMb.left	 = 300;				// 窗口位置

	eMb.Binding("歡迎使用EtSoft!"); // 初始化类建立元素
	eMb.close();

	eMb.Binding();
	eMb.show("歡迎使用EtSoft!");
	eMb.close();

*/
function Et_Messbox()	// 提示窗口
	{
		this.Id			= 'Et_Messbox$' + Math.floor(Math.random() * 1000);
		this.opacity	= 30;			// 透明度
		this.byWith		= 0;
		this.byHeight	= 0;
		this.width		= '300';
		this.height		= '100';
		this.className	= 'EtMessageBox';
		this.top		= -1;
		this.left		= -1;
		this.isPosion	= true; // 是否自动定位窗口如果手机设置了Top 或者Left些功能失效
		this.Et_MsgBox	= null;
		this.Et_Mask	= null;
		var _me			= this;
		this.opacityindex = 5;
		this.fadeT=null;

		this.Binding=function(val){
			// 判断是否让系统自动定位窗口位置
			if( this.isPosion== true ){
				if( this.top > -1 || this.left > -1 ){
					this.isPosion= false;
				}
			}
			this.Et_Mask = $(this.Id + '_Mask')
			if (this.Et_Mask == null)
			{
				this.GetWH();
				this.Et_Mask = document.createElement("DIV");
				this.Et_Mask.id = this.Id + '_Mask';
				this.Et_Mask.className				= this.className;
				this.Et_Mask.style.position			= 'absolute';
				this.Et_Mask.style.background		= '#4D3913';
				this.Et_Mask.style.display			= '';
				this.Et_Mask.style.top				= 0;
				this.Et_Mask.style.left				= 0;
				this.Et_Mask.style.filter			= 'alpha(Opacity=5)';
				this.Et_Mask.innerHTML				=''
				this.Et_Mask.style.display			='none';
				this.Et_Mask.style.visibility		='hidden';

				document.body.appendChild(this.Et_Mask);
				this.hotKey();
			}
			// Message Box
			this.Et_MsgBox = $(this.Id)
			if (this.Et_MsgBox == null)
			{
				this.GetWH();
				this.Et_MsgBox						= document.createElement("DIV");
				this.Et_MsgBox.id					= this.Id
				this.Et_MsgBox.className			= this.className;
				this.Et_MsgBox.style.position		= 'fixed';
				this.Et_MsgBox.style.background		= '#FFFFFF';
				this.Et_MsgBox.style.display		= 'block';
				this.Et_MsgBox.style.border			= '1px solid #330000';
				this.Et_MsgBox.style.top			= this.top;
				this.Et_MsgBox.style.left			= this.left;
				this.Et_MsgBox.style.display		='none';
				this.Et_MsgBox.style.visibility		='hidden';

				document.body.appendChild(this.Et_MsgBox);
			}			
			this.show(val);
			// Et_MsgBox.onblur = this.onblur;
		}
		// 热键
		this.hotKey = function(){
			document.onkeyup = function(){
				switch(window.event.keyCode){
					case 27:
						_me.close();
						break;
				}
			}			
		}
		this.close = function(){
			this.Et_Mask = $(this.Id + '_Mask')
			if (this.Et_Mask != null){
				this.Et_Mask.style.display='none';
				this.Et_Mask.style.visibility='hidden';
			}
			this.Et_MsgBox = $(this.Id )
			if (this.Et_MsgBox != null){
				this.Et_MsgBox.style.display='none';
				this.Et_MsgBox.style.visibility='hidden';
			}
		}
		// 
		this.show = function(val){
			if(typeof(val)=='undefined'){val='';}
			if(val==''){return false;}
			this.GetWH();
			this.Et_Mask = $(this.Id + '_Mask')
			if (this.Et_Mask != null){
				this.Et_Mask.style.display		= 'block';
				this.Et_Mask.style.visibility	= 'visible';
				this.Et_Mask.style.width		= this.byWith;
				this.Et_Mask.style.height		= this.byHeight;
			}
			this.Et_MsgBox = $(this.Id )
			if (this.Et_MsgBox != null){
				this.Et_MsgBox.style.width		= this.width + 'px';
				this.Et_MsgBox.style.height		= this.height + 'px';
				this.Et_MsgBox.style.top		= this.top;
				this.Et_MsgBox.style.left		= this.left;
				this.Et_MsgBox.innerHTML		= val;
				this.Et_MsgBox.style.display	= 'block';
				this.Et_MsgBox.style.visibility	= 'visible';
			}
			this.opacityindex = 5;			
			this.TShow();
		}
		// 渐变显示背景
		this.TShow = function(){			
			if (this.opacityindex >=this.opacity){
				clearTimeout(this.fadeT);				
				return false;
			}
			this.opacityindex +=5;
			this.Et_Mask.style.filter="Alpha(Opacity="+ this.opacityindex +")";
			this.fadeT=setTimeout(function(){_me.TShow()},20)
		}

		this.GetWH = function(){
			// 设置屏蔽范围
			if(document.body.clientHeight>screen.height-120){
				this.byHeight=document.body.clientHeight;
				this.byWith=document.body.offsetWidth;
			}
			else{
				this.byHeight=screen.height;
				this.byWith=document.body.offsetWidth;
			}
			if(this.isPosion == true){
				this.top = (document.body.clientHeight - this.height)/2;
				this.left = (document.body.clientWidth - this.width)/2;
			
			}

		}
		this.onblur = function(){this.Et_MsgBox.focus();}
	}
