C:\Users\KHammer\Desktop\ffoffice\HTMLBasedGUI\general\csc.js D:\dev\perforce\FF_REL_5_0\install\ffoffice-tomcat\webapps\ffoffice\HTMLBasedGUI\general\csc.js
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: //FF/04/dev/WEBFAM/ffserver/HTMLBasedGUI/general/csc.js#3 $ // $Id: //FF/04/dev/WEBFAM/ffserver/HTMLBasedGUI/general/csc.js#3 $
// $Change: 11287 $ // $Change: 11287 $
// $DateTime: 2008/06/25 11:14:11 $ // $DateTime: 2008/06/25 11:14:11 $
// $Author: khammer $ // $Author: khammer $
// //
// Copyright (c) 2008 FORCAM GmbH. All rights reserved. // Copyright (c) 2008 FORCAM GmbH. All rights reserved.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
   
function addVersionInfoCSC() function addVersionInfoCSC()
{ {
if (this.m_jsversions == undefined) m_jsversions = new Array(); if (this.m_jsversions == undefined) m_jsversions = new Array();
if (this.m_jsfiles == undefined) m_jsfiles = new Array(); if (this.m_jsfiles == undefined) m_jsfiles = new Array();
m_jsversions.push('40_20080115'); m_jsversions.push('40_20080115');
m_jsfiles.push('srcjs/csc.js_design'); m_jsfiles.push('srcjs/csc.js_design');
} }
var m_doLog = true; var m_doLog = true;
var m_doTrace = false; var m_doTrace = false;
var m_doDebug = false; var m_doDebug = false;
var m_traceRequestStartDate = new Date(); var m_traceRequestStartDate = new Date();
var m_traceRequestEndDate = new Date(); var m_traceRequestEndDate = new Date();
var m_traceBuildXMLTime; var m_traceBuildXMLTime;
var m_firstUsage = true; var m_firstUsage = true;
var m_pageInactive = false; var m_pageInactive = false;
var m_modelName; var m_modelName;
var m_modelId; var m_modelId;
var m_sessionId; var m_sessionId;
var m_processId; var m_processId;
var m_pageName = "dummy"; var m_pageName = "dummy";
var m_modelListeners = new Array(); var m_modelListeners = new Array();
var m_modelListenersLast = new Array(); var m_modelListenersLast = new Array();
var m_propertyListeners = new Array(); var m_propertyListeners = new Array();
var m_propertyListenersTBP = new Array(); var m_propertyListenersTBP = new Array();
var m_statuspropListeners = new Array(); var m_statuspropListeners = new Array();
var m_dcListeners = new Array(); var m_dcListeners = new Array();
var m_properties; var m_properties;
var m_model; var m_model;
var m_currentArray; var m_currentArray;
var m_currentRow; var m_currentRow;
var m_changedPropertyNames; var m_changedPropertyNames;
var m_internalProperties = new Array(); var m_internalProperties = new Array();
var m_bufferNeedsRefresh = false; var m_bufferNeedsRefresh = false;
var m_callcounter = 0; var m_callcounter = 0;
var m_processCasabacSynchronizeIfNecessary; var m_processCasabacSynchronizeIfNecessary;
var m_dateDisplay = "DD.MM.YYYY"; var m_dateDisplay = "DD.MM.YYYY";
var m_timeDisplay = "HH:MM:SS"; var m_timeDisplay = "HH:MM:SS";
var m_decimalSeparator = ","; var m_decimalSeparator = ",";
var m_language = "E"; var m_language = "E";
var m_direction = "ltr"; var m_direction = "ltr";
var m_hotKeyCode = "17;18"; var m_hotKeyCode = "17;18";
var m_headerObjects = new Array(); var m_headerObjects = new Array();
var m_footerObjects = new Array(); var m_footerObjects = new Array();
var m_clickAwayObjects = new Array(); var m_clickAwayObjects = new Array();
var m_clickAwayMethods = new Array(); var m_clickAwayMethods = new Array();
var m_avoidClickAway = false; var m_avoidClickAway = false;
var m_isremoved = false; var m_isremoved = false;
var m_modelDeltaId = "inittini"; var m_modelDeltaId = "inittini";
var m_calledInPopup = false; var m_calledInPopup = false;
var casaPopupParameters; var casaPopupParameters;
var casaPopupReturnValue; var casaPopupReturnValue;
var m_parentparent = parent.parent; var m_parentparent = parent.parent;
var m_parentdocument = parent.document; var m_parentdocument = parent.document;
var m_parentdocumentbody = parent.document.body; var m_parentdocumentbody = parent.document.body;
var m_parentparentdocument = parent.parent.document; var m_parentparentdocument = parent.parent.document;
var m_bufferedxml = null; var m_bufferedxml = null;
var m_validationErrors = new Array(); var m_validationErrors = new Array();
var m_logStrings = new Array(); var m_logStrings = new Array();
var m_logDates = new Array(); var m_logDates = new Array();
var m_logIndex = 0; var m_logIndex = 0;
var m_isIE; var m_isIE;
var m_inEditMode = null; var m_inEditMode = null;
var m_lastProcessedEventX = -1; var m_lastProcessedEventX = -1;
var m_lastProcessedEventY= -1; var m_lastProcessedEventY= -1;
var m_continueMethod = null; var m_continueMethod = null;
var m_innerFrames = new Array(); var m_innerFrames = new Array();
var m_innerFramesIndex = 0; var m_innerFramesIndex = 0;
var m_innerMFFrames = new Array(); var m_innerMFFrames = new Array();
var m_innerMFFramesIndex = 0; var m_innerMFFramesIndex = 0;
var m_synchronizePage = false; var m_synchronizePage = false;
var m_synchronizeAvoidDrillDown = false; var m_synchronizeAvoidDrillDown = false;
var m_firstFocusCall = true; var m_firstFocusCall = true;
var m_focusRequestors = new Array(); var m_focusRequestors = new Array();
var m_focusables = new Array(); var m_focusables = new Array();
var m_focusablesCat = new Array(); var m_focusablesCat = new Array();
var m_focusSETIN = undefined; var m_focusSETIN = undefined;
var m_hotKeys = new Array(); var m_hotKeys = new Array();
var m_hotKeysWithCallback = new Array(); var m_hotKeysWithCallback = new Array();
var m_hotKeysWithControlScope = new Array(); var m_hotKeysWithControlScope = new Array();
var m_hotKeysPAGE = new Object(); var m_hotKeysPAGE = new Object();
var m_noProcessingForNextHotKey = false; var m_noProcessingForNextHotKey = false;
var m_tabElements = new Object(); var m_tabElements = new Object();
var m_tabElementsUndefined = new Object(); var m_tabElementsUndefined = new Object();
var m_completeCounter = 0; var m_completeCounter = 0;
var m_cscformOccupied = false; var m_cscformOccupied = false;
var m_cscformxmlstack = new Array(); var m_cscformxmlstack = new Array();
var m_cre1 = "\001"; var m_cre1 = "\001";
var m_cre2 = "\002"; var m_cre2 = "\002";
var m_cre3 = "\003"; var m_cre3 = "\003";
var m_cre4 = "\004"; var m_cre4 = "\004";
var m_cre5 = "\005"; var m_cre5 = "\005";
var m_cre6 = "\006"; var m_cre6 = "\006";
var m_cre35 = "\035"; var m_cre35 = "\035";
var m_cre36 = "\036"; var m_cre36 = "\036";
var m_re1 = new RegExp("\001","g"); var m_re1 = new RegExp("\001","g");
var m_re2 = new RegExp("\002","g"); var m_re2 = new RegExp("\002","g");
var m_re3 = new RegExp("\003","g"); var m_re3 = new RegExp("\003","g");
var m_re4 = new RegExp("\004","g"); var m_re4 = new RegExp("\004","g");
var m_re5 = new RegExp("\005","g"); var m_re5 = new RegExp("\005","g");
var m_re6 = new RegExp("\006","g"); var m_re6 = new RegExp("\006","g");
var m_re35 = new RegExp("\035","g"); var m_re35 = new RegExp("\035","g");
var m_re36 = new RegExp("\036","g"); var m_re36 = new RegExp("\036","g");
var m_blockSubmit = false; var m_blockSubmit = false;
var m_beforeFirstReactOnNewModel = true; var m_beforeFirstReactOnNewModel = true;
var m_firstModel = true; var m_firstModel = true;
var m_continueUpdateModelListeners; var m_continueUpdateModelListeners;
var m_killedItems = 0; var m_killedItems = 0;
var m_pushedContinueMethod; var m_pushedContinueMethod;
var m_bufferedMethodName = "inittini"; var m_bufferedMethodName = "inittini";
var m_noactivityuntil; var m_noactivityuntil;
var m_MLValues = new Array(); var m_MLValues = new Array();
var m_MLSpans = new Array(); var m_MLSpans = new Array();
var m_MLButtons = new Array(); var m_MLButtons = new Array();
var m_MLOptions = new Array(); var m_MLOptions = new Array();
var m_MLImages = new Array(); var m_MLImages = new Array();
var m_MLTabs = new Array(); var m_MLTabs = new Array();
var m_openedAmodals = new Array(); var m_openedAmodals = new Array();
var m_lastStamp = undefined; var m_lastStamp = undefined;
var m_jsversions = new Array(); var m_jsversions = new Array();
var m_jsfiles = new Array(); var m_jsfiles = new Array();
var m_activityTimeout = null; var m_activityTimeout = null;
var m_mozdivs = new Array(); var m_mozdivs = new Array();
function addMozDiv(pd, continueMethod) function addMozDiv(pd, continueMethod)
{ {
if (isIE()) return; if (isIE()) return;
if (pd != null) if (pd != null)
{ {
var o = new Object(); var o = new Object();
o.div = pd; o.div = pd;
o.continueMethod = continueMethod; o.continueMethod = continueMethod;
m_mozdivs.push(o); m_mozdivs.push(o);
} }
else else
addLogMessage("addMozDiv: null inserted"); addLogMessage("addMozDiv: null inserted");
} }
function sizeMozDivs() function sizeMozDivs()
{ {
try try
{ {
if (isIE()) return; if (isIE()) return;
addLogMessage("MOZDIV Starting Setting to 0"); addLogMessage("MOZDIV Starting Setting to 0");
var ikmax = m_mozdivs.length; var ikmax = m_mozdivs.length;
for (var ik = 0; ik < ikmax; ik++) for (var ik = 0; ik < ikmax; ik++)
{ {
try try
{ {
m_mozdivs[ik].CASA_scrollTop = m_mozdivs[ik].div.scrollTop; m_mozdivs[ik].CASA_scrollTop = m_mozdivs[ik].div.scrollTop;
m_mozdivs[ik].div.style.height = "1px"; m_mozdivs[ik].div.style.height = "1px";
} }
catch (eexxccee) { alert("m_mozdivs["+ik+"]" + eexxccee); } catch (eexxccee) { alert("m_mozdivs["+ik+"]" + eexxccee); }
} }
sizeMozDivsContinue(); sizeMozDivsContinue();
} }
catch (eexxcc) catch (eexxcc)
{ {
alert(">>>> sizeMozDivs" + eexxcc); alert(">>>> sizeMozDivs" + eexxcc);
} }
} }
function sizeMozDivsContinue(newHeight) function sizeMozDivsContinue(newHeight)
{ {
for (var i = (m_mozdivs.length - 1); i >= 0; i--) for (var i = (m_mozdivs.length - 1); i >= 0; i--)
{ {
try try
{ {
vpn = m_mozdivs[i].div.parentNode; vpn = m_mozdivs[i].div.parentNode;
vpns = m_mozdivs[i].div.parentNode.style; vpns = m_mozdivs[i].div.parentNode.style;
addLogMessage("MOZDIV setting height: " + m_mozdivs[i].div.id + "/" + vpn.offsetHeight + "/" + m_mozdivs[i].div.offsetTop + "/" + vpn.offsetTop); addLogMessage("MOZDIV setting height: " + m_mozdivs[i].div.id + "/" + vpn.offsetHeight + "/" + m_mozdivs[i].div.offsetTop + "/" + vpn.offsetTop);
m_mozdivs[i].div.style.height = vpn.offsetHeight - m_mozdivs[i].div.style.height = vpn.offsetHeight -
calculatePixelValue(vpns.borderTopWidth) - calculatePixelValue(vpns.borderTopWidth) -
calculatePixelValue(vpns.borderBottomWidth) - calculatePixelValue(vpns.borderBottomWidth) -
calculatePixelValue(vpns.paddingTop) - calculatePixelValue(vpns.paddingTop) -
calculatePixelValue(vpns.paddingBottom); calculatePixelValue(vpns.paddingBottom);
if (vpn.vAlign != 'top') vpn.vAlign = "top"; if (vpn.vAlign != 'top') vpn.vAlign = "top";
var vy = m_mozdivs[i].div.top;   var vy = m_mozdivs[i].div.top;  
var vst = m_mozdivs[i].CASA_scrollTop; var vst = m_mozdivs[i].CASA_scrollTop;
if (vst != null && vst != 0) m_mozdivs[i].div.scrollTop = vst; if (vst != null && vst != 0) m_mozdivs[i].div.scrollTop = vst;
} catch (eexxcc) { alert(eexxcc + "in " + m_mozdivs[i].div.id); } } catch (eexxcc) { alert(eexxcc + "in " + m_mozdivs[i].div.id); }
} }
for (var j = (m_mozdivs.length - 1); j >= 0; j--) for (var j = (m_mozdivs.length - 1); j >= 0; j--)
{ {
try try
{ {
if (m_mozdivs[j].continueMethod != null) if (m_mozdivs[j].continueMethod != null)
m_mozdivs[j].continueMethod(); m_mozdivs[j].continueMethod();
} catch (eexxcc) { alert(eexxcc + "in " + m_mozdivs[j].div.id); } } catch (eexxcc) { alert(eexxcc + "in " + m_mozdivs[j].div.id); }
} }
} }
function calculatePixelValue(p) function calculatePixelValue(p)
{ {
if (p == null) return 0; if (p == null) return 0;
if (p.indexOf("px") > 0) return p.substring(0,p.length-2)*1; if (p.indexOf("px") > 0) return p.substring(0,p.length-2)*1;
try { return p*1; } catch (eexxcc) {} try { return p*1; } catch (eexxcc) {}
return 0; return 0;
} }
function outputFrameHierarchy() function outputFrameHierarchy()
{ {
var vcur = this; var vcur = this;
var vstr = ""; var vstr = "";
var vcount = 1; var vcount = 1;
while (true) while (true)
{ {
vstr += "(" + vcount + ") " + vcur.location.href + "\n"; vstr += "(" + vcount + ") " + vcur.location.href + "\n";
var vtmp = vcur.parent; var vtmp = vcur.parent;
if (vtmp == null) break; if (vtmp == null) break;
if (vtmp == vcur) break; if (vtmp == vcur) break;
vcur = vtmp; vcur = vtmp;
vcount++; vcount++;
} }
alert("FRAME HIERARCHY:\n\n" + vstr); alert("FRAME HIERARCHY:\n\n" + vstr);
} }
function outputHotkeys() function outputHotkeys()
{ {
var vstr = "HOTKEYS\n===============================\n\n"; var vstr = "HOTKEYS\n===============================\n\n";
var ctrl = replaceLiteralTRANSLATION(m_language, "CTRL")+"+"; var ctrl = replaceLiteralTRANSLATION(m_language, "CTRL")+"+";
var alt = replaceLiteralTRANSLATION(m_language, "ALT")+"+"; var alt = replaceLiteralTRANSLATION(m_language, "ALT")+"+";
var shift = replaceLiteralTRANSLATION(m_language, "SHIFT")+"+"; var shift = replaceLiteralTRANSLATION(m_language, "SHIFT")+"+";
var vcount = 1; var vcount = 1;
for (var i=0; i<m_hotKeys.length; i++) for (var i=0; i<m_hotKeys.length; i++)
{ {
h = m_hotKeys[i]; h = m_hotKeys[i];
vstr+= "("+vcount+") "; vstr+= "("+vcount+") ";
if (h.ctrlKey == true) vstr+= ctrl; if (h.ctrlKey == true) vstr+= ctrl;
if (h.altKey == true) vstr+= alt; if (h.altKey == true) vstr+= alt;
if (h.shiftKey == true) vstr+= shift; if (h.shiftKey == true) vstr+= shift;
vstr += h.keyCode+" ==> "+h.method+" (PAGE)\n"; vstr += h.keyCode+" ==> "+h.method+" (PAGE)\n";
vcount++; vcount++;
} }
for (var i=0; i<m_hotKeysWithCallback.length; i++) for (var i=0; i<m_hotKeysWithCallback.length; i++)
{ {
vstr+= "("+vcount+") "; vstr+= "("+vcount+") ";
if (m_hotKeyCode.indexOf("17")>=0) vstr+= ctrl; if (m_hotKeyCode.indexOf("17")>=0) vstr+= ctrl;
if (m_hotKeyCode.indexOf("18")>=0) vstr+= alt; if (m_hotKeyCode.indexOf("18")>=0) vstr+= alt;
if (m_hotKeyCode.indexOf("16")>=0) vstr+= shift; if (m_hotKeyCode.indexOf("16")>=0) vstr+= shift;
vstr += m_hotKeysWithCallback[i].keyCode; vstr += m_hotKeysWithCallback[i].keyCode;
m = ""+m_hotKeysWithCallback[i].callbackMethod; m = ""+m_hotKeysWithCallback[i].callbackMethod;
if (m.indexOf("anonymous")>0) if (m.indexOf("anonymous")>0)
{ {
indexOfC = m.indexOf("C."); indexOfC = m.indexOf("C.");
if (indexOfC>0) vstr += " ==> "+m.substring(indexOfC, m.indexOf(")", indexOfC)+1); if (indexOfC>0) vstr += " ==> "+m.substring(indexOfC, m.indexOf(")", indexOfC)+1);
else vstr += " ==> "+m; else vstr += " ==> "+m;
} }
else else
{ {
vstr += " ==> "+m; vstr += " ==> "+m;
} }
vstr += " (PAGE)\n"; vstr += " (PAGE)\n";
vcount++; vcount++;
} }
for (var i=0; i<m_hotKeysWithControlScope.length; i++) for (var i=0; i<m_hotKeysWithControlScope.length; i++)
{ {
vstr+= "("+vcount+") "; vstr+= "("+vcount+") ";
h = m_hotKeysWithControlScope[i]; h = m_hotKeysWithControlScope[i];
if (h.ctrlKey == true) vstr+= ctrl; if (h.ctrlKey == true) vstr+= ctrl;
if (h.altKey == true) vstr+= alt; if (h.altKey == true) vstr+= alt;
if (h.shiftKey == true) vstr+= shift; if (h.shiftKey == true) vstr+= shift;
if (h.keyCode.charAt(0) == "$") if (h.keyCode.charAt(0) == "$")
vstr += getPropertyValue(h.keyCode); vstr += getPropertyValue(h.keyCode);
else else
vstr += h.keyCode; vstr += h.keyCode;
vstr += " ==> "+h.method+" ("+h.controlInfo+")\n"; vstr += " ==> "+h.method+" ("+h.controlInfo+")\n";
vcount++; vcount++;
} }
alert(vstr); alert(vstr);
} }
function deactivatePage() function deactivatePage()
{ {
m_pageInactive = true; m_pageInactive = true;
for (var i=0; i<m_openedAmodals.length; i++) for (var i=0; i<m_openedAmodals.length; i++)
{ {
try try
{ {
m_openedAmodals[i].close(); m_openedAmodals[i].close();
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
m_openedAmodals = new Array(); m_openedAmodals = new Array();
for (var ifi=0; ifi<m_innerFrames.length; ifi++) for (var ifi=0; ifi<m_innerFrames.length; ifi++)
{ {
try try
{ {
m_innerFrames[ifi].WORKAREA.csciframe.deactivatePage(); m_innerFrames[ifi].WORKAREA.csciframe.deactivatePage();
} }
catch (exc) { } catch (exc) { }
} }
} }
function checkIfPageIsDeactivated() { return m_pageInactive; } function checkIfPageIsDeactivated() { return m_pageInactive; }
function initGlobals() function initGlobals()
{ {
if (m_firstUsage == true) if (m_firstUsage == true)
{ {
m_firstUsage = false; m_firstUsage = false;
return; return;
} }
m_modelName = undefined; m_modelName = undefined;
m_modelId = undefined; m_modelId = undefined;
m_sessionId = undefined; m_sessionId = undefined;
m_processId = undefined; m_processId = undefined;
m_pageName = "dummy"; m_pageName = "dummy";
m_modelListeners = new Array(); m_modelListeners = new Array();
m_modelListenersLast = new Array(); m_modelListenersLast = new Array();
m_propertyListeners = new Array(); m_propertyListeners = new Array();
m_propertyListenersTBP = new Array(); m_propertyListenersTBP = new Array();
m_statuspropListeners = new Array(); m_statuspropListeners = new Array();
m_dcListeners = new Array(); m_dcListeners = new Array();
m_properties = undefined; m_properties = undefined;
m_model = undefined; m_model = undefined;
m_currentArray = undefined; m_currentArray = undefined;
m_currentRow = undefined; m_currentRow = undefined;
m_changedPropertyNames = undefined; m_changedPropertyNames = undefined;
m_internalProperties = new Array(); m_internalProperties = new Array();
m_bufferNeedsRefresh = false; m_bufferNeedsRefresh = false;
m_processCasabacSynchronizeIfNecessary = false; m_processCasabacSynchronizeIfNecessary = false;
m_headerObjects = new Array(); m_headerObjects = new Array();
m_footerObjects = new Array(); m_footerObjects = new Array();
m_clickAwayObjects = new Array(); m_clickAwayObjects = new Array();
m_clickAwayMethods = new Array(); m_clickAwayMethods = new Array();
m_avoidClickAway = false; m_avoidClickAway = false;
m_isremoved = false; m_isremoved = false;
m_modelDeltaId = "inittini"; m_modelDeltaId = "inittini";
m_calledInPopup = false; m_calledInPopup = false;
casaPopupParameters = null; casaPopupParameters = null;
casaPopupReturnValue = null; casaPopupReturnValue = null;
m_bufferedxml = null; m_bufferedxml = null;
m_validationErrors = new Array(); m_validationErrors = new Array();
m_inEditMode = null; m_inEditMode = null;
m_lastProcessedEventX = -1; m_lastProcessedEventX = -1;
m_lastProcessedEventY= -1; m_lastProcessedEventY= -1;
m_continueMethod = null; m_continueMethod = null;
m_innerFrames = new Array(); m_innerFrames = new Array();
m_innerFramesIndex = 0; m_innerFramesIndex = 0;
m_innerMFFrames = new Array(); m_innerMFFrames = new Array();
m_innerMFFramesIndex = 0; m_innerMFFramesIndex = 0;
m_synchronizePage = false; m_synchronizePage = false;
m_firstFocusCall = true; m_firstFocusCall = true;
m_focusRequestors = new Array(); m_focusRequestors = new Array();
m_focusables = new Array(); m_focusables = new Array();
m_focusablesCat = new Array(); m_focusablesCat = new Array();
m_focusSETIN = undefined; m_focusSETIN = undefined;
m_hotKeys = new Array(); m_hotKeys = new Array();
m_hotKeysWithCallback = new Array(); m_hotKeysWithCallback = new Array();
m_hotKeysWithControlScope = new Array(); m_hotKeysWithControlScope = new Array();
m_hotKeysPAGE = new Object(); m_hotKeysPAGE = new Object();
m_noProcessingForNextHotKey = false; m_noProcessingForNextHotKey = false;
m_tabElements = new Object(); m_tabElements = new Object();
m_tabElementsUndefined = new Object(); m_tabElementsUndefined = new Object();
m_completeCounter = 0; m_completeCounter = 0;
m_cscformOccupied = false; m_cscformOccupied = false;
m_cscformxmlstack = new Array(); m_cscformxmlstack = new Array();
m_blockSubmit = false; m_blockSubmit = false;
m_beforeFirstReactOnNewModel = true; m_beforeFirstReactOnNewModel = true;
m_firstModel = true; m_firstModel = true;
m_continueUpdateModelListeners = undefined; m_continueUpdateModelListeners = undefined;
m_killedItems = 0; m_killedItems = 0;
m_pushedContinueMethod = undefined; m_pushedContinueMethod = undefined;
m_bufferedMethodName = "inittini"; m_bufferedMethodName = "inittini";
m_MLValues = new Array(); m_MLValues = new Array();
m_MLSpans = new Array(); m_MLSpans = new Array();
m_MLTabs = new Array(); m_MLTabs = new Array();
m_MLButtons = new Array(); m_MLButtons = new Array();
m_MLOptions = new Array(); m_MLOptions = new Array();
m_MLImages = new Array(); m_MLImages = new Array();
m_openedAmodals = new Array(); m_openedAmodals = new Array();
m_lastStamp = undefined; m_lastStamp = undefined;
m_activityTimeout = null; m_activityTimeout = null;
m_dateInputPopupFrame = null; m_dateInputPopupFrame = null;
} }
function initCasaControl(pcc) function initCasaControl(pcc)
{ {
for (var vname in pcc) for (var vname in pcc)
if (vname.indexOf("CASA_") >= 0) if (vname.indexOf("CASA_") >= 0)
pcc[vname] = undefined; pcc[vname] = undefined;
} }
function findVisibleValue(pVal) function findVisibleValue(pVal)
{ {
if (pVal != null) return pVal; if (pVal != null) return pVal;
if (parent.m_visiblevalueifundefined == undefined) return pVal; if (parent.m_visiblevalueifundefined == undefined) return pVal;
return parent.m_visiblevalueifundefined; return parent.m_visiblevalueifundefined;
} }
function CL() function CL()
{ {
var vresult = m_parentparent.m_centralLib; var vresult = m_parentparent.m_centralLib;
return vresult; return vresult;
} }
function findParentNodeWithTag(pControl,pTagName) function findParentNodeWithTag(pControl,pTagName)
{ {
if (pControl == null) return null; if (pControl == null) return null;
vParent = pControl.parentNode; vParent = pControl.parentNode;
if (vParent.tagName == pTagName) return vParent; if (vParent.tagName == pTagName) return vParent;
if (vParent == pControl)  return null; if (vParent == pControl)  return null;
return findParentNodeWithTag(vParent,pTagName); return findParentNodeWithTag(vParent,pTagName);
} }
function calculatePageOffset(pControl) function calculatePageOffset(pControl)
{ {
var vControl = pControl; var vControl = pControl;
var vLeft = 0; var vLeft = 0;
var vTop = 0; var vTop = 0;
while (true) while (true)
{ {
try try
{ {
if (vControl == null) break; if (vControl == null) break;
vLeft = vLeft + vControl.offsetLeft - vControl.scrollLeft; vLeft = vLeft + vControl.offsetLeft - vControl.scrollLeft;
vTop = vTop + vControl.offsetTop - vControl.scrollTop; vTop = vTop + vControl.offsetTop - vControl.scrollTop;
var vTemp = vControl.offsetParent; var vTemp = vControl.offsetParent;
if (vControl == vTemp) break; if (vControl == vTemp) break;
vControl = vTemp; vControl = vTemp;
} }
catch (exc) catch (exc)
{ {
break; break;
} }
} }
pControl.CASA_pageoffsetleft = vLeft; pControl.CASA_pageoffsetleft = vLeft;
pControl.CASA_pageoffsettop = vTop; pControl.CASA_pageoffsettop = vTop;
} }
function checkIfStringEndsWith(instring, searchstring) function checkIfStringEndsWith(instring, searchstring)
{ {
if (instring == null || searchstring == null) return false; if (instring == null || searchstring == null) return false;
var index = instring.indexOf(searchstring); var index = instring.indexOf(searchstring);
if (index == -1) return false; if (index == -1) return false;
return (index-0+searchstring.length) == instring.length; return (index-0+searchstring.length) == instring.length;
} }
var mm_openCasabacPageAsModalPopup = null; var mm_openCasabacPageAsModalPopup = null;
function openCasabacPageAsModalPopup(pPage,pWidth,pHeight) function openCasabacPageAsModalPopup(pPage,pWidth,pHeight)
{ {
if (mm_openCasabacPageAsModalPopup == null) mm_openCasabacPageAsModalPopup = CL().C_openCasabacPageAsModalPopup; if (mm_openCasabacPageAsModalPopup == null) mm_openCasabacPageAsModalPopup = CL().C_openCasabacPageAsModalPopup;
return mm_openCasabacPageAsModalPopup(this,pPage,pWidth,pHeight);  return mm_openCasabacPageAsModalPopup(pPage,pWidth,pHeight); 
} }
function setPageName(pageName) function setPageName(pageName)
{ {
m_pageName = pageName; m_pageName = pageName;
} }
function reactOnInit() function reactOnInit()
{ {
if (parent.parent.m_centralLib == null) { document.location.href = '../../HTMLBasedGUI/general/aboutBlank.html'; return; } if (parent.parent.m_centralLib == null) { document.location.href = '../../HTMLBasedGUI/general/aboutBlank.html'; return; }
parent.reactOnInit(); parent.reactOnInit();
} }
function convertDoubleTildeToUTag(pText) function convertDoubleTildeToUTag(pText)
{ {
if (pText == null) if (pText == null)
return null; return null;
if (pText.indexOf("~~")<0) if (pText.indexOf("~~")<0)
return pText; return pText;
var vResult = new Array(); var vResult = new Array();
var vStart = 0; var vStart = 0;
var vEnd = pText.indexOf("~~"); var vEnd = pText.indexOf("~~");
while (vEnd >= 0 && (vEnd+2)<pText.length) while (vEnd >= 0 && (vEnd+2)<pText.length)
{ {
vResult.push(pText.substring(vStart, vEnd)); vResult.push(pText.substring(vStart, vEnd));
vResult.push("<u>"); vResult.push("<u>");
vResult.push(pText.charAt(vEnd+2)); vResult.push(pText.charAt(vEnd+2));
vResult.push("</u>"); vResult.push("</u>");
vStart = vEnd + 3; vStart = vEnd + 3;
vEnd = pText.indexOf("~~", vStart); vEnd = pText.indexOf("~~", vStart);
} }
vResult.push(pText.substring(vStart, pText.length)); vResult.push(pText.substring(vStart, pText.length));
return vResult.join(""); return vResult.join("");
} }
function reactOnResizePAGEBODY(casacontrol) function reactOnResizePAGEBODY(casacontrol)
{ {
if (casacontrol.CASA_firstresize == undefined && isIE()) if (casacontrol.CASA_firstresize == undefined && isIE())
{ {
casacontrol.CASA_firstresize = false; casacontrol.CASA_firstresize = false;
return; return;
} }
var vHeight; var vHeight;
if (isIE()) if (isIE())
vHeight = m_parentdocumentbody.clientHeight; vHeight = m_parentdocumentbody.clientHeight;
else else
{ {
vHeight = parent.innerHeight; vHeight = parent.innerHeight;
if (casacontrol.CASA_paddingtop != undefined) vHeight = vHeight-casacontrol.CASA_paddingtop; if (casacontrol.CASA_paddingtop != undefined) vHeight = vHeight-casacontrol.CASA_paddingtop;
if (casacontrol.CASA_paddingbottom != undefined) vHeight = vHeight-casacontrol.CASA_paddingbottom; if (casacontrol.CASA_paddingbottom != undefined) vHeight = vHeight-casacontrol.CASA_paddingbottom;
} }
vHeight = vHeight - calculateHeaderHeight() - calculateFooterHeight(); vHeight = vHeight - calculateHeaderHeight() - calculateFooterHeight();
if (vHeight < 0) vHeight = 0; if (vHeight < 0) vHeight = 0;
var vWidth; var vWidth;
if (isIE()) if (isIE())
vWidth = m_parentdocumentbody.clientWidth; vWidth = m_parentdocumentbody.clientWidth;
else else
{ {
vWidth = parent.innerWidth; vWidth = parent.innerWidth;
if (casacontrol.CASA_paddingleft != undefined) vWidth = vWidth-casacontrol.CASA_paddingleft; if (casacontrol.CASA_paddingleft != undefined) vWidth = vWidth-casacontrol.CASA_paddingleft;
if (casacontrol.CASA_paddingright != undefined) vWidth = vWidth-casacontrol.CASA_paddingright; if (casacontrol.CASA_paddingright != undefined) vWidth = vWidth-casacontrol.CASA_paddingright;
} }
if (casacontrol.CASA_bufferedHeight == vHeight && casacontrol.CASA_bufferedWidth == vWidth) return; if (casacontrol.CASA_bufferedHeight == vHeight && casacontrol.CASA_bufferedWidth == vWidth) return;
casacontrol.CASA_bufferedHeight = vHeight; casacontrol.CASA_bufferedHeight = vHeight;
casacontrol.CASA_bufferedWidth = vWidth; casacontrol.CASA_bufferedWidth = vWidth;
passPagePixelSize(vWidth,vHeight); passPagePixelSize(vWidth,vHeight);
casacontrol.style.height = vHeight; casacontrol.style.height = vHeight;
casacontrol.style.width = vWidth; casacontrol.style.width = vWidth;
sizeMozDivs(); sizeMozDivs();
} }
function passPagePixelSize(pWidth,pHeight) function passPagePixelSize(pWidth,pHeight)
{ {
if (pHeight <= 0) if (pHeight <= 0)
{ {
if (isIE()) pHeight = m_parentdocumentbody.clientHeight; if (isIE()) pHeight = m_parentdocumentbody.clientHeight;
else pHeight = parent.innerHeight; else pHeight = parent.innerHeight;
} }
if (pWidth <= 0) if (pWidth <= 0)
{ {
if (isIE()) pWidth = m_parentdocumentbody.clientWidth; if (isIE()) pWidth = m_parentdocumentbody.clientWidth;
else pWidth = parent.innerWidth; else pWidth = parent.innerWidth;
} }
setPropertyValue("pagePixelHeight",pHeight); setPropertyValue("pagePixelHeight",pHeight);
setPropertyValue("pagePixelWidth",pWidth); setPropertyValue("pagePixelWidth",pWidth);
} }
m_firstMozillaSwitch = true; m_firstMozillaSwitch = true;
function switchToOccupiedPAGE() function switchToOccupiedPAGE()
{ {
parent.m_blockIO = true; parent.m_blockIO = true;
parent.CasaOCCUPIED.style.display = ""; parent.CasaOCCUPIED.style.display = "";
} }
function switchToDisplayPAGE() function switchToDisplayPAGE()
{ {
m_cscformOccupied = false; m_cscformOccupied = false;
parent.m_blockIO = false; parent.m_blockIO = false;
parent.m_blockIOByFlush = false; parent.m_blockIOByFlush = false;
parent.CasaPAGE.style.display = ''; parent.CasaPAGE.style.display = '';
parent.CasaOCCUPIED.style.display = ""; parent.CasaOCCUPIED.style.display = "";
parent.CasaOCCUPIED.style.display = "none"; parent.CasaOCCUPIED.style.display = "none";
if (!isIE() && m_firstMozillaSwitch == true) if (!isIE() && m_firstMozillaSwitch == true)
{ {
parent.reactOnResize(); parent.reactOnResize();
m_firstMozillaSwitch = false; m_firstMozillaSwitch = false;
} }
if (parent.CasaLOADING.style.display == '') if (parent.CasaLOADING.style.display == '')
parent.CasaLOADING.style.display = 'none'; parent.CasaLOADING.style.display = 'none';
} }
var mm_startDragCL = null; var mm_startDragCL = null;
function startDragCL(dropInfo,innerHTML,evt,isIE,tt,useTT) function startDragCL(dropInfo,innerHTML,evt,isIE,tt,useTT)
{ {
if (mm_startDragCL == null) mm_startDragCL = CL().C_startDrag; if (mm_startDragCL == null) mm_startDragCL = CL().C_startDrag;
return mm_startDragCL(this,dropInfo,innerHTML,evt,isIE,tt,useTT);  return mm_startDragCL(dropInfo,innerHTML,evt,isIE,tt,useTT); 
} }
var mm_setDragShift = null; var mm_setDragShift = null;
function setDragShift(shiftLeft,shiftTop,dragDropFunction) function setDragShift(shiftLeft,shiftTop,dragDropFunction)
{ {
if (mm_setDragShift == null) mm_setDragShift = CL().C_setDragShift; if (mm_setDragShift == null) mm_setDragShift = CL().C_setDragShift;
return mm_setDragShift(this,shiftLeft,shiftTop,dragDropFunction);  return mm_setDragShift(shiftLeft,shiftTop,dragDropFunction); 
} }
var mm_moveDragCL = null; var mm_moveDragCL = null;
function moveDragCL(evt) function moveDragCL(evt)
{ {
if (mm_moveDragCL == null) mm_moveDragCL = CL().C_moveDrag; if (mm_moveDragCL == null) mm_moveDragCL = CL().C_moveDrag;
return mm_moveDragCL(this,evt);  return mm_moveDragCL(evt); 
} }
var mm_checkIfDragProcessIsActiveCL = null; var mm_checkIfDragProcessIsActiveCL = null;
function checkIfDragProcessIsActiveCL() function checkIfDragProcessIsActiveCL()
{ {
if (mm_checkIfDragProcessIsActiveCL == null) mm_checkIfDragProcessIsActiveCL = CL().C_checkIfDragProcessIsActive; if (mm_checkIfDragProcessIsActiveCL == null) mm_checkIfDragProcessIsActiveCL = CL().C_checkIfDragProcessIsActive;
return mm_checkIfDragProcessIsActiveCL(this);  return mm_checkIfDragProcessIsActiveCL(); 
} }
var mm_endDragCL = null; var mm_endDragCL = null;
function endDragCL(evt) function endDragCL(evt)
{ {
if (mm_endDragCL == null) mm_endDragCL = CL().C_endDrag; if (mm_endDragCL == null) mm_endDragCL = CL().C_endDrag;
return mm_endDragCL(this,evt);  return mm_endDragCL(evt); 
} }
function startDragPAGE(casadragdrop,dragHTML,eve) function startDragPAGE(casadragdrop,dragHTML,eve)
{ {
try try
{ {
parent.m_dragMode = true; parent.m_dragMode = true;
casadragdrop.innerHTML = dragHTML; casadragdrop.innerHTML = dragHTML;
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
function setDragShiftPAGE(shiftLeft,shiftTop) function setDragShiftPAGE(shiftLeft,shiftTop)
{ {
parent.m_dragIconShiftLeft = shiftLeft; parent.m_dragIconShiftLeft = shiftLeft;
parent.m_dragIconShiftTop = shiftTop; parent.m_dragIconShiftTop = shiftTop;
} }
function moveDragPAGE(casadragdrop,eve) function moveDragPAGE(casadragdrop,eve)
{ {
try try
{ {
if (checkIfDragProcessIsActiveCL()) if (checkIfDragProcessIsActiveCL())
{ {
moveDragCL(eve); moveDragCL(eve);
return; return;
} }
if (parent.m_dragMode == false) return; if (parent.m_dragMode == false) return;
casadragdrop.style.display = ""; casadragdrop.style.display = "";
if (parent.m_dragType == "RESIZABLE") if (parent.m_dragType == "RESIZABLE")
{ {
var vCC = parent.m_dragRsizable; var vCC = parent.m_dragRsizable;
casadragdrop.style.top = vCC.CASA_posY; casadragdrop.style.top = vCC.CASA_posY;
casadragdrop.style.left = eve.clientX; casadragdrop.style.left = eve.clientX;
} }
else if (parent.m_dragType == "COLMOVE") else if (parent.m_dragType == "COLMOVE")
{ {
var vCC = parent.m_dragRsizable; var vCC = parent.m_dragRsizable;
casadragdrop.style.top = vCC.CASA_posY; casadragdrop.style.top = vCC.CASA_posY;
var eventX = eve.clientX;; var eventX = eve.clientX;;
if (vCC.CASA_posXMin > eventX) if (vCC.CASA_posXMin > eventX)
casadragdrop.style.left = vCC.CASA_posXMin; casadragdrop.style.left = vCC.CASA_posXMin;
else if (vCC.CASA_posXMax < eventX) else if (vCC.CASA_posXMax < eventX)
casadragdrop.style.left = vCC.CASA_posXMax; casadragdrop.style.left = vCC.CASA_posXMax;
else else
casadragdrop.style.left = eventX-10; casadragdrop.style.left = eventX-10;
} }
else if (parent.m_dragType == "VSPLIT") else if (parent.m_dragType == "VSPLIT")
{ {
var vCC = parent.document.getElementById("VSPLIT" + parent.m_dragId); var vCC = parent.document.getElementById("VSPLIT" + parent.m_dragId);
casadragdrop.style.top = vCC.CASA_posY; casadragdrop.style.top = vCC.CASA_posY;
var eventX = eve.clientX;; var eventX = eve.clientX;;
if (vCC.CASA_posXMin > eventX) if (vCC.CASA_posXMin > eventX)
casadragdrop.style.left = vCC.CASA_posXMin; casadragdrop.style.left = vCC.CASA_posXMin;
else if (vCC.CASA_posXMax < eventX) else if (vCC.CASA_posXMax < eventX)
casadragdrop.style.left = vCC.CASA_posXMax; casadragdrop.style.left = vCC.CASA_posXMax;
else else
casadragdrop.style.left = eventX; casadragdrop.style.left = eventX;
} }
else if (parent.m_dragType == "HSPLIT") else if (parent.m_dragType == "HSPLIT")
{ {
var vCC = parent.document.getElementById("HSPLIT" + parent.m_dragId); var vCC = parent.document.getElementById("HSPLIT" + parent.m_dragId);
casadragdrop.style.left = vCC.CASA_posX; casadragdrop.style.left = vCC.CASA_posX;
var eventY = eve.clientY; var eventY = eve.clientY;
if (vCC.CASA_posYMin > eventY-3) if (vCC.CASA_posYMin > eventY-3)
casadragdrop.style.top = vCC.CASA_posYMin; casadragdrop.style.top = vCC.CASA_posYMin;
else if (vCC.CASA_posYMax < eventY) else if (vCC.CASA_posYMax < eventY)
casadragdrop.style.top = vCC.CASA_posYMax; casadragdrop.style.top = vCC.CASA_posYMax;
else else
casadragdrop.style.top = eventY; casadragdrop.style.top = eventY;
} }
else if (parent.m_dragType == "CHARTAREA") else if (parent.m_dragType == "CHARTAREA")
{ {
casadragdrop.style.left = eve.clientX+parent.m_dragIconShiftLeft; casadragdrop.style.left = eve.clientX+parent.m_dragIconShiftLeft;
casadragdrop.style.top = eve.clientY+parent.m_dragIconShiftTop; casadragdrop.style.top = eve.clientY+parent.m_dragIconShiftTop;
} }
else else
{ {
casadragdrop.style.left = eve.clientX+10; casadragdrop.style.left = eve.clientX+10;
casadragdrop.style.top = eve.clientY+10; casadragdrop.style.top = eve.clientY+10;
} }
if (this.isIE() == true) if (this.isIE() == true)
this.parent.document.selection.empty(); this.parent.document.selection.empty();
else else
this.parent.window.getSelection().removeAllRanges(); this.parent.window.getSelection().removeAllRanges();
return false; return false;
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
function endDragPAGE(casadragdrop,eve) function endDragPAGE(casadragdrop,eve)
{ {
if (checkIfDragProcessIsActiveCL()) if (checkIfDragProcessIsActiveCL())
{ {
endDragCL(eve); endDragCL(eve);
return; return;
} }
try try
{ {
m_parentdocumentbody.style.cursor = ''; m_parentdocumentbody.style.cursor = '';
casadragdrop.style.display = 'none'; casadragdrop.style.display = 'none';
parent.m_dragMode = false; parent.m_dragMode = false;
parent.m_dragId = null; parent.m_dragId = null;
parent.m_dropMethod = null; parent.m_dropMethod = null;
parent.m_dragType = null; parent.m_dragType = null;
return true; return true;
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
function registerValidationError(cc) function registerValidationError(cc)
{ {
cc.CASA_cscValidationErrorStamp = "FIELD"; cc.CASA_cscValidationErrorStamp = "FIELD";
m_validationErrors.push(cc); m_validationErrors.push(cc);
} }
function registerValidationErrorForDateInput(cc) function registerValidationErrorForDateInput(cc)
{ {
cc.CASA_cscValidationErrorStamp = "DATEINPUT"; cc.CASA_cscValidationErrorStamp = "DATEINPUT";
m_validationErrors.push(cc); m_validationErrors.push(cc);
} }
function unregisterValidationError(cc) function unregisterValidationError(cc)
{ {
var vTmp = new Array(); var vTmp = new Array();
for (var vI = 0; vI < m_validationErrors.length; vI++) for (var vI = 0; vI < m_validationErrors.length; vI++)
if (m_validationErrors[vI] != cc) if (m_validationErrors[vI] != cc)
vTmp.push(m_validationErrors[vI]); vTmp.push(m_validationErrors[vI]);
m_validationErrors = vTmp; m_validationErrors = vTmp;
} }
function checkAllValidations() function checkAllValidations()
{ {
for (var ifi=0; ifi<m_innerFrames.length; ifi++) for (var ifi=0; ifi<m_innerFrames.length; ifi++)
{ {
try try
{ {
var ifOK = m_innerFrames[ifi].WORKAREA.csciframe.checkAllValidations(); var ifOK = m_innerFrames[ifi].WORKAREA.csciframe.checkAllValidations();
if (ifOK == false) return false; if (ifOK == false) return false;
} }
catch (exc) { } catch (exc) { }
} }
if (m_validationErrors.length == 0) return true; if (m_validationErrors.length == 0) return true;
var msg =  replaceLiteralTRANSLATION(m_language, "labelNoValidPage"); var msg =  replaceLiteralTRANSLATION(m_language, "labelNoValidPage");
if (confirm(msg)) if (confirm(msg))
{ {
resetValidationErrors(); resetValidationErrors();
return true; return true;
} }
return false; return false;
} }
function resetValidationErrors() function resetValidationErrors()
{ {
for (var vI = 0; vI < m_validationErrors.length; vI++) for (var vI = 0; vI < m_validationErrors.length; vI++)
{ {
var cc = m_validationErrors[vI]; var cc = m_validationErrors[vI];
if (cc.CASA_cscValidationErrorStamp == "DATEINPUT") if (cc.CASA_cscValidationErrorStamp == "DATEINPUT")
resetValidationErrorDI(cc); resetValidationErrorDI(cc);
else else
resetValidationErrorFIELD(cc); resetValidationErrorFIELD(cc);
} }
m_validationErrors = new Array(); m_validationErrors = new Array();
} }
function addLogMessage(logMessage) function addLogMessage(logMessage)
{ {
vDate = new Date(); vDate = new Date();
m_logStrings[m_logIndex] = logMessage; m_logStrings[m_logIndex] = logMessage;
m_logDates[m_logIndex] = vDate; m_logDates[m_logIndex] = vDate;
m_logIndex++; m_logIndex++;
if (m_logIndex > 999) m_logIndex = 0; if (m_logIndex > 999) m_logIndex = 0;
} }
var mm_outputLog = null; var mm_outputLog = null;
function outputLog(pAbbreviated) function outputLog(pAbbreviated)
{ {
if (mm_outputLog == null) mm_outputLog = CL().C_outputLog; if (mm_outputLog == null) mm_outputLog = CL().C_outputLog;
return mm_outputLog(this,pAbbreviated);  return mm_outputLog(pAbbreviated); 
} }
function outputWorkareaBufferLog() function outputWorkareaBufferLog()
{ {
var vout = "WORKAREABUFFER\n\n"; var vout = "WORKAREABUFFER\n\n";
for (var i=0; i<m_parentparent.m_wainfos.length; i++) for (var i=0; i<m_parentparent.m_wainfos.length; i++)
vout += m_parentparent.m_wainfos[i] + "\n"; vout += m_parentparent.m_wainfos[i] + "\n";
vout += "\n\*********************************************-\n"; vout += "\n\*********************************************-\n";
vout += "\n\LIVING POPUPs\n\n"; vout += "\n\LIVING POPUPs\n\n";
var vPopups = CL().m_popupPages; var vPopups = CL().m_popupPages;
for (var i=0; i<vPopups.length; i++) for (var i=0; i<vPopups.length; i++)
{ {
vout +=  "["+i+"]"+vPopups[i].window.location.href+"\n\n"; vout +=  "["+i+"]"+vPopups[i].window.location.href+"\n\n";
} }
alert(vout); alert(vout);
} }
function convertCasabacURL(urlString) function convertCasabacURL(urlString)
{ {
if (urlString == null) return null; if (urlString == null) return null;
if (urlString.charAt(0) == '/') return m_parentparent.m_currentWebApp + urlString; if (urlString.charAt(0) == '/') return m_parentparent.m_currentWebApp + urlString;
return urlString; return urlString;
} }
function isIE() function isIE()
{ {
if (m_isIE == undefined) if (m_isIE == undefined)
{ {
if (navigator.appName == "Netscape") m_isIE = false; if (navigator.appName == "Netscape") m_isIE = false;
else m_isIE = true; else m_isIE = true;
} }
return m_isIE; return m_isIE;
} }
function findRollInEventName() function findRollInEventName()
{ {
if (isIE() == true) if (isIE() == true)
return "onmouseenter"; return "onmouseenter";
else else
return "onmouseover"; return "onmouseover";
} }
function findRollOutEventName() function findRollOutEventName()
{ {
if (isIE() == true) if (isIE() == true)
return "onmouseleave"; return "onmouseleave";
else else
return "onmouseout"; return "onmouseout";
} }
function findSrcElement(evt) function findSrcElement(evt)
{ {
if (evt == null) return null; if (evt == null) return null;
if(isIE()) if(isIE())
return evt.srcElement; return evt.srcElement;
var srcElement; var srcElement;
if (evt && evt.target) if (evt && evt.target)
{ {
srcElement = evt.target; srcElement = evt.target;
while (srcElement.nodeType != 1) while (srcElement.nodeType != 1)
srcElement = srcElement.parentNode; srcElement = srcElement.parentNode;
} }
return srcElement; return srcElement;
} }
var mm_controlSelected = null; var mm_controlSelected = null;
function controlSelected(controlid,selectevent) function controlSelected(controlid,selectevent)
{ {
if (mm_controlSelected == null) mm_controlSelected = CL().C_controlSelected; if (mm_controlSelected == null) mm_controlSelected = CL().C_controlSelected;
return mm_controlSelected(this,controlid,selectevent);  return mm_controlSelected(controlid,selectevent); 
} }
function avoidNextSynchronizationDrillDown() function avoidNextSynchronizationDrillDown()
{ {
m_synchronizeAvoidDrillDown = true; m_synchronizeAvoidDrillDown = true;
} }
function addInnerFrame(innerFrame) function addInnerFrame(innerFrame)
{ {
m_innerFrames[m_innerFrames.length] = innerFrame; m_innerFrames[m_innerFrames.length] = innerFrame;
} }
function synchronizeAndContinue(continueMethod) function synchronizeAndContinue(continueMethod)
{ {
synchronizePageAndInnerPagesAndContinue(continueMethod);   synchronizePageAndInnerPagesAndContinue(continueMethod);  
} }
function synchronizePageAndInnerPagesAndContinue(continueMethod) function synchronizePageAndInnerPagesAndContinue(continueMethod)
{ {
m_continueMethod = continueMethod; m_continueMethod = continueMethod;
m_innerFramesIndex = m_innerFrames.length - 1; m_innerFramesIndex = m_innerFrames.length - 1;
m_synchronizePage = true; m_synchronizePage = true;
synchronizeAndContinueWithNextIndex(); synchronizeAndContinueWithNextIndex();
} }
function synchronizeInnerPagesAndContinue(continueMethod) function synchronizeInnerPagesAndContinue(continueMethod)
{ {
m_continueMethod = continueMethod; m_continueMethod = continueMethod;
if (m_synchronizeAvoidDrillDown == false) if (m_synchronizeAvoidDrillDown == false)
{ {
m_innerFramesIndex = m_innerFrames.length - 1; m_innerFramesIndex = m_innerFrames.length - 1;
} }
else else
{ {
m_innerFramesIndex = -1; m_innerFramesIndex = -1;
m_synchronizeAvoidDrillDown = false; m_synchronizeAvoidDrillDown = false;
} }
m_synchronizePage = false; m_synchronizePage = false;
try try
{ {
synchronizeAndContinueWithNextIndex(); synchronizeAndContinueWithNextIndex();
} }
catch (exc) catch (exc)
{ {
} }
} }
function synchronizeAndContinueWithNextIndex() function synchronizeAndContinueWithNextIndex()
{ {
if (m_innerFrames != null && if (m_innerFrames != null &&
m_innerFramesIndex >= 0 && m_innerFramesIndex >= 0 &&
m_innerFramesIndex < m_innerFrames.length) m_innerFramesIndex < m_innerFrames.length)
{ {
var innerFrame = m_innerFrames[m_innerFramesIndex]; var innerFrame = m_innerFrames[m_innerFramesIndex];
m_innerFramesIndex--; m_innerFramesIndex--;
try try
{ {
if (innerFrame != null && if (innerFrame != null &&
innerFrame.WORKAREA != null && innerFrame.WORKAREA != null &&
innerFrame.m_isCasabacMFPAGE != true && innerFrame.m_isCasabacMFPAGE != true &&
innerFrame.WORKAREA.csciframe != null) innerFrame.WORKAREA.csciframe != null)
{ {
addLogMessage("synchronizing inner frame " + (m_innerFramesIndex+1)); addLogMessage("synchronizing inner frame " + (m_innerFramesIndex+1));
innerFrame.WORKAREA.m_blockIOByFlush = true; innerFrame.WORKAREA.m_blockIOByFlush = true;
innerFrame.WORKAREA.csciframe.synchronizePageAndInnerPagesAndContinue(synchronizeAndContinueWithNextIndex); innerFrame.WORKAREA.csciframe.synchronizePageAndInnerPagesAndContinue(synchronizeAndContinueWithNextIndex);
} }
else if (innerFrame != null && else if (innerFrame != null &&
innerFrame.WORKAREA != null && innerFrame.WORKAREA != null &&
innerFrame.WORKAREA.m_isCasabacMFPAGE == true) innerFrame.WORKAREA.m_isCasabacMFPAGE == true)
{ {
addLogMessage("synchronizing inner frame " + (m_innerFramesIndex+1) + " - this is a MFPAGE"); addLogMessage("synchronizing inner frame " + (m_innerFramesIndex+1) + " - this is a MFPAGE");
m_innerMFFrames = innerFrame.WORKAREA.getCasabacFrames(); m_innerMFFrames = innerFrame.WORKAREA.getCasabacFrames();
m_innerMFFramesIndex = m_innerMFFrames.length; m_innerMFFramesIndex = m_innerMFFrames.length;
synchronizeNextMFFrame(); synchronizeNextMFFrame();
} }
else else
{ {
synchronizeAndContinueWithNextIndex(); synchronizeAndContinueWithNextIndex();
} }
} }
catch (exc) catch (exc)
{ {
synchronizeAndContinueWithNextIndex(); synchronizeAndContinueWithNextIndex();
} }
} }
else else
{ {
if (m_synchronizePage == true) if (m_synchronizePage == true)
{ {
var unSubmittedChangeExists = false; var unSubmittedChangeExists = false;
if (m_properties == null) if (m_properties == null)
{ {
var vtcm = m_continueMethod; var vtcm = m_continueMethod;
m_continueMethod = null; m_continueMethod = null;
if (vtcm!=null) vtcm(); if (vtcm!=null) vtcm();
return; return;
} }
invokeDCListeners(); invokeDCListeners();
var vmaxi = m_properties.length; var vmaxi = m_properties.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
if (m_properties[i].isChanged == true && if (m_properties[i].isChanged == true &&
!(m_internalProperties[m_properties[i].name] == true)) !(m_internalProperties[m_properties[i].name] == true))
{ {
unSubmittedChangeExists = true; unSubmittedChangeExists = true;
break; break;
} }
} }
if (unSubmittedChangeExists == true) if (unSubmittedChangeExists == true)
{ {
setPropertyValue("casabacSubPageRefresh","true"); setPropertyValue("casabacSubPageRefresh","true");
submitModel("submit"); submitModel("submit");
} }
else else
{ {
var vtcm = m_continueMethod; var vtcm = m_continueMethod;
m_continueMethod = null; m_continueMethod = null;
if (vtcm!=null) vtcm(); if (vtcm!=null) vtcm();
} }
} }
else else
{ {
var vtcm = m_continueMethod; var vtcm = m_continueMethod;
m_continueMethod = null; m_continueMethod = null;
if (vtcm!=null) vtcm(); if (vtcm!=null) vtcm();
} }
} }
} }
function synchronizeNextMFFrame() function synchronizeNextMFFrame()
{ {
m_innerMFFramesIndex--; m_innerMFFramesIndex--;
if (m_innerMFFramesIndex < 0) if (m_innerMFFramesIndex < 0)
{ {
synchronizeAndContinueWithNextIndex(); synchronizeAndContinueWithNextIndex();
return; return;
} }
addLogMessage("synchronizing inner MF frame " + m_innerMFFramesIndex); addLogMessage("synchronizing inner MF frame " + m_innerMFFramesIndex);
try try
{ {
m_innerMFFrames[m_innerMFFramesIndex].WORKAREA.csciframe.synchronizePageAndInnerPagesAndContinue(synchronizeNextMFFrame); m_innerMFFrames[m_innerMFFramesIndex].WORKAREA.csciframe.synchronizePageAndInnerPagesAndContinue(synchronizeNextMFFrame);
} }
catch (eexxcc) catch (eexxcc)
{ {
addLogMessage('Exception caught: csc.synchronizeNextMFFrame:' + eexxcc); addLogMessage('Exception caught: csc.synchronizeNextMFFrame:' + eexxcc);
synchronizeNextMFFrame(); synchronizeNextMFFrame();
} }
} }
function checkIO() function checkIO()
{ {
if (parent.m_blockIOByFlush == true) return true; if (parent.m_blockIOByFlush == true) return true;
if (parent.m_blockIO == true) return checkIOFalse(); if (parent.m_blockIO == true) return checkIOFalse();
if (isIE()==false && CL().checkMozIO(m_parentparent)==false) return false; if (isIE()==false && CL().checkMozIO(m_parentparent)==false) return false;
if (isIE() == true) if (isIE() == true)
{ {
if (m_parentdocument.readyState != "complete") return checkIOFalse(); if (m_parentdocument.readyState != "complete") return checkIOFalse();
if (document.readyState != "complete") return checkIOFalse(); if (document.readyState != "complete") return checkIOFalse();
for (var i=0; i<m_innerFrames.length; i++) for (var i=0; i<m_innerFrames.length; i++)
{ {
try try
{ {
if (m_innerFrames[i].document.readyState != "complete") return checkIOFalse("document.readyState"); if (m_innerFrames[i].document.readyState != "complete") return checkIOFalse("document.readyState");
if (m_innerFrames[i].WORKAREA.document.readyState != "complete") return checkIOFalse("WORKAREA.document.readyState"); if (m_innerFrames[i].WORKAREA.document.readyState != "complete") return checkIOFalse("WORKAREA.document.readyState");
if (m_innerFrames[i].WORKAREA.csciframe.document.readyState != "complete") return checkIOFalse("WORKAREA.csciframe.document.readyState"); if (m_innerFrames[i].WORKAREA.csciframe.document.readyState != "complete") return checkIOFalse("WORKAREA.csciframe.document.readyState");
if (m_innerFrames[i].WORKAREA.csciframe.m_sessionId != m_sessionId) continue; if (m_innerFrames[i].WORKAREA.csciframe.m_sessionId != m_sessionId) continue;
if (m_innerFrames[i].WORKAREA.csciframe.checkIOForNoSubmits() == false) return checkIOFalse("WORKAREA.csciframe.checkIOForNoSubmits"); if (m_innerFrames[i].WORKAREA.csciframe.checkIOForNoSubmits() == false) return checkIOFalse("WORKAREA.csciframe.checkIOForNoSubmits");
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
} }
return true; return true;
} }
function checkIOForNoSubmits() function checkIOForNoSubmits()
{ {
if (parent.m_blockIO == true && parent.m_blockIOByFlush == true) if (parent.m_blockIO == true && parent.m_blockIOByFlush == true)
{ {
var vcd = new Date(); var vcd = new Date();
if (m_lastServerFetch != null) if (m_lastServerFetch != null)
{ {
var vdiff = vcd.getTime() - m_lastServerFetch.getTime(); var vdiff = vcd.getTime() - m_lastServerFetch.getTime();
if (vdiff > 250) if (vdiff > 250)
return checkIOFalse(); return checkIOFalse();
} }
} }
return checkIO(); return checkIO();
} }
function checkIOFalse(addText) function checkIOFalse(addText)
{ {
if (addText == null) addText = ""; if (addText == null) addText = "";
status = "Browser is communicating to server - page currently blocked for input (" + status = "Browser is communicating to server - page currently blocked for input (" +
addText + addText +
")"; ")";
return false; return false;
} }
function resetCheckIO() function resetCheckIO()
{ {
parent.m_blockIOByFlush = false; parent.m_blockIOByFlush = false;
parent.m_blockIO = false; parent.m_blockIO = false;
} }
/* /*
PUBLIC ACCESS FOR CONTROLS. PUBLIC ACCESS FOR CONTROLS.
This method is called by controls during construction process. This method is called by controls during construction process.
Each control registers if it potencially may receive focus when Each control registers if it potencially may receive focus when
a page is newly displayed. a page is newly displayed.
@param pfocusable @param pfocusable
DOM object supporting focus() method DOM object supporting focus() method
@param pfirstcategory @param pfirstcategory
When setting the focus first objets of the "first category" are checked. When setting the focus first objets of the "first category" are checked.
If no object of first category is available then the remaining objects If no object of first category is available then the remaining objects
are investigated. Reason: if there are fields and buttons on one screen are investigated. Reason: if there are fields and buttons on one screen
then fields should receive the focus before buttons. then fields should receive the focus before buttons.
*/  */ 
function addFocusable(pfocusable,pfirstcategory) function addFocusable(pfocusable,pfirstcategory)
{ {
m_focusables.push(pfocusable); m_focusables.push(pfocusable);
m_focusablesCat.push(pfirstcategory); m_focusablesCat.push(pfirstcategory);
} }
var m_currentFocusLine; var m_currentFocusLine;
var m_currentFocusGrid; var m_currentFocusGrid;
function startFocusGrid(cc) function startFocusGrid(cc)
{ {
try try
{ {
var vfcs = m_currentFocusGrid[0]; var vfcs = m_currentFocusGrid[0];
var vlcs = m_currentFocusGrid[1]; var vlcs = m_currentFocusGrid[1];
var vdelta = vfcs.length - vlcs.length var vdelta = vfcs.length - vlcs.length
var vfccs = new Array(); var vfccs = new Array();
for (var i=0; i<vlcs.length; i++) for (var i=0; i<vlcs.length; i++)
vfccs.push(vfcs[i+vdelta]); vfccs.push(vfcs[i+vdelta]);
m_currentFocusGrid[0] = vfccs; m_currentFocusGrid[0] = vfccs;
cc.CASA_fg = m_currentFocusGrid; cc.CASA_fg = m_currentFocusGrid;
m_currentFocusGrid = null; m_currentFocusGrid = null;
} }
catch (exc) {} catch (exc) {}
} }
function startFocusLine() function startFocusLine()
{ {
if (m_currentFocusGrid == null) m_currentFocusGrid = new Array(); if (m_currentFocusGrid == null) m_currentFocusGrid = new Array();
m_currentFocusGrid.push(m_currentFocusLine); m_currentFocusGrid.push(m_currentFocusLine);
m_currentFocusLine = null; m_currentFocusLine = null;
} }
function startFocusCell(cc) function startFocusCell(cc)
{ {
if (m_currentFocusLine == null) m_currentFocusLine = new Array(); if (m_currentFocusLine == null) m_currentFocusLine = new Array();
m_currentFocusLine.push(cc); m_currentFocusLine.push(cc);
} }
function buildLineCells(vcs) function buildLineCells(vcs)
{ {
var vres = new Array(); var vres = new Array();
for (var i=0; i<vcs.length; i++) for (var i=0; i<vcs.length; i++)
{ {
var vcsi = vcs[i]; var vcsi = vcs[i];
var vsubs = vcsi.CASA_fgsubs; var vsubs = vcsi.CASA_fgsubs;
if (vsubs == null) if (vsubs == null)
{ {
vres.push(vcsi); vres.push(vcsi);
} }
else else
{ {
for (var j=0; j<vsubs.length; j++) for (var j=0; j<vsubs.length; j++)
{ {
vres.push(vsubs[j]); vres.push(vsubs[j]);
} }
} }
} }
return vres; return vres;
} }
function findFocusControl(vgrid,vcell,vdelta) function findFocusControl(vgrid,vcell,vdelta)
{ {
var vls = vgrid.CASA_fg; var vls = vgrid.CASA_fg;
if (vls == null) return -1; if (vls == null) return -1;
if (vls.length == 0) return -1; if (vls.length == 0) return -1;
for (var il=0; il<vls.length; il++) for (var il=0; il<vls.length; il++)
{ {
var vcs = vls[il]; var vcs = vls[il];
vcs = buildLineCells(vcs); vcs = buildLineCells(vcs);
for (var ic=0; ic<vcs.length; ic++) for (var ic=0; ic<vcs.length; ic++)
{ {
if (vcs[ic] == vcell) if (vcs[ic] == vcell)
{ {
try try
{ {
var newIndex = il + vdelta; var newIndex = il + vdelta;
if (vdelta == 1000) newIndex = 0; if (vdelta == 1000) newIndex = 0;
if (vdelta == 1001) newIndex = vls.length-1; if (vdelta == 1001) newIndex = vls.length-1;
var vccs = vls[newIndex]; var vccs = vls[newIndex];
vccs = buildLineCells(vccs); vccs = buildLineCells(vccs);
var vres = vccs[ic]; var vres = vccs[ic];
return vres; return vres;
} }
catch (exc) catch (exc)
{ {
return 0; return 0;
} }
} }
} }
} }
return -1; return -1;
} }
function findFirstFocusControl(vgrid) function findFirstFocusControl(vgrid)
{ {
var vls = vgrid.CASA_fg; var vls = vgrid.CASA_fg;
if (vls == null) return null; if (vls == null) return null;
if (vls.length == 0) return null; if (vls.length == 0) return null;
var vcs = buildLineCells(vls[0]); var vcs = buildLineCells(vls[0]);
return vcs[0]; return vcs[0];
} }
function findLastFocusControl(vgrid) function findLastFocusControl(vgrid)
{ {
var vls = vgrid.CASA_fg; var vls = vgrid.CASA_fg;
if (vls == null) return null; if (vls == null) return null;
if (vls.length == 0) return null; if (vls.length == 0) return null;
var vcs = buildLineCells(vls[vls.length-1]); var vcs = buildLineCells(vls[vls.length-1]);
return vcs[vcs.length-1]; return vcs[vcs.length-1];
} }
function findIndexOfLastTabableFocusLine(vgrid) function findIndexOfLastTabableFocusLine(vgrid)
{ {
var vls = vgrid.CASA_fg; var vls = vgrid.CASA_fg;
if (vls == null) return null; if (vls == null) return null;
if (vls.length == 0) return null; if (vls.length == 0) return null;
var result = -1; var result = -1;
for (var il=0; il<vls.length; il++) for (var il=0; il<vls.length; il++)
{ {
var vcs = vls[il]; var vcs = vls[il];
vcs = buildLineCells(vcs); vcs = buildLineCells(vcs);
for (var ic=0; ic<vcs.length; ic++) for (var ic=0; ic<vcs.length; ic++)
if (vcs[ic].tabIndex >= 0 && if (vcs[ic].tabIndex >= 0 &&
vcs[ic].readOnly != true && vcs[ic].readOnly != true &&
vcs[ic].disabled != true) vcs[ic].disabled != true)
{ {
result = il; result = il;
break; break;
} }
} }
return result; return result;
} }
function findFocusControlXY(vgrid,vcell) function findFocusControlXY(vgrid,vcell)
{ {
var vls = vgrid.CASA_fg; var vls = vgrid.CASA_fg;
if (vls == null) return null; if (vls == null) return null;
if (vls.length == 0) return null; if (vls.length == 0) return null;
for (var il=0; il<vls.length; il++) for (var il=0; il<vls.length; il++)
{ {
var vcs = vls[il]; var vcs = vls[il];
vcs = buildLineCells(vcs); vcs = buildLineCells(vcs);
for (var ic=0; ic<vcs.length; ic++) for (var ic=0; ic<vcs.length; ic++)
if (vcs[ic] == vcell) if (vcs[ic] == vcell)
{ {
var vres = new Object(); var vres = new Object();
vres.X = ic; vres.X = ic;
vres.Y = il; vres.Y = il;
return vres; return vres;
} }
} }
return null; return null;
} }
function findFocusControlForXY(vgrid,vx,vy) function findFocusControlForXY(vgrid,vx,vy)
{ {
var vls = vgrid.CASA_fg; var vls = vgrid.CASA_fg;
if (vls == null) return null; if (vls == null) return null;
if (vls.length == 0) return null; if (vls.length == 0) return null;
var vlsvy = vls[vy]; var vlsvy = vls[vy];
vlsvy = buildLineCells(vlsvy); vlsvy = buildLineCells(vlsvy);
return vlsvy[vx]; return vlsvy[vx];
} }
function repointFocusInScreenExecute() function repointFocusInScreenExecute()
{ {
m_firstFocusCall = true; m_firstFocusCall = true;
pointFocusInternally(false); pointFocusInternally(false);
} }
/* /*
PUBLIC ACCESS FROM SERVLETINTEGRATION IN ORDER TO DIRECTLY POINT FOCUS PUBLIC ACCESS FROM SERVLETINTEGRATION IN ORDER TO DIRECTLY POINT FOCUS
AFTER CHANGING THE PAGE. AFTER CHANGING THE PAGE.
*/  */ 
function repointFocus() function repointFocus()
{ {
m_firstFocusCall = true; m_firstFocusCall = true;
pointFocusInternally(true); pointFocusInternally(true);
} }
function pointFocus() function pointFocus()
{ {
pointFocusInternally(true); pointFocusInternally(true);
} }
function pointFocusInternally(pCheckSuppressFocusMgmt) function pointFocusInternally(pCheckSuppressFocusMgmt)
{ {
addLogMessage("FOCUS - pointFocus started"); addLogMessage("FOCUS - pointFocus started");
var vSuppFocus = getPropertyValue("casabacAddons.suppressFocusManagement"); var vSuppFocus = getPropertyValue("casabacAddons.suppressFocusManagement");
if (pCheckSuppressFocusMgmt && (vSuppFocus == true || vSuppFocus == "true")) if (pCheckSuppressFocusMgmt && (vSuppFocus == true || vSuppFocus == "true"))
{ {
addLogMessage("FOCUS - Adapter suppressed focus management"); addLogMessage("FOCUS - Adapter suppressed focus management");
return; return;
} }
var vcfe =  parent.document.activeElement; var vcfe =  parent.document.activeElement;
if (vcfe != null && if (vcfe != null &&
m_firstFocusCall == false && m_firstFocusCall == false &&
vcfe.tagName != "IFRAME") vcfe.tagName != "IFRAME")
{ {
try try
{ {
vcfe.focus(); vcfe.focus();
parent.focus(); parent.focus();
vcfe.focus(); vcfe.focus();
vcfe.select(); vcfe.select();
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
var vResult = false; var vResult = false;
try try
{ {
addLogMessage("pointFocus - pointFocusToFirstRequestor"); addLogMessage("pointFocus - pointFocusToFirstRequestor");
vResult = pointFocusToFirstRequestor(); vResult = pointFocusToFirstRequestor();
} }
catch (eexxcc) {} catch (eexxcc) {}
if (vResult == true) if (vResult == true)
{ {
m_firstFocusCall = false; m_firstFocusCall = false;
return; return;
} }
if (vResult == false && m_firstFocusCall == false) if (vResult == false && m_firstFocusCall == false)
return; return;
m_firstFocusCall = false; m_firstFocusCall = false;
addLogMessage("FOCUS - No explicit focus set by application, normal focus selection started"); addLogMessage("FOCUS - No explicit focus set by application, normal focus selection started");
pointFocusForFreshPage(); pointFocusForFreshPage();
} }
function pointFocusForFreshPage() function pointFocusForFreshPage()
{ {
for (var j=0; j<2; j++) for (var j=0; j<2; j++)
{ {
if (j == 1) vfirstcat = false; if (j == 1) vfirstcat = false;
for (var i=0; i<m_focusables.length; i++) for (var i=0; i<m_focusables.length; i++)
{ {
if (j == 0 && m_focusablesCat[i] != true) continue; if (j == 0 && m_focusablesCat[i] != true) continue;
var vcon = m_focusables[i]; var vcon = m_focusables[i];
if (vcon.disabled != true && vcon.tabIndex >= 0) if (vcon.disabled != true && vcon.tabIndex >= 0)
try try
{ {
addLogMessage("FOCUS - Setting focus in focusable " + i); addLogMessage("FOCUS - Setting focus in focusable " + i);
vcon.focus(); vcon.focus();
parent.focus(); parent.focus();
vcon.focus(); vcon.focus();
return; return;
} }
catch (ee) catch (ee)
{ {
addLogMessage("FOCUS - Execption occurred in focusable " + i + ": " + ee); addLogMessage("FOCUS - Execption occurred in focusable " + i + ": " + ee);
} }
} }
} }
} }
function pointFocusToFirstRequestor() function pointFocusToFirstRequestor()
{ {
if (m_focusRequestors == null) if (m_focusRequestors == null)
return false; return false;
addLogMessage("FOCUS - pointFocusToFirstRequestor started, number of focus requestors = " + m_focusRequestors.length); addLogMessage("FOCUS - pointFocusToFirstRequestor started, number of focus requestors = " + m_focusRequestors.length);
if (m_focusRequestors.length == 1) if (m_focusRequestors.length == 1)
{ {
try try
{ {
var frInfo = m_focusRequestors[0]; var frInfo = m_focusRequestors[0];
if (frInfo.setActiveOnly != true) if (frInfo.setActiveOnly != true)
{ {
frInfo.control.focus(); frInfo.control.focus();
parent.focus(); parent.focus();
frInfo.control.focus(); frInfo.control.focus();
} }
try { frInfo.control.select(); } catch (eee) {} try { frInfo.control.select(); } catch (eee) {}
try { if (isIE() == true) frInfo.control.setActive(); } catch (eee) {} try { if (isIE() == true) frInfo.control.setActive(); } catch (eee) {}
m_focusRequestors = null; m_focusRequestors = null;
addLogMessage("FOCUS - Did set focus to first requestor"); addLogMessage("FOCUS - Did set focus to first requestor");
return true; return true;
} }
catch (exception) catch (exception)
{ {
m_focusRequestors = null; m_focusRequestors = null;
addLogMessage("FOCUS - Exception occurred " + exception); addLogMessage("FOCUS - Exception occurred " + exception);
return false; return false;
} }
} }
var vmaxj = m_focusRequestors.length; var vmaxj = m_focusRequestors.length;
for (var j=0; j<vmaxj; j++) for (var j=0; j<vmaxj; j++)
{ {
try try
{ {
var frInfo = m_focusRequestors[j]; var frInfo = m_focusRequestors[j];
if (frInfo.control.focus != null) if (frInfo.control.focus != null)
{ {
if (frInfo.setActiveOnly != true) if (frInfo.setActiveOnly != true)
{ {
frInfo.control.focus(); frInfo.control.focus();
parent.focus(); parent.focus();
frInfo.control.focus(); frInfo.control.focus();
} }
try { frInfo.control.select(); } catch (eee) {} try { frInfo.control.select(); } catch (eee) {}
try { if (isIE() == true) frInfo.control.setActive(); } catch (eee) {} try { if (isIE() == true) frInfo.control.setActive(); } catch (eee) {}
m_focusRequestors = null; m_focusRequestors = null;
addLogMessage("FOCUS - Did set focus to requestor " + j); addLogMessage("FOCUS - Did set focus to requestor " + j);
return true; return true;
} }
else else
{ {
addLogMessage("FOCUS - Focus requestor does not support focus() " + j); addLogMessage("FOCUS - Focus requestor does not support focus() " + j);
} }
} }
catch (exception) catch (exception)
{ {
addLogMessage("FOCUS - Could not set focus for requestor " + j +": " + exception); addLogMessage("FOCUS - Could not set focus for requestor " + j +": " + exception);
} }
} }
m_focusRequestors = null; m_focusRequestors = null;
return false; return false;
} }
function addFocusRequestor(control) function addFocusRequestor(control)
{ {
if (m_focusRequestors == null) if (m_focusRequestors == null)
m_focusRequestors = new Array(); m_focusRequestors = new Array();
var reqInfo = new Object(); var reqInfo = new Object();
reqInfo.control = control; reqInfo.control = control;
reqInfo.setActiveOnly = false; reqInfo.setActiveOnly = false;
m_focusRequestors[m_focusRequestors.length] = reqInfo; m_focusRequestors[m_focusRequestors.length] = reqInfo;
} }
function addActiveElementRequestor(control) function addActiveElementRequestor(control)
{ {
if (m_focusRequestors == null) if (m_focusRequestors == null)
m_focusRequestors = new Array(); m_focusRequestors = new Array();
var reqInfo = new Object(); var reqInfo = new Object();
reqInfo.control = control; reqInfo.control = control;
reqInfo.setActiveOnly = true; reqInfo.setActiveOnly = true;
m_focusRequestors[m_focusRequestors.length] = reqInfo; m_focusRequestors[m_focusRequestors.length] = reqInfo;
} }
/* /*
Points the focus to the last focusable element. This method is e.g. Points the focus to the last focusable element. This method is e.g.
called by the "rolling focus"-span which is part of every page. called by the "rolling focus"-span which is part of every page.
*/  */ 
function pointFocusToLastElement() function pointFocusToLastElement()
{ {
try try
{ {
for (var id in m_tabElementsUndefined) for (var id in m_tabElementsUndefined)
{ {
var vf = m_tabElementsUndefined[id]; var vf = m_tabElementsUndefined[id];
addLogMessage("Processing focusable " + vf.tagName); addLogMessage("Processing focusable " + vf.tagName);
if (vf.disabled != true && vf.tabIndex >= 0) if (vf.disabled != true && vf.tabIndex >= 0)
{ {
try try
{ {
vf.focus(); vf.focus();
parent.focus(); parent.focus();
vf.focus(); vf.focus();
try { vf.select(); } catch (eee) {} try { vf.select(); } catch (eee) {}
try { if (isIE() == true) vf.setActive(); } catch (eee) {} try { if (isIE() == true) vf.setActive(); } catch (eee) {}
return; return;
} }
catch (exc) {} catch (exc) {}
} }
} }
for (var j = 2; true; j++) for (var j = 2; true; j++)
{ {
var vf = m_tabElements[j]; var vf = m_tabElements[j];
if (vf == null) break; if (vf == null) break;
addLogMessage("Processing focusable " + vf.tagName); addLogMessage("Processing focusable " + vf.tagName);
if (vf.disabled != true && vf.tabIndex >= 0) if (vf.disabled != true && vf.tabIndex >= 0)
{ {
try try
{ {
vf.focus(); vf.focus();
parent.focus(); parent.focus();
vf.focus(); vf.focus();
try { vf.select(); } catch (eee) {} try { vf.select(); } catch (eee) {}
try { if (isIE() == true) vf.setActive(); } catch (eee) {} try { if (isIE() == true) vf.setActive(); } catch (eee) {}
return; return;
} }
catch (exc) {} catch (exc) {}
} }
} }
for (var i=m_focusables.length-1; i>=0; i--) for (var i=m_focusables.length-1; i>=0; i--)
{ {
var vf = m_focusables[i]; var vf = m_focusables[i];
addLogMessage("Processing focusable " + vf.tagName); addLogMessage("Processing focusable " + vf.tagName);
if (vf.disabled != true && vf.tabIndex >= 0) if (vf.disabled != true && vf.tabIndex >= 0)
{ {
try try
{ {
vf.focus(); vf.focus();
parent.focus(); parent.focus();
vf.focus(); vf.focus();
try { vf.select(); } catch (eee) {} try { vf.select(); } catch (eee) {}
try { if (isIE() == true) vf.setActive(); } catch (eee) {} try { if (isIE() == true) vf.setActive(); } catch (eee) {}
return; return;
} }
catch (exc) {} catch (exc) {}
} }
} }
} }
catch (eexxcc) { addLogMessage("Exception in pointFocusToLastElement"); } catch (eexxcc) { addLogMessage("Exception in pointFocusToLastElement"); }
} }
function applyCasaTabIndex(cc, pCallerInfo) function applyCasaTabIndex(cc, pCallerInfo)
{ {
applyCasaTabIndexFor(cc, cc, pCallerInfo); applyCasaTabIndexFor(cc, cc, pCallerInfo);
} }
function disableCasaTabIndexFor(cc, tabElm, pCallerInfo) function disableCasaTabIndexFor(cc, tabElm, pCallerInfo)
{ {
applyCasaTabIndexFor(cc, tabElm, pCallerInfo); applyCasaTabIndexFor(cc, tabElm, pCallerInfo);
tabElm.tabIndex = -1; tabElm.tabIndex = -1;
} }
function applyCasaTabIndexFor(cc, tabElm, pCallerInfo) function applyCasaTabIndexFor(cc, tabElm, pCallerInfo)
{ {
if (cc.CASA_cti == null) if (cc.CASA_cti == null)
{ {
cc.CASA_cti = 1; cc.CASA_cti = 1;
} }
tabElm.tabIndex = cc.CASA_cti; tabElm.tabIndex = cc.CASA_cti;
if (cc.CASA_tabindex == null) if (cc.CASA_tabindex == null)
{ {
cc.CASA_tabindex = "-"; cc.CASA_tabindex = "-";
} }
if (m_tabElements["LOGCOUNT"] == null) if (m_tabElements["LOGCOUNT"] == null)
m_tabElements["LOGCOUNT"] = 0; m_tabElements["LOGCOUNT"] = 0;
if (m_tabElements["LOGCOUNT"] > 100) if (m_tabElements["LOGCOUNT"] > 100)
return; return;
m_tabElements["LOGCOUNT"] += 1; m_tabElements["LOGCOUNT"] += 1;
tabElm.CASA_tabIndexInfo = pCallerInfo; tabElm.CASA_tabIndexInfo = pCallerInfo;
tabElm.CASA_tabindex = cc.CASA_tabindex; tabElm.CASA_tabindex = cc.CASA_tabindex;
tabElm.CASA_cti = cc.CASA_cti; tabElm.CASA_cti = cc.CASA_cti;
if (cc.CASA_cti > 1) if (cc.CASA_cti > 1)
m_tabElements[cc.CASA_cti] = tabElm; m_tabElements[cc.CASA_cti] = tabElm;
else else
m_tabElementsUndefined[tabElm.id] = tabElm; m_tabElementsUndefined[tabElm.id] = tabElm;
} }
function addAreaTabIndexInfo(id,name,cti,tabindex) function addAreaTabIndexInfo(id,name,cti,tabindex)
{ {
var o = new Object(); var o = new Object();
o.CASA_cti = cti; o.CASA_cti = cti;
o.CASA_tabindex = tabindex; o.CASA_tabindex = tabindex;
o.CASA_valueprop = name; o.CASA_valueprop = name;
o.id = id; o.id = id;
applyCasaTabIndex(o, "ROWAREA") applyCasaTabIndex(o, "ROWAREA")
} }
function outputTabIndexes() function outputTabIndexes()
{ {
var joined = new Array(); var joined = new Array();
for (var ccId in m_tabElementsUndefined) for (var ccId in m_tabElementsUndefined)
{ {
var tabElm = m_tabElementsUndefined[ccId]; var tabElm = m_tabElementsUndefined[ccId];
if (tabElm.CASA_cti < 0) if (tabElm.CASA_cti < 0)
joined.push(tabElm); joined.push(tabElm);
} }
for (var ccId in m_tabElementsUndefined) for (var ccId in m_tabElementsUndefined)
{ {
var tabElm = m_tabElementsUndefined[ccId]; var tabElm = m_tabElementsUndefined[ccId];
if (tabElm.CASA_cti >= 0) if (tabElm.CASA_cti >= 0)
joined.push(tabElm); joined.push(tabElm);
} }
for (var i=2; true; i++) for (var i=2; true; i++)
{ {
var tabElm = m_tabElements[i]; var tabElm = m_tabElements[i];
if (tabElm == null) if (tabElm == null)
break; break;
joined.push(tabElm); joined.push(tabElm);
} }
var vstr = "  CTI      TI      Control\n"; var vstr = "  CTI      TI      Control\n";
vstr += "=======================================\n"; vstr += "=======================================\n";
for (var i = 0; i < joined.length; i++) for (var i = 0; i < joined.length; i++)
{ {
var cc = joined[i]; var cc = joined[i];
if (cc != null) if (cc != null)
{ {
var s = "  "+cc.CASA_cti+"\t"+cc.CASA_tabindex+"\t"+cc.CASA_tabIndexInfo+" ("; var s = "  "+cc.CASA_cti+"\t"+cc.CASA_tabindex+"\t"+cc.CASA_tabIndexInfo+" (";
if (cc.CASA_valueprop != null) if (cc.CASA_valueprop != null)
s += cc.CASA_valueprop; s += cc.CASA_valueprop;
if (cc.CASA_buttonlistprop != null) if (cc.CASA_buttonlistprop != null)
s += cc.CASA_buttonlistprop; s += cc.CASA_buttonlistprop;
if (cc.CASA_method != null) if (cc.CASA_method != null)
s += cc.CASA_method; s += cc.CASA_method;
if (cc.offsetWidth != null) if (cc.offsetWidth != null)
s += ";"+cc.offsetWidth; s += ";"+cc.offsetWidth;
} }
vstr += s+")\n"; vstr += s+")\n";
} }
vstr += "=======================================\n"; vstr += "=======================================\n";
alert(vstr); alert(vstr);
} }
function highlightHotKey(text, pChar) function highlightHotKey(text, pChar)
{ {
if (pChar == null || pChar.length==0) return text; if (pChar == null || pChar.length==0) return text;
index = text.indexOf(pChar); index = text.indexOf(pChar);
if (index<0)return text; if (index<0)return text;
return text.substring(0,index)+"<u>"+pChar+"</u>"+text.substring(index+1, text.length); return text.substring(0,index)+"<u>"+pChar+"</u>"+text.substring(index+1, text.length);
} }
function addHotKey(keyCode,ctrlKey,shiftKey,altKey,method) function addHotKey(keyCode,ctrlKey,shiftKey,altKey,method)
{ {
var hotKey = new Object(); var hotKey = new Object();
hotKey.keyCode = keyCode; hotKey.keyCode = keyCode;
hotKey.ctrlKey = ctrlKey; hotKey.ctrlKey = ctrlKey;
hotKey.shiftKey = shiftKey; hotKey.shiftKey = shiftKey;
hotKey.altKey = altKey; hotKey.altKey = altKey;
hotKey.method = method; hotKey.method = method;
m_hotKeys.push(hotKey); m_hotKeys.push(hotKey);
} }
function addControlBasedHotKey(ccId, keyCode,callbackMethod,callbackParam) function addControlBasedHotKey(ccId, keyCode,callbackMethod,callbackParam)
{ {
var hotKey = new Object(); var hotKey = new Object();
hotKey.ccId = ccId; hotKey.ccId = ccId;
hotKey.keyCode = keyCode; hotKey.keyCode = keyCode;
hotKey.ctrlKey = m_hotKeyCode.indexOf("17")>=0; hotKey.ctrlKey = m_hotKeyCode.indexOf("17")>=0;
hotKey.shiftKey = m_hotKeyCode.indexOf("16")>=0; hotKey.shiftKey = m_hotKeyCode.indexOf("16")>=0;
hotKey.altKey = m_hotKeyCode.indexOf("18")>=0; hotKey.altKey = m_hotKeyCode.indexOf("18")>=0;
hotKey.callbackMethod = callbackMethod; hotKey.callbackMethod = callbackMethod;
hotKey.callbackParam = callbackParam; hotKey.callbackParam = callbackParam;
m_hotKeysWithCallback.push(hotKey); m_hotKeysWithCallback.push(hotKey);
} }
function addHotKeyWithControlScope(keyCode,ctrlKey,shiftKey,altKey,method,controlInfo) function addHotKeyWithControlScope(keyCode,ctrlKey,shiftKey,altKey,method,controlInfo)
{ {
var hotKey = new Object(); var hotKey = new Object();
hotKey.keyCode = keyCode; hotKey.keyCode = keyCode;
hotKey.ctrlKey = ctrlKey; hotKey.ctrlKey = ctrlKey;
hotKey.shiftKey = shiftKey; hotKey.shiftKey = shiftKey;
hotKey.altKey = altKey; hotKey.altKey = altKey;
hotKey.method = method; hotKey.method = method;
hotKey.controlInfo = controlInfo; hotKey.controlInfo = controlInfo;
m_hotKeysWithControlScope.push(hotKey); m_hotKeysWithControlScope.push(hotKey);
} }
function removeHotKeys(ccId) function removeHotKeys(ccId)
{ {
v = new Array(); v = new Array();
for (var i=0; i<m_hotKeysWithCallback.length; i++) for (var i=0; i<m_hotKeysWithCallback.length; i++)
if (m_hotKeysWithCallback[i].ccId != ccId) if (m_hotKeysWithCallback[i].ccId != ccId)
v.push(m_hotKeysWithCallback[i]); v.push(m_hotKeysWithCallback[i]);
m_hotKeysWithCallback = v; m_hotKeysWithCallback = v;
} }
var mm_processHotKeys = null; var mm_processHotKeys = null;
function processHotKeys(bodyEvent) function processHotKeys(bodyEvent)
{ {
if (mm_processHotKeys == null) mm_processHotKeys = CL().C_processHotKeys; if (mm_processHotKeys == null) mm_processHotKeys = CL().C_processHotKeys;
return mm_processHotKeys(this,bodyEvent);  return mm_processHotKeys(bodyEvent); 
} }
var mm_changeReturnToTab = null; var mm_changeReturnToTab = null;
function changeReturnToTab(bodyEvent) function changeReturnToTab(bodyEvent)
{ {
if (mm_changeReturnToTab == null) mm_changeReturnToTab = CL().C_changeReturnToTab; if (mm_changeReturnToTab == null) mm_changeReturnToTab = CL().C_changeReturnToTab;
return mm_changeReturnToTab(this,bodyEvent);  return mm_changeReturnToTab(bodyEvent); 
} }
var mm_focusNextInput = null; var mm_focusNextInput = null;
function focusNextInput(element) function focusNextInput(element)
{ {
if (mm_focusNextInput == null) mm_focusNextInput = CL().C_focusNextInput; if (mm_focusNextInput == null) mm_focusNextInput = CL().C_focusNextInput;
return mm_focusNextInput(this,element);  return mm_focusNextInput(element); 
} }
function avoidProcessingForNextHotKey() function avoidProcessingForNextHotKey()
{ {
m_noProcessingForNextHotKey = true; m_noProcessingForNextHotKey = true;
} }
function findHotkeyKeycode(name) function findHotkeyKeycode(name)
{ {
if (name == null) return null; if (name == null) return null;
var index = name.indexOf("~~"); var index = name.indexOf("~~");
if (index >= 0 && index != name.length-2) if (index >= 0 && index != name.length-2)
{ {
var c = name.charCodeAt(name.indexOf("~~")+2); var c = name.charCodeAt(name.indexOf("~~")+2);
if (c >= 97) c -=32; if (c >= 97) c -=32;
return c; return c;
} }
return null; return null;
} }
function decodeCSVStringEMPTY(s) function decodeCSVStringEMPTY(s)
{ {
if (s == "") if (s == "")
{ {
var vResult = new Array(); var vResult = new Array();
vResult[0] = ""; vResult[0] = "";
return vResult; return vResult;
} }
else else
return decodeCSVString(s); return decodeCSVString(s);
} }
var s_bufferCSV = new Array(); var s_bufferCSV = new Array();
function decodeCSVStringUsingBuffer(s) function decodeCSVStringUsingBuffer(s)
{ {
var result = s_bufferCSV[s]; var result = s_bufferCSV[s];
if (result != null) if (result != null)
return result; return result;
result = decodeCSVString(s); result = decodeCSVString(s);
s_bufferCSV[s] = result; s_bufferCSV[s] = result;
return result; return result;
} }
function decodeCSVString(s) function decodeCSVString(s)
{ {
return decodeString(s, ";"); return decodeString(s, ";");
} }
function decodeString(s,separator) function decodeString(s,separator)
{ {
var vResult = new Array(); var vResult = new Array();
if ((s == null)||(s == "")) return vResult; if ((s == null)||(s == "")) return vResult;
var vNextSubStringStartIndex = 0; var vNextSubStringStartIndex = 0;
var vNextCommaIndex = s.indexOf(separator); var vNextCommaIndex = s.indexOf(separator);
var vTmpString = ""; var vTmpString = "";
while (vNextCommaIndex >= 0) while (vNextCommaIndex >= 0)
{ {
if ((vNextCommaIndex == 0) || (s.charAt(vNextCommaIndex-1) != "\\")) if ((vNextCommaIndex == 0) || (s.charAt(vNextCommaIndex-1) != "\\"))
{ {
vTmpString = vTmpString + s.substring(vNextSubStringStartIndex, vNextCommaIndex); vTmpString = vTmpString + s.substring(vNextSubStringStartIndex, vNextCommaIndex);
vResult[vResult.length] = vTmpString; vResult[vResult.length] = vTmpString;
vTmpString= ""; vTmpString= "";
} }
else else
{ {
vTmpString = vTmpString + s.substring(vNextSubStringStartIndex, vNextCommaIndex-1) + separator; vTmpString = vTmpString + s.substring(vNextSubStringStartIndex, vNextCommaIndex-1) + separator;
} }
vNextSubStringStartIndex = vNextCommaIndex +1; vNextSubStringStartIndex = vNextCommaIndex +1;
vNextCommaIndex = s.indexOf(separator, vNextCommaIndex + 1); vNextCommaIndex = s.indexOf(separator, vNextCommaIndex + 1);
} }
vResult[vResult.length] = vTmpString + s.substring(vNextSubStringStartIndex, s.length); vResult[vResult.length] = vTmpString + s.substring(vNextSubStringStartIndex, s.length);
return vResult; return vResult;
} }
function addClickAwayObject(cao) function addClickAwayObject(cao)
{ {
m_clickAwayObjects[m_clickAwayObjects.length] = cao; m_clickAwayObjects[m_clickAwayObjects.length] = cao;
} }
function addClickAwayMethod(pMethod) function addClickAwayMethod(pMethod)
{ {
m_clickAwayMethods.push(pMethod); m_clickAwayMethods.push(pMethod);
} }
function avoidClickAway() function avoidClickAway()
{ {
m_avoidClickAway = true; m_avoidClickAway = true;
} }
function clickAway() function clickAway()
{ {
if (m_avoidClickAway == false) if (m_avoidClickAway == false)
{ {
for (var i=0; i<m_clickAwayObjects.length; i++) m_clickAwayObjects[i].style.display = "none"; for (var i=0; i<m_clickAwayObjects.length; i++) m_clickAwayObjects[i].style.display = "none";
for (var i=0; i<m_clickAwayMethods.length; i++) m_clickAwayMethods[i](); for (var i=0; i<m_clickAwayMethods.length; i++) m_clickAwayMethods[i]();
} }
m_avoidClickAway = false; m_avoidClickAway = false;
} }
function addHeaderObject(headerObject) function addHeaderObject(headerObject)
{ {
m_headerObjects.push(headerObject); m_headerObjects.push(headerObject);
} }
function addFooterObject(footerObject) function addFooterObject(footerObject)
{ {
m_footerObjects.push(footerObject); m_footerObjects.push(footerObject);
} }
function calculateHeaderHeight() function calculateHeaderHeight()
{ {
var zHeight = 0; var zHeight = 0;
for (var i=0; i<m_headerObjects.length; i++) for (var i=0; i<m_headerObjects.length; i++)
zHeight += m_headerObjects[i].offsetHeight; zHeight += m_headerObjects[i].offsetHeight;
return zHeight; return zHeight;
} }
function calculateFooterHeight() function calculateFooterHeight()
{ {
var zHeight = 0; var zHeight = 0;
for (var i=0; i<m_footerObjects.length; i++) for (var i=0; i<m_footerObjects.length; i++)
zHeight += m_footerObjects[i].offsetHeight; zHeight += m_footerObjects[i].offsetHeight;
return zHeight; return zHeight;
} }
function addMLValue(pval) { if (pval != null) m_MLValues.push(pval); } function addMLValue(pval) { if (pval != null) m_MLValues.push(pval); }
function addMLSpan(pspan) { if (pspan != null) m_MLSpans.push(pspan); } function addMLSpan(pspan) { if (pspan != null) m_MLSpans.push(pspan); }
function addMLOption(poption) { if (poption != null) m_MLOptions.push(poption); } function addMLOption(poption) { if (poption != null) m_MLOptions.push(poption); }
function addMLImage(pimage) { if (pimage != null) m_MLImages.push(pimage); } function addMLImage(pimage) { if (pimage != null) m_MLImages.push(pimage); }
function addMLButton(pbutton, callbackMethod, callbackParam) function addMLButton(pbutton, callbackMethod, callbackParam)
{ {
if (pbutton != null) if (pbutton != null)
{ {
o = new Object(); o = new Object();
o.input = pbutton; o.input = pbutton;
o.callbackMethod= callbackMethod; o.callbackMethod= callbackMethod;
o.callbackParam = callbackParam; o.callbackParam = callbackParam;
m_MLButtons.push(o); m_MLButtons.push(o);
} }
} }
function addMLTab(ptab, callbackMethod, callbackParam) function addMLTab(ptab, callbackMethod, callbackParam)
{ {
if (ptab != null) if (ptab != null)
{ {
o = new Object(); o = new Object();
o.span = ptab; o.span = ptab;
o.callbackMethod= callbackMethod; o.callbackMethod= callbackMethod;
o.callbackParam = callbackParam; o.callbackParam = callbackParam;
m_MLTabs.push(o); m_MLTabs.push(o);
} }
} }
function replaceTextIds() function replaceTextIds()
{ {
var values = m_MLValues; var values = m_MLValues;
var vmaxi = values.length; var vmaxi = values.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
if (values[i].value.charAt(0) == '$') if (values[i].value.charAt(0) == '$')
{ {
var vText = getPropertyValue(values[i].value); var vText = getPropertyValue(values[i].value);
if (vText == null) continue; if (vText == null) continue;
if (vText == '') continue; if (vText == '') continue;
values[i].value = convertDoubleTildeToUTag(vText); values[i].value = convertDoubleTildeToUTag(vText);
} }
} }
var spans = m_MLSpans; var spans = m_MLSpans;
var vmaxi = spans.length; var vmaxi = spans.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
if (spans[i].id.charAt(0) == '$') if (spans[i].id.charAt(0) == '$')
{ {
var vText = getPropertyValue(spans[i].innerHTML); var vText = getPropertyValue(spans[i].innerHTML);
if (vText == null) continue; if (vText == null) continue;
if (vText == '') continue; if (vText == '') continue;
spans[i].innerHTML = convertDoubleTildeToUTag(vText); spans[i].innerHTML = convertDoubleTildeToUTag(vText);
} }
} }
var tabs = m_MLTabs; var tabs = m_MLTabs;
var vmaxi = tabs.length; var vmaxi = tabs.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
if (tabs[i].span.id.charAt(0) == '$') if (tabs[i].span.id.charAt(0) == '$')
{ {
var vText = getPropertyValue(tabs[i].span.innerHTML); var vText = getPropertyValue(tabs[i].span.innerHTML);
if (vText == null) continue; if (vText == null) continue;
if (vText == '') continue; if (vText == '') continue;
var keyCode = findHotkeyKeycode(vText); var keyCode = findHotkeyKeycode(vText);
if (keyCode != null) addControlBasedHotKey(tabs[i].span.id, keyCode,tabs[i].callbackMethod,tabs[i].callbackParam); if (keyCode != null) addControlBasedHotKey(tabs[i].span.id, keyCode,tabs[i].callbackMethod,tabs[i].callbackParam);
tabs[i].span.innerHTML = convertDoubleTildeToUTag(vText); tabs[i].span.innerHTML = convertDoubleTildeToUTag(vText);
} }
} }
buttons = m_MLButtons buttons = m_MLButtons
vmaxi = buttons.length; vmaxi = buttons.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
var vvalue = buttons[i].input.innerHTML; var vvalue = buttons[i].input.innerHTML;
var vdollar1 = vvalue.indexOf("$1$"); var vdollar1 = vvalue.indexOf("$1$");
var vdollar2 = vvalue.indexOf("$2$"); var vdollar2 = vvalue.indexOf("$2$");
if (vdollar1 >= 0 && vdollar2 > vdollar1) if (vdollar1 >= 0 && vdollar2 > vdollar1)
{ {
var vwholetext = vvalue.substring(0,vdollar1); var vwholetext = vvalue.substring(0,vdollar1);
var vtextprop = vvalue.substring(vdollar1+3,vdollar2); var vtextprop = vvalue.substring(vdollar1+3,vdollar2);
var vText = getPropertyValue("$"+vtextprop); var vText = getPropertyValue("$"+vtextprop);
if (vText == null) continue; if (vText == null) continue;
if (vText == '') continue; if (vText == '') continue;
var keyCode = findHotkeyKeycode(vText); var keyCode = findHotkeyKeycode(vText);
if (keyCode != null) addControlBasedHotKey(buttons[i].input.id, keyCode,buttons[i].callbackMethod,buttons[i].callbackParam); if (keyCode != null) addControlBasedHotKey(buttons[i].input.id, keyCode,buttons[i].callbackMethod,buttons[i].callbackParam);
if (vText != null) vwholetext += convertDoubleTildeToUTag(vText); if (vText != null) vwholetext += convertDoubleTildeToUTag(vText);
vwholetext += vvalue.substring(vdollar2+3,vvalue.length); vwholetext += vvalue.substring(vdollar2+3,vvalue.length);
buttons[i].input.innerHTML = vwholetext; buttons[i].input.innerHTML = vwholetext;
} }
} }
var options = m_MLOptions; var options = m_MLOptions;
vmaxi = options.length; vmaxi = options.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
if (options[i].text != null && options[i].text.charAt(0) == "$") if (options[i].text != null && options[i].text.charAt(0) == "$")
{ {
var vText = getPropertyValue(options[i].text); var vText = getPropertyValue(options[i].text);
if (vText == null) continue; if (vText == null) continue;
if (vText == '') continue; if (vText == '') continue;
options[i].text = vText; options[i].text = vText;
} }
} }
var images = m_MLImages; var images = m_MLImages;
vmaxi = images.length; vmaxi = images.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
if (images[i].title != null && images[i].title.charAt(0) == "$") if (images[i].title != null && images[i].title.charAt(0) == "$")
{ {
var vText = getPropertyValue(images[i].title); var vText = getPropertyValue(images[i].title);
if (vText == null) continue; if (vText == null) continue;
if (vText == '') continue; if (vText == '') continue;
images[i].title = vText; images[i].title = vText;
} }
} }
} }
var mm_refreshOccuranceOfAdapter = null; var mm_refreshOccuranceOfAdapter = null;
function refreshOccuranceOfAdapter(casaocc) function refreshOccuranceOfAdapter(casaocc)
{ {
if (mm_refreshOccuranceOfAdapter == null) mm_refreshOccuranceOfAdapter = CL().C_refreshOccuranceOfAdapter; if (mm_refreshOccuranceOfAdapter == null) mm_refreshOccuranceOfAdapter = CL().C_refreshOccuranceOfAdapter;
return mm_refreshOccuranceOfAdapter(this,casaocc);  return mm_refreshOccuranceOfAdapter(casaocc); 
} }
var mm_repointFocusInScreen = null; var mm_repointFocusInScreen = null;
function repointFocusInScreen(casafoc) function repointFocusInScreen(casafoc)
{ {
if (mm_repointFocusInScreen == null) mm_repointFocusInScreen = CL().C_repointFocusInScreen; if (mm_repointFocusInScreen == null) mm_repointFocusInScreen = CL().C_repointFocusInScreen;
return mm_repointFocusInScreen(this,casafoc);  return mm_repointFocusInScreen(casafoc); 
} }
var mm_setURLInTarget = null; var mm_setURLInTarget = null;
function setURLInTarget(url,target) function setURLInTarget(url,target)
{ {
if (mm_setURLInTarget == null) mm_setURLInTarget = CL().C_setURLInTarget; if (mm_setURLInTarget == null) mm_setURLInTarget = CL().C_setURLInTarget;
return mm_setURLInTarget(this,url,target);  return mm_setURLInTarget(url,target); 
} }
var mm_callMethodInTarget = null; var mm_callMethodInTarget = null;
function callMethodInTarget(methodName,target) function callMethodInTarget(methodName,target)
{ {
if (mm_callMethodInTarget == null) mm_callMethodInTarget = CL().C_callMethodInTarget; if (mm_callMethodInTarget == null) mm_callMethodInTarget = CL().C_callMethodInTarget;
return mm_callMethodInTarget(this,methodName,target);  return mm_callMethodInTarget(methodName,target); 
} }
var mm_findParameterInQuery = null; var mm_findParameterInQuery = null;
function findParameterInQuery(pq,pname) function findParameterInQuery(pq,pname)
{ {
if (mm_findParameterInQuery == null) mm_findParameterInQuery = CL().C_findParameterInQuery; if (mm_findParameterInQuery == null) mm_findParameterInQuery = CL().C_findParameterInQuery;
return mm_findParameterInQuery(this,pq,pname);  return mm_findParameterInQuery(pq,pname); 
} }
var mm_sizeTarget = null; var mm_sizeTarget = null;
function sizeTarget(target,size) function sizeTarget(target,size)
{ {
if (mm_sizeTarget == null) mm_sizeTarget = CL().C_sizeTarget; if (mm_sizeTarget == null) mm_sizeTarget = CL().C_sizeTarget;
return mm_sizeTarget(this,target,size);  return mm_sizeTarget(target,size); 
} }
function initAlreadyLoadedPage() function initAlreadyLoadedPage()
{ {
} }
function initWithModelIdAndSessionIdAndProcessId(modelName,modelId,sessionId,processId) function initWithModelIdAndSessionIdAndProcessId(modelName,modelId,sessionId,processId)
{ {
m_pageInactive = false; m_pageInactive = false;
for (var i=0; i<m_modelListenersLast.length; i++) for (var i=0; i<m_modelListenersLast.length; i++)
m_modelListeners.push(m_modelListenersLast[i]); m_modelListeners.push(m_modelListenersLast[i]);
m_modelListenersLast = new Array(); m_modelListenersLast = new Array();
var vserverversion = m_parentparent.m_casaversion; var vserverversion = m_parentparent.m_casaversion;
for (var i=0; i<m_jsversions.length; i++) for (var i=0; i<m_jsversions.length; i++)
{ {
var vjsversion = m_jsversions[i]; var vjsversion = m_jsversions[i];
if (vjsversion != vserverversion) if (vjsversion != vserverversion)
alert("VERSIONING PROBLEM\n\nThe file " + m_jsfiles[i] + " is version "+vjsversion+". The server's version is " + vserverversion+ ".\nLayout definitions need to be regenerated."); alert("VERSIONING PROBLEM\n\nThe file " + m_jsfiles[i] + " is version "+vjsversion+". The server's version is " + vserverversion+ ".\nLayout definitions need to be regenerated.");
} }
if (isIE() == true) if (isIE() == true)
{ {
var vAllComplete = true; var vAllComplete = true;
if (m_parentdocument.readyState != "complete") vAllComplete = false; if (m_parentdocument.readyState != "complete") vAllComplete = false;
if (document.readyState != "complete") vAllComplete = false; if (document.readyState != "complete") vAllComplete = false;
for (var i=0; i<m_innerFrames.length; i++) for (var i=0; i<m_innerFrames.length; i++)
{ {
try try
{ {
if (m_innerFrames[i].document.readyState != "complete" || if (m_innerFrames[i].document.readyState != "complete" ||
m_innerFrames[i].WORKAREA.document.readyState != "complete" || m_innerFrames[i].WORKAREA.document.readyState != "complete" ||
m_innerFrames[i].WORKAREA.csciframe.document.readyState != "complete") m_innerFrames[i].WORKAREA.csciframe.document.readyState != "complete")
{ {
vAllComplete = false; vAllComplete = false;
break; break;
} }
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
if (vAllComplete == false) if (vAllComplete == false)
{ {
m_completeCounter++; m_completeCounter++;
if (m_completeCounter > 5) if (m_completeCounter > 5)
parent.status = "Waiting for completion of contained frames (" + m_completeCounter + ")"; parent.status = "Waiting for completion of contained frames (" + m_completeCounter + ")";
if (m_completeCounter > 2500) if (m_completeCounter > 2500)
{ {
alert("INFO: Waiting for completion of IFRAMEs - no completion after 2.500 loops."); alert("INFO: Waiting for completion of IFRAMEs - no completion after 2.500 loops.");
m_completeCounter = 0; m_completeCounter = 0;
} }
continueInit(modelName,modelId,sessionId,processId); continueInit(modelName,modelId,sessionId,processId);
return; return;
} }
} }
passPagePixelSize(-1,-1); passPagePixelSize(-1,-1);
if (m_doLog) addLogMessage("initWithModelId... - started"); if (m_doLog) addLogMessage("initWithModelId... - started");
m_modelName = modelName; m_modelName = modelName;
m_sessionId = sessionId; m_sessionId = sessionId;
m_processId = processId; m_processId = processId;
m_modelId = modelId; m_modelId = modelId;
vPageInitParam = m_parentparent.pageInitParam; vPageInitParam = m_parentparent.pageInitParam;
if (vPageInitParam != null) if (vPageInitParam != null)
{ {
setPropertyValue("pageInitParam",vPageInitParam); setPropertyValue("pageInitParam",vPageInitParam);
cscformiframe.document.getElementById("PAGEINITPARAM").value = vPageInitParam; cscformiframe.document.getElementById("PAGEINITPARAM").value = vPageInitParam;
m_parentparent.pageInitParam = null; m_parentparent.pageInitParam = null;
} }
if (m_parentparent.CasaSessionSTYLESHEET != null && if (m_parentparent.CasaSessionSTYLESHEET != null &&
m_parentparent.CasaSessionSTYLESHEET != "") m_parentparent.CasaSessionSTYLESHEET != "")
{ {
setPropertyValue("style",m_parentparent.CasaSessionSTYLESHEET); setPropertyValue("style",m_parentparent.CasaSessionSTYLESHEET);
} }
var vxml = buildFirstTag("i","") + var vxml = buildFirstTag("i","") +
buildXMLFromModel("initWithModelIdAndSessionIdAndProcessId"); buildXMLFromModel("initWithModelIdAndSessionIdAndProcessId");
if (m_doLog) addLogMessage("initWithModelId... - submitting"); if (m_doLog) addLogMessage("initWithModelId... - submitting");
if (m_parentparent.isPopupPage == true) if (m_parentparent.isPopupPage == true)
{ {
CL().registerPopupPage(m_parentparent, true); CL().registerPopupPage(m_parentparent, true);
} }
fetchModelFromServer(vxml); fetchModelFromServer(vxml);
} }
function findPseudoURL() function findPseudoURL()
{ {
var vhref = parent.location.href; var vhref = parent.location.href;
var vx = vhref.lastIndexOf("/"); var vx = vhref.lastIndexOf("/");
var vresult = vhref.substring(vx,vhref.length); var vresult = vhref.substring(vx,vhref.length);
vhref = vhref.substring(0,vx); vhref = vhref.substring(0,vx);
vx = vhref.lastIndexOf("/"); vx = vhref.lastIndexOf("/");
vresult = vhref.substring(vx,vhref.length) + vresult; vresult = vhref.substring(vx,vhref.length) + vresult;
return vresult; return vresult;
} }
var m_lastServerFetch; var m_lastServerFetch;
function fetchModelFromServer(pxml) function fetchModelFromServer(pxml)
{ {
m_bufferedxml = null; m_bufferedxml = null;
var pAccessKey = null; var pAccessKey = null;
try try
{ {
if (CL() != null) if (CL() != null)
{ {
pAccessKey = CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL()); pAccessKey = CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL());
m_bufferedxml = CL().findBufferedAdapterStream(pAccessKey); m_bufferedxml = CL().findBufferedAdapterStream(pAccessKey);
} }
} }
catch (exc) { m_bufferedxml = null; } catch (exc) { m_bufferedxml = null; }
if (m_cscformOccupied == true) if (m_cscformOccupied == true)
{ {
if (m_doLog) addLogMessage("fetchModelFromServer - Try again in 20 ms"); if (m_doLog) addLogMessage("fetchModelFromServer - Try again in 20 ms");
setTimeout("fetchModelFromServer(\""+pxml+"\")",20); setTimeout("fetchModelFromServer(\""+pxml+"\")",20);
return; return;
} }
m_lastServerFetch = new Date(); m_lastServerFetch = new Date();
parent.switchToOccupied(); parent.switchToOccupied();
if (m_bufferedxml == null) if (m_bufferedxml == null)
{ {
if (m_doLog) addLogMessage("fetchModelFromServer - Model is fetched from server"); if (m_doLog) addLogMessage("fetchModelFromServer - Model is fetched from server");
m_cscformOccupied = true; m_cscformOccupied = true;
cscformiframe.document.getElementById("SESSIONID").value = m_sessionId; cscformiframe.document.getElementById("SESSIONID").value = m_sessionId;
cscformiframe.document.getElementById("XML").value = pxml; cscformiframe.document.getElementById("XML").value = pxml;
cscformiframe.submitPost(); cscformiframe.submitPost();
if (m_doLog) addLogMessage("fetchModelFromServer - Submit executed"); if (m_doLog) addLogMessage("fetchModelFromServer - Submit executed");
status = "Waiting for Server Response..."; status = "Waiting for Server Response...";
if (isIE()) setTimeout("checkSubPageStatus("+m_callcounter+")",2000); if (isIE()) setTimeout("checkSubPageStatus("+m_callcounter+")",2000);
} }
else else
{ {
if (m_doLog) addLogMessage("fetchModelFromServer - Model is available in central library"); if (m_doLog) addLogMessage("fetchModelFromServer - Model is available in central library");
CL().clearBufferedAdapterStream(pAccessKey); CL().clearBufferedAdapterStream(pAccessKey);
reactOnNewModel(true); reactOnNewModel(true);
} }
} }
function checkSubPageStatus(vcaco,secondtime) function checkSubPageStatus(vcaco,secondtime)
{ {
if (vcaco == m_callcounter) if (vcaco == m_callcounter)
{ {
try try
{ {
var v = cscformiframe.document.readyState; var v = cscformiframe.document.readyState;
addLogMessage("checkSubPageStatus, readyState = " + v); addLogMessage("checkSubPageStatus, readyState = " + v);
setTimeout("checkSubPageStatus("+vcaco+")",2000); setTimeout("checkSubPageStatus("+vcaco+")",2000);
} }
catch (eexxcc) catch (eexxcc)
{ {
if (secondtime == undefined) if (secondtime == undefined)
{ {
// Messagebox auskommentiert von KH // Messagebox auskommentiert von KH
//alert("Server did not respond to your request.\n"+ //alert("Server did not respond to your request.\n"+
//"The page that sent the request will be reloaded.\n\n" + //"The page that sent the request will be reloaded.\n\n" +
//"Please contact your system administrator."); //"Please contact your system administrator.");
//status = ""; //status = "";
//parent.location.reload(); //parent.location.reload();
} }
else else
{ {
setTimeout("checkSubPageStatus("+vcaco+")",1000); setTimeout("checkSubPageStatus("+vcaco+")",1000);
} }
} }
} }
} }
function continueInit(modelName,modelId,sessionId,processId) function continueInit(modelName,modelId,sessionId,processId)
{ {
setTimeout("initWithModelIdAndSessionIdAndProcessId('"+modelName+"','"+modelId+"','"+sessionId+"','"+processId+"')",30); setTimeout("initWithModelIdAndSessionIdAndProcessId('"+modelName+"','"+modelId+"','"+sessionId+"','"+processId+"')",30);
} }
function reactOnNewModel(pbufferedcall) function reactOnNewModel(pbufferedcall)
{ {
m_callcounter++; m_callcounter++;
status = "Processing server response... " + parent.location.href; status = "Processing server response... " + parent.location.href;
CL(); CL();
CL().reactOnNewActivity(); CL().reactOnNewActivity();
if (pbufferedcall == null || pbufferedcall == false) if (pbufferedcall == null || pbufferedcall == false)
{ {
if (m_processCasabacSynchronizeIfNecessary != true) if (m_processCasabacSynchronizeIfNecessary != true)
if (CL() != null) CL().clearBufferedAdapterStreams(parent.location.href + " in reactOnNewModel"); if (CL() != null) CL().clearBufferedAdapterStreams(parent.location.href + " in reactOnNewModel");
} }
m_beforeFirstReactOnNewModel = false; m_beforeFirstReactOnNewModel = false;
m_bufferNeedsRefresh = false; m_bufferNeedsRefresh = false;
if (m_doLog) addLogMessage("reactOnNewModel - started"); if (m_doLog) addLogMessage("reactOnNewModel - started");
var startReactDate = new Date(); var startReactDate = new Date();
var nextLoop = true; var nextLoop = true;
var errorMessage = null; var errorMessage = null;
if (m_continueMethod != null) if (m_continueMethod != null)
{ {
try try
{ {
var tempContinueMethod = m_continueMethod; var tempContinueMethod = m_continueMethod;
m_continueMethod = null; m_continueMethod = null;
tempContinueMethod(); tempContinueMethod();
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
var stamp = cscformiframe.document.getElementById("STAMP").value; var stamp = cscformiframe.document.getElementById("STAMP").value;
if (m_lastStamp != undefined && if (m_lastStamp != undefined &&
m_lastStamp != "INIT" && m_lastStamp != "INIT" &&
stamp != undefined && stamp != undefined &&
stamp != "INIT") stamp != "INIT")
{ {
var i1 = m_lastStamp * (-1) * (-1); var i1 = m_lastStamp * (-1) * (-1);
var i2 = stamp * (-1) * (-1); var i2 = stamp * (-1) * (-1);
if (i1 > i2) if (i1 > i2)
{ {
alert("Client is not in synch with Server. Possible reasons:\n\n" + alert("Client is not in synch with Server. Possible reasons:\n\n" +
"(1) MOST LIKELY: You may have used the browser's BACK button - which is not supported in order to keep application consistet.\n" + "(1) MOST LIKELY: You may have used the browser's BACK button - which is not supported in order to keep application consistet.\n" +
"(2) Your server was shut down and restarted during your client session.\n" + "(2) Your server was shut down and restarted during your client session.\n" +
"(3) If operating in a cluster: error in set up.\n\n" + "(3) If operating in a cluster: error in set up.\n\n" +
"After pressing OK the client will be synchronized with the server."  "After pressing OK the client will be synchronized with the server." 
); );
status = ""; status = "";
parent.location.reload(); parent.location.reload();
return; return;
} }
} }
m_lastStamp = stamp; m_lastStamp = stamp;
var vEMSG = cscformiframe.document.getElementById("ERRORMESSAGE"); var vEMSG = cscformiframe.document.getElementById("ERRORMESSAGE");
if (vEMSG != null) errorMessage = vEMSG.value; if (vEMSG != null) errorMessage = vEMSG.value;
if (errorMessage != null && errorMessage != "") if (errorMessage != null && errorMessage != "")
{ {
if (m_doLog) addLogMessage("reactOnNewModel - error message was passed from server"); if (m_doLog) addLogMessage("reactOnNewModel - error message was passed from server");
if (errorMessage.indexOf("(1)") >= 0 && if (errorMessage.indexOf("(1)") >= 0 &&
errorMessage.indexOf("(2)") >= 0 && errorMessage.indexOf("(2)") >= 0 &&
errorMessage.indexOf("(3)") >= 0) errorMessage.indexOf("(3)") >= 0)
{ {
m_parentparent.location.href = "../servlet/StartMessagePage?TYPE=SESSIONTIMEOUT"; m_parentparent.location.href = "../servlet/StartMessagePage?TYPE=SESSIONTIMEOUT";
status = ""; status = "";
return; return;
} }
else if (errorMessage.indexOf("ProcessNotAvailableError") >= 0) else if (errorMessage.indexOf("ProcessNotAvailableError") >= 0)
{ {
try try
{ {
addLogMessage("reactOnNewModel - Suppressed ProcessNotAvailableError"); addLogMessage("reactOnNewModel - Suppressed ProcessNotAvailableError");
parent.switchToDisplay(); parent.switchToDisplay();
} }
catch (eexxcc) {} catch (eexxcc) {}
status = ""; status = "";
return; return;
} }
else if (isIE() && else if (isIE() &&
errorMessage.indexOf("Session was already removed") >= 0) errorMessage.indexOf("Session was already removed") >= 0)
{ {
status = ""; status = "";
return; return;
} }
else if (isIE() && else if (isIE() &&
errorMessage.indexOf("831167") >= 0) errorMessage.indexOf("831167") >= 0)
{ {
alert("ERROR:\n\n" + errorMessage + "\n\nPage will be reloaded to insure consistency after pressing OK."); alert("ERROR:\n\n" + errorMessage + "\n\nPage will be reloaded to insure consistency after pressing OK.");
status = ""; status = "";
parent.location.reload(); parent.location.reload();
return; return;
} }
else else
{ {
alert("ERROR IN APPLICATION:\n\n" + errorMessage); alert("ERROR IN APPLICATION:\n\n" + errorMessage);
parent.switchToDisplay(); parent.switchToDisplay();
status = ""; status = "";
return; return;
} }
} }
var xml = null; var xml = null;
if (pbufferedcall == null || pbufferedcall == false) if (pbufferedcall == null || pbufferedcall == false)
{ {
if (m_doLog) addLogMessage("reactOnNewModel - convert special characters - start"); if (m_doLog) addLogMessage("reactOnNewModel - convert special characters - start");
xml = cscformiframe.document.getElementById("XML").value; xml = cscformiframe.document.getElementById("XML").value;
if (xml.indexOf(m_cre1) >= 0) xml = xml.replace(m_re1,"\b"); if (xml.indexOf(m_cre1) >= 0) xml = xml.replace(m_re1,"\b");
if (xml.indexOf(m_cre2) >= 0) xml = xml.replace(m_re2,"\t"); if (xml.indexOf(m_cre2) >= 0) xml = xml.replace(m_re2,"\t");
if (xml.indexOf(m_cre3) >= 0) xml = xml.replace(m_re3,"\n"); if (xml.indexOf(m_cre3) >= 0) xml = xml.replace(m_re3,"\n");
if (xml.indexOf(m_cre4) >= 0) xml = xml.replace(m_re4,"\f"); if (xml.indexOf(m_cre4) >= 0) xml = xml.replace(m_re4,"\f");
if (xml.indexOf(m_cre5) >= 0) xml = xml.replace(m_re5,"\r"); if (xml.indexOf(m_cre5) >= 0) xml = xml.replace(m_re5,"\r");
if (xml.indexOf(m_cre6) >= 0) xml = xml.replace(m_re6,"&"); if (xml.indexOf(m_cre6) >= 0) xml = xml.replace(m_re6,"&");
if (xml.indexOf(m_cre35) >= 0) xml = xml.replace(m_re35,"<"); if (xml.indexOf(m_cre35) >= 0) xml = xml.replace(m_re35,"<");
if (xml.indexOf(m_cre36) >= 0) xml = xml.replace(m_re36,">"); if (xml.indexOf(m_cre36) >= 0) xml = xml.replace(m_re36,">");
if (m_doLog) addLogMessage("reactOnNewModel - convert special characters - end"); if (m_doLog) addLogMessage("reactOnNewModel - convert special characters - end");
} }
else else
{ {
xml = m_bufferedxml; xml = m_bufferedxml;
m_bufferedxml = null; m_bufferedxml = null;
} }
m_cscformOccupied = false; m_cscformOccupied = false;
if (xml == null || xml.length == 0) if (xml == null || xml.length == 0)
{ {
parent.switchToDisplay(); parent.switchToDisplay();
status = ""; status = "";
return; return;
} }
if (m_doLog) addLogMessage("reactOnNewModel - transfer model into datastructure - start"); if (m_doLog) addLogMessage("reactOnNewModel - transfer model into datastructure - start");
if (m_doTrace) beforeTransferDate = new Date(); if (m_doTrace) beforeTransferDate = new Date();
transferXMLIntoModel(xml); transferXMLIntoModel(xml);
if (m_doTrace) afterTransferDate = new Date(); if (m_doTrace) afterTransferDate = new Date();
if (m_doLog) addLogMessage("reactOnNewModel - transfer model into datastructure - end"); if (m_doLog) addLogMessage("reactOnNewModel - transfer model into datastructure - end");
var vInterim; var vInterim;
vInterim = getPropertyValue("dateDisplay"); vInterim = getPropertyValue("dateDisplay");
if (vInterim != null && vInterim != "") m_dateDisplay = vInterim; if (vInterim != null && vInterim != "") m_dateDisplay = vInterim;
vInterim = getPropertyValue("timeDisplay"); vInterim = getPropertyValue("timeDisplay");
if (vInterim != null && vInterim != "") m_timeDisplay = vInterim; if (vInterim != null && vInterim != "") m_timeDisplay = vInterim;
vInterim = getPropertyValue("decimalSeparator"); vInterim = getPropertyValue("decimalSeparator");
if (vInterim != null && vInterim != "") m_decimalSeparator = vInterim; if (vInterim != null && vInterim != "") m_decimalSeparator = vInterim;
vInterim = getPropertyValue("language"); vInterim = getPropertyValue("language");
if (vInterim != null && vInterim != "") m_language = vInterim; if (vInterim != null && vInterim != "") m_language = vInterim;
vInterim = getPropertyValue("hotKeyCode"); vInterim = getPropertyValue("hotKeyCode");
if (vInterim != null && vInterim != "") m_hotKeyCode = vInterim; if (vInterim != null && vInterim != "") m_hotKeyCode = vInterim;
vInterim = getPropertyValue("casabacAddons.dir"); vInterim = getPropertyValue("casabacAddons.dir");
if (vInterim != null && vInterim != "") m_direction = vInterim; if (vInterim != null && vInterim != "") m_direction = vInterim;
if (m_firstModel == true) if (m_firstModel == true)
{ {
if (m_doLog) addLogMessage("reactOnNewModel - fill textid spans - start"); if (m_doLog) addLogMessage("reactOnNewModel - fill textid spans - start");
parent.fillTextIdSpans(); parent.fillTextIdSpans();
if (m_doLog) addLogMessage("reactOnNewModel - fill textid spans - end"); if (m_doLog) addLogMessage("reactOnNewModel - fill textid spans - end");
} }
var vStyle = getPropertyValue('style'); var vStyle = getPropertyValue('style');
parent.parent.CasaSTYLESHEET = vStyle; parent.parent.CasaSTYLESHEET = vStyle;
if (vStyle != null && vStyle != "" && m_parentparent.CasaSessionSTYLESHEET != null) m_parentparent.CasaSessionSTYLESHEET = vStyle; if (vStyle != null && vStyle != "" && m_parentparent.CasaSessionSTYLESHEET != null) m_parentparent.CasaSessionSTYLESHEET = vStyle;
var vStyleSheet = m_parentdocument.getElementById('casabacstylesheet'); var vStyleSheet = m_parentdocument.getElementById('casabacstylesheet');
if (parent.CASAstylesheetfile == null && if (parent.CASAstylesheetfile == null &&
m_parentparent.CasaSTYLESHEET != null && m_parentparent.CasaSTYLESHEET != null &&
m_parentparent.CasaSTYLESHEET != "") m_parentparent.CasaSTYLESHEET != "")
{ {
if (isIE()) if (isIE())
{ {
if (vStyleSheet.href != m_parentparent.CasaSTYLESHEET) if (vStyleSheet.href != m_parentparent.CasaSTYLESHEET)
vStyleSheet.href = m_parentparent.CasaSTYLESHEET; vStyleSheet.href = m_parentparent.CasaSTYLESHEET;
} }
else else
{ {
hrefSheetName = vStyleSheet.href; hrefSheetName = vStyleSheet.href;
if (vStyleSheet.href.lastIndexOf("/") > 0) if (vStyleSheet.href.lastIndexOf("/") > 0)
hrefSheetName = vStyleSheet.href.substring(vStyleSheet.href.lastIndexOf("/")-0+1, vStyleSheet.href.length); hrefSheetName = vStyleSheet.href.substring(vStyleSheet.href.lastIndexOf("/")-0+1, vStyleSheet.href.length);
ppSheetName = m_parentparent.CasaSTYLESHEET; ppSheetName = m_parentparent.CasaSTYLESHEET;
if (ppSheetName.lastIndexOf("/") > 0) if (ppSheetName.lastIndexOf("/") > 0)
ppSheetName = ppSheetName.substring(ppSheetName.lastIndexOf("/")-0+1, ppSheetName.length); ppSheetName = ppSheetName.substring(ppSheetName.lastIndexOf("/")-0+1, ppSheetName.length);
if (hrefSheetName != ppSheetName) if (hrefSheetName != ppSheetName)
vStyleSheet.href = m_parentparent.CasaSTYLESHEET; vStyleSheet.href = m_parentparent.CasaSTYLESHEET;
} }
} }
if (m_doLog) addLogMessage("reactOnNewModel - informing listeners"); if (m_doLog) addLogMessage("reactOnNewModel - informing listeners");
if (m_doTrace) beforeListenersDate = new Date(); if (m_doTrace) beforeListenersDate = new Date();
updateModelListeners(xml); updateModelListeners(xml);
if (m_doLog) addLogMessage("reactOnNewModel - informing listeners - finished"); if (m_doLog) addLogMessage("reactOnNewModel - informing listeners - finished");
if (m_doTrace) afterListenersDate = new Date(); if (m_doTrace) afterListenersDate = new Date();
var stdBefore = new Date(); var stdBefore = new Date();
try try
{ {
parent.switchToDisplay(); parent.switchToDisplay();
} }
catch (eexxcc) catch (eexxcc)
{ {
addLogMessage("Error when switching to display occurred"); addLogMessage("Error when switching to display occurred");
addLogMessage("This error normally happens when back is pressed in the browser"); addLogMessage("This error normally happens when back is pressed in the browser");
alert("Reloading page, reason (most likely): back-button pressed in browser"); alert("Reloading page, reason (most likely): back-button pressed in browser");
parent.location.reload(); parent.location.reload();
} }
var stdEnd = new Date(); var stdEnd = new Date();
if (m_doLog) addLogMessage("reactOnNewModel - Duration of switchToDisplay = " + (stdEnd.getTime()-stdBefore.getTime())); if (m_doLog) addLogMessage("reactOnNewModel - Duration of switchToDisplay = " + (stdEnd.getTime()-stdBefore.getTime()));
sizeMozDivs(); sizeMozDivs();
if (!isIE()) parent.reactOnResize(); if (!isIE()) parent.reactOnResize();
var endReactDate = new Date(); var endReactDate = new Date();
vInitTime = "Not measured"; vInitTime = "Not measured";
if (m_doTrace) if (m_doTrace)
{ {
if (parent.m_startInitDate != null && parent.m_endInitDate != null) if (parent.m_startInitDate != null && parent.m_endInitDate != null)
{ {
vInitTime = parent.m_endInitDate.getTime() - parent.m_startInitDate.getTime(); vInitTime = parent.m_endInitDate.getTime() - parent.m_startInitDate.getTime();
vRenderingTime = parent.m_startInitDate.getTime() - parent.m_startPageDate.getTime(); vRenderingTime = parent.m_startInitDate.getTime() - parent.m_startPageDate.getTime();
} }
} }
if (m_doLog) addLogMessage("reactOnNewModel - Duration of client update = " + (endReactDate.getTime()-startReactDate.getTime())); if (m_doLog) addLogMessage("reactOnNewModel - Duration of client update = " + (endReactDate.getTime()-startReactDate.getTime()));
if (m_doTrace) alert( if (m_doTrace) alert(
"REQUEST PROCESSING" + "REQUEST PROCESSING" +
"\nTotal: " + (m_traceRequestEndDate.getTime() - m_traceRequestStartDate.getTime()) + "\nTotal: " + (m_traceRequestEndDate.getTime() - m_traceRequestStartDate.getTime()) +
"\nBuild XML stream: " + m_traceBuildXMLTime + "\nBuild XML stream: " + m_traceBuildXMLTime +
"\nFirst rendering (only for first appearance!) " + vRenderingTime + "\nFirst rendering (only for first appearance!) " + vRenderingTime +
"\nInit Time (only for first appearance!) " + vInitTime + "\nInit Time (only for first appearance!) " + vInitTime +
"\n\nRESPONSE PROCESSING:" + "\n\nRESPONSE PROCESSING:" +
"\nTotal: " + (endReactDate.getTime() - startReactDate.getTime()) + "\nTotal: " + (endReactDate.getTime() - startReactDate.getTime()) +
"\nParsing: " + (afterTransferDate.getTime() - beforeTransferDate.getTime()) + "\nParsing: " + (afterTransferDate.getTime() - beforeTransferDate.getTime()) +
"\n\nTOTAL PROCESSING:" + "\n\nTOTAL PROCESSING:" +
"\nTotal: " + (endReactDate.getTime() - m_traceRequestStartDate.getTime()) + "\nTotal: " + (endReactDate.getTime() - m_traceRequestStartDate.getTime()) +
"\nhttp: " + (startReactDate.getTime() - m_traceRequestEndDate.getTime()) "\nhttp: " + (startReactDate.getTime() - m_traceRequestEndDate.getTime())
); );
status = ""; status = "";
var nextPopup = getPropertyValue('nextPopup'); var nextPopup = getPropertyValue('nextPopup');
var nextPopupId = getPropertyValue('nextPopupId'); var nextPopupId = getPropertyValue('nextPopupId');
var nextPopupModal = getPropertyValue('nextPopupModal'); var nextPopupModal = getPropertyValue('nextPopupModal');
var nextPopupFeatures = getPropertyValue('nextPopupFeatures'); var nextPopupFeatures = getPropertyValue('nextPopupFeatures');
var nextPopupTitle = getPropertyValue('nextPopupTitle'); var nextPopupTitle = getPropertyValue('nextPopupTitle');
if (nextPopup != null && nextPopup != "null" && nextPopup != "") if (nextPopup != null && nextPopup != "null" && nextPopup != "")
{ {
if (nextPopupId == null) nextPopupId = ""; if (nextPopupId == null) nextPopupId = "";
var nextPopupSessionId = getPropertyValue('nextPopupSessionId'); var nextPopupSessionId = getPropertyValue('nextPopupSessionId');
var nextPopupSubsessionId = getPropertyValue('nextPopupSubsessionId'); var nextPopupSubsessionId = getPropertyValue('nextPopupSubsessionId');
var nextPopupOnCloseMethod = getPropertyValue('nextPopupOnCloseMethod'); var nextPopupOnCloseMethod = getPropertyValue('nextPopupOnCloseMethod');
var nextPopupOnCloseProperty = getPropertyValue('nextPopupOnCloseProperty'); var nextPopupOnCloseProperty = getPropertyValue('nextPopupOnCloseProperty');
var nextPopupOnClosePropertyValue = getPropertyValue('nextPopupOnClosePropertyValue'); var nextPopupOnClosePropertyValue = getPropertyValue('nextPopupOnClosePropertyValue');
openPopupPAGE(nextPopup,nextPopupId,nextPopupModal,nextPopupFeatures,nextPopupTitle,nextPopupSessionId,nextPopupSubsessionId,nextPopupOnCloseMethod,nextPopupOnCloseProperty,nextPopupOnClosePropertyValue); openPopupPAGE(nextPopup,nextPopupId,nextPopupModal,nextPopupFeatures,nextPopupTitle,nextPopupSessionId,nextPopupSubsessionId,nextPopupOnCloseMethod,nextPopupOnCloseProperty,nextPopupOnClosePropertyValue);
} }
try try
{ {
var vCounter = 0; var vCounter = 0;
while (true) while (true)
{ {
var vurl = getPropertyValue("frameMessages["+vCounter+"].frameURL"); var vurl = getPropertyValue("frameMessages["+vCounter+"].frameURL");
var vtarget = getPropertyValue("frameMessages["+vCounter+"].frameTarget"); var vtarget = getPropertyValue("frameMessages["+vCounter+"].frameTarget");
var vmethod = getPropertyValue("frameMessages["+vCounter+"].frameMethod"); var vmethod = getPropertyValue("frameMessages["+vCounter+"].frameMethod");
if (vtarget == null) if (vtarget == null)
break; break;
if (m_doLog) addLogMessage("reactOnNewModel - frame communication "+vtarget+"/"+vmethod+"/"+vurl); if (m_doLog) addLogMessage("reactOnNewModel - frame communication "+vtarget+"/"+vmethod+"/"+vurl);
if (vmethod == "FRAMERESIZE") sizeTarget(vtarget,vurl); if (vmethod == "FRAMERESIZE") sizeTarget(vtarget,vurl);
else if (vtarget != null && vtarget.substring(0,8) == "CASAOCC;") refreshOccuranceOfAdapter(vtarget); else if (vtarget != null && vtarget.substring(0,8) == "CASAOCC;") refreshOccuranceOfAdapter(vtarget);
else if (vtarget != null && vtarget.substring(0,8) == "CASAFOC;") repointFocusInScreen(vtarget); else if (vtarget != null && vtarget.substring(0,8) == "CASAFOC;") repointFocusInScreen(vtarget);
else if (vurl != null && vurl != "") setURLInTarget(vurl,vtarget); else if (vurl != null && vurl != "") setURLInTarget(vurl,vtarget);
else if (vmethod != null && vmethod != "") callMethodInTarget(vmethod,vtarget); else if (vmethod != null && vmethod != "") callMethodInTarget(vmethod,vtarget);
vCounter++; vCounter++;
} }
var vurl = getPropertyValue("frameURL"); var vurl = getPropertyValue("frameURL");
var vtarget = getPropertyValue("frameTarget"); var vtarget = getPropertyValue("frameTarget");
if (vurl != null && vurl != "" && vtarget != null && vtarget != "") if (vurl != null && vurl != "" && vtarget != null && vtarget != "")
setURLInTarget(vurl,vtarget); setURLInTarget(vurl,vtarget);
} }
catch (eexxcc) {} catch (eexxcc) {}
try try
{ {
vRefreshParent = getPropertyValue("refreshParent"); vRefreshParent = getPropertyValue("refreshParent");
if (vRefreshParent != null && vRefreshParent == "true") if (vRefreshParent != null && vRefreshParent == "true")
{ {
if (m_parentparent != null && if (m_parentparent != null &&
m_parentparent.parent != null && m_parentparent.parent != null &&
m_parentparent.parent.csciframe != null) m_parentparent.parent.csciframe != null)
{ {
parent.switchToDisplay(); parent.switchToDisplay();
if (m_focusSETIN == null) if (m_focusSETIN == null)
m_parentparent.parent.csciframe.m_focusSETIN = self; m_parentparent.parent.csciframe.m_focusSETIN = self;
else else
{ {
m_parentparent.parent.csciframe.m_focusSETIN = m_focusSETIN; m_parentparent.parent.csciframe.m_focusSETIN = m_focusSETIN;
m_focusSETIN = undefined; m_focusSETIN = undefined;
} }
m_parentparent.parent.m_blockIOByFlush = true; m_parentparent.parent.m_blockIOByFlush = true;
m_parentparent.parent.csciframe.submitModel("submit"); m_parentparent.parent.csciframe.submitModel("submit");
status = ""; status = "";
return; return;
} }
if (m_parentparent != null && if (m_parentparent != null &&
m_parentparent.parent != null && m_parentparent.parent != null &&
m_parentparent.parent.m_isCasabacMFPAGE == true && m_parentparent.parent.m_isCasabacMFPAGE == true &&
m_parentparent.parent.parent != null && m_parentparent.parent.parent != null &&
m_parentparent.parent.parent.parent != null && m_parentparent.parent.parent.parent != null &&
m_parentparent.parent.parent.parent.csciframe != null) m_parentparent.parent.parent.parent.csciframe != null)
{ {
parent.switchToDisplay(); parent.switchToDisplay();
if (m_focusSETIN == null) if (m_focusSETIN == null)
m_parentparent.parent.parent.parent.csciframe.m_focusSETIN = self; m_parentparent.parent.parent.parent.csciframe.m_focusSETIN = self;
else else
{ {
m_parentparent.parent.parent.parent.csciframe.m_focusSETIN = m_focusSETIN; m_parentparent.parent.parent.parent.csciframe.m_focusSETIN = m_focusSETIN;
m_focusSETIN = undefined; m_focusSETIN = undefined;
} }
m_parentparent.parent.parent.parent.csciframe.submitModel("submit"); m_parentparent.parent.parent.parent.csciframe.submitModel("submit");
status = ""; status = "";
return; return;
} }
if (parent != null && if (parent != null &&
m_parentparent != null && m_parentparent != null &&
m_parentparent.leaveToPage != null) m_parentparent.leaveToPage != null)
{ {
parent.switchToDisplay(); parent.switchToDisplay();
m_parentparentdocument.location.href = m_parentparent.leaveToPage; m_parentparentdocument.location.href = m_parentparent.leaveToPage;
status = ""; status = "";
return; return;
} }
if (parent != null && if (parent != null &&
m_parentparent != null) m_parentparent != null)
{ {
if (!(m_parentparent.isPopupPage == true || if (!(m_parentparent.isPopupPage == true ||
m_parentparent.isPopupPage == "true")) m_parentparent.isPopupPage == "true"))
{ {
parent.switchToDisplay(); parent.switchToDisplay();
m_parentparentdocument.location.href = "../../HTMLBasedGUI/general/aboutBlank.html"; m_parentparentdocument.location.href = "../../HTMLBasedGUI/general/aboutBlank.html";
status = ""; status = "";
return; return;
} }
else else
{ {
} }
} }
} }
} }
catch (eexxcc) { m_firstModel = false; } catch (eexxcc) { m_firstModel = false; }
m_firstModel = false; m_firstModel = false;
addLogMessage("reactOnNewModel - processing statusproplisteners"); addLogMessage("reactOnNewModel - processing statusproplisteners");
for (var id in m_statuspropListeners) for (var id in m_statuspropListeners)
{ {
try try
{ {
var s = getPropertyValue(id); var s = getPropertyValue(id);
if (s == "ERROR" || s == "FOCUS") if (s == "ERROR" || s == "FOCUS")
{ {
vls = m_statuspropListeners[id]; vls = m_statuspropListeners[id];
for(iiii=0;iiii<vls.length;iiii++) for(iiii=0;iiii<vls.length;iiii++)
addFocusRequestor(vls[iiii]); addFocusRequestor(vls[iiii]);
} }
} }
catch (exc) {} catch (exc) {}
} }
if (m_focusSETIN == null) if (m_focusSETIN == null)
{ {
if (m_doLog) addLogMessage("reactOnNewModel - Setting focus"); if (m_doLog) addLogMessage("reactOnNewModel - Setting focus");
pointFocus(); pointFocus();
if (m_doLog) addLogMessage("reactOnNewModel - finished"); if (m_doLog) addLogMessage("reactOnNewModel - finished");
status = ""; status = "";
} }
else else
{ {
try { m_focusSETIN.pointFocus(); } catch (eexxcc) {} try { m_focusSETIN.pointFocus(); } catch (eexxcc) {}
m_focusSETIN = undefined; m_focusSETIN = undefined;
status = ""; status = "";
} }
var vfpl = getPropertyValue("forcePageReload"); var vfpl = getPropertyValue("forcePageReload");
if (vfpl == "true") if (vfpl == "true")
{ {
setPropertyValue("forcePageReload",false,true); setPropertyValue("forcePageReload",false,true);
m_parentparent.resetWABuffer(); m_parentparent.resetWABuffer();
CL().clearBufferedAdapterStream(CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL())); CL().clearBufferedAdapterStream(CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL()));
parentLocationReload(); parentLocationReload();
} }
} }
function parentLocationReload() function parentLocationReload()
{ {
if (!isIE()) if (!isIE())
{ {
var ssrc = parent.location.href; var ssrc = parent.location.href;
parent.location.replace(ssrc); parent.location.replace(ssrc);
} }
else else
{ {
parent.location.reload(); parent.location.reload();
} }
} }
function updateModelListeners(xml) function updateModelListeners(xml)
{ {
m_continueUpdateModelListeners = true; m_continueUpdateModelListeners = true;
var vmaxii = m_modelListeners.length; var vmaxii = m_modelListeners.length;
for (var ii=0; ii<m_modelListeners.length; ii++) for (var ii=0; ii<m_modelListeners.length; ii++)
{ {
try try
{ {
var vbefore = new Date(); var vbefore = new Date();
m_modelListeners[ii](xml); m_modelListeners[ii](xml);
var vend = new Date(); var vend = new Date();
var vdiff = vend.getTime()-vbefore.getTime(); var vdiff = vend.getTime()-vbefore.getTime();
if (m_doLog) addLogMessage("reactOnNewModel - modellistener["+ii+"] " + vdiff); if (m_doLog) addLogMessage("reactOnNewModel - modellistener["+ii+"] " + vdiff);
} }
catch (exc) {} catch (exc) {}
if (m_continueUpdateModelListeners == false) return; if (m_continueUpdateModelListeners == false) return;
} }
for (var id in m_propertyListenersTBP) for (var id in m_propertyListenersTBP)
{ {
try try
{ {
var vbefore = new Date(); var vbefore = new Date();
m_propertyListenersTBP[id](xml); m_propertyListenersTBP[id](xml);
var vend = new Date(); var vend = new Date();
if (m_doLog) addLogMessage("reactOnNewModel - propertyListenersTBP["+id+"] " + (vend.getTime()-vbefore.getTime())); if (m_doLog) addLogMessage("reactOnNewModel - propertyListenersTBP["+id+"] " + (vend.getTime()-vbefore.getTime()));
} }
catch (exc) {} catch (exc) {}
} }
m_propertyListenersTBP = new Array(); m_propertyListenersTBP = new Array();
} }
function transferXMLIntoModel(xml) function transferXMLIntoModel(xml)
{ {
var vPropStack = new Array(); var vPropStack = new Array();
var vAbbrs = new Array(); var vAbbrs = new Array();
var vPropStackTop = 0; var vPropStackTop = 0;
var vPropString = ""; var vPropString = "";
if (m_properties == null) if (m_properties == null)
{ {
m_properties = new Array(); m_properties = new Array();
m_model = new Array(); m_model = new Array();
reapplyPropertyListeners("transferXMLIntoModel"); reapplyPropertyListeners("transferXMLIntoModel");
} }
var length = xml.length; var length = xml.length;
var i=0; var i=0;
var pCount = 0; var pCount = 0;
while (true) while (true)
{ {
if (i >= length) { break; } if (i >= length) { break; }
vcurrentchar = xml.charAt(i); vcurrentchar = xml.charAt(i);
if (vcurrentchar == "p" || vcurrentchar == "q" || vcurrentchar == "z" || vcurrentchar == "w") if (vcurrentchar == "p" || vcurrentchar == "q" || vcurrentchar == "z" || vcurrentchar == "w")
{ {
pCount++; pCount++;
var pvallength = 5; var pvallength = 5;
if (vcurrentchar == "z") { pvallength = 10; vcurrentchar = "p"; } if (vcurrentchar == "z") { pvallength = 10; vcurrentchar = "p"; }
else if (vcurrentchar == "w") { pvallength = 10; vcurrentchar = "q"; } else if (vcurrentchar == "w") { pvallength = 10; vcurrentchar = "q"; }
nLength = xml.substr(i+1,2) * 1; nLength = xml.substr(i+1,2) * 1;
vLength = xml.substr(i+3,pvallength) * 1; vLength = xml.substr(i+3,pvallength) * 1;
i += (3 + pvallength); i += (3 + pvallength);
var vName = xml.substr(i,nLength); var vName = xml.substr(i,nLength);
if (vcurrentchar == "q") if (vcurrentchar == "q")
{ {
vNameBefore = vName; vNameBefore = vName;
vName = vAbbrs[vName]; vName = vAbbrs[vName];
} }
vName = vPropString + vName; vName = vPropString + vName;
i += nLength; i += nLength;
var vValue = xml.substr(i,vLength); var vValue = xml.substr(i,vLength);
i = i + vLength; i = i + vLength;
var property = m_model[vName]; var property = m_model[vName];
if (property == null) if (property == null)
{ {
property = new Object(); property = new Object();
property.isNormalField = true; property.isNormalField = true;
property.name = vName; property.name = vName;
property.value = vValue; property.value = vValue;
property.isChanged = false; property.isChanged = false;
property.isKilled = false; property.isKilled = false;
m_properties[m_properties.length] = property; m_properties[m_properties.length] = property;
m_model[vName] = property; m_model[vName] = property;
addPropertyListenerTBP(property); addPropertyListenerTBP(property);
} }
else else
{ {
property.value = vValue; property.value = vValue;
property.isChanged = false; property.isChanged = false;
property.isKilled = false; property.isKilled = false;
addPropertyListenerTBP(property); addPropertyListenerTBP(property);
} }
} }
else if (vcurrentchar == "s") else if (vcurrentchar == "s")
{ {
var abbr = new Object(); var abbr = new Object();
nLength1 = xml.substr(i+1,1) * 1; nLength1 = xml.substr(i+1,1) * 1;
nLength2 = xml.substr(i+2,2) * 1; nLength2 = xml.substr(i+2,2) * 1;
i += 4; i += 4;
var vAbbr = xml.substr(i,nLength1); var vAbbr = xml.substr(i,nLength1);
i += nLength1; i += nLength1;
var vAbPr = xml.substr(i,nLength2); var vAbPr = xml.substr(i,nLength2);
i += nLength2; i += nLength2;
vAbbrs[vAbbr] = vAbPr; vAbbrs[vAbbr] = vAbPr;
} }
else if (vcurrentchar == "x") else if (vcurrentchar == "x")
{ {
nLength = xml.substr(i+1,2) * 1; nLength = xml.substr(i+1,2) * 1;
i += 3; i += 3;
m_modelDeltaId = xml.substr(i,nLength); m_modelDeltaId = xml.substr(i,nLength);
i += nLength; i += nLength;
} }
else if (vcurrentchar == "b") else if (vcurrentchar == "b")
{ {
nLength = xml.substr(i+1,2) * 1; nLength = xml.substr(i+1,2) * 1;
i += 3; i += 3;
vPropStack[vPropStackTop] = xml.substr(i,nLength); vPropStack[vPropStackTop] = xml.substr(i,nLength);
vPropStackTop++; vPropStackTop++;
vPropString = ""; vPropString = "";
for (var ijk = 0; ijk<vPropStackTop; ijk++) for (var ijk = 0; ijk<vPropStackTop; ijk++)
{ {
vPropString += vPropStack[ijk]; vPropString += vPropStack[ijk];
vPropString += "."; vPropString += ".";
} }
i += nLength; i += nLength;
} }
else if (vcurrentchar == "c") else if (vcurrentchar == "c")
{ {
i += 1; i += 1;
vPropStackTop--; vPropStackTop--;
vPropString = ""; vPropString = "";
for (var ijk = 0; ijk<vPropStackTop; ijk++) for (var ijk = 0; ijk<vPropStackTop; ijk++)
{ {
vPropString += vPropStack[ijk]; vPropString += vPropStack[ijk];
vPropString += "."; vPropString += ".";
} }
} }
else if (vcurrentchar == "k") else if (vcurrentchar == "k")
{ {
nLength = xml.substr(i+1,2) * 1; nLength = xml.substr(i+1,2) * 1;
i += 3; i += 3;
var vName = xml.substr(i,nLength); var vName = xml.substr(i,nLength);
var vConvertedName = vName; var vConvertedName = vName;
i += nLength; i += nLength;
var property = m_model[vConvertedName]; var property = m_model[vConvertedName];
if (property != null) if (property != null)
{ {
property.isKilled = true; property.isKilled = true;
property.isChanged = false; property.isChanged = false;
addPropertyListenerTBP(property); addPropertyListenerTBP(property);
} }
m_killedItems++; m_killedItems++;
} }
else if (vcurrentchar == "l") else if (vcurrentchar == "l")
{ {
m_properties = new Array(); m_properties = new Array();
m_model = new Array(); m_model = new Array();
reapplyPropertyListeners("vcurrentchar == l"); reapplyPropertyListeners("vcurrentchar == l");
i++; i++;
} }
else if (vcurrentchar == "a") else if (vcurrentchar == "a")
{ {
var vlengths = xml.substr(i+1,2) * 1; var vlengths = xml.substr(i+1,2) * 1;
var vlengthss = xml.substr(i+3,2) * 1; var vlengthss = xml.substr(i+3,2) * 1;
var vlengthpid = xml.substr(i+5,2) * 1; var vlengthpid = xml.substr(i+5,2) * 1;
var vlengthcn = xml.substr(i+7,2) * 1; var vlengthcn = xml.substr(i+7,2) * 1;
var vlengthpg = xml.substr(i+9,2) * 1; var vlengthpg = xml.substr(i+9,2) * 1;
var vlengthxml = xml.substr(i+11,8) * 1; var vlengthxml = xml.substr(i+11,8) * 1;
i += 19; i += 19;
var vs = xml.substr(i,vlengths); i += vlengths; var vs = xml.substr(i,vlengths); i += vlengths;
var vss = xml.substr(i,vlengthss); i+= vlengthss; var vss = xml.substr(i,vlengthss); i+= vlengthss;
var vpid = xml.substr(i,vlengthpid); i+= vlengthpid; var vpid = xml.substr(i,vlengthpid); i+= vlengthpid;
var vcn = xml.substr(i,vlengthcn); i += vlengthcn; var vcn = xml.substr(i,vlengthcn); i += vlengthcn;
var vpg = xml.substr(i,vlengthpg); i += vlengthpg; var vpg = xml.substr(i,vlengthpg); i += vlengthpg;
var vxml = xml.substr(i,vlengthxml); i+= vlengthxml; var vxml = xml.substr(i,vlengthxml); i+= vlengthxml;
var vbuffkey = CL().buildBufferAccesKey(vs,vss,vpid,vcn,vpg); var vbuffkey = CL().buildBufferAccesKey(vs,vss,vpid,vcn,vpg);
CL().bufferAdapterStream(vbuffkey,vxml); CL().bufferAdapterStream(vbuffkey,vxml);
} }
else else
{ {
alert("Previous property: " + vName); alert("Previous property: " + vName);
alert(xml.substr(i,i+10)); alert(xml.substr(i,i+10));
alert("This should never happen: " + xml.charAt(i) + "\nat" + i + "\n\n" + xml); alert("This should never happen: " + xml.charAt(i) + "\nat" + i + "\n\n" + xml);
break; break;
} }
} }
if (m_killedItems > 100) if (m_killedItems > 100)
{ {
var newModel = new Array(); var newModel = new Array();
for (var propName in m_model) for (var propName in m_model)
{ {
var tempObject = m_model[propName]; var tempObject = m_model[propName];
if (tempObject != null && if (tempObject != null &&
(tempObject.isKilled == false || tempObject.listeners != null)) (tempObject.isKilled == false || tempObject.listeners != null))
newModel[propName] = m_model[propName]; newModel[propName] = m_model[propName];
} }
m_model = newModel; m_model = newModel;
m_killedItems = 0; m_killedItems = 0;
} }
} }
function getPropertyValue(name) function getPropertyValue(name)
{ {
var propertyName = name; var propertyName = name;
property = m_model[propertyName]; property = m_model[propertyName];
if (property == null) return null; if (property == null) return null;
if (property.isKilled == true) return null; if (property.isKilled == true) return null;
return property.value; return property.value;
} }
function setPropertyValue(name,value,nodirtyflag) function setPropertyValue(name,value,nodirtyflag)
{ {
if (value == null) value = ""; if (value == null) value = "";
value = "" + value; value = "" + value;
if (m_properties == null) if (m_properties == null)
{ {
m_properties = new Array(); m_properties = new Array();
m_model = new Array(); m_model = new Array();
} }
property = m_model[name]; property = m_model[name];
if (property != null) if (property != null)
{ {
property.value = value; property.value = value;
if (nodirtyflag != true) if (nodirtyflag != true)
{ {
property.isChanged = true; property.isChanged = true;
addPropertyListenerTBP(property); addPropertyListenerTBP(property);
} }
} }
else else
{ {
property = new Object(); property = new Object();
property.isNormalField = true; property.isNormalField = true;
property.name = name; property.name = name;
property.value = value; property.value = value;
if (nodirtyflag != true) property.isChanged = true; if (nodirtyflag != true) property.isChanged = true;
m_properties[m_properties.length] = property; m_properties[m_properties.length] = property;
m_model[name] = property; m_model[name] = property;
} }
if (m_beforeFirstReactOnNewModel == true) if (m_beforeFirstReactOnNewModel == true)
m_internalProperties[property.name] = true; m_internalProperties[property.name] = true;
if (m_internalProperties[name] != true) if (m_internalProperties[name] != true)
m_bufferNeedsRefresh = true; m_bufferNeedsRefresh = true;
} }
function addChangedPropertyName() function addChangedPropertyName()
{ {
if (m_changedPropertyNames == null) m_changedPropertyNames = new Array(); if (m_changedPropertyNames == null) m_changedPropertyNames = new Array();
} }
function blockSubmit() function blockSubmit()
{ {
if (!isIE()) return; if (!isIE()) return;
m_blockSubmit = true; m_blockSubmit = true;
} }
function unblockSubmit() function unblockSubmit()
{ {
m_blockSubmit = false; m_blockSubmit = false;
} }
function blockActivities() function blockActivities()
{ {
m_noactivityuntil = new Date(); m_noactivityuntil = new Date();
} }
function checkIfNoActivities(pDate) function checkIfNoActivities(pDate)
{ {
if (m_noactivityuntil==null)return false; if (m_noactivityuntil==null)return false;
if (pDate.valueOf() < (m_noactivityuntil.valueOf()+250)) return true; if (pDate.valueOf() < (m_noactivityuntil.valueOf()+250)) return true;
return false; return false;
} }
function pushContinueMethod() function pushContinueMethod()
{ {
m_pushedContinueMethod = m_continueMethod; m_pushedContinueMethod = m_continueMethod;
} }
function popContinueMethod() function popContinueMethod()
{ {
m_continueMethod = m_pushedContinueMethod; m_continueMethod = m_pushedContinueMethod;
} }
/** /**
Special flush management in Mozilla. The flush of the field is - somtimes - directly Special flush management in Mozilla. The flush of the field is - somtimes - directly
processed together with the event that comes from e.g. the button that was pressed after. processed together with the event that comes from e.g. the button that was pressed after.
The flush of the field as consequence waits for some time (100ms) before it is executed The flush of the field as consequence waits for some time (100ms) before it is executed
and checks if it was not executed in the interim phase. and checks if it was not executed in the interim phase.
**/  **/ 
var m_submitModelFlushCalled; var m_submitModelFlushCalled;
function submitModelFlush(command,withClearingBuffer) function submitModelFlush(command,withClearingBuffer)
{ {
if (m_lastServerFetch != null && if (m_lastServerFetch != null &&
m_submitModelFlushCalled != null && m_submitModelFlushCalled != null &&
m_lastServerFetch.getTime() >= m_submitModelFlushCalled.getTime()) m_lastServerFetch.getTime() >= m_submitModelFlushCalled.getTime())
{ {
addLogMessage("submitModelFlush(): Already transferred!"); addLogMessage("submitModelFlush(): Already transferred!");
return; return;
} }
else else
{ {
addLogMessage("submitModelFlush(): Not yet transferred!"); addLogMessage("submitModelFlush(): Not yet transferred!");
submitModel(command,withClearingBuffer); submitModel(command,withClearingBuffer);
} }
} }
function submitModel(command,withClearingBuffer) function submitModel(command,withClearingBuffer)
{ {
var vNoResponse = getPropertyValue("casabacAddons.noResponse"); var vNoResponse = getPropertyValue("casabacAddons.noResponse");
if (vNoResponse == "true") if (vNoResponse == "true")
{ {
addLogMessage("submitModel(): no submit - adapter sends noResponse==true"); addLogMessage("submitModel(): no submit - adapter sends noResponse==true");
return; return;
} }
if (isIE() == false && parent.m_blockIOByFlush == true) if (isIE() == false && parent.m_blockIOByFlush == true)
{ {
addLogMessage("submitModel(): parent.m_blockIOByFlush = " + parent.m_blockIOByFlush); addLogMessage("submitModel(): parent.m_blockIOByFlush = " + parent.m_blockIOByFlush);
addLogMessage("submitModel(): Processing Mozilla Flush Management!"); addLogMessage("submitModel(): Processing Mozilla Flush Management!");
parent.m_blockIOByFlush = false; parent.m_blockIOByFlush = false;
m_submitModelFlushCalled = new Date(); m_submitModelFlushCalled = new Date();
setTimeout("submitModelFlush(\""+command+"\","+withClearingBuffer+")",100); setTimeout("submitModelFlush(\""+command+"\","+withClearingBuffer+")",100);
return; return;
} }
if (checkAllValidations() == false) { parent.m_blockIOByFlush = false; return;} if (checkAllValidations() == false) { parent.m_blockIOByFlush = false; return;}
if (m_blockSubmit == true) if (m_blockSubmit == true)
{ {
parent.m_blockIOByFlush = false; parent.m_blockIOByFlush = false;
addLogMessage("submitModel - page just blocked, submit suppressed"); addLogMessage("submitModel - page just blocked, submit suppressed");
return; return;
} }
if (m_sessionId == null) if (m_sessionId == null)
{ {
addLogMessage("submitModel - page not initialized yet, submit suppressed"+ addLogMessage("submitModel - page not initialized yet, submit suppressed"+
"\nThis may happen in multi frame pages when not carefully paying attention to order of building up frame content"+ "\nThis may happen in multi frame pages when not carefully paying attention to order of building up frame content"+
"\nProcessing will be interrupted for this page."); "\nProcessing will be interrupted for this page.");
return; return;
} }
if (m_doTrace) m_traceRequestStartDate = new Date(); if (m_doTrace) m_traceRequestStartDate = new Date();
if (m_bufferNeedsRefresh == true || withClearingBuffer == true) if (m_bufferNeedsRefresh == true || withClearingBuffer == true)
{ {
CL().clearBufferedAdapterStream(CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL())); CL().clearBufferedAdapterStream(CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL()));
} }
if (checkIO() == false) if (checkIO() == false)
{ {
if (m_doLog) addLogMessage("submitModel - ended, page just blocked"); if (m_doLog) addLogMessage("submitModel - ended, page just blocked");
return; return;
} }
parent.switchToOccupied(); parent.switchToOccupied();
pushContinueMethod(); pushContinueMethod();
synchronizeInnerPagesAndContinue(submitModelContinue); synchronizeInnerPagesAndContinue(submitModelContinue);
} }
function submitModelContinue() function submitModelContinue()
{ {
popContinueMethod(); popContinueMethod();
invokeDCListeners(); invokeDCListeners();
var vxml = buildFirstTag("m","") + var vxml = buildFirstTag("m","") +
buildXMLFromModel("submitModel"); buildXMLFromModel("submitModel");
if (m_doTrace) m_traceRequestEndDate = new Date(); if (m_doTrace) m_traceRequestEndDate = new Date();
fetchModelFromServer(vxml); fetchModelFromServer(vxml);
} }
function refreshModel() function refreshModel()
{ {
addLogMessage("refreshModel - started"); addLogMessage("refreshModel - started");
if (this.m_refreshPopupParams != null) if (this.m_refreshPopupParams != null)
{ {
setPropertyValue("casabacAddons.closedPopupModelName",m_refreshPopupParams.modelName); setPropertyValue("casabacAddons.closedPopupModelName",m_refreshPopupParams.modelName);
setPropertyValue("casabacAddons.closedPopupModelId",m_refreshPopupParams.modelId); setPropertyValue("casabacAddons.closedPopupModelId",m_refreshPopupParams.modelId);
m_refreshPopupParams = null; m_refreshPopupParams = null;
} }
if (checkIO() == false) if (checkIO() == false)
{ {
addLogMessage("refreshModel - need to repeat page or inner page just blocked"); addLogMessage("refreshModel - need to repeat page or inner page just blocked");
setTimeout("refreshModel();",50); setTimeout("refreshModel();",50);
return; return;
} }
parent.switchToOccupied(); parent.switchToOccupied();
var vxml = buildFirstTag("e","") + var vxml = buildFirstTag("e","") +
buildXMLFromModel("refreshModel"); buildXMLFromModel("refreshModel");
addLogMessage("refreshModel - sending " + vxml); addLogMessage("refreshModel - sending " + vxml);
m_continueUpdateModelListeners = false; m_continueUpdateModelListeners = false;
fetchModelFromServer(vxml); fetchModelFromServer(vxml);
} }
function invokeMethodInModel(methodName,withoutClearingBuffer) function invokeMethodInModel(methodName,withoutClearingBuffer)
{ {
var vNoResponse = getPropertyValue("casabacAddons.noResponse"); var vNoResponse = getPropertyValue("casabacAddons.noResponse");
if (vNoResponse == "true") if (vNoResponse == "true")
{ {
addLogMessage("invokeMethodInModel(): no invoke - adapter sends noResponse==true"); addLogMessage("invokeMethodInModel(): no invoke - adapter sends noResponse==true");
return; return;
} }
if (withoutClearingBuffer != true) if (withoutClearingBuffer != true)
CL().clearBufferedAdapterStream(CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL())); CL().clearBufferedAdapterStream(CL().buildBufferAccesKey(m_sessionId,m_processId,m_modelId,m_modelName,findPseudoURL()));
if (methodName != "casabacSynchronizeIfNecessary" && if (methodName != "casabacSynchronizeIfNecessary" &&
checkAllValidations() == false) checkAllValidations() == false)
{ {
return; return;
} }
if (m_doLog) addLogMessage("invokeMethodInModel - started ("+methodName+")"); if (m_doLog) addLogMessage("invokeMethodInModel - started ("+methodName+")");
if (checkIO() == false) if (checkIO() == false)
{ {
if (m_doLog) addLogMessage("invokeMethod - ended, page just blocked"); if (m_doLog) addLogMessage("invokeMethod - ended, page just blocked");
return; return;
} }
var now = new Date(); var now = new Date();
if (checkIfNoActivities(now)) if (checkIfNoActivities(now))
{ {
addLogMessage("invokeMethodInModel - page is blocked (Reason: noactivityuntil was set)"); addLogMessage("invokeMethodInModel - page is blocked (Reason: noactivityuntil was set)");
return; return;
} }
if (m_doTrace) m_traceRequestStartDate = new Date(); if (m_doTrace) m_traceRequestStartDate = new Date();
parent.switchToOccupied(); parent.switchToOccupied();
m_bufferedMethodName = methodName; m_bufferedMethodName = methodName;
pushContinueMethod(); pushContinueMethod();
synchronizeInnerPagesAndContinue(invokeMethodInModelContinue); synchronizeInnerPagesAndContinue(invokeMethodInModelContinue);
} }
function invokeMethodInModelContinue() function invokeMethodInModelContinue()
{ {
if (m_doLog) addLogMessage("invokeMethodInModelContinue - started"); if (m_doLog) addLogMessage("invokeMethodInModelContinue - started");
popContinueMethod(); popContinueMethod();
invokeDCListeners(); invokeDCListeners();
m_processCasabacSynchronizeIfNecessary = false; m_processCasabacSynchronizeIfNecessary = false;
if (m_bufferedMethodName == "casabacSynchronizeIfNecessary") if (m_bufferedMethodName == "casabacSynchronizeIfNecessary")
{ {
var unSubmittedChangeExists = false; var unSubmittedChangeExists = false;
var vmaxi = m_properties.length; var vmaxi = m_properties.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
if (m_properties[i].isChanged == true && if (m_properties[i].isChanged == true &&
!(m_internalProperties[m_properties[i].name] == true)) !(m_internalProperties[m_properties[i].name] == true))
{ {
unSubmittedChangeExists = true; unSubmittedChangeExists = true;
break; break;
} }
} }
if (unSubmittedChangeExists == false) if (unSubmittedChangeExists == false)
{ {
parent.switchToDisplay(); parent.switchToDisplay();
return; return;
} }
else else
{ {
m_processCasabacSynchronizeIfNecessary = true; m_processCasabacSynchronizeIfNecessary = true;
} }
} }
var vxml; var vxml;
if (m_bufferedMethodName != "casabacSynchronizeIfNecessary") if (m_bufferedMethodName != "casabacSynchronizeIfNecessary")
vxml = buildFirstTag("v",m_bufferedMethodName) + vxml = buildFirstTag("v",m_bufferedMethodName) +
buildXMLFromModel("invokeMethodInModel"); buildXMLFromModel("invokeMethodInModel");
else else
var vxml = buildFirstTag("m","") + var vxml = buildFirstTag("m","") +
buildXMLFromModel("submitModel"); buildXMLFromModel("submitModel");
m_bufferedMethodName = "inittini"; m_bufferedMethodName = "inittini";
if (m_doLog) addLogMessage("invokeMethodInModelContinue - submitting"); if (m_doLog) addLogMessage("invokeMethodInModelContinue - submitting");
if (m_doTrace) m_traceRequestEndDate = new Date(); if (m_doTrace) m_traceRequestEndDate = new Date();
fetchModelFromServer(vxml); fetchModelFromServer(vxml);
} }
function buildXMLFromModel(caller) function buildXMLFromModel(caller)
{ {
if (m_properties == null) return ""; if (m_properties == null) return "";
if (m_doTrace) startBuildXMLDate = new Date(); if (m_doTrace) startBuildXMLDate = new Date();
var vsb = new Array(); var vsb = new Array();
var vmaxi = m_properties.length; var vmaxi = m_properties.length;
for (var i=0; i<vmaxi; i++) for (var i=0; i<vmaxi; i++)
{ {
vprop = m_properties[i]; vprop = m_properties[i];
if (vprop == null) continue; if (vprop == null) continue;
if (vprop.isChanged == true) if (vprop.isChanged == true)
{ {
vName = vprop.name; vName = vprop.name;
vValue = vprop.value; vValue = vprop.value;
if (vName == null) { continue; } if (vName == null) { continue; }
if (vValue == null) { continue; } if (vValue == null) { continue; }
if (vValue == null || vValue.length < 100000) if (vValue == null || vValue.length < 100000)
{ {
vsb.push("p" + detLength(vName,2) + detLength(vValue,5) + vName + vValue); vsb.push("p" + detLength(vName,2) + detLength(vValue,5) + vName + vValue);
} }
else else
{ {
vsb.push("z" + detLength(vName,2) + detLength(vValue,10) + vName + vValue); vsb.push("z" + detLength(vName,2) + detLength(vValue,10) + vName + vValue);
} }
vprop.isChanged = false; vprop.isChanged = false;
} }
} }
vsb.push("x" + detLength(m_modelDeltaId,2) + m_modelDeltaId); vsb.push("x" + detLength(m_modelDeltaId,2) + m_modelDeltaId);
var s = vsb.join(""); var s = vsb.join("");
if (m_doTrace) if (m_doTrace)
{ {
endBuildXMLDate = new Date(); endBuildXMLDate = new Date();
m_traceBuildXMLTime = endBuildXMLDate.getTime() - startBuildXMLDate.getTime(); m_traceBuildXMLTime = endBuildXMLDate.getTime() - startBuildXMLDate.getTime();
} }
return s; return s;
} }
function registerListener(listener) function registerListener(listener)
{ {
if (listener == null) return; if (listener == null) return;
m_modelListeners.push(listener); m_modelListeners.push(listener);
} }
function registerPropertyListener(listener,propertyName,listenerId,isreregistration) function registerPropertyListener(listener,propertyName,listenerId,isreregistration)
{ {
if (propertyName == null) return; if (propertyName == null) return;
if (propertyName == "") return; if (propertyName == "") return;
if (m_properties == null) if (m_properties == null)
{ {
m_properties = new Array(); m_properties = new Array();
m_model = new Array(); m_model = new Array();
} }
property = m_model[propertyName]; property = m_model[propertyName];
if (property == null) if (property == null)
{ {
property = new Object(); property = new Object();
property.isNormalField = true; property.isNormalField = true;
property.name = propertyName; property.name = propertyName;
property.value = null; property.value = null;
m_properties[m_properties.length] = property; m_properties[m_properties.length] = property;
m_model[propertyName] = property; m_model[propertyName] = property;
} }
if (property.listeners == null) if (property.listeners == null)
property.listeners = new Array(); property.listeners = new Array();
property.listeners[listenerId] = listener; property.listeners[listenerId] = listener;
var o = new Object(); var o = new Object();
o.listener = listener; o.listener = listener;
o.propertyName = propertyName; o.propertyName = propertyName;
o.listenerId = listenerId; o.listenerId = listenerId;
if (isreregistration != true) if (isreregistration != true)
{ {
m_propertyListeners.push(o); m_propertyListeners.push(o);
} }
m_propertyListenersTBP[listenerId] = listener; m_propertyListenersTBP[listenerId] = listener;
} }
function registerStatusPropertyListener(listener,propertyName,listenerId, cc) function registerStatusPropertyListener(listener,propertyName,listenerId, cc)
{ {
registerPropertyListener(listener,propertyName,listenerId,false); registerPropertyListener(listener,propertyName,listenerId,false);
if (m_statuspropListeners[propertyName] == null) if (m_statuspropListeners[propertyName] == null)
m_statuspropListeners[propertyName] = new Array(); m_statuspropListeners[propertyName] = new Array();
m_statuspropListeners[propertyName].push(cc); m_statuspropListeners[propertyName].push(cc);
} }
function reapplyPropertyListeners(comment) function reapplyPropertyListeners(comment)
{ {
for (var i=0; i<m_propertyListeners.length; i++) for (var i=0; i<m_propertyListeners.length; i++)
{ {
var o = m_propertyListeners[i]; var o = m_propertyListeners[i];
registerPropertyListener(o.listener,o.propertyName,o.listenerId,true); registerPropertyListener(o.listener,o.propertyName,o.listenerId,true);
} }
} }
function addPropertyListenerTBP(property) function addPropertyListenerTBP(property)
{ {
var pls = property.listeners; var pls = property.listeners;
if (pls == null) return; if (pls == null) return;
for (var id in pls) for (var id in pls)
m_propertyListenersTBP[id] = pls[id]; m_propertyListenersTBP[id] = pls[id];
} }
function registerListenerAsFirst(listener) function registerListenerAsFirst(listener)
{ {
index = m_modelListeners.length; index = m_modelListeners.length;
var i; var i;
for (var i=index; i>0; i--) for (var i=index; i>0; i--)
m_modelListeners[i] = m_modelListeners[i-1]; m_modelListeners[i] = m_modelListeners[i-1];
m_modelListeners[0] = listener; m_modelListeners[0] = listener;
} }
function registerListenerAsLast(listener) function registerListenerAsLast(listener)
{ {
m_modelListenersLast.push(listener); m_modelListenersLast.push(listener);
} }
function removeListener(containedstring) function removeListener(containedstring)
{ {
for (var i=0; i<m_modelListeners.length; i++) for (var i=0; i<m_modelListeners.length; i++)
{ {
var code = "" + m_modelListeners[i]; var code = "" + m_modelListeners[i];
if (code.indexOf(containedstring) >= 0) if (code.indexOf(containedstring) >= 0)
{ {
m_modelListeners.splice(i,1); m_modelListeners.splice(i,1);
break; break;
} }
} }
} }
function removePropertyListener(listenerId) function removePropertyListener(listenerId)
{ {
var propertyListeners = new Array(); var propertyListeners = new Array();
var propertyNames = new Array(); var propertyNames = new Array();
for (var i=0; i<m_propertyListeners.length; i++) for (var i=0; i<m_propertyListeners.length; i++)
{ {
var o = m_propertyListeners[i]; var o = m_propertyListeners[i];
if (o.listenerId != listenerId) if (o.listenerId != listenerId)
{ {
propertyListeners.push(o); propertyListeners.push(o);
} }
else else
{ {
propertyNames.push(o.propertyName); propertyNames.push(o.propertyName);
} }
} }
m_propertyListeners = propertyListeners; m_propertyListeners = propertyListeners;
for (var i=0; i<propertyNames.length; i++) for (var i=0; i<propertyNames.length; i++)
{ {
var property = m_model[propertyNames[i]]; var property = m_model[propertyNames[i]];
if (property == null) continue; if (property == null) continue;
var listeners = new Object(); var listeners = new Object();
for (var id in property.listeners) for (var id in property.listeners)
{ {
if (id != listenerId) if (id != listenerId)
listeners[id] = property.listeners[id]; listeners[id] = property.listeners[id];
} }
property.listeners = listeners; property.listeners = listeners;
} }
} }
function registerDCListener(pl) function registerDCListener(pl)
{ {
m_dcListeners.push(pl); m_dcListeners.push(pl);
} }
function invokeDCListeners() function invokeDCListeners()
{ {
for (var i=0; i<m_dcListeners.length; i++) for (var i=0; i<m_dcListeners.length; i++)
m_dcListeners[i](); m_dcListeners[i]();
} }
function removeProcess() function removeProcess()
{ {
alert("should not be called (csc.removeProcess)"); alert("should not be called (csc.removeProcess)");
} }
function removeSession() function removeSession()
{ {
try try
{ {
cscformiframe.document.getElementById("XML").value = cscformiframe.document.getElementById("XML").value =
buildFirstTag("s","") + buildFirstTag("s","") +
buildXMLFromModel("removeSession"); buildXMLFromModel("removeSession");
cscformiframe.document.getElementById("SESSIONID").value = m_sessionId; cscformiframe.document.getElementById("SESSIONID").value = m_sessionId;
cscformiframe.document.getElementById("ApperConnector").submit(); cscformiframe.document.getElementById("ApperConnector").submit();
} }
catch (eexxcc) {} catch (eexxcc) {}
} }
function getCenturyPrefix(vshortyear) function getCenturyPrefix(vshortyear)
{ {
try try
{ {
vshortyear = vshortyear * 1; vshortyear = vshortyear * 1;
if (vshortyear >= 50) return "19"; if (vshortyear >= 50) return "19";
else return "20"; else return "20";
} }
catch (exc) catch (exc)
{ {
return "20"; return "20";
} }
} }
var mm_convertValue = null; var mm_convertValue = null;
function convertValue(value,dataType,decimalDigitsFloat) function convertValue(value,dataType,decimalDigitsFloat)
{ {
if (mm_convertValue == null) mm_convertValue = CL().C_convertValue; if (mm_convertValue == null) mm_convertValue = CL().C_convertValue;
return mm_convertValue(this,value,dataType,decimalDigitsFloat);  return mm_convertValue(value,dataType,decimalDigitsFloat); 
} }
var mm_convertYYYYMMDDIntoDisplayString = null; var mm_convertYYYYMMDDIntoDisplayString = null;
function convertYYYYMMDDIntoDisplayString(yyyymmdd) function convertYYYYMMDDIntoDisplayString(yyyymmdd)
{ {
if (mm_convertYYYYMMDDIntoDisplayString == null) mm_convertYYYYMMDDIntoDisplayString = CL().C_convertYYYYMMDDIntoDisplayString; if (mm_convertYYYYMMDDIntoDisplayString == null) mm_convertYYYYMMDDIntoDisplayString = CL().C_convertYYYYMMDDIntoDisplayString;
return mm_convertYYYYMMDDIntoDisplayString(this,yyyymmdd);  return mm_convertYYYYMMDDIntoDisplayString(yyyymmdd); 
} }
var mm_convertDisplayStringIntoYYYYMMDD = null; var mm_convertDisplayStringIntoYYYYMMDD = null;
function convertDisplayStringIntoYYYYMMDD(value) function convertDisplayStringIntoYYYYMMDD(value)
{ {
if (mm_convertDisplayStringIntoYYYYMMDD == null) mm_convertDisplayStringIntoYYYYMMDD = CL().C_convertDisplayStringIntoYYYYMMDD; if (mm_convertDisplayStringIntoYYYYMMDD == null) mm_convertDisplayStringIntoYYYYMMDD = CL().C_convertDisplayStringIntoYYYYMMDD;
return mm_convertDisplayStringIntoYYYYMMDD(this,value);  return mm_convertDisplayStringIntoYYYYMMDD(value); 
} }
var mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = null; var mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = null;
function convertYYYYMMDDHHMMSSMMMIntoDisplayString(yyyymmddhhmmssmmm) function convertYYYYMMDDHHMMSSMMMIntoDisplayString(yyyymmddhhmmssmmm)
{ {
if (mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString == null) mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = CL().C_convertYYYYMMDDHHMMSSMMMIntoDisplayString; if (mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString == null) mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = CL().C_convertYYYYMMDDHHMMSSMMMIntoDisplayString;
return mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString(this,yyyymmddhhmmssmmm, "HHMMSSMMM"); return mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString(yyyymmddhhmmssmmm, "HHMMSSMMM");
} }
function convertYYYYMMDDHHMMSSIntoDisplayString(yyyymmddhhmmss) function convertYYYYMMDDHHMMSSIntoDisplayString(yyyymmddhhmmss)
{ {
if (mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString == null) mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = CL().C_convertYYYYMMDDHHMMSSMMMIntoDisplayString; if (mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString == null) mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = CL().C_convertYYYYMMDDHHMMSSMMMIntoDisplayString;
return mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString(this,yyyymmddhhmmss, "HHMMSS"); return mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString(yyyymmddhhmmss, "HHMMSS");
} }
function convertYYYYMMDDHHMMIntoDisplayString(yyyymmddhhmmss) function convertYYYYMMDDHHMMIntoDisplayString(yyyymmddhhmmss)
{ {
if (mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString == null) mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = CL().C_convertYYYYMMDDHHMMSSMMMIntoDisplayString; if (mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString == null) mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString = CL().C_convertYYYYMMDDHHMMSSMMMIntoDisplayString;
return mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString(this,yyyymmddhhmmss, "HHMM"); return mm_convertYYYYMMDDHHMMSSMMMIntoDisplayString(yyyymmddhhmmss, "HHMM");
} }
var mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM = null; var mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM = null;
function convertDisplayStringIntoYYYYMMDDHHMMSSMMM(dispstring) function convertDisplayStringIntoYYYYMMDDHHMMSSMMM(dispstring)
{ {
if (mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM == null) mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM = CL().C_convertDisplayStringIntoYYYYMMDDHHMMSSMMM; if (mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM == null) mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM = CL().C_convertDisplayStringIntoYYYYMMDDHHMMSSMMM;
return mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM(this,dispstring);  return mm_convertDisplayStringIntoYYYYMMDDHHMMSSMMM(dispstring); 
} }
function convertDisplayStringIntoYYYYMMDDHHMMSS(vDisplay) function convertDisplayStringIntoYYYYMMDDHHMMSS(vDisplay)
{ {
return vDisplay; return vDisplay;
} }
var mm_convertHHMMSSIntoDisplayString = null; var mm_convertHHMMSSIntoDisplayString = null;
function convertHHMMSSIntoDisplayString(hhmmss) function convertHHMMSSIntoDisplayString(hhmmss)
{ {
if (mm_convertHHMMSSIntoDisplayString == null) mm_convertHHMMSSIntoDisplayString = CL().C_convertHHMMSSIntoDisplayString; if (mm_convertHHMMSSIntoDisplayString == null) mm_convertHHMMSSIntoDisplayString = CL().C_convertHHMMSSIntoDisplayString;
return mm_convertHHMMSSIntoDisplayString(this,hhmmss);  return mm_convertHHMMSSIntoDisplayString(hhmmss); 
} }
var mm_convertDisplayStringIntoHHMMSS = null; var mm_convertDisplayStringIntoHHMMSS = null;
function convertDisplayStringIntoHHMMSS(value) function convertDisplayStringIntoHHMMSS(value)
{ {
if (mm_convertDisplayStringIntoHHMMSS == null) mm_convertDisplayStringIntoHHMMSS = CL().C_convertDisplayStringIntoHHMMSS; if (mm_convertDisplayStringIntoHHMMSS == null) mm_convertDisplayStringIntoHHMMSS = CL().C_convertDisplayStringIntoHHMMSS;
return mm_convertDisplayStringIntoHHMMSS(this,value);  return mm_convertDisplayStringIntoHHMMSS(value); 
} }
var mm_convertFLOATIntoDisplayString = null; var mm_convertFLOATIntoDisplayString = null;
function convertFLOATIntoDisplayString(vFloat,decimalDigitsFloat) function convertFLOATIntoDisplayString(vFloat,decimalDigitsFloat)
{ {
if (mm_convertFLOATIntoDisplayString == null) mm_convertFLOATIntoDisplayString = CL().C_convertFLOATIntoDisplayString; if (mm_convertFLOATIntoDisplayString == null) mm_convertFLOATIntoDisplayString = CL().C_convertFLOATIntoDisplayString;
return mm_convertFLOATIntoDisplayString(this,vFloat,decimalDigitsFloat);  return mm_convertFLOATIntoDisplayString(vFloat,decimalDigitsFloat); 
} }
var mm_convertDisplayStringIntoFLOAT = null; var mm_convertDisplayStringIntoFLOAT = null;
function convertDisplayStringIntoFLOAT(vDisplay) function convertDisplayStringIntoFLOAT(vDisplay)
{ {
if (mm_convertDisplayStringIntoFLOAT == null) mm_convertDisplayStringIntoFLOAT = CL().C_convertDisplayStringIntoFLOAT; if (mm_convertDisplayStringIntoFLOAT == null) mm_convertDisplayStringIntoFLOAT = CL().C_convertDisplayStringIntoFLOAT;
return mm_convertDisplayStringIntoFLOAT(this,vDisplay);  return mm_convertDisplayStringIntoFLOAT(vDisplay); 
} }
var mm_checkIfValueHasError = null; var mm_checkIfValueHasError = null;
function checkIfValueHasError(value,dataType,decimalDigitsFloat) function checkIfValueHasError(value,dataType,decimalDigitsFloat)
{ {
if (mm_checkIfValueHasError == null) mm_checkIfValueHasError = CL().C_checkIfValueHasError; if (mm_checkIfValueHasError == null) mm_checkIfValueHasError = CL().C_checkIfValueHasError;
return mm_checkIfValueHasError(this,value,dataType,decimalDigitsFloat);  return mm_checkIfValueHasError(value,dataType,decimalDigitsFloat); 
} }
var mm_convert1000Separators = null; var mm_convert1000Separators = null;
function convert1000Separators(floatValue) function convert1000Separators(floatValue)
{ {
if (mm_convert1000Separators == null) mm_convert1000Separators = CL().C_convert1000Separators; if (mm_convert1000Separators == null) mm_convert1000Separators = CL().C_convert1000Separators;
return mm_convert1000Separators(this,floatValue);  return mm_convert1000Separators(floatValue); 
} }
var mm_checkIf1000SeparatorsHasError = null; var mm_checkIf1000SeparatorsHasError = null;
function checkIf1000SeparatorsHasError(floatValue) function checkIf1000SeparatorsHasError(floatValue)
{ {
if (mm_checkIf1000SeparatorsHasError == null) mm_checkIf1000SeparatorsHasError = CL().C_checkIf1000SeparatorsHasError; if (mm_checkIf1000SeparatorsHasError == null) mm_checkIf1000SeparatorsHasError = CL().C_checkIf1000SeparatorsHasError;
return mm_checkIf1000SeparatorsHasError(this,floatValue);  return mm_checkIf1000SeparatorsHasError(floatValue); 
} }
function convertDURATIONIntoDisplayString(duration) function convertDURATIONIntoDisplayString(duration)
{ {
} }
var CONTROLTYPE_CONTAINER = 0; var CONTROLTYPE_CONTAINER = 0;
var CONTROLTYPE_INPUT = 1; var CONTROLTYPE_INPUT = 1;
function convertStatusToVisible(pstatus,pcontroltype) function convertStatusToVisible(pstatus,pcontroltype)
{ {
if (pstatus == "true") return pstatus; if (pstatus == "true") return pstatus;
if (pstatus == "false") return pstatus; if (pstatus == "false") return pstatus;
if (pstatus == "INVISIBLE") return "false"; if (pstatus == "INVISIBLE") return "false";
if (pstatus == "DISPLAY") if (pstatus == "DISPLAY")
{ {
if (pcontroltype == CONTROLTYPE_CONTAINER) return "true"; if (pcontroltype == CONTROLTYPE_CONTAINER) return "true";
else return "false"; else return "false";
} }
if (pstatus == "EDIT") return "true"; if (pstatus == "EDIT") return "true";
if (pstatus == "FOCUS") return "true"; if (pstatus == "FOCUS") return "true";
if (pstatus == "ERROR") return "true"; if (pstatus == "ERROR") return "true";
if (pstatus == "ERROR_NO_FOCUS") return "true"; if (pstatus == "ERROR_NO_FOCUS") return "true";
return pstatus; return pstatus;
} }
function detLength(s,digits) function detLength(s,digits)
{ {
if (s == null) s = ""; if (s == null) s = "";
s = ""+s; s = ""+s;
if (isIE()==false) if (isIE()==false)
s = s.replace(/\n/g,"\r\n"); s = s.replace(/\n/g,"\r\n");
vl = s.length; vl = s.length;
if (digits == 1) return ""+vl; if (digits == 1) return ""+vl;
if (digits == 2) if (digits == 2)
{ {
if (vl < 10) return "0"+vl; if (vl < 10) return "0"+vl;
return ""+vl; return ""+vl;
} }
if (digits == 3) if (digits == 3)
{ {
if (vl < 10) return "00"+vl; if (vl < 10) return "00"+vl;
if (vl < 100) return "0"+vl; if (vl < 100) return "0"+vl;
return ""+vl; return ""+vl;
} }
if (digits == 5) if (digits == 5)
{ {
if (vl < 10) return "0000"+vl; if (vl < 10) return "0000"+vl;
if (vl < 100) return "000"+vl; if (vl < 100) return "000"+vl;
if (vl < 1000) return "00"+vl; if (vl < 1000) return "00"+vl;
if (vl < 10000) return "0"+vl; if (vl < 10000) return "0"+vl;
return ""+vl; return ""+vl;
} }
if (digits == 10) if (digits == 10)
{ {
if (vl < 10) return "000000000"+vl; if (vl < 10) return "000000000"+vl;
if (vl < 100) return "00000000"+vl; if (vl < 100) return "00000000"+vl;
if (vl < 1000) return "0000000"+vl; if (vl < 1000) return "0000000"+vl;
if (vl < 10000) return "000000"+vl; if (vl < 10000) return "000000"+vl;
if (vl < 100000) return "00000"+vl; if (vl < 100000) return "00000"+vl;
if (vl < 1000000) return "0000"+vl; if (vl < 1000000) return "0000"+vl;
if (vl < 10000000) return "000"+vl; if (vl < 10000000) return "000"+vl;
if (vl < 100000000) return "00"+vl; if (vl < 100000000) return "00"+vl;
if (vl < 1000000000) return "0"+vl; if (vl < 1000000000) return "0"+vl;
return ""+vl; return ""+vl;
} }
alert("This method is not prepared for the call, digits = " + digits); alert("This method is not prepared for the call, digits = " + digits);
} }
function detString(s) function detString(s)
{ {
if (s != null) return s; if (s != null) return s;
return ""; return "";
} }
function convertForSend(v) function convertForSend(v)
{ {
alert("convertForSend: Not required anymore!"); alert("convertForSend: Not required anymore!");
return v; return v;
} }
function convertForReceive(v) function convertForReceive(v)
{ {
alert("convertForReceive: Not required anymore!"); alert("convertForReceive: Not required anymore!");
return v; return v;
} }
function convertPropertyNameIn(v) function convertPropertyNameIn(v)
{ {
alert("convertPropertyNameIn: Not required anymore!"); alert("convertPropertyNameIn: Not required anymore!");
return v; return v;
} }
function convertSpecialHTMLCharacters(v) function convertSpecialHTMLCharacters(v)
{ {
var vs = v; var vs = v;
if (vs.indexOf("&") >= 0)  vs = vs.replace(/&/g,"&amp;"); if (vs.indexOf("&") >= 0)  vs = vs.replace(/&/g,"&amp;");
if (vs.indexOf("\"") >= 0) vs = vs.replace(/\"/g,"&quot;"); if (vs.indexOf("\"") >= 0) vs = vs.replace(/\"/g,"&quot;");
if (vs.indexOf("<") >= 0)  vs = vs.replace(/\</g,"&lt;"); if (vs.indexOf("<") >= 0)  vs = vs.replace(/\</g,"&lt;");
if (vs.indexOf(">") >= 0)  vs = vs.replace(/\>/g,"&gt;"); if (vs.indexOf(">") >= 0)  vs = vs.replace(/\>/g,"&gt;");
return vs; return vs;
} }
function calculateControlPosition(control) function calculateControlPosition(control)
{ {
pp = control; pp = control;
pleft = 0; pleft = 0;
ptop = 0; ptop = 0;
while (pp.offsetParent != null) while (pp.offsetParent != null)
{ {
pleft += pp.offsetLeft; pleft += pp.offsetLeft;
ptop += pp.offsetTop; ptop += pp.offsetTop;
pp = pp.offsetParent; pp = pp.offsetParent;
} }
pos = new Object(); pos = new Object();
pos.left = pleft; pos.left = pleft;
pos.top = ptop; pos.top = ptop;
return pos; return pos;
} }
function buildFirstTag(firstChar,param) function buildFirstTag(firstChar,param)
{ {
var vpageURL = m_parentdocument.URL; var vpageURL = m_parentdocument.URL;
var vispopup = m_parentparent.isPopupPage; var vispopup = m_parentparent.isPopupPage;
if (vispopup == null) vispopup = false; if (vispopup == null) vispopup = false;
return firstChar + return firstChar +
detLength(m_sessionId,2) + detLength(m_sessionId,2) +
detLength(m_processId,2) + detLength(m_processId,2) +
detLength(m_modelId,2) + detLength(m_modelId,2) +
detLength(m_modelName,2) + detLength(m_modelName,2) +
detLength(m_pageName,2) + detLength(m_pageName,2) +
detLength(vpageURL,3) + detLength(vpageURL,3) +
detLength(param,5) + detLength(param,5) +
detLength(vispopup,1) + detLength(vispopup,1) +
detString(m_sessionId) + detString(m_sessionId) +
detString(m_processId) + detString(m_processId) +
detString(m_modelId) + detString(m_modelId) +
detString(m_modelName) + detString(m_modelName) +
detString(m_pageName) + detString(m_pageName) +
detString(vpageURL) + detString(vpageURL) +
detString(param) + detString(param) +
detString(vispopup); detString(vispopup);
} }
function getCanBeClosed() function getCanBeClosed()
{ {
var vResult = getPropertyValue("canBeClosed"); var vResult = getPropertyValue("canBeClosed");
if (vResult == null) vResult = "true"; if (vResult == null) vResult = "true";
return vResult; return vResult;
} }
var mm_buildControlSelectionEventCSC = null; var mm_buildControlSelectionEventCSC = null;
function buildControlSelectionEventCSC(pCC) function buildControlSelectionEventCSC(pCC)
{ {
if (mm_buildControlSelectionEventCSC == null) mm_buildControlSelectionEventCSC = CL().C_buildControlSelectionEvent; if (mm_buildControlSelectionEventCSC == null) mm_buildControlSelectionEventCSC = CL().C_buildControlSelectionEvent;
return mm_buildControlSelectionEventCSC(this,pCC);  return mm_buildControlSelectionEventCSC(pCC); 
} }
var mm_buildSPANStyleCSC = null; var mm_buildSPANStyleCSC = null;
function buildSPANStyleCSC(pImageURL) function buildSPANStyleCSC(pImageURL)
{ {
if (mm_buildSPANStyleCSC == null) mm_buildSPANStyleCSC = CL().C_buildSPANStyle; if (mm_buildSPANStyleCSC == null) mm_buildSPANStyleCSC = CL().C_buildSPANStyle;
return mm_buildSPANStyleCSC(this,pImageURL);  return mm_buildSPANStyleCSC(pImageURL); 
} }
var mm_buildIMGStyleCSC = null; var mm_buildIMGStyleCSC = null;
function buildIMGStyleCSC(pImageURL) function buildIMGStyleCSC(pImageURL)
{ {
if (mm_buildIMGStyleCSC == null) mm_buildIMGStyleCSC = CL().C_buildIMGStyle; if (mm_buildIMGStyleCSC == null) mm_buildIMGStyleCSC = CL().C_buildIMGStyle;
return mm_buildIMGStyleCSC(this,pImageURL);  return mm_buildIMGStyleCSC(pImageURL); 
} }
var mm_checkIfIsPNGImage = null; var mm_checkIfIsPNGImage = null;
function checkIfIsPNGImage(pImageURL) function checkIfIsPNGImage(pImageURL)
{ {
if (mm_checkIfIsPNGImage == null) mm_checkIfIsPNGImage = CL().C_checkIfIsPNGImage; if (mm_checkIfIsPNGImage == null) mm_checkIfIsPNGImage = CL().C_checkIfIsPNGImage;
return mm_checkIfIsPNGImage(this,pImageURL);  return mm_checkIfIsPNGImage(pImageURL); 
} }
function encodeURLParameter(ps) function encodeURLParameter(ps)
{ {
if (ps == null) return null; if (ps == null) return null;
var psMem = ps; var psMem = ps;
try try
{ {
ps = encodeStringIntoUTF8(ps); ps = encodeStringIntoUTF8(ps);
ps = escape(ps).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27'); ps = escape(ps).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27');
return ps; return ps;
} }
catch (exc) catch (exc)
{ {
return psMem; return psMem;
} }
} }
function encodeStringIntoUTF8(rohtext) function encodeStringIntoUTF8(rohtext)
{ {
rohtext = rohtext.replace(/\r\n/g,"\n"); rohtext = rohtext.replace(/\r\n/g,"\n");
var utftext = ""; var utftext = "";
for(var n=0; n<rohtext.length; n++) for(var n=0; n<rohtext.length; n++)
{ {
var c=rohtext.charCodeAt(n); var c=rohtext.charCodeAt(n);
if (c<128) if (c<128)
utftext += String.fromCharCode(c); utftext += String.fromCharCode(c);
else if((c>127) && (c<2048)) { else if((c>127) && (c<2048)) {
utftext += String.fromCharCode((c>>6)|192); utftext += String.fromCharCode((c>>6)|192);
utftext += String.fromCharCode((c&63)|128);} utftext += String.fromCharCode((c&63)|128);}
else { else {
utftext += String.fromCharCode((c>>12)|224); utftext += String.fromCharCode((c>>12)|224);
utftext += String.fromCharCode(((c>>6)&63)|128); utftext += String.fromCharCode(((c>>6)&63)|128);
utftext += String.fromCharCode((c&63)|128);} utftext += String.fromCharCode((c&63)|128);}
} }
return utftext; return utftext;
} }
var mm_findInnerWidth = null; var mm_findInnerWidth = null;
function findInnerWidth(elm) function findInnerWidth(elm)
{ {
if (mm_findInnerWidth == null) mm_findInnerWidth = CL().C_findInnerWidth; if (mm_findInnerWidth == null) mm_findInnerWidth = CL().C_findInnerWidth;
return mm_findInnerWidth(this,elm);  return mm_findInnerWidth(elm); 
} }
var mm_flushColumnInfos = null; var mm_flushColumnInfos = null;
function flushColumnInfos(cc,methodName) function flushColumnInfos(cc,methodName)
{ {
if (mm_flushColumnInfos == null) mm_flushColumnInfos = CL().C_flushColumnInfos; if (mm_flushColumnInfos == null) mm_flushColumnInfos = CL().C_flushColumnInfos;
return mm_flushColumnInfos(this,cc,methodName);  return mm_flushColumnInfos(cc,methodName); 
} }
var mm_replaceLiteralTRANSLATION = null; var mm_replaceLiteralTRANSLATION = null;
function replaceLiteralTRANSLATION(lang, textid) function replaceLiteralTRANSLATION(lang, textid)
{ {
if (mm_replaceLiteralTRANSLATION == null) mm_replaceLiteralTRANSLATION = CL().C_replaceLiteralTRANSLATION; if (mm_replaceLiteralTRANSLATION == null) mm_replaceLiteralTRANSLATION = CL().C_replaceLiteralTRANSLATION;
return mm_replaceLiteralTRANSLATION(this,lang, textid); return mm_replaceLiteralTRANSLATION(lang, textid);
} }
var mm_replaceLiteralWithAddTextTRANSLATION = null; var mm_replaceLiteralWithAddTextTRANSLATION = null;
function replaceLiteralWithAddTextTRANSLATION(lang,textid,addtext,thisthis) function replaceLiteralWithAddTextTRANSLATION(lang,textid,addtext,thisthis)
{ {
if (mm_replaceLiteralWithAddTextTRANSLATION == null) mm_replaceLiteralWithAddTextTRANSLATION = CL().C_replaceLiteralWithAddTextTRANSLATION; if (mm_replaceLiteralWithAddTextTRANSLATION == null) mm_replaceLiteralWithAddTextTRANSLATION = CL().C_replaceLiteralWithAddTextTRANSLATION;
return mm_replaceLiteralWithAddTextTRANSLATION(this,lang,textid,addtext,thisthis);  return mm_replaceLiteralWithAddTextTRANSLATION(lang,textid,addtext,thisthis); 
} }
function mozCalculatePageScoll(pControl) function mozCalculatePageScoll(pControl)
{ {
if (isIE()) return 0; if (isIE()) return 0;
var vControl = pControl; var vControl = pControl;
var vScroll = 0; var vScroll = 0;
while (true) while (true)
{ {
try try
{ {
if (vControl == null) break; if (vControl == null) break;
if (vControl.scrollTop > 0) if (vControl.scrollTop > 0)
vScroll = vScroll + vControl.scrollTop; vScroll = vScroll + vControl.scrollTop;
var vTemp = vControl.parentNode; var vTemp = vControl.parentNode;
if (vControl == vTemp) break; if (vControl == vTemp) break;
vControl = vTemp; vControl = vTemp;
} }
catch (exc) catch (exc)
{ {
break; break;
} }
} }
return vScroll; return vScroll;
} }