1 Object.defineProperty(Element.prototype, 'outerHeight', {
3 var height = this.clientHeight;
4 height += getStyle(this,'marginTop');
5 height += getStyle(this,'marginBottom');
6 height += getStyle(this,'borderTopWidth');
7 height += getStyle(this,'borderBottomWidth');
12 if (document.addEventListener) {
13 document.addEventListener('DOMContentLoaded', function () {
14 var height = document.querySelector("#footer").outerHeight;
15 document.querySelector("#inner").setAttribute("style",
16 "margin-bottom:" + height.toString()+ "px");
19 window.attachEvent("onload", function () {
20 var height = document.querySelector("#footer").outerHeight;
21 document.querySelector("#inner").setAttribute("style",
22 "margin-bottom:" + height.toString()+ "px");
28 function getStyle(el, prop) {
29 var result = el.currentStyle ? el.currentStyle[prop] :
30 document.defaultView.getComputedStyle(el,"")[prop];
31 if (parseInt(result,10))
32 return parseInt(result,10);
37 function divVisibility(divID) {
38 var element = document.querySelector("#"+divID);
39 if (element.style.display=="block")
40 element.style.display="none";
42 element.style.display="block";
45 function datesURL(histPage) {
47 var yearStart = document.querySelector('#yearStart').value;
48 var yearEnd = document.querySelector('#yearEnd').value;
49 var monthStart = document.querySelector('#monthStart').value;
50 var monthEnd = document.querySelector('#monthEnd').value;
51 if (monthStart.length == 1) monthStart = 0 + monthStart;
52 if (monthEnd.length == 1) monthEnd = 0 + monthEnd;
54 validated &= validateYear(yearStart);
55 validated &= validateYear(yearEnd);
56 validated &= validateMonth(monthStart);
57 validated &= validateMonth(monthEnd);
59 if (validated) window.location=histPage+"&dates="+yearStart+monthStart+"-"+yearEnd+monthEnd;
60 else alert("Please correct your date selections");
63 function userFilter(approvalPage) {
64 var user = document.querySelector('#userTextBox').value;
66 window.location=approvalPage+"?user="+user;
68 window.location=approvalPage;
71 function validateYear(year) {
72 var today = new Date();
73 if (year >= 1900 && year <= today.getFullYear()) return true;
77 function validateMonth(month) {
78 if (month) return true;
82 function alterLink(breadcrumbToFind, newTarget) {
83 var breadcrumbs = document.querySelector("#breadcrumbs").getElementsByTagName("A");
84 for (var i=0; i< breadcrumbs.length;i++) {
85 var breadcrumbHref = breadcrumbs[i].getAttribute('href');
86 if (breadcrumbHref.indexOf(breadcrumbToFind)>-1)
87 breadcrumbs[i].setAttribute('href', newTarget);
91 // clipBoardData object not cross-browser supported. Only IE it seems
92 function copyToClipboard(controlId) {
93 var control = document.getElementById(controlId);
94 if (control == null) {
95 alert("ERROR - control not found - " + controlId);
97 var controlValue = control.href;
98 window.clipboardData.setData("text/plain", controlValue);
99 alert("Copied text to clipboard : " + controlValue);