Project

General

Profile

Download (1.61 KB) Statistics
| Branch: | Tag: | Revision:
1
function fr_toggle(id) {
2
	var checkbox = document.getElementById('frc' + id);
3
	checkbox.checked = !checkbox.checked;
4
	fr_bgcolor(id);
5
}
6
function fr_bgcolor(id) {
7
	var row = document.getElementById('fr' + id);
8
	var checkbox = document.getElementById('frc' + id);
9
	var cells = row.getElementsByTagName('td');
10
	var cellcnt = cells.length;
11

    
12
	for (i = 0; i < cellcnt; i++) {
13
		// Check for cells with frd id only
14
		if (cells[i].id == "frd" + id)
15
			cells[i].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#FFFFFF";
16
	}
17
	//cells[7].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#990000";
18
}
19
function fr_insline(id, on) {
20
	var row = document.getElementById('fr' + id);
21
  var prevrow;
22
	if (id != 0) {
23
		prevrow = document.getElementById('fr' + (id-1));
24
	} else {
25
		prevrow = document.getElementById('frheader');
26
	}
27

    
28
	var cells = row.getElementsByTagName("td"); 
29
	var prevcells = prevrow.getElementsByTagName("td");
30
	
31
	for (i = 0; i <= prevcells.length - 1; i++) {
32
		if (prevcells[i].id == 'frd' + (id-1)) {
33
			if (on) {
34
				prevcells[i].style.borderBottom = "3px solid #990000";
35
				prevcells[i].style.paddingBottom = ((id != 0) ? 2 : 3) + "px";
36
			} else {
37
				prevcells[i].style.borderBottom = "1px solid #999999";
38
				prevcells[i].style.borderBottomWidth = "1px";
39
				prevcells[i].style.paddingBottom = ((id != 0) ? 4 : 5) + "px";
40
			}
41
		}
42
	}
43

    
44
	for (i = 0; i <= cells.length - 1; i++) {
45
		if (cells[i].id == 'frd' + (id)) {
46
			if (on) {
47
				cells[i].style.borderTop = "2px solid #990000";
48
				cells[i].style.paddingTop = "2px";
49
			} else {
50
				cells[i].style.borderTopWidth = 0;
51
				cells[i].style.paddingTop = "4px";
52
			}
53
		}
54
	}
55
}
(12-12/15)