<!--
// ------ Hxcms.bbs滚动公告定义全局变量
       var theNewsNum;
       var theAddNum;
       var totalNum;
       var CurrentPosion=0;
       var theCurrentNews;
       var theCurrentLength;
       var theNewsText;
       var theTargetLink;
       var theCharacterTimeout;
       var theNewsTimeout;
       var theBrowserVersion;
       var theWidgetOne;
       var theWidgetTwo;
       var theSpaceFiller;
       var theLeadString;
       var theNewsState;
       function startTicker()
       {               
// ------ 设置初始数值
          theCharacterTimeout = 70;//字符间隔时间
          theNewsTimeout      = 2500;//公告间隔时间
          theWidgetOne        =  "_";//公告前面下标符1
          theWidgetTwo        =  "-";//公告前面下标符
          theNewsState        = 1;
          //theNewsNum        = document.body.children.incoming.children.NewsNum.innerText;//公告总条数
          //add by lin
		  theNewsNum          = document.body.children.incoming.children.AllNews.children.length;//公告总条数
		  theAddNum           = document.body.children.incoming.children.AddNews.children.length;//补充条数
		  totalNum            =theNewsNum+theAddNum;
		  theCurrentNews      = 0;
          theCurrentLength    = 0;
          theLeadString       = " ";
          theSpaceFiller      = " ";
          runTheTicker();
       }
// --- 基础函数
       function runTheTicker()
       {
          if(theNewsState == 1)
          {
            if(CurrentPosion<theNewsNum){ 
						    setupNextNews();
            }
						else{
						    setupAddNews();
						}
						CurrentPosion++;
						if(CurrentPosion>=totalNum||CurrentPosion>=5) CurrentPosion=0;  //最多条数不超过5条
					}
          if(theCurrentLength != theNewsText.length)
          {
             drawNews();
          }
          else
          {
             closeOutNews();
          }
       }
// --- 跳转下一条公告
       function setupNextNews()
       {
          theNewsState = 0;
					theCurrentNews = theCurrentNews % theNewsNum;     
          theNewsText = document.body.children.incoming.children.AllNews.children[theCurrentNews].children.Summary.innerText;
          theTargetLink = document.body.children.incoming.children.AllNews.children[theCurrentNews].children.NewsLink.innerText;          
          theCurrentLength = 0;
          document.all.hottext.href = theTargetLink;
          theCurrentNews++;
			 }
       function setupAddNews()
       {
          theNewsState = 0;
					theCurrentNews = theCurrentNews % theAddNum;     
          theNewsText = document.body.children.incoming.children.AddNews.children[theCurrentNews].children.Summary.innerText;
          theTargetLink = document.body.children.incoming.children.AddNews.children[theCurrentNews].children.NewsLink.innerText;          
          theCurrentLength = 0;
          document.all.hottext.href = theTargetLink;
          theCurrentNews++;
			 }			 
// --- Hxcms.bbs滚动公告
       function drawNews()
       {
          var myWidget;       
          if((theCurrentLength % 2) == 1)
          {
             myWidget = theWidgetOne;
          }
          else
          {
             myWidget = theWidgetTwo;
          }
          document.all.hottext.innerHTML = theLeadString + theNewsText.substring(0,theCurrentLength) + myWidget + theSpaceFiller;
          theCurrentLength++;
          setTimeout("runTheTicker()", theCharacterTimeout);
       }
// --- Hxcms.bbs公告循环结束
       function closeOutNews()
       {
          document.all.hottext.innerHTML = theLeadString + theNewsText + theSpaceFiller;
          theNewsState = 1;
          setTimeout("runTheTicker()", theNewsTimeout);
       }      
window.onload=startTicker;  

// ---
function showtab(m,n,count){
for(var i=1;i<=count;i++){
		if (1==n){
			getObject('tab_1').className="topic_sp";
			getObject('tab_2').className="topic";
			getObject('tab_3').className="topic";
			getObject('tab_4').className="topic";			
			getObject('tab_1_1').style.display='';
			getObject('tab_1_2').style.display='none';
			getObject('tab_1_3').style.display='none';
                        getObject('tab_1_4').style.display='none';						
			}
		else if (2==n){
			getObject('tab_1').className="topic";
			getObject('tab_2').className="topic_sp";
			getObject('tab_3').className="topic";
			getObject('tab_4').className="topic";		
			getObject('tab_1_1').style.display='none';
			getObject('tab_1_2').style.display='';
			getObject('tab_1_3').style.display='none';
                        getObject('tab_1_4').style.display='none';						
			}
		else if (3==n){
			getObject('tab_1').className="topic";
			getObject('tab_2').className="topic";
			getObject('tab_3').className="topic_sp";
			getObject('tab_4').className="topic";		
			getObject('tab_1_1').style.display='none';
			getObject('tab_1_2').style.display='none';
			getObject('tab_1_3').style.display='';
                        getObject('tab_1_4').style.display='none';						
			}
		else if (4==n){
			getObject('tab_1').className="topic";
			getObject('tab_2').className="topic";
			getObject('tab_3').className="topic";
			getObject('tab_4').className="topic_sp";		
			getObject('tab_1_1').style.display='none';
			getObject('tab_1_2').style.display='none';
			getObject('tab_1_3').style.display='none';
                        getObject('tab_1_4').style.display='';						
			}			
	}

}
function getObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
}
//-->
