setHelp.html

<HTML>

<HEAD>

<script>var dFrameFilePath = '../../../../../dFrame/'</script>

<script language="Javascript" src="../../../../../dFrame/dFrame/lib/DFrameAPI.js"></script>

<script language="Javascript">

//Style

DFrameAPI.include('../../ExamplesStyles/blue/styleBlue.js', 'A')

//Global

var baseAll, dFramePage, dFrameHelp, helpIndex

DFrameAPI.onLoad = function(){

//Set the DFrame for Help

DFrameAPI.setHelpDFrame('openHelp()')

//Set the default URL for Help

DFrameAPI.setDefaultHelpURL('./setHelp/welcome.html')

//2 other features for Help:

// add standard Button for Help: Done in DFrame creations

// set the URL for each document: In the onLoadDFrame function of each document

baseAll = new DFrame([5, 5, 85, 85], 'setHelp.html', dFrameStyle)

baseAll.addTaskBar()

baseAll.addButton('Open a dFrame with document 1', 'createDFrame("./setHelp/document1.html")')

baseAll.addButton('Open a dFrame with document 2', 'createDFrame("./setHelp/document2.html")')

baseAll.show()

}

function createDFrame(url) {

if (!dFramePage) {

dFramePage = new DFrame([30, 30, 70, 70], '', dFrameStyle, baseAll)

dFramePage.addStdButton('Close', 'CLOSE')

dFramePage.addStdButton('Help', 'HELP')

}

dFramePage.setURL(url)

//Reset the helpURL: It will be set (if any) by the onLoadDframe function of each page

dFramePage.setHelpURL('')

}

function openHelp() {

//Create all the context for help

//but returns dFrameHelp as target for DFrameAPI.setHelpDFrame

if (!dFrameHelp) {

//Create the base for Help

baseHelp = new DFrame([10, 10, 90, 90], 'baseHelp', dFrameStyle);

baseHelp.addStdButton('Close', 'CLOSE')

baseHelp.addTaskBar()

//Left side: Index

helpIndex= new DFrame([0, 0, 30, 100], 'index.html', dFrameStyle, baseHelp);

helpIndex.setURL('./setHelp/helpIndex.html')

helpIndex.setTitleBarHeight(0)

//For links in Index

helpIndex.setTarget('openHelpRightPage()')

helpIndex.addToTaskBars(false)

//dFrameHelp is opened in a separate function as it is also the target for helpIndex

dFrameHelp = openHelpRightPage()

}

return dFrameHelp

}

function openHelpRightPage() {

var pos = [40, 0, 100, 100]

pos[0] = [helpIndex, 'RIGHT', 0]

dFrameHelp = new DFrame(pos, 'dFrameHelp', dFrameStyle, baseHelp);

dFrameHelp.setTitleBarHeight(0)

dFrameHelp.addToTaskBars(false)

return dFrameHelp

}

</script>

</HEAD>

</HTML>