
window.onload = function() {

	var comment  = document.getElementById("comment");
	var form = document.createElement("form");
	form.setAttribute("action", "http://rc.eeme.li/cgi/comment.cgi");
	form.setAttribute("method", "post");
	comment.appendChild(form);
	var fieldset = document.createElement("fieldset");
	form.appendChild(fieldset);
	form = fieldset;
	var h2 = document.createElement("legend");
	var apu = document.createTextNode("Kommentoi");
	h2.appendChild(apu);
	form.appendChild(h2);

	fieldset = document.createElement("fieldset");
	var legend = document.createElement("legend");
	apu = document.createTextNode("Roskasuojaus");
	legend.appendChild(apu);
	fieldset.appendChild(legend);
	var spam = document.createElement("input");
	spam.setAttribute("name", "spam");
	spam.setAttribute("type", "password");
	var label = document.createElement("label");
	apu = document.createTextNode("Mikä laji on RC Eemelin harrastamien lajien listassa ensimmäisenä? Vinkki: katso sivun lopusta.");
	label.appendChild(apu);
	label.setAttribute("class", "tasa");
	var p = document.createElement("p");
	p.appendChild(spam);
	fieldset.appendChild(label);
	fieldset.appendChild(p);
	form.appendChild(fieldset);

	var url = document.createElement("input");
	url.setAttribute("name", "url");
	url.setAttribute("type", "hidden");
	url.setAttribute("value", document.location.href);
	form.appendChild(url);

	var teksti = document.createElement("textarea");
	teksti.setAttribute("name", "teksti");
	teksti.setAttribute("cols", "40");
	teksti.setAttribute("rows", "8");
	label = document.createElement("label");
	apu = document.createTextNode("Kommentti");
	label.appendChild(apu);
	label.setAttribute("class", "tasa");

	p = document.createElement("p");
	p.appendChild(teksti);
	form.appendChild(label);
	form.appendChild(p);

	var nimi = document.createElement("input");
	nimi.setAttribute("name", "nimi");
	label = document.createElement("label");
	apu = document.createTextNode( "Nimi" );
	label.appendChild(apu);
	label.setAttribute("class", "tasa");
	p = document.createElement("p");
	p.appendChild(nimi);
	form.appendChild(label);
	form.appendChild(p);

	var submit = document.createElement("input");
	submit.setAttribute("type", "submit");
	submit.setAttribute("value", "Kommentoi");
	p = document.createElement("p");
	p.appendChild(submit);
	form.appendChild(p);

}

