// JS Script Document : Audio list

function PopulateVideoList()
{
	var yr, mn, varref, lbnd, ubnd, varOption, nCount, i, j, varstr
	
	ClearOptions (idSelectClip);

	yr = parseInt(idYear.value);
	mn = parseInt(idMonth.value);
	
	document.getElementById("idAvailableClips").style.display = "none";
	document.getElementById("idNothingAvailable").style.display = "none";
	
	switch (yr)
	{
		case 1:
			for ( j = 0; j <= 9; j++)
			{
				if ("" != year2001[mn][j])
				{
					varstr = year2001[mn][j].split("$");
					AddToOptionList(idSelectClip, varstr[0], varstr[1]);
				}
			}
			break;
		case 2:
			for ( j = 0; j <= 9; j++)
			{
				if ("" != year2002[mn][j])
				{
					varstr = year2002[mn][j].split("$");
					AddToOptionList(idSelectClip, varstr[0], varstr[1]);
				}
			}
			break;
		case 3:
			for ( j = 0; j <= 9; j++)
			{
				if ("" != year2003[mn][j])
				{
					varstr = year2003[mn][j].split("$");
					AddToOptionList(idSelectClip, varstr[0], varstr[1]);
				}
			}
			break;
		default:
			break;
	}

	if (0 >= idSelectClip.length)
		document.getElementById("idNothingAvailable").style.display = "";
	else
		document.getElementById("idAvailableclips").style.display = "";
}

function PopulateAudioList( curDate )
{
	var yr, mn, varref, lbnd, ubnd, varOption, nCount, i, j, varstr

	yr = curDate.split("/")[0];// - 2000
	mn = curDate.split("/")[1] - 1
	dt = curDate.split("/")[2] - 1

	ClearOptions (idSelectAudioClip);

	document.getElementById("idAudioAvailable").style.display = "none"
	document.getElementById("idNoAudioAvailable").style.display = "none"
	
//	if ("" != eval("audioyear"+yr)[mn][dt])
	if ("" != eval("audioyear")[mn][dt])	
	{
		varstr = eval("audioyear")[mn][dt].split("$");
		for (j = 0; j < varstr.length; j++)
		{
			AddToOptionList(idSelectAudioClip, varstr[j].split("@")[1], varstr[j].split("@")[0])
		}
	}	

	if (0 >= idSelectAudioClip.length)
		document.getElementById("idNoAudioAvailable").style.display = ""
	else
		document.getElementById("idAudioAvailable").style.display = ""
}



function DisplayRecentVideos()
{
	var strVideo;
	var nCtr, ntotal;

	ntotal = strRecentVideosLink.length;

	for (nCtr = 0; nCtr < ntotal; nCtr++)
	{
		strVideo = "<a class='rvlinks' href='javascript:gotoVideo(\"" + strRecentVideosLink[nCtr] + "\", idrv" + nCtr + ")'   id='idrv" + nCtr + "'>\n" 
		strVideo += "<li>" + strRecentVideosTitle[nCtr] + "</li>\n"
		strVideo += "</a>"
		document.write (strVideo);
	}
}

