// Logo.java
// Source code by Marshall Brain, brain@iftech.com
// (C) Copyright 1996 by Marshall Brain
// Version 1.0, 3/8/96
// Source described at http://www.iftech.com/classes/webdev/webdev6.htm

import java.io.InputStream;
import java.awt.*;
import java.net.*;

public class Logo extends java.applet.Applet implements Runnable 
    {
    Image img;
    Thread thd = null;
    int i;
    int imgWidth = 359;
    int imgHeight = 121;

    public void run() 
    {
        img = getImage(getCodeBase(), "itilogo2.gif");
	repaint();
        if (img != null) 
        {
            i=imgHeight;
            repaint();
            while (true) 
            {
                try {Thread.sleep(1000);} catch (InterruptedException e){}
                i=0;
                while (i<imgHeight)
                {
                    repaint();
                    try {Thread.sleep(50);} catch (InterruptedException e){}
                    i+=4;
                }
            }
        }
    }
    public void update(Graphics g) 
    {
        if (img != null) 
        {
            g.clipRect(0, 0, imgWidth, i);
            g.drawImage(img, 0, i - imgHeight, null);
        }
    }
    public void start() 
    {
        if (thd == null) 
        {
            thd = new Thread(this);
            thd.start();
        }
    }
    public void stop() 
    {
        thd = null;
    }
}
