// -*- java -*-
// Java Script Common routines for me
//
//    Copyright (C) 2001 hiro <hiro@zob.ne.jp>
//

// preload image and create image object.
function preloadimg(img){
  a = new Image();
  a.src = img;
  return a;
}

// set image object on the document object.
function setimage(self, img)
{
  var src = self.id + "img";
  if (document.getElementById) {
    // DOM-1 ... NN6/Mozilla/Galeon/IE5.x
    document.getElementById(src).src = img;
  } else {
    if (document.all) {
      // IE4
      document.all[src].src = img;
    } else {
      // NN4
      document[src].src = img;
    }
  }
}

// text based clock ... but maybe only works on MSIE
function tick()
{
  var t, m, ih, im, is, today;
  today = new Date();
  ih = today.getHours()
  im = today.getMinutes();
  is = today.getSeconds();

  t = ih + ":";
  if(is % 2){
    t = ih + ".";
  }
  m = im;
  if(im < 10){
    m = "0" + im;
  }
  t = t + m;
  if (document.all) {
    document.all.clock.innerHTML = t;
  }
  window.setTimeout("tick();", 1000);
}

// Jump to URL
function GotoURL(link)
{
  if (link != "") {
    window.location = link;
  }
}
// Image
function loadthumbimg(self, path)
{
    self.fullimg = self.src;
    if (!self.thumbimg) {
	self.thumbimg = preloadimg(path).src;
    }
    self.src = self.thumbimg;
}

function loadfullimg(self, path)
{
    self.thumbimg = self.src;
    if (!self.fullimg) {
	self.fullimg = preloadimg(path).src;
    }
    self.src = self.fullimg;
}


// End Of Javascript
