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 displayContent() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("rollover_content").innerHTML=xmlHttp.responseText;
	}
}

function getCategoryContent(id){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
  	{
  		//Default content
		var HTML = "<img src=\"../images/walking_to_school.jpg\" hspace=\"1\" align=\"right\" />" +
			"<span class=\"mainBody\" >" +
			"Even while you attend college you can still benefit from CollegeWishingWell.com." +
			"</span><br />";
		
		
		document.getElementById("rollover_content").innerHTML= HTML;
  	} 
	var url="functions/front_rollover_ajax.php";
	url=url+"?id="+id;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=displayContent;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}
//////////////////////////////////////////////////////////////
var intval="";
var myIndex = 0;
function roll_over(id){
	//stop timer
	stop_show();
	//get new content
	getCategoryContent(id);
}

function roll_out(id){
	//start timer
	myIndex = id;
	start_show();
}

function auto_content(){
	myIndex++;
	if(myIndex == 0){myIndex=1;}
	if(myIndex == 6){myIndex=1;}
	getCategoryContent(myIndex);
}

function first_show(){
	auto_content();
}

function start_show(){
	intval = window.setInterval('auto_content()',14000);
}

function stop_show(){
	if(intval != ""){
		window.clearInterval(intval);
		intval = "";
	}
}