var req;
var gID;
function togglePreview() //{{{
{
  document.getElementById('prvStat').innerHTML = "(loading...)";
  processAJAX('toggle.htm', 'prvStat');
} //}}}
function processAJAX(url,id) //{{{
{
  try { req = new XMLHttpRequest(); } catch(e) {
  try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {
  try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {
    alert("AJAX Error. Scripting for ActiveX might be disabled?");
    return;
  } } }
  gID = id;
  req.onreadystatechange = processReqChange;
  req.open("GET", url , true);
  req.send(null);
}
//}}}
function processReqChange() //{{{
{
  if (req.readyState == 4) {
    if (req.status == 200) {
      document.getElementById(gID).innerHTML = req.responseText;
    } else {
      document.getElementById(gID).innerHTML = "There was a problem retrieving the XML data:\n" + req.statusText;
    }
  }
}
//}}}

