// JavaScript Document

function ajax_approaches(dynamicpage,querystring,htmlid,htmltype)
{ 
if (htmlid != "null")
{
var folderpath="http://"+window.location.host + "/ajax/"
ajax_approaches.el=htmlid;
ajax_approaches.el2=htmltype;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url=folderpath + dynamicpage;
url=url+querystring;
//url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");  
xmlHttp.send(null);
}
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
	switch(ajax_approaches.el2)
	{
		case "innerhtml":
			document.getElementById(ajax_approaches.el).innerHTML=xmlHttp.responseText;
			break;
		case "image":
			document.getElementById(ajax_approaches.el).src = xmlHttp.responseText;
			//document.getElementById("test").innerHTML=xmlHttp.responseText;
			//document.write("not worked")
			break;
		default:
			document.write("not worked")
	}

}
}

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;
}