
  function setTopM(divID, ypos) {
   dref = getRef(divID), noPx = document.childNodes ? 'px' : 0;
   if( !dref ) { return; }
   if( dref.style ) { dref = dref.style; }
   dref.marginTop = ypos + noPx;
  }

  function setLeftM(divID, xpos) {
   dref = getRef(divID), noPx = document.childNodes ? 'px' : 0;
   if( !dref ) { return; }
   if( dref.style ) { dref = dref.style; }
   dref.marginLeft = xpos + noPx;
}

  function MagMove(x,y, x2, y2) {
	dref = getRef('mag');

	mx = x + 22;
	my = y - 10;
	if (my < 5) my = 5;

	setLeft('mag', mx);
	setTop('mag', my);
	setLeftM('magimg', -2*x2);
	setTopM('magimg', -2*y2);
  }

  function MagHandler(e) {
     if (magnifying) {
	Xpos = MI_NN?e.pageX:event.x + document.body.scrollLeft;
	Ypos = MI_NN?e.pageY:event.y + document.body.scrollTop;
	Xpos2 = MI_NN?e.pageX-findPos(e.target)[0]:event.offsetX;
	Ypos2 = MI_NN?e.pageY-findPos(e.target)[1]:event.offsetY;
	MagMove(Xpos, Ypos, Xpos2, Ypos2);
     }
  }

  function startmag() {
    getRef('comic-img').onmousemove = MagHandler;
    getRef('magimg').src = '<cms$img index="3" urlonly="true" />';
    ShowHide('comic-nav-left','hide');
    ShowHide('mag','show');
  }

  function magloaded() {
       magnifying = true;
       getRef('magload').innerHTML = 'Move mouse over image to zoom.';
  }
  
  
function CommentsSize(width, height) {
  var r = getRef('commentsframe').style;
  r.height = height;
  r.marginTop = 100-height;
  getRef('comments-08').style.height = height - 46;
  getRef('comments-09').style.height = height - 46;
  getRef('comments-12').style.height = height - 66;  
  getRef('comments-14').style.top = height - 25;
  getRef('comments-15').style.top = height - 20;
  getRef('comments-16').style.top = height - 20;
  getRef('comments-ta').style.height = Math.max(height - 150, 50);
  for (i=1; i<5; i++)
    getRef('comments-text' + i).style.height = height - 38;
  commentsh = height;
  commentsw = width;
}
  

  
  function growtick(growby) {
     if(clockID) {
        clearTimeout(clockID);
        clockID  = 0;
     }
     
     t++;
     CommentsSize(commentsw, commentsh + growby);
     
     if (t < 10) setTimeout("growtick("+growby+")", 100); else {
        t = 0;
     }
  }  
  
  function CommentsToggle() {
    if (comments_enlarged) {
        CommentsSize(commentsw, 130);
        setImage('comments-06','images/expand.png');
        comments_enlarged = false;
    } else {
        growtick(40);
        comments_enlarged = true;
        setImage('comments-06','images/shrink.png');
    }
  }
