prevobj = 'menu0';

initial = true;

function openPopup()
{
	var layer3 = document.createElement('div');
	layer3.innerHTML = "<div id='bazaar' style='position: absolute; z-index: 8; top: 30px; left: 30px; width: 450px; height: 400px; border: 2px solid black; overflow: hidden'><img src='images/church.jpg' alt='' height='850' width='750' border='0'><div id='info' style='position: absolute; z-index: 9; top: 20px; left: 25px; width: 400px; height: 360px'><table width='400' border='0' cellspacing='0' cellpadding='0'><tr><td ><p align='center'><img src='images/churchbazaar.gif' alt='' height='150' width='393' border='0'></p><p class='poemtitle'>ANNUAL BAZAAR</p><p class='subhead'>Friday, October 21 - 1:00 PM - 9:00 PM</p><p class='subhead'>Saturday, October 22 - 11:00 AM - 7:00 PM</p><p class='bodytextcentered'>Visit the Bazaars page in the Activities menu for more information</p><form><p align='center'><input type='button' value='Close Window' onClick='closePopup();'></p></form></td></tr></table></div></div>";
	document.body.appendChild(layer3);
}

function closePopup()
{
    if (document.all)  //IE
	document.all('bazaar').style.visibility = 'hidden'; 
    else if (document.getElementById)  //Netscape 6
    	document.getElementById('bazaar').style.visibility = 'hidden';
}

function createMenu()
{
	var layer = document.createElement('div');
	layer.innerHTML = "<div id='layer2' style='position: absolute; z-index: 3; top: 160px; left: 10px; width: 180px; height: 300px'><table><tr><td><span class='navheading'>About Us</span><br><span><a href='index.html' class='navigation2'>Home</a><br><a href='map3.html' class='navigation2'>Map</a><br><a href='staff.html' class='navigation2'>Staff</a><br><a href='bulletin.php' class='navigation2'>Parish Bulletin</a><br><a href='masses4.html' class='navigation2'>Sacraments</a><br><a href='stwillibrord.html' class='navigation2'>St. Willibrord</a><br><a href='contactus2.php' class='navigation2'>Contact Us</a><br></span><span class='navheading'>History</span><br><span><a href='history6.html' class='navigation2'>History</a><br><a href='pastor3.html' class='navigation2'>Pastor</a><br><a href='anniversary2.html' class='navigation2'>Parish Anniversary</a><br><a href='pilgrimage2.html' class='navigation2'>Echternach Visit</a><br><a href='consecration2.html' class='navigation2'>Consecration</a><br><a href='palmsunday.html' class='navigation2'>Palm Sunday</a><br><a href='retirement.html' class='navigation2'>Pastor Retirement</a><br></span><span class='navheading'>Child Faith Formation</span><br><span><a href='childliturgy2.html' class='navigation2'>Children&rsquo;s Liturgy</a><br><a href='biblecamp2.html' class='navigation2'>Bible Camp</a><br><a href='registration.php' class='navigation2'>Registration Form</a><br></span><span class='navheading'>Activities</span><br><span><a href='calendar2.html' class='navigation2'>Calendar</a><br><a href='bazaars2.html' class='navigation2'>Bazaars</a><br><a href='challenge.html' class='navigation2'>Challenge</a><br><a href='baskets2.html' class='navigation2'>Christmas Baskets</a><br><a href='hospitality2.html' class='navigation2'>Hospitality Centre</a><br><a href='trips.html' class='navigation2'>Pilgrimages</a><br><a href='rcia.html' class='navigation2'>RCIA</a><br><a href='retreats2.html' class='navigation2'>Retreats</a><br></span><span class='navheading'>Resources</span><br><span><a href='willisword2.html' class='navigation2'>Willi&rsquo;s Word</a><br><a href='pastorblog.php' class='navigation2'>Pastor&rsquo;s Blog</a><br><a href='gallery.html' class='navigation2'>Picture Gallery</a><br><a href='http://www.canadahelps.org/CharityProfilePage.aspx?CharityID=s40293' target='_blank' class='navigation2'>Donations</a><br><a href='links.html' class='navigation2'>Links</a><br></span></td></tr></table></div>";
	document.body.appendChild(layer);
}

function flipPastors() {
	setTimeout("document.pastorphoto.src='images/pastor2.jpg'",2000);
	setTimeout("document.pastorphoto.src='images/pastor3.jpg'",4000);
	setTimeout("document.pastorphoto.src='images/pastor4.jpg'",6000);
	setTimeout("document.pastorphoto.src='images/pastor5.jpg'",8000);
	setTimeout("document.pastorphoto.src='images/pastor6.jpg'",10000);
	setTimeout("document.pastorphoto.src='images/pastor7.jpg'",12000);
	setTimeout("document.pastorphoto.src='images/pastor8.jpg'",14000);
}

function flipProcession() {
	setTimeout("document.procession.src='images/palmsunday0b.jpg'",2000);
	setTimeout("document.procession.src='images/palmsunday0c.jpg'",4000);
	setTimeout("document.procession.src='images/palmsunday0d.jpg'",6000);
	setTimeout("document.procession.src='images/palmsunday0e.jpg'",8000);
	setTimeout("document.procession.src='images/palmsunday0f.jpg'",10000);
	setTimeout("document.procession.src='images/palmsunday0g.jpg'",12000);
	setTimeout("document.procession.src='images/palmsunday0h.jpg'",14000);
	setTimeout("document.procession.src='images/palmsunday0i.jpg'",16000);
	setTimeout("document.procession.src='images/palmsunday0j.jpg'",18000);
	setTimeout("document.procession.src='images/palmsunday0k.jpg'",20000);
	setTimeout("document.procession.src='images/palmsunday0l.jpg'",22000);
}

function submitForm() {
	if(document.contactform.realname.value.length < 1) {
			alert("Please enter your name.");
			document.contactform.realname.focus();
			return; }
	if(document.contactform.telephone.value.length < 8) {
			alert("Please enter a valid telephone number.");
			document.contactform.telephone.focus();
			return; }
	if(document.contactform.email.value.length < 4) {
			alert("Please enter a valid e-mail address.");
			document.contactform.email.focus();
			return; }
	document.contactform.postdate.value = Date();
	document.contactform.submit();
}

function submitForm2() {
	if(document.registerform.realname.value.length < 1) {
			alert("Please enter your child's name.");
			document.registerform.realname.focus();
			return; }
	if(document.registerform.birth.value.length < 8) {
			alert("Please enter a valid birthdate.");
			document.registerform.birth.focus();
			return; }
	if(document.registerform.parent1.value.length < 1) {
			alert("Please enter your name.");
			document.registerform.parent1.focus();
			return; }
	document.registerform.postdate.value = Date();
	document.registerform.submit();
}

function createColumns() {
	var minHeight = (document.getElementById('columnone').offsetHeight + document.getElementById('columntwo').offsetHeight)/2;
	while (document.getElementById('columnone').offsetHeight < minHeight) {
		document.getElementById('entryone').appendChild(document.getElementById('entrytwo').firstChild);
	}
}

