var xmlHttp;
var which = 1;
var title;
function imageswitch(abc)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  

	var sendabc = "testinfo2.php?name="+abc;
	xmlHttp.open("GET",sendabc,true);
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.send(null);
	which++;
	
	} 

function stateChanged() 
{ 

var imageinfo = xmlHttp.responseText.split("-");
var amm = imageinfo.length;
var ammx = amm/3 + 1;
if( which == ammx ){ which = 1; }


var amm2 = which*3;
var arr = amm2-1;
var arr2 = amm2-2;
var arr3 = amm2-3;
var image = imageinfo[arr];
var link = imageinfo[arr2];
var  title = imageinfo[arr3];


var linkfull = "<span style=\"color:#000; font: 17px Trebuchet MS; line-height:30px; verticle-align:middle;\"><center><a href=\""+link+"\">"+title+"</a></center></span>";

var linkfull2 = "<center><a href=\""+link+"\"><img src=\""+image+"\"/></a></center>";
if( title != undefined ) {
document.getElementById("ftitle").innerHTML=linkfull;
document.getElementById("fimage").innerHTML=linkfull2;
}

}

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;
}