var xmlHttp;
function displayimage(str)
{
if (str.length==0)
  { 
  document.getElementById("selectedimage").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="gallery/displayimage.html";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () 
			{ 
			if (xmlHttp.readyState==4)
			{
			document.getElementById("selectedimage").innerHTML=xmlHttp.responseText;
			displaytitle(str);
			Effect.Fade('selectedimage');
 			Element.hide('selectedimage');
			setTimeout("Effect.toggle('selectedimage','appear')","1000");			
			}
			};
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
			}
function displaytitle(str)
{
if (str.length==0)
  { 
  document.getElementById("selectedtitle").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="gallery/displaytitle.html";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () 
			{ 
			if (xmlHttp.readyState==4)
			{ 
			document.getElementById("selectedtitle").innerHTML=xmlHttp.responseText;
			displaytext(str);
			}
			}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function displaytext(str)
{
if (str.length==0)
  { 
  document.getElementById("selectedtitle").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="gallery/displaytext.html";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () 
			{ 
			if (xmlHttp.readyState==4)
			{ 
			document.getElementById("selectedtext").innerHTML=xmlHttp.responseText;
			}
			}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
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;
}
