function changeContent(pageName) {
  var xmlHttp;
  try {
    xmlHttp = new XMLHttpRequest();
  } catch(e) {
    try {
      xmlHttp = new ActiveXObject("Msxml12.XMLHTTP");
    } catch(e) {
      try {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(e) {
        alert("Sorry, your browser does not support this website");
        return false;
      }
    }
  }
  xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4) {
      document.getElementById('contentSection').innerHTML = xmlHttp.responseText;
    }
  }
  pageName += ".php";
  xmlHttp.open("GET",pageName,true);
  xmlHttp.send(null);
}
function createSubMenu(parentTD,subject) {
  document.getElementById(subject+"sub");
}
function show(imageNum) {
  var last = 62;
  imageNum = parseInt(imageNum);
  var next = imageNum+1;
  var prev = imageNum-1;
  if (imageNum == last) {
    document.getElementById('nextlink').innerHTML = "<font color='black'>Next ></font>";
  } else {
    document.getElementById('nextlink').innerHTML = '<a class="medialinks" href="javascript:show(' + next + ');">Next ></a>';
  }
  if (imageNum == 1) {
    document.getElementById('prevlink').innerHTML = "<font color='black'>< Previous</font>";
  } else {
    document.getElementById('prevlink').innerHTML = '<a class="medialinks" href="javascript:show(' + prev + ');">< Previous</a>';
  }
  var stringer = "<img src='gallery/";
  stringer = stringer + imageNum;
  stringer = stringer + ".jpg'>";
  document.getElementById('mediaContent').innerHTML = stringer;
}
function embed(videoLink) {
  document.getElementById('nextlink').innerHTML = "";  
  document.getElementById('prevlink').innerHTML = "";
  var stringer = '<object width="325" height="198"><param name="movie" value="';
  stringer = stringer + videoLink
  stringer = stringer + '"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="';
  stringer = stringer + videoLink
  stringer = stringer + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="325" height="198"></embed></object>';
  document.getElementById('mediaContent').innerHTML = stringer;
}
