﻿// JScript 文件
function news_change(id)
        {
            document.getElementById("news_1").style.display="none";
            document.getElementById("news_2").style.display="none";
            document.getElementById("news_3").style.display="none";
            document.getElementById(id).style.display="";
            
            document.getElementById("menu_news_1").className="but_02";
            document.getElementById("menu_news_2").className="but_02";
            document.getElementById("menu_news_3").className="but_02";
            document.getElementById("menu_"+id).className="but_01";
        }


function scl(id){ 
var o=document.getElementById(id); 
window.setInterval(function(){scrollup(o,25,0);},5000); 
} 

function scrollup(o,d,c){ 
if(d==c){ 
var t=o.firstChild.cloneNode(true); 
o.removeChild(o.firstChild);
o.appendChild(t); 
t.style.marginTop=o.firstChild.style.marginTop='0px'; 
} 
else{ 
var s=2,c=c+s,l=(c>=d?c-d:0); 
o.firstChild.style.marginTop=-c+l+'px'; 
window.setTimeout(function(){scrollup(o,d,c-l)},30); 
} 
} 

function TextFormMat(id,oNum)
        {
            var strP=/^\d*\.?\d{0,2}$/; 
            if(!strP.test(oNum)) 
            {   
                alert("请输入数字类型!");
                document.getElementById(id).value="";
                document.getElementById(id).focus();
                return;
            } 

        }