var urls = new Array(); urls[0] = "http://www.google.com"; urls[1] = "http://www.ebay.com"; var random = Math.floor(Math.random()*urls.length); window.location = urls[random];