function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') { window.onload = func; }
    else {
    	window.onload = function() {
			if (oldonload) {
				oldonload();
            	}
			func();
        	}
    	}
	}
	
addLoadEvent(function() {
	
	var myElement = ['ball1','ball2','ball3','ball4','ball5','ball6','ball7']
	
	var myText = [
		["Escendency includes a strategy-building methodology.","Start with your highest-level objective and then break this down into second level ","objectives",", third level objectives and so on.","You can choose to weight relative priorities as you go along, or do this later.","If you already have a strategy, you can quickly map it into the Escendency system or we can do this for you."],
		[" ","You can create any ","indicators"," and targets you want to see improved, tracked and reported on, whatever the frequency or type - even complex equations.","You can assign responsibilities for input, ownership and validation.","You can attach these to the relevant parts of your strategy.","Graphs and tables are available at the click of a button and you can see how the status of your indicators affects the strategic ","objectives"," above them."],
		[" ","You can create, accept, approve, assign and automatically report ","actions"," to bring about improvement."," You can attach actions to anything: ","objectives, people, indicators",", even other actions - and so nest them.","The system will track the status and effects of all of these activities so you will be able to see if they are making things better.","Continuous improvement is integral to the Escendency system."],
		[" ","Assessments"," are conducted against pre-prepared criteria, or automatically graded from checklists. Qualitative results can also be converted to numeric ","Indicators"," that can be rolled-up, with others, to report wider progress."," ","If there is a gap between the results of the assessment and what is desired, then improvement ","Actions"," can be implemented before the next assessment.","Assessments can be useful for HR, student progress, surveys, risk assessments and elsewhere."],
		[" ","People"," are the heart of Escendency.","People are your organisation, your partnership, your community and those you serve.","Escendency is designed to be inexpensive enough for you to include anybody and everybody, as you wish, providing individually relevant information via uniquely configured dashboards."],
		[" ","Responsibilities are assigned to ","posts",", not directly to ","people",". People can hold one or more posts or none at all."," ","Responsibilities could be in the form of ","indicators, objectives, actions",", and so on.","If people move, the responsibilities of the post remain until it is filled or the responsibilities are re-assigned to other posts.","When taking on a post, anyone can see what they are responsible for - encouraging self-management and empowerment."],
		[" ","Escendency's ","SMART mapping"," methodology ensures that your whole ","strategy"," is joined-up, nested and coherent."," ","The system provides automatic online progress ","reporting ","for your vision, mission, hard and soft objectives, indicators, action plans and assessments from across your organisation."," ","There is no software or hardware to buy.","The system is subscription-based, securely hosted and future-proofed."]
		]
	
	var myScreen = ['sc1','sc2','sc3','sc4','sc5','sc6','sc7']
	
	var myHeading = [
		'Objectives',
		'Indicators',
		'Actions',
		'Assessments',
		'People',
		'Posts',
		'Strategy Realisation'
		]
	
	var myBorder = ['c00','bfc43e','090','39c','039','639','036']
	
	var myTextBg = ['fdd','ffd','dfd','dff','ddf','fdf','93ccf4']
	
	var MyComp = {}
	
	var i
	for (i=0;i<myElement.length;i++) {
		MyComp[myElement[i]] = [myElement[i],myText[i],myScreen[i],myHeading[i],myBorder[i],myTextBg[i]]
		var myImg = new Image()
		var ball = i + 1
		myImg.src = "sixball/ball" + ball + ".jpg"
		}

	for (i in MyComp) {
		var MyBall = document.getElementById(i)
		MyBall.desc = MyComp[i];
		MyBall.onclick = start6ball
		MyBall.onmouseover = mouseover;
		}
	
	var buttonQ = new Image()
	buttonQ.src = "sixball/button_q_down.jpg"
	
	var buttonC = new Image()
	buttonC.src = "sixball/button_c_down.jpg"
	
	var buttonV = new Image()
	buttonV.src = "sixball/button_v_down.jpg"
	
	})


function start6ball() {
	if (window.sixball == 1) window.sixball = 0;
	else window.sixball = 1;

	var MyParent = document.getElementById('ballDesc');
	
	var n;
	for (n=1; n<12; n++) {
		var mtPara = document.createElement('p');
		mtPara.appendChild(document.createTextNode(' '));
		mtPara.style.display = 'none';
		MyParent.appendChild(mtPara);
		}
		
	var Allchange = this.desc
	changeBall(Allchange)
	}
	

function mouseover() {
	if (window.sixball == 1) {
		var Allchange = this.desc
		changeBall(Allchange)
		}
	}


function restoreCSS(myPara) {
	var n
	for (n=0;n<myPara.length;n++) {
		myPara[n].style.display = 'block';
		myPara[n].style.color = '#000';
		myPara[n].style.margin = '0.7em 0';
		myPara[n].style.fontSize = '100%';
		myPara[n].style.fontWeight = 'normal';
		myPara[n].style.fontStyle = 'normal';
		myPara[n].style.borderStyle = 'none';
		myPara[n].style.paddingBottom = '0';
		myPara[n].setAttribute('class','');
		}
	
	return myPara;
	
	}

