replaced alert and confirm with jQuery UI Dialog