

function ShowAjaxTestimonialImage(str1)
{
	document.getElementById("GalleryDetails").style.display = "none";
	document.getElementById("LoadingAnimation").style.display = "block";
	
	//alert(str1);
	
	if (str1.length==0)
	  { 
	  //document.getElementById("IdeaBulb").innerHTML="";
	  document.getElementById("TestimonialDetails").innerHTML="";
	  return;
	  }
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	  
	//alert(iLocation);
	//document.getElementById('IdeaBulb').style.top = '600px';
	//alert(document.getElementById('IdeaBulb').style.top.value);
	
	//var object = document.getElementById("TestimonialDetails");
	//object.style.top = ""+iLocation+"px";
	
	//alert(object.style.top);
	
	var url="/includes/ajax_gallery.asp";
	url=url+"?id="+str1;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedTestimonialImage;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

	// Set textbox for customer service
	var txtUrl = document.getElementById("txtUrl");
	if (txtUrl != null) {
	    // Found the textbox, populate it
	    txtUrl.value = "http://www.photopopart.com/order-style.asp?tid=" + str1;
	}
	
	//alert("boing");
	
	var object = document.getElementById('TestimonialDetails');
	
//	object.style.opacity = 50;
//	object.style.filter = 'alpha(opacity=50)';
	
	//alert(document.getElementById("TestimonialDetails").style.display);
	
	//alert("zoing");
	
	//var object = document.getElementById('ChatTable');
	//object.style.top = "800px";
	
	//go through the iFullIndex array and set the iCurrentIndex to whichever one has this TestimonialID
	var iScan;
	for (iScan in iFullIndex)
	{
		if (iFullIndex[iScan] == str1)
		{
			iCurrentIndex = iScan;	
		}	
	}
	
}

function stateChangedTestimonialImage() 
{ 
	if (xmlHttp.readyState==4)
	{ 
	//var object = document.getElementById("IdeaBulb");
	//object.style.top = "440px";
	//alert("ping");
	
	document.getElementById("TestimonialDetails").innerHTML=xmlHttp.responseText;
	document.getElementById("LoadingAnimation").style.display = "none";
	document.getElementById("GalleryDetails").style.display = "block";
	//document.getElementById('TestimonialDetails').style.opacity=0.4;
	
	}
}

				
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;
}

