/*! * Copyright (C) 2012-2015 Hewlett-Packard Development Company, L.P. * * The contents of this software are proprietary and confidential to the * Hewlett-Packard Development Company, L.P. No part of this program may be * photocopied, reproduced or translated into another programming language * without prior written consent of the Hewlett-Packard Dev. Co., L.P. * */ function addLoadEvent(func) { var oldonload = window.onload; if (typeof(window.onload) != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); }; } } function addUnloadEvent(func) { var oldonunload = window.onunload; if (typeof(window.onunload) != 'function') { window.onunload = func; } else { window.onunload = function() { oldonunload(); func(); }; } } function testSessionCookie() { return true; } function writePermanentCookie(cookieName, cookieValue) { document.cookie = escape(cookieName) + "=" + escape(cookieValue) + "; path=/; expires=Mon, 01-Jan-3000 00:00:00 GMT;"; return true; } function writeSessionCookie(cookieName, cookieValue) { if (testSessionCookie()) { document.cookie = escape(cookieName) + "=" + escape(cookieValue) + "; path=/"; return true; } else { return false; } } function getCookieValue(cookieName) { var exp = new RegExp (escape(cookieName) + "=([^;]+)"); if (exp.test (document.cookie + ";")) { exp.exec (document.cookie + ";"); return unescape(RegExp.$1); } else { return false; } } var dynBlockRemoveFromCookie = 1; var dynBlockAddToCookie = 2; function updateDynBlockCookie(aTag,aClass,aOperation) { var blockID = aClass; var oldDynBlockState = getCookieValue("dynblockstate"); var newDynBlockState = ''; if (typeof(oldDynBlockState) != 'string') { oldDynBlockState = ''; } var newArray = []; switch(aOperation) { case dynBlockRemoveFromCookie: newArray = oldDynBlockState.split(' ').without(blockID); newDynBlockState = newArray.join(" "); break; case dynBlockAddToCookie: newArray = oldDynBlockState.split(' ').without(blockID); if (newArray.length == 1 && newArray[0] === "") { newArray[0] = blockID; } else { newArray[newArray.length] = blockID; } newDynBlockState = newArray.join(" "); break; } writePermanentCookie("dynblockstate",newDynBlockState); } function toggleDynamicBlock(aSpanObject,aTag,aClass) { var selectorString = aTag + ".hidable." + aClass; var togglingOn = aSpanObject.hasClassName('closed'); aSpanObject.toggleClassName('closed'); $$(selectorString).invoke('toggleClassName','closed'); /* We remember in the cookie which sections are opened. All the others are implicitly closed. */ if (togglingOn) { updateDynBlockCookie(aTag,aClass,dynBlockAddToCookie); } else { updateDynBlockCookie(aTag,aClass,dynBlockRemoveFromCookie); } } function applyDynBlockCookie() { var dynBlockHeaderList = $$('span.spanDynBlockHeader'); var dynBlockState = getCookieValue('dynblockstate'); var cookieStateArray; if (dynBlockState) { cookieStateArray = dynBlockState.split(' '); var classNameIsInCookieStateArray = function (aPageDynBlockClassName) { return cookieStateArray.include(aPageDynBlockClassName); }; var openedBlocksFinder = function(aDynBlockHeader) { return aDynBlockHeader.classNames().any(classNameIsInCookieStateArray); }; var openedBlocks = dynBlockHeaderList.findAll(openedBlocksFinder); if (openedBlocks) { openedBlocks.invoke('onclick'); } } } addLoadEvent(applyDynBlockCookie); try { document.execCommand("BackgroundImageCache",false,true); } catch(e) {} function SetFormControlsState(aFormId,aAffectedClass,aProtectedClass,aState) { updatedForm = document.getElementById(aFormId); for(elementIndex=0;elementIndex < updatedForm.elements.length;elementIndex++) { currentFormElement = updatedForm.elements.item(elementIndex); if (currentFormElement.className != aProtectedClass) { if (aAffectedClass == "anyClass") { currentFormElement.disabled = aState; } else { if (currentFormElement.className == aAffectedClass) { currentFormElement.disabled = aState; } } } } } function makeRemote(topic) { // Defines size of remote window in pixels remote = window.open("","helpwin","width=600,height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1"); if (remote.blur) remote.focus(); remote.location.href = topic ; return false; } function show(place) { window.status = place; } function showoff() { window.status = ""; }