	var bannerNo = 0;
	var bannerwidth = 958;
	var bannerheight = 218;



		function scrollBanner(){



			if(bannerdirection == "left"){
				bannerLeft+= 30;
			} else {
				bannerLeft-= 30;
			}
			oldvalue = document.getElementById('bannerscroller').scrollLeft;

			document.getElementById('bannerscroller').scrollLeft = bannerLeft;
			if(oldvalue == document.getElementById('bannerscroller').scrollLeft){
				clearInterval(binterval);
				bannerBusy = false;
				holder = document.getElementById('contentLoader');

				if(bannerdirection == "left"){
					holder.removeChild(holder.firstChild);
				} else {
					holder.removeChild(holder.lastChild);
				}

				for(i=0; i < bannerpages.length; i++){
					if(i == bannerNo){
						document.getElementById('indicator_'+i).onmouseover = function(){
							this.src= "/templates/armourinsurance/images/graycircle.png";
						}
						document.getElementById('indicator_'+i).onmouseout = function(){
							this.src= "/templates/armourinsurance/images/opencircle.png";
						}
						document.getElementById('indicator_'+i).src= "/templates/armourinsurance/images/opencircle.png";
						document.getElementById('indicator_'+i).style.height = "11px";
						document.getElementById('indicator_'+i).style.width = "11px";
					} else {
						document.getElementById('indicator_'+i).onmouseover = function(){};
						document.getElementById('indicator_'+i).onmouseout = function(){};
						document.getElementById('indicator_'+i).src= "/templates/armourinsurance/images/closedcircle.png";
						document.getElementById('indicator_'+i).style.height = "11px";
						document.getElementById('indicator_'+i).style.width = "11px";
					}
				} 




				bannerLeft = 0;
				document.getElementById('bannerscroller').scrollLeft = 0;
			}

		}
		function loadBannerContent(page, direction){
			if(bannerBusy == false){

			bannerBusy = true;

			bannerdirection = direction;
			if(bannerdirection == "left"){
				bannerNo++;
			} else {
				bannerNo--;
			}


			if(bannerNo >= bannerpages.length){
				bannerNo = 0;
			}

			if(bannerNo < 0){
				bannerNo = bannerpages.length-1;
			}

			var con = new HTTPSocket(bannerpages[bannerNo]);
			con.onLoad = function(){
				if(this.readyStatus == 4 && this.httpStatus==200){


					holder = document.getElementById('contentLoader');

					newcontent = document.createElement("div");
					newcontent.className = "banner_content";
					newcontent.innerHTML = this.getBody();
					

					if(bannerdirection == "left"){
						holder.appendChild(newcontent);
					} else {
						holder.insertBefore(newcontent, holder.firstChild);
						document.getElementById('bannerscroller').scrollLeft = bannerwidth; 
						bannerLeft = bannerwidth;
					}
					binterval  = setInterval(scrollBanner,10);
				}
			
			}
			con.send();


			}
		}

		var activeMenu = false;
		var menuInterval = false;


		function setBannerIndicators(){
			for(i=0; i < bannerpages.length; i++){
				img = document.createElement("img");
				if(i == 0){
					img.src="/templates/armourinsurance/images/closedcircle.png";
				} else {
					img.src="/templates/armourinsurance/images/opencircle.png";
				}
				img.id = "indicator_"+i;
				img.onclick = function(){
					bannerNo = parseInt(this.id.split('_')[1])-1; // minus one so it loads the next one.
			

					loadBannerContent('','left');

					
				}

				document.getElementById('indicators').appendChild(img);


			}


			var con = new HTTPSocket(bannerpages[0]);

			con.onLoad = function(){
				if(this.readyStatus == 4 && this.httpStatus==200){


					holder = document.getElementById('contentLoader');

					newcontent = document.createElement("div");
					newcontent.className = "banner_content";
					newcontent.innerHTML = this.getBody();
					holder.appendChild(newcontent);
			
				}
			}
			con.send();



		}
