import java.awt.*;
import java.applet.*;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class turkmenbashi extends Applet {
	int font_size;
	String font_face;
	
	int monthcount;
	int daycount;
	int weekcount;
	String outputstring;
	String[] monthnames = { "Turkmenbashi", "Baidag", "Novruz", "Gurbansoltan Edzhe", "Makhtumkuli", "Oguz", "Gorkut", "Alp Arslan", "Rukhnama", "Garashsyzlyk", "Sandzhar", "Bitaraplyk" };
	String[] weeknames = { "Dynch Gyun", "Bash Gyun", "Yash Gyun", "Khosh Gyun", "Sogap Gyun", "Anna Guyn", "Rukh Gyun" };
public void init() {
	GregorianCalendar mycal = new GregorianCalendar();
	monthcount = mycal.get(Calendar.MONTH);
	daycount = mycal.get(Calendar.DAY_OF_MONTH);
	weekcount = mycal.get(Calendar.DAY_OF_WEEK);
	outputstring = daycount + " " + monthnames[monthcount] + ", " + weeknames[weekcount-1];
	String fontsize = getParameter("fontsize");
	font_size = 12;
	if (fontsize != null)
		font_size = Integer.parseInt(fontsize);
	String fontface = getParameter("font");
	font_face = "Times New Roman";
	if (fontface != null)
		font_face = fontface;
}

public void paint(Graphics screen) {
	setBackground(Color.black);
	Font font = new Font(font_face, Font.PLAIN, font_size);
	FontMetrics fm = screen.getFontMetrics(font);
	screen.setFont(font);
	screen.setColor(Color.white);
	screen.drawString(outputstring, (getSize().width - fm.stringWidth(outputstring)) / 2, ((getSize().height - fm.getHeight()) /2) + fm.getAscent());
}

}
