//-- Set Your Number of changes/divs
var swapCount=4

//-- Set as many of these as you require
var textBlockContent = new Array();

//-- Then Update the values here of what you want it to change to
//-= (Remeber you require as many changes here, as previously set in swapCount)

//-- Change 1
textBlockContent[1] = "<div style='background-image: url(images/home_bg_pink.jpg);' id='containAll'><div id='containAllText'><div style='padding-left: 18px;' id='textBlock'><h1 id='textBlockH1'>We've got all your shopping covered</h1><img src='images/home_line_pink.gif' alt='' name='textBlockLine' id='textBlockLine'><span id='textBlockContent'>With over 30 shops, mall exhibitors and an indoor market we've got shopping for all the family. So visit the only under cover Shopping Centre in the South Lakes today.</span><br><br><a href='link1.html' id='textBlockLink'><!--<img src='images/more_details_pink.gif' alt='Click here for more details' id='textBlockDetails' border='0'>--></a></div></div><div id='containAllLinks'><div><a href='javascript:swapBG(1,1)' id='swimg1'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div><div><a href='javascript:swapBG(2,1)' id='swimg2'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(3,1)' id='swimg3'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(4,1);' id='swimg4'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div></div></div>"

//-- Change 2
textBlockContent[2] = "<div style='background-image: url(images/home_bg_lblue.jpg);' id='containAll'><div id='containAllText'><div style='padding-left: 18px;' id='textBlock'><h1 id='textBlockH1'>All the shops,<br>Just one place</h1><img src='images/home_line_blue.gif' alt='' name='textBlockLine' id='textBlockLine'><span id='textBlockContent'>The multi-storey Car Park is adjacent to the centre and can accommodate over 700 cars. Please note, a pay on exit scheme is in operation.</span><br><br><a href='link2.html' id='textBlockLink'><!--<img src='images/more_details_blue.gif' alt='Click here for more details' id='textBlockDetails' border='0'>--></a></div></div><div id='containAllLinks'><div><a href='javascript:swapBG(1,1)' id='swimg1'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div><div><a href='javascript:swapBG(2,1)' id='swimg2'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(3,1)' id='swimg3'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(4,1);' id='swimg4'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div></div></div>"

//-- Change 3
textBlockContent[3] = "<div style='background-image: url(images/home_bg_yellow.jpg);' id='containAll'><div id='containAllText'><div style='padding-left: 327px;' id='textBlock'><h1 id='textBlockH1'>A day out for<br>all the family</h1><img src='images/home_line_yellow.gif' alt='' name='textBlockLine' id='textBlockLine'><span id='textBlockContent'>Fancy something delicious? At BB's Coffee &amp; Muffins we serve premium ground coffees, unique muffin recipes, oven baked baguettes and much, much more...</span><br><br><a href='link3.html' id='textBlockLink'><!--<img src='images/more_details_yellow.gif' alt='Click here for more details' id='textBlockDetails' border='0'>--></a></div></div><div id='containAllLinks'><div><a href='javascript:swapBG(1,1)' id='swimg1'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div><div><a href='javascript:swapBG(2,1)' id='swimg2'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(3,1)' id='swimg3'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(4,1);' id='swimg4'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div></div></div>"

//-- Change 4
textBlockContent[4] = "<div style='background-image: url(images/home_bg_dblue.jpg);' id='containAll'><div id='containAllText'><div style='padding-left: 327px;' id='textBlock'><h1 id='textBlockH1'>There's so many things to do</h1><img src='images/home_line_db.gif' alt='' name='textBlockLine' id='textBlockLine'><span id='textBlockContent'>The Westmorland Shopping Centre caters for all the family with a dedicated family room.</span><br><br><a href='link4.html' id='textBlockLink'><!--<img src='images/more_details_db.gif' alt='Click here for more details' id='textBlockDetails' border='0'>--></a></div></div><div id='containAllLinks'><div><a href='javascript:swapBG(1,1)' id='swimg1'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div><div><a href='javascript:swapBG(2,1)' id='swimg2'><img src='images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(3,1)' id='swimg3'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='153' border='0' height='54'></a></div><div><a href='javascript:swapBG(4,1);' id='swimg4'><img src='/images/trans.gif' onMouseOver=''this.src='images/home_blue_over.gif''' onMouseOut=''this.src='images/trans.gif''' width='152' border='0' height='54'></a></div></div></div>"


function swapBG(swapTo,swapClicked){
	//-- Update as necessary to coincide with elements required to change
	document.getElementById("tdContain").innerHTML = textBlockContent[swapTo];
	//-- Stop editing
	
	if (swapClicked==1){
		if (swapTo==swapCount){
		window.clearInterval(intval);
		intval=window.setTimeout("swapBG(1,0)",12000);
		}else{
		window.clearInterval(intval);
		intval=window.setTimeout("swapBG("+(swapTo+1)+",0)",12000);
		}
	}else{
		if (swapTo==swapCount){
		window.clearInterval(intval);
		intval=window.setTimeout("swapBG(1,0)",4000);
		}else{
		window.clearInterval(intval);
		intval=window.setTimeout("swapBG("+(swapTo+1)+",0)",4000);
		}
	}
}
function doStuff(){
		window.clearInterval(intval);
		intval=window.setTimeout("swapBG(2,0)",4000);
	}
	intval=window.setInterval('doStuff()',10);
