var XMLHttpRequestObject = false;

if (window.XMLHttpRequest)
	{XMLHttpRequestObject = new XMLHttpRequest();}
else 
if (window.ActiveXObject)
	{XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");}

function loadimage()	{

//load arrays containing images and colors to use
var imagearray = new Array ('Main-graphics-1.jpg', 'Main-graphics-2.jpg', 'Main-graphics-3.jpg', 'Main-graphics-4.jpg')
//var colorarray = new Array ('contactnumber', 'contactnumbergreen', 'contactnumberorange','contactnumbermauve')
var alttagarray = new Array ('We love being your flexible partner', 'We do white-label without the red tape', 'We like fussypants', 'We love challenging briefs')

//get current values from page
var image = document.getElementById('home_image').src;
//curent image name as a value 0,1,2,3
var name = document.getElementById('home_image').name;
//put contact number in obj for manipulation

		//check if initial pass if so just goto timer
		if (name != "99") 	{

		//var divid = document.getElementById(colorarray[name]).id;
		
		//increment name by 1 to get new image	
		name = parseFloat(name) + 1;
		
				//if name is greater than 4 then reset loop
				if (name >3)	{
				name = 0;
				}
		
		//set new value of image
		document.getElementById('home_image').src = 'images/maincontent/' + imagearray[name];
		
		//set new vlaue of image name
		document.getElementById('home_image').name = name;
		document.getElementById('home_image').alt = alttagarray[name];
		//set new value if div id for contact display color
		//document.getElementById(divid).id = colorarray[name];
		
		}
		else
		{
		document.getElementById('home_image').name = "0";	
		}

timer()
}

function timer()	{
	setTimeout(loadimage,3000)
}// JavaScript Document
