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      = theSummaries[theCurrentStory].replace(/&quot;/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;
	}
}

// IMAGE ROLLOVER CODE
if (!window.sSelectedImg) {
	var sSelectedImg = new Array();
}
function LoadImages(numImages,navtype) {  }
function SwapImage(sImage,nState) {
	// image states: 0 = out, 1 = over, 2 = selected
	if (document.images) {
		if (parseInt(sImage)>=0) {	// convert old method
			sImage = "MenuImg" + sImage;
		}
		var oImage = document.images[sImage];
		if (oImage) {
			if (sImage.indexOf("_img") > 0) {
				var sMenu = sImage.substring(0,sImage.indexOf("_img"));
				sSelImg = sSelectedImg[sMenu];
			} else {
				if (!sSelectedImg["x"]) { sSelectedImg["x"]=""; }
				sSelImg = sSelectedImg["x"];
			}
		if (nState !=2 || sSelImg != sImage) {
			if (nState !=2 || sSelImg != oImage) {
				var sTmp = oImage.src;
				var sTmp1 = sTmp.substring(0,sTmp.lastIndexOf("."));
				var sTmp2 = sTmp.substring(sTmp.lastIndexOf(".")+1);
				if (sTmp.indexOf("_2.") == -1) {
					sTmp1 = sTmp1.replace(/\_1+/g,"");
					oImage.src = (nState==0) ? sTmp1 + "."+ sTmp2 : sTmp1 + "_"+nState+ "." + sTmp2;
				}
				if (nState==2 && sSelImg != oImage) {
					if (sSelImg) {
						sTmp = sSelImg.src;
						sSelImg.src = sTmp.replace(/_2\./g,".");
					}
					if (sMenu) {
						sSelectedImg[sMenu] = oImage;
					} else {
						sSelectedImg["x"] = oImage;
					}
				}
			}
		}
		}
	}
}

function DisplayStatusMsg(msgStr) {
  status=msgStr;
  document.ReturnValue = true;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function displayLayers() {
  var i,p,v,obj,args=displayLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }
	obj.display=v; }
}

function showHideLayers() { //v6.0
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function otherLinkPopUp(fileName) {
     myFloater = window.open('')
     myFloater.location.href = fileName;
}

function swapClass(id, newClass) {
	theElement=document.getElementById(id);
	theElement.className=newClass;
}

browser = navigator.appName;
appVer = parseInt(navigator.appVersion);
ie = "Microsoft Internet Explorer";
ns = "Netscape";
if (navigator.appVersion.indexOf("Macintosh") != -1) {
	isMac = true;
} else {
	isMac = false;
}
if (isMac == true) {
   document.write('<style type="text/css">#wrapper{display:table;}</style>');
}
if (browser == ie && isMac == true) {
   document.write('<style type="text/css">');
   document.write('body { background-color: #A70100; background-image: none; }');
   document.write('#footer { clear: both; }');
   document.write('#pgcontent { height: 3000px; }');
   document.write('</style>');
}
