<!--

/*  the below function is needed to enable UL/LI menu's in IE6  */
sfHover = function() {
	var nav = document.getElementById("nav");
	if (nav != null) var sfEls = nav.getElementsByTagName("LI");
	if (sfEls != null)
	{
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



function ClearTxt(theText) 
{
    if (theText.value == theText.defaultValue)
    {
        theText.value = "";
    }
}

function PageLoad(print)
{
	SetMsgTimer(10);
	ResizeNews();
	AlignRight("spreekImg", "banner", 0, 80);
	if (document.getElementById("spreekImg") != null) document.getElementById("spreekImg").style.display = "block";
	
	if (print == 1) 
	{
		window.print();
		window.close();
	}	
}

function PageResize() 
{
	AlignRight("spreekImg", "banner", 0, 80);
}	

function getElementPosition(elem)
{   
    var posX = 0;
    var posY = 0;
        
    while(elem != null)
    {
        posX += elem.offsetLeft;
        posY += elem.offsetTop;
        elem = elem.offsetParent;  
    }

    return [posX,posY];
}

function AlignRight(el_id, refEl_id, moveX, moveY)
{
    var el = document.getElementById(el_id);
    var referenceEl = document.getElementById(refEl_id);
	
	if (el != null && referenceEl != null)
	{
	    el.style.right = getElementPosition(referenceEl)[0] + moveX + 'px';
	    el.style.top = getElementPosition(referenceEl)[1] + moveY + 'px';
    }
}

function ResizeNews()
{
    var el = document.getElementById("newsOnHomepage");

    if ( el != null )
    {
        var refEl = document.getElementById("contentDiv");
        
        if (refEl != null) 
        {
	        el.style.height = refEl.offsetHeight + 8 + 'px';
        }
    }
}

function PrintPage()
{
	
	var old_url = document.location.href;

	if (old_url.indexOf("?") > 0) 
	{
		new_url = old_url + "&print=1";
	}
	else
	{
		new_url = old_url + "?print=1";
	}	

	printWindow = window.open(new_url, "print_popup", "width=820, height=600, location=0, status=0, scrollbars=0, menubar=0, toolbar=0");
}

//-->