//翻页的跳转
function GoToTheUrl(TheSelect)
{
	window.open(TheSelect.value,"_self");
}
//显示动画
function ShowFlash(flashWIDTH,flashHEIGHT,flashURL)
{
document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+'>'); 
document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">'); 
document.writeln ('<PARAM NAME=wmode VALUE=transparent>'); 
document.writeln ('<PARAM NAME=loop VALUE=true>'); 
document.writeln ('<PARAM NAME=quality VALUE=high>'); 
document.writeln ('<EMBED src="'+flashURL+'" loop=true wmode=transparent quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'); 
document.writeln ('</OBJECT>'); 
}
//限制图片大小
function resize(o)
{
	if (o.width>690)
	{
		o.style.width='690px';
		o.style.height='auto';
	}
}
//当前日期
function GetNowTime()
{
	var tmpDate = new Date(); 
	var year= tmpDate.getYear(); 
	var month= tmpDate.getMonth() + 1 ;
	var date = tmpDate.getDate(); 
	
	var xqj="";
	
	var hours = tmpDate.getHours(); 
	var minutes = tmpDate.getMinutes(); 
	var seconds = tmpDate.getSeconds();
	
	
	myArray=new Array(6); 
	myArray[0]="星期日    " 
	myArray[1]="星期一    " 
	myArray[2]="星期二    " 
	myArray[3]="星期三    " 
	myArray[4]="星期四    " 
	myArray[5]="星期五    " 
	myArray[6]="星期六    " 
	weekday=tmpDate.getDay(); 
	if (weekday==0 | weekday==6) 
	{xqj=myArray[weekday];} 
	else 
	{xqj=myArray[weekday];} 
	//document.getElementById("NowTime").innerHTML="今天是"+year+"年"+bw(month)+"月"+bw(date)+"日 "+bw(xqj)+" "+bw(hours)+":"+bw(minutes)+":"+bw(seconds)+"";
	document.getElementById("NowTime").innerHTML="今天是"+year+"年"+bw(month)+"月"+bw(date)+"日 "+bw(xqj)+"";
}
function bw(n)
{
	if(n.toString().length==1)
	{return "0"+n.toString()}
	else
	{return n}
}
//向下滚动
function DownScroll(colee0,colee1,colee2)
{
	var speed=30
	var colee_bottom2=document.getElementById(colee2);
	var colee_bottom1=document.getElementById(colee1);
	var colee_bottom=document.getElementById(colee0);
	
	colee_bottom2.innerHTML=colee_bottom1.innerHTML;
	colee_bottom.scrollTop=colee_bottom.scrollHeight;
	function Marquee2(){
		if(colee_bottom1.offsetTop-colee_bottom.scrollTop>=0)
		{colee_bottom.scrollTop+=colee_bottom2.offsetHeight;}
		else{colee_bottom.scrollTop--;}
	};
	var MyMar2=setInterval(Marquee2,speed);
	colee_bottom.onmouseover=function() {clearInterval(MyMar2);};
	colee_bottom.onmouseout=function() {MyMar2=setInterval(Marquee2,speed);};
}
/*
//向下滚动
function DownScroll(dome,dome1,dome2)
{
	var speed=60
	var A2=document.getElementById(dome2);
	var A1=document.getElementById(dome1);
	var A=document.getElementById(dome);
	A2.innerHTML=A1.innerHTML
	Marquee2(dome,dome1,dome2);
	//A.scrollTop=A.scrollHeight
	var MyMar2=setInterval(function(){Marquee2(dome,dome1,dome2);},speed)
	A.onmouseover=function() {clearInterval(MyMar2)}
	A.onmouseout=function() {MyMar2=setInterval(function(){Marquee2(dome,dome1,dome2);},speed)}
}

function Marquee2(dome,dome1,dome2)
{
	var B2=document.getElementById(dome2);
	var B1=document.getElementById(dome1);
	var B=document.getElementById(dome);
	var n=get_offset(B2)-get_offset(B1)//求相对上个节点的唯移动(兼容目的)
	//B2.offsetTop 有可能是相对上个节点 有可能是相对BODY
	if(n-B.scrollTop<=0)
		B.scrollTop-=B1.offsetHeight
	else
	{
		B.scrollTop++
	}
}
function get_offset(obj){
    var offsetparent = obj;
	var top=0
    while(offsetparent != null && offsetparent.nodeName != "BODY"){
         //left += offsetparent.offsetLeft;
         top += offsetparent.offsetTop;
         offsetparent=offsetparent.parentNode;
    }
	return top;
}
*/
//二级页左右高度一致设置
function SetLeftRightHeight()
{
	var B0=543;
	var B1=document.getElementById("EjLeft").offsetHeight;
	var B2=document.getElementById("EjRight").offsetHeight;
	if (B1>B0)
	{B0=B1}
	if (B2>B0)
	{B0=B2}
	document.getElementById("EjLeft").style.height=B0+"px";
	document.getElementById("EjRight").style.height=B0+"px";	
}
//学习中心左右高度一致设置
function SetLeftRightHeight2()
{
	var B0=543;
	var B1=document.getElementById("StudyLeft").offsetHeight;
	var B2=document.getElementById("StudyRight").offsetHeight;
	if (B1>B0)
	{B0=B1}
	if (B2>B0)
	{B0=B2}
	document.getElementById("StudyLeft").style.height=B0+"px";
	document.getElementById("StudyRight").style.height=B0+"px";	
}
//搜索取值
function SearchClick()
{
	var TheContent=document.getElementById("SearchContent").value;
	var TheSelectSortStr=document.getElementById("TheSelectSortStr").value;
	if(TheContent!="" && TheContent!=null)
	{window.location.href="News_Search.asp?thestr="+TheSelectSortStr+"&content="+TheContent}
	else
	{alert("请输入您的搜索关键字...");}
}
//留言板提交
function CkGuestBook(thefrom)
{
	if (thefrom.LybZt.value=="")
	{
		alert("请输入留言内容");
		thefrom.LybZt.focus();
		return false;
	}
	if (thefrom.LybLxr.value=="")
	{
		alert("请输入联系人");
		thefrom.LybLxr.focus();
		return false;
	}
	if (thefrom.LybLxdh.value=="")
	{
		alert("请输入联系电话");
		thefrom.LybLxdh.focus();
		return false;
	}
	if (thefrom.Lybemail.value=="")
	{
		alert("请输入E-mail");
		thefrom.Lybemail.focus();
		return false;
	}
	if (thefrom.LybNr.value=="")
	{
		alert("请输入留言内容");
		thefrom.LybNr.focus();
		return false;
	}
}

