Check boxes and Images display based on a value
<p>I am currently working with checkboxes and radio buttons displaying a picture based on the value selected. I have been able to get for the most part everything working. Problem: The checkboxes selected value displays an image but when unchecked it doesn't remove the picture. Is there away to remove the picture when the checkbox is unchecked? <a href="http://webprolearner2346.zxq.net/bike_calculator/" rel="nofollow">EXAMPLE</a></p>

<p><strong>JS</strong></p>

<pre><code>&lt;script&gt;
function check_value(val, id, type) {     
    var el = document.getElementById("imgBox" + id);
    if (val&gt;0 &amp;&amp; val&lt;4) { //will trigger when [1,2,3]
         el.src = "images/"+ type + val + ".jpg";    
         el.style.display = "";

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

<p><strong>HTML</strong></p>

<pre><code>  &lt;h2&gt;Choose a bike&lt;/h2&gt;
    &lt;form name="builder"&gt;
        &lt;input type="radio" name="field" onclick='check_value(1, 1, "bike")' /&gt;KAWASAKI KX 450F
        &lt;br /&gt;
        &lt;input type="radio" name="field" onclick='check_value(2, 1, "bike")' /&gt;2010 Yamaha Road Star S
        &lt;br /&gt;
        &lt;input type="radio" name="field" onclick='check_value(3, 1, "bike")' /&gt;Aprilia RSV4
        &lt;br /&gt;
    &lt;/form&gt;
    &lt;img id="imgBox1" src="#" style="display:none"&gt;

  &lt;h2&gt;Choose a tire&lt;/h2&gt; 
    &lt;form name="tire"&gt;
        &lt;input type="radio" name="field" value="1" onclick='check_value(1, 2, "tire")'
        /&gt;Michelin Pilot Road 3 Tires
        &lt;br /&gt;
        &lt;input type="radio" name="field" value="2" onclick='check_value(2, 2, "tire")'
        /&gt;Dunlop Roadsmart Sport-Touring Tires
        &lt;br /&gt;
        &lt;input type="radio" name="field" value="3" onclick='check_value(3, 2, "tire")'
        /&gt;Pirelli Scorpion Trail Tires
        &lt;br /&gt;
    &lt;/form&gt;
    &lt;img id="imgBox2" src="#" style="display:none"&gt;

  &lt;h2&gt;Choose Accesories&lt;/h2&gt;   
    &lt;form name="tire"&gt;
        &lt;input type="checkbox" name="field" value="1" onclick='check_value(1, "3a", "accessories")'
        /&gt;Chrome Front Plate
        &lt;br /&gt;
        &lt;input type="checkbox" name="field" value="2" onclick='check_value(2, "3b", "accessories")'
        /&gt;Jacket
        &lt;br /&gt;
        &lt;input type="checkbox" name="field" value="3" onclick='check_value(3, "3c", "accessories")'
        /&gt;Gloves&lt;/form&gt;
    &lt;div id="accessories"&gt;
        &lt;img id="imgBox3a" src="#" style="display:none"&gt;
        &lt;img id="imgBox3b" src="#" style="display:none"&gt;
        &lt;img id="imgBox3c" src="#" style="display:none"&gt;
    &lt;/div&gt;
</code></pre>
