
// Delay in milliseconds for the growing headliner
growWait=90
// Delay in milliseconds for the expanding headliner
expandWait=100
// Delay in milliseconds for the scrolling headliner
scrollWait=100
// Number of characters in scrolling zone for the scrolling headliner
scrollWidth=60
// Number of lines, specify as much as you want to use
lineMax=4
lines=new Array(lineMax)
// Define the lines (Text to display, url, effect, time to wait)
lines[1]=new Line("  Take Home Message Fonction et Dysfonctions Sexuelles présenté au congrès 2005 de l'AUA (VF)", Static, 3000)
lines[2]=new Line("  Programme des sessions SFMS du congrès de la WAS, Montréal Juillet 2005 en ligne", "", Expand, 3000)
lines[3]=new Line("  11 juin 2005, Paris : Journée de préparation aux Assises de la Médecine Sexuelle. ", "", Expand, 3000)
lines[4]=new Line("  Bientôt : Le 1er bulletin de la SFMS", "", Expand, 3000)
lines[5]=new Line("  <%=FormatDateTime(date,1)%> Informations...","main.asp",Static,2000)

// Some other variables (just don't change)
lineText=""
timerID=null
timerRunning=false
spaces=""
charNo=0
charMax=50
charMiddle=0
lineNo=0
lineWait=0

// Define line object
function Line(text, url, type, wait) {
  this.text=text
  this.url=url
  this.Display=type
  this.wait=wait
}

// Fill a string with n chars c

function StringFill(c, n) {
  s=""
  while (--n >= 0) {
    s+=c
  }
  return s
}

function Static() {
  if(document.all) {
    document.all.buttonFace.innerText=this.text
    timerID=setTimeout("ShowNextLine()", this.wait)
  }
}

function Grow() {
  lineText=this.text
  lineWait=this.wait
  charMax=lineText.length
  charmax=60;
  TextGrow()
}

function TextGrow() {
  if (charNo <= charMax) {
    if(document.all) {
      document.all.buttonFace.innerText=lineText.substring(0, charNo)
      charNo++
      timerID=setTimeout("TextGrow()", growWait)
    }  
  }
  else {
    charNo=0
    timerID=setTimeout("ShowNextLine()", lineWait)
  }
}

function Expand() {
  lineText=this.text
  charMax=lineText.length
  charMiddle=Math.round(charMax / 2)
  lineWait=this.wait
  TextExpand()
}

function TextExpand() {
  if (charNo <= charMiddle) {
    if(document.all) {
      document.all.buttonFace.innerText=lineText.substring(charMiddle - charNo, charMiddle + charNo)
      charNo++
      timerID=setTimeout("TextExpand()", expandWait)
    }
  }
  else {
    charNo=0
    timerID=setTimeout("ShowNextLine()", lineWait)
  }
}

function Scroll() {
  spaces=StringFill(" ", scrollWidth)
  lineText=spaces+this.text
  charMax=lineText.length
  lineText+=spaces
  lineWait=this.wait
  TextScroll()
}

function TextScroll() {
  if (charNo <= charMax) {
    if(document.all) {
      document.all.buttonFace.innerText=lineText.substring(charNo, scrollWidth+charNo)
      charNo++
      timerID=setTimeout("TextScroll()", scrollWait)
    }
  }
  else {
    charNo=0
    timerID=setTimeout("ShowNextLine()", lineWait)
  }
}

function StartHeadliner() {
  StopHeadliner()
  timerID=setTimeout("ShowNextLine()", 1000)
  timerRunning=true
}

function StopHeadliner() {
  if (timerRunning) { 
    clearTimeout(timerID)
    timerRunning=false
  }
}

function ShowNextLine() {
  (lineNo < lineMax) ? lineNo++ : lineNo=1
  lines[lineNo].Display()
}

function GotoUrl(url)
{
  window.open(url,"my_new_window","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=<%=a%>,height=<%=b%>,top=0,left=0");
}

// end hide -->

