var cont = "";

var TRhTimer = null;

var RLines = 14;           //  right lines
var RPhei = 107;            // right picture height + 2*border width + margin-top + margin-bottom
var RViewHei = 425;         // right viewable area height
var actuellRMarginTop = 0;  //  right margin-top at start and actual position
var thumbholderRHei = RPhei * RLines;   // height of right thumbholder
var RTopMarginBorder = 0;   //  right top border
var RBotMarginBorder = 0 - thumbholderRHei + RViewHei;   //  right bottom border

var TlhTimer = null;
var LLines = 30;           //  left lines
var LPhei = 107;            // left picture height + 2*border width + margin-top + margin-bottom
var LViewHei = 425;         // left viewable area height
var actuellLMarginTop = 0;  //  left margin-top at start and actual position
var thumbholderLHei = LPhei * LLines;   // height of left thumbholder
var LTopMarginBorder = 0;   //  left top border
var LBotMarginBorder = 0 - thumbholderLHei + LViewHei;   //  left bottom border

var ppL = 7;                //  pics per line
var sta = 1                 //  number of first pic
var picUrlFoNa = "http://owlinfo.ow.funpic.de/MAG/sq/th/";


function fillLpics()
{
  var pico = sta-1;         // local picture counter

// set the real height of left <div id="in_lltgpb">
  if(document.getElementById('in_lltgpb')) { document.getElementById('in_lltgpb').style.height=thumbholderLHei+ 'px'; }

  cont = "";
// write the pictures
  for(var ii=1; ii<=LLines; ii++)
  {
    for(var jj=1; jj<=ppL; jj++)
    {
      pico++;
      cont += '<a href="' +lili[pico][1]+ '" onclick="window.open(\'' +lili[pico][0]+ '\',\'_blank\'); return false;" title="' +lili[pico][1]+ '">';
      cont += '<img class="lepi" alt="Picture ' +pico+ '" src="' +picUrlFoNa+pico+ '.jpg" /></a>';
    }
  }
}
function wrLpics()
{
  fillLpics();
  document.write(cont);
  cont="";
}
function reWrLpics()
{
  fillLpics();
  display('in_lltgpb');
}
function display(whLoc)
{
  if(document.getElementById(whLoc)) { document.getElementById(whLoc).innerHTML = cont; }
  cont="";
}
function clearLpics()
{
  if(document.getElementById('in_lltgpb')) { document.getElementById('in_lltgpb').innerHTML = ""; }
}

function wrRpics()
{
// set the real height of <div id="in_lrtgpb">
  if(document.getElementById('in_lrtgpb')) { document.getElementById('in_lrtgpb').style.height=thumbholderRHei+ 'px'; }
// write the pictures
  for(var ii=1; ii<=RLines; ii++)
  {
    if(ii%2==1) { document.write('<img class="ripi" alt="Picture ' +ii+ '" src="ri/ri1.jpg" title="More galleries soon" />'); }
    else { document.write('<img class="ripi" alt="Picture ' +ii+ '" src="ri/ri2.jpg" title="More galleries soon" />'); }

//    if(ii%2==1) { document.write('<a href="javascript:reWrLpics();"><img class="ripi" alt="Picture ' +ii+ '" src="ri/ri1.jpg" /></a>'); }
//    else { document.write('<a href="javascript:clearLpics();"><img class="ripi" alt="Picture ' +ii+ '" src="ri/ri2.jpg" /></a>'); }
  }
}




function uLup()
{
  scrollLThumbs(thumbholderLHei);
}
function dLdown()
{
  scrollLThumbs(0-thumbholderLHei);
}
function fastLDown()
{
  var srl = 0-LPhei;
  TLhTimer = window.setInterval('scrollLThumbs(' +srl+ ')',50);
}
function fastLUp()
{
  var srl = LPhei;
  TLhTimer = window.setInterval('scrollLThumbs(' +srl+ ')',50);
}
function slowLDown()
{
  var srl = -4;
  TLhTimer = window.setInterval('scrollLThumbs(' +srl+ ')',50);
}
function slowLUp()
{
  var srl = 4;
  TLhTimer = window.setInterval('scrollLThumbs(' +srl+ ')',50);
}

function scrollLThumbs(amo)
{
  actuellLMarginTop += amo
  if(actuellLMarginTop > LTopMarginBorder) { actuellLMarginTop = LTopMarginBorder; }
  if(actuellLMarginTop < LBotMarginBorder) { actuellLMarginTop = LBotMarginBorder; }
  if(document.getElementById('in_lltgpb')) { document.getElementById('in_lltgpb').style.marginTop = actuellLMarginTop + 'px'; }
}
function stopLTimer()
{
  window.clearInterval(TLhTimer);
  TLhTimer = null;
}













function uRup()
{
  scrollRThumbs(thumbholderRHei);
}
function dRdown()
{
  scrollRThumbs(0-thumbholderRHei);
}
function fastRDown()
{
  var srl = 0-RPhei;
  TRhTimer = window.setInterval('scrollRThumbs(' +srl+ ')',50);
}
function fastRUp()
{
  var srl = RPhei;
  TRhTimer = window.setInterval('scrollRThumbs(' +srl+ ')',50);
}
function slowRDown()
{
  var srl = -4;
  TRhTimer = window.setInterval('scrollRThumbs(' +srl+ ')',50);
}
function slowRUp()
{
  var srl = 4;
  TRhTimer = window.setInterval('scrollRThumbs(' +srl+ ')',50);
}

function scrollRThumbs(amo)
{
  actuellRMarginTop += amo
  if(actuellRMarginTop > RTopMarginBorder) { actuellRMarginTop = RTopMarginBorder; }
  if(actuellRMarginTop < RBotMarginBorder) { actuellRMarginTop = RBotMarginBorder; }
  if(document.getElementById('in_lrtgpb')) { document.getElementById('in_lrtgpb').style.marginTop = actuellRMarginTop + 'px'; }
}
function stopRTimer()
{
  window.clearInterval(TRhTimer);
  TRhTimer = null;
}



