/*******************************************************************************

File:   application.js
Date:   07/07/2008
Author: Takashi Okamoto.

*******************************************************************************/

////////////////////////////////////////////////////////////////////////////////
// UTILITY METHODS
function showFullImage(image, width, height) {
  var url = 'gallery.php?' + Object.toQueryString({id: image, height: height});
  var features = "left=0,top=0,menubar=no,location=no,resizable=yes,scrollbars=auto,status=no," + 'width=' + width + ',height=' + height;
  window.open(url, 'largeimage', features);
}

function highlightOn(event) {  
  var img = Event.element(event);
  img.setStyle({opacity: '0.5'});
  Event.stop(event);
}

function highlightOff(event) {
  var img = Event.element(event);
  img.setStyle({opacity: '0.99'});
  Event.stop(event);
}

// All image rollovers assume the over image is the source image with -over
// appended in the name.
function initRolloverImage(obj) {
  var over_image = obj.src.substr(0, obj.src.length-4); // get rid of .gif
  over_image += '-over.gif';
  var over_obj = new Image();
  over_obj.src = over_image;
  return over_obj;
}

function initRolloffImage(obj) {
  var off_obj = new Image();
  off_obj.src = obj.src;
  return off_obj;
}

function insertQTMovie(src) {
  document.write('<object id="Wall-E" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=7,3,0,0" width="320" height="196" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">\n');
  document.write('<param value="'+ src +'" name="src" />\n');
  document.write('<param value="true" name="autoplay" />\n');
  document.write('<param value="true" name="saveembedtags" />\n');
  document.write('<param value="transparent" name="wmode" />\n');
  document.write('</object>\n');
}