function kaanna(txt) {
	var rtxt="";
	var i=0;
	for (i=txt.length-1; i>=0; i--) {
		rtxt += txt.charAt(i);
	}
	return rtxt;
}
function osoite() {
	var os="";
	os = location.href;
	var i = os.indexOf("www.");
	if (i>0) {
		var j = os.lastIndexOf("fi/");
		return os.substring(i+4,j+2);
	} else {
		return "???.fi";
	}
}
function splinkki(txt,spos) {
	document.write("<a href=\"");
	var str="melo:";
	document.write(str.replace("el","ailt"));
	document.write(spos + String.fromCharCode(64));
	document.write(osoite());
	document.write("\" title=\"Lähetä sähköpostia\">");
	document.write(txt);
	document.write("</a>")
}


// Popup code for <A HREF="popupbasic.html" onClick="return popup(this, 'notes')">...</A>
var newwindow;
function popup(mylink, windowname) {
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
		href=mylink;
	else
		href=mylink.href;
	newwindow=window.open(href, windowname, 'width=530,height=340,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}



