var N_BASEZINDEX = 50; var RE_PARAM = /^\s*(\w+)\s*\=\s*(.*)\s*$/; window.b_w_screenOn = false; function f_w_putScreen (b_w_show) { if (b_w_show == null && !window.b_w_screenOn){ toggleParentControls(true); return;}
if (b_w_show == false) { window.b_w_screenOn = false; if(window.e_w_screen) window.e_w_screen.style.display = 'none'; if (document.removeEventListener) { document.removeEventListener('mousemove', f_w_dragProgress, false); window.removeEventListener('resize', f_w_putScreen, false); window.removeEventListener('scroll', f_w_putScreen, false);}
else if (window.detachEvent) { document.detachEvent('onmousemove', f_w_dragProgress); window.detachEvent('onresize', f_w_putScreen); window.detachEvent('onscroll', f_w_putScreen);}
else { document.onmousemove = function(){}; window.onresize = function(){}; window.onscroll = function(){};}
window.e_w_screen = null; toggleParentControls(true); return;}
if (window.e_w_screen == null) { window.e_w_screen = document.createElement("div"); window.e_w_screen.innerHTML = "&nbsp;"; window.e_w_screen.style.position = 'absolute'; window.e_w_screen.id = 'windowModalScreen'; document.body.appendChild(window.e_w_screen); if (document.addEventListener) { document.addEventListener('mousemove', f_w_dragProgress, false); window.addEventListener('resize', f_w_putScreen, false); window.addEventListener('scroll', f_w_putScreen, false);}
if (window.attachEvent) { document.attachEvent('onmousemove', f_w_dragProgress); window.attachEvent('onresize', f_w_putScreen); window.attachEvent('onscroll', f_w_putScreen);}
else { document.onmousemove = f_w_dragProgress; window.onresize = f_w_putScreen; window.onscroll = f_w_putScreen;}
}
var a_w_docSize = documentSize(); window.e_w_screen.style.left = a_w_docSize[2] + 'px'; window.e_w_screen.style.top = a_w_docSize[3] + 'px'; window.e_w_screen.style.width = a_w_docSize[0] + 'px'; window.e_w_screen.style.height = a_w_docSize[1] + 'px'; window.e_w_screen.style.zIndex = N_BASEZINDEX + a_w_windows.length * 2 - 1; window.e_w_screen.style.display = 'block'; window.b_w_screenOn = true; toggleParentControls(false);}
function f_w_dialogOpen (s_url, s_title, s_features) { if (!window.a_w_windows)
window.a_w_windows = []; var a_w_featuresStrings = s_features.split(','); var a_w_features = []; for (var i = 0; i < a_w_featuresStrings.length; i++)
if (a_w_featuresStrings[i].match(RE_PARAM))
a_w_features[String(RegExp.$1).toLowerCase()] = RegExp.$2; var n_w_nesting = a_w_windows.length; var e_w_window = document.createElement("div"); e_w_window.style.position = 'absolute'; var n_w_width = a_w_features.width ? parseInt(a_w_features.width) : 300; var n_w_height = a_w_features.height ? parseInt(a_w_features.height) : 200; var a_w_docSize = documentSize (); e_w_window.style.left = (a_w_features.left ? parseInt(a_w_features.left) : ((a_w_docSize[0] - n_w_width) / 2) + a_w_docSize[2]) + 'px'; e_w_window.style.top = (a_w_features.top ? parseInt(a_w_features.top) : ((a_w_docSize[1] - n_w_height) / 2) + a_w_docSize[3]) + 'px'; var n_w_window_zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; e_w_window.style.zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; var n_w_dialogWindowBG_zIndex = parseInt(e_w_window.style.zIndex) - 2; var n_w_dialogWindowBG_left = e_w_window.style.left; var n_w_dialogWindowBG_top = e_w_window.style.top; var n_w_spinner_left, n_w_spinner_top, n_w_spinner_zIndex; n_w_spinner_left = (n_w_width/2) - 16; n_w_spinner_top = (n_w_height/2); n_w_spinner_zIndex = parseInt(e_w_window.style.zIndex) + 2; e_w_window.innerHTML = '<iframe name="dialogWindowBG" id="dialogWindowBG" style="z-index: ' + n_w_dialogWindowBG_zIndex + '; left: ' + n_w_dialogWindowBG_left + 'px; top: ' + n_w_dialogWindowBG_top + 'px;" height = "' + n_w_height + '" width = "' + n_w_width + '"></iframe>' + '<table border="1" class="' + (a_w_features.css ? a_w_features.css : 'dialogWindow') + '" style="z-index: ' + n_w_window_zIndex + '"><tr><th onmousedown="f_w_dragStart(' + n_w_nesting + ', event)" onmouseup="f_w_dragEnd()" ' + 'onmousemove="f_w_dragProgress(event)" onselectstart="return false"><span style="float: left">' + (s_title ? s_title : 'Dialog Window') + '</span><img src="' + windowsCloseIcon + '" onclick="top.f_w_dialogClose();f_putScreen(false);" onmousedown="return false;" ' + ' style="float: right" title="Close"></th></tr><tr><td><iframe width="' + n_w_width + '" height="' + n_w_height + '" src="' + s_url + '"></iframe></td></tr></table>'; document.body.appendChild(e_w_window); a_w_windows[n_w_nesting] = e_w_window; f_w_putScreen(true);}
function f_w_dialogPost (o_form, s_title, s_features) { if (!window.a_w_windows)
window.a_w_windows = []; var a_w_featuresStrings = s_features.split(','); var a_w_features = []; for (var i = 0; i < a_w_featuresStrings.length; i++)
if (a_w_featuresStrings[i].match(RE_PARAM))
a_w_features[String(RegExp.$1).toLowerCase()] = RegExp.$2; var n_w_nesting = a_w_windows.length; var e_w_window = document.createElement("div"); e_w_window.style.position = 'absolute'; var n_w_width = a_w_features.width ? parseInt(a_w_features.width) : 300; var n_w_height = a_w_features.height ? parseInt(a_w_features.height) : 200; var a_w_docSize = documentSize (); e_w_window.style.left = (a_w_features.left ? parseInt(a_w_features.left) : ((a_w_docSize[0] - n_w_width) / 2) + a_w_docSize[2]) + 'px'; e_w_window.style.top = (a_w_features.top ? parseInt(a_w_features.top) : ((a_w_docSize[1] - n_w_height) / 2) + a_w_docSize[3]) + 'px'; var n_w_window_zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; e_w_window.style.zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; var n_w_dialogWindowBG_zIndex = parseInt(e_w_window.style.zIndex) - 2; var n_w_dialogWindowBG_left = e_w_window.style.left; var n_w_dialogWindowBG_top = e_w_window.style.top; var n_w_spinner_left, n_w_spinner_top, n_w_spinner_zIndex; n_w_spinner_left = (n_w_width/2) - 16; n_w_spinner_top = (n_w_height/2); n_w_spinner_zIndex = parseInt(e_w_window.style.zIndex) + 2; e_w_window.innerHTML = '<iframe name="dialogWindowBG" id="dialogWindowBG" style="z-index: ' + n_w_dialogWindowBG_zIndex + '; left: ' + n_w_dialogWindowBG_left + 'px; top: ' + n_w_dialogWindowBG_top + 'px;" height = "' + n_w_height + '" width = "' + n_w_width + '"></iframe>' + '<table border="1" class="' + (a_w_features.css ? a_w_features.css : 'dialogWindow') + '" style="z-index: ' + n_w_window_zIndex + '"><tr><th onmousedown="f_w_dragStart(' + n_w_nesting + ', event)" onmouseup="f_w_dragEnd()" ' + 'onmousemove="f_w_dragProgress(event)" onselectstart="return false"><span style="float: left">' + (s_title ? s_title : 'Dialog Window') + '</span><img src="' + windowsCloseIcon + '" onclick="top.f_w_dialogClose();" onmousedown="return false;" ' + ' style="float: right" title="Close"></th></tr><tr><td><iframe id="formTarget" name="formTarget" width="' + n_w_width + '" height="' + n_w_height + '"></iframe></td></tr></table>'; document.body.appendChild(e_w_window); a_w_windows[n_w_nesting] = e_w_window; o_form.target = "formTarget"; o_form.submit(); f_w_putScreen(true);}
function f_w_dialogConfirm (o_form, s_title, s_features, s_message) { if (!window.a_w_windows)
window.a_w_windows = []; var a_w_featuresStrings = s_features.split(','); var a_w_features = []; for (var i = 0; i < a_w_featuresStrings.length; i++)
if (a_w_featuresStrings[i].match(RE_PARAM))
a_w_features[String(RegExp.$1).toLowerCase()] = RegExp.$2; var n_w_nesting = a_w_windows.length; var e_w_window = document.createElement("div"); e_w_window.style.position = 'absolute'; var n_w_width = a_w_features.width ? parseInt(a_w_features.width) : 300; var n_w_height = a_w_features.height ? parseInt(a_w_features.height) : 200; var a_w_docSize = documentSize (); e_w_window.style.left = (a_w_features.left ? parseInt(a_w_features.left) : ((a_w_docSize[0] - n_w_width) / 2) + a_w_docSize[2]) + 'px'; e_w_window.style.top = (a_w_features.top ? parseInt(a_w_features.top) : ((a_w_docSize[1] - n_w_height) / 2) + a_w_docSize[3]) + 'px'; var n_w_window_zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; e_w_window.style.zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; var n_w_dialogWindowBG_zIndex = parseInt(e_w_window.style.zIndex) - 2; var n_w_dialogWindowBG_left = e_w_window.style.left; var n_w_dialogWindowBG_top = e_w_window.style.top; var n_w_spinner_left, n_w_spinner_top, n_w_spinner_zIndex; n_w_spinner_left = (n_w_width/2) - 16; n_w_spinner_top = (n_w_height/2); n_w_spinner_zIndex = parseInt(e_w_window.style.zIndex) + 2; e_w_window.innerHTML = '<iframe name="dialogWindowBG" id="dialogWindowBG" style="z-index: ' + n_w_dialogWindowBG_zIndex + '; left: ' + n_w_dialogWindowBG_left + 'px; top: ' + n_w_dialogWindowBG_top + 'px;" width="' + n_w_width + '" height="' + n_w_height + '"></iframe>' + '<table border="1" class="' + (a_w_features.css ? a_w_features.css : 'dialogWindow') + '" style="z-index: ' + n_w_window_zIndex + '"><tr><th onmousedown="f_w_dragStart(' + n_w_nesting + ', event)" onmouseup="f_w_dragEnd()" ' + 'onmousemove="f_w_dragProgress(event)" onselectstart="return false"><span style="float: left">' + (s_title ? s_title : 'Dialog Window') + '</span><img src="' + windowsCloseIcon + '" onclick="top.f_w_dialogClose();" onmousedown="return false;" ' + ' style="float: right" title="Close"></th></tr><tr><td align="center"><table border="0" height="' + n_w_height + '" width="' + n_w_width + '" cellspacing="5" cellpadding="5" align="center"><tr><td colspan="5">&nbsp;</td></tr><tr><td>&nbsp;</td><td><img src="' + windowsConfirmIcon + '"></td><td>&nbsp;</td><td>' + s_message + '</td><td>&nbsp;</td></tr><tr><td colspan="5">&nbsp;</td></tr><tr><td colspan="5" align="center"><input type="button" class="button" value="OK" onclick="top.document.'+o_form.name+'.submit();top.f_w_dialogClose();">' + '&nbsp;<input type="button" class="button" value="Cancel" onclick="top.f_w_dialogClose();"></td></tr><tr><td colspan="5">&nbsp;</td></tr></table></td></tr></table>'; document.body.appendChild(e_w_window); a_w_windows[n_w_nesting] = e_w_window; o_form.target = "_self"; f_w_putScreen(true); enableSelectedCheckboxes(o_form);}
function f_w_dialogErrors (s_title, s_features, s_message) { if (!window.a_w_windows)
window.a_w_windows = []; var a_w_featuresStrings = s_features.split(','); var a_w_features = []; for (var i = 0; i < a_w_featuresStrings.length; i++)
if (a_w_featuresStrings[i].match(RE_PARAM))
a_w_features[String(RegExp.$1).toLowerCase()] = RegExp.$2; var n_w_nesting = a_w_windows.length; var e_w_window = document.createElement("div"); e_w_window.style.position = 'absolute'; var n_w_width = a_w_features.width ? parseInt(a_w_features.width) : 300; var n_w_height = a_w_features.height ? parseInt(a_w_features.height) : 200; var a_w_docSize = documentSize (); e_w_window.style.left = (a_w_features.left ? parseInt(a_w_features.left) : ((a_w_docSize[0] - n_w_width) / 2) + a_w_docSize[2]) + 'px'; e_w_window.style.top = (a_w_features.top ? parseInt(a_w_features.top) : ((a_w_docSize[1] - n_w_height) / 2) + a_w_docSize[3]) + 'px'; var n_w_window_zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; e_w_window.style.zIndex = N_BASEZINDEX + a_w_windows.length * 2 + 2; var n_w_dialogWindowBG_zIndex = parseInt(e_w_window.style.zIndex) - 2; var n_w_dialogWindowBG_left = e_w_window.style.left; var n_w_dialogWindowBG_top = e_w_window.style.top; e_w_window.innerHTML = '<iframe name="dialogWindowBG" id="dialogWindowBG" style="z-index: ' + n_w_dialogWindowBG_zIndex + '; left: ' + n_w_dialogWindowBG_left + 'px; top: ' + n_w_dialogWindowBG_top + 'px;" width="' + n_w_width + '" height="' + n_w_height + '"></iframe>' + '<table border="1" class="' + (a_w_features.css ? a_w_features.css : 'dialogWindow') + '" style="z-index: ' + n_w_window_zIndex + '"><tr><th onmousedown="f_w_dragStart(' + n_w_nesting + ', event)" onmouseup="f_w_dragEnd()" ' + 'onmousemove="f_w_dragProgress(event)" onselectstart="return false"><span style="float: left">' + (s_title ? s_title : 'Dialog Window') + '</span><img src="' + windowsCloseIcon + '" onclick="top.f_w_dialogClose();" onmousedown="return false;" ' + ' style="float: right" title="Close"></th></tr><tr><td align="center"><table border="0" height="' + n_w_height + '" width="' + n_w_width + '" cellspacing="5" cellpadding="5"><tr><td colspan="5">&nbsp;</td></tr>' + '<tr><td width="15"></td><td valign="top"><img src="' + windowsErrorIcon + '"></td><td>&nbsp;</td><td align="left" width="260">Please see the message list below:</td><td width="15"></td></tr><tr><td colspan="5">&nbsp;</td></tr><tr><td width="15"></td><td valign="top" colspan="3"><div class="messageList">' + s_message + '</div></td><td width="15"></td></tr><tr><td colspan="5">&nbsp;</td></tr><tr><td width="15"></td><td colspan="3" align="right"><input type="button" class="button" value="&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;" onclick="top.f_w_dialogClose();"></td><td width="15"></td></tr><tr><td colspan="5">&nbsp;</td></tr></table></td></tr></table>'; document.body.appendChild(e_w_window); a_w_windows[n_w_nesting] = e_w_window; f_w_putScreen(true); e_w_window.focus();}
function f_w_dialogClose () { var n_w_nesting = a_w_windows.length - 1; if (a_w_windows[n_w_nesting].removeNode)
a_w_windows[n_w_nesting].removeNode(true); else if (document.body.removeChild)
document.body.removeChild(a_w_windows[n_w_nesting]); a_w_windows[n_w_nesting] = null; a_w_windows.length = n_w_nesting; f_w_putScreen(n_w_nesting ? true : false);}
function f_w_dragStart (s_name, e_w_event) { if (!e_w_event && window.event) e_w_event = window.event; window.n_w_mouseX = e_w_event.clientX; window.n_w_mouseY = e_w_event.clientY; window.e_w_draggedWindow = window.a_w_windows[s_name]; return false;}
function f_w_dragProgress (e_w_event) { if (!e_w_event && window.event) e_w_event = window.event; if (!e_w_event || window.e_w_draggedWindow == null) return; var n_w_newMouseX = e_w_event.clientX; var n_w_newMouseY = e_w_event.clientY; window.e_w_draggedWindow.style.left = (parseInt(window.e_w_draggedWindow.style.left) - window.n_w_mouseX + n_w_newMouseX) + 'px'; window.e_w_draggedWindow.style.top = (parseInt(window.e_w_draggedWindow.style.top) - window.n_w_mouseY + n_w_newMouseY) + 'px'; window.n_w_mouseX = n_w_newMouseX; window.n_w_mouseY = n_w_newMouseY;}
function f_w_dragEnd () { window.e_w_draggedWindow = null;}
function toggleParentControls(b_w_enable){ var forms, f, i, count; forms = window.document.forms; count = forms.length; if(forms){ for (i=0;i<count;i++){ f = forms[i]; toggleFormControls(f, b_w_enable);}
}
toggleAnchorsAndLinks(b_w_enable);}
function toggleFormControls(form, b_w_enable){ var e, f, i, count; if(form){ f=form; count=f.elements.length; for (i=0;i<count;i++){ e = f.elements[i]; e.disabled = !b_w_enable;}
}
}
function toggleAnchorsAndLinks(b_w_enable){ var a, i, count, anchors; anchors = document.anchors; count = anchors.length; for (i=0;i<count;i++){ a = anchors[i]; if(!b_w_enable) a.onfocus = function(){window.e_w_screen.focus()}; else a.onfocus = function(){};}
anchors = document.links; count = anchors.length; for (i=0;i<count;i++){ a = anchors[i]; if(!b_w_enable) a.onfocus = function(){window.e_w_screen.focus()}; else a.onfocus = function(){};}
}
function enableSelectedCheckboxes(form){ var e, f, i, count; if(form){ f=form; count=f.elements.length; for (i=0;i<count;i++){ e = f.elements[i]; if (e.name != TOGGLE_ALL && e.type==CHECKBOX && e.disabled && e.checked)
e.disabled = false;}
}
}
