function findDOM(id) {
    return document.getElementById(id);
}

function display(id) {
    findDOM(id).style.display="block";
}

function vanish(id) {
    findDOM(id).style.display="none";
}

function copyToDiv(src, dst) {
//    window.status = ('from ' + dst + ' to ' + src);
    findDOM(dst).innerHTML = findDOM(src).innerHTML;
}

function setPage(mid, index) {
    copyToDiv(mid + "_" + index, mid);
}

function loadIntoDiv(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = findDOM(id);
 if (!element) { // id not found. return.
alert ("no id"); // ***********************
  return;
 }
  if (req) {
    // Synchronous
    // do before
    req.open('GET', url, false);
    req.setRequestHeader( "Content-type", "text/html; charset=ISO-8859-1" );
    req.send(null);
    // do after
    element.innerHTML = req.responseText;
  } else {
alert ("no ajax"); // ***********************
    return; // not ajax enable
  }
}


