// JavaScript Document




<!--//

/* ADDED BY Orangutan - 22/10/2008 */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

/* ADDED BY Orangutan - 22/10/2008 */
addLoadEvent(alterHistory);

/* ADDED BY Orangutan - 22/10/2008 */
function alterHistory()
{
	if (document.getElementById('myHistory')) {
		document.getElementById('myHistory').height = '1000px';
	}
}


function startTicker() {
/*
	// Define run time values

	popdiv();

	

	theTicker = document.getElementById('ticki');

    theCurrentStory = -1;

    theCurrentLength = 0;

    // Locate base objects

    if (document.getElementById) {

		theAnchorObject = document.getElementById("tickerAnchor");

		runTheTicker();

		theTicker.className = "ticki";

    }else{

		return true;

    }
*/
}



function popdiv() {



	var maindiv = document.getElementById('ctl00_Content_ContentArea');

	var slideshow = document.getElementById('slideshow');

	var overlayholder = document.createElement('overlay-holder');

	var overlay = document.createElement('overlay');

	

	overlayholder.setAttribute('id','overlay-holder');

	overlay.setAttribute('id','overlay');

	

	overlayholder.appendChild(overlay);

	maindiv.insertBefore(overlayholder, slideshow);

	//maindiv.appendChild(overlayholder);

	

	var so = new FlashObject("overlay4.swf", "name", "1", "1", "8", "#ffffff");

	so.addParam("wmode","transparent");

	so.write("overlay");



}



function closeOverlay() {

	document.getElementById('overlay-holder').className='hide';

}



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;

    }

}



function mytime(){

showtime = setInterval("rotatedivs()", 8000);

}



var count = 0;

var trackcount = 0;



//Switch On & Off divs 

function switchDiv(divOn) {

	

	try {

		clearInterval(showtime);

		//mytime();

	}catch(err){

		

	}



	var s = document.getElementById('slideshow');

	if(!s){return;}

	var divs = s.getElementsByTagName('div');

	

	document.getElementById('Slide' + divOn).className = 'page_SlideShowDisplay';



	for (var i=1;i<divs.length;i++){

			if(i == divOn) {

				trackcount = divOn;

				count = divOn;

				document.getElementById('Slide' + divOn).className = 'page_SlideShowDisplay';

			}else{

				if(!document.getElementById('Slide' + i)){return;}

				document.getElementById('Slide' + i).className = 'page_SlideShowHide';

			}

		}

}



function switchDiv2(divOn) {

	

	try {

		clearInterval(showtime);

		mytime();

	}catch(err){

		

	}



	var s = document.getElementById('slideshow');

	if(!s){return;}

	var divs = s.getElementsByTagName('div');

	

	document.getElementById('Slide' + divOn).className = 'page_ShowDisplay';



	for (var i=1;i<divs.length;i++){

			if(i == divOn) {

				trackcount = divOn;

				count = divOn;

				document.getElementById('Slide' + divOn).className = 'page_ShowDisplay';

			}else{

				if(!document.getElementById('Slide' + i)){return;}

				document.getElementById('Slide' + i).className = 'page_ShowHide';

			}

		}

}



function rotatedivs(){

trackcount = count;

count++;

var myDiv = document.getElementById("Slide" + count);

var myOldDiv = document.getElementById("Slide" + trackcount);

if(!myDiv){count = 1;}

	myDiv = document.getElementById("Slide" + count);

	myDiv.className = 'page_SlideShowDisplay';

	if(myOldDiv){myOldDiv.className = 'page_SlideShowHide';}

}

-->