var message= new Array()
// message[indexnumber]="标题|说明|网址"

message[0]="July News|Dr. Lishan Sun completed his Postdoctoral study at Transtech and became an assistant professor at Beijing University of Technology. Dr. Liu visited a couple of Chinese universities to give seminars and seek opportunities for collaboration in research."
message[1]="August News|Three papers were submitted to TRB 2010 annual meeting!"
message[2]="September News|Transtech was awarded two research projects by RTI and Lubbock District of Texas Department of Transportation."
message[3]="October News|Hao抯 paper titled: Control Delay at Signalized Diamond Interchanges Considering Internal Queue Spillback was accepted for presentation at TRB 2010 annual meeting and publication in the Journal of Transportation Research Record, this will be Hao抯 3rd journal paper accepted by first tier transportation journals."
message[4]="November News|TransTech received funding (through TechMRT) from the Texas Department of Transportation to conduct bicycle studies in mid-sized cities."
message[5]="December News|TranTech received funding (through TechMRT) from the Texas Department of Transportation Lubbock District to conduct studies on various transportation studies including evaluation of alternative control strategies of diamond interchanges with two-way frontage roads and road user抯 cost analysis in work zones."
message[6]="January News|Jared Squyres joined the TransTech as a new PhD student. Mr. Squyres brings to the lab his enthusiasm and substantial knowledge in computer programming and more. Welcome, Jared! Hao and Dr. Liu attended the 2010 TRB annual meeting and made presentations!"
message[7]="February News|"


//message[4]=""

// 卷轴的高
  var scrollerheight=120
// 标题宽
  var titlezonewidth=200
// 说明宽
  var copyzonewidth=200
// 距离窗口顶
  var scrollertop=0
// 距离窗口左
  var scrollerleft=10
var scrollerborder=0
// 标题背景色
  var titlezonebg="#FF0000"
// 文字的背景色
  var copyzonebg="#FFFFFF"
// 卷轴的背景色
  var scrollbg="FFFFFF"
// 目标窗口
  var targetlink="_blank"
// 标题的字体属性
  var font_titleface="宋体"
  var font_titlecolor="#CC0001"
  var font_titlesize=2
// 说明的字体属性
  var font_copyface="Arial"
  var font_copycolor="000000"
  var font_copysize=1.5
// s设置 1 标题为粗体, 0 为正常
  var titlebold=1
// 说明
  var copybold=1
// 设置 'right', 'left' or 'center' 标题对齐方式
  var titlealign="left"
// 说明
  var copyalign="left"
// 停顿时间
  var standstill=5000
  

var pre_titlebold
  var after_titlebold
  var pre_copybold
  var after_copybold
var cliptop=0
  var clipbottom=0
  var clipleft=0
  var clipright=copyzonewidth+10
var i_message=0
  var mes_joined
  var mes_split
  var contenttext
  var contentbg=""
var step=2
  var pause=20
if (titlebold==1) {
  pre_titlebold="<b>"
  after_titlebold="</b>"
  }
  else if (titlebold==0) {
  pre_titlebold=""
  after_titlebold=""
  }
if (copybold==1) {
  pre_copybold="<b>"
  after_copybold="</b>"
  }
  else if (copybold==0) {
  pre_copybold=""
  after_copybold=""
  }
  var scrollertexttemp;
function initiate() {
  mes_joined=message[i_message]
  mes_split=mes_joined.split("|")  
  cliptop=0
  clipbottom=0  
  contenttext="<table cellpadding=4 cellspacing=0 border=0 width=210>"
  contenttext+="<tr valign='top'>"
  contenttext+="<td align="+titlealign+" width="+titlezonewidth+" >"
 // contenttext+="<a href='"+mes_split[2]+"' target='"+targetlink+"'>"
  contenttext+="<font face='"+font_titleface+"' color='"+font_titlecolor+"' size='"+font_titlesize+"'>"
  contenttext+=pre_titlebold
  contenttext+=mes_split[0]
  contenttext+=after_titlebold
  contenttext+="</font></td></tr>"
  contenttext+="<tr><td align="+copyalign+" width="+copyzonewidth+">"
  contenttext+="<font  face='"+font_copyface+"' color='"+font_copycolor+"' size='"+font_copysize+"'>"
  contenttext+=pre_copybold
  contenttext+=mes_split[1]
  contenttext+=after_copybold
  contenttext+="</font></td></tr>"
  contenttext+="</table>"
  //alert(contenttext)
  var bg_width=copyzonewidth
  var bg_height=scrollerheight 
  
  contentbg="<table width="+bg_width+" height='"+bg_height+"' cellpadding=0 cellspacing=0 border='"+scrollerborder+"'><tr><td bgcolor='"+scrollbg+"'> </td></tr></table>"
//for firefox 
  //getElementsByTagName("*") 可以得到得到所有元素的集合
  //getElemntById 可以按id得到某一元素
  //getElementsByName 可以得到按name属性得到某一元素
  
  if (document.getElementsByTagName("*")) {
  scrollertext.innerHTML=contenttext
  scrollerbg.innerHTML=contentbg
  document.all.scrollertext.style.posTop=scrollertop
 //document.all.scrollertext.style.posTop=scrollertop+scrollerheight
  document.all.scrollertext.style.posLeft=scrollerleft
  document.all.scrollerbg.style.posTop=scrollertop-scrollerborder
  document.all.scrollerbg.style.posLeft=scrollerleft-scrollerborder
  clipbottom=scrollerheight;
  document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
  
  
  //the second text div
 // alert(contenttext);
 // scrollertext1.innerHTML=contenttext
 // scrollerbg.innerHTML=contentbg
 // document.all.scrollertext1.style.posTop=scrollertop
 // document.all.scrollertext1.style.posLeft=scrollerleft
  //document.all.scrollerbg.style.posTop=scrollertop-scrollerborder
  //document.all.scrollerbg.style.posLeft=scrollerleft-scrollerborder
 // document.all.scrollertext1.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
 
 var timer=setTimeout("scrollout()",standstill)
  //alert(document.all.scrollertext)
  }
  if (document.layers) {
  document.scrollertext.document.write(contenttext)
  document.scrollertext.document.close()
  document.scrollerbg.document.write(contentbg)
  document.scrollerbg.document.close()
  document.scrollertext.top=scrollertop+scrollerheight
  document.scrollertext.left=scrollerleft
  document.scrollerbg.top=scrollertop-scrollerborder
  document.scrollerbg.left=scrollerleft-scrollerborder
  document.scrollertext.clip.left=clipleft
  document.scrollertext.clip.right=clipright
  document.scrollertext.clip.top=cliptop
  document.scrollertext.clip.bottom=clipbottom
 // scrollin()
  }
  }
