I am having a terible time trying to get my mouseover event to work in a php page. I dont know how to correct the problem. Here is what I have in my header.php page that is included in a content php page.
<head>
<title>About Us</title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<?php $page=getenv(SCRIPT_NAME); ?>
<?php $nav1off = "../images/nav1_on.gif"; ?>
</head>
<body bgcolor="White" link="#003366" vlink="#003366" alink="#003366" MARGINWIDTH="0" LEFTMARGIN=0 MARGINHEIGHT="0" TOPMARGIN=0 RIGHTMARGIN="0">
<center>
<script language="JavaScript">
function turnOn(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "over.src");
}
}
function turnOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "off.src");
}
}
if (document.images) {
nav1over = new Image();
nav1over.src = "../images/nav1_over.gif";
nav2over = new Image();
nav2over.src = "../images/nav2_over.gif";
nav3over = new Image();
nav3over.src = "../images/nav3_over.gif";
nav4over = new Image();
nav4over.src = "../images/nav4_over.gif";
nav1off = new Image();
nav1off.src = <?php echo $nav1off; ?>;
nav2off = new Image();
nav2off.src = "../images/nav2_off.gif";
nav3off = new Image();
nav3off.src = "../images/nav3_off.gif";
nav4off = new Image();
nav4off.src = "../images/nav4_off.gif";
}
</script>
calling the mouseover event in this code in another php page
<td width="80" height="15" align="center"><a href="index.php" onMouseOver="turnOn('nav1')" onMouseOut="turnOff('nav1')"><img src= <?php echo $nav1off; ?> name="nav1" width="64" height="15" border="0" alt="Home"></a></td>
do I have to do anything to help parse the javascript?
thx in advance,
alex