//柱形图类 构造函数
function ZxClass (ZwID,ZbID,BfbID,Tps,Ztps){
		this.ZwID=ZwID;
		this.ZbID=ZbID;
		this.BfbID=BfbID;
		this.Tps=Tps;
		this.Ztps=Ztps;
	}
//柱形图类的非静态属性与方法
ZxClass.prototype={
		zw_h:0,//占位图实际要求高
		zb_h:0,//中部图实际要求高
		bfb:0,//实际百分比
		zw_height:100,//占位图当前高
		zb_height:0,//中部图当前高
		mydszx:null,//定时执行
		ZxChange:function (){
			if(this.Ztps==0 || this.Tps==0)
			{
				this.zw_h=100;
				}
			else
			{
				this.zw_h=100-parseInt(100/this.Ztps*this.Tps,10);
				this.zb_h=parseInt(100/this.Ztps*this.Tps,10);
				this.bfb=parseInt(this.Tps/this.Ztps*100,10);
				}
			document.getElementById(this.BfbID).innerHTML=this.bfb+"%";
			}
		}

//实例化一个柱形图
function SetZxgd(ZwID,ZbID,BfbID,Tps,Ztps)
{
	var shengao=new ZxClass(ZwID,ZbID,BfbID,Tps,Ztps);
	shengao.ZxChange();
	shengao.xinghuanzhixing=function(){
		if (shengao.zw_height==shengao.zw_h){
				clearInterval(shengao.mydszx);
				}
			document.getElementById(shengao.ZwID).style.height=shengao.zw_height+"px";
			document.getElementById(shengao.ZbID).style.height=shengao.zb_height+"px";
			shengao.zw_height--;
			shengao.zb_height++;
		}
	shengao.mydszx=setInterval(shengao.xinghuanzhixing,5);
}

