3 Copyright (C) 2005 Deryck Hodge <deryck@samba.org>
5 JS functions for tweaking page styles, forms, etc.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 function changeMirror(mirrorChoice)
24 mirrorSite = mirrorChoice.options[mirrorChoice.selectedIndex].value;
26 if (mirrorSite != "") {
27 document.location.href = mirrorSite;
31 function setContentLen()
33 var content = document.getElementById('content');
38 if (document.getElementById('links')) {
39 sidebar = document.getElementById('links');
40 } else if (document.getElementById('countries')) {
41 sidebar = document.getElementById('countries');
42 } else if (document.getElementById('nav')) {
43 sidebar = document.getElementById('nav');
46 // Get the sidebar height as integer
48 contentY = content.offsetHeight;
49 sidebarY = sidebar.offsetHeight;
51 contentY = window.getComputedStyle(content, '').getPropertyValue('height');
52 sidebarY = window.getComputedStyle(sidebar, '').getPropertyValue('height');
53 contentY = parseInt(contentY.slice(0,-2));
54 sidebarY = parseInt(sidebarY.slice(0,-2));
57 // Allow for the extra top margin value
58 if (document.getElementById('links') ||
59 document.getElementById('nav')) {
60 sidebarY = sidebarY + 115;
61 } else if (document.getElementById('countries')) {
62 sidebarY = sidebarY + 240;
65 if (sidebarY + 50 > contentY) {
66 content.style.height = sidebarY.toString() + 'px';