function showPhoto()
{
  document.forms[0].lvl.value = 3; // PICTURE
  document.forms[0].submit();
}

function prevPhoto()
{
  document.forms[0].col.value--;
  showPhoto();
}

function morePhoto()
{
  document.forms[0].row.value++;
  showPhoto();
}

function jumpPhoto(c)
{
  document.forms[0].row.value = 0;
  document.forms[0].col.value = c;
  showPhoto();
}

function overPhoto(grp, c)
{
  document.forms[0].row.value = 0;
  document.forms[0].grp.value = grp;
  document.forms[0].col.value = c;
  showPhoto();
}

function pickPhoto(grp, c)
{
  document.forms[0].row.value = -11;
  document.forms[0].grp.value = grp;
  document.forms[0].col.value = c;
  showPhoto();
}

function showSShot(c)
{
  document.forms[0].lvl.value = 4; // SNAPSHOT
  document.forms[0].grp.value = -1;
  document.forms[0].col.value = c;
  document.forms[0].row.value = 0;
  document.forms[0].submit();
}

function nextPhoto()
{
  document.forms[0].col.value++;
  showPhoto();
}

function jumpGall(dll, grp)
{
  document.forms[0].lvl.value = dll;
  document.forms[0].grp.value = grp;
  document.forms[0].col.value = 0;
  document.forms[0].submit();
}

function pickList()
{
  g = document.forms[0].grp.value;
  jumpGall(2, g); // CHAMBER
}

function pickMenu()
{
  jumpGall(1, 0); // GALLERY
}

function pickBiog()
{
  jumpGall(-1, 0); // GALLERY
}

function pickMsge()
{
  jumpGall(-1, -5); // GALLERY
}

function pickStry(s)
{
  jumpGall(-1, -5 - s); // GALLERY
}

function jumpBack()
{
  history.go(-1);
}


function setSize(size)
{
  var cssRules =
    ( ( document.styleSheets[0]['cssRules'] ) ? 'cssRules' : 'rules' );

//  a = '';

  for ( var s = 0; s < document.styleSheets.length; s++ )
  {
//    a += ' s = ' + s;
    for ( var r = 0; r < document.styleSheets[s][cssRules].length; r++ )
    {
//      a += ', ' + r + '=' + document.styleSheets[s][cssRules][r].selectorText;
      b = document.styleSheets[s][cssRules][r]
      if ( b.selectorText == 'td' || b.selectorText == 'TD' )
      {
//        a += ' both classes found. Was ' ;
//        a += document.styleSheets[s][cssRules][r].style['fontSize'];
        b.style['fontSize'] = size + 'px';
//        a += ', now is ' ;
//        a += document.styleSheets[s][cssRules][r].style['fontSize'];
      }
    }
  }
//alert(a);
//  document.getElementById('text').style.fontSize = size + 'px';
  makeCookie('size', size);
}

function makeCookie(name, value, days, hours, domain)
{
  if ( days )
  {
    var date = new Date();
    date.setTime( date.getTime() + (days * 24 * 60 * 60 * 1000) +
      (hours * 60 * 60  *1000));
    var expires = '; expires=' + date.toGMTString();
  }
  else
    var expires = '';

  document.cookie = name + '=' + value + expires + '; path=/' +
    ( ( domain ) ? ';domain=' + domain : '' );
}

function readCookie(name)
{
  if ( document.cookie.length > 0 )
  {
    var nameEQ = name + '=';
    var ca = document.cookie.split(';');
    var i;

    for ( i = 0; i < ca.length; i++ )
    {
      var c = ca[i];
      while ( c.charAt(0) == ' ' )   c = c.substring(1,c.length);
      if ( c.indexOf(nameEQ) == 0 )  return c.substring(nameEQ.length,c.length);
    }
  }
  return null;
}

