How do I add links to images in this javascript?
<p>I need help please. How do I add links to images in the code below. This is a script that allows visitors to click a choice on a dropdown menu in a form, and every choice changes the image presented. I am trying to add a link to each image that will allow the visitors to hover their mouse over the image and it opens up a larger image. </p>

<p>I just need to know where to add the link. Everytime I add it in the var sel_imgs=[ , it disables the function of changing the images when the visitor selects an option in the dropdown menu.</p>

<pre><code>function diva_imgBySel(objId,theValue) { //v0.1 divaHTML.com

    var sel_imgs=["images/md01.jpeg","images/md01.jpeg","images/md02.jpeg","images/md03.jpeg","images/md04.jpeg","images/md06.jpeg","images/md05.jpeg","images/pic07.jpeg","images/pic08.jpeg"];

    var d=document;
    theValue=sel_imgs[theValue];
    if (!theValue || !d.getElementById ) return;
    var obj = d.getElementById(objId);
    if (obj) obj.src=theValue;    
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i&lt;a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
&lt;/script&gt;
</code></pre>

<p>And here is the form code lower down on the page:</p>

<pre><code>&lt;img src="images/md01.jpeg" alt="" name="theImg" width="147" height="161" id="theImg" style="border: 1px solid #ffffff;" align="LEFT" /&gt;&lt;strong&gt;Add a vase:&lt;/strong&gt;
&lt;input type="checkbox" name="anniv" id="anniv" value="6.95" onclick="priceUpdate('anniv');"/&gt;
             &amp;pound;6.95
            &lt;/td&gt;
          &lt;td width="71%" align="left" valign="top"&gt; &lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
            &lt;tr&gt;
              &lt;td align="left"&gt;&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;select name="productColors" id="productColors" style="width:270px; margin-bottom:5px; margin-top:5px" onchange="diva_imgBySel('theImg',this.selectedIndex)"&gt;
                &lt;option value="MD1004"&gt;Select Flower Arrangement&lt;/option&gt;
                &lt;option value="MD1004"&gt;Bloom&lt;/option&gt;
                &lt;option value="MD1001"&gt;Majestic&lt;/option&gt;
                &lt;option value="MD1007"&gt;Mothers Day Premium&lt;/option&gt;
                &lt;option value="MD1002"&gt;Mum's the Word&lt;/option&gt;
                &lt;option value="NF1011"&gt;Joyful Orchids&lt;/option&gt;
                &lt;option value="NF1010"&gt;Lily and Rose Hand Tied&lt;/option&gt;
                &lt;option value="NF1013"&gt;Sunflower Sensation&lt;/option&gt;
                &lt;option value="SF002-free-vase"&gt;Tranquililty&lt;/option&gt;
                &lt;/select&gt;&lt;/td&gt;
</code></pre>

<p>Here is the node with the mouseover effect attached. it works fine, but repeats the same large image for each selection the user makes. I need to know how to duplicate this effect for each image not just "md01.jpeg".</p>

<pre><code>&lt;a href="#" rel="imgtip[1]"&gt;&lt;img src="images/md01.jpeg" alt="" name="theImg" width="147" height="161" id="theImg" style="border: 1px solid #ffffff;" align="LEFT" /&gt;&lt;a/&gt;

&lt;link rel="stylesheet" type="text/css" href="ddimgtooltip.css" /&gt;

&lt;script type="text/javascript" src="ddimgtooltip.js"&gt;

/***********************************************
* Image w/ description tooltip v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

&lt;/script&gt;
</code></pre>

<p>Here is the code for image mouseover. It is a .js file</p>

<pre><code>/* Image w/ description tooltip v2.0
* Created: April 23rd, 2010. This notice must stay intact for usage 
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code
*/


var ddimgtooltip={

    tiparray:function(){
        var tooltips=[]
        //define each tooltip below: tooltip[inc]=['path_to_image', 'optional desc', optional_CSS_object]
        //For desc parameter, backslash any special characters inside your text such as apotrophes ('). Example: "I\'m the king of the world"
        //For CSS object, follow the syntax: {property1:"cssvalue1", property2:"cssvalue2", etc}

        tooltips[0]=["images/pic01.jpg"]
        tooltips[1]=["images/pic02.jpg"]
        tooltips[2]=["images/pic03.jpg"]
        tooltips[3]=["images/pic04.jpeg"]
        tooltips[4]=["images/pic05.jpeg"]
        tooltips[5]=["images/pic06.jpeg"]

        return tooltips //do not remove/change this line
    }(),

    tooltipoffsets: [20, -30], //additional x and y offset from mouse cursor for tooltips

    //***** NO NEED TO EDIT BEYOND HERE

    tipprefix: 'imgtip', //tooltip ID prefixes

    createtip:function($, tipid, tipinfo){
        if ($('#'+tipid).length==0){ //if this tooltip doesn't exist yet
            return $('&lt;div id="' + tipid + '" class="ddimgtooltip" /&gt;').html(
                '&lt;div style="text-align:center"&gt;&lt;img src="' + tipinfo[0] + '" /&gt;&lt;/div&gt;'
                + ((tipinfo[1])? '&lt;div style="text-align:left; margin-top:5px"&gt;'+tipinfo[1]+'&lt;/div&gt;' : '')
                )
            .css(tipinfo[2] || {})
            .appendTo(document.body)
        }
        return null
    },

    positiontooltip:function($, $tooltip, e){
        var x=e.pageX+this.tooltipoffsets[0], y=e.pageY+this.tooltipoffsets[1]
        var tipw=$tooltip.outerWidth(), tiph=$tooltip.outerHeight(), 
        x=(x+tipw&gt;$(document).scrollLeft()+$(window).width())? x-tipw-(ddimgtooltip.tooltipoffsets[0]*2) : x
        y=(y+tiph&gt;$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
        $tooltip.css({left:x, top:y})
    },

    showbox:function($, $tooltip, e){
        $tooltip.show()
        this.positiontooltip($, $tooltip, e)
    },

    hidebox:function($, $tooltip){
        $tooltip.hide()
    },


    init:function(targetselector){
        jQuery(document).ready(function($){
            var tiparray=ddimgtooltip.tiparray
            var $targets=$(targetselector)
            if ($targets.length==0)
                return
            var tipids=[]
            $targets.each(function(){
                var $target=$(this)
                $target.attr('rel').match(/\[(\d+)\]/) //match d of attribute rel="imgtip[d]"
                var tipsuffix=parseInt(RegExp.$1) //get d as integer
                var tipid=this._tipid=ddimgtooltip.tipprefix+tipsuffix //construct this tip's ID value and remember it
                var $tooltip=ddimgtooltip.createtip($, tipid, tiparray[tipsuffix])
                $target.mouseenter(function(e){
                    var $tooltip=$("#"+this._tipid)
                    ddimgtooltip.showbox($, $tooltip, e)
                })
                $target.mouseleave(function(e){
                    var $tooltip=$("#"+this._tipid)
                    ddimgtooltip.hidebox($, $tooltip)
                })
                $target.mousemove(function(e){
                    var $tooltip=$("#"+this._tipid)
                    ddimgtooltip.positiontooltip($, $tooltip, e)
                })
                if ($tooltip){ //add mouseenter to this tooltip (only if event hasn't already been added)
                    $tooltip.mouseenter(function(){
                        ddimgtooltip.hidebox($, $(this))
                    })
                }
            })

        }) //end dom ready
    }
}

//ddimgtooltip.init("targetElementSelector")
ddimgtooltip.init("*[rel^=imgtip]")
</code></pre>
