// Scripts for Sunrays

// Open a detail window for viewing an image.
function showPicture(number, portrait) {
  scriptName = portrait? "detailportrait.php" : "detail.php";
  height = portrait? 826 : 750;
  options = 'menubar=yes,scrollbars=yes,resizable=yes,width=470,height=' + height;
  //alert(options);
  window.open(scriptName + '?picture=' + number, 'Detail' + number, options);
}

// Ask for a rotated version of an image, depending on how many times the user has
// clicked the rotate button.
var rotation = 0;
function rotateImage(picture) {
  rotation = (rotation + 1) % 4;
  newSrc = "rotate.php?picture=" + picture + "&degrees=" + (rotation * 90);
  //alert(newSrc);
  document.getElementById("pic").src = newSrc;
  newTitle = "Detail, Photograph " + picture;
  if (rotation != 0) {
	newTitle = newTitle + ", Rotated " + (rotation * 90) + " Degrees";
  }
  document.title = newTitle;
}

function goo()
{
  for (var i=0; i < arguments.length; i++)
    document.write(String.fromCharCode(arguments[i]+i));
}
