function videoLink (text, link)
{
	var onClick = "onclick=\"goToVideo('videos/" + link + "'); return true;\" ";
	document.write ("<div id=\"doc_videoLink\"><a " + onClick + ">" + text + "</a></div>\n");
}

function createElement (el) 
{
	return (typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", el) : document.createElement(el);
}

function goToVideo (link)
{
	var elm = document.getElementById("doc_right");
	while(elm.hasChildNodes()) {
		elm.removeChild(elm.firstChild);
	}
	var embed = createElement("object");
	embed.setAttribute("type", "application/x-shockwave-flash");
	embed.setAttribute("width", 676);
	embed.setAttribute("height", 524); // 504 + 20
	embed.setAttribute("data", "player.swf");
	embed.setAttribute("id", "doc_video");
	embed.setAttribute("allowscriptaccess", "always");
	embed.setAttribute("allowfullscreen", "true");
	embed.setAttribute("flashvars", "file=" + link + "&searchbar=false&autoStart=true");
	
	elm.appendChild(embed);
}

function sectionStart (text)
{
	var onClick = "onclick=\"toggleDisplay(this.parentNode.childNodes[2]); return true;\" ";
	document.write ("<div id=\"doc_section\"><a " + onClick + ">" + text + "</a>\n");
	document.write ("<div id=\"doc_subsection\">\n");
}

function toggleDisplay (elm)
{
	if (elm.style.display == "block")
		elm.style.display = "none";
	else
		elm.style.display = "block";
}