function growIcon(id, amt, direction) {
    document.getElementById(id).style.backgroundPosition = "0px " + amt + "px";
    amt += (2 * direction);



    if (
                            ((direction == -1) && amt >= 0) ||
                            ((direction == 1) && amt < 30)
                        )
        window.setTimeout("growIcon('" + id + "', " + amt + "," + direction + ");", 10);



}

fixActiveIcon= function() {
    if (document.activeIcon) {
	    var el = document.getElementById(document.activeIcon);
	    if (el) {
		    el.style.backgroundPosition = "0px 0px";
	    }
    }
	
}

out = function(id) {    
    var icon = id.toString().replace("link", "icon");
    
    if (document.activeIcon && document.activeIcon == icon) {
	    return;
    }
    
    var el = document.getElementById(icon);

    if (el) {
	var detectedStyle = el.style.backgroundPosition;
	var re = /[0-9]+px ([0-9]+)px/;
	
	
	var amt = "1";
	if (detectedStyle && detectedStyle.length > 0) {
		var array = re.exec(detectedStyle);
		if (array != null) {
			amt = array[1];			
		}
	}
        el.style.backgroundPosition = "0px "+amt+"px";
	
	window.clearTimeout(el.timer);
	
        el.timer = window.setTimeout("growIcon('" + icon + "', "+amt+", 1);", 100);
    }

}

over = function(id) {
    var icon = id.toString().replace("link", "icon");
    var el = document.getElementById(icon);

    if (el) {
	var detectedStyle = el.style.backgroundPosition;
	var re = /[0-9]+px ([0-9]+)px/;
	
	
	var amt = "25";
	if (detectedStyle && detectedStyle.length > 0) {
		var array = re.exec(detectedStyle);
		if (array != null) {
			amt = array[1];			
		}
	}
        el.style.backgroundPosition = "0px "+amt+"px";
	window.clearTimeout(el.timer);
        el.timer = window.setTimeout("growIcon('" + icon + "', "+amt+", -1);", 100);
	
    }

}