function execAjax(div, url, w, h, postdata, type, div2)
{
   var xmlHttp;
   var mnr;
   if (type == null) { type = 1; }
   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;
         }
      }
   }

   if (w != null && h != null) {
      w = (w - 45) / 2;
      h = (h - 45) / 2;
      mnr = true;
   } else {
      mnr = false;
   }

   xmlHttp.onreadystatechange=function()
   {
      if(xmlHttp.readyState==1) {
         if (mnr) { document.getElementById(div).innerHTML = '<div style="position: absolute; margin: ' + h + 'px ' + w + 'px; width: 45px; height: 45px;"><img src="images/minira.gif" width="45" height="45" /></div>'; }
      }
      if(xmlHttp.readyState==4)
      {
         resp = xmlHttp.responseText;

         if (type == 1) { document.getElementById(div).innerHTML = resp; }
         if (type == 2) { document.getElementById(div).value = resp; if (document.getElementById(div2).checked) { document.getElementById(div).disabled = false; } else { document.getElementById(div).disabled = true; } }
         if (type == 3) { dfupdate(div, resp); }
         if (type == 4) { layupdate(div, resp); }
         if (type == 5) { comboupdate(div, resp); }
      }
   }
   if (postdata != null) {
      xmlHttp.open("POST", url, true);
      xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
      xmlHttp.send(postdata);
   } else {
      xmlHttp.open("GET", url, true);
      xmlHttp.send(null);
   }
}


