you can try having the links with rel="nofollow"
so search engines can read it, and then you can change that value onclick. like this
<a id="mylink" rel="nofollow" onclick="return changerel(this);" href="#">link</a>
<script type="text/javascript">
function changerel(el)
{
var myreplace = "{handler: 'iframe', size: {x: 700, y: 550}}";
alert('rel before:'+el.rel)
el.setAttribute("rel", myreplace);
alert('rel after:'+el.rel);
if (el.rel != myreplace)
{
el.onclick();
}
}
</script>
see it in action here http://jsfiddle.net/5Basb/4/