// AJAX call to spotlight-ajax-page.aspx to change spotlight onclick

function swapSpot() {
	var as = $('spotList').getElementsByTagName("a");
	for (var i=0; i<as.length; i++) {
		as[i].onclick = function() {
			createXMLHttpRequest();
			xmlHttp.onreadystatechange = function() {
				if (xmlHttp.readyState == 1) {
					$('feature').getElementsByTagName("h3")[0].style.color = "white";
					$('feature').getElementsByTagName("h3")[0].innerHTML = "Loading.....";
					getElementsByClass("inner",$('feature'),"div")[0].innerHTML = "<img style='border:0;padding:0' src='/assets/uploads/images/homepage/spotlight/spotimgs/loader.gif' alt='' />Loading.....";
				}
				if (xmlHttp.readyState == 4) {
					if (xmlHttp.status == 200) {
						$('feature').innerHTML = xmlHttp.responseText;
					}
				}
			}			
			var temp = this.getAttribute("title");
			temp = temp.substr(7,1);
			xmlHttp.open("GET","/spotlight-ajax-page.aspx?show=" + temp,true);
			xmlHttp.send(null);			
			changeClass(getElementsByClass("active")[0],"active","remove");
			changeClass(this.parentNode,"active","add");
			return false;
		}
	}
}
addLoadEvent(swapSpot);