var xmlHttp

function showExample(str)
{ 
	var img="img"+str;
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="work/show_example.php";
	url=url+"?q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	
	var img_src=window.document.getElementById(img).src;
	if (Right(img_src,5)=='+.png')
	{
		window.document.getElementById('imgVBA').src='img/+.png';
		window.document.getElementById('imgPHP').src='img/+.png';
		window.document.getElementById('imgPHP-MySQL').src='img/+.png';
		window.document.getElementById(img).src='img/-.png';
	}
	
}


function stateChanged() 
{ 
	div_id="expanded_links"
	document.getElementById(div_id).innerHTML="<p><i>Loading examples...</i>" 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById(div_id).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 Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}