function scrollin(){
  if (document.getElementsByTagName("*")){
  if (document.all.scrollertext.style.posTop>(scrollertop)) {
  clipbottom+=step
  document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
  document.all.scrollertext.style.posTop-=step
  //the second text div
 // document.all.scrollertext1.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
 // document.all.scrollertext1.style.posTop-=step
  //move
  var timer=setTimeout("scrollin()",pause)
  }
  else {
  clearTimeout(timer)
  var timer=setTimeout("scrollout()",standstill)
  }
  
  }
  if (document.layers){
  if (document.scrollertext.top>scrollertop) {
  clipbottom+=step
  document.scrollertext.clip.left=clipleft
  document.scrollertext.clip.right=clipright
  document.scrollertext.clip.top=cliptop
  document.scrollertext.clip.bottom=clipbottom
  document.scrollertext.top-=step
  var timer=setTimeout("scrollin()",pause)
  }
  else {
  clearTimeout(timer)
  var timer=setTimeout("scrollout()",standstill)
  }
  }
  }

function scrollout(){
  if (document.getElementsByTagName("*")){
  if (document.all.scrollertext.style.posTop>(scrollertop-scrollerheight)) {
  cliptop+=step
  document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
  document.all.scrollertext.style.posTop-=step
  var timer=setTimeout("scrollout()",pause)
  }
  else {
  clearTimeout(timer)
  changemessage()
  }
  }
  if (document.layers){
  if (document.scrollertext.top>(scrollertop-scrollerheight)) {
  cliptop+=step
  document.scrollertext.clip.left=clipleft
  document.scrollertext.clip.right=clipright
  document.scrollertext.clip.top=cliptop
  document.scrollertext.clip.bottom=clipbottom
  document.scrollertext.top-=step
  var timer=setTimeout("scrollout()",pause)
  }
  else {
  
  clearTimeout(timer)
 changemessage()
  }
  }
  }
function changemessage(){
  i_message++
  if (i_message>message.length-1) {i_message=0}
  mes_joined=message[i_message]
  mes_split=mes_joined.split("|")
  cliptop=0
  clipbottom=0
  
  contenttext="<table cellpadding=4 cellspacing=0 border=0 width=210>"
  contenttext+="<tr valign='top'>"
  contenttext+="<td align="+titlealign+" width="+titlezonewidth+" >"
  contenttext+="<a href='"+mes_split[2]+"' target='"+targetlink+"'>"
  contenttext+="<font face='"+font_titleface+"' color='"+font_titlecolor+"' size='"+font_titlesize+"'>"
  contenttext+=pre_titlebold
  contenttext+=mes_split[0]
  contenttext+=after_titlebold
  contenttext+="</font></a></td></tr>"
  contenttext+="<tr><td align="+copyalign+" width="+copyzonewidth+">"
  contenttext+="<font  face='"+font_copyface+"' color='"+font_copycolor+"' size='"+font_copysize+"'>"
  contenttext+=pre_copybold
  contenttext+=mes_split[1]
  contenttext+=after_copybold
  contenttext+="</font></td></tr>"
  contenttext+="</table>"
  
  if (document.getElementsByTagName("*")) {
  scrollertext.innerHTML=contenttext
  document.all.scrollertext.style.posTop=scrollertop+scrollerheight
  document.all.scrollertext.style.posLeft=scrollerleft
  document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
  scrollin();
  }
  if (document.layers) {
  document.scrollertext.document.write(contenttext)
  document.scrollertext.document.close()
  document.scrollertext.top=scrollertop+scrollerheight
  document.scrollertext.left=scrollerleft
  document.scrollertext.clip.left=clipleft
  document.scrollertext.clip.right=clipright
  document.scrollertext.clip.top=cliptop
  document.scrollertext.clip.bottom=clipbottom
  scrollin()
  }
  }

