var areatop = 0;
var areawidth = 464; 
var areaheight = 275 
var scrollamount = 3; 
var scrolldelay = 40; 
var scrollingup = 0; 
var scrollingdown = 0; 
var scrollmode = 0; 
 

function squashcontents()
{
  scrollmode = 1;
  document.getElementById('maindiv').style.position = 'relative';
  document.getElementById('maindiv').style.width = areawidth;
  document.getElementById('maindiv').style.height = areaheight;
  document.getElementById('maindiv').style.overflow = 'hidden';
  document.getElementById('maindiv2').style.position = 'relative';
  document.getElementById('maindiv2').style.top = areatop;
}

function fullsizecontents()
{
  scrollmode = 0;
  areatop = 0;
  document.getElementById('maindiv').style.position = 'relative';
  document.getElementById('maindiv').style.width = areawidth;
  document.getElementById('maindiv').style.height = 'auto'; 
  document.getElementById('maindiv').style.overflow = 'visible'; 
  document.getElementById('maindiv2').style.position = 'relative'; 
  document.getElementById('maindiv2').style.height = 'auto'; 
  document.getElementById('maindiv2').style.top = areatop; 
} 
 
function togglescrollmode() 
{ 
  if (scrollmode == 0) 
  { 
    squashcontents(); 
  } 
  else 
  { 
    fullsizecontents(); 
  } 
} 
 
function scrollareadown() 
{ 
  if (scrollingdown == 1)
  { 
    areatop = areatop - scrollamount; 
    document.getElementById('maindiv2').style.top = areatop; 
    setTimeout('scrollareadown()', scrolldelay); 
  } 
} 
 
function startscrolldown() 
{ 
  if (scrollmode == 1) 
  { 
    scrollingdown = 1; 
    scrollareadown(); 
  } 
} 
 
function stopscrolldown() 
{ 
  scrollingdown = 0; 
} 
 
function scrollareaup() 
{ 
  if (scrollingup == 1)
  { 
    areatop = areatop + scrollamount; 
    if (areatop > 0) 
    { 
       areatop = 0; 
    } 
    document.getElementById('maindiv2').style.top = areatop; 
    setTimeout('scrollareaup()', scrolldelay); 
  } 
} 
 
function startscrollup() 
{ 
  if (scrollmode == 1) 
  { 
    scrollingup = 1; 
    scrollareaup(); 
  } 
} 
 
function stopscrollup() 
{ 
  scrollingup = 0; 
}
