function buildHomePage() {
	var pageHTML='<table border=0 width=630px><tr>'
	+ '<td>'
	+ '<p class=contentHead onclick=loadEmergencyMaint()><font size=+2>T</font>he Presbyterian Church of Mount Kisco is a welcoming Christian community.'
	+ '  We believe in the importance of family, social justice, compassion for one another and spiritual'
	+ ' values nurtured through our ministries of worship, education and fellowship.'
	+ '<br><div id=emergencyMaint></div><div id=emergencyMsg onclick=loadEmergencyMaint()></div>'
	+ '</td><td><img id=frontPageSlideShowSpacer src=images/spacer.gif width=230px height=230px align=right>'
	+ '</td></tr></table>'
	+ '<img src=images/divider.jpg style="align:center">'
	+ '<p class=contentHead>' +'Worship Service Schedule</p>'

//Worship Services
	+ '<span id=worshipServices></span>'
		
//Hot Info
	+ '<p class=contentHead>Coming Events<font size=-2>   (see church news for more..)</p>'
	+ '<span id=hotInfo></span>'

//	$('frontPageSlideShowSpacer').style.display=''
	$('pictureFrame').style.display='block'
	$('picture').style.display='block'
	$('contentText').innerHTML=pageHTML
	var worship=new getHost('Transactions/FPsermons.asp',worshipServicesReturn)
	worship.exec()

	var HotFPInfo=new getHost('Transactions/FPhotInfo.asp',loadFPHotInfo)
	HotFPInfo.exec()
	
	var emergency=new getHost('Transactions/FPemergency.asp',loadFPemergency)
	emergency.exec()
	
}
function worshipServicesReturn(xml) {
	var dte1=''
	var title1=''
	var author1=''
	var reading1=''
	var reading2=''
	var dte2=''
	var title2=''
	var author2=''
	var reading3=''
	var reading4=''
	if (!xml.EOF) {
//	var dte1=xml.read(0)
	var split=xml.read(0).split(' ')
	var split2=split[1].split(':')
	dte1=split[0] + ' ' + split2[0] + ':' + split2[1] + ' ' + split[2]
	title1=xml.read(1)
	author1=xml.read(3)
	reading1=xml.read(4)
	reading2=xml.read(5)
	xml.moveNext()
	
	if (!xml.EOF) {
//		dte2=xml.read(0)
		var split=xml.read(0).split(' ')
		var split2=split[1].split(':')
		var dte2=split[0] + ' ' + split2[0] + ':' + split2[1] + ' ' + split[2]
		title2=xml.read(1)
		author2=xml.read(3)
		reading3=xml.read(4)
		reading4=xml.read(5)
	}
	}
	var html='<table width=100% class=contentText><tr><td></td><td class=contentSubHead>' + dte1 + '</td><td class=contentSubHead>' + dte2 + '</td></tr>'
	html+='<tr><td width=25px>sermon:</td><td>'+ title1 + '</td><td>' + title2 + '</td></tr>'
	html+='<tr><td></td><td>'+ author1 + '</td><td>' + author2 + '</td></tr>'
	html+='<tr><td>readings:</td><td>'+ reading1 + '</td><td>' + reading3 + '</td></tr>'
	html+='<tr><td></td><td>'+ reading2 + '</td><td>' + reading4 + '</td></tr>'
	html+='</table>'
	html+='<img src=images/divider.jpg style="align:center">'
	$('worshipServices').innerHTML=html

}
function loadFPemergency(xml) {
	if (!xml.EOF) {
$('emergencyMsg').innerHTML='<div style="color:red;  border:2px solid red;width:350px;padding:5px;font-size:12px">' + xml.read(2) + '</div>'
	}
}
function loadEmergencyMaint() {
	if (!MaintMode) {return;}
	var emergency=new getHost('Transactions/getEmergencies.asp',loadEmergencyMaintReturn)
	emergency.exec()
	
}
function loadEmergencyMaintReturn(xml) {
	var html='<table cellpadding=3 cellspacing=0 border=1 class=contentText>'
	if (!xml.EOF) {
		html+='<tr><td><input id=expdteUpd style="font-size:10px" type=text value="' + xml.read(1) + '">'
		html+='<br><input style="font-size:10px" type=button value=Update onclick=updateEmergency(' + xml.read(0) + ')></td>'
		html+='<td><textarea id=txtUpd cols=35 style="font-size:10px;">' + xml.read(2) + '</textarea></td>'
		html+= '</tr>'
		xml.moveNext()
	}
	$('emergencyMaint').innerHTML=html
}

function updateEmergency(id) {
	var emergency=new getHost('Transactions/updateEmergency.asp',updateEmergencyReturn)
	emergency.args.id=id
	emergency.args.date=$('expdteUpd').value
	emergency.args.text=$('txtUpd').innerHTML
	emergency.exec()
}
function updateEmergencyReturn(xml) {
	buildHomePage()
}
function showBlueBook() {
	$('blueBookBlurb').style.cursor='pointer'
	$('blueBook').style.cursor='pointer'
	$('blueBookBlurb').style.display='block';
}
function hideBlueBook() {
	$('blueBookBlurb').style.cursor='default'
	$('blueBook').style.cursor='default'
	$('blueBookBlurb').style.display='none';
}
function showCIF() {
	$('cifBlurb').style.cursor='pointer'
	$('cif').style.cursor='pointer'
	$('cifBlurb').style.display='block';
}
function hideCIF() {
	$('cifBlurb').style.cursor='derfault'
	$('cif').style.cursor='default'
	$('cifBlurb').style.display='none';
}
