function setTitle(data) {
    document.title = data.replace("&apos;", "'").substring(0, 50);
}

function changeColor(button) {
    button.form.color.value = button.id;
    button.form.submit();
}

function getHostName() {
    var url = window.location.href;
    var index = url.indexOf(".com");
    if (index === -1) {
        return "localhost";
    }
    return url.substring(7, index + 4);
}

function inputFocus(input, message) {
    if (input.value === message) {
        input.value = "";
    }
}

function inputBlur(input, message) {
    if (input.value === "") {
        input.value = message;
    }
}

function close() {
    window.document.lobby.SetVariable("data", "<>");
    window.document.lobby.TCallLabel("\/", "send");
    if (window.document.topic) {
        window.document.topic.SetVariable("data", "<>");
        window.document.topic.TCallLabel("\/", "send");
    }
}