
var window_h = window.screen.height;
var window_w = window.screen.width;
var client_h = 1000;
var client_w = 1000;
var mac1024_ch = 817;

function iran(i) { return 1+Math.floor(Math.random(1)*i); }

function getClientHeight() {
  if ( document.body != null ) {
    client_h = document.body.clientHeight;
    client_w = document.body.clientHeight;
    if ( client_h > mac1024_ch ) client_h = mac1024_ch;
  }
}

function getStringTo(s, p) { return s.substring(0, s.indexOf(p)); }
function getStringFrom(s, p) { return s.substring(s.indexOf(p)+1,999); }

function z(x) { getClientHeight(); return Math.floor(x*client_h/mac1024_ch); }

function sound(url) { getObject("sound").innerHTML="<embed src='"+url+"' hidden=true autostart=true loop=false>"; }

function getObject(id) { return document.getElementById(id); }

function show(id) { getObject(id).style.visibility = "visible"; }
function hide(id) { getObject(id).style.visibility = "hidden"; }
function set_src(id, src) { getObject(id).src = src; }
function set_left(id, i) { getObject(id).style.left = i; }
function set_top(id, i) { getObject(id).style.top = i; }
function set_width(id, i) { getObject(id).style.width = i; }
function set_height(id, i) { getObject(id).style.height = i; }

function set_html(id, src) { getObject(id).innerHTML = src; }

var images = 0;
var image = new Array(1000);
function loadImage(img) {
  images++;
  image[images] = new Image();
  image[images].src = img;
}

var over = "onmouseover='mouseover(this)' onmouseout='mouseout(this)'";

function mouseover(img) { 
  src = img.src; 
  img.src = getStringTo(src,".")+"0."+getStringFrom(src,".");
}
function mouseout(img) { 
  src = img.src; 
  if ( src.indexOf("0.") > -1 )
    img.src = getStringTo(src,"0.")+"."+getStringFrom(src,".");
}

function dummy() { }

function wait(t) {
  window.setTimeout(dummy(),t); 
}




