var xmlhttp;

function noCache(uri){return uri.concat(/\?/.test(uri)?"&":"?","noCache=",(new Date).getTime(),".",Math.random()*1234567)};

function loadXMLDoc(url)
{
xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for Firefox, Opera, IE7, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change;
  xmlhttp.open("GET",noCache(url+".html"),true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }
}

function state_Change()
{
if (xmlhttp.readyState==4)
  {// 4 = "loaded"
  if (xmlhttp.status==200)
    {// 200 = "OK"
	document.getElementById('content').innerHTML=xmlhttp.responseText;
	if (window.location.hash == "#photos") {  }
    }
  else
    {
    loadXMLDoc('notfound');
    }
  }
}

function LoadFromHash() {
  var pagehash = window.location.hash;
  if (pagehash == "") { loadXMLDoc('main'); }
  else { loadXMLDoc(pagehash.substring(1)); }
}

function showImage(obj) {
  alert(obj.src.substring(obj.src.lastIndexOf('/')+1));
}
