Help me simplify this JS code
<p>I'm a beginner in JS and want to know a way to simplify this code. There are 7 different divs with iframes, and also 7 different links. I have shown 1 div with iframe and 1 link. I have no idea where to start. Any help would be greatly appreciated.</p>

<p>NOTE: The code works to my needs, but I just need to simplify it (less js code in html, and more in js file).</p>

<p>JavaScript in .js file:</p>

<pre><code>function show_visibility(){
for(var i = 0,e = arguments.length;i &lt; e;i++){
var myDiv = document.getElementById(arguments[i]).style;
myDiv.display = "block";}
}

function hide_visibility(){
for(var i = 0,e = arguments.length;i &lt; e;i++){
var myDiv = document.getElementById(arguments[i]).style;
myDiv.display = "none";}
}
 function refFrame()    {
for(var i = 0,e = arguments.length;i &lt; e;i++){
document.getElementById(arguments[i]).src = document.getElementById(arguments[i]).src;
}

}
</code></pre>

<p>Div/iframe to be modified:</p>

<pre><code>&lt;div id="r1-box"&gt;
&lt;iframe id="frame-box1" class="work" src="youtubelink" width="720" height="405" frameborder="0"&gt;&lt;/iframe&gt;
&lt;/div&gt; 
</code></pre>

<p>Link to execute JS:</p>

<pre><code>&lt;a id="r1" href="javascript:refFrame('frame-box2','frame-box3','frame-box4','frame-box5','frame-box6','frame-box7');show_visibility('r1-box');hide_visibility('r2-box','r3-box', 'r4-box','r5-box','r6-box','r7-box');"&gt;
&lt;/a&gt;
</code></pre>
