//import java.applet.*;
import java.awt.*;
import javax.swing.*;

public class YesApplet extends JApplet {
	private Thread _thread;

	public void init() {
		String longitude = getParameter("longitude");
		String latitude = getParameter("latitude");
		String edt = getParameter("edt_on");
		String time = getParameter("show_time");
		String markers = getParameter("show_markers");
		String jewels = getParameter("show_jewels");
		String day = getParameter("day");
		String night = getParameter("night");
		String background = getParameter("background");

		YesClock clock = new YesClock();
		getContentPane().setLayout( new BorderLayout() );
		getContentPane().add( clock, BorderLayout.CENTER );
		//clock.setBounds(0,0,getSize().width, getSize().height);
		float lon = Float.valueOf( longitude ).floatValue();
		float lat = Float.valueOf( latitude ).floatValue();
		clock.setLongitude( lon );
		clock.setLatitude( lat );
		if (edt != null) {
			boolean edt_on = Boolean.valueOf(edt).booleanValue();
			clock.setEDT( edt_on );
		}
		if (time!=null && time.equalsIgnoreCase("false")) clock.showDigitalTime( false );
		if (markers!=null && markers.equalsIgnoreCase("false")) clock.showMarkers( false );
		if (jewels!=null && jewels.equalsIgnoreCase("false")) clock.showJewels( false );
		if (day!=null) clock.setDay(Color.decode(day));
		if (night!=null) clock.setNight(Color.decode(night));
		if (background!=null) clock.setBackground(Color.decode(background));
		_thread = new Thread( clock );
	}

	public void start() {
		_thread.start();
	}

	public void stop() {
		_thread.interrupt();
	}
}
