var xmlHttp;
//spotlight();
function showSpotlight(i)
{ 

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)  {
	 alert ("Browser does not support HTTP Request");
	 return;
}

var url="spotlight_processor.php";
url=url+"?index="+i;

a = i;

for (i=1;i<7;i++) {
	var imgpath = document.getElementById('spotlight'+i).getElementsByTagName('img')[0].src;
	rExp = /active_icon.jpg/gi;
	results = imgpath.search(rExp);
	if (results !== -1) {
		folder = imgpath.split("active_icon.jpg")[0];
		active = "icon.jpg";
		document.getElementById('spotlight'+i).getElementsByTagName('img')[0].src = folder+active;
	}
}

var imgpath = document.getElementById('spotlight'+a).getElementsByTagName('img')[0].src;
folder = imgpath.split("icon.jpg")[0];
active = "active_icon.jpg";
document.getElementById('spotlight'+a).getElementsByTagName('img')[0].src = folder+active;

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
// alert(xmlHttp.responseText); 
document.getElementById("focus").innerHTML=xmlHttp.responseText;

 } 
 
 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

function spotlight()
{
  for (i=1;i<7;i++) {
  var img = document.getElementById('spotlight'+i).getElementsByTagName('img')[0];
  var imgpath = img.src;
  rExp = /icon.jpg/gi;
  results = imgpath.search(rExp);
  if (results !== -1) {
	folder = imgpath.split("icon.jpg")[0];
	img[0].onmouseover=function(){this.src=folder+"active_icon.jpg";}
	img[0].onmouseout=function(){this.src=folder+"icon.jpg";}
  }
  }
}