var rotation = new Array();

rotation[0] = 'Innovative <a href="http://' + location.hostname + '/web-development.php" title="See what design and development services we offer, AccessKey: w" accesskey="w"><span class="accesskey">w</span>eb development</a> and<br /><a href="http://' + location.hostname + '/marketing.php" title="Learn about Marketing offers, AccessKey: m" accesskey="m"><span class="accesskey">m</span>arketing</a> services';

rotation[1] = 'Let us help your <a href="http://' + location.hostname + '/about-us.php" title="Learn about EduNation as a team and our approach, AccessKey: a" accesskey="a">business</a> grow';

rotation[2] = '<a href="http://' + location.hostname + '/show-me.php" title="See some examples of our work, AccessKey: e" accesskey="e">S<span class="accesskey">e</span>e</a> what we can do for you';

var end = rotation.length;

setTimeout('rotateText(1);', 5000);

function rotateText(num) 
{
	if(num == end)
	{
		num = 0;
	}

	var next = num + 1;

	setTimeout('rotateText(' + next + ');', 5000);

	var fader = new Fx.Style('leftMessage', 'font-size', {duration:800});

	fader.start('28px', 0).chain(
		function()
		{
			$('leftMessage').innerHTML = rotation[num];
		 
			this.start(0, '28px');
		}
	);
	
}

/*
$$('a.target_blank').each(
	function(link)
	{
		link.setProperty('target', '_blank');
	}
);
*/

var ready = 0;

if(document.addEventListener)
{
	document.addEventListener('DOMContentLoaded', 
		function()
		{
			ready = 1; 
			initialise(); 
		}, false);
}
else if(document.all && !window.opera)
{
	document.write('<script type="text/javascript" id="contentloadtag" defer="defer" src="javascript:void(0)"><\/script>');
	var contentloadtag = document.getElementById('contentloadtag');
	
	contentloadtag.onreadystatechange = function()
	{
		if(this.readyState == 'complete')
		{
			ready = 1;
			initialise();
		}
	}
}

window.onload = function()
{
	setTimeout('if(!ready) { initialise(); }', 0);
}


function initialise()
{
	// Make certain links open in a new window
	var target_blank = getElementsByStyleClass('target_blank');
	for(var i = 0; i < target_blank.length; i++)
	{
		target_blank[i].setAttribute('target', '_blank');
	}
}


function getElementsByStyleClass(searchClass)
{
	var all = document.all ? document.all : document.getElementsByTagName('*');

	var elements = new Array();

	for(var i = 0; i < all.length; i++)
	{
		if(all[i].className == searchClass)
		{
			elements[elements.length] = all[i];
		}
	}

	return elements;
}