var null_element;

function _GetElementById(id) {
	if (document.getElementById(id)) {
		return document.getElementById(id);
	} else if (document.all) {
		return document.all[id];
	} else if (document.layers && document.layers[id]) {
		return (document.layers[id]);
	} else {
		return null_element;
	}
}

function openCentered(url,name,width,height){
	var WW = width;
	var HH = height;
	var TT = screen.height / 2 - HH / 2;
	var LL = screen.width / 2 - WW / 2;
	var opts = 'width='+WW+',height='+HH+',top='+TT+',left='+LL+',innerWidth='+WW+',innerHeight='+HH+',status=no,scrollbars=yes,resizable=no,menubar=no,copyhistory=no,toolbar=no,location=no,directories=no';
	var new_window = window.open(url,name,opts);
	new_window.focus();
	if( typeof( new_window.innerWidth ) == 'number' ) {
		//Non-IE
		new_window.innerWidth = WW;
		new_window.innerHeight = HH;
	} else if( new_window.document.documentElement && ( new_window.document.documentElement.clientWidth || new_window.document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		new_window.document.documentElement.clientWidth = WW;
		new_window.document.documentElement.clientHeight = HH;
	} else if( new_window.document.body && ( new_window.document.body.clientWidth || new_window.document.body.clientHeight ) ) {
		//IE 4 compatible
		new_window.document.body.clientWidth = WW;
		new_window.document.body.clientHeight = HH;
	}
}

function onPreload(aImages, nImages)
{
	StartScroll();
}

function externalLinks() {

	if (!document.getElementsByTagName) return;

	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		var relvalue = anchor.getAttribute("rel");

		if (anchor.getAttribute("href")) {
			var external = /external/;
			var relvalue = anchor.getAttribute("rel");
			if (external.test(relvalue)) { anchor.target = "_blank"; }
		}
	}
}
