var roseville = 'roseville';
var whiteBear = 'white_bear';

//date in yyyyMMdd format
function familyTalk( date )
{
	  var year = date.substring(0,4);
	  window.open( getRootURL() + "/sermons/" + year + "/family_talk/" + date + ".pdf",
	     "FamilyTalk", "width=1000,height=600,left=0,top=0,resizable,scrollbars,menubar,toolbar,directories");
}

function connectingGroupsRoseville( date )
{
	connectingGroups(roseville, date );
}

function connectingGroupsWhiteBear( date )
{
	connectingGroups( whiteBear, date );
}

//date in yyyyMMdd format
function connectingGroups( campus, date )
{
	  var year = date.substring(0,4);
	  window.open( getRootURL() + "/sermons/" + year + "/" + campus + "/connecting_groups/" + date + ".pdf",
	     "ConnectingGroups", "width=1000,height=600,left=0,top=0,resizable,scrollbars,menubar,toolbar,directories");
}


function goingDeeperRoseville( date )
{
	goingDeeper(roseville, date );
}

function goingDeeperWhiteBear( date )
{
	goingDeeper( whiteBear, date );
}

//date in yyyyMMdd format
function goingDeeper( campus, date )
{
	  var year = date.substring(0,4);
	  window.open( getRootURL() + "/sermons/" + year + "/" + campus + "/going_deeper/" + date + ".pdf",
	     "GoingDeeper", "width=1000,height=600,left=0,top=0,resizable,scrollbars,menubar,toolbar,directories");

}

function notesRosevillePDF( date )
{
	notesPDF( roseville, date );
}

function notesWhiteBearPDF( date )
{
	notesPDF( whiteBear, date );
}

// date in yyyyMMdd format
function notesPDF( campus, date )
{
  var year = date.substring(0,4);
  window.open( getRootURL() + "/sermons/" + year + "/" + campus + "/notes/" + date + ".pdf",
     "MessageOutline", "width=1000,height=600,left=0,top=0,resizable,scrollbars,menubar,toolbar,directories");
}

function notesRoseville( date )
{
	notes( roseville, date );
}

function notesWhiteBear( date )
{
	notes( whiteBear, date );
}

// date in yyyyMMdd format
function notes( campus, date )
{
  var year = date.substring(0,4);
  window.open( getRootURL() + "/sermons/" + year + "/" + campus + "/notes/" + date + ".htm",
     "MessageOutline", "width=1000,height=600,left=0,top=0,resizable,scrollbars,menubar,toolbar,directories");
}

// date in yyyyMMdd format
function listenRoseville( date )
{
  listen( roseville, date, false );
}

// date in yyyyMMdd format
function listenWhiteBear( date )
{
  listen( whiteBear, date, false );
}

// date in yyyyMMdd format
function listenWithSlidesRoseville( date )
{
  listen( roseville, date, true );
}

function listenWithSlidesWhiteBear( date )
{
  listen( whiteBear, date, true );
}

// date in yyyyMMdd format
function listen( campus, date, withSlides )
{
  var year = date.substring(0,4);

  if ( withSlides )
  	document.location.href= getRootURL() + "/sermons/" + year + "/" + campus + "/audio/" + date + "/multimedia.ram";
  else
  	document.location.href= getRootURL() + "/sermons/" + year + "/" + campus + "/audio/" + date + "/audio.ram";
}
/*
function downloadWhiteBear( date )
{
	download( whiteBear, date );
}

function downloadRoseville( date )
{
	download( roseville, date );
}

function download( campus, date )
{
  var year = date.substring(0,4);
  window.open( getRootURL() + "/sermons/" + year + "/" + campus + "/audio/" + date + "/cbc_" + campus + "_" + date + ".mp3",
     "MessageDownload", "width=500,height=400,left=0,top=0");
}*/
