
//
// =========================================================================================
// global variables
// =========================================================================================
//
// scratch and helper variables
//
	var bDebug			= false; // global debug flag for more messages
	var QUOTE           = String.fromCharCode(34); // quote character
	var UNQUOTE         = QUOTE;
//
	var FILE_LOCATION ="GLC/Services/";  // html for sermon playback
	var FILE_LOCATION_GV ="MediaArchive/grapevines/"; // individual grapevine PDFs
	var FILE_LOCATION_SC ="MediaArchive/music/Senior Choir/"; // Choir's mp3
	var FILE_LOCATION_PnH ="MediaArchive/music/PraiseNHarmony/"; // PnH's mp3
	var FILE_LOCATION_XF ="MediaArchive/music/CrossFire/"; // Crossfire's mp3
	var FILE_LOCATION_JN ="MediaArchive/music/JoyfulNoise/"; // Joyful Noise's mp3
	var MP3_LOCATION ="MediaArchive/sermons/";

// =========================================================================================
// variables and functions for GLC News Ticker --start--
// =========================================================================================
var scrollerheight='130px'
var scrollerwidth ='302px'
var scrollerbgcolor=''
var scrollerbackground=''
var intVisibleTime = 4000 // interval where lines are frozen and visible [in milliseconds]
var intChangeTime = 75  // interval where lines transition [in milliseconds]
var ie=document.all
var dom=document.getElementById
	
//
// =========================================================================================
// functions
// =========================================================================================
//

// =========================================================================================
function WriteNavTable() 
// =========================================================================================
{
// v1.0 20071028 - created
// v2.0 20071029 - third row added
// v2.1 20071030 - rearranged the links and added links buried in Welcome page

var fVersion = "2.1 20071030"; 
    // version information
    if (bDebug) {
		alert ("function: WriteNavTable(); version="+fVersion); 
	}
	// identify yourself
	document.writeln("<! Start include file for Navigation Bar>");
	// write the code for the navigation bar
	document.writeln("<table background="+QUOTE+"/images/navbackground.png"+QUOTE+" border="+QUOTE+"0"+QUOTE+" cellpadding="+QUOTE+"0"+QUOTE+"cellspacing="+QUOTE+"0"+QUOTE+" >");
	document.writeln("<table background="+QUOTE+"/images/navbackground.png"+QUOTE+" width="+QUOTE+"640"+QUOTE+">");
// row 1 ===============================================================================================
	document.writeln("<tr>");
 	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"7"+QUOTE+">  &nbsp;</td>");
// 	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"94"+QUOTE+"> <a href="+QUOTE+"/welcome.htm"+QUOTE+">Welcome</a></td>");
 	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"94"+QUOTE+"> <a href="+QUOTE+"/default.asp"+QUOTE+">Welcome</a></td>");
 	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"67"+QUOTE+"> <a href="+QUOTE+"/vision.htm"+QUOTE+">Vision</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"85"+QUOTE+"> <a href="+QUOTE+"/staff.htm"+QUOTE+">Staff</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"92"+QUOTE+"> <a href="+QUOTE+"/grapevine.htm"+QUOTE+">Grapevine</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"153"+QUOTE+"><a href="+QUOTE+"/outreach.htm"+QUOTE+">Outreach</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"78"+QUOTE+"> <a href="+QUOTE+"/MediaArchive/sermons.htm"+QUOTE+">Sermons</a></td>");
//	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"30"+QUOTE+"> <a href="+QUOTE+""+QUOTE+">&nbsp;</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"7"+QUOTE+">  &nbsp;</td>");
	document.writeln("</tr>");
