function Trim(value)
{
	return value.replace(/^\s+|\s+$/g, '');
}

// writes a link
function WriteLink(sLink, sTarget, sText)
{
	document.write('<a href="' + sLink + '" target="' + sTarget + '">' + sText + '</a>');
}

// writes a break
function WriteBreak()
{
	document.write('<br/>');
}

// checks if a redirect is needed to the master page
function checkFrame()
{
	// if parent doesn't have at least one frame, check if redirection is needed
	if (self.parent.frames.length < 1)
	{
		// only redirect when on koster.nl
		if(self.location.hostname == 'www.koster.nl')
		{
			var whoami = self.location.href;
			var whereto = "http://www.koster.nl/?mode=link&url=" + whoami;

			// redirect
			self.parent.location = whereto;
		}
	}
}

// expands/collapses the container with the given ID
function ExpandCollapseContent(e, inputId)
{
	if(!inputId) inputId = this.id;

	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var contentContainer = document.getElementById('contentContainer' + numericId);

	// determine whether to expand or to collapse	
	if((!contentContainer.style.display) || (contentContainer.style.display == 'none'))
	{
		contentContainer.style.display = 'block';
		contentContainer.style.visibility = 'visible';
	}
	else
	{
		contentContainer.style.display = 'none';
		contentContainer.style.visibility = 'hidden';
	}
}

/*
// determines and returns the language of the browser
function browserLanguage()
{
	var b_lang;

	if (window["navigator"])
	{
		if (navigator.language)
		{
			b_lang = navigator.language;
		}
		else if (navigator.userLanguage)
		{
			b_lang = navigator.userLanguage;
		}
	}

	if (blang != undefined)
	{
		return b_lang;
	}
	else if (blang.substring(0,2) != undefined)
	{
		return b_lang.substring(0,2);
	}
	else
	{
		// if no language, return Dutch
		return "nl";
	}
}
*/