+1  A: 

Instead of using the name attribute on the <img>, I would start by recommending you use the id attribute, as follows:

<img id="crt" />

Then you can change the src as follows:

document.getElementById('crt').src = 'images/addcrt_btn_dn.png';

Make sure you properly escape all those quotes properly, or work on generating the content another way (here's an example sticking with the name attribute):

...
?>
<a href="catalog.php?buyproduct=<?php=$productNumber?>" onmouseover="document[crt].src='images/addcrt_btn_dn.png'" onmouseout="document[crt].src='images/addcrt_btn.png'">
<img src="images/addcrt_btn.png" name="crt" alt="Add to cart" width="81" height="24">
</a>
<?php
...
Dolph
thank you for your help Dolph, why is the id preferred over name?
Pete Herbert Penito
`name` attributes are not required to be unique, while `id` attributes are required to be unique identifiers on the page. When accessing elements through the DOM using JavaScript, it's obviously more convenient to be able to access a specific object by it's unique `id`. Normally when you want to access an element by `name`, you'll get an array of elements back, even if there is only one element with that given `name`.
Dolph
Pete Herbert Penito
The code you just posted is mixing `id` and `name`. `document[crt]` accesses `crt` by name, but you also changed the `name` attribute to `id`. Instead of `document[crt]`, access the `id="crt"` using `document.getElementById('crt')`.
Dolph
Pete Herbert Penito
thanks for the info man i figured it out!
Pete Herbert Penito
No problem, anytime!
Dolph
just in case anybody is curious, i just used a counter inside the loop (which pulls each product out of the database) and used it on the end of the crt like this: crt$itemCount in the ID and in the link that way it was unique each time it read. :)
Pete Herbert Penito