function changeBall(Allchange) {

	var sshot = document.getElementById('sshot_intro')
	sshot.style.display = 'none'

	var n

	var myBackground = document.getElementById('ballpark');
	myBackground.style.background = "url(sixball/" + Allchange[0] + ".jpg) no-repeat top right";

	var mySShot = document.getElementById('sshot').getElementsByTagName('img')[0];
	mySShot.setAttribute('src','sixball/' + Allchange[2] + '.jpg');

	var myHead = document.getElementById('tys').firstChild;
	myHead.nodeValue = Allchange[3];

	var myHeadColour = document.getElementById('tys')
	myHeadColour.style.color = "#" + Allchange[4]

	var myBallDesc = document.getElementById('ballDesc');
	myBallDesc.style.border = "1px solid #" + Allchange[4];
	myBallDesc.style.background = "#" + Allchange[5];
	myBallDesc.style.fontSize = '95%';
	myBallDesc.style.backgroundImage = 'none';
	myBallDesc.style.paddingTop = '0';
	myBallDesc.style.paddingRight = '1em';
	myBallDesc.style.paddingLeft = '1em';
	myBallDesc.style.paddingBottom = '0.5em';
	myBallDesc.style.height = '270px';
	myBallDesc.style.lineHeight = '1.2';
	myBallDesc.style.textAlign = 'left';

	var myPara = document.getElementById('ballDesc').getElementsByTagName('p');
	
	myPara = restoreCSS(myPara);
	
	
	if (Allchange[2] == 'sc1') {
		myPara[1].style.display = 'inline';
		myPara[2].style.display = 'inline';
		myPara[2].style.fontWeight = 'bold';
		myPara[2].style.color = '#c00';
		myPara[3].style.display = 'inline';
		}
	
	else if (Allchange[2] == 'sc2') {
		myPara[1].style.display = 'inline';
		myPara[2].style.display = 'inline';
		myPara[2].style.fontWeight = 'bold';
		myPara[2].style.color = '#993';
		myPara[3].style.display = 'inline';
		myPara[6].style.display = 'inline';
		myPara[7].style.display = 'inline';
		myPara[7].style.fontWeight = 'bold';
		myPara[7].style.color = '#993';
		myPara[8].style.display = 'inline';
		}
			
	else if (Allchange[2] == 'sc3') {
		myPara[1].style.display = 'inline';
		myPara[2].style.display = 'inline';
		myPara[2].style.fontWeight = 'bold';
		myPara[2].style.color = '#090';
		myPara[3].style.display = 'inline';
		myPara[4].style.display = 'inline';
		myPara[5].style.display = 'inline';
		myPara[5].style.fontWeight = 'bold';
		myPara[5].style.color = '#090';
		myPara[6].style.display = 'inline';
		}
		
	else if (Allchange[2] == 'sc4') {
		myPara[1].style.fontWeight = 'bold';
		myPara[1].style.color = '#369';
		myPara[1].style.display = 'inline';
		myPara[2].style.display = 'inline';
		myPara[3].style.fontWeight = 'bold';
		myPara[3].style.color = '#369';
		myPara[3].style.display = 'inline';
		myPara[4].style.display = 'inline';
		myPara[6].style.display = 'inline';
		myPara[7].style.display = 'inline';
		myPara[7].style.fontWeight = 'bold';
		myPara[7].style.color = '#369';
		myPara[8].style.display = 'inline';
		}
		
	else if (Allchange[2] == 'sc5') {
		myPara[1].style.display = 'inline';
		myPara[1].style.fontWeight = 'bold';
		myPara[1].style.color = '#039';
		myPara[2].style.display = 'inline';
		}
		
	else if (Allchange[2] == 'sc6') {
		myPara[1].style.display = 'inline';
		myPara[2].style.display = 'inline';
		myPara[2].style.fontWeight = 'bold';
		myPara[2].style.color = '#639';
		myPara[3].style.display = 'inline';
		myPara[4].style.display = 'inline';
		myPara[4].style.fontWeight = 'bold';
		myPara[4].style.color = '#639';
		myPara[5].style.display = 'inline';
		myPara[7].style.display = 'inline';
		myPara[8].style.display = 'inline';
		myPara[8].style.fontWeight = 'bold';
		myPara[8].style.color = '#639';
		myPara[9].style.display = 'inline';
		}

	else if (Allchange[2] == 'sc7') {
		myPara[1].style.display = 'inline';
		myPara[2].style.display = 'inline';
		myPara[2].style.fontWeight = 'bold';
		myPara[2].style.color = '#000';
		myPara[3].style.display = 'inline';
		myPara[4].style.display = 'inline';
		myPara[4].style.fontWeight = 'bold';
		myPara[4].style.color = '#000';
		myPara[5].style.display = 'inline';
		myPara[7].style.display = 'inline';
		myPara[8].style.display = 'inline';
		myPara[8].style.fontWeight = 'bold';
		myPara[8].style.color = '#000';
		myPara[9].style.display = 'inline';
		}

	for (n=0;n<13;n++) {
		var myBlurb = document.getElementById('ballDesc').getElementsByTagName('p')[n].firstChild;
		if ((myBlurb.nodeValue = Allchange[1][n]));
		else myBlurb.nodeValue = "";
		}
		
	}