I modified your code little bit and it worked as expected:
JS change at here: return Url...
Modified code
<SCRIPT Language="Javascript">
function Randomlink()
{
Url = new Array;
Url[0] = "http://www.google.com";
Url[1] = "http://www.youtube.com";
Url[2] = "http://www.facebook.com";
Url[3] = "http://www.yahoo.com";
return Url[Math.floor(Math.random() * Url.length)];
}
</SCRIPT>
HTML change at here: window.open Randomlink...
Modified code
<center>
<input id="input" name="url" onfocus="this.value=''" type="text" value="Type url here.." />
<input onclick="window.open(Randomlink()+'/'+ window.document.getElementById('input').value.replace(/^https?:\/\//,''))" style="font-family: Arial, sans-serif; font-size: 0.9em; margin: 2px 0; padding: 4px; width: 100px;" type="button" value="Go"/>
</center>
Cheers