

function setHomePage() {
    if (document.all){
        testHomePage.style.behavior='url(#default#homepage)';
        testHomePage.setHomePage('http://www.TextBanter.com');
    }
}

function addToFavourites() {
    var bookmarkurl="http://www.textBanter.com"
    var bookmarktitle="Enjoy TextBanter ...the last word in football "

    window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function test() {
    alert("hello");
}

function registerPlayer() {

    warning = "please complete the pink boxes";
    backgroundColor = "pink";
    origBackgroundColor = "white";
    name = document.register.nickname.value;

    age = document.register.age.value;
    sex = document.register.sex.options[document.register.sex.selectedIndex].value;
    team = document.register.team.options[document.register.team.selectedIndex].value;
    mobileNetwork = document.register.mobileNetwork.options[document.register.mobileNetwork.selectedIndex].value;
    postcode = document.register.postcode.value;

    mobileNumber = document.register.mobileNumber.value;
    tAndC = document.register.tAndC.checked;

    completed = "N";
    errors = "none";
    spaceError = "none";

    document.register.nickname.style.backgroundColor = origBackgroundColor;
    document.register.age.style.backgroundColor = origBackgroundColor;
    document.register.sex.style.backgroundColor = origBackgroundColor;
    document.register.team.style.backgroundColor = origBackgroundColor;
    document.register.postcode.style.backgroundColor = origBackgroundColor;

    document.register.mobileNumber.style.backgroundColor = origBackgroundColor;

    if (name == '') {
        document.register.nickname.style.backgroundColor = backgroundColor;
        errors = "yes";
        document.register.nickname.focus();

    } else if (name.indexOf(" ") > -1) {
        spaceError = "yes";
    }

    if (age == '') {
        document.register.age.style.backgroundColor = backgroundColor;
        errors = "yes";
        document.register.age.focus();
    }

    if (sex == '') {
        document.register.sex.style.backgroundColor = backgroundColor;
        errors = "yes";
        document.register.sex.focus();
    }

    if (team == '') {
        document.register.team.style.backgroundColor = backgroundColor;
        errors = "yes";
        document.register.team.focus();
    }

    if (postcode == '') {
        document.register.postcode.style.backgroundColor = backgroundColor;
        errors = "yes";
        document.register.postcode.focus();

    }

    if (mobileNumber == '') {
        document.register.mobileNumber.style.backgroundColor = backgroundColor;
        errors = "yes";
        document.register.mobileNumber.focus();

    }

    if (mobileNetwork == '') {
        document.register.mobileNetwork.style.backgroundColor = backgroundColor;
        errors = "yes";
        document.register.mobileNetwork.focus();

    }

    if (errors == 'yes') {
        alert(warning);
        errors="no";
    }
    if (spaceError == 'yes') {
        alert("Name must not contain spaces");
        spaceError="no";
    }

    if (tAndC == false ) {
        alert("you must read and agree with the terms and conditions");
    }

    if ( errors == "none" && tAndC == true ) {
        document.register.formAction.value="SEND";
        document.register.submit();
    }
}