Help with onclick and a simple script.

view full story

http://www.daniweb.com – I have a webpage with 2 images, mtastats.png, and mchammer.gif I want dragging mchammer.gif over mtastats.png (which is already an a href link) to execute the click() function in my code. I have it written out, but must be doing something small wrong. The script is at the top of the body, mtastats.png is in the cloud of ahrefs, and mchammer.gif is right below them. Here is my page as of now, any help would be very appreciated. <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>2l2q.net</title> </head> <? include('menu.htm'); ?> <body> <script type="text/javascript"><!-- document.onmouseup = mouseUp; var dragObject    = null; function click(){         dragObject = 1;         } } function mouseUp(){         dragObject = null; } function gateKeeper(){         if(dragObject = 1){                 var password = prompt("?", "");                 if (password) { this.location.href = password + ".htm"; }         } } //--></script> <center> <img src="img/iggysolutions.png" alt="IggySolutions" title="IggySolutions" class="placeholder"><br><br> <a href="http://www.2l2q.net/wiki/"><img src="img/wiki.png" alt="Wiki" title="wiki" class="placeholder"></a><br> <a href="http://www.2l2q.net/iggystats/mta/" onMouseOver="gateKeeper();"><img src="img/mtastats.png" alt="#MTA Stats" title="mta stats" class="placeholder"></a><br> <a href="http://www.2l2q.net/mqdb/"><img src="img/mtaqdb.png" alt="MTA Quote Database" title="mta qdb" class="placeholder"></a><br><br> <a href="http://2l2q.tumblr.com/"><img src="img/tumblr.png" alt="Tumblr" title="tumblr" class="placeholder"></a><br> <a href="http://www.last.fm/user/Iggy248"><img src="img/last.png" alt="Last.fm" title="last.fm" class="placeholder"></a><br> <a href="http://www.youtube.com/user/MediocreChief#g/f"><img src="img/youtube.png" alt="Youtube" title="youtube" class="placeholder"></a> <br><br> <img onclick="click();" src="img/McHammer.gif"><br> <br> <img src="/img/favicon.png" alt="egg" border="0"> </center> </body> </html> (General)