// You can find general instructions for this file here:
// http://www.treeview.net
// Intructions on how to add checkboxes to a tree are only provided in this file.

USETEXTLINKS = 1   // Change to 0 if don't want the link on text  
STARTALLOPEN = 0
HIGHLIGHT = 0
PERSERVESTATE = 1
USEICONS = 0
USEFRAMES = 0

// In this case we want the whole tree to be built,
// even those branches that are closed. The reason is that
// otherwise some form elements might not be built at all
// before the user presses "Get Values"
BUILDALL = 1

// This configuration file is used to demonstrate how to add checkboxes to your tree.
// If your site will not display checkboxes, pick a different configuration file as 
// the example to follow and adapt.

// Notes:
// If you are going to set USEICONS = 1, then you will want to edit the gif files and 
// remove the white space on the right


// Auxiliary functions for the contruction of the tree
// You will mcertainly want to change these functions for your own purposes

// If you want to add checkboxes to the folder you will have to create a function 
// similar to this one to do that and call it below in the tree construction section

// These functions are directly related with the additional JavaScript in the 
// page holding the tree (demoCheckbox.html), where the form handling code
// resides
function generateCheckBox(parentfolderObject, itemLabel, checkBoxDOMId) {
	var newObj;

	// Read the online documentation for an explanation of insDoc and gLnk,
    // they are the base of the simplest Treeview trees
	newObj = insDoc(parentfolderObject, gLnk("R", itemLabel, "javascript:parent.op()"))

    // The trick to show checkboxes in a tree that was made to display links is to 
	// use the prependHTML. There are general instructions about this member
    // in the online documentation
	newObj.prependHTML = '<td align="left" valign="middle"><input type="checkbox" class="treeBox" id='+checkBoxDOMId+'></td>'
}

// Function similar to the above, but instead of creating checkboxes, it creates
// radio buttons
function generateRadioB(parentfolderObject, itemLabel, checkBoxDOMId) {
	var newObj;

	// Read the online documentation for an explanation of insDoc and gLnk,
    // they are the base of the simplest Treeview trees
	newObj = insDoc(parentfolderObject, gLnk("R", itemLabel, "javascript:parent.op()"))

    // The trick to show checkboxes in a tree that was made to display links is to 
	// use the prependHTML. There are general instructions about this member
    // in the online documentation
	newObj.prependHTML = '<td align="left" valign="middle"><input type="radio" class="treeBox" name="SItype" id='+checkBoxDOMId+'></td>'
}


// Construction of the tree

foldersTree = gFld("Expand and choose")
foldersTree.treeID = "checkboxTree"
aux1 = insFld(foldersTree, gFld("Species", "javascript:undefined"))
generateCheckBox(aux1, "Arabidopsis", "AT")
generateCheckBox(aux1, "Medicago", "MT")
generateCheckBox(aux1, "Lotus", "LJ")
generateCheckBox(aux1, "Rice", "OS")
// generateCheckBox(aux1, "Maize", "ZM")
aux2 = insFld(foldersTree, gFld("AS events", "javascript:undefined"))
generateRadioB(aux2, "AltD, Alt. Donor", "AltD")
generateRadioB(aux2, "AltA, Alt. Acceptor", "AltA")
generateRadioB(aux2, "AltP, Alt. Position", "AltP")
generateRadioB(aux2, "Exon Skipping", "ExonS")
generateRadioB(aux2, "Intron Retention", "IntronR")
aux3 = insFld(foldersTree, gFld("More intron categories", "javascript:undefined"))
//generateRatioB(aux3, "Short intron", "Short")
generateRadioB(aux3, "Long intron", "Long")
generateRadioB(aux3, "U12 intron", "U12")
generateRadioB(aux3, "Noncanonical intron", "NCI")

//Bing-Bing Note: To change the tree structure, it is necessary to add/remove entries above, as well as change the file ../phplib/treeHead.php and ../perlib/ASIPsite.pl correspondingly. 4/4/2005

