function ScrollToElement(theElement) {

	var selectedPosX = 0;
	var selectedPosY = 0;

	while (theElement != null) {
		selectedPosX += theElement.offsetLeft;
		selectedPosY += theElement.offsetTop;
		theElement = theElement.offsetParent;
	}

	window.scrollTo(selectedPosX, selectedPosY);

}

function setLocation(page) {
	location.href = page;
}

function SplitOnInput(input,output1,output2,splitstr) {
	var str = input.value;
	var i = str.indexOf(splitstr);
	if (i > -1) {
		var str1 = str.substring(0, i);
		var str2 = str.substring(i + 2);
		output1.value = str1;
		output2.value = str2;
	}
}

function place_youtube_video(youtubeID, width, height, style) {
	if (typeof width == "undefined") {
		width = 320;
	}
	if (typeof height == "undefined") {
		height = 265;
	}
	if (typeof style == "undefined") {
		style = "new";
	}
	
	var scr;
	if (style=="new") {
		scr = 	"<iframe width=\"" + width + "\" height=\"" + height + "\" src=\"http://www.youtube.com/embed/" + youtubeID + "\" frameborder=\"0\" allowfullscreen></iframe>\n";
	}
	else {
		scr = 	"<object width=\"" + width + "\" height=\"" + height + "\">\n" +
				"\t<param name=\"movie\" value=\"http://www.youtube.com/v/" + youtubeID + "&hl=nl&fs=1&color1=0x2b405b&color2=0x6b8ab6\"></param>\n" +
				"\t<param name=\"allowFullScreen\" value=\"true\"></param>\n" +
				"\t<param name=\"allowscriptaccess\" value=\"always\"></param>\n" +
				"\t<embed src=\"http://www.youtube.com/v/" + youtubeID + "&hl=nl&fs=1&color1=0x2b405b&color2=0x6b8ab6\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"" + width + "\" height=\"" + height + "\"></embed>\n" +
				"</object>\n";
	}
	document.write(scr)
}
