1
//----------------------------------------------------------------------------
2
// Copyright (c) 2005 Zope Corporation and Contributors.
3
// All Rights Reserved.
5
// This software is subject to the provisions of the Zope Public License,
6
// Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
7
// THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
8
// WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
9
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
10
// FOR A PARTICULAR PURPOSE.
11
//----------------------------------------------------------------------------
13
//----------------------------------------------------------------------------
14
// popup window with settings
15
//----------------------------------------------------------------------------
16
function popup(page, name, settings) {
17
win = window.open(page, name, settings);
21
//----------------------------------------------------------------------------
22
// guess browser version, feel free to enhance it if needed.
23
//----------------------------------------------------------------------------
24
var ie = document.all != null;
25
var moz = !ie && document.getElementById != null && document.layers == null;
27
//----------------------------------------------------------------------------
28
// change the status (color) of the matrix table used in grant.html
29
//----------------------------------------------------------------------------
30
function changeMatrix(e) {
31
var ele = e? e: window.event;
32
var id = ele.getAttribute('id');
33
var name = ele.getAttribute('name');
35
var label = ele.parentNode;
36
var center = label.parentNode;
37
var td = center.parentNode;
40
var label = ele.parentElement;
41
var center = label.parentElement;
42
var td = center.parentElement;
45
if (td.className != "default") {
46
td.className = "changed";
50
function resetMatrixCSS(name) {
51
var inputFields = document.getElementsByTagName('input');
52
for (var i = 0; i < inputFields.length; i++) {
53
var field = inputFields[i];
54
if (field.getAttribute('name') == name) {
56
td = field.parentNode.parentNode.parentNode;
59
td = field.parentElement.parentElement.parentElement;
61
if (td.className != "default") {
69
//----------------------------------------------------------------------------
70
// toggle the status of all checkboxes that have class == "className"
71
//----------------------------------------------------------------------------
72
function updateCheckboxes(master, className) {
73
newState = master.checked;
74
objects = document.getElementsByTagName("input")
75
count = objects.length;
76
for(x = 0; x < count; x++) {
78
if (obj.type == "checkbox") {
79
var classes = obj.className.split(" ");
80
for (var i = 0; i < classes.length; i++)
81
if (classes[i] == className) {
82
obj.checked = newState;