var DTech = new Object();

DTech.Functions = {
	
	init : function() {
		Event.onDOMReady(function() {
			DTech.Functions.formatNavigation();
			DTech.Functions.formatLists();
		});
	},
	
	formatNavigation : function() {
		var obj;
		
		if ($('content')) {
			obj = $('content');
		}
		else if ($('content-full')) {
			obj = $('content-full');
		}
		
		if (typeof obj != 'undefined') {
			$('nav' + $A(obj.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('www.rectorfuneralhome.com', 'ABQIAAAAMdZp_NFg_FtI0G6h5LKbORQskGCYQ_5yNW7y7WRJiInLew0onRRbXjHPz9BZrGk5yHCVVBWm-eAjuw'),
			new Array('rectorfuneralhome.com', 'ABQIAAAAQEeiNmZSZxFm0ebRgAk8vxTtiIjhgP9af7ZDhT86k1Lbq95ItxQnYChJF8rq6MqXTMCjXwwnmqC-Dw')
		);
		
		DT.Maps.insert(domains);
	}
	
};

DTech.Functions.init();