// form validation functions 
function validateField(id, label)
{    
    var c = document.getElementById(id);
    
    switch(id.substring(0,3))
    {
        case "txt":
        {
            if(c == null || c.value == "")   
            {   
                alert("Please enter your '" + label + "'");        
                c.focus();      
                return false;   
            }
            return true;
        }
        
        case "cbo":
        {
            if(c == null || c.options[c.selectedIndex].value == "")
            {
                alert("Please enter your '" + label + "'");        
                c.focus();
                return false;
            }
            return true;
        }
        
        case "chk":
        {
            return true;
        }
        
        default:
        {
            alert("Invalid field '" + id + " to validate.");
            return false;
        }
    }    
}