/// 获得控件
function getE(id){
	return document.getElementById(id)
}

/// 控件或标记隐藏或显示
/// Eid 为控件或标记的ID
/// value 为显示或隐藏的值 "none"/"block"
function display(Eid,value){
	getE(Eid).style.display=value;
}
/// 添加到收藏夹
/// name 要显示的文本
function addf(name){
    try{
        window.external.addfavorite(window.location.href,name);
        return false;
        }catch(e){}
}

function submi(evt)
{
    if(evt.keyCode == 13)
    {  
        if(!isNumber(document.getElementById("TexGO").value)){
           document.getElementById("TexGO").value = "";
           document.getElementById("TexGO").focus();
           alert('请输入数字。');
        }else{
           document.getElementById('Button5').focus(); 
        }
   }
}

//数字;
function isNumber(s){
    return !isNaN(s);
}


// Useage: marquee(滚动对象id, 可见范围宽度, 可见范围高度, 滚动速度, 停留时间(速度数值越大速度越慢), 方向); 方向有left和up两种
function marquee(id,mw,mh,mr,ms,pause,dr){
	
	var obj=document.getElementById(id);
	obj.ss=false; //stop tag
	obj.mr=mr; //marquee rows
	obj.mw=mw; //marquee width
	obj.mh=mh; //marquee height
	obj.ms=ms; //marquee speed
	obj.pause=pause; //pause time
	obj.pt=0; //pre top
	obj.st=0; //stop time
	obj.dr=dr; //direction

	with(obj){
		style.width=mw+"px";
		style.height=mh+"px";
		noWrap=false;
		obj.onmouseover=stopm;
		obj.onmouseout=startm;
		scrollTop=0+"px";
		scrollLeft=0+"px";
	}
	
	if(obj.mr!=1){
		switch(obj.dr){
			case("up"):
				obj.tt=mh*mr;
				obj.ct=mh; //current top
				obj.innerHTML+=obj.innerHTML;
				setInterval(scrollUp,obj.ms); break;
			default://("left"):
				obj.tt=mw*mr;
				obj.ct=mw;
				obj.innerHTML='<div style="width:'+(obj.tt*2)+'px;"><div style="float:left;">'+obj.innerHTML+'</div><div style="float:right;">'+obj.innerHTML+'</div></div>';
				document.write('<style type="text/css">#'+id+' table{width:'+mw*mr+'px;} #'+id+' td{width:'+mw+'px;}</style>');
				setInterval(scrollLeft,obj.ms); break;
		}
	}

	function scrollUp(){
		if(obj.ss==true) return;
		obj.ct+=1;
		if(obj.ct==obj.mh+1){
			obj.st+=1; obj.ct-=1;
			if(obj.st==obj.pause){obj.ct=0; obj.st=0;}
		}else {
			obj.pt=(++obj.scrollTop);
			if(obj.pt==obj.tt){obj.scrollTop=0;}
		}
	}

	function scrollLeft(){
		if(obj.ss==true) return;
		obj.ct+=1;
		if(obj.ct==obj.mw+1){
			obj.st+=1; obj.ct-=1;
			if(obj.st==obj.pause){obj.ct=0; obj.st=0;}
		}else {
			obj.pt=(++obj.scrollLeft);
			if(obj.pt==obj.tt){obj.scrollLeft=0;}
		}
	}

	function stopm(){obj.ss=true;}
	function startm(){obj.ss=false;}
}

