window.onload = function()
{
	// Start the form
	oReq = new RequestForm();
	// also start the tooltips
	new Tooltip();
	// and the calculation
	oCalc = new CalculatePrize();
	oCalc.start( oReq );
	oReq.start();
}

function moreInfo( sType )
{
	var overlay = document.getElementById( 'overlay' );
	var box = document.getElementById( sType );
	if( overlay && box )
	{
		overlay.style.display = 'block';
		box.style.display = 'block';
		
		var container = box.parentNode;
		container.overlay = overlay;
		container.box = box;
		container.onclick = function()
		{
			this.box.style.display = 'none';
			this.overlay.style.display = 'none';
		}
		
		var button = document.getElementById( sType + 'button' );
		if( !button )
		{
			button = document.createElement( 'P' );
			button.id = sType + 'button';
			button.className = 'boxbutton';
			button.innerHTML = '<span>sluiten</span>';
			button.onmouseover = function()
			{
				this.className += ' hover';
			}
			button.onmouseout = function()
			{
				this.className = this.className.replace(/ hover/g, '');
			}
			box.insertBefore( button, box.childNodes[ 0 ] );
		}
	}
}
function getCookie(name)
	{
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1)
		{
			begin = dc.indexOf(prefix);
			if (begin != 0)
				return null;
		}
		else
			begin += 2;
		var end = document.cookie.indexOf(";", begin);
		if (end == -1)
			end = dc.length;
		return unescape(dc.substring(begin + prefix.length, end));
	}
