// JavaScript Document

function highlightLeftMenu()
{
	//debugger;
	var pathName = document.location.pathname;
	var pageName = pathName.substring(pathName.lastIndexOf('_') + 1);
	var menu=document.getElementById("modulesMenu");
	var indexItems = new Array();
	indexItems = menu.getElementsByTagName("li");
	for (i=0; i < indexItems.length; i++) //Iterate through the modules list
	{
		if (pageName.search(indexItems[i].id) != -1)
			indexItems[i].className="active";
			//indexItems[i].className=("active");
			//indexItems[i].setAttribute('className','active');  // for IE6???
			//indexItems[i].setAttribute((document.all ? ‘className’ : ‘class’), "active");
	}	
}

function makeBannerConsistent()
{
	//debugger;
	
	imagesLHS = new Array(3);
	imagesLHS[0] = 'url(images/Home1Left.jpg)';
	imagesLHS[1] = 'url(images/Home2Left.jpg)';
	imagesLHS[2] = 'url(images/Home3Left.jpg)';
	imagesRHS = new Array(3);
	imagesRHS[0] = 'images/Home1Right.jpg';
	imagesRHS[1] = 'images/Home2Right.jpg';
	imagesRHS[2] = 'images/Home3Right.jpg';
	
	var lhs = document.getElementById("homeheadlines");
	var rhs = document.getElementById("flashcontent");
	//alert("Index is " + index);
	
	lhs.style.background = imagesLHS[index];
	rhs.firstChild.src = imagesRHS[index];
	
}

function rotateHeadline()  //Set up the headline question on lhs of the banner
{	
	//debugger;

	var lhs = document.getElementById("changingtext");
	if (typeof lhs == 'undefined') return;
	
	//Set up the array to randomly select a banner
	questionsLHS = new Array(20);
	questionsLHS[0] = '"Can you tell which of your publications have been the most successful?"';
	questionsLHS[1] = '"Can you see which of your publications are meeting gross margin targets?"';
	questionsLHS[2] = '"How easily can you compare annual stock to sale ratios?"';
	questionsLHS[3] = '"Can you tell which of your sales channels are the most productive?"';
	questionsLHS[4] = '"How accurately can you forecast based on previous similar experience?"';
	questionsLHS[5] = '"Are you data rich but information poor?"';
	questionsLHS[6] = '"Could you benefit from automating current manual processes?"';
	questionsLHS[7] = '"How effectively can you analyse sales?"';
	questionsLHS[8] = '"Do you spend too much time calculating royalties?"';
	questionsLHS[9] = '"How integrated is your production workflow?"';
	questionsLHS[10] = '"How frequently do you currently have to duplicate data?"';
	questionsLHS[11] = '"How accurate and timely is your management information?"';
	questionsLHS[12] = '"At what level can you monitor marketing and product expenditure? "';
	questionsLHS[13] = '"Can you generate real business intelligence out of our current systems?"';
	questionsLHS[14] = '"How effectively can you integrate third party data?"';
	questionsLHS[15] = '"Do you have all your sales information in one place?"';
	questionsLHS[16] = '"Can you evaluate the lifetime profitability of your products?"';
	questionsLHS[17] = '"Can you access the information you need, whenever you need it?"';
	questionsLHS[18] = '"Could you improve your budgeting and product costing processes?"';
	questionsLHS[19] = '"Could an integrated business management system save you time and money?"';

	var headlineText = "Are we data rich but information poor?"; //setup a default quote
	
	index = Math.floor(Math.random() * questionsLHS.length);
	
	headlineText = questionsLHS[index];
	//alert("headlineText is " + headlineText + " index is " + index);
	lhs.firstChild.nodeValue = headlineText;
}