// Global vars
var spd = 2;		// Slide speed of the menu
var max = 80;		// Top value of tip when minimized (mouseout)
var min = 0;		// Top value of tip when maximized (mouseover)
var tim = null;		// Var user for setTimout function

function slide(obj, dir) {
    var el = document.getElementById(obj);
    clearTimeout(el.tim);
    var t = parseInt(el.style.top);
   	var h = parseInt(el.style.height);
    
    if (dir) {
     // textblock should slide up
     	el.style.display = 'block';
    	if (t > min) {
        	el.style.top = (t-spd)+'px';
            el.style.height = (h+spd)+'px';
            el.tim = setTimeout("slide('"+obj+"', 1)",1);
        } else {
        	el.style.top = min+'px';
            el.style.height = h+'px';
        }
    } else {
      // textblock should slide down
    	if (t<=max) {
        	el.style.top = (t+spd)+'px';
            var tmp_height = (h-spd);
            if(tmp_height < 0){ tmp_height = 0;}
            el.style.height = tmp_height+'px';
            el.tim=setTimeout("slide('"+obj+"')",1);
        } else {
        	// textblock must be gone ;-)
        	el.style.display = 'none';
        	el.style.top = max+'px';
            el.height = 1+'px';
        }
    }
}