function toggle(d) {
  d = document.getElementById(d);
  d.style.display = (d.style.display=="none")?"block":"none";
}

function getContent(str) {
  if (str=="home.html" && (s = (/\?url=([^&]+)/).exec(window.location))) {
    str = s[1];
  }
  if (str == "")
    window.location = "index.html";
  xmlHttp = GetXmlHttpObject();
  if (xmlHttp == null) {
    window.location = "index.html";
    return;
  }
  xmlHttp.onreadystatechange = stateChanged;
  xmlHttp.open("GET",str,true);
  xmlHttp.send(null);
} 

function stateChanged() { 
  if (xmlHttp.readyState == 4) { 
    document.getElementById("main").innerHTML = xmlHttp.responseText;
  }
}

function GetXmlHttpObject() {
  try { // Firefox, Opera 8.0+, Safari
    return new XMLHttpRequest();
  } catch (e) { // Internet Explorer
    try {
      return new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      return new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return null;
}

function swap(to,src) {
  document.images[to].src = "images/1x1.jpg";
  document.images[to].src = src;
}
