Well I am officially blind...I have 2 template pages, one for my sites product menus and one for my product pages themselves. I have a common menu bar to both the templates, therefore I just cut the code from one to the other..but the one chooses not to work, if I view the source in the browser, the proper image paths and everything is there, so it is getting the proper values from the db, but for some reason my mouseover just isn't working on my menu template. here are the chunks of code from the 2 pages. the first one has one more menu being displayed, but it to is having the same problems with the mouseover..."the changeState function works and has nothing to do with the problem."
MENU
<?php
$main_query=@mysql_query("SELECT prod_name,link,main_over,main_out,shortdesc,smlimg,status_bar FROM products WHERE prod_cat='$cat_name' ORDER BY prod_name DESC"); //get rid of desc when images cut properly
echo "<div name='layermainmenu' id='layermainmenu' style='left: 382px; top: 97px; width: 180px; height: 235px'>";
echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>";
$x=1;
while($main=mysql_fetch_array($main_query))
{
$prod_name=$main["prod_name"];
$link=$main["link"];
$main_over=$main["main_over"];
$main_out=$main["main_out"];
$status=$main["status_bar"];
?>
<tr><td><a href="<? echo $link ?>" onMouseOver="document.<? echo $prod_name ?>.src='<? echo $main_over ?>';changeState('layerprod<? echo $x ?>desc', 'visible'); changeState('layerprod<? echo $x ?>img', 'visible'); status='<? echo $status ?> !'; return true" onMouseOut="document.<? echo $prod_name ?>.src='<? echo $main_out ?>';changeState('layerprod<? echo $x ?>desc', 'hidden'); changeState('layerprod<? echo $x ?>img', 'hidden'); status=''; return true"><img border=0 name="<? echo $prod_name ?>" src="<? echo $main_out ?>"></a></td></tr>
<?php
$x++;
}
echo "</table>";
echo "</div>";
$div_query=@mysql_query("SELECT prod_name,shortdesc,smlimg FROM products WHERE prod_cat='$cat_name' ORDER BY prod_name DESC");
$y=1;
while($lay=mysql_fetch_array($div_query))
{
$short_desc=$lay["shortdesc"];
$sml_img=$lay["smlimg"];
?>
<div name="layerprod<? echo $y; ?>desc" id="layerprod<? echo $y; ?>desc" style="left: 169px; top: 51px; visibility: hidden"><img border="0" src="<? echo $short_desc; ?>"></div>
<div name="layerprod<? echo $y; ?>img" id="layerprod<? echo $y; ?>img" style="left: 169px; top: 174px; visibility: hidden"><img border="0" src="<? echo $sml_img; ?>"></div>
<?php
$y++;
}
?>
<?php
$menu_query=@mysql_query("SELECT prod_name,link,top_over,top_out,status_bar FROM products WHERE prod_cat='$cat_name' ORDER BY prod_name DESC"); //get rid of desc when images cut properly
echo "<div name='layertopmenu' id='layertopmenu' style='left: 200px; top: 26px'>";
echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>";
echo "<TR>";
$z=1;
while($menu=mysql_fetch_array($menu_query))
{
$prod_name=$menu["prod_name"];
$link=$menu["link"];
$top_over=$menu["top_over"];
$top_out=$menu["top_out"];
$status=$menu["status_bar"];
?>
<td><a href="<? echo $link; ?>" onMouseOver="document.<? echo $prod_name; ?>.src='<? echo $top_over; ?>'; changeState('layerprod<? echo $z; ?>desc', 'visible'); changeState('layerprod<? echo $z; ?>img', 'visible'); status='<? echo $status; ?> !'; return true" onMouseOut="document.<? echo $prod_name; ?>.src='<? echo $top_out; ?>'; changeState('layerprod<? echo $z; ?>desc', 'hidden'); changeState('layerprod<? echo $z; ?>img', 'hidden'); status=''; return true"><img border=0 name="<? echo $prod_name; ?>" src="<? echo $top_out; ?>"></a></td>
<?php
$z++;
}
echo "</tr>";
echo "</table>";
echo "</div>";
?>
PAGE
<?php
$cat_query=@mysql_query("SELECT prod_cat FROM products WHERE prod_name='$prod_name'");
$cat=mysql_fetch_array($cat_query);
$category=$cat["prod_cat"];
$menu_query=@mysql_query("SELECT prod_name,link,top_over,top_out,status_bar FROM products WHERE prod_cat='$category'");
echo "<div name='layertopmenu' id='layertopmenu' style='left: 200px; top: 26px'>";
echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>";
echo "<TR>";
while($menu=mysql_fetch_array($menu_query))
{
$samecat_name=$menu["prod_name"];
$link=$menu["link"];
$top_over=$menu["top_over"];
$top_out=$menu["top_out"];
$status=$menu["status_bar"];
if($samecat_name=="$prod_name")
{ ?>
<td><IMG SRC="<? echo $top_over; ?>" name="<? echo $prod_name; ?>" border="0"></td>
<?php
}
else
{?>
<td><a href="<? echo $link; ?>" onMouseOver="document.<? echo $samecat_name; ?>.src='<? echo $top_over; ?>'; status='<? echo $status; ?> !'; return true" onMouseOut="document.<? echo $samecat_name; ?>.src='<? echo $top_out; ?>'; status=''; return true"><img border=0 name="<? echo $samecat_name; ?>" src="<? echo $top_out; ?>"></a></td>
<?php
}
}
echo "</tr>";
echo "</table>";
echo "</div>";
?>