<!--

var f = false;

function SwitchImg(img, isOver, isActive)
{
  if ((null == img) || (!img)) {
    return false;
  }

  var name = img.id;
  var new_name;

  if ((null == name) || (!name) || (0 >= name.length)) {
    return false;
  }

  new_name = (PATH + name);
  if (isOver) {
    new_name += SUFFIX_O;
  }
  if (isActive) {
    new_name += SUFFIX_A;
  }
  new_name += EXT;
  
  img.src = new_name;
  
  return true;
}

function PreloadImg()
{
  for (var i = 0; i < IMAGES.length; i++) {
    var tmp = new Image;
    tmp.src = (PATH + IMAGES[i] + SUFFIX_O + EXT);
  }

  return true;
}

function AlignFooter(isOnLoad)
{
  if (f) {
    return true;
  }

  if (document.getElementById) {
    var isFirstHop = false;
    var cnt_height;
    try {
      cnt_height = 0;
      var h_container   = 0;
      var h_picture     = 0;
      var h_contents    = 0;
      var h_contents_np = 0;
      var h_lastpic     = 0;
      if (document.getElementById('Container')) {
        h_container = document.getElementById('Container').offsetHeight;
      }
      if (document.getElementById('Picture')) {
        h_picture = document.getElementById('Picture').offsetHeight;
      }
      if (document.getElementById('Contents')) {
        h_contents = document.getElementById('Contents').offsetHeight;
      }
      if (document.getElementById('ContentsNoPic')) {
        h_contents_np = document.getElementById('ContentsNoPic').offsetHeight;
      }
      cnt_height += Math.max(h_container, Math.max(h_picture, Math.max(h_contents, h_contents_np)));
      if (document.getElementById('LastPic')) {
        h_contents_np = document.getElementById('LastPic').offsetTop +
	 document.getElementById('LastPic').offsetHeight + 30;
        cnt_height += h_contents_np;
      }
      
      cnt_height += document.getElementById('Header').offsetHeight;
      cnt_height += document.getElementById('HeaderBg').offsetHeight;
      cnt_height += document.getElementById('ButtonsBg').offsetHeight;
    }
    catch (e) {
      cnt_height = null;
    }
    var win_height = window.innerHeight ?
     window.innerHeight :
     (document.documentElement && document.documentElement.clientHeight) ?
      document.documentElement.clientHeight :
       null;
    var footer = document.getElementById('Footer');
    if ((!footer) || (!footer.style)) {
      f = false;
      return false;
    }
 
    if (footer.offsetTop && win_height && cnt_height) {
      var url_this    = document.URL ? document.URL : document.location;
      var url_referer = document.referrer;
      if (url_referer && (0 < url_referer.length)) {
        url_this    = url_this.substr(url_this.indexOf('://', 0) + 1);
        url_this    = url_this.toLowerCase();
        url_referer = url_referer.substr(url_referer.indexOf('://', 0) + 1);
        url_referer = url_referer.toLowerCase();
        pos = url_referer.substr(url_referer.indexOf('/', 0));
        if ((-1 == pos) || ((0 < pos) && (url_this.substr(0, pos) == url_referer.substr(0, pos)))) {
          isFirstHop = true;
        }
      } else {
        isFirstHop = true;
      }
      
      if (isOnLoad && isFirstHop) {
        var logo = document.getElementById('Logo');
        if (logo && logo.style && (navigator.appName.toLowerCase() == 'microsoft internet explorer') &&
	  (-1 == navigator.userAgent.indexOf('Opera'))) {
	    logo.style.filter = 'blendTrans(duration=2)';
            logo.style.visibility = 'hidden';
            logo.filters.blendTrans.Apply();
            logo.style.visibility = 'visible';
            logo.filters.blendTrans.Play();
        }
      }
      
      footer.style.position = 'absolute';
      footer.style.top      = '';
      footer.style.bottom   = 0;
      if (cnt_height > win_height) {
        footer.style.bottom = null;
        footer.style.top    = (cnt_height + 'px');
      } else {
        if (isOnLoad && isFirstHop) {
          initSLAnime("Footer", 0, win_height, 0, win_height - footer.offsetHeight, 0);
        }
      }
    }
  } else {
    f = false;
    return false;
  }
  
  f = false;
  return true;
}

function SetHandler()
{
  window.onresize = function() { AlignFooter(false); };
}

// -->


