Added functions to IndexHtml to handle dialog code