Hi,

I am having a small problem;

I have tree images defined as variables in PHP
<?php
// setup variables
$currency = '$';
$products = array();
$prod['desc'] = '(1 shirt)';
$prod['price'] = '19.99';
$prod['quantity'] = '1';
$prod['name'] = '1 Shirt';
$prod['id'] = '268';
$prod['ship_id'] = '12';
$prod['ship_cost'] = '5.99';
$prod['image_name'] = '1shirt';
$prod['image_path_clic'] = 'img/prod/mo_1shirt_clic.jpg';
$prod['image_path_omo'] = 'img/prod/mo_1shirt_omo.jpg';
$prod['image_path'] = 'img/prod/mo_1shirt_norm.jpg';
$prod['image_desc'] = 'Blue Shirt';
$products[] = $prod;

I use this JS to create 3 state mouse events (norm, omo & click):
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--

var base= "img/prod/mo_";
var nrm = new Array();
var omo = new Array();
var ocl = new Array();
var stuff = new Array('1shirt','2shirts','3shirts');
var select = 3;
var name2 = "";
var temp = 0;

// Pre-load part.

if (document.images)
{
for (i=0;i<stuff.length;i++)
{
nrm[i] = new Image;
nrm[i].src = base + stuff[i] + "_norm.jpg"
omo[i] = new Image;
omo[i].src = base + stuff[i] + "_omo.jpg";
ocl[i] = new Image;
ocl[i].src = base + stuff[i] + "_clic.jpg";
}
}

// The functions: first mouseover, then mouseout

function over(no)
{
if (document.images && select != no)
{
document.images[stuff[no]].src = omo[no].src
}
}

function out(no)
{
if (document.images && select != no)
{
document.images[stuff[no]].src = nrm[no].src
}
}

function clic(no)
{
if (document.images)
{
document.images[stuff[no]].src = ocl[no].src
temp = select;
select = no;
if (temp != -1) {out(temp)}
}
}

// -->
</SCRIPT>

and this is in the body:
<?php
$count = 1;
foreach($products as $product) {
?>
<li class="product<?php echo $count; ?><?php if ($count == 1) { echo ' selected'; }?>">
<a href="#"
data-price="<?php echo $product['price'];?>"
data-proddesc="<?php echo $product['desc']; ?>"
data-prodcode="<?php echo $product['id'];?>"
data-shipcost="<?php echo $product['ship_cost'];?>"
data-shipid="<?php echo $product['ship_id'];?>"
data-prodname="<?php echo $product['name'];?>"
data-imagename="<?php echo $product['image_name']; ?>"
data-imagesrc="<?php echo $product['image_path']; ?>"
data-imagemo="<?php echo $product['image_path_omo']; ?>"
data-imagecl="<?php echo $product['image_path_clic']; ?>"


onMouseOver="over(0)"
onMouseOut="out(0)"
onClick="clic(0)";>

<img src="<?php echo $product['image_path']; ?>" name="<?php echo $product['image_name']; ?>" id="<?php echo $product['image_name']; ?>" width="203" height="307" border="0"></a> <br/> <?php echo $product['image_desc']; ?> </li>
<?php
$count++;
} ?>
</ul>

" onMouseOver="over(0)" onMouseOut="out(0)" onClick="clic(0)";>" // How can I pass the variables. If I write it like this: just the first image have effect - and I need all 3 of them.

thanks your help is greatly appreciated.