// JavaScript Document
// Copyright 2006 Ladislav Brychta

function webresize(imgheight) {
  var content = document.getElementById('content');
  var mottos = document.getElementById('mottos');
  if (content && mottos) {
    if (imgheight>content.offsetHeight) {
      content.style.height = imgheight+'px';
    } else {
      content.style.height = 'auto';
    }
    mottos.style.position = 'absolute';
    mottos.style.bottom = '0%';
    if ((content.offsetTop+content.offsetHeight)>(mottos.offsetTop)) {
      mottos.style.position = 'relative';
      mottos.style.top = '0px';
    }
  }
}

function clearallalt() {
  allimages = document.body.getElementsByTagName('img');
  for (var i=0;i<allimages.length;i++) {
    allimages[i].alt = '';
  }
}

function showhint(object,event,show,text) {
  var minihint = document.getElementById('minihint');
  var bow = document.body.offsetWidth;
  if (event.x && event.y) {
    var x = event.x;
    var y = event.y;
  } else {
    var x = event.pageX;
    var y = event.pageY;
  }
  if (minihint) {
    if (show==1) {
      minihint.innerHTML = text;
      minihint.style.display = 'block';
      if (bow<(x+minihint.offsetWidth+10)) {
        minihint.style.left = null;
        minihint.style.right = bow-x+10+'px';
      } else {
        minihint.style.right = null;
        minihint.style.left = x+10+'px';
      }
      minihint.style.top = y+10+'px';
      object.title = '';
    } else {
      minihint.style.display = 'none';
    }
  }
}

