
window.onload = initialise;

function initialise()  {
    var x = document.getElementsByTagName('a');
    for (var i=0;i<x.length;i++) {
	if (x[i].getAttribute('type') == 'popup') {
		x[i].onclick = function () {
			return pop(this.href)
		}
		x[i].title += ' (Popup)';
	}
    }
}

function pop(url) {
	newwindow=window.open(url,'name','height=500,width=500');
	if (window.focus) {newwindow.focus()}
	return false;
}
function popscroll(url) {
	newwindow=window.open(url,'name','height=300,width=450,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}
function popmap(url) {
	newwindow=window.open(url,'name','height=300,width=500');
	if (window.focus) {newwindow.focus()}
	return false;
}
   
function areYouSure(text)
{
     return confirm(text);
}

function setActiveStyleSheet(title) {
    var i, a, main;
    for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
            a.disabled = true;
            if(a.getAttribute("title") == title) a.disabled = false;
        }
    }
}

function show(id) {
    document.getElementById(id).style.display = "block";
}

function hide(id) {
    document.getElementById(id).style.display = "none";
}

function toggleVisible(id) {
    myElement = document.getElementById(id);
    if(myElement.style.display == "none") {
        myElement.style.display = "block";
    } else {
        myElement.style.display = "none";
    }
}

