var timers = new Array();

function animMouseOver(id, src, pos, anim)
{
    var img = document.getElementById(id);
    if (img && timers[id]) {
	img.setAttribute("src", src+pos+".png");
	if (pos < anim) {
	    pos++;
	    setTimeout("animMouseOver('"+id+"','"+src+"',"+pos+","+anim+")", 75);
	}
	else {
	    timers[id] = null;
	}
    }
}

function mouseOver(img, src, pos, anim)
{
    if (anim) {
	var id = img.getAttribute("id");
	timers[id] = setTimeout("animMouseOver('"+id+"','"+src+"',"+pos+","+anim+")", 1);
    }
    else {
	img.setAttribute("src", src);
    }
}

function mouseDown(img, src)
{
    var id = img.getAttribute("id");
    if (timers[id]) {
	clearTimeout(timers[id]);
	timers[id] = null;
    }
    img.setAttribute("src", src);
}

function mouseUp(img, src, loc)
{
    var id = img.getAttribute("id");
    if (timers[id]) {
	clearTimeout(timers[id]);
	timers[id] = null;
    }
    img.setAttribute("src", src);
    self.location = loc;
}

function mouseOut(img, src)
{
    var id = img.getAttribute("id");
    if (timers[id]) {
	clearTimeout(timers[id]);
	timers[id] = null;
    }
    img.setAttribute("src", src);
}
