At first glance, this reads like plugin territory, you may have to develop something custom for this.