// JavaScript Document

<!-- OPEN CENTER WINDOW SCRIPT -->

function openCenterWindow(URL,winName,w,h,features) {

  // if screen.dimension is true (available), 
  // then calculate the position using that value, else use a fixed value
  xPos = (screen.width) ? (screen.width-w)/2 : 50;
  yPos = (screen.height) ? (screen.height-h)/2 : 50;
  
  // assemble all window settings from calculations and parameters
  settings = 'height='+h+',width='+w+',top='+yPos+',left='+xPos+','+features
  
  // open the window and bring it to front
  thisWin=window.open(URL,winName,settings);
  thisWin.focus();
}

function hov(loc,cls){
   if(loc.className)
      loc.className=cls;}


<!-- Dynamic Photo Gallery JAVASCRIPT -->

function dyngallery()
{
  var picId='bigDynPic';
  var loadingId='loadingmessage';
  var d=document.getElementById('thumbs');
  if(!d){return;}
  if(!document.getElementById(loadingId))
  {
    var lo=document.createElement('div');
    lo.appendChild(document.createTextNode('Loading image'));
    d.parentNode.insertBefore(lo,d);
    lo.id=loadingId;
    lo.style.display='none';
  }
  var piclinks=d.getElementsByTagName('a');
  for(var i=0;i<piclinks.length;i++)
  {
    piclinks[i].onclick=function()
    {
      document.getElementById(loadingId).style.display='block';
      var oldp=document.getElementById(picId);
      if(oldp)
      {
       oldp.parentNode.removeChild(oldp);
      }
      var nc=document.createElement('div');
      d.parentNode.insertBefore(nc,d);
      nc.style.display='none';
      nc.id=picId;
      var newpic=document.createElement('img');
      newpic.src=this.href;
      newpic.alt=this.getElementsByTagName('img')[0].alt;
      newpic.title='Click to return to images';
      newpic.onload=function()
      {
        document.getElementById(loadingId).style.display='none';
      }
      newpic.onclick=function()
      {
       this.parentNode.parentNode.removeChild(this.parentNode);
      }
      nc.appendChild(newpic);
      np=document.createElement('p');
      np.appendChild(document.createTextNode(this.getElementsByTagName('img')[0].alt))
      nc.appendChild(np);
      nc.style.display='block';
      return false;
    }
  }    
}
/* ******************  MATT! I CHANGED ROM HERE ON ********************** */

window.onload=function()
{
  if(document.getElementById && document.createTextNode)
  {
      dyngallery();

  	}
}