// row 2 ===============================================================================================
	document.writeln("<tr>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"7"+QUOTE+">  &nbsp;</td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"94"+QUOTE+"> <a href="+QUOTE+"http://www.mychurchevents.com/calendar/calendar.aspx?ci=L6N8F0O9G1L6J4"+QUOTE+">Calendar</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"67"+QUOTE+"> <a href="+QUOTE+"/music.htm"+QUOTE+">Music</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"85"+QUOTE+"> <a href="+QUOTE+"/elders.htm"+QUOTE+">Elders</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"92"+QUOTE+"> <a href="+QUOTE+"/prayer.htm"+QUOTE+">Prayer</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"153"+QUOTE+"><a href="+QUOTE+"/evangelism.htm"+QUOTE+">Evangelism</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"78"+QUOTE+"> <a href="+QUOTE+"/faith.htm"+QUOTE+">Faith</a></td>");
//	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"30"+QUOTE+"> <a href="+QUOTE+""+QUOTE+">&nbsp;</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"7"+QUOTE+">  &nbsp;</td>");
	document.writeln("</tr>");
// row 3 ===============================================================================================
	document.writeln("<tr>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"7"+QUOTE+">  &nbsp;</td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"94"+QUOTE+"> <a href="+QUOTE+"http://maps.google.com/maps?q=130+Spit+Brook+Rd,+Nashua,+NH+03062&om=1"+QUOTE+">Directions</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"67"+QUOTE+"> <a href="+QUOTE+"/youth.htm"+QUOTE+">Youth</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"85"+QUOTE+"> <a href="+QUOTE+"/history.htm"+QUOTE+">History</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"92"+QUOTE+"> <a href="+QUOTE+"/missions.htm"+QUOTE+">Missions</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"153"+QUOTE+"><a href="+QUOTE+"/churchforms.htm"+QUOTE+">Church Forms</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"78"+QUOTE+"> <a href="+QUOTE+"/links.htm"+QUOTE+">Links</a></td>");
//	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"30"+QUOTE+"> <a href="+QUOTE+""+QUOTE+">&nbsp;</a></td>");
	document.writeln("<td height="+QUOTE+"25"+QUOTE+" class="+QUOTE+"navtable"+QUOTE+" width="+QUOTE+"7"+QUOTE+">  &nbsp;</td>");
	document.writeln("</tr>");

// A sample blank line: <a href="+QUOTE+""+QUOTE+">&nbsp;</a></td>");


	// close it out; we're done here
	document.writeln("<! End include file>");
	document.writeln("</table>");
   return;
}


// =========================================================================================
function writeALink(sTheText,sTheLink,sTheGroup) 
// =========================================================================================
// write one entry in the link list to past and present grapevine editions
{
// v1.0 20071027 - created
// v2.0 20071127 - added parameter to allow for variety of links to be written, pointing to different places
	  var lDebug = false; // set this flag for diagnostic messages
    	// version information
	  var fVersion = "2.0 20071127"; 

    	  if (lDebug) {
		alert ("function: WriteALink(); version="+fVersion+" parms=>"+sTheText+"<,>"+sTheLink+"<,>"+sTheGroup+"<"); 
	  }

	// identify yourself
	  document.writeln("<! writeALink(); version="+fVersion+" parms=["+sTheText+"],["+FILE_LOCATION_GV+sTheLink+"] >");

	// write the code for one entry in the list of back issues of the Grapevine
	  document.writeln("<br><img border="+QUOTE+"0"+QUOTE+" src="+QUOTE+"/images/pointfinger.png"+QUOTE+" width="+QUOTE+"27"+QUOTE+" height="+QUOTE+"14"+QUOTE+">");
 	  if (sTheGroup == "SC") { 
    	  	if (lDebug) { alert ("function: WriteALink(); location=>"+FILE_LOCATION_SC+"<"); }
		document.writeln("<a href="+QUOTE+FILE_LOCATION_SC+sTheLink+".mp3"+QUOTE+">");  // Senior / Adult Choir
	  }
 	  if (sTheGroup == "PnH") {
		document.writeln("<a href="+QUOTE+FILE_LOCATION_PnH+sTheLink+".mp3"+QUOTE+">");  // Praise 'n Harmony
	  }
 	  if (sTheGroup == "XF") {
		document.writeln("<a href="+QUOTE+FILE_LOCATION_XF+sTheLink+".mp3"+QUOTE+">");  // Crossfire
	  }
 	  if (sTheGroup == "JN") {
		document.writeln("<a href="+QUOTE+FILE_LOCATION_JN+sTheLink+".mp3"+QUOTE+">");  // Joyful Noise
	  }
 	  if (sTheGroup == "GV") {
		document.writeln("<a href="+QUOTE+FILE_LOCATION_GV+sTheLink+QUOTE+">");  // link to grapevine articles
	  }
 	  if (sTheGroup == "ext") {
		document.writeln("<a href="+QUOTE+"http://"+sTheLink+QUOTE+">");  // link to grapevine articles
	  }
	  document.writeln("&nbsp;"+sTheText+"</a>");

	return;
 }

// =========================================================================================
function playSermon(sTheTitle,sTheDate,sTheLink) 
// =========================================================================================
// create a new window and load the plugin to play back the mp3
// all parameters, no need for a specific file for each sermon (grin)
{
// v1.0 20071101 - created MG
	  var lDebug = false; // set this flag for diagnostic messages
    	// version information
	  var fVersion = "1.0 20071101"; 

    	  if (lDebug) {
		alert ("function: playSermon(); version="+fVersion+" parms=>"+sTheLink+"<,>"+sTheTitle+"<,>"+sTheDate+"<"); 
	  }
	  var subwindow = window.open ("","","HEIGHT=280,WIDTH=410");
	  with (subwindow) {
	  	document.writeln("<HTML>");
	  	document.writeln('<script type="text/javascript" src="http://www.glcmsnh.org/GLC_default.js"></script>');
	  	document.writeln("<TITLE>Grace Lutheran Church - Audio Sermon Playback</TITLE>");
	  	document.writeln('<link rel="stylesheet" type="text/css" href="http://www.glcmsnh.org/GLC_default.css">');
	  	document.writeln("<BODY>");

		document.writeln('<p class="pagetitle">'+"Grace Lutheran Church<br>Audio Sermon Playback"+'</p>');
		document.writeln('<p class="glctitle">'+sTheDate);
		document.writeln('<BR>'+"Rev. Mick Meyer"+'<BR>');
		document.writeln('<p class="glctitle">'+sTheTitle+'</p>');
		document.writeln('<p align=center>');
	  	  
		document.writeln('<object id="id7" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ');
		document.writeln('codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="300" height="16">');
		document.writeln('<param name="src" value="http://www.glcmsnh.org/MediaArchive/sermons/QTPlaceholder.mov" />');
		document.writeln('<param name="qtsrc" value="http://www.glcmsnh.org/MediaArchive/sermons/'+sTheLink+'.mp3" />');
		document.writeln('<param name="controller" value="true" />');
		document.writeln('<param name="autoplay" value="false" />');
		document.writeln('<param name="scale" value="tofit" />');
		document.writeln('<param name="volume" value="100" />');
		document.writeln('<param name="loop" value="false" />');
		document.writeln('<embed pluginspage="http://www.apple.com/quicktime/download/" ');
		document.writeln('type="video/quicktime" ');
		document.writeln('class="mov" width="300" height="16" ');
		document.writeln('src="http://www.glcmsnh.org/MediaArchive/sermons/QTPlaceholder.mov" ');
		document.writeln('qtsrc="http://www.glcmsnh.org/MediaArchive/sermons/'+sTheLink+'.mp3" ');
		document.writeln('controller="true" ');
		document.writeln('autoplay="false" ');
		document.writeln('scale="tofit" ');
		document.writeln('volume="100" ');
		document.writeln('loop="false">');
		document.writeln('</embed></object>');
		document.writeln('</div>');
        document.writeln('<p align=center><font size="2">Press the "play" button to begin listening.</font></p>');
   
		document.writeln('</p>');

	  	document.writeln("</BODY></HTML>");

	  }
	return;
 }
 

// =========================================================================================
function writeSermonLink(sTheTitle,sTheDate,sTheLink) 
// =========================================================================================
// write one entry in the link list to sermon audio files
{
// v1.0 20071027 - created
	  var lDebug = false; // set this flag for diagnostic messages
    	// version information
	  var fVersion = "1.0 20071027"; 
	  var FILE_LOCATION ="GLC/Services/";
	  var MP3_LOCATION ="/MediaArchive/sermons/";

    	  if (lDebug) {
		alert ("function: writeSermonLink(); version="+fVersion+" parms=>"+sTheTitle+"<,>"+sTheDate+"<,>"+sTheLink+"<"); 
	  }

	// identify yourself
	  document.writeln("<! writeSermonLink(); version="+fVersion+" parms=["+sTheTitle+"],["+sTheDate+"],["+sTheLink+"] >");

	// write the code for one entry in the list of sermons
	  document.writeln("<center>");
	  document.writeln("<span style="+QUOTE+"font-style: italic;  line-height: 25px; "+QUOTE+">"+sTheDate+"</span>");  // date
	  document.writeln("<div class="+QUOTE+"glctitle"+QUOTE+">&quot;"+sTheTitle+"&quot;</div>");  // title

	// write the links
//	  document.writeln("<br>");
//    use a javascript to open a new window that plays back the sermon audio
	  document.writeln("<div class="+QUOTE+"glccontent"+QUOTE+">");  // make it class 'glccontent' to fit in nicely
 	  document.writeln("<a href="+QUOTE+"javascript:playSermon('"+sTheTitle+"','"+sTheDate+"','"+sTheLink+"');"+QUOTE+">");
	  document.writeln("<img border="+QUOTE+"0"+QUOTE+" src="+QUOTE+"/images/pointfinger.png"+QUOTE+" width="+QUOTE+"27"+QUOTE+" height="+QUOTE+"14"+QUOTE+">"); 
	  document.writeln("&nbsp;"+"Listen Online "+"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
 	  document.writeln("<a href="+QUOTE+MP3_LOCATION+sTheLink+".mp3"+QUOTE+">");
	  document.writeln("<img border="+QUOTE+"0"+QUOTE+" src="+QUOTE+"/images/pointfinger.png"+QUOTE+" width="+QUOTE+"27"+QUOTE+" height="+QUOTE+"14"+QUOTE+">"); // same as previous image line
	  document.writeln("&nbsp;"+"Download mp3"+"</a>"+"</div>");
	  document.writeln("<hr>");
	  document.writeln("</div></center>");

	return;
 } 
// =========================================================================================
function writeMovie0(sTheName,sTheTitle,sTheDate)
// =========================================================================================
{
    document.writeln('<div class="graphic_generic_datefield_textbox_style_default" style="height: 27px; left: 118px; position: absolute; top: 352px; width: 464px; z-index: 1; " id="id5">');
    document.writeln('<div>');
    document.writeln('<div class="Normal">');
    document.writeln('<div class="paragraph Date" style="line-height: 19px; margin-bottom: 0px; margin-top: 0px; padding-bottom: 0pt; padding-top: 0pt; text-align: center; line-height: 19px;">');
    document.writeln(sTheDate+'</div> ');                                   
    document.writeln('</div>');
    document.writeln('</div>');
    document.writeln('</div>');
    document.writeln('<div style="height: 1px; line-height: 1px; " class="tinyText"> </div>');
    document.writeln('<div class="graphic_generic_body_textbox_style_default" style="margin-left: 118px; margin-top: 428px; position: relative; width: 464px; z-index: 1; ">');
    document.writeln('<div style="height: 152px; line-height: 152px; " class="tinyText"></div>  ');
    document.writeln('</div>');
    document.writeln('<img src="../Images/Glyph-1.png" alt="" id="id6" style="border: none; height: 9px; left: 301px; opacity: 1.00; position: absolute; top: 381px; width: 97px; z-index: 1; " />');
    document.writeln('<div style="height: 316px; left: 200px; position: absolute; top: 26px; width: 300px; z-index: 1; ">');
    document.writeln('<img style="height: 300px; width: 300px; " src="20071014_files/transparent.gif" width="1" height="1" />');


    document.writeln('<object id="id7" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ');
    document.writeln('codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="300" height="16">');
    document.writeln('<param name="src" value="'+sTheName+'_files/QTPlaceholder.mov" />');
    document.writeln('<param name="qtsrc" value="'+sTheName+'.mp3" />');
    document.writeln('<param name="controller" value="true" />');
    document.writeln('<param name="autoplay" value="false" />');
    document.writeln('<param name="scale" value="tofit" />');
    document.writeln('<param name="volume" value="100" />');
    document.writeln('<param name="loop" value="false" />');
    document.writeln('<embed pluginspage="http://www.apple.com/quicktime/download/" ');
    document.writeln('type="video/quicktime" ');
    document.writeln('class="mov" width="300" height="16" ');
    document.writeln('src="'+sTheName+'_files/QTPlaceholder.mov" ');
    document.writeln('qtsrc="'+sTheName+'.mp3" ');
    document.writeln('controller="true" ');
    document.writeln('autoplay="false" ');
    document.writeln('scale="tofit" ');
    document.writeln('volume="100" ');
    document.writeln('loop="false">');
    document.writeln('</embed></object>');
    document.writeln('</div>');

    document.writeln('<div style="height: 40px; left: 118px; position: absolute; top: 393px; width: 464px; z-index: 1; " >');
    document.writeln('<div>');
    document.writeln('<div class="Normal">');
    document.writeln('<div class="paragraph Title" style="line-height: 32px; padding-bottom: 0pt; padding-top: 0pt; ">'+sTheTitle+'</div>   ');                        
    document.writeln('</div>');
    document.writeln('<p align="center">');
    document.writeln('<BR><a href="../../MediaArchive/'+sTheName+'.mp3"><em>NEW:</em> Right-click here to download to your mp3 device!</a> </div>');
    document.writeln('</div>');
    document.writeln('</div>');
return;
}

// =========================================================================================
function writeMovie1(sTheName,sTheTitle,sTheDate)
// =========================================================================================
{
	document.writeln('<p class="glctitle">'+sTheDate+'</p>');
	document.writeln('<p class="glctitle">'+sTheTitle+'</p>');
	document.writeln('<p align=center>');
	  	  
    document.writeln('<object id="id7" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ');
    document.writeln('codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="300" height="16">');
    document.writeln('<param name="src" value="QTPlaceholder.mov" />');
    document.writeln('<param name="qtsrc" value="'+sTheName+'.mp3" />');
    document.writeln('<param name="controller" value="true" />');
    document.writeln('<param name="autoplay" value="false" />');
    document.writeln('<param name="scale" value="tofit" />');
    document.writeln('<param name="volume" value="100" />');
    document.writeln('<param name="loop" value="false" />');
    document.writeln('<embed pluginspage="http://www.apple.com/quicktime/download/" ');
    document.writeln('type="video/quicktime" ');
    document.writeln('class="mov" width="300" height="16" ');
    document.writeln('src="QTPlaceholder.mov" ');
    document.writeln('qtsrc="'+sTheName+'.mp3" ');
    document.writeln('controller="true" ');
    document.writeln('autoplay="false" ');
    document.writeln('scale="tofit" ');
    document.writeln('volume="100" ');
    document.writeln('loop="false">');
    document.writeln('</embed></object>');
    document.writeln('</div>');
    
	document.writeln('</p>');
    
return;
}

// =========================================================================================
function writeMovieAbs(sTheName,sTheTitle,sTheDate)
// =========================================================================================
{
	document.writeln('<p class="glctitle">'+sTheDate+'</p>');
	document.writeln('<p class="glctitle">'+sTheTitle+'</p>');
	document.writeln('<p align=center>');
	  	  
    document.writeln('<object id="id7" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ');
    document.writeln('codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="300" height="16">');
    document.writeln('<param name="src" value="http://www.glcmsnh.org/MediaArchive/sermons/QTPlaceholder.mov" />');
    document.writeln('<param name="qtsrc" value="http://www.glcmsnh.org/MediaArchive/sermons/'+sTheName+'.mp3" />');
    document.writeln('<param name="controller" value="true" />');
    document.writeln('<param name="autoplay" value="false" />');
    document.writeln('<param name="scale" value="tofit" />');
    document.writeln('<param name="volume" value="100" />');
    document.writeln('<param name="loop" value="false" />');
    document.writeln('<embed pluginspage="http://www.apple.com/quicktime/download/" ');
    document.writeln('type="video/quicktime" ');
    document.writeln('class="mov" width="300" height="16" ');
    document.writeln('src="http://www.glcmsnh.org/MediaArchive/sermons/QTPlaceholder.mov" ');
    document.writeln('qtsrc="http://www.glcmsnh.org/MediaArchive/sermons/'+sTheName+'.mp3" ');
    document.writeln('controller="true" ');
    document.writeln('autoplay="false" ');
    document.writeln('scale="tofit" ');
    document.writeln('volume="100" ');
    document.writeln('loop="false">');
    document.writeln('</embed></object>');
    document.writeln('</div>');
    
	document.writeln('</p>');
    
return;
}


	
// =========================================================================================
// functions move1 thru move4, and startscroll
// =========================================================================================
// =========================================================================================
function move1(whichlayer)
// =========================================================================================
{
	tlayer=eval(whichlayer)
	if (tlayer.top>0&&tlayer.top<=5){
		tlayer.top=0
		setTimeout("move1(tlayer)", intVisibleTime)
		setTimeout("move2(document.main.document.second)", intVisibleTime)
		return
	}
	if (tlayer.top>=tlayer.document.height*-1){
		tlayer.top-=5
		setTimeout("move1(tlayer)", intChangeTime)
	}
	else{
		tlayer.top=parseInt(scrollerheight)
		tlayer.document.write(messages[i])
		tlayer.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}	

// =========================================================================================
function move2(whichlayer)
// =========================================================================================
{
	tlayer2=eval(whichlayer)
	if (tlayer2.top>0&&tlayer2.top<=5){
		tlayer2.top=0
		setTimeout("move2(tlayer2)", intVisibleTime)
		setTimeout("move1(document.main.document.first)", intVisibleTime)
		return
	}
	if (tlayer2.top>=tlayer2.document.height*-1){
		tlayer2.top-=5
		setTimeout("move2(tlayer2)", intChangeTime)
	}
	else{
		tlayer2.top=parseInt(scrollerheight)
		tlayer2.document.write(messages[i])
		tlayer2.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

// =========================================================================================
function move3(whichdiv)
// =========================================================================================
{
	tdiv=eval(whichdiv)
	if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
		tdiv.style.top=0+"px"
		setTimeout("move3(tdiv)", intVisibleTime)
		setTimeout("move4(second2_obj)", intVisibleTime)
		return
	}
	if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
		tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
		setTimeout("move3(tdiv)", intChangeTime)
	}
	else{
		tdiv.style.top=parseInt(scrollerheight)
		tdiv.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

// =========================================================================================
function move4(whichdiv)
// =========================================================================================
{
	tdiv2=eval(whichdiv)
	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
		tdiv2.style.top=0+"px"
		setTimeout("move4(tdiv2)", intVisibleTime)
		setTimeout("move3(first2_obj)", intVisibleTime)
		return
	}
	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
		setTimeout("move4(second2_obj)", intChangeTime)
	}
	else{
		tdiv2.style.top=parseInt(scrollerheight)
		tdiv2.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

// =========================================================================================
function startscroll()
// =========================================================================================
{
	if (ie||dom){
		first2_obj=ie? first2 : document.getElementById("first2")
		second2_obj=ie? second2 : document.getElementById("second2")
		move3(first2_obj)
		second2_obj.style.top=scrollerheight
		second2_obj.style.visibility='visible'
	}
	else if (document.layers){
		document.main.visibility='show'
		move1(document.main.document.first)
		document.main.document.second.top=parseInt(scrollerheight)+5
		document.main.document.second.visibility='show'
	}
}
// =========================================================================================
// variables and functions for GLC News Ticker --end--
// =========================================================================================

// =========================================================================================
function MakeTickerEntry (theStartDate,theEndDate,sHeadline,sTheText,sTheLinkText,sTheLink) {
// =========================================================================================
//
// create an entry for the news ticker that will start to be displayed at the start date,
// and stop being displayed on the day of the end date
// version 1.0
// =========================================================================================
	var bLocalDebug = false;
	var tickerseparator = "<p align='center'><img border='0' src='/images/separator.png' width='71' height='9'></p>";
	if (bLocalDebug) alert ("Inside MakeTickerEntry()");
	
	// extend last day to the full length of the day; default is 00:00:00
	theEndDate.setHours(23);
	theEndDate.setMinutes(59);
	theEndDate.setSeconds(59);
	// subtract one months to make the month numbers consitent with expectations
	theEndDate.setMonth(theEndDate.getMonth()-1);
	theStartDate.setMonth(theStartDate.getMonth()-1);
	
	if (bLocalDebug) alert ("Start Date:"+theStartDate);
	if (bLocalDebug) alert ("End   Date:"+theEndDate);
	// --------------------------------------------------------------------------------------
	var today = new Date();
	if (bLocalDebug) alert("The date:"+today);
   	if ((today > theStartDate) && (today < theEndDate)) {
		if (bLocalDebug) alert ("today is > start date and < end date");  // create entry only if between show dates
			startdate[i] = theStartDate;
 			enddate[i] = theEndDate;
			messages[i]="<div class='glctitle'>";
			//>>>> headline goes here vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
			messages[i]+=sHeadline;
			//>>>>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^		 
			messages[i]+="</div><div class='glccontent'>";
			//>>>> text for news goes here. Embedd HTML as needed. Use single quote if quotes are required. vvvvvvvvvvvv
			messages[i]+=sTheText;
			//>>>>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			messages[i]+="<br><a href='";
			//>>>> clickable web adress goes here vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
			messages[i]+=sTheLink;
			//>>>>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			messages[i]+="'><img border='0' src='/images/pointfinger.png' width='27' height='12'> ";
			//>>>>clickable text for link goes here  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
			messages[i]+=sTheLinkText; 
			//>>>>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			messages[i]+="</a></div>";
			if (bLocalDebug) alert (messages[i]);
			// stick on separator image
			messages[i] += tickerseparator;

			i=i+1;  // advance i for next entry
	} else {
		if (bLocalDebug) alert ("today is NOT > start date or NOT < end date");
		return;
	}
	// --------------------------------------------------------------------------------------
	if (bLocalDebug) {
		return ("message ["+String(i-1)+"] entry created:>"+messages[i-1]+"<");
	} else {
		return;
	}
}  // MakeTickerEntry()

// =========================================================================================
function AnnounceServiceTime (theStartDate,theEndDate) {
// =========================================================================================
//
// create the home page entry for the dates of the service(s). Shall change Labor Day and
// Memorial Day, so feed these days.
// version 1.0
// =========================================================================================
	var bLocalDebug = false;
	if (bLocalDebug) alert ("Inside AnnounceServiceTime ()");
	
	// extend last day to the full length of the day; default is 00:00:00
	theEndDate.setHours(23);
	theEndDate.setMinutes(59);
	theEndDate.setSeconds(59);
	// subtract one months to make the month numbers consitent with expectations
	theEndDate.setMonth(theEndDate.getMonth()-1);
	theStartDate.setMonth(theStartDate.getMonth()-1);
	
	if (bLocalDebug) alert ("Start Date:"+theStartDate);
	if (bLocalDebug) alert ("End   Date:"+theEndDate);
	// --------------------------------------------------------------------------------------
	var today = new Date();
	if (bLocalDebug) alert("The date:"+today);
   	if ((today > theStartDate) && (today < theEndDate)) {
		if (bLocalDebug) alert ("today is > start date and < end date");  // create entry only if between show dates
		// This is between the Summer Setting between Memorial Day and Labor Day		
		document.writeln('<div class="doorsign">');			
		document.writeln('<font size="3">Please join us in Worship</font><br>On Sundays at 9:30 AM<br>');
		document.writeln("(with children's church)<br>");
		document.writeln('<font size="1">(Until Labor Day there is only one service)<br></font>');
	//	document.writeln('<font size="1">Beginning September 13, worship starts at 8:15 AM and 10:30 AM)</font>');
		document.writeln('</div>');
 	} else { 
		if (bLocalDebug) alert ("today is NOT > start date or NOT < end date");
		// this is the Winter setting between Labor Day and Memorial Day; displayed unless within date range
		document.writeln('<div class="doorsign">');			
		document.writeln('<font size="3">Please join us in Worship</font><br>On Sundays at 8:15 AM and 10:45 AM<br>');
		document.writeln("(with children's church)<br>");
		document.writeln('<font size="1">Sunday School for all ages starts at 9:30 AM</font>');
		document.writeln('</div>');
		return;
	}
	// --------------------------------------------------------------------------------------
	if (bLocalDebug) {
		return (">"+"Leaving AnnounceServiceTime ()"+"<");
	} else {
		return;
	}
}  // AnnounceServiceTime ()
