I need help with a 3 frame page where I want the top navigation frame to include a drop down menu. The items on the menu need to be linked to open 2 different frames. My javascript skills are very basic - having always used share scripts in the past. I merged the following two shareware scripts with the following errors resulting. So I am sure I am missing something basic....
The following code produces 2 runtime errors-
"Expected" ';'
'menu 1' is undefined
I would really appreciate if someone could review the following and point out my errors and or suggest another script. Thanks!
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
<script language="JavaScript1.2">
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="javascript:loadFrames('test1.htm','coursedes criptions.htm#24-36','schedulestest.htm#24-36')">Parenting for Tots 24 to 36 Months</a>
<br>'
menu1[1]='<a href=test.htm>Menu link here</a><br>'
menu1[2]='<a href=test.htm>Menu link here</a><br>'
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function loadFrames(page1, page2, page3) {
framecode = "<frameset rows='33%,33%,*'>"
+ "<frame src='" + page1 + "'>"
+ "<frame src='" + page2 + "'>"
+ "<frame src='" + page3 + "'>"
+ "</frameset>";
page = window.open("");
page.document.open();
page.document.write(framecode);
page.document.close();
}
// End -->
</script>
<style>
<!--
.iewrap1{
position:relative;
height:30px;
}
.iewrap2{
position:absolute;
}
#dropmenu0{
visibility:hide;
z-index:100;
}
-->
</style>
</head>
<body>
<table>
<tr>
<td width="634" colspan="5" valign="middle">
<hr width="90%" color="#000099">
</td>
</tr>
<tr>
<td width="634" valign="top" colspan="5">Select Classes by Subject</td>
</tr>
<tr>
<td width="628" colspan="5">
<script language="JavaScript1.2">
//reusable/////////////////////////////
var zindex=100
function dropit2(whichone){
if (window.themenu&&themenu.id!=whichone.id)
themenu.style.visibility="hidden"
themenu=whichone
if (document.all){
themenu.style.left=document.body.scrollLeft+event. clientX-event.offsetX
themenu.style.top=document.body.scrollTop+event.cl ientY-event.offsetY+18
if (themenu.style.visibility=="hidden"){
themenu.style.visibility="visible"
themenu.style.zIndex=zindex++
}
else{
hidemenu()
}
}
}
function dropit(e,whichone){
if (window.themenu&&themenu.id!=eval(whichone).id)
themenu.visibility="hide"
themenu=eval(whichone)
if (themenu.visibility=="hide")
themenu.visibility="show"
else
themenu.visibility="hide"
themenu.zIndex++
themenu.left=e.pageX-e.layerX
themenu.top=e.pageY-e.layerY+19
return false
}
function hidemenu(whichone){
if (window.themenu)
themenu.style.visibility="hidden"
}
function hidemenu2(){
themenu.visibility="hide"
}
if (document.all)
document.body.onclick=hidemenu
//reusable/////////////////////////////
</script>
<!----------Menu 1 starts here---------->
<ilayer height=35px>
<layer visibility=show>
<span class=iewrap2 onClick="dropit2(dropmenu0);event.cancelBubble=tru e;return false"><font face=Verdana><b><a href="alternate.htm" onClick="if(document.layers) return dropit(event, 'document.dropmenu0')">Parents</a></b></font>
</span>
</span>
</layer>
</ilayer>
</td>
</tr>
</table>
<div id=dropmenu0 style="position:absolute;left:0;top:0;layer-background-color:lightyellow;background-color:lightyellow;width:120;visibility:hidden;bord er:2px solid black;padding:0px">
<script language="JavaScript1.2">
if (document.all)
dropmenu0.style.padding="4px"
for (i=0;i<menu1.length;i++)
document.write(menu1[i])
</script>
</div>
</body>
</html>