+var servers = ['chkno.net', 'localhost']
+
+var session = Math.random();
+
+function addport(server) {
+ // Add the default port if server doesn't contain a port number already
+ if (server.indexOf(":") == -1) {
+ return server + ":21059";
+ } else {
+ return server;
+ }
+}
+
+function rcsend(d, message) {
+ var id = new Date().getTime() + "-" + session + "-" + Math.random();
+ var path = "/speak" +
+ "?id=" + encodeURIComponent(id) +
+ "&text=" + encodeURIComponent(message);
+ for (i in servers) {
+ var uri = "http://" + addport(servers[i]) + path;
+ var img = document.createElement("img");
+ img.setAttribute("src", uri);
+ d.appendChild(img);
+ }
+}
+