// Ramdom images for home page
myPix = new Array("i/goho1.jpg","i/goho2.jpg","i/goho3.jpg","i/goho4.jpg","i/goho5.jpg","i/goho6.jpg","i/goho7.jpg","i/goho8.jpg")
imgCt = myPix.length
function choosePic() {
  if (document.images) {
    randomNum = Math.floor ((Math.random() * imgCt))
    document.myPicture.src = myPix[randomNum]
  }
}

function resizeWinToMatchPic(inPicName) {
  thepic=document.images[inPicName];
  if (thepic.width==0) {
    // The page probably hasn't fully loaded yet. Wait a bit and try again...
    window.setTimeout("resizeWinToMatchPic('" + inPicName + "')",1000);
  } else {
    window.resizeTo(thepic.width+10,thepic.height+50);
  }
}

function switchPic(inWhichGallery, inWhichPic) {
  fullFileName='i/' + inWhichGallery + '/' + inWhichGallery + 'Md' + inWhichPic + '.jpg';
  document.images.thepic.src=fullFileName;
}

function sPic(inFullFilename) {
  document.images.thepic.src=inFullFilename;
}

// e.g. openWindow('bigpic.asp','picwin','width=800,height=600');
function openWindow(inURL,inWinName,inOptions) {
  thisWin=window.open(inURL,inWinName,inOptions);
  thisWin.focus();
}

function p(inName) {
  res=document.location.href;
  startPos=res.indexOf(inName + "=");
  if (startPos==-1) {
    res='';
    return;
  }
  startPos+=inName.length + 1;
  res=res.slice(startPos,res.length);
  endPos=res.indexOf('&');
  if (endPos>0) {
    res=res.slice(0,endPos);
  } else {
    res=res.slice(0, res.length);
  }
  return res;
}

function getBigPic(inSrcPic) {
  pic=inSrcPic;
  // Can the Md
  splicePoint=pic.lastIndexOf('/');
  bPic=pic.slice(0,splicePoint)
  pic=pic.slice(splicePoint,pic.length);
  splicePoint=pic.indexOf('Md');
  bPic+=pic.slice(0,splicePoint)
  pic=pic.slice(splicePoint+2,pic.length);
  bPic+=pic;
  return(bPic);
}
