var p = {

	util : {

		configEvents : function() {
		     if (document.addEventListener) {
		          this.addEvent = function(el, type, func, capture) {
		            el.addEventListener(type, func, capture);  
		          };
		          this.stopBubble = function(evt) { evt.stopPropagation(); };
		          this.stopDefault = function(evt) { evt.preventDefault(); };
		          this.findTarget = function(evt, targetNode, container) {
		            var currentNode = evt.target;
		            while (currentNode && currentNode !== container) {
		              if (currentNode.nodeName.toLowerCase() === targetNode) {
		                  return currentNode; break;
		              }
		              else { currentNode = currentNode.parentNode; }
		            };
		            return false;
		          };
		      }
		      else if (document.attachEvent) {
		          this.addEvent = function(el, type, func) {
		            el["e" + type + func] = func;
		            el[type + func] = function() { el["e" + type + func] (window.event); };
		            el.attachEvent("on" + type, el[type + func]);
		          };
		          this.stopBubble = function(evt) { evt.cancelBubble = true; };
		          this.stopDefault = function(evt) { evt.returnValue = false; };
		          this.findTarget = function(evt, targetNode, container) {
		            var currentNode = evt.srcElement;
		            while (currentNode && currentNode !== container) {
		              if (currentNode.nodeName.toLowerCase() === targetNode) {
		                  return currentNode; break;
		              }
		              else { currentNode = currentNode.parentNode; }
		            };
		            return false;
		          };
			}
			if (document.addEventListener) {
				this.removeEvent = function(el, type, func, capture) {
					el.removeEventListener(type, func, capture);
				};
			}
			else if (document.attachEvent) {
				this.removeEvent = function(el, type, func) {
					el["e" + type + func] = null;
					el[type + func] = null;
					el.detachEvent("on" + type, el[type + func]);
				};
			}
		},
    
		createCookie : function(name,value,expiration,path,domain,secure) {
		      var data = name + "=" + escape(value);
		      if (expiration) { 
		          var expiresAt = new Date();
		          expiresAt.setTime(expiration);
		          data += "; expires=" + expiresAt.toGMTString();
		      }
		      if (path) { data += "; path=" + path; }
		      if (domain) { data += "; domain=" + domain; }
		      if (secure) { data += "; secure"; }
		      document.cookie = data;
		},    

		findCookie : function(name) {  
		      var query = name + "=";
		      var queryLength = query.length;
		      var cookieLength = document.cookie.length;
		      var i=0;
		      while (i<cookieLength) {
		        var position = i + queryLength;
		        if (document.cookie.substring(i,position) === query) {
		           return this.findCookieValue(position);
		        }
		        i = document.cookie.indexOf(" ", i) + 1;
		        if (i == 0) { break; }  
		      }
		      return null;  
		},

		findCookieValue : function(position) {
		      var endsAt = document.cookie.indexOf(";", position);
		      if (endsAt == -1) { endsAt = document.cookie.length; }
		      return unescape(document.cookie.substring(position,endsAt));
		},
 
		eraseCookie : function(name) {
			if(this.findCookie(name)) {
				var data = name + "=";
				data += "; expires=Thu, 01-Jan-70 00:00:01 GMT";
				document.cookie = data;
			}
		}
		
	},//end of util
		    
	init : function() {
		
		//object detection
		if(!document.getElementById || !document.getElementsByTagName || !document.createElement || !document.createTextNode) {return;}
		
		this.util.configEvents();  
		
		//photo numbering starts at 1
		this.pCtr = 1;
		this.allPhotos = 10;
		this.slideCtr = 1;
		
		//javascript functions for all pages
		//open external links in new pages
		this.theBody = document.getElementsByTagName('body')[0];
		this.pageContent = document.getElementById('page_content');
		
		//for all non-largePhoto pages
		if(this.pageContent) {
			//identify divs
			this.leftSide = document.getElementById('leftSide');
			//the home page
			this.thePDiv = document.getElementById('homeTopPhoto');
			//pages with structure 2 format
			this.localNav = document.getElementById('localNav');
			this.textWithLN = document.getElementById('textWithLocalNav');
			//the history page
			this.theTimelineList = document.getElementById('timelineList');
			//the membership page
			this.theMemForm = document.getElementById('membershipForm');
			//the news home page
			this.articleList = document.getElementById('articleList');
			//the news article pages
			this.newsH3 = document.getElementById('newsArticlesH3');
			//create global nav and footer
			//calculate current Year
			this.thisYear = new Date().getFullYear();
			//create global nav
			this.entireSite.createGNav();
			//create contact and copyright info in footer of all pages except for home page (in case JS is not enabled)
			this.entireSite.createFooterDivs();
			//style top divs in leftSide and rightSide divs
			this.entireSite.styleTopDivs();
			//add the text "in [current year]" to text
			this.entireSite.getCurrentYear();
			//create special announcement bar
			this.entireSite.createAnnBar();
			//add 'click to enlarge' link
			//this.entireSite.addClickToEnlargeLink();
			//for printing, generate html for image in h2 on each page and add print logo
			this.entireSite.createPrintItems();
				
			//open new window for large images
			this.util.addEvent(this.theBody,'click',this.entireSite.openPhotoWindow,false);
			//close window for large images
			this.util.addEvent(this.theBody,'click',this.entireSite.closePhotoWindow,false);
			//open separate tab for some links
			this.util.addEvent(this.theBody,'click',this.entireSite.openNewTab,false);
			
			
		}
		
		//for large photo pages
		this.largePhoto = document.getElementById('largePhoto');
			
		
		//start the fade on the home page
		if(this.thePDiv) {
			//pinpoint existing photo (the first photo to be faded out
			this.oldP = p.thePDiv.getElementsByTagName('img')[0];
			var timer = setTimeout(p.homePageFade.crossFade, 4000);
		}
		
		//print membership form
		if(this.theMemForm) {
			this.memForm.addMemTypeClass();
			this.memForm.addLabelClass();
			this.thePrintCell = document.getElementById('printForm');
			this.thePrintB = this.thePrintCell.getElementsByTagName('input')[0];
			//this.util.addEvent(this.theMemForm,'click',this.memForm.printBlankForm,false);
			this.util.addEvent(this.thePrintB,'click',this.memForm.printForm,false);
		}
		
		//news article pages
		if(this.newsH3) {
			//this.allArticles = this.newsArticles.length;
			this.newsPage.createNewsNav();
		}
		
		//if "Show Answers" button is clicked on image map, show all overlay photos and labels, individual overlays are selected via the image map in html
		this.findTransPhoto = document.getElementById('findTransPhoto');
		if(this.findTransPhoto) {
			this.util.addEvent(this.findTransPhoto,'click',this.showAllAnswers,false);
		}
		
		
	},
	
	entireSite :  {
	
		//generate announcement bar at the top of each page
		createAnnBar : function() {
			var annBar = document.getElementById('annBar');
			//create the main announcement text
			var theAnn1 = document.createElement('p');
			//create the secondary announcement text
			var theAnn2 = document.createElement('a');
			theAnn2.className = 'exLink';
			//enter announcement text--this will change as announcements change
			theAnn1.appendChild(document.createTextNode('The North Baltimore Area Historical Center is now open Tuesdays 9:00 a.m. - 12:00 Noon.'));
			//theAnn2.appendChild(document.createTextNode('Visit the center on North Baltimore\'s Main Street between 9:00 and 12:00 every Tuesday. \(Other times by appointment\). '));
			theAnn2.href = "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=229+North+Main+Street,+North+Baltimore,+Ohio&sll=37.0625,-95.677068&sspn=31.977057,79.013672&ie=UTF8&ll=41.185873,-83.678398&spn=0.007412,0.01929&z=16&iwloc=A";
			//dirLink.href = 'about.html';
			theAnn2.appendChild(document.createTextNode('Get Directions to the Center'));
		
			annBar.appendChild(theAnn1);
			annBar.appendChild(theAnn2)
		
		},
	
		//generate global nav at the top of each page
		createGNav : function() {
		
			//determine current page via path name
			var currentPath = location.pathname;			
			var startName = currentPath.lastIndexOf("/") + 1;
			var thePage = currentPath.substring(startName);
			var pageStart = thePage.substring(0,5);
		
			var gNavLabels = ['Home','History','News','About Us','Membership','Resources'];
			var gNavLinks = ['index','history','news','about','membership','resources']
			var gNavLength = gNavLabels.length;
			var gNav = document.getElementById('global_nav');
			
			
			for(var n=0; n<gNavLength; n++) {
				//create the li
				var navLi = document.createElement('li');
					
				//if the corresponding link does not match the current page create a link
				if((gNavLinks[n] + '.html') !== thePage) {
					var navA = document.createElement('a');
					navA.href = gNavLinks[n] + '.html';
					navA.appendChild(document.createTextNode(gNavLabels[n]));
					navLi.appendChild(navA);
					if(n === 1) {
						if(pageStart === 'timel') {
							navLi.className = 'current';
						}
					}
					if(n === 2) {
						if(pageStart === 'artic') {
							navLi.className = 'current';
						}
					}
					if(n === 5) {
						if(thePage === 'publications.html') {
							navLi.className = 'current';
						}
					}
				}
				
				//if the label does match create the current page label
				else {
					navLi.className = 'current';
					navLi.appendChild(document.createTextNode(gNavLabels[n]));
				}
				gNav.appendChild(navLi);
			}
			
					
		},
		
		styleTopDivs : function() {
			//identify divs at the top of leftSide and rightSide columns
			if(!p.leftSide) {return;}
			var rightSide = document.getElementById('rightSide');
			var topLeftDiv = p.leftSide.getElementsByTagName('div')[0];
			var topRightDiv = rightSide.getElementsByTagName('div')[0];
			topLeftDiv.className = topRightDiv.className = 'topOfSide';
		},
	
		openNewTab : function(evt) {
			var aLink = p.util.findTarget(evt,'a',this);
			if(!aLink) {return;}
						
			//if classname includes 'exLink'--this is necessary because some links have multiple classes assigned to them	
			if(aLink.className.match('exLink')) {
				p.util.stopDefault(evt);
				window.open(aLink,'_blank');
			}
		},
		
		openPhotoWindow : function(evt) {
			var thisLink = p.util.findTarget(evt,'a',this);
			if(!thisLink) {return;}
			
			if(thisLink.className.match('enlargeLink')) {
				p.util.stopDefault(evt);
				//window.open(thisLink,'_blank','width=1200,height=1400,scrollbars=1');
				//pinpoint the withinTextPhoto div
				var theParentDiv = thisLink.parentNode;
				var thePhoto = theParentDiv.getElementsByTagName('img')[0];
				var theCaptionSpan = theParentDiv.getElementsByTagName('span')[0];
				var theCaption = theCaptionSpan.firstChild.nodeValue;
				var fullSizeTitle = document.createElement('h1');
				fullSizeTitle.appendChild(document.createTextNode(theCaption));
				var closeLink = document.createElement('a');
				closeLink.id = 'closeLargePhoto';
				closeLink.appendChild(document.createTextNode('Close'));
				var fullSizePhoto = document.createElement('img');
				fullSizePhoto.id = 'fullSizePhoto';
				var largePhotoSrc = thePhoto.src;
				var theExtensionPos = largePhotoSrc.lastIndexOf('.');
				var theExtension = largePhotoSrc.substring(theExtensionPos);
				largePhotoSrc = largePhotoSrc.replace(theExtension,"_fullSize.jpg");
				
				//alert('now it is ' + largePhotoSrc);
				var photoBox = document.createElement('div');
				photoBox.id = 'photoBox';
				var largePhotoContainer = document.createElement('div');
				largePhotoContainer.id = 'largePhotoContainer';
				fullSizePhoto.src = largePhotoSrc;		
				photoBox.appendChild(fullSizeTitle);
				photoBox.appendChild(closeLink);
				photoBox.appendChild(fullSizePhoto);
				p.theBody.appendChild(largePhotoContainer);
				p.theBody.appendChild(photoBox);
				
				//if(thisLink.parentNode.id === 'largePhotoLink') {
					//window.open(thisLink,'_blank','width=1200,height=1400,scrollbars=1');
				//}
				if(thisLink.id === 'newsSlides') {
					window.open(thisLink,'_blank','width=1000,height=600,scrollbars=1');
				}
			}
		},
			
		closePhotoWindow : function(evt) {
			var thisLink = p.util.findTarget(evt,'a',this);
			if(!thisLink) {return;}
		
			if(thisLink.id === 'closeLargePhoto') {
				p.util.stopDefault(evt);
				
				
				var photoBox = document.getElementById('photoBox');
				var largePhotoContainer = document.getElementById('largePhotoContainer');
				p.theBody.removeChild(photoBox);
				p.theBody.removeChild(largePhotoContainer);
			}
		},
		
		//add footer contact to all pages except for homepage, which has footer info hard-coded
		createFooterDivs : function() {
			//home page has all footer info hard-coded so if it exists, stop now
			var footer_contact = document.getElementById('footer_contact');
			if(footer_contact) {return;}
		
			//locate footer
			var footer = document.getElementById('footer');
			
			//create first div for full society name, address, phone, email
			var div1 = document.createElement('div');
			div1.id = 'footerContact';
			//array of div1 text
			var div1Contents = ['The North Baltimore, Ohio Area Historical Society, Inc.','229 North Main Street, P.O. Box 174','North Baltimore, Ohio, 45872','(419) 257-2266','Send us an email'];
			//create 5 ps for div 1
			for(var d=0; d<5; d++) {
				var div1P = document.createElement('p');
				if(d === 0){
					var aStrong = document.createElement('strong');
					aStrong.appendChild(document.createTextNode(div1Contents[d]));
					div1P.appendChild(aStrong);
				}
				else if((d>0) && (d<4)) {
					div1P.appendChild(document.createTextNode(div1Contents[d]));
				}
				else{
					div1P.appendChild(document.createTextNode('Email: nbahs@wcnet.org' + ' '));
					var emailLink=document.createElement('a');
					emailLink.href="mailto:nbahs@wcnet.org";
					emailLink.appendChild(document.createTextNode(div1Contents[d]));
					div1P.appendChild(emailLink);
				}
				div1.appendChild(div1P);			
			}
			
			//create second div for copyright, designer link, and url for printing
			var div2 = document.createElement('div');
			//array of div1 text
			var div2Contents = ['Copyright @',' The North Baltimore, Ohio Area Historical Society, Inc. All Rights Reserved.','Site designed by ','.'];
			//create ps and append
			for(var d=0; d<3; d++) {
				var div2P = document.createElement('p');
				if(d === 0) {
					div2P.id = 'printURL';
					var theURL = location.href;
					div2P.appendChild(document.createTextNode('Printed from: '));
					var urlSpan = document.createElement('span');
					urlSpan.appendChild(document.createTextNode(theURL));
					div2P.appendChild(urlSpan);
				}if(d === 1){
					div2P.id = 'copyrightDiv';
					div2P.appendChild(document.createTextNode(div2Contents[0]));
					div2P.appendChild(document.createTextNode(p.thisYear));
					div2P.appendChild(document.createTextNode(div2Contents[1]));
				}
				if(d === 2) {
					div2P.id = 'designedBy';
					div2P.appendChild(document.createTextNode(div2Contents[2]));
					var designerLink = document.createElement('a');
					designerLink.className = 'exLink';
					designerLink.href = 'http://www.christineboltz.com/';
					designerLink.appendChild(document.createTextNode('Christine Boltz'));
					div2P.appendChild(designerLink);
					div2P.appendChild(document.createTextNode(div2Contents[3]));					
				}
				div2.appendChild(div2P);
			}
			
			footer.appendChild(div1);	
			footer.appendChild(div2);
		//in first div, insert 5 ps
		//append text to each p
		//in second div, insert 2 ps
		//append texzt to each p
		//use date object to get year
		
		},
		
		getCurrentYear : function() {
		
			var pageSpans = document.getElementsByTagName('span');
			for(var s=0,allSpans=pageSpans.length; s<allSpans; s++) {
				if(pageSpans[s].className === 'thisYear') {	
					pageSpans[s].appendChild(document.createTextNode(' in ' + p.thisYear));
				}
			}
		},
		
		//insert print logo and first word of page header for printing
		createPrintItems : function() {
			//pinpoint the h2 element which is the page title
			var theH2 = document.getElementsByTagName('h2')[0];
			
			//create print logo image and add it to the page_content div right before the h2
			var thePrintLogo = document.createElement('img');
			thePrintLogo.className = 'printLogo';
			thePrintLogo.src = 'images/printLogo.gif';
			thePrintLogo.alt="Logo of the North Baltimore Area Historical Society";
			if(theH2) {
				p.pageContent.insertBefore(thePrintLogo, theH2);			
				//add text to the beginning of h2 that matches the alt of the h2 img
				if(!p.articleList){  //the word "news" already appears on news page, article pages have no h2
					var theH2Img = theH2.getElementsByTagName('img')[0];
					var theH2ScreenText = theH2.getElementsByTagName('span')[0];
					var theAlt = theH2Img.alt;
					var theH2Span = document.createElement('span');
					theH2Span.appendChild(document.createTextNode(theAlt + " "));
					theH2Span.className = 'printOnly';
					theH2.appendChild(theH2Span);
					theH2.insertBefore(theH2Span, theH2ScreenText);
				}
			}
			else {
				//news articles have no h2 so create one
				var newH2 = document.createElement('h2');
				newH2.appendChild(document.createTextNode('News from the North Baltimore Area Historical Society'));
				newH2.className = 'printOnly';
				p.pageContent.insertBefore(newH2, p.textWithLN);
				p.pageContent.insertBefore(thePrintLogo, newH2);
			}
		}
		
		/*addClickToEnlargeLink : function() {
		
			var theDivs = p.pageContent.getElementsByTagName('div');
			for(var x=0,allDivs=theDivs.length; x<allDivs; x++) {
				if(theDivs[x].className.match('withinTextPhoto')) {
					//var theImage = theDivs[x].getElementsByTagName('img')[0];
					var theCaptionSpan = theDivs[x].getElementsByTagName('span')[0];
					var theClickLink = document.createElement('a');
					theClickLink.appendChild(document.createTextNode('Click to Enlarge'));
					theClickLink.className = 'enlargeLink';
					theClickLink.href = 'largePhoto.html';
					theCaptionSpan.appendChild(theClickLink);
					//theDivs[x].insertBefore(theClickLink, theImage);
				}
			}
		}*/
	},
	
	homePageFade : {
		crossFade : function() {
			p.oldCtr = 20;		//opacity counter for photo fading out
			p.newCtr = 0;		//opacity counter for photo fading in
		
			//insert next photo
			p.pCtr++;
			p.newP = document.createElement('img');
			p.newP.id = 'pNum' + p.pCtr;
			p.newP.className = 'op0';
			p.newP.src = 'images/topPhoto' + p.pCtr + '.jpg';
			p.thePDiv.appendChild(p.newP);
			
			//start fade
			p.fadeTimer = setInterval(p.homePageFade.fadeInOut, 50);
		},
	
		fadeInOut : function() {
		
			if(p.oldCtr > 0){
				//fade out old
				var oldOldOp = p.oldCtr;
				var newOldOp = p.oldCtr - 1;
				p.oldP.className = p.oldP.className.replace(oldOldOp,newOldOp);
				p.oldCtr--;
				//fade in new
				var oldNewOp = p.newCtr;
				var newNewOp = p.newCtr + 1;
				p.newP.className = p.newP.className.replace(oldNewOp,newNewOp);
				p.newCtr++;
			}
			else {
				clearInterval(p.fadeTimer);
				p.thePDiv.removeChild(p.thePDiv.getElementsByTagName('img')[0]);
				//start again if there are more photos
				if(p.pCtr < p.allPhotos) {
					var timer = setTimeout(p.homePageFade.crossFade, 4000);
				}
			}
		}
	},
	
	history : {
	
		hideEventDivs : function() {
			for(var x=0,allDivs=p.eachEventDivs.length; x<allDivs; x++) {
				if(p.eachEventDivs[x].id !== 'tlMarker1Events') {
					p.eachEventDivs[x].className = 'hide';
				}
			}
		},
	
		showTimePeriod : function(evt) {
			var theMarker = p.util.findTarget(evt,'a',this);
			if(!theMarker) {return;}
			
			p.util.stopDefault(evt);
			
			//hide any divs previously clicked on
			for(var x=0,allDivs=p.eachEventDivs.length; x<allDivs; x++) {
				if(p.eachEventDivs[x].className === 'show') {
					p.eachEventDivs[x].className = 'hide';
				}
			}
			
			//show this events div
			var thisEventsDiv = document.getElementById(theMarker.id + 'Events');
			thisEventsDiv.className = 'show';
		},
	
		showSlideshow : function(evt) {
			var slideshowLink = p.util.findTarget(evt,'a',this);
			p.util.stopDefault(evt);
			var theSlide = slideshowLink.href;
			window.open(theSlide,'_blank','height=400,width=600,left=200,top=100,menubar=1,toolbar=1');
			//p.history.showSlide();
		},
		
		hideDivs : function() {
			var thePhotoDivs = p.slideshowPhoto.getElementsByTagName('div');
			for(var p=0,allDivs=thePhotoDivs.length; p<allDivs; p++) {
				thePhotoDivs[p].className = 'hide';
			}
		}
	},
	
	colExp : {
	
		collapseList : function() {
			var theLinks = p.theNewsletterList.getElementsByTagName('a');
			for(var v=0,allLinks=theLinks.length; v<allLinks; v++) {
				var theLI = theLinks[v].parentNode;
				theLI.className = 'collapsed';
				var theTopicList = theLI.getElementsByTagName('ul')[0];
				theTopicList.className = 'hide';
			}
		},
	
		expandCollapse : function(evt) {
			var theItem = p.util.findTarget(evt,'li',this);
			if(!theItem) {return;}
			if(theItem.parentNode === p.theNewsletterList) {
				var theTopicList = theItem.getElementsByTagName('ul')[0];
				if(theItem.className === 'collapsed') {
					theItem.className = 'expanded';
					theTopicList.className = '';
				}
				else {
					theItem.className = 'collapsed';
					theTopicList.className = 'hide';
				}
				theItem.stopBubble(evt);
			}
		}
	},
	
	memForm : {
	
		addMemTypeClass : function() {
			var theMemTypes = document.getElementById('memDues');
			var theCells = theMemTypes.getElementsByTagName('td');
			for(var q=0,allCells=theCells.length; q<allCells; q=(q + 2)) {
				theCells[q].className = 'memType';
			}
		},
		
		addLabelClass : function() {		
			var theCells = p.theMemForm.getElementsByTagName('td');
			for(var q=0,allCells=theCells.length; q<allCells; q=(q + 2)) {
				theCells[q].className = 'labelCell';
			}
		},
		
		printBlankForm : function(evt) {
			var printBlank = this.util.findTarget(evt,'a',this);
			if(!printBlank) {return;}
			alert(printBlank.href);	
			p.util.stopDefault(evt);	
		},
		
		printForm : function() {
			var outerDiv = document.getElementById('outerContent');
			outerDiv.className = 'formOnly';
			print();
		}	
		
	},
	
	newsPage : {
	
		createNewsNav : function() {			
		
			//create div to insert article list into		
			//var newsNavDiv = document.createElement('div');
			//create h3
			var artListHdr = document.createElement('h3');
			artListHdr.appendChild(document.createTextNode('News Articles'));		
			//identify article on current page so it is not linked in list		
			//var theArticle = document.getElementById('article');
			var theArtH3 = p.textWithLN.getElementsByTagName('h3')[0];
			var theTitle = theArtH3.firstChild.nodeValue;
			//create list		
			var newsNav = document.createElement('ul');
			newsNav.id = 'newsNav';
			var articleTitles = ['Historical Center Decorates for Christmas','Vanished North Baltimore','Help Save Historical Photographs From Destruction',"What's in a Picture?"];
			var allArts = articleTitles.length - 1;			
			for(var a=allArts; a>-1; a--) {
				var artLi = document.createElement('li');
				if(articleTitles[a] !== theTitle) {
					var artLink = document.createElement('a');
					artLink.href = 'article' + (a+1) + '.html';
					artLink.appendChild(document.createTextNode(articleTitles[a]));
					artLi.appendChild(artLink);
				}
				else {
					artLi.appendChild(document.createTextNode(articleTitles[a]));
				}
				newsNav.appendChild(artLi);
			}
			var lastLI=newsNav.getElementsByTagName('li')[allArts];
			lastLI.className = 'last';
			//append list to div and div to div
			//newsNavDiv.appendChild(artListHdr);
			//newsNavDiv.appendChild(newsNav);
			//p.newsItems.appendChild(newsNavDiv);
			//p.localNav.appendChild(artListHdr);
			p.localNav.appendChild(newsNav);
			
			//create got news? div
			//create div
			/*var haveNews = document.createElement('div');
			haveNews.className = 'boxText';
			//create h3
			var haveNewsHdr = document.createElement('h3');
			haveNewsHdr.appendChild(document.createTextNode('Have Some News?'));		
			//create p
			var haveNewsP = document.createElement('p');
			//create email link
			var emailLink = document.createElement('a');
			emailLink.href = 'mailto:nbahs@wcnet.org';
			emailLink.appendChild(document.createTextNode('email us'));
			//append email link to p
			haveNewsP.appendChild(document.createTextNode('If you have any history-related news or announcements, '));
			haveNewsP.appendChild(emailLink);
			haveNewsP.appendChild(document.createTextNode(' at nbahs@wcnet.org or call (419) 257-2266.'));
			//append to div
			haveNews.appendChild(haveNewsHdr);
			haveNews.appendChild(haveNewsP);
			p.textWithLN.appendChild(haveNews);*/
		}
	},
	
	showAllAnswers : function(evt) {
		var theB = p.util.findTarget(evt,'input',this);
		if(!theB) {return;}
		
		
		/*function showRR() {
			var railroadOv = document.getElementById('railroad');
			var railroadOvLabel = document.getElementById('railroadLabel');
			
			railroadOv.className='clickedOverlay';
			railroadOvLabel.className = 'clickedOverlay label';
		}
		
		function showStreetcar() {
			var streetcarOv1 = document.getElementById('streetcar1');
			var streetcarOv2 = document.getElementById('streetcar2');
			var streetcarOvLabel = document.getElementById('streetcarLabel');
			
			streetcarOv1.className = streetcarOv2.className = 'clickedOverlay';
			streetcarOvLabel.className = 'clickedOverlay label'; 
		}
		
		function showBicycle() {
			var bicycleOv1 = document.getElementById('bicycle1');
			var bicycleOv2 = document.getElementById('bicycle2');
			var bicycleOvLabel = document.getElementById('bicycleLabel');
			
			bicycleOv1.className = bicycleOv2.className = 'clickedOverlay';
			bicycleOvLabel.className = 'clickedOverlay label';
		}
		
		function showHorse() {
			var horseOv1 = document.getElementById('horse1');
			var horseOv2 = document.getElementById('horse2');
			var horseOv3 = document.getElementById('horse3');
			var horseOvLabel = document.getElementById('horseLabel');
			
			horseOv1.className = horseOv2.className = horseOv3.className = 'clickedOverlay';
			horseOvLabel.className = 'clickedOverlay label';
		}
		
		
		function showWalkers() {
			var walkersOv1 = document.getElementById('walkers1');
			var walkersOv2 = document.getElementById('walkers2');
			var walkersOv3 = document.getElementById('walkers3');
			var walkersOvLabel = document.getElementById('walkersLabel');
			
			walkersOv1.className = walkersOv2.className = walkersOv3.className = 'clickedOverlay';
			walkersOvLabel.className = 'clickedOverlay label';
		}
		
		*/	
		if(theB.id === 'showAnswers') {
		
			
			var overlayDiv = document.getElementById('overlayPhotos');
			
			var overlayPhotos = overlayDiv.getElementsByTagName('img');
			for(var x=0,allPhotos=overlayPhotos.length; x<allPhotos; x++) {
				overlayPhotos[x].className = 'clickedOverlay';
			}
			
			var overlayLabels = overlayDiv.getElementsByTagName('p');
			for(var l=0,allLabels=overlayLabels.length; l<allLabels; l++) {
				overlayLabels[l].className = 'clickedOverlay';
			}
		}
		
	}
	
			
}; //end of meta

p.init();