function init() {
	
	// Fetch all the a elements in the document.
	var links = document.getElementsByTagName('a');

	// Loop through the a elements in reverse order
	// for speed.
	for (var i = links.length; i != 0; i--) {
		
		// Pull out the element for this iteration.
		var a = links[i-1];
		
		// If the element doesn't have an href, skip it.
		if (!a.href) continue;

		// If the element has a className that contains
		// 'external' attach the onclick handler.			
		if (!a.href.indexOf('http:\/\/') && a.href.indexOf('http:\/\/www.primoschiedam.nl') && a.href.indexOf('http:\/\/localhost:8080') && a.href.indexOf('http:\/\/uat.pareto.nl')) a.onclick = PopWin;
	}
}

function PopWin(e) {

	// Accommodate IE's non-standard event handling.
	if (!e) var e = window.event;
	var a = e.target ? e.target : e.srcElement;

	// Open a new window with the link's href.
	var newwin = window.open(a.href);

	// The thought is that if the new window didn't
	// (popups blocked or whatever) we want to return
	// true so the link is follow normally. Not sure
	// if this works, but it doesn't seem to hinder.
	return !newwin;                               
}

onload = init;

// Get the viewport height for all kind of browsers
function getWindowHeight() {
	var windowHeight;
	if (self.innerHeight) // all except Explorer
	{
		windowHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		windowHeight = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		windowHeight = document.body.clientHeight;
	}
	return windowHeight;
}

function onResizeHandler()
{
	if (document.getElementById) {
		var windowHeight2 = getWindowHeight();
		var maincolElement = document.getElementById('maincol');
		maincolElement.style.height = (windowHeight2 - 50) + 'px';
	}
}

window.onresize = onResizeHandler;
window.onload = onResizeHandler;
