document.querySelector('img').addEventListener('click', function() {
var links = [];
[].forEach.call(document.querySelectorAll('.random_link a'), function(el) {
links.push(el.getAttribute("href"));
});
window.location.href = links[Math.floor(Math.random() * links.length)];
});