//------------------------------------------------------------
// AJAX functions
//
var xmlhttp=false;


/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@else
 xmlhttp=false
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    try {
         xmlhttp = new XMLHttpRequest();
         xmlhttp.overrideMimeType("text/xml");
    } catch (e) {
         xmlhttp=false;
    }
    /* debug.print (xmlhttp); */
}


function async_get(e,id,pagename)
{
     new Ajax.Updater(id, pagename, {method: 'get'});
     return false;
}

// function async_get(e,id,pagename)
// {
//      if (!document.getElementById) return true;

//      Element.show('loading')
//      var element = document.getElementById(id);

//      xmlhttp.open("GET", pagename , true);

//      xmlhttp.onreadystatechange = function()
//           {
//                if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
//                {
//                     element.innerHTML = xmlhttp.responseText;
//                     Element.hide('loading')

//                }
//           }
//      xmlhttp.send(null);
//      return false;
// }

function async_post(e,id)
{
     if (!document.getElementById) return true;
     var form = e.target;
     var eles = form.elements;
     var post = "";
     var elem;
     for (var i=0;i< eles.length; i++)
     {
          elem = eles[i];
          if ((elem.type == 'checkbox' || elem.type == 'radio')
              && !elem.checked)
          {
               continue;
          }
          post += "&" + elem.name + "=" + encodeURIComponent(elem.value);
     }

     ele.style.top = e.pageY - 10;
     ele.style.left = e.pageX - 10;
     document.body.appendChild(ele);
     var element = document.getElementById(id);

     xmlhttp.open("POST", form.action , true);

     xmlhttp.onreadystatechange = function()
          {
               if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
               {
                    element.innerHTML = xmlhttp.responseText;
                    document.body.removeChild(ele, document.body)
               }
          }
     xmlhttp.send(post);
     return false;
}

function highlight(id)
{
     var element = document.getElementById(id);
/*      element.style.backgroundColor = "#dedede"; */
     element.style.backgroundColor = "#f0f0f0";
}

function unhighlight(id)
{
     var element = document.getElementById(id);
     element.style.backgroundColor = null;
}


function select_worker(e)
{
     async_get(e, 'eval', pagename)
}


function toggle_show(id)
{
     var ele = document.getElementById(id);
     current = ele.style.display;
     ele.style.display = (current=='block')?'none':'block';
}

function select(ele)
{
     var nodes = ele.parentNode.childNodes;
     for (i=0;i < nodes.length; i++)
     {
          nodes[i].style.backgroundColor = null;
     }
     ele.style.backgroundColor = "rgb(194, 243, 182)";
}

@@ -81,1336 +81,117 @@
 %0A//%0A
-var xmlhttp=false;%0A%0A%0A/*@cc_on @*/%0A/*@if (@_jscript_version %3E= 5)%0A// JScript gives us Conditional compilation, we can cope with old IE versions.%0A// and security blocked creation of the objects.%0A try %7B%0A  xmlhttp = new ActiveXObject(%22Msxml2.XMLHTTP%22);%0A %7D catch (e) %7B%0A  try %7B%0A   xmlhttp = new ActiveXObject(%22Microsoft.XMLHTTP%22);%0A  %7D catch (E) %7B%0A   xmlhttp = false;%0A  %7D%0A %7D%0A@else%0A xmlhttp=false%0A@end @*/%0Aif (!xmlhttp && typeof XMLHttpRequest!='undefined') %7B%0A    try %7B%0A         xmlhttp = new XMLHttpRequest();%0A         xmlhttp.overrideMimeType(%22text/xml%22);%0A    %7D catch (e) %7B%0A         xmlhttp=false;%0A    %7D%0A    /* debug.print (xmlhttp); */%0A%7D%0A%0A%0Afunction async_get(e,id,pagename)%0A%7B%0A     new Ajax.Updater(id, pagename, %7Bmethod: 'get'%7D);%0A     return false;%0A%7D%0A%0A// function async_get(e,id,pagename)%0A// %7B%0A//      if (!document.getElementById) return true;%0A%0A//      Element.show('loading')%0A//      var element = document.getElementById(id);%0A%0A//      xmlhttp.open(%22GET%22, pagename , true);%0A%0A//      xmlhttp.onreadystatechange = function()%0A//           %7B%0A//                if (xmlhttp.readyState == 4 && xmlhttp.status == 200)%0A//                %7B%0A//                     element.innerHTML = xmlhttp.responseText;%0A//                     Element.hide('loading')%0A%0A//                %7D%0A//           %7D%0A//      xmlhttp.send(null);%0A//      return false;%0A// 
+function async_get(e,id,pagename)%0A%7B%0A     new Ajax.Updater(id, pagename, %7Bmethod: 'get'%7D);%0A     return false;%0A
 %7D%0A%0Af
@@ -1618,39 +1618,17 @@
 r ele = 
-document.getElementById
+$
 (id);%0A  

Clean up code.