function mail(name,server,domain,title)
{
  if(title=="")
    document.write('<a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#x3a;'+name+'&#x40;'+server+'&#x2e;'+domain+'">'+name+'&#x40;'+server+'&#x2e;'+domain+'</a>');
  else
    document.write('<a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#x3a;'+name+'&#x40;'+server+'&#x2e;'+domain+'">'+title+'</a>');
}

function mailer(name,server,domain)
{
    document.write(''+name+'&#x40;'+server+'&#x2e;'+domain+'');
}

function calculate(notice1,notice2,variable)
{
  var w = reference(variable+'height');
  var x = reference(variable+'width');
  var y = reference(variable+'orgheight');
  var z = reference(variable+'orgwidth');
  var i = 0, j = 0, xheight = 0, xwidth = 0;
  if(w.value != "") { i += 1; j = 1; }
  if(x.value != "") { i += 1; j = 2; }
  if(i == 0)
  {
    alert(notice1);
    return;
  }
  if(i > 1)
  {
    alert(notice2);
    return;
  }
  if(j == 1)
  {
    height = eval(w.value);
    width = height * (z.value / y.value);
  }
  if(j == 2)
  {
    width = eval(x.value);
    height = width * (y.value / z.value);
  }
  w.value = Math.round(height);
  x.value = Math.round(width);
}

function empty(variable)
{
  var a = reference(variable+'height');
  var b = reference(variable+'width');
  a.value = '';
  b.value = '';
}

function reference(element)
{
  return  document.getElementById(element);
}

function image(picture,width,height) 
{
window.open('/phil/ikk/ik/files/Image/'+picture,'','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width='+width+',height='+height+',top=0,left=0');
}

function gallery(path,images,format,shot)
{
  var i = 0;
  var loaded = {};
  var images = images;
  var format = format;
  var path = path;
  var length = images.length;
  for (i; i < length; i ++) {
    loaded[i] = new Image();
    loaded[i].src = path + images[i] + format;
  }
  var shot = document.getElementById(shot);
  var width = Math.floor(shot.offsetWidth / length);
  shot.onmousemove = function(e){
    var x = (!e) ? event.clientX + document.body.scrollLeft : e.pageX;
    function osp(f) {
      return (f.offsetParent) ? f.offsetLeft+osp(f.offsetParent) : f.offsetLeft;
    }
   var pos = Math.floor((x - osp(shot)) / width);
    shot.src = path + images[pos < length ? pos : length - 1] + format;
  }
  shot.onmouseout = function(e){
    shot.src = path + images[0] + format;
  }
}

