function DrawQuickLinks()
{
olbar = new CreateOutLookToolBar ( "olBar", 120, 250 );

panel1 = new CreatePanel ( "idPanel0", "See Also" );
panel1.addNodes ( "Online Store", "http://onlinestore.samratchana.com" );
panel1.addNodes ( "Tour Samratchana", "/voiceofbaba/video/discourses/en-us/default.asp" );
panel1.addNodes ( "Subscribe to magazine", "http://onlinestore.samratchana.com/samratchana.asp" );
panel1.addNodes ( "Free eNewsletter", "/newsletter/en-us/default.asp" );

olbar.addPanel (panel1);

olbar.draw();		
olbar.displayPanel ("idPanel0");
}

function playAudio( strUrl, strText )
{
	var strSplitUrl, mobj, ds;

	strSplitUrl = strUrl.split("*")

	idRealPlayer.DoStop()
	idRealPlayer.Source = strSplitUrl[0]
	idRealPlayer.DoPlay()
	idDwnTodaySpeech.href = "download.aspx?file=" + strSplitUrl[0];
	
	var sDateSplit = gDate.split ("/");
	idspeechdate.innerHTML =  "Speech rendered by Baba on " + yxMonths[parseInt(sDateSplit[1])-1]+" "+sDateSplit[2]+", "+sDateSplit[0]+"";
	idspeechdate.innerHTML =  strText;
/*
	var obj = getElement("idAudioTextFrm");
	if ("-" == strSplitUrl[1])
	{
		getElement("idTranslation").style.display = "none"
		getElement("idNoTranslation").style.display = ""
		getElement("idPrint").style.display="none"
	}
	else
	{
		getElement("idTranslation").style.display = ""
		getElement("idNoTranslation").style.display = "none"
		getElement("idPrint").style.display=""
		obj.src = strSplitUrl[1]
	}
*/	
}

function onBodyUnload()
{
	if (null != idRealPlayer)
	{
		idRealPlayer.DoStop()
		idRealPlayer.Source = ""
	}
}

function playTodaySpeech()
{
	var sDateSplit = gDate.split ("/");
	
	var y = sDateSplit[0];
	var m = sDateSplit[1];
	var d = parseInt(sDateSplit[2]);
	
	var bcontinue = true;
	y1=y; m1=m; d1=d;
	
	do 
	{
		if ( true == IsSpeechAvailable( y, (m-1), d ))
		{
			bcontinue = false;
		}
		else
		{
			d--;
			if (d<1)
			{
				var D = new Date (y, m, 0)
				d = D.getDate();
				m--;
				if ( m<1)
				{
					y--;
					m=12;
					if (y<2004)
					{
						break;
					}
				}
			}
		}
	} while (bcontinue);

	if ( IsSpeechAvailable( y, (m-1), d ) )
	{
		nLatestSpeechDate = y+"/"+m+"/"+d; //gDate;
	}
	
	PopulateAudioList( nLatestSpeechDate )
	/*var val = idSelectAudioClip.options(0).value
	idSelectAudioClip.selectedIndex = 0;
	playAudio(val, idSelectAudioClip.options(0).text)*/
	
	//playAudio(strTodaySpeech)

	//idspeechdate.innerHTML = "Speech rendered by Baba on " + yxMonths[parseInt(sDateSplit[1])-1]+" "+sDateSplit[2]+", "+sDateSplit[0]+"";
	//idspeechdate.innerHTML = 'Speech rendered by Baba on Pournami - March 6 2004';
}


function playTruth()
{
	playAudio(strTruthSpeech, "<u>Samratchana Song that asserts Baba's Truth</u>")
	idspeechdate.innerHTML = "<u>Samratchana Song that asserts Baba's Truth</u>";
}

function readBabaMessage ( strUrl )
{
	var obj = getElement("idAudioTextFrm");
	
	getElement("idTranslation").style.display = ""
	getElement("idNoTranslation").style.display = "none"
	
	obj.src = strUrl
}

function ChangeBackColor (obj, color, forecolor)
{
	getElement(obj).style.backgroundColor = color;
	getElement(obj).style.borderColor = color;
	getElement(obj).style.color = forecolor;
	
	color = color.toLowerCase();
	if("white"==color)
	{
		getElement(obj).style.borderStyle = "none";
		getElement(obj).style.borderWidth='0px'
	}	
	else
	{
		getElement(obj).style.borderStyle = "outset";
		getElement(obj).style.borderWidth='3px'
	}	
}

function downloadSpeech()
{
	document.getElementById("idDwnTodaySpeech").execCommand("SaveAs");
}
