Project

General

Profile

1
 /*
2
  *   '$RCSfile$'
3
  *     Purpose: Default style sheet for admin web pages 
4
  *   Copyright: 2008 Regents of the University of California and the
5
  *               National Center for Ecological Analysis and Synthesis
6
  *     Authors: Matt Jones
7
  *
8
  *    '$Author: daigle $'
9
  *      '$Date: 2008-11-10 15:14:37 -0800 (Mon, 10 Nov 2008) $'
10
  *  '$Revision: 4544 $'
11
  *
12
  * This program is free software; you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License as published by
14
  * the Free Software Foundation; either version 2 of the License, or
15
  * (at your option) any later version.
16
  *
17
  * This program is distributed in the hope that it will be useful,
18
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
  * GNU General Public License for more details.
21
  *
22
  * You should have received a copy of the GNU General Public License
23
  * along with this program; if not, write to the Free Software
24
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
  */
26

    
27
function validateForm(form_ref) {
28
    j = form_ref.length
29
    for (i = 0; i < j; i++) {
30
        if (form_ref.elements[i].value == "") {
31
            alert("All form fields must be populated");
32
            return false;
33
        }
34
    }
35
    return true;
36
}
37

    
38
function submitForm(form_ref) {
39
//	form_ref.action.value=action;
40
//	form_ref.sessionId.value=<xsl:value-of select="$sessid" />;
41
	form_ref.submit();
42
}
43

    
44
function validateAndSubmitForm(form_ref) {
45
//	form_ref.action.value=action;
46
//	form_ref.sessionId.value=<xsl:value-of select="$sessid" />;
47
	if (!validateForm(form_ref)) {
48
		return false;
49
	}
50
	form_ref.submit();
51

    
52
}
53

    
54
function forward(location) {
55
	window.location = location;
56
}
57

    
58
function toggleHiddenRow(thisObj, id) {
59
	if (thisObj.checked) {
60
		showRow(id);
61
	} else {
62
		hideObject(id);
63
	}
64
}
65

    
66
function toggleHiddenInline(thisObj, id) {
67
	if (thisObj.checked) {
68
		showInline(id);
69
	} else {
70
		hideObject(id);
71
	}
72
}
73

    
74
function toggleHiddenTable(thisObj, id) {
75
	if (thisObj.checked) {
76
		showSection(id);
77
	} else {
78
		hideObject(id);
79
	}
80
}
81

    
82
function hideObject(objectID) 
83
{ 
84
	document.getElementById(objectID).style.display = 'none'; 
85
} 
86

    
87
function showRow(objectID) 
88
{ 
89
	document.getElementById(objectID).style.display = 'table-row'; 
90
} 
91

    
92
function showInline(objectID)
93
{
94
        document.getElementById(objectID).style.display = 'inline';
95
}
96

    
97
function showSection(objectID) 
98
{ 
99
	document.getElementById(objectID).style.display = 'table'; 
100
} 
101

    
102
function toggleHiddenDefaultText(radioName, activeSkinName) {
103
	radioList = document.getElementsByName(radioName);
104
	for (i = 0; i < radioList.length; i++) {
105
		radioId = radioList[i].id;
106
		nameArray = radioId.split("-", 1);
107
		radioSkinName = nameArray[0];
108
		if (radioSkinName == activeSkinName) {
109
			document.getElementById("hiding-default-" + radioSkinName).style.display = 'inline';
110
		} else {
111
			document.getElementById("hiding-default-" + radioSkinName).style.display = 'none';
112
		}
113
	}
114
}
115

    
116
function helpWindow(context, helpFile) {
117
	fileLoc = context + "/docs/user/" + helpFile;
118
	window.open(fileLoc,'mywindow','width=750,height=200,scrollbars=yes,location=no,status=no');
119
}
120

    
121

    
(3-3/14)