	function getPath() {
	
		var p = window.location.href;
		p = p.split("/");
		return p[p.length-1].split("#")[0];
	
	}
	
	function navObj() {

		this.items = new Array();
	
	}
	
	navObj.prototype.addItem = function (item) {
	
		this.items[this.items.length] = item;
	
	}
	
	navObj.prototype.length = function () {
	
		return this.items.length;
	
	}	
	
	navObj.prototype.getItem = function (index) {
	
		return this.items[index];
	
	}
	
	navObj.prototype.isCurrent = function (index) {
	
		var ret = (getPath() == this.getItem(index).getLocation());
		var subnav = this.getItem(index).subnav;
	
		if (!ret && subnav) {
		
			var len = subnav.length();
		
			for (var i = 0; i < len; i++) {
			
				ret = subnav.isCurrent(i);
				
				if (ret) { 
				
					break; 
					
				}
			
			}
		
		}
	
		return ret;
	
	}
	
	function navItem (label, href, on, off, sub) {
	
		this.label = label ? label : "label";
		this.href = href ? href : "index.htm";
		this.on = on ? on : null;
		this.off = off ? off : null;
		this.subnav = sub ? sub : null;
		
	
	}
				
	navItem.prototype.getLocation = function () {
	
		return this.href.split("#")[0];
	
	}
	
	function drawMainNav() {
	
		var nav = MainNav;
		var len = nav.length();
		var str = "";
		var src = "";
		
		for (var i = 0; i < len; i++) {
		
			src = nav.isCurrent(i) ? nav.getItem(i).on : nav.getItem(i).off;
			str += '<a href="'+nav.getItem(i).href+'"><img src="'+src+'" id="main'+i+'" onmouseover="swapImg(\'main'+i+'\', \''+nav.getItem(i).on+'\')" onmouseout="swapImg(\'main'+i+'\', \''+src+'\')"></a>';
		
		}
		
		str += "";
		
		document.write(str);
	
	}
	
	function drawSecondNav() {
	
		var nav = MainNav;
		var len = nav.length();
		var item;
		var snav = null;
		
		for (var i = 0; i< len; i++) {
		
			if (nav.isCurrent(i)) {
			
				snav = nav.getItem(i).subnav;
				break;
			
			}		
		
		}
		
		if (snav) {
		
			nav = snav;
			len = nav.length();
	
			var str = "<ul>";
			var style = "";
			
			for (var i = 0; i < len; i++) {
			
				style = nav.isCurrent(i) ? "disabled" : "";
				str += '<li><a href="'+nav.getItem(i).href+'" class="' + style + '">'+nav.getItem(i).label+'</a></li>';
			
			}
			
			str += "</ul>";
			document.write(str);
			
		}
	
	}
	
	function drawFooterNav() {
	
		var nav = MainNav;
		var len = nav.length();
		var str = "";
		var src = "";
		
		for (var i = 0; i < len; i++) {
		
			str += i != 0 ? " | " : "";
			src = nav.isCurrent(i) ? nav.getItem(i).on : nav.getItem(i).off;
			str += '<a href="'+nav.getItem(i).href+'">'+nav.getItem(i).label+'</a>';
		
		}
		
		str += "";
		
		document.write(str);
	
	}
	
	function drawCopyright() {
	
		var str = "&copy; Copyright " + new Date().getFullYear() + ", Atkinson-Noland &amp; Associates, Inc.";
		document.write(str);	
	
	}
	
	function swapImg (id, src) {
	
		document.getElementById(id).src = src;
	
	}
	
	var popwin;
	
	function openPDF (id) {
	
		try {
	
			popwin.location = "download/"+id;
			
		} catch (e) {
	
			popwin = window.open("download/"+id, "popwin", "height=400,width=400,status=1,scrollbars=1,resizable=1");
			
		}
		
		popwin.focus();
	
	}
	
	function toggle (id, link, mssg) {
	
		var m = mssg ? mssg : "";
		
		var o = document.getElementById(id);
			o.style.display = o.style.display == "none" ? "block" : "none";
		
		var p = document.getElementById(link);
			p.innerHTML = (o.style.display == "none" ? "Show" : "Hide") + " " + m;

	}
	
	var WhoWeAreNav = new navObj();
	var WhatWeDoNav = new navObj();
	var ResourcesNav = new navObj();

	var MainNav = new navObj();
		MainNav.addItem(new navItem("Home", "index.htm", "img/home_on.gif", "img/home_off.gif"));
		MainNav.addItem(new navItem("Who We Are", "whoweare.htm", "img/whoweare_on.gif", "img/whoweare_off.gif", WhoWeAreNav));
		MainNav.addItem(new navItem("What We Do", "whatwedo.htm", "img/whatwedo_on.gif", "img/whatwedo_off.gif", WhatWeDoNav));
		MainNav.addItem(new navItem("Resources", "resources.htm", "img/resources_on.gif", "img/resources_off.gif", ResourcesNav));
		MainNav.addItem(new navItem("Contact", "contact.htm", "img/contact_on.gif", "img/contact_off.gif"));
	
	/*************************************************************************/
	//
	//   Start this is where you can edit ...
	//
	/*************************************************************************/
		
		
		// Navigation for the 'Who We Are' section
		WhoWeAreNav.addItem(new navItem("About ANA", "whoweare.htm"));
		WhoWeAreNav.addItem(new navItem("Professional Staff", "whoweare2.htm"));
		
		// Navigation for the 'What We Do' section
		WhatWeDoNav.addItem(new navItem("Professional Services", "whatwedo.htm"));
		WhatWeDoNav.addItem(new navItem("Masonry Materials &amp; Structures", "whatwedo2.htm"));
		WhatWeDoNav.addItem(new navItem("Nondestructive Testing", "whatwedo3.htm"));
		WhatWeDoNav.addItem(new navItem("Historic Preservation", "whatwedo4.htm"));
		WhatWeDoNav.addItem(new navItem("Repair &amp; Strengthening", "whatwedo5.htm"));

		// Navigation for the 'Resources' section
		ResourcesNav.addItem(new navItem("The ANA Library", "resources.htm"));
		ResourcesNav.addItem(new navItem("Recent Publications", "resources2.htm"));
		ResourcesNav.addItem(new navItem("Recent Articles", "resources4.htm"));
		ResourcesNav.addItem(new navItem("Related Links", "resources3.htm"));

	/*************************************************************************/
	//
	//   End this is where you can edit ...
	//
	/*************************************************************************/