
var theSiteLinks = new Array();
var theSentences = new Array();


// ****************************
// *** TICKER CONFIGURATION ***
// ****************************


// *** Total number of sentences to display     ***
// *** (must match the number of entries below) ***

var theItemCount = 2;


// *************************************************************
// *** The text of each sentence and it's corresponding link ***
// *** (use "#ticker" for no link).                          ***
// *** If you add/remove an entry please remember to update  ***
// *** theItemCount above!                                   ***
// *************************************************************


theSentences[0] = "A community based website for the global pharma and biotech industries, the exchange of ideas and business experiences...";
theSiteLinks[0] = "#ticker";

theSentences[1] = "...between pharma organisations, academic researchers and other pharma professionals.";
theSiteLinks[1] = "#ticker";
 
// *************************************************************


// *** Time delay in milliseconds to show each character ***
var theCharacterTimeout = 35;


// *** Time delay in milliseconds before showing next sentence ***
var theStoryTimeout	 = 1500;


// *** Common text at start of every sentence e.g. "LATEST: " ***
var theLeadString	   = "";


// *** The ticker characters ***
var theWidgetOne		= "_";
var theWidgetTwo		= "_";
var theWidgetNone	   = "";



// Functions - DO NOT CHANGE //

function startTicker()
{
 // Define run time values
 theCurrentStory	 = -1;
 theCurrentLength	= 0;
 // Locate base objects
 if (document.getElementById) { 
	  theAnchorObject = document.getElementById("tickerAnchor");
   runTheTicker();	
   }
 else {
			document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
			return true;
 }
}
// Ticker main run loop
function runTheTicker()
{
 var myTimeout;

 // Go for the next story data block
 if(theCurrentLength == 0)
 {
  theCurrentStory++;
  theCurrentStory	  = theCurrentStory % theItemCount;
  theStorySummary	  = theSentences[theCurrentStory].replace(/"/g,'"');  
  theTargetLink		= theSiteLinks[theCurrentStory];
  theAnchorObject.href = theTargetLink;
  thePrefix 	  = "<span class=\"tickls\">" + theLeadString + "</span>";
 }
 // Stuff the current ticker text into the anchor
 theAnchorObject.innerHTML = thePrefix + 
 theStorySummary.substring(0,theCurrentLength) + whatWidget();
 // Modify the length for the substring and define the timer
 if(theCurrentLength != theStorySummary.length)
 {
  theCurrentLength++;
  myTimeout = theCharacterTimeout;
 }
 else
 {
  theCurrentLength = 0;
  myTimeout = theStoryTimeout;
 }
 // Call up the next cycle of the ticker
 setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
 if(theCurrentLength == theStorySummary.length)
 {
  return theWidgetNone;
 }

 if((theCurrentLength % 2) == 1)
 {
  return theWidgetOne;
 }
 else
 {
  return theWidgetTwo;
 }
}


