<html>
<head>
</head>
<body>
<a href='http://ya.ru'>link1</a>
<a href='http://www.google.ru'>link2</a>
<a href='http://javascript.ru'>link3</a>
<script>
if(address=document.body.innerHTML.match(/(?=[^<]+link3)http:\/\/[^"']+/)) location=address[0]
</script>
</body>
</html>