//验证用户登录
function CkMemberLogo(thefrom)
{
	if (thefrom.IndexUser.value=="")
	{
		alert("请输入用户名");
		thefrom.IndexUser.focus();
		return false;
	}
	if (thefrom.IndexPass.value=="")
	{
		alert("请输入密码");
		thefrom.IndexPass.focus();
		return false;
	}
}

//验证修改密码
function CkEditPass(TheForm)
{
	if (TheForm.EditUsername.value=="")
	{
		alert("请输入用户名");
		TheForm.EditUsername.focus();
		return false;
	}
	if (TheForm.EditYmm.value=="")
	{
		alert("请输入原密码");
		TheForm.EditYmm.focus();
		return false;
	}
	if(TheForm.EditXmm.value.length<4 || TheForm.EditXmm.value.length>20)
	{
		alert("新密码长度在4位-20位之间");
		TheForm.EditXmm.focus();
		return false;
	}
	if(!IsHf(TheForm.EditXmm.value))
	{
		alert("新密码只能为数字，字母或下划线");
		TheForm.EditXmm.focus();
		return false;
	}
	if(TheForm.EditXmm.value!=TheForm.EditXmm2.value)
	{
		alert("两次输入新密码不一致");
		TheForm.EditXmm.focus();
		return false;
	}
}

//验证忘记密码
function CkWjmmPass(TheForm)
{
	if (TheForm.WjmmUser.value=="")
	{
		alert("请输入用户名");
		TheForm.WjmmUser.focus();
		return false;
	}
}

//验证字符串是否只含数字，字母和下划线 是则返回True 否则返回False
function IsHf(str)
{ 
	var reg=/[^A-Za-z0-9_]/g 
    if (reg.test(str))
	{return (false);}
	else
	{return(true);} 
}

//激活
function Activation(TheForm)
{
	if(TheForm.Submit.value=="检测卡的有效性")
	{
		if (TheForm.xlh.value=="")
		{
			alert("请输入卡序列号");
			TheForm.xlh.focus();
			return false;
		}
		if (TheForm.kpass.value=="")
		{
			alert("请输入卡密码");
			TheForm.kpass.focus();
			return false;
		}
	}
	if(TheForm.Submit.value=="确认激活")
	{
		if (TheForm.sfzh.value=="")
		{
			alert("请输入身份证号");
			TheForm.sfzh.focus();
			return false;
		}
		if (TheForm.cyzgzh.value=="")
		{
			alert("请输入从业资格证号");
			TheForm.cyzgzh.focus();
			return false;
		}
	}
}
//继续教育登录
function CkEducationLogin(TheForm)
{
	if (TheForm.sfzh.value=="")
	{
		alert("请输入身份证号");
		TheForm.sfzh.focus();
		return false;
	}
	if (TheForm.cyzgzh.value=="")
	{
		alert("请输入从业资格证号");
		TheForm.cyzgzh.focus();
		return false;
	}
	if (TheForm.yzm.value=="")
	{
		alert("请输入验证码");
		TheForm.yzm.focus();
		return false;
	}
}

//会计从业人员资格信息查询
function CkCyzgCx(TheForm)
{
	if (TheForm.sfzh.value=="")
	{
		alert("请输入身份证号");
		TheForm.sfzh.focus();
		return false;
	}
	if (TheForm.cyzgzh.value=="")
	{
		alert("请输入从业资格证号");
		TheForm.cyzgzh.focus();
		return false;
	}
}

//改变√
function GaiBianIsXx(TheId)
{
	document.getElementById("ChapterBID_"+TheId).className='Ej Yxx';
}

//添加横杠
function Zdtjhg(TheValue)
{
	if((TheValue.length+1)%5==0)
	{
		TheValue=TheValue+"-";
	}
	return TheValue;
}
