/* wizard.js Version Date 7 Developer Notes 1.0 23. Dec 2002 Nicolai Lyng Als (NL) Initial version supported by IE 5.5 and 6.0 (Not tested on Mac IE). 1.1 3. Jan 2003 Nicolai Lyng Als (NL) Added keyboard control of stepsmenu using arrows up and down or/and tab key. 1.2 5. Feb 2003 Nicolai Lyng Als (NL) Added multible steps in one HTML page by using toggleWizard function. 1.21 11. Mar 2003 Nicolai Lyng Als (NL) Added support for homepage frameset. 1.22 2. Apr 2003 Nicolai Lyng Als (NL) Additional support and bugfixes of homepage imagefile structure. 1.3 3. Apr 2003 Nicolai Lyng Als (NL) Added language support. 1.31 21. Maj 2003 Claus Witt (CWI) Changes to reflex moving dnbnetstyr to top 1.32 25. Jun 2003 Nicolai Lyng Als (NL) Moving js to topframe and implementing proxy in top.logo. 1.40 1. Jul 2003 Nicolai Lyng Als (NL) Added support for removing the helparea on intranet applications. 1.41 17. Okt 2003 Nicolai Lyng Als (NL) Added disable '?' functionality, Tooltip on numbers and up to 15 steps on intranet. 1.50 1. Sep 2004 Nicolai Lyng Als (NL) Support for altenate browsers Mozilla, Netscape, Safari, Opera + userbility. wizard.js is a frontend javascript/dhtml component, which generates a wizard dialogframework, for the developers in Danske Bank. This dialogframework is optimized for use in applikation, which need controlled steps and a posibility for getting imiate help. For each step, it is possible to specify whereto the user can navigate, thus controlling the workflow. Navigation is done via javascript or specifying Objects and Actions in Netstyr. The component uses following frameset-functions and variables: Function/variable Description getBrand(); function in top.logo (intranet-portal), which returns brand string ex. BG or DB. brand function in top (internetframeset), which contains brand string ex. BG or DB. framesetpath variable in top (internetframeset), which contains full current framesetpath. gsBrand function in top (homepageframeset), which contains brand string ex. BG or DB. domain_domino variable in top (homepageframeset), which contains server path. jsframe variable in dnbnetstyr.js/usfkb1.js which contains path to dnbnetstyr frame. ImgPath variable in dnbnetstyr.js/usfkb1.js which contains path to image lib. */ // Global variables var glWizardTargetFrame; var glWizardMainArray; var glWizardSize; var glWizardSubLevel; var glWizardEndPage; var glWizardStepsMenuItemArray=new Array(); var glWizardStepsMenuAvailableItemsArray=new Array(); var glWizardBrandPath; var glWizardLastCreated; var glWizardHelpArea; var glWizardTabToNext; // Wizard object top function wizardObjBegin(wizardId,wizardSize,wizardHeadline,wizardHelpString,wizardMainArray,wizardSubLevel,wizardEndPage,wizardTarget,wizardHelpArea,wizardeLearningLink){ // getting brand from frameset, to use in inserting correct image paths. if ("" + top.brand == "undefined" && "" + top.gsBrand == "undefined"){ // intranet portal wizardBrand = top.logo.getBrand(); } else if ("" + top.brand == "undefined") { // homepage frameset wizardBrand = top.gsBrand; } else { // netbank frameset wizardBrand = top.brand; } glWizardBrandPath = wizardBrand.toUpperCase(); // preparing wizard for working in different frames/iframes. if ("" + wizardTarget == "undefined" || "" + wizardTarget == ""){ wizardTarget = "" + targetFrame; } else { wizardTarget = wizardTarget + "."; } setWizardTargetFrame(wizardTarget); // setting incoming wizardMainArray in global variable for use in wizardObjEnd() setWizardMainArray(wizardMainArray); // setting incoming wizardSize in global variable for use in wizardObjEnd() setWizardSize(wizardSize); // setting incoming wizardSubLevel in global variable for use in wizardSubLevel() if ("" + wizardSubLevel == "undefined" || "" + wizardSubLevel == ""){ setWizardSubLevel(false); } else if (wizardSubLevel == true || wizardSubLevel == false){ setWizardSubLevel(wizardSubLevel); } else { alert("Invalid parameter - wizardSubLevel"); } // setting incoming wizardEndPage in global variable for use in wizardEndPage() if ("" + wizardEndPage == "undefined" || "" + wizardEndPage == ""){ setWizardEndPage(false); } else if (wizardEndPage == true || wizardEndPage == false){ setWizardEndPage(wizardEndPage); } else { alert("Invalid parameter - wizardEndPage"); } // setting incoming wizardHelpArea in global variable for use in wizardHelpArea() if ("" + wizardHelpArea == "undefined" || "" + wizardHelpArea == ""){ setWizardHelpArea(true); } else if (wizardHelpArea == true || wizardHelpArea == false){ setWizardHelpArea(wizardHelpArea); } else { alert("Invalid parameter - wizardHelpArea"); } // checking for invalid wizardHelpArea parameter if (getWizardHelpArea()==false && getWizardEndPage()== true){ alert("Invalid parameter - wizardHelpArea - Help Area must be added on confirmation page"); } // setting document attribute to simulate IE document.activeElement in other browsers eval("" + getWizardTargetFrame() + "document.body.setAttribute('activeElement','undefined')"); // preparing and setting first wizard active/displayed if multible steps on one page, // attaching event to document . Done only once a page. glWizardLastCreated = wizardId; eval("wizardAttr = " + getWizardTargetFrame() + "document.body.getAttribute('glWizardActive')"); if("" + wizardAttr == "undefined" || "" + wizardAttr == "null" || "" + wizardAttr == "" ){ // setting global variable glWizardActive to active wizard step. eval("" + getWizardTargetFrame() + "document.body.setAttribute('glWizardActive','" + wizardId + "')"); // IE - attaching event to document to close stepsmenu on click and scroll. /* SVEKN Changed from try catch sentence to a if sentence */ if(document.attachEvent) { eval(getWizardTargetFrame() + "document.attachEvent('onmouseup'," + jsframe + "closeWizardStepsMenu);"); eval(getWizardTargetFrame() + "window.attachEvent('onscroll'," + jsframe + "closeWizardStepsMenu);"); // IE - attaching event to document to tap stepsmenu on arrowkeys. eval(getWizardTargetFrame() + "document.attachEvent('onkeyup'," + jsframe + "keybControllWizardStepsMenu);"); } else { // attaching event to document to close stepsmenu on click and scroll. eval(getWizardTargetFrame() + "document.addEventListener('click', " + jsframe + "closeWizardStepsMenu, true);"); eval(getWizardTargetFrame() + "window.addEventListener('scroll'," + jsframe + "closeWizardStepsMenu, false);"); // attaching event to document to tap stepsmenu on arrowkeys. eval(getWizardTargetFrame() + "document.addEventListener('keyup'," + jsframe + "keybControllWizardStepsMenu, false);"); } /* SVEKN Changed from try catch sentence to a if sentence */ // setting attribute to prevent further event attachment and display on next wizardsteps. wizardAttr = wizardId; } else { } // creating wizardHelpArray for use in CreateRubrikObj if ("" + wizardHelpString == "undefined" || "" + wizardHelpString == ""){ wizardHelpArray = ""; } else { wizardHelpArray = new Array("Hjælp","H",wizardHelpString,""); } // creating toggle span start str = ""; if (wizardAttr == wizardId){ if (getWizardHelpArea()){ str += ""; } else { str += ""; } } else { if (getWizardHelpArea()){ str += "