var redirect = (function() {
var DEBUG = false, // true to disable redirects
NAME = 'redirect=',
DAYS = 7, // number of days to redirect
cookie = document.cookie,
expires;
// read cookie and redirect
if (cookie.indexOf( NAME ) >= 0) {
cookie = cookie.split( NAME ).pop().split(';').shift();
cookie = decodeURIComponent( cookie );
if (DEBUG) alert( 'Redirect\n' + cookie); else location.href = cookie;
}
// set redirect
return function( url ) {
if (confirm('Go to this link automatically on your next visit?')) {
expires = new Date();
expires.setDate( expires.getDate() + DAYS );
cookie = 'redirect=' + encodeURIComponent( url ) + ';expires=' + expires.toUTCString() + ';path=/';
document.cookie = cookie;
}
if (!DEBUG) location.href = url;
}
})()
<html>
<head>
</head>
<body>
<img src="http://technical.walkerdendle.co.uk/_resx/images/logo.png">
<br>
<a href="javascript:void(0)" onclick="redirect('http://technical.walkerdendle.co.uk')">Technical</a>
<br>
<a href="javascript:void(0)" onclick="redirect('http://financial.walkerdendle.co.uk')">Financial</a>
</body>
</html>