// The maximum number of allowed characters
MAXINTROLENGTH = 200;

// Text to append when the text is too long (used in 'introText')
APPENDTEXT = " ...";

// Dumb function that simply shortens the text
function shortText(text) {
	return(text.substr(0, MAXINTROLENGTH));
}

// Cut the text to the maximum characters allowed and put the APPENDTEXT behind it
function introText(text) {
	var tmpTxt;
	var lastSpace;

	tmpTxt = shortText(text);
	lastSpace = tmpTxt.lastIndexOf(' ');

	if (lastSpace == -1) {
		// No space found
		tmpTxt = tmpTxt.substr(0, MAXINTROLENGTH - 4);
	} else {
		// Space found
		tmpTxt = tmpTxt.substr(0, lastSpace);
	}

	tmpTxt = tmpTxt + APPENDTEXT;

	return(tmpTxt);
}

var openwin;

function popup(href, target) {
	if (target == 'kleinvenster') {
		openwin = window.open(href, target, 'width=570,height=430,scrollbars=yes,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,left=100,top=200');
	}
 	else {
		openwin = window.open(href, target, 'scrollbars=auto,status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes');
	}
	setTimeout("openwin.focus();",300);
}
