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('www.ludvigsenmortuary.com', 'ABQIAAAAMdZp_NFg_FtI0G6h5LKbORRmZg6yIbhwY2De8l-T6lpLe72pjRRIr8CpZ8QqbhWR7BiZ9UiknC6u0w'),
			new Array('www.hooper-scribner.com','ABQIAAAAMdZp_NFg_FtI0G6h5LKbORTYQzTDBgmRkY_Vdy3xeiQXp07vFxTZHqeTlY3FeokoZXR87Ab4d8g7Hg'),
			new Array('ludvigsenmortuary.com', 'ABQIAAAAQEeiNmZSZxFm0ebRgAk8vxQtwNJzfdHWsAiyqbWOTRxCladDpxRXgRGuQzbAeGkJNYFG55GXWKhAwA'),
			new Array('hooper-scribner.com','ABQIAAAAQEeiNmZSZxFm0ebRgAk8vxTYQzTDBgmRkY_Vdy3xeiQXp07vFxSP10V6cwhqrDZmn6UGEiRvZNEMwA')
		);
		
		DT.Maps.insert(domains);
	}
	
};

DTech.Functions.init();