A Javascript rules based contextual dialog system