You are missing the Cascade boat there!

if your middle section has a class="mid_section" then the following rules will do the trick wihtout needing to set the class="" on each <a> element.
[code:1:d3d5311671]
<style>
a:visited { color: white; }
.mid_section a:visited {colour: darkblue; }
</style>
<div class="mid_section">
<a href="...">link in the mid section will be darkblue after it's visited</a>
</div>
<a href="...">link OUT of the mid section will be white after it's visited</a>
[/code:1:d3d5311671]