Simple JavaScript function help

Tired of trying to figure this out. I have a flash menu. All I want to do is if the “Home” link is pressed it only loads homepage (let’s say “index.html”) if user is not already at index.html. My js is lame :(.

<script language="JavaScript">
	function homePage() {
		var url = "index.html";
		if (document.location.href == url) {
			window.location.href = 'index.html';
		}
	}
			
</script>

Yeah, I have this on the btn in the flash file:

on (press) {
	getURL("javascript:homePage()");
}