Rollover effect and wordpress comments (dinamically change the var name)
Hello all, i'm totally new to JS so i've a problem:
I'm trying to develop a plugin for comments: when mouse is over the commenter's name it take a screenshot of his website with a rollover effect.
All works fine if there is just one comment, but none good when the comments are 2 or plus.
Basically i load this JS in the header
Picture_Over = eval(picimage +"On.src")
document[picimage].src = Picture_Over
Picture_Out = eval(picimage +"Off.src")
document[picimage].src = Picture_Out
Then this is the code to turn the screenshot on:
var Img2On = new Image();
Img2On.src = "<?php echo $urlnohttp;?>";
var Img2Off = new Image();
Img2Off.src = "<?php bloginfo('url');?>/wp-content/plugins/[...]/control_play.png";
<a href="<?php echo $commenturl ?>" onMouseOver="MOver('Img2')" onMouseOut = "MOut('Img2')" ><?php echo $author ?> <img src="<?php bloginfo('url');?>/wp-content/plugins/[...]/control_play.png" border="0" name="Img2"></img></a>
I think the problem is that the name of var in MOver() is not unique, but i don't know how to dinamically change the var name.