function showHide(id,minx,miny,maxx,maxy,tim){
    this.id=document.getElementById(id);
    this.minx=minx;
    this.miny=miny;
    this.maxx=maxx;
    this.maxy=maxy;
    this.x=minx;
    this.y=miny;

    var ref = this;

    function showHideStep(){
        if (ref.dir=='up'){
            if (ref.x>ref.minx) ref.x=ref.x-1;
            if (ref.y>ref.miny) ref.y=ref.y-1;
            ref.id.style.top=" " + ref.x + "px"
            ref.id.style.left=" " + ref.y + "px";
            if ((ref.x>ref.minx) || (ref.y>ref.miny)){
                window.setTimeout(showHideStep,tim);
            }
        }else{
			ref.id.style.visibility = "visible";
            if (ref.x<ref.maxx) ref.x=ref.x+1;
            if (ref.y<ref.maxy) ref.y=ref.y+1;
            ref.id.style.top=" " + ref.x + "px"
            ref.id.style.left=" " + ref.y + "px";
            if ((ref.x<ref.maxx) || (ref.y<ref.maxy)){
                window.setTimeout(showHideStep,tim);
            }
        }
    }

    this.startUp = function(time){
        ref.dir='up';
        window.setTimeout(showHideStep,time);
    }

    this.startDown = function(){
        ref.dir='down';
        showHideStep();
    }

}
