/**********************************************************************
        Version: FreeRichTextEditor.com (Free AJAX Version 1.00).
        License: http://creativecommons.org/licenses/by/2.5/
        Description: Example of how to add freeAJAX into a page.
        Author: Copyright (C) 2006  Steven Ewing
**********************************************************************/
function ajaxGET(ajaxMethod, ajaxUrl, ajaxDiv, ajaxOutput, AutoJumlHREF)
{
  function ajaxObject()
  {
    if (document.all && !window.opera)
    {
      obj = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
    {
      obj = new XMLHttpRequest();
    }
  return obj;
  }

var ajaxHttp = ajaxObject();

lsLoading = '<table border=0><tr valign=middle>'
  + '<td>&nbsp;&nbsp;&nbsp;<img border=0 src="images/wait.gif"></td>'
  + '<td><font color=yellow><b><i>Tunggu Sebentar.... &nbsp;&nbsp;&nbsp;</i> </b></font></td>'
  + '</tr></table>';
lsLoading = '<table border=0><tr valign=middle>'
  + '<td>&nbsp;&nbsp;&nbsp;<img border=0 src="images/wait.gif"></td>'
  + '<td><font color=red><b><i>Tunggu Sebentar.... &nbsp;&nbsp;&nbsp;</i> </b></font></td>'
  + '</tr></table>';
//_SetDIV( 'idLoadTime', '');
_SetDIV( 'idStatusBawah', lsLoading);
if (ie){
  _SetDIV( 'idStatusIE', lsLoading);
}
timeStart = new Date();
iKoneksiJelek = 0;

e=document.getElementById(ajaxDiv);
liWarnaAsli = e.style.backgroundColor;
e.style.backgroundColor = "#FFFFee";


document.body.style.cursor = 'wait';
ajaxHttp.open(ajaxMethod, ajaxUrl);
ajaxHttp.onreadystatechange = function()
  {
    if(ajaxHttp.readyState == 4)
    {
      var ajaxResponse = ajaxHttp.responseText;


      timeStop = new Date();
      iLoadTime = timeStop.getTime() - timeStart.getTime();
      sLoadTime =  'Last LoadTime: ' + iLoadTime+'ms  &nbsp;&nbsp; ';
      //_SetDIV( 'idLoadTime', sLoadTime);
      //_SetDIV( 'idStatusBawah', '');
      _SetDIV( 'idStatusBawah', '<font color=black><i>' + sLoadTime + '</i></font>');
      document.body.style.cursor = 'default';
      e.style.backgroundColor    = liWarnaAsli;


      if (ie){
        _SetDIV( 'idStatusIE', '<font color=black><i>' + sLoadTime + '</i></font>');
        }

      if (ajaxOutput == "innerHTML")
      {
        document.getElementById(ajaxDiv).innerHTML = ajaxResponse;
      }
      else if (ajaxOutput == "value")
      {
        document.getElementById(ajaxDiv).value = ajaxResponse;
      }
      if (AutoJumlHREF == 'idMainContent')
        AutoJumlHREF = 'Top';
      location.href = "#" + AutoJumlHREF;
  }
}
ajaxHttp.send(null);}