This is an HTML version of an attachment to the Freedom of Information request 'Contract details of latest ERP Gold Programme Manager'.

/** help-start */

$(document).ready(function(){
$(".help-level>li>a").click(function(){
var li = $(this).parents('li').first();
if( $(li).hasClass('selected') ){
$(li).removeClass('selected');
$(li).find('li.selected').removeClass('selected');
$(li).find('.help-level').slideUp();
}
else{
$(li).addClass('selected');
$(li).children('div.help-level').first().slideDown();
$(li).children('ul.help-level').first().slideDown();
}
return false;
});
});

function expandRelatedSearchSection(pleaseSpecifySearch) {
var searchInput = document.getElementById("searchTextHelp");
//alert(searchInput.value);
if(searchInput.value == "") {
alert(pleaseSpecifySearch);
return false;
}
// initialze list if needed
if (allHelpTextNode== null) {
initiliazeAllHelpTextNode();
}
collapseAllSection();
// Searh for text in list
for(var i=0; i < allHelpTextNode.length; i++) {
var contenuHelpNode= allHelpTextNode[i].textContent || allHelpTextNode[i].innerText;
if (contenuHelpNode.search(new RegExp(searchInput.value, "i")) > -1) {
// result is matching - add it to the list
//alert(allHelpTextNode[i].textContent);
//alert(allHelpTextNode[i].parentNode.innerHTML);
var element = getClosestSectionToActivate(allHelpTextNode[i]);
if (element!=null) {
//alert('expandit');
$(element).addClass('selected');
$(element).children('.help-level').slideDown();
expandAllParentSections(element);
}
}
}
return false;
}
var allHelpTextNode = null;
/**
* Initialize the list of searchable text node.
*/
function initiliazeAllHelpTextNode() {
if (allHelpTextNode != null) {
return;
} else {
allHelpTextNode=[];
//var allHelpTextNodeTemp = textNodesUnder(document.getElementById("helpRootElement"));
var allHelpTextNodeTemp = $("a.helpTitle, div.help-level");
for (index = 0; index < allHelpTextNodeTemp.length; ++index) {
//alert('testing |'+allHelpTextNodeTemp[index].textContent+'|');
var contenuTempNode= allHelpTextNodeTemp[index].textContent|| allHelpTextNodeTemp[index].innerText;
var tempText = contenuTempNode.replace(/\\n/,'').trim();
if (tempText.replace(/\\n/,'').trim().length==0) {
//alert("gonna remove |"+tempText+"|");
allHelpTextNodeTemp[index].textContent='';
} else {
//alert("gonna keep |"+tempText+"|");
//allHelpTextNodeTemp[index].textContent=tempText;
allHelpTextNode.push(allHelpTextNodeTemp[index]);
}
}
}
}


function getClosestSectionToActivate(el) {
do {
if (el.nodeName === 'LI' && ((' ' + el.className + ' ').indexOf(' expcolMarker ') > -1)) {
// tag name is found! let's return it. :)
return el;
}
} while (el = el.parentNode);
// not found :(
return null;
}

/**
* Collapse all sections.
*/
function collapseAllSection() {
var listExpanded = $("div.help-accordion").find("li.selected");
$(listExpanded).removeClass('selected');
$(listExpanded).find('li.selected').removeClass('selected');
$(listExpanded).find('.help-level').slideUp();
}

/**
* Collapse all sections.
*/
function expandAllParentSections(element) {
var grandFather = element.parentNode.parentNode;
if (grandFather.id=="helpRootElement" || ((' ' + grandFather.className + ' ').indexOf(' selected ') > -1)) {
// NTD
} else {
// Expand it and check its grandFather
$(grandFather).addClass('selected');
$(grandFather).children('.help-level').slideDown();
expandAllParentSections(grandFather);
}
}

function expandHelpToPageId(pageID) {
collapseAllSection();
var pageIdList = $('#helpRootElement *').contents().filter(function() {
// take comment node inside element with id helpRootElement
return (this.nodeType == 8);
});
for (index = 0; index < pageIdList.length; ++index) {
if (pageID == (""+pageIdList[index].data).trim()) {
//alert("gonna remove |"+tempText+"|");
var element = getClosestSectionToActivate(pageIdList[index]);
if (element!=null) {
//alert('expandit');
$(element).addClass('selected');
$(element).children('.help-level').slideDown();
expandAllParentSections(element);
}
break;
}
}
}

if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}