function executeJavascript(s)
{
var start=s.search(/<script/i);
while(start!=-1)
{
var i=start+1;
while(s.charAt(i)!=">") i++
var scriptStart=i+1;
var endS="<\/script>";
var scriptEnd=s.search(endS);
script=s.substring(scriptStart,scriptEnd);
//alert(script);
eval(script);
end=scriptEnd+8;
s=s.substring(0,start)+s.substring(end+1);
var start=s.search(/<script/i);
}
return s;
}



function AjaxLoad(page,destination,user,password,param)
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  
  //destination.innerHTML=""; 
  //destination.style.visibility="hidden";
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
        if (xmlHttp.status!=200) alert('error');
		destination.innerHTML=xmlHttp.responseText;
        //alert('test');
        executeJavascript(xmlHttp.responseText);
        destination.style.visibility="visible"; 
      }
    }
  
  if (param!=null)
  {         
  if ((user!=null) && (password!=null))
  xmlHttp.open("POST",page,true,user,password);
  else
  xmlHttp.open("POST",page,true);
   xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   xmlHttp.setRequestHeader("Content-length", param.length);
   xmlHttp.setRequestHeader("Connection", "close");   
    xmlHttp.send(param);
  }
  else
  {
  if ((user!=null) && (password!=null))
  xmlHttp.open("GET",page,true,user,password);
  else
  xmlHttp.open("GET",page,true);
    xmlHttp.send(null);
  }
  
  }
  


  
  
