function setElementById(id,val)
{
    if (document.getElementById && document.getElementById(id)) {
        document.getElementById(id).value = val;
    }
}

function is_equal(id1, id2)
{
    if (document.getElementById(id1).value != document.getElementById(id2).value) {
        alert('New password and confirm password do not match.');
        return false;
    } else {
        return true;
    }
}
