function ShowVideoPlayer(splashFile, mainFile) {

	// get the content of the target box
	var player = document.getElementById("video-player");

	// erase any existing content from the target box
	while(player.hasChildNodes()) {
		player.removeChild(player.childNodes[0]);
	}
	
	// generate the HTML code
	var str = '';
	str += '<object type="application/x-shockwave-flash" data="/video/video-player.swf" width="400" height="295">' + '\n';
	str += '    <param name="movie" value="/video/video-player.swf" />' + '\n';
	str += '    <param name="allowScriptAcess" value="sameDomain" />' + '\n';
	str += '    <param name="FlashVars" value="splashFile=' + splashFile + '&amp;mainFile=' + mainFile + '&amp;playerSkin=' + playerSkin + '&amp;bgColor=' + bgColor + '" />' + '\n';
	str += '    <a href="http://www.adobe.com/" title="Get Adobe Flash Player"><img src="/images/no-flash.jpg" width="400" height="295" alt="Get Adobe Flash Player" /></a>' + '\n';
	str += '</object>' + '\n';

	// insert the HTML code into the document
	if(document.createRange) {
		// for most browsers
		rng = document.createRange();
		rng.setStart(player, 0);
		htmlFrag = rng.createContextualFragment(str);
		player.appendChild(htmlFrag);
	} else {
		// for Internet Explorer
		player.innerHTML = str;
	}

}

function ShowPlaylistItem(splashFile, mainFile, linkText) {
	
	// generate the HTML code
	var str = '<a href="#" onclick="ShowVideoPlayer(\'' + splashFile + '\', \'' + mainFile + '\'); return false;" title="Watch &#8220;' + linkText + '&#8221;">' + linkText + '</a>';
	
	// insert the HTML code into the document
	document.write(str);

}
