
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 openWin(myURL, w, h) {
	var winprops = 'height=' + h + ',width=' + w;
	window.open(myURL.href, "win"+(new Date()).getSeconds(), winprops + 'resizable=yes, scrollbars=yes, status=yes ');   
	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";
    }
}

var _PAGE="";
    _PAGE=""; /* Specify an actual page if you don't want to use the popup code. */

var _CONTENT=""; /* this holds the data to write if no external html file is used */

function popImage(image, nothing){
	
	popWindow=window.open('about:blank','',"location=0,scrollbars=auto,width=0,height=0,resizeable=1");
	popWindow.moveTo(100,100);
    popWindow.document.write('<body onBlur="window.close();"><div style="position: absolute; width: 100%; height: 100%; z-index: 1; left:0px; top:0px"><table cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="center"><img title="Click To Close Window" id="IMG" onclick="window.close();" onload="window.resizeTo(this.width+5,this.height+50);" src="'+image+'"></td></tr></table></div></body>');

}