/***
  author: shawn driscoll // lispwriter@gmail.com
  date: 12 dec 2005
**/
function show(obj_over,nXpos,nYpos) {
  $path = "./thumbnails/";
  $ext = obj_over.src.substr(obj_over.src.lastIndexOf("."));
  ////
  // create roll-over
  obj_over.src = $path + obj_over.name + "-over" + $ext;
  
  ////
  // figure out the pop-up's x position in the document
  nClient = document.body.clientWidth;
  if(nClient < 820) {
    nFinalX = nXpos;
  }
  else {
    nFinalX = (nClient - 820) / 2 + nXpos;
  }

  ////
  // create the id string
  szId = obj_over.id + "_desc" + obj_over.id.substr(obj_over.id.length-1,1);
  
  ////
  // set position and visibility
  // positions are relative to top left corner of the web browser's document area
  obj_desc = document.getElementById(szId);
  obj_desc.style.position = "absolute";
  obj_desc.style.top = nYpos;
  //obj_desc.style.left = 100;
  //obj_desc.style.left = (window.innerWidth - 820) / 2 + nXpos;
  //obj_desc.style.left = document.body.scrollLeft;
  obj_desc.style.left = nFinalX;
  obj_desc.style.visibility = "visible";
}

function hide(obj_over) {
  $path = "./thumbnails/";
  $ext = obj_over.src.substr(obj_over.src.lastIndexOf("."));
  ////
  // create roll-over
  obj_over.src = $path + obj_over.name + $ext;

  ////
  // first create the id string
  szId = obj_over.id + "_desc" + obj_over.id.substr(obj_over.id.length-1,1);
  ////
  // now make it visible and position it below the object the user's mouse
  // is passing over.
  obj_desc = document.getElementById(szId);
  obj_desc.style.visibility = "hidden";
}

////
// preload
function preloadRollOvers() {
  szpath = "./thumbnails/";
  arnames = new Array();
  arImages = new Array();
  
  ////
  // make an array of the roll-over image names
  j = 0;
  for(i = 0; i < 5; ++i) {
    szid = "thumb" + i;
    obj_img = document.getElementById(szid);
    ////
    // find out if the element has a roll-over
    if(!(obj_img.name == "no")) {
      ////
      // create roll-over image name
      szext = obj_img.src.substr(obj_img.src.lastIndexOf("."));
      arnames[j] = szpath + obj_img.name + "-over" + szext;
      ++j;
    }
  }
  ////
  // load the images
  for(i = 0; i < arnames.length; ++i) {
    arImages[i] = new Image;
    arImages[i].src = arnames[i];
  }
  
}

////
// popup control for the clip links
/*function showmovie(szMovie) {
  
  var szLink = "showmovie.php?movie=" + szMovie;
  
  var szApp = navigator.appName;
  if(szApp.indexOf("Microsoft") != -1) {
    nHeight = 255;
    nLeft = window.screenLeft;
    nTop = window.screenTop;
  }
  else {
    nHeight = 255;
    nLeft = window.screenX;
    nTop = window.screenY;
  }
  
  // figure out where to put it
  var nLeftPosition = nLeft + (document.body.clientWidth / 2) - 160;
  var nTopPosition = nTop + (document.body.clientHeight / 2) - (255 / 2);
  
  var szWindowOptions = "width=320," + 
    "height=" + nHeight + "," + 
    "scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no," + 
    "left=" + nLeftPosition + ",top=" + nTopPosition;
  
  window.open(szLink,"viewer",szWindowOptions);

}*/

////
// sizzle reel description table visibility

function openReelDesc() {
  /*var obj_desc = document.getElementById("reel_desc");
  
  obj_desc.style.visibility = "visible";*/

}

function closeReelDesc() {
  /*var obj_desc = document.getElementById("reel_desc");
  
  obj_desc.style.visibility = "hidden";*/

}

function reel() {
  var result = confirm("you made it!");
}

//document.onMouseMove = reel();