
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 areYouSure(text)
{
     return confirm(text);
}

function toggleProcedure(currProcedure) {
		thisProcedure = document.getElementById("procedure"+currProcedure).style;
		thisExpander = document.getElementById("expander"+currProcedure);
		if (thisProcedure.display == "block") {
			thisProcedure.display = "none";
			thisExpander.src = "http://aimex.dev.go4.com.au/themes/aimex/images/expand.gif";
		}
		else {
			thisProcedure.display = "block";
			thisExpander.src = "http://aimex.dev.go4.com.au/themes/aimex/images/collapse.gif";
		}
}

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;
        }
    }
}
