function UpdateSimpleChart(imageUrl, heading, chartImgId, subtitleId)
{
	var chartImg = document.getElementById(chartImgId);
	if (chartImg != null)
	{
		chartImg.src = imageUrl;
		chartImg.alt = heading;
	}

	var subtitle = document.getElementById(subtitleId);
	if (subtitle != null) subtitle.innerHTML = heading;
	
	return false;
}

function UpdateComplexChart(baseImageName, optionsId, optionLabelPrefix, imgChartId, optionLinkId, timeSpanLinkId, ddlTimeSpanId)
{
	// Get Option Id
	var optionId = '';
	var optionName = '';
	var options = document.getElementsByName(optionsId);
	for (i = 0; i < options.length; i++)
	{
		if (options[i].checked)
		{
			optionId += options[i].value + '';
			var label = document.getElementById(optionLabelPrefix + options[i].value);
			optionName += (navigator.userAgent.indexOf('Firefox') >= 0 ? label.textContent : label.innerText);
		}
	}

	// Get Time Span Id
	var dllTimeSpan = document.getElementById(ddlTimeSpanId);
	var timeSpanId = dllTimeSpan.options[dllTimeSpan.selectedIndex].value;
	var timeSpanName = dllTimeSpan.options[dllTimeSpan.selectedIndex].innerHTML;

	var optionLabel = document.getElementById(optionLinkId);
	optionLabel.innerHTML = optionName;

	var timeSpanLabel = document.getElementById(timeSpanLinkId);
	timeSpanLabel.innerHTML = timeSpanName;

	// Image Url and Subtitle
	var imgChart = document.getElementById(imgChartId);
	imgChart.src = baseImageName + optionId + 'x' + timeSpanId + '.jpg';
	imgChart.alt = optionName.substring(0, optionName.length - 3) + '-' + timeSpanName;
	
	return false;
}

function copyText(text)        
{
	//if browser supports clipboard data
	if (window.clipboardData)
	{
		window.clipboardData.setData('text', text);
	}
	else
	{
		 alert('Your browser does not support copying to the clipboard');
	}
}

$(document).ready(
function()
{
	if ($('#camtasia-content').length > 0)
	{
		LBi.CamtasiaLoader.applyVideo();
	}
})

LBi.CamtasiaLoader = 
{
	applyVideo: function() 
	{
		var div_id = "camtasia-content";
		var fo = new FlashObject(video_player_movie_url, "flash_movie", "627", "482", "8", "#FFFFFF");
		
		// mandatory parameters
		fo.addParam("menu", false);
		fo.addParam("allowScriptAccess", "always");

		fo.write(div_id);
	}
}
