// Reloads the window if Nav4 resized
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// several pages
nextGPM = 'April 1'  // when next gpofmonth is

// Random picture on main.html
function randPic() {
a = '<a style="text-transform:capitalize" href="http://guineapigs.8m.com/gpgallery'
b = '.html">Random&nbsp;Pigture:<br><img src="http://www.guineapigs.8m.com/gpgallery/'
c = '_th.jpg" alt="Random picture from the guinea pig gallery. Click here for a description and larger picture of the cavy/cavies shown." border="0" height="100"><br>'
d = '.html">'
e = '</a><br>'
var whichpic=Math.floor(Math.random()*(pic.length))
if (whichpic==0) {
document.write(a+b+pic[whichpic]+c+pic[whichpic]+"</a>")
}
else {
document.write(a+(whichpic+1)+b+pic[whichpic]+c+pic[whichpic]+"</a>")
}
}

// Prints the last gp added to the gallery
function lastPic() {
a = '<a style="text-transform:capitalize" href="http://guineapigs.8m.com/gpgallery'
b = '.html">'
document.write(pic.length+" pigtures and counting, including our latest edition: ")
document.write(a+(pic.length)+b+(pic[pic.length-1])+'</a>')
}

// Random picture with text, on random.html
function randomPic() {
a = '<img src="http://guineapigs.8m.com/gpgallery/'
b = '.jpg"><br>'
var whichpic=Math.floor(Math.random()*(pic.length))
if (whichpic==0) {
document.write(a+pic[whichpic]+b+text[whichpic])
}
else {
document.write(a+pic[whichpic]+b+text[whichpic])
}
}

// Reloads window on "javascript:reload()"
function reload() {
window.location.reload(true);
}