// JavaScript Document
//browser detection
var isIE = false;
var isSafari = false;
if (navigator.appName.toUpperCase() == "MICROSOFT INTERNET EXPLORER") {
isIE = true;
}
if (navigator.vendor) {
if (navigator.vendor.substring(0,5).toUpperCase() == "APPLE") { //Safari
isSafari = true;
}
}
function addBrowserStylesheets() {
if (isSafari) {
document.writeln('');
}
}
//global variables
function pageResized() { //unused
return;
var body_element = document.getElementsByTagName("body")[0];
document_height = body_element.offsetHeight;
var winH;
if (window.innerHeight) {
winH = window.innerHeight;
} else if (document.body.offsetHeight) {
winH = document.body.offsetHeight;
} else {
winH = 0;
}
var maxH;
if (winH > document_height) {
maxH = winH;
} else {
maxH = document_height;
}
document.getElementById('background_div').style.height = maxH + "px";
document.getElementById('bg_bottom').style.visibility = "visible";
window.setTimeout(pageResized,500); //called after page is fully rendered
//window.setInterval(pageResized,1000);
}
function pageLoaded() {
/*
this function is called immediately after the page has finished loading.
*/
pageResized();
window.onresize = pageResized;
if (isIE) {
fixIEmenu();
}
}
function fixIEmenu() {
/*
emulate
display: table-cell;
vertical-align: middle;
set in the IE stylesheet
if, by the time you are reading this, IE properly supports "display: table-*" and "vertical-align: middle",
you may want to remove this and the respective overrides in ie.css
*/
var anchors = document.getElementsByTagName("a");
var h2s = document.getElementsByTagName("h2");
for (var i = 0; i < anchors.length; ++i) {
if (isInMenu(anchors[i])) {
if (anchors[i].parentNode.tagName != "H2") {
anchors[i].innerHTML =
"
"+anchors[i].innerHTML+"
";
} else {
anchors[i].innerHTML =
"
"+anchors[i].innerHTML+"
";
}
}
}
for (var i = 0; i < h2s.length; ++i) {
if (isInMenu(h2s[i]) && (h2s[i].firstChild.tagName != "A")) {
h2s[i].innerHTML =
"
"+h2s[i].innerHTML+"
";
}
}
}
function activateLink(link_element) {
/* emulates link behaviour for IE, just another Microsoft brain damage */
var h = link_element.href;
var t = link_element.target;
if (t == "_blank") {
window.open(h);
} else {
document.location = h;
}
}
function isInMenu(element) {
//recursively test if an element is part of "menu"
if (element.id == "menu") {
return true;
}
if (!element.parentNode) {
return false;
} else {
return isInMenu(element.parentNode);
}
}
function findPos(obj) { //returns the position of obj in [x,y]. Recursive implementation =)
if ((obj.offsetParent) && (obj.offsetParent.tagName != "BODY") && (obj.offsetParent.tagName != "body")
&& (obj.offsetParent.tagName != "HTML") && (obj.offsetParent.tagName != "html")) {
return [findPos(obj.offsetParent)[0]+obj.offsetLeft, findPos(obj.offsetParent)[1]+obj.offsetTop];
} else {
return [obj.offsetLeft, obj.offsetTop];
}
}