window.onload=setfocus;

function setfocus() {
	if (document.editor && document.editor.pagesource)
	{
// This does not work in Firefox 1.5.0.4... (IE6, Opera9 are fine):
		document.editor.pagesource.focus();
// http://www.webdeveloper.com/forum/showthread.php?t=80644 suggests:
//		setTimeout("document.editor.pagesource.focus();",0);
// but that didn't work either.
// Neither does this (again: IE6, Opera9 are fine):
//		var txtarea = document.getElementById('pagesource');
//		txtarea.focus();
//
//AAAAAAAARRRGHHH, OK, I found it: Firefox actually DOES put the 
//caret there, but positions it to END, not HOME. Plus, it fails 
//to actually bring the blinkig caret into the viewport! So if you 
//have a longer text that does not entirely fit the box, you'll just 
//have it off-screen, unnoticed... Man!... (Such a basic thing, 
//not solved for such a long time?! Usability still considered 
//a luxury??...)
	} 
}
