﻿// Creates popup and destroy it on exit
function CreatePopupWindow(divId, result, options) {
    options["onClose"] = function () { $(this).data('tWindow').destroy(); };
    var windowElement = $.telerik.window.create(options);
    windowElement.attr('id', divId);
    $(windowElement).data('tWindow')
        .content(result.replace('\r', '').replace('\n', '').replace('\r\n', '').replace('\n\r', ''))
        .center();
};

function ClosePopupWindow(divId, paneId, language, shouldUpdateMenu) {
	$("#" + divId).data('tWindow').close();
	if (paneId != null) {
		PO_displayPane(paneId);
	}
	if (shouldUpdateMenu) {
		UpdateMenu(language);
	}
}
