﻿String.prototype.trim = function() {
a = this.replace(/^\s+/, '');
return a.replace(/\s+$/, '');
};

function calculateTotalEmployess()
{
    if (window.document.getElementById("txtNumFullTimeEmployees").value.trim() != "" && window.document.getElementById("txtNumPartTimeEmployees").value.trim() != "")
    {
        var totalFullEmployees = parseInt(window.document.getElementById("txtNumFullTimeEmployees").value);
        var totalPartEmployees = parseInt(window.document.getElementById("txtNumPartTimeEmployees").value);
        if (isNaN(totalFullEmployees) == false && isNaN(totalPartEmployees) == false)
        {
            var totalEmployees = totalFullEmployees + (totalPartEmployees / 2);
            window.document.getElementById("lblTotalEmployees").innerHTML = parseInt(totalEmployees);
        }
    }
}

