function login()	 {
	if (document.frmLogin.UserName.value=='')
	{
		alert('请输入用户名！');
		return false;
	}else if (document.frmLogin.PassWord.value=='')
	{
		alert('请输入密码！');
		return false;
	}else	{
		return true;
	}
}

function bbimg(o){
		var zoom=parseInt(o.style.zoom, 10)||100;
		zoom+=event.wheelDelta/12;
		if (zoom>0) o.style.zoom=zoom+'%';
		return false;
	}

function checkName()	{
	if (document.form_pl.username.value=='')
	{
		alert('请输入您的姓名！');
	}else if(document.form_pl.content.value=='')	{
		alert('请输入评论内容！');
	}else	{
		document.form_pl.btnSubmit.disabled=true;
		document.form_pl.submit();
	}
}

function search_news()	{
	if (document.search_form_news.keyword.value=='')
	{
		alert('请输入搜索关键字！');
	}else if (document.search_form_news.search_range.value=='')
	{
		alert('请选择搜索范围！');
	}else{
		document.search_form_news.submit();
	}
}

function feedback()	{
	txt=document.feedback.yourEmail.value;
	if (txt.indexOf("@")<3)
	{ 
		alert("邮件地址必须包含@'");
	}else if ((txt.indexOf(".com")<5)&&(txt.indexOf(".org")<5)
	&&(txt.indexOf(".gov")<5)&&(txt.indexOf(".net")<5)
	&&(txt.indexOf(".mil")<5))
	{
		alert("邮件地址"
		+"必须包含"
		+".com,.net,.org,.gov,.mil");
	}else{
		document.feedback.submit();
	}
}

function set_index()	 {
	this.style.behavior="url(#default#homepage)";this.setHomePage("http://www.cref.cn")
}

function doZoom(size){
	document.getElementById('zoom').style.fontSize=size+'px'
	setTailPosition()
}

function bookmark_it()
{
	if ( document.all )
	{
		window.external.AddFavorite(window.document.location,window.document.title);
	}
}

function tuijian() {
txt=document.mail_page.email.value;
if (txt.indexOf("@")<3)
{ 
	alert("邮件地址必须包含@'");
}else if ((txt.indexOf(".com")<5)&&(txt.indexOf(".org")<5)
	&&(txt.indexOf(".gov")<5)&&(txt.indexOf(".net")<5)
	&&(txt.indexOf(".mil")<5))
	{
		alert("邮件地址"
		+"必须包含"
		+".com,.net,.org,.gov,.mil");
	}else{
		document.mail_page.submit();
	}

}


function setBarPosition(){
	document.getElementById('toolBar').style.top=0
	document.getElementById('toolBar').style.left=613
	document.getElementById('toolBar').style.display='block'
}

function setTailPosition(){

}

//鼠标双击滚屏开始
var currentpos,timer;

function initialize()
{
	timer=setInterval("scrollwindow()",20);
}

function sc(){
	clearInterval(timer);
}

function scrollwindow()
{
	currentpos=document.body.scrollTop;
	window.scroll(0,++currentpos);
	if (currentpos != document.body.scrollTop)
	sc();
}
document.onmousedown=sc
document.ondblclick=initialize
//鼠标双击滚屏结束

//页面最小化
function min_page()
{

	window.blur();

}

//页面最大化
function max_page()
{

	self.moveTo(0,0)
	self.resizeTo(screen.availWidth,screen.availHeight)

}

//选择全部
function select_all()
{
	var zoom=document.all("zoom");
	var oTextRange=document.body.createTextRange();
	with (oTextRange) {
	moveToElementText(zoom);
	execCommand("SelectAll");
	}
	var oTextRange=document.selection.createRange();
}

//鼠标滚轮缩放图片，用法<img src='xxx' onmousewheel="return bbimg(this)" >
function bbimg(o){
		var zoom=parseInt(o.style.zoom, 10)||100;
		zoom+=event.wheelDelta/12;
		if (zoom>0) o.style.zoom=zoom+'%';
		return false;
}


function vote_submit(vote_flag){
						  vote_form.vote_flag.value=vote_flag;
						  window.open('','vote','scrollbars=yes,status=no,width=420,height=340');
						  vote_form.submit();
						}


function link_jump(targ,selObj,restore){ //v3.0
 if(selObj.options[selObj.selectedIndex].value)
 { 
 window.open(selObj.options[selObj.selectedIndex].value,'new','');
 }
}



	function setPointer(theRow, thePointerColor)
	{
	    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
	        return false;
	    }
	
	    var row_cells_cnt           = theRow.cells.length;
	    for (var c = 0; c < row_cells_cnt; c++) {
	        theRow.cells[c].bgColor = thePointerColor;
	    }
	
	    return true;
	} // end of the 'setPointer()' function


//title特效开始
//***********默认设置定义.*********************
tPopWait=10;		//停留tWait豪秒后显示提示。
tPopShow=3000;		//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=95;
fontcolor="#000000";
bgcolor="#EDEDED";
bordercolor="#007db5";

//***************内部变量定义*****************
sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;

document.write("<style type='text/css' id='defaultPopStyle'>");
document.write(".cPopText {  background-color: " + bgcolor +";color:" + fontcolor + "; border: 1px " + bordercolor + " solid; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		dypopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}

function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {
		dypopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;
//title特效结束

function scrollit_r2l(seed)
{ var m1  = "Http://www.yihongtai.com    北京益弘泰科技发展有限责任公司 " ;
 var m2  = "" ;
       var msg=m1+m2;
       var out = " "; 
       var c = 1; 
 var speed  = 240;
if (seed > 100)
{                seed-=2;
                var cmd="scrollit_r2l(" + seed + ")";   
             timerTwo=window.setTimeout(cmd,speed);}     
    else if (seed <= 100 && seed > 0)
     {                for (c=0 ; c < seed ; c++)
                      {       out+=" ";}   
       out+=msg;         seed-=2;      
   var cmd="scrollit_r2l(" + seed + ")";      
   window.status=out;         
 timerTwo=window.setTimeout(cmd,speed); }        
      else if (seed <= 0) 
{                if (-seed < msg.length) 
                  { 
                       out+=msg.substring(-seed,msg.length);        
                       seed-=2;                        
                       var cmd="scrollit_r2l(" + seed + ")";         
                       window.status=out;                     
       timerTwo=window.setTimeout(cmd,speed);}
       else {               window.status=" ";       
                 timerTwo=window.setTimeout("scrollit_r2l(100)",speed);
}
}
}
scrollit_r2l(100);
// -- End of JavaScript code -->

