/***********************************************
* ProHTML Ticker script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
*
* www.dynamicdrive.com/dynamicindex2/prohtmlticker.htm
* 
* Add before </head> or in <body>
  <style type="text/css">
  <!--
  #dropcontentsubject { width: 155px; font-weight: bold; }
  .dropcontent { width: 155px; height: 155px; border: 1px solid black; padding: 3px; display:block; }
  -->
  </style>

* In <body> add:
  echo '<div id="dropcontentsubject"></div>' . "\n";
  Repeat the next 3 lines as many messages you have
  echo '<div id="dropmsg2" class="dropcontent" subject="What is DHTML?">' . "\n";
  echo 'DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.' . "\n";
  echo '</div>' . "\n";
***********************************************/

var tickspeed=10000 //ticker speed in miliseconds (1000=1 seconds, former 6000)
var enablesubject=1 //enable scroller subject? Set to 0 to hide

if (document.getElementById)
   { document.write('<style type="text/css">\n');
     document.write('.dropcontent{display:none;}\n');
     document.write('</style>\n');
   }

var selectedDiv=0
var totalDivs=0

function contractall()
{ var inc=0;
  while (document.getElementById("dropmsg"+inc))
  { document.getElementById("dropmsg"+inc).style.display="none"; inc++; }
}

function expandone()
{ var selectedDivObj=document.getElementById("dropmsg"+selectedDiv);
  contractall();
  document.getElementById("dropcontentsubject").innerHTML=selectedDivObj.getAttribute("subject");
  selectedDivObj.style.display="block";
  selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0;
  setTimeout("expandone()",tickspeed);
}

function startscroller()
{ while (document.getElementById("dropmsg"+totalDivs)!=null)
  totalDivs++
  expandone()
  if (!enablesubject) document.getElementById("dropcontentsubject").style.display="none"
}

if (window.addEventListener) window.addEventListener("load", startscroller, false);
else if (window.attachEvent) window.attachEvent("onload", startscroller);


