var DTech = new Object();
var win = null;

DTech.Functions = {
	
	init : function() {
		Event.onDOMReady(function() {
			DTech.Functions.formatNavigation();
			DTech.Functions.formatLists();
		});
	},
	
	formatNavigation : function() {
		if ($('content')) {
			if ($A($('content').classNames()).length > 0) {
				$('nav' + $A($('content').classNames())[0].split('-')[1]).addClassName('current');
			}
		}
	},
	
	formatLists : function() {
		$A(document.getElementsByClassName('records')).each(function(obj) {
			var count = 0;
			
			$A(obj.getElementsByTagName(obj.tagName.toLowerCase() == 'dl' ? 'dd' : 'tr')).each(function(dd) {
				if (count % 2 != 0) {
					dd.addClassName('alt');
				}
				
				count++;
			});
		});
	},
	
	popWindow : function(mypage, myname, w, h, scroll) {
		LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
		TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
		settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable';
		win = window.open(mypage, myname, settings);
	},

	map: function() {
		var domains = new Array(
			new Array('heritagefuneralchapels.com', 'ABQIAAAAYzKLIBt1dfSh_WmX5OrvEhRT8mtAOe1iK8wfVfqVfevT6thIRxS1MMOtScJWkolfMPSxFC5vD6c63w'),
			new Array('www.heritagefuneralchapels.com', 'ABQIAAAAYzKLIBt1dfSh_WmX5OrvEhR28GKHxmpIcflC_xCYO1bWlUCGYRSWL_efSVNhtjgyxymMvaZ4hL8esQ')
		);
		
		DT.Maps.insert(domains);
	}
	
};

DTech.Functions.init();

var win = null;
function popWindow(url, name, width, height, toolbar, location, scrollbars) {
	var left = (screen.width ? ((screen.width - width) / 2) : 0);
	var top = (screen.height ? ((screen.height - height) / 2) : 0);
	var t = ((Prototype.Browser.IE && (navigator.appVersion.search(/MSIE\ 7\.0/) > -1) && (toolbar = 'yes')) ? 'no' : toolbar);
	var settings = 'height=' + height + ',width=' + width + ',top=' + top + ',left=' + left + ',toolbar=' + t + ',location=' + location + ',scrollbars=' + scrollbars;
	var win = window.open(url, name, settings);
}