﻿// function to check if call back textboxs are empty onblur, if so add value
function CheckCallBackEmptyFields() {
    var firstname = document.getElementById("ctl00_Firstnametxt");
    var surname = document.getElementById("ctl00_Surnametxt");
    var telno = document.getElementById("ctl00_TelNotxt");
    var email = document.getElementById("ctl00_Emailtxt");

    if (firstname.value == "") {
        firstname.value = 'Your Name';
    }
    if (telno.value == "") {
        telno.value = 'Telephone Number';
    }
    if (email.value == "") {
        email.value = 'Email Address';
    }
}

//Validation to check if the defaults have been changed
function FirstnameValidateCB(source, arguments) {
    if (arguments.Value == "Your Name") {
        arguments.IsValid = false;
    }
    else {
        arguments.IsValid = true;
    }
}

// check if they haven't entered anything on click, then empty the textbox
function ClickControl(obj) {

    if (obj.value == "Your Name" || obj.value == "Telephone Number" || obj.value == "Email Address") {
        obj.value = '';
    }
}
