Hi,
I wrote a script for menu links. It is in the 'menu' frame of my index.html page, and the links go to the 'body' frame. When I click on a link, the page opens, and the menu page is reloaded, reads the name of the 'body' page so it can change the background of the cell containing the link.

It works perfectly when run on my computer, either with IE or Mozilla (I don't have other browsers to test it). But when I upload it, I got strange things: at first it loads fine, but then when I click on a link, the page is loaded but then sometimes the color of the cell doesn't change, and sometimes all my menu desapears! So you get stuck with the page and have to reload index.html to have the menu back.

Here is the script, in the body (tha'ts all I have in the page):

Code:
<SCRIPT LANGUAGE="Javascript">
	<!-- MENU
	// Get the name of main page
	var cheminpage=parent.window.body.location.href;
	var decoupe=cheminpage.split("/");
	var finale=decoupe[decoupe.length-1];
	var finaledecoupe=finale.split(".");
	var page=finaledecoupe[0];
	// Lignes repetitives
	var ligne = "<TR VALIGN=MIDDLE ALIGN=LEFT><TD COLSPAN=2 HEIGHT=5></TD></TR><TR ALIGN=LEFT VALIGN=MIDDLE height='20'><TD background='images/theme/left.gif' width='10' height='20'></TD>"; 
	var page_chargee = "<TD BGCOLOR='#F3ED86'><A HREF='menu.html' ONCLICK='parent.window.body.location=";
	var page_non_chargee = "<TD BGCOLOR='#DCB810'><A HREF='menu.html' onLoad='menu.html' ONCLICK='parent.window.body.location=";
	//Debut du tableau
	document.write("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=160 VALIGN=MIDDLE ALIGN=LEFT><TR VALIGN=MIDDLE ALIGN=LEFT><TD COLSPAN=2 HEIGHT=100></TD></TR>");
	document.write(ligne); 
		if (page=="accueil") { document.write(page_chargee); }
		else { document.write(page_non_chargee); }
		document.write('"./accueil.html"' + "'> &nbsp; Accueil &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</A></TD></TR>"); 
	document.write(ligne); 
		if (page=="p06") { document.write(page_chargee); }
		else { document.write(page_non_chargee); }
		document.write('"./p06.html"' + "'> &nbsp; Photos juin 2004</A></TD></TR>"); 
	
// other links

	document.write("</TABLE>");
	//-->
	</SCRIPT>
At first I didn't have the onLoad='menu.html' but then on my PC sometimes the color wouldn't change. Now it changes everytimes.

Can somebody tell me why it works locally and not on the net? I'm lost. It took me some time to write this all by myself, now I'd like to be able to use it!

Thanks,
Tedamh