var WApp; var WGlobal; function InitializeWebApi() { WApp=new ApplicationManager(); WGlobal=new Global(); /* var pageRequest=new CRequestOpenPage(); pageRequest.Page.SetLocation("MainPage"); pageRequest.Page.SetName("CurrentPage"); pageRequest.Execute(); */ } function ApplicationManager() { // Command handler var _commandHandler=new CommandHandler(); // Page manager var _pageManager=new PageManager(); // Element manager var _elementManager=new ElementManager(); // Xml node var _xmlNode; // Gets the main page this.GetMainPage=function(){ return _mainPage; } // Gets the command handler this.GetCommandHandler=function(){ return _commandHandler; } // Gets the page manager this.GetPageManager=function(){ return _pageManager; } // Gets the element manager this.GetElementManager=function(){ return _elementManager; } // Initialization method var Initialize=function() { // Create the xml node _xmlNode=document.createElement("div"); _xmlNode.style.position="absolute"; _xmlNode.style.visibility="hidden"; _xmlNode.style.left="-100px"; _xmlNode.style.top-"-100px"; document.body.appendChild(_xmlNode); /* try { if(document.implementation && document.implementation.createDocument) { _xmlDoc=new DOMParser(); } else if(window.ActiveXObject) { _xmlDoc=new ActiveXObject("Microsoft.XMLDOM") _xmlDoc.async="false" } } catch(e) {} */ } // Initialize the application Initialize(); var _toolTipDiv=null; // Shows the tool tip this.ShowToolTip=function(event,toolTipText) { this.HideToolTip(); _toolTipDiv=document.createElement("div"); _toolTipDiv.appendChild(document.createTextNode(toolTipText)); _toolTipDiv.style.position="absolute"; _toolTipDiv.style.zIndex=101; this.RepositionToolTip(event); _toolTipDiv.style.border="solid 1px #0000a0"; _toolTipDiv.style.background="#ffffff"; _toolTipDiv.style.font="12px 'ms sans serif'"; _toolTipDiv.style.padding="2px 4px 2px 4px"; // Append the tool tip div to the body document.body.appendChild(_toolTipDiv); } // Hides the tool tip this.HideToolTip=function() { if(_toolTipDiv!=null) if(_toolTipDiv.parentNode==document.body) document.body.removeChild(_toolTipDiv); _toolTipDiv=null; } // Repositions the tool tip this.RepositionToolTip=function(event) { if(_toolTipDiv!=null) { _toolTipDiv.style.left=(event.clientX+16)+"px"; _toolTipDiv.style.top=(event.clientY+8)+"px"; } } } function Global() { // Calculates the left position of any given element this.CalculateElementLeftPosition=function(element) { var left=0; // Loop until we reach the top of the dom while(element!=null) { // Add this left position left+=element.offsetLeft; // Move to the offset parent element=element.offsetParent; } return left; } // Calculates the top position of any given element this.CalculateElementTopPosition=function(element) { var top=0; // Loop until we reach the top of the dom while(element!=null) { // Add this left position top+=element.offsetTop; // Move to the offset parent element=element.offsetParent; } return top; } // Disposes an object and removes all of its properties this.DisposeObject=function(obj) { // Disposes an object and all of its properties for(var index in obj) { obj[index]=null; delete obj[index]; } } // Checks if an element is appended to parent this.ElementIsAppendedTo=function(element,parent) { for(var i=0;i1) { var valueValueArray=new Array(); valueValueArray.push(valueValue); // Loop for all the truncated child nodes for(var j=1;j"); _container.style.visibility="visible"; // Attach the event handlers if(_style!=null) if(_style.AttachEventHandlers) _style.AttachEventHandlers(); //alert((new Date())-start); // Set the events need detaching flag _eventsNeedDetaching=true; } // Appends the container to the document var AppendContainer=function() { // Check the container has been created if(_container==null) return; // If the container is already appended, return if(_containerAppended) return; // Append to the document thisRef.GetPage().GetDocument().body.appendChild(_container); // Set the appended flag _containerAppended=true; } // Removes the container from the document var RemoveContainer=function() { // Check the container has been created if(_container==null) return; // If the container is not already appended, return if(_containerAppended==false) return; // Get the document var doc=thisRef.GetPage().GetDocument(); // Remove from the body if it is still appended if(WGlobal.ElementIsAppendedTo(_container,doc.body)) // Remove from the document doc.body.removeChild(_container); // Set the appended flag to false _containerAppended=false; } // Makes the element visible this.Show=function() { // Set the displayed flag _isDisplayed=true; // Append the container to the document AppendContainer(); // Loop through all the scrollers for(var index in _scrollers) { // If the scroller needs updating if(_scrollers[index].GetUpdateOnElementShow()) // Update _scrollers[index].Update(); } // Make the container visible _container.style.visibility="visible"; } // Makes the element hidden this.Hide=function() { // Set the not displayed _isDisplayed=false; // Set the container to hidden _container.style.visibility="hidden"; // Remove the container RemoveContainer(); // Loop through all the scrollers for(var index in _scrollers) { // Hide _scrollers[index].Dispose(); } } // Disposes the element, releasing all resources associated with it this.Dispose=function() { // Detach the event handlers from the old html to prevent memory leaks if(_style!=null) if(_style.DetachEventHandlers) _style.DetachEventHandlers(); // Remove the container from the document RemoveContainer(); // Nullify the container _container=null; // Dispose the scrollers for(var index in _scrollers) { // Dispose _scrollers[index].Dispose(); // Delete delete _scrollers[index]; } // Nullify the page reference to remove the circular reference (ie bug) _page=null; // Remove from the element manager WApp.GetElementManager().RemoveElement(this); // Dispose the object WGlobal.DisposeObject(this); } } EElement.prototype.ePositioning=new Object(); EElement.prototype.ePositioning.Absolute=0; EElement.prototype.ePositioning.Static=1; EElement.prototype.ePositioning.Relative=2; function ElementFunctionManager() { // Handles the mouse over data grid event this.MouseOverDataGrid=function(event,element) { // Highlighting unavailable for now return; window.status=event.clientX; // Get the cell that fired the mouse over event var element=(event.srcElement?event.srcElement:event.target); // Check the element is a cell if(element.tagName!="DIV") return; // Get the element object var elementSearch=element; while(elementSearch!=null) { if(elementSearch.attIsContainer=="true") break; elementSearch=elementSearch.parentNode; } // Return if we couldnt find the element if(elementSearch==null) return; // Get the element id var elementId=elementSearch.attGetElementId(); // Get the element var elementObject=WApp.GetElementManager().GetElement(elementId); // Return if the element is null if(elementObject==null) return; // Set the container var container=elementSearch; // Get the row index var rowIndex=-1; var elementParentNode=element.parentNode; for(var i=0;i"+eventXml+"")); // If we found the command collection if(executeCommandCollection!=null) executeCommandCollection.Execute(parameters); } // Fires an event on a sub element this.FireSubElementEvent=function(domNode,subElementIndex,eventName,parameters) { // Set the current event dom node _currentEventDomNode=domNode; // Loop until we get to the container of the sub element while(domNode!=null && domNode.attIsContainer!="true") domNode=domNode.parentNode; // Return if we couldnt find the container if(domNode==null) return; // Get the element var element=WApp.GetElementManager().GetElement(domNode.attGetElementId()); // Return if we couldnt find the element if(element==null) return; // Get the event xml var eventXml=element.GetEventXml(eventName); // Create the command collection from the xml var executeCommandCollection=CommandCollection.prototype.FromXml(new XmlParser(""+eventXml+"")); // If we found the command collection if(executeCommandCollection!=null) executeCommandCollection.Execute(parameters); } } function HistoryHandler() { } function Page() { // Page id var _id=null; // Element collection var _elements=new Object(); // Append node var _appendNode; // Page reference var _location=0; // If _pageLocation is Page.prototype.ePageLocation.IFrame, this holds the iframe name var _iFrameName=""; // Is displayed flag var _isDisplayed=false; // Is disposed flag var _isDisposed=false; // Gets/Sets the id // Allows 1 set of the id this.GetId=function(){ return _id; } this.SetId=function(value){ if(_id==null)_id=value; } // Gets/Sets the append node this.GetAppendNode=function(){ return _appendNode; } this.SetAppendNode=function(value){ _appendNode=value; } // Gets/Sets the main page location this.GetLocation=function(){ return _location; } this.SetLocation=function(value){ _location=value; } // Gets/Sets the iframe name this.GetIFrameName=function(){ return _iFrameName; } this.SetIFrameName=function(value){ _iFrameName=value; } // Gets if the page is displayed this.GetIsDisplayed=function(){ return _isDisplayed; } // Adds an element to the page this.AddElement=function(element) { // Add to the element page _elements[element.GetId()]=element; } // Removes an element from the page this.RemoveElement=function(element) { // Remove the element from the page var elementId=element.GetId(); if(_elements[elementId]!=null) delete _elements[elementId]; } // Gets an element given its id this.GetElement=function(elementId) { // Retrieve the element if(_elements[elementId]!=null) return _elements[elementId]; return null; } // Gets the document object of the page this.GetDocument=function() { // If this page is the main page, return the main document if(_location==Page.prototype.eLocation.MainPage) return document; // If the page is an iframe, return the iframe's document if(_location==Page.prototype.eLocation.IFrame) { if(window.frames[_iFrameName]!=null) return window.frames[_iFrameName].document; alert("Error:\r\n\r\nCannot locate iFrame \""+_iFrameName+"\""); } alert("Error:\r\n\r\nAn error occured whilst trying to retrieve the document of the page."); } // Gets the is disposed flag this.GetIsDisposed=function(){ return _isDisposed; } /// Displays the page this.Show=function() { // Inform the page manager that the main page is changing WApp.GetPageManager().CurrentPageChanging(this); // Set the page to displayed _isDisplayed=true; // Loop for all the elements on this page for(var index in _elements) { // Show the element _elements[index].Show(); } } // Hides the page this.Hide=function() { // Set the page to hidden _isDisplayed=false; // Loop for all the element on this page for(var index in _elements) { // Hide the element _elements[index].Hide(); } } // Disposes the page and all elements belonging to it this.Dispose=function() { // Dispose all elements for(var index in _elements) { _elements[index].Dispose(); // Delete delete _elements[index]; } // Remove the page from the manager WApp.GetPageManager().RemovePage(this); // Set the disposed flag to true _isDisposed=true; } } Page.prototype.eLocation=new Object(); Page.prototype.eLocation.MainPage=0; Page.prototype.eLocation.IFrame=1; Page.prototype.eLocation.Dialog=2; function PageManager() { // Open pages lookup var _pages=new Object(); // Currently displayed page in the main window var _currentPage=null; // Gets a page from the lookup table this.GetPage=function(pageId) { // Check the page exists if(_pages[pageId]==null) { //alert("Error:\r\n\r\nUnable to find page with id "+pageId+"."); return null; } return _pages[pageId]; } // Adds a page to the manager this.AddPage=function(page) { // Set the page _pages[page.GetId()]=page; } // Removes a page from the manager this.RemovePage=function(page) { // Remove the page if(_pages[page.GetId()]!=null) delete _pages[page.GetId()]; // Dispose the page delete page; } // Gets the currently displayed page this.GetCurrentPage=function() { return _currentPage; } // Disposes all pages in the manager this.DisposeAllPages=function() { // Loop for all the pages for(var index in _pages) { _pages[index].Dispose(); // Delete the index delete _pages[index]; } // Set the current page to null _currentPage=null; } // Called when a new page is about to be displayed in the main window this.CurrentPageChanging=function(newPage) { // Hide the current page if(_currentPage!=null) _currentPage.Hide(); // Set the current page _currentPage=newPage; } } function Scroller() { // Is vertical flag (horizontal if off) var _isVertical=true; // Div containers to scroll var _scrollTargetId; var _scrollTargets=new Array(); // Positions var _positionX=0; var _positionY=0; // Override length var _overrideLength=0; // Scrolling container var _scrollContainer=null; // Scroll mode var _mode="Smooth"; // Number of visible notches var _visibleNotches=0; // Total number of notches var _totalNotches=0; // Stagger step var _staggerStep; // Element the scroller belongs to var _element; // Needs updating flag // Set if the scroller is updated but the page is not yet shown // Scroller needs to be updated when the element is displayed var _updateOnElementShow=false; // Gets/Sets the is vertical flag this.GetIsVertical=function(){ return _isVertical; } this.SetIsVertical=function(value){ _isVertical=value; } // Adds a scroll target id this.GetScrollTargetId=function(){ return _scrollTargetId; } this.SetScrollTargetId=function(value){ _scrollTargetId=value; } // Gets/Sets the element that the scroller belongs to this.GetElement=function(){ return _element; } this.SetElement=function(value){ _element=value; } // Gets/Sets the mode this.GetMode=function(){ return _mode; } this.SetMode=function(value){ _mode=value; } // Gets/Sets the override length this.GetOverrideLength=function(){ return _overrideLength; } this.SetOverrideLength=function(value){ _overrideLength=value; } // Gets/Sets the visible notches this.GetVisibleNotches=function(){ return _visibibleNotches; } this.SetVisibleNotches=function(value){ _visibleNotches=value; } // Gets/Sets the total number of notches this.GetTotalNotches=function(){ return _totalNotches; } this.SetTotalNotches=function(value){ _totalNotches=value; } // Gets the update on page show flag this.GetUpdateOnElementShow=function(){ return _updateOnElementShow; } // Gets/Sets the position x this.GetPositionX=function(){ return _positionX; } this.SetPositionX=function(value){ _positionX=value; } // Gets/Sets the position y this.GetPositionY=function(){ return _positionY; } this.SetPositionY=function(value){ _positionY=value; } // This ref var thisRef=this; // Creates the scrolling container var CreateScrollContainer=function() { // Create the scroll container _scrollContainer=_element.GetPage().GetDocument().createElement("div"); // Set the positioning to absolute _scrollContainer.style.position="absolute"; _scrollContainer.style.left="-1000px"; _scrollContainer.style.top="-1000px"; // Set the z index _scrollContainer.style.zIndex=1000; // Set the dimensions of the scroller container if(_isVertical) _scrollContainer.style.width="18px"; else _scrollContainer.style.height="19px"; // Hide initially _scrollContainer.style.visibility="hidden"; // Set the overflow to scroll _scrollContainer.style.overflow="auto"; _scrollContainer.style.padding="0px"; // Append to the document _element.GetPage().GetDocument().body.appendChild(_scrollContainer); // Create the inner scroll div var innerScroll=_element.GetPage().GetDocument().createElement("div"); // Set the style innerScroll.style.padding="0px"; innerScroll.style.fontSize="0px"; // Set the height to force the scroller to display innerScroll.style.height="1px"; // Append _scrollContainer.appendChild(innerScroll); // Set the back reference _scrollContainer.scroller=thisRef; // Set the scroll event to scroll the target _scrollContainer.onscroll=function() { this.scroller.Scroll(); } } // Updates the scroller this.Update=function() { // Check the page the target element is displayed on is shown if(_element.GetIsDisplayed()==false) { // If not, set the scroller to be updated when the page is shown _updateOnElementShow=true; return; } // If the mode is staggered if(_mode=="Staggered") { // If we dont need a scroller, return if(_totalNotches<=_visibleNotches) return; } else { } // Set the update on page show to false _updateOnPageShow=false; // If the scroll container is null, create it if(_scrollContainer==null) CreateScrollContainer(); // Clear the scroll targets _scrollTargets=new Array(); // Add the scroll targets var count=1; while(true) { var scrollTarget=_element.GetPage().GetDocument().getElementById(_scrollTargetId+"_"+count); if(scrollTarget==null) break; _scrollTargets.push(scrollTarget); count++; } // If there are no scroll targets if(_scrollTargets.length==0) return; // Hide _scrollContainer.style.visibility="hidden"; // Re-position _scrollContainer.style.left=_positionX+"px"; _scrollContainer.style.top=_positionY+"px"; // Get the scroll target size var scrollTargetSize; if(_isVertical) scrollTargetSize=_scrollTargets[0].offsetHeight; else scrollTargetSize=_scrollTargets[0].offsetWidth; for(var i=1;i<_scrollTargets.length;i++) { var nextScrollTargetSize; if(_isVertical) nextScrollTargetSize=_scrollTargets[i].offsetHeight; else nextScrollTargetSize=_scrollTargets[i].offsetWidth; if(nextScrollTargetSize!=scrollTargetSize) alert("Warning\r\n\r\nInconsistant scroll container size"); } // Get the scroller height var scrollerSize=scrollTargetSize; // Set the width or height of the container depending on horizontal or vertical if(_isVertical) _scrollContainer.style.height=scrollerSize+"px"; else _scrollContainer.style.width=scrollerSize+"px"; // If the scroller is smooth if(_mode=="Smooth") { var scrollInnerSize; // If the length is overridden if(_overrideLength!=0) scrollInnerSize=_overrideLength; else { // If vertical, set the height, otherwise set the width if(_isVertical) // Set the scroller height to the same as the target element scrollInnerSize=_scrollTargets[0].firstChild.offsetHeight; else // Set the scroller width to the same as the target element scrollInnerSize=_scrollTargets[0].firstChild.offsetWidth; } // If vertical, set the height, otherwise set the width if(_isVertical) // Set the scroller height to the same as the target element _scrollContainer.firstChild.style.height=scrollInnerSize+"px"; else // Set the scroller width to the same as the target element _scrollContainer.firstChild.style.width=scrollInnerSize+"px"; } if(_mode=="Staggered") { var notchStep=0; // If this is internet explorer if(document.frames) notchStep=Math.floor(scrollerSize/8); else // FF is always 19. // Unsure about other browsers notchStep=19; if(_isVertical) // Set the height of the inner scroller _scrollContainer.firstChild.style.height=(scrollerSize+Math.round((notchStep*(_totalNotches-_visibleNotches))))+"px"; else // Set the width of the inner scroller _scrollContainer.firstChild.style.width=(scrollerSize+Math.round((notchStep*(_totalNotches-_visibleNotches))))+"px"; // Set the stagger step if(_isVertical) // Set the row height _staggerStep=_scrollTargets[0].firstChild.offsetHeight/_totalNotches; else // Set the row height _staggerStep=_scrollTargets[0].firstChild.offsetWidth/_totalNotches; } // Make visible _scrollContainer.style.visibility="visible"; } // Scrolls the target element this.Scroll=function() { // Get the scroll position var scrollPosition=0 if(_isVertical) scrollPosition=_scrollContainer.scrollTop; else scrollPosition=_scrollContainer.scrollLeft; // If the mode is smooth if(_mode=="Smooth") { // Loop through all scroll targets for(var i=0;i<_scrollTargets.length;i++) { // If vertical if(_isVertical) _scrollTargets[i].scrollTop=scrollPosition; else _scrollTargets[i].scrollLeft=scrollPosition; } } else { var notchStep=0; // If this is internet explorer if(document.frames) notchStep=Math.floor(_scrollContainer.offsetHeight/8); else // FF is always 19. // Unsure about other browsers notchStep=19; // Calculate the number of notches we have scrolled var numberNotchesScrolled=Math.round(scrollPosition/notchStep); // Loop through all scroll targets for(var i=0;i<_scrollTargets.length;i++) { // If vertical if(_isVertical) _scrollTargets[i].scrollTop=numberNotchesScrolled*_staggerStep; else _scrollTargets[i].scrollLeft=numberNotchesScrolled*_staggerStep; } } } // Disposes the scroller this.Dispose=function() { // Get the document var doc=_element.GetPage().GetDocument(); // Remove from the body if it is still appended if(WGlobal.ElementIsAppendedTo(_scrollContainer,doc.body)) { doc.body.removeChild(_scrollContainer); // Remove the scroll event _scrollContainer.onscroll=null; } // Nullify _scrollContainer=null; } } function SSubElement() { // Events var _eventsXml=new Object(); // Gets the command collection for a specified event this.GetEventXml=function(eventName) { if(_eventsXml[eventName]==null) return ""; return _eventsXml[eventName]; } // Sets the command collection for a specified event this.SetEventXml=function(eventName,eventXml) { _eventsXml[eventName]=eventXml; } } function XmlParser(xmlString) { /* // XML string var _xmlString=xmlString; // XML string pointer var _xmlPointer=0; // Gets if we are at the end of the stream this.IsEnd=function(){ if(_xmlPointer==-1)return true; else return false; } // Reads to the next node this.ReadToNextNode=function() { if(_xmlPointer!=-1) // Get the index of the next opening tag _xmlPointer=_xmlString.indexOf('<',_xmlPointer)+1; } // This method gets the tag name of the current node this.ReadNodeName=function(expectedName) { // Read to the next node this.ReadToNextNode(); if(_xmlPointer==-1) return ""; var closingTagPointer=_xmlString.indexOf('>',_xmlPointer); // Check validity if(closingTagPointer==-1) return ""; var nodeName=_xmlString.substring(_xmlPointer,closingTagPointer); _xmlPointer=closingTagPointer+1; return nodeName==expectedName; } // This method peeks at the next node name without moving the pointer along this.PeekNodeName=function(expectedName) { // Get the index of the next node var nextNodePointer=_xmlString.indexOf('<',_xmlPointer)+1; if(nextNodePointer==-1) return ""; // Get the index of the closing tag var closingNodePointer=_xmlString.indexOf('>',nextNodePointer); if(closingNodePointer==-1) return ""; var nodeName=_xmlString.substring(nextNodePointer,closingNodePointer); return expectedName==nodeName; } // Gets the content of the current node this.ReadNodeContent=function() { if(_xmlPointer==-1) return ""; // Get the index of the next node var nextTagPointer=_xmlString.indexOf('<',_xmlPointer); // Check validity if(nextTagPointer==-1) return ""; var returnString=_xmlString.substring(_xmlPointer,nextTagPointer); _xmlPointer=nextTagPointer; return returnString; } */ var xmlSplit=xmlString.split(/\>\<|\<|\>/g); var pointer=0; this.ReadNodeContent=function() { var returnString=xmlSplit[pointer]; pointer++; return returnString; } this.PeekNodeName=function(expectedName) { return expectedName==xmlSplit[pointer]; } this.ReadNodeName=function(expectedName) { while(xmlSplit[pointer]=="") pointer++; var returnString=xmlSplit[pointer]; pointer++; return expectedName==returnString; } this.debug=function() { return xmlSplit[pointer]; } } function CAddElementToPage() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(true); this.SetIsInternal(true); this.SetType("CAddElementToPage"); this.Element=null;this.Page=null; this.Execute=function(parameters) { var element=WApp.GetElementManager().GetElement(this.Element.GetId());var page=WApp.GetPageManager().GetPage(this.Page.GetId());page.AddElement(element);element.SetPage(page); } } function CCreateElement() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(true); this.SetIsInternal(true); this.SetType("CCreateElement"); this.Element=null;this.Page=null;this.Positioning=null;this.Html=null; this.Execute=function(parameters) { var element=eval("new E"+this.Element.GetElementType()+"()");element.SetId(this.Element.GetId());var newElementStyle=eval("new S"+this.Element.GetStyleName()+"(element)");element.SetStyle(newElementStyle);WApp.GetElementManager().AddElement(element);if(this.Page!=null){var page=WApp.GetPageManager().GetPage(this.Page.GetId());page.AddElement(element);element.SetPage(page);}if(this.Positioning!=null){var validMembers=this.Positioning.GetValidMembers();var positioningMode;if(this.Positioning.GetPositioningMode()=="Absolute")positioningMode=EElement.prototype.ePositioning.Absolute;if(this.Positioning.GetPositioningMode()=="Relative")positioningMode=EElement.prototype.ePositioning.Relative;if(this.Positioning.GetPositioningMode()=="Static")positioningMode=EElement.prototype.ePositioning.Static;if((validMembers&0x01)==0x01)element.SetPositioningMode(positioningMode);if((validMembers&0x02)==0x02)element.SetPositionX(parseInt(this.Positioning.GetPositionX(),10));if((validMembers&0x04)==0x04)element.SetPositionY(parseInt(this.Positioning.GetPositionY(),10));if((validMembers&0x08)==0x08)element.SetPositionZ(parseInt(this.Positioning.GetPositionZ(),10));}var metaDataSplit=this.Element.GetMetaData().split(String.fromCharCode(31));for(var i=0;iparameters.fieldIndex)sortFieldName=enquiry.IITIIT1[parameters.fieldIndex];if(sortFieldName=='')return;top.TTI1T11.TTTTTT.I1I1TI11(element.GetMetaData('EnquiryIndex'),sortFieldName); } } function CUpdateElementEvent() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(true); this.SetIsInternal(true); this.SetType("CUpdateElementEvent"); this.Element=null;this.StringAttributes=null; this.Execute=function(parameters) { var element=WApp.GetElementManager().GetElement(this.Element.GetId());if(element==null)return;var eventXml=element.GetEventXml(this.StringAttributes.GetKey());if(this.StringAttributes.GetValue1()=="Add"){eventXml+=unescape(this.StringAttributes.GetValue2());}element.SetEventXml(this.StringAttributes.GetKey(),eventXml); } } function CUpdateElementHtml() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(true); this.SetIsInternal(true); this.SetType("CUpdateElementHtml"); this.Element=null;this.Html=null; this.Execute=function(parameters) { var element=WApp.GetElementManager().GetElement(this.Element.GetId());element.UpdateHtml(this.Html.GetHtml()); } } function CUpdateElementPositioning() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(true); this.SetIsInternal(true); this.SetType("CUpdateElementPositioning"); this.Element=null;this.Positioning=null; this.Execute=function(parameters) { var element=WApp.GetElementManager().GetElement(this.Element.GetId());var validMembers=this.Positioning.GetValidMembers();var positioningMode;if(this.Positioning.GetPositioningMode()=="Absolute")positioningMode=EElement.prototype.ePositioning.Absolute;if(this.Positioning.GetPositioningMode()=="Relative")positioningMode=EElement.prototype.ePositioning.Relative;if(this.Positioning.GetPositioningMode()=="Static")positioningMode=EElement.prototype.ePositioning.Static;if((validMembers&0x01)==0x01)element.SetPositioningMode(positioningMode);if((validMembers&0x02)==0x02)element.SetPositionX(parseInt(this.Positioning.GetPositionX(),10));if((validMembers&0x04)==0x04)element.SetPositionY(parseInt(this.Positioning.GetPositionY(),10));if((validMembers&0x08)==0x08)element.SetPositionZ(parseInt(this.Positioning.GetPositionZ(),10)); } } function CUpdateElementScroller() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(true); this.SetIsInternal(true); this.SetType("CUpdateElementScroller"); this.Element=null;this.Scroller=null;this.Positioning=null; this.Execute=function(parameters) { var element=WApp.GetElementManager().GetElement(this.Element.GetId());var scroller=element.GetScroller(this.Scroller.GetScrollerName());scroller.SetMode(this.Scroller.GetScrollMode());scroller.SetVisibleNotches(parseInt(this.Scroller.GetVisibleNotches(),10));scroller.SetTotalNotches(parseInt(this.Scroller.GetTotalNotches(),10));scroller.SetPositionX(parseInt(this.Positioning.GetPositionX(),10));scroller.SetPositionY(parseInt(this.Positioning.GetPositionY(),10));if(this.Scroller.GetOverrideLength()!="")scroller.SetOverrideLength(parseInt(this.Scroller.GetOverrideLength(),10));scroller.Update(); } } function CUpdateEnquiryDataGridIndex() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(true); this.SetIsInternal(true); this.SetType("CUpdateEnquiryDataGridIndex"); this.StringAttributes=null;this.Element=null; this.Execute=function(parameters) { var enquiry=top.TTI1T11.TTTTTT.ITTTIT1[this.StringAttributes.GetValue1()];if(enquiry==null)return;enquiry.TTTTTI=this.Element.GetId(); } } function CChangeDataGridView() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(true); this.SetType("CChangeDataGridView"); this.Element=new PElement();this.StringAttributes=new PStringAttributes();} function CDataCellContentClicked() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(true); this.SetType("CDataCellContentClicked"); this.Element=new PElement();this.Column=new PColumn();this.Row=new PRow();} function CRequestCreateElement() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(true); this.SetType("CRequestCreateElement"); } function CRequestOpenPage() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(true); this.SetType("CRequestOpenPage"); this.Page=new PPage();} function CRequestUpdateElementHtml() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(true); this.SetType("CRequestUpdateElementHtml"); this.Element=new PElement();this.StringAttributes=new PStringAttributes();} function CSetButtonText() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(true); this.SetType("CSetButtonText"); this.Element=new PElement();this.StringAttributes=new PStringAttributes();} function CUpdateRangeMarker() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(false); this.SetType("CUpdateRangeMarker"); this.Element=new PElement();this.Row=new PRow();this.StringAttributes=new PStringAttributes();} function CDataCellContentClicked() { this.inherit=CCommand; this.inherit(); this.SetIsClientCommand(false); this.SetIsInternal(false); this.SetType("CDataCellContentClicked"); this.Element=new PElement();this.Column=new PColumn();this.Row=new PRow();} function PColour() { this.inherit=PParameter; this.inherit(); this.SetType("PColour"); this.GetColour=function(){ return this.GetValue("colour"); } this.SetColour=function(value){ this.SetValue("colour",value); } } function PColumn() { this.inherit=PParameter; this.inherit(); this.SetType("PColumn"); this.GetColumnIndex=function(){ return this.GetValue("columnindex"); } this.SetColumnIndex=function(value){ this.SetValue("columnindex",value); } } function PElement() { this.inherit=PParameter; this.inherit(); this.SetType("PElement"); this.GetElementType=function(){ return this.GetValue("elementtype"); } this.SetElementType=function(value){ this.SetValue("elementtype",value); } this.GetId=function(){ return this.GetValue("id"); } this.SetId=function(value){ this.SetValue("id",value); } this.GetStyleName=function(){ return this.GetValue("stylename"); } this.SetStyleName=function(value){ this.SetValue("stylename",value); } this.GetMetaData=function(){ return this.GetValue("metadata"); } this.SetMetaData=function(value){ this.SetValue("metadata",value); } } function PHtml() { this.inherit=PParameter; this.inherit(); this.SetType("PHtml"); this.GetHtml=function(){ return this.GetValue("html"); } this.SetHtml=function(value){ this.SetValue("html",value); } } function PPage() { this.inherit=PParameter; this.inherit(); this.SetType("PPage"); this.GetId=function(){ return this.GetValue("id"); } this.SetId=function(value){ this.SetValue("id",value); } this.GetName=function(){ return this.GetValue("name"); } this.SetName=function(value){ this.SetValue("name",value); } this.GetLocation=function(){ return this.GetValue("location"); } this.SetLocation=function(value){ this.SetValue("location",value); } this.GetIFrameName=function(){ return this.GetValue("iframename"); } this.SetIFrameName=function(value){ this.SetValue("iframename",value); } } function PPositioning() { this.inherit=PParameter; this.inherit(); this.SetType("PPositioning"); this.GetValidMembers=function(){ return this.GetValue("validmembers"); } this.SetValidMembers=function(value){ this.SetValue("validmembers",value); } this.GetPositioningMode=function(){ return this.GetValue("positioningmode"); } this.SetPositioningMode=function(value){ this.SetValue("positioningmode",value); } this.GetPositionX=function(){ return this.GetValue("positionx"); } this.SetPositionX=function(value){ this.SetValue("positionx",value); } this.GetPositionY=function(){ return this.GetValue("positiony"); } this.SetPositionY=function(value){ this.SetValue("positiony",value); } this.GetPositionZ=function(){ return this.GetValue("positionz"); } this.SetPositionZ=function(value){ this.SetValue("positionz",value); } } function PRow() { this.inherit=PParameter; this.inherit(); this.SetType("PRow"); this.GetRowIndex=function(){ return this.GetValue("rowindex"); } this.SetRowIndex=function(value){ this.SetValue("rowindex",value); } } function PScroller() { this.inherit=PParameter; this.inherit(); this.SetType("PScroller"); this.GetScrollMode=function(){ return this.GetValue("scrollmode"); } this.SetScrollMode=function(value){ this.SetValue("scrollmode",value); } this.GetOrientation=function(){ return this.GetValue("orientation"); } this.SetOrientation=function(value){ this.SetValue("orientation",value); } this.GetScrollerName=function(){ return this.GetValue("scrollername"); } this.SetScrollerName=function(value){ this.SetValue("scrollername",value); } this.GetOverrideLength=function(){ return this.GetValue("overridelength"); } this.SetOverrideLength=function(value){ this.SetValue("overridelength",value); } this.GetVisibleNotches=function(){ return this.GetValue("visiblenotches"); } this.SetVisibleNotches=function(value){ this.SetValue("visiblenotches",value); } this.GetTotalNotches=function(){ return this.GetValue("totalnotches"); } this.SetTotalNotches=function(value){ this.SetValue("totalnotches",value); } } function PStringAttributes() { this.inherit=PParameter; this.inherit(); this.SetType("PStringAttributes"); this.GetKey=function(){ return this.GetValue("key"); } this.SetKey=function(value){ this.SetValue("key",value); } this.GetValue1=function(){ return this.GetValue("value1"); } this.SetValue1=function(value){ this.SetValue("value1",value); } this.GetValue2=function(){ return this.GetValue("value2"); } this.SetValue2=function(value){ this.SetValue("value2",value); } } function SSubElement() { this.inherit=EElement; this.inherit(); } function EButton() { this.inherit=EElement; this.inherit(); } function EDataGrid() { this.inherit=EElement; this.inherit(); } function RowDataCollection() { this.inherit=EElement; this.inherit(); } function ColumnDataCollection() { this.inherit=EElement; this.inherit(); } function SStyle(element) { var _element=element; } function SButtonStandard(element) { var _element=element; this.AttachEventHandlers=function() { var container=_element.GetContainer(); var buttonElement=container.firstChild;buttonElement.onclick=function(){top.WApp.GetElementManager().FireElementEvent(this,'OnClick');}} this.DetachEventHandlers=function() { var container=_element.GetContainer(); var buttonElement=container.firstChild;if(buttonElement!=null)buttonElement.onclick=null;} } function SDataGridStandard(element) { var _element=element; this.AttachEventHandlers=function() { var container=_element.GetContainer(); var dataGridDataCellsHold=container.firstChild.childNodes[2];dataGridDataCellsHold.onclick=function(event){if(!event)event=this.ownerDocument.parentWindow.event;WApp.GetElementManager().GetElementFunctionManager().MouseClickDataGridRow(event,this);};var headingsHold=container.firstChild.firstChild;headingsHold.onclick=function(event){if(!event)event=this.ownerDocument.parentWindow.event;WApp.GetElementManager().GetElementFunctionManager().MouseClickDataGridHeading(event,this);};} this.DetachEventHandlers=function() { var container=_element.GetContainer(); } }