function getyScroll()
 {
  yScroll = 0;

  if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX)
   {
    yScroll = window.innerHeight + window.scrollMaxY;
    xScroll = window.innerWidth + window.scrollMaxX;

    var deff = document.documentElement;
    var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;
    var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;

    xScroll -= (window.innerWidth - wff);
    yScroll -= (window.innerHeight - hff);
   } 
  else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth)
   { // all but Explorer Mac
    yScroll = document.body.scrollHeight;
    xScroll = document.body.scrollWidth;
   } 
  else 
   { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
    yScroll = document.body.offsetHeight;
    xScroll = document.body.offsetWidth;
   }

  return yScroll;
 }

function showloginform()
 {
  $('niceloginform').style.display = 'block';
  $('screen').style.display = 'block';
  $('screen').style.height = getyScroll() + 'px'; //window.innerHeight + window.scrollMaxY;
 }

function hideloginform()
 {
  $('niceloginform').style.display = 'none';
  $('screen').style.display = 'none';
 }

function showpicuploadform()
{
   var winScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
   $('picuploadform').style.display = 'block'; 
//   $('picuploadform').style.top = (135+winScroll)+'px';
   $('picuploadform').style.top = '410px';
   $('screen').style.display = 'block';
   $('screen').style.height = getyScroll() + 'px'; //window.innerHeight + window.scrollMaxY;
}

function hidepicuploadform()
 {
  $('picuploadform').style.display = 'none';
  $('screen').style.display = 'none';
 }

window.onresize = function()
 {
  if ($('pagemenuszd')) $('pagemenuszd').style.fontSize = (document.body.clientWidth < 991) ? '9px' : '17px'; //1006-7
  if ($('pagemenuszd2')) $('pagemenuszd2').style.fontSize = (document.body.clientWidth < 991) ? '10px' : '15px'; //1006-7
  if (navigator.appName.indexOf('Internet Explorer') != -1 && navigator.appVersion.substr(0, 1) < 7) { //IE lt 7
   if ($('content'))
    $('content').style.width=( document.body.clientWidth < 900)?'724':'';
  }
 }

window.onresize();
window.onload = window.onresize;

function register(evt)
 {
  if (!evt)
   evt = window.event;

  if (evt.ctrlKey && !disKeyTrap)
   {
    switch(evt.keyCode)
     {
      case 37:
       aelt = $('previous_page');
       if (aelt) location.href = aelt.href;
       break;

      case 39:
       aelt = $('next_page');
       if (aelt) location.href = aelt.href;
       break;
     }
   }
 }

disKeyTrap = false;
document.onkeydown = register;
