Setting main window position (JS)

I need to know how to set the position of the main parent window in Javascript. I've tried using the usual window.screenx = 0 etc but that just restores the window and then moves up.

Basically my problem is that I have a textbox where a user enters a mark (for example 20/50). If the mark is great than the max (50 in this case) it gives an alert box and then deletes the mark, that part is fine.

But if someone uses tabs to go through forms, then after the alert has taken place the user will still scroll down to the next box for marking. What I'd like to do is to go back to the box which was wrong for changes instead.

So I thought I'd find a way to move the window back up to that box. Here is my code to mark the form:

function checkMark(mark,max)
{
if(mark.value>document.getElementById(max).value)
{
alert("The mark you entered was higher than the maximum mark.");
mark.value="";
mark.focus();
}
}

Remember this is not a sub-window opened using window.open, this is just the web page itself.

Edited: Found out that this only happens in Firefox, IE 7+Opera are ok.
[1214 byte] By [Nibinaear] at [2007-11-20 4:45:16]
# 1 Re: Setting main window position (JS)
To move a window, you can use moveTo() (http://www.w3schools.com/htmldom/met_win_moveto.asp), and to size a window you use resizeTo() (http://www.w3schools.com/htmldom/met_win_resizeto.asp). While you are at it, you might want to look at window objects (http://www.w3schools.com/htmldom/dom_obj_window.asp).
PeejAvery at 2007-11-8 0:41:39 >