/* (c) Xtranet Multimedia 2005 Outputs JavaScript for balloon help system NOTE Although this is an ASP file it is called from a SCRIPT tag using the src attribute and hence this file must only contain valid JavaScript */ //var xcBubbleKeywords = {'keyword':'This is a keyword', 'test':'A test of the popups'}; var xcBubbleHelp; var xcRelevantContents = new Array(); var ie = document.all ? true : false function initializeXcBubbleHelp() { function Sensitize(KeyWord) { xcRelevantContents[KeyWord] = {message:xcBubbleKeywords[KeyWord].replace(/[\*]/ig, '')}; document.getElementById("xcBubbleHelp").innerHTML = document.getElementById("xcBubbleHelp").innerHTML.replace(new RegExp('(\\W+)\\*('+EscapeRegExp(KeyWord.replace(/[\*]/ig, ''))+')\\*(\\W+)', 'ig'), '$1$2$3'); //WalkNodes(document.getElementById("xcBubbleHelp"), KeyWord); } function WalkNodes(oNode, sKeyWord) { var i; if(oNode.childNodes.length == 0) { if(oNode.nodeType == 3) { oNode.nodeValue = oNode.nodeValue.replace(new RegExp('(\\W+)('+EscapeRegExp(sKeyWord)+')(\\W+)', 'ig'), '$1$2$3'); } } else { for(i=0; i < oNode.childNodes.length-1; i++) { WalkNodes(oNode.childNodes(i), sKeyWord); } } if(oNode.nextSibling) { WalkNodes(oNode.nextSibling, sKeyWord); } return; } var i; xcBubbleHelp=new JSBalloon({autoAway:false, autoHide:false, showCloseBox:true, transShow:false, transHide:false}); for(i in xcBubbleKeywords) { Sensitize(i); } var oSpans = document.getElementById("xcBubbleHelp").getElementsByTagName('SPAN'); for (i = 0; i < oSpans.length; i++) { var oSpan = oSpans.item(i); if (oSpan.className == 'xcBubbleHelp') { oSpan.title = 'Click for definition'; oSpan.style.borderBottom = '1px solid'; //oSpan.style.paddingBottom = '1px'; //oSpan.style.borderBottom = 'darkgreen 0.07em solid'; //oSpan.style.textDecoration = 'underline'; oSpan.style.cursor = 'help'; oSpan.style.fontWeight = ie ? oSpan.parentNode.currentStyle.fontWeight : window.getComputedStyle(oSpan.parentNode, "").getPropertyValue('font-weight'); } } } function xcBH(what, where) { //xcRelevantContents[what]['title'] = ' definition'; xcRelevantContents[what]['icon'] = 'Info'; xcRelevantContents[what]['anchor'] = where; xcBubbleHelp.Show(xcRelevantContents[what]); } function EscapeRegExp(pstrString) { var re = /(\\|\^|\$|\*|\+|\?|\.|\(|\)|\||\{|\}|\[|\])/ig; var ret = pstrString.replace(re, "\\$1"); return ret; } //window.onload = initPage; /*----------------------------------------------------------------------------\ | JSBalloon | |-----------------------------------------------------------------------------| | Created by Arkady (Alex) Lesniara | | (arkady@lesniara.com) | |-----------------------------------------------------------------------------| | Copyright (c) 2005 Arkady Lesniara | |-----------------------------------------------------------------------------| | This software is provided "as is", without warranty of any kind, express or | | implied, including but not limited to the warranties of merchantability, | | fitness for a particular purpose and noninfringement. In no event shall the | | authors or copyright holders be liable for any claim, damages or other | | liability, whether in an action of contract, tort or otherwise, arising | | from, out of or in connection with the software or the use or other | | dealings in the software. | \----------------------------------------------------------------------------*/ var JSBalloonPath=""; var ie = document.all ? true : false /* Class: JSBalloon Provides a flexible, encapsulated way to implement a passive feedback mechanism in a DHTML environment. Define and initialize this object globally, otherwise it will create a new instance each time you call it's constructor. Set up the object with an object array passed to the constructor or, once instantiated, with properties. See for more. */ function JSBalloon() { var tmrBalloonPopup; var blbWidth=200;; var titleFontStyle='font-family: MS Sans Serif;font-weight: bold; font-size:10pt;'; var messageFontStyle='font-family: MS Sans Serif\; font-size:10pt\;'; var footerFontStyle='font-family: MS Sans Serif\; font-size:10pt\;'; var transShow=true; var transHide=true; var transShowFilter='progid:DXImageTransform.Microsoft.Fade(Overlap=1.00)'; var transHideFilter='progid:DXImageTransform.Microsoft.Fade(Overlap=1.00)'; var autoHide=true; var autoHideInterval=4000; // 4 sec var autoAway=true; var showCloseBox=false; if(JSBalloon.arguments.length>0) { var oArg=JSBalloon.arguments[0]; if(oArg.width!=null) { blbWidth=oArg.width; } if(oArg.titleFontStyle!=null) { titleFontStyle=oArg.titleFontStyle; } if(oArg.messageFontStyle!=null) { messageFontStyle=oArg.messageFontStyle; } if(oArg.footerFontStyle!=null) { footerFontStyle=oArg.footerFontStyle; } if(oArg.transShow!=null) { transShow=oArg.transShow; } if(oArg.transHide!=null) { transHide=oArg.transHide; } if(oArg.transShowFilter!=null) { transShowFilter=oArg.transShowFilter; } if(oArg.transHideFilter!=null) { transHideFilter=oArg.transHideFilter; } if(oArg.autoHide!=null) { autoHide=oArg.autoHide; } if(oArg.autoHideInterval!=null) { autoHideInterval=oArg.autoHideInterval; } if(oArg.autoAway!=null) { autoAway=oArg.autoAway; } if(oArg.showCloseBox!=null) { showCloseBox=oArg.showCloseBox; } } // Public properties /* Property: titleFontStyle Sets or retrieves a Cascading Style Sheet formatted value that formats the balloon's title (heading). Syntax: object.titleFontStyle [= sCSS ] Possible Values: sCSS - *variant* that specifies a properly formed Cascading Style Sheet formatting. Examples: balloonObj.titleFontStyle="font-family: MS Sans Serif;font-weight: bold; font-size:12pt;"; */ this.titleFontStyle=titleFontStyle; /* Property: messageFontStyle Sets or retrieves a Cascading Style Sheet formatted value that formats the balloon's main message body. Syntax: object.messageFontStyle [= sCSS ] Possible Values: sCSS - *variant* that specifies a properly formed Cascading Style Sheet formatting. Examples: balloonObj.messageFontStyle="font-family: MS Sans Serif;font-weight: bold; font-size:12pt;"; */ this.messageFontStyle=messageFontStyle; /* Property: footerFontStyle Sets or retrieves a Cascading Style Sheet formatted value that formats the balloon's footer. Syntax: object.footerFontStyle [= sCSS ] Possible Values: sCSS - *variant* that specifies a properly formed Cascading Style Sheet formatting. Examples: balloonObj.footerFontStyle="font-family: MS Sans Serif;font-weight: bold; font-size:12pt;"; */ this.footerFontStyle=footerFontStyle; /* Property: transShowFilter Sets or retrieves a value of a transition (a filter) applied when showing the balloon. Syntax: object.transShowFilter [= string ] Possible Values: string - *variant* that specifies the transition filter. More information found at http://msdn.microsoft.com/workshop/author/filter/reference/reference.asp Examples: balloonObj.transShowFilter="progid:DXImageTransform.Microsoft.Stretch(stretchstyle=SPIN)"; See also: */ this.transShowFilter=transShowFilter; /* Property: transHideFilter Sets or retrieves a value of a transition (a filter) applied when hiding the balloon. Syntax: object.transHideFilter [= string ] Possible Values: string - *variant* that specifies the transition filter. More information found at http://msdn.microsoft.com/workshop/author/filter/reference/reference.asp Examples: balloonObj.transHideFilter="progid:DXImageTransform.Microsoft.Slide(slidestyle=HIDE,Bands=1)"; See also: */ this.transHideFilter=transHideFilter; /* Property: transShow Sets or retrieves a value indicating whether to apply transition filter specified in when showing the balloon. Syntax: object.transShow [= bValue ] Possible Values: bValue - *boolean* true / false Examples: balloonObj.transShow=true; See also: */ this.transShow=transShow; /* Property: transHide Sets or retrieves a value indicating whether to apply transition filter specified in when hiding the balloon. Syntax: object.transHide [= bValue ] Possible Values: bValue - *boolean* true / false Examples: balloonObj.transHide=true; See also: */ this.transHide=transHide; /* Property: autoHide Sets or retrieves a value indicating whether to automatically hide the balloon after s time specified in . Syntax: object.autoHide [= bValue ] Possible Values: bValue - *boolean* true / false Examples: balloonObj.autoHide=true; See also: */ this.autoHide=autoHide; /* Property: autoHideInterval Sets or retrieves a value indicating how long to wait before executing . Syntax: object.autoHideInterval [= iValue ] Possible Values: iValue - *integer* number of milliseconds to wait before activating . Examples: balloonObj.autoHideInterval=5000; // 5 Sec See also: */ this.autoHideInterval=autoHideInterval; /* Property: autoAway Sets or retrieves a value of this property. When set to true the balloon will immediately run the method on mouse over. This is particularly useful when the balloon is used only for passive feedback and doesn't have to be dismissed. The user may want to perform some task quickly without having to wait the time specified in the while the balloon is obstructing a page element. Syntax: object.autoAway [= bValue ] Possible Values: bValue - *boolean* true / false Examples: balloonObj.autoAway=true; */ this.autoAway=autoAway; /* Property: width Sets or retrieves a value of balloon's width. The height is dynamic, the width has to be specified. Syntax: object.width [= iValue ] Possible Values: iValue - *integer* the number of pixels. Examples: balloonObj.width=325; */ this.width=blbWidth; /* Property: showCloseBox Sets or retrieves a value of whether the close balloon (right-upper corner) should be displayed. It makes sense to turn off when enabling this feature. Syntax: object.showCloseBox [= bValue ] Possible Values: bValue - *boolean* true / false Examples: balloonObj.showCloseBox=false; */ this.showCloseBox=showCloseBox; var childID; // Constructor var balloonDIV = document.createElement("DIV"); balloonDIV.style.width=String(blbWidth); balloonDIV.style.position="absolute"; balloonDIV.style.visibility="hidden"; balloonDIV.style.filter=transShowFilter+' '+transHideFilter; balloonDIV.style.zIndex=2001; /* Property: balloon Retrieves the reference to the instantiated balloon object. Syntax: [obj =] object.balloon Possible Values: obj - *object* balloon reference Examples: var obj = balloonObj.balloon; */ this.balloon=balloonDIV; // Pulic Methods this.Show=Show; this.Hide=Hide; /* Function: Show Makes the instantiated balloon appear. Balloon content note: Because SELECT objects are what's known as windowed controles they need to be hidden when balloons are shown, otherwise they will always be on top (they ignore zIndex attribute). It is normally done automatically by this control. Sometimes, however, you may want to place a drop-down inside the balloon itself. To override this default behaviour add an balloonMember expando attirbute to the SELECT you are placing withing. - e.g.