function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

addLoadEvent(externalLinks);
function externalLinks() {
	if (!document.getElementsByTagName) return;  var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
	}
}

function createWindow(width,height,type,page)
{
    var URL = page;
    var windowName = type.value;
    var xOffset = 150;
    var yOffset = 150;
    var features =
        'width='         + width +
        ',height='       + height +
        ',left='         + xOffset +
        ',top='          + yOffset +
        ',directories=0' +
        ',location=0'    +
        ',menubar=0'     +
        ',scrollbars=0'  +
        ',status=0'      +
        ',toolbar=0'     +
        ',resizable=0'

    window.open(URL, windowName, features);
}