Couple of JS problems that make no sense


I am working on a Web site update and in one of the page of this site I need to have couple of JS related things happen. You can see a sample of this page here:
Viewing the Profile of member: dean

So what I need to happen is that when you click on “Send Me a Message” button that the cursor is moved to the TextBox that opens up upon you clicking on this button and that the view is also moved to this TexBox area. I am using these JS codes for these purposes:

function display_hiden (itemopen, itemclose, page_loc) {

	document.getElementById(itemclose).style.display = 'none';
	document.getElementById(itemopen).style.display = 'block';



function MovePage(goto_loc)

	goto_loc = '#' + goto_loc;


However 3 problems:

1- In most browsers the cursor does not move to the TextBox!

2- In most browsers the the cursor is not on the1st pixel position of the TextBox, even after you click on the TextBox, but instead it is like half way in there!
What to do to correct this?

3- When you click on the “Close” button your view is supposed to move to the Top of the Page, but that is not happening!
What to do to correct this?