/*
http://isohunt.com Interface Javascript
by Gary Fung - email: gary{REPLACE_WITH_THE_AT_SIGN}isohunt.com

Feel free to use / mod this to your heart's content,
but keep these lines to acknowledge where this code originated.
Comments, mods or additions you'd like add to this script can be posted here:
http://isohunt.com/forum/viewforum.php?f=1

Tip popup functions adapted from AWStats: http://awstats.sourceforge.net/
*/
var smooth_timer;

function smoothHeight(id, curH, targetH, stepH, mode) {
  diff = targetH - curH;
  if (diff != 0) {
    newH = (diff > 0) ? curH + stepH : curH - stepH;
    ((document.getElementById) ? document.getElementById(id) : eval("document.all['" + id + "']")).style.height = newH + "px";
    if (smooth_timer) window.clearTimeout(smooth_timer);
    smooth_timer = window.setTimeout( "smoothHeight('" + id + "'," + newH + "," + targetH + "," + stepH + ",'" + mode + "')", 16 );
  }
  else if (mode != "o") ((document.getElementById) ? document.getElementById(mode) : eval("document.all['" + mode + "']")).style.display="none";
}

function openiframe(i, href) {
  var trObj = (document.getElementById) ? document.getElementById('iframeRow' + i) : eval("document.all['iframeRow" + i + "']");
  var ifObj = (document.getElementById) ? document.getElementById('iframe' + i) : eval("document.all['iframe" + i + "']");
  if (trObj != null) {
    if (trObj.style.display=="none") {
      ifObj.style.height = "0px";
      trObj.style.display="";
      //if (!ifObj.src) ifObj.src = href;
	  ifObj.src = href;
      smoothHeight('iframe' + i, 0, 336, 42, 'o');
    } else {
	  //ifObj.style.height = "0px";
      //trObj.style.display="none";
      //if (!ifObj.src) ifObj.src = href;
      smoothHeight('iframe' + i, 336, 0, 42, 'iframeRow' + i);
  	  ifObj.src = "";
    }
  }
}
function openPane(i) {
  var trObj = (document.getElementById) ? document.getElementById('trInfo' + i) : eval("document.all['trInfo" + i + "']");
  if (trObj != null) {
    if (trObj.style.display=="none") {
      trObj.style.display="";
    } else {
      trObj.style.display="none";
    }
  }
}