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

DTech.Functions = {
	
	init : function() {
		Event.onDOMReady(function() {
			DTech.Functions.formatNavigation();
			DTech.Functions.formatLists();
			
			if ($('movie')) {
				swfobject.embedSWF("Includes/swf/" + DTech.Functions.rand(6) + ".swf", "movie", "752", "176", "9.0.28", "Includes/swf/expressInstall.swf");
			}
		});
	},
	
	formatNavigation : function() {
		if ($('content')) {
			if ($A($('content').classNames()).length > 0) {
				$('nav' + $A($('content').classNames())[0].split('-')[1]).up('li').addClassName('current');
			}
		}
	},
	
	formatLists : function() {
		$A(document.getElementsByClassName('records')).each(function(obj) {
			var count = 0;
			
			if (!obj.hasClassName('nostyle')) {
				$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);
	},
	
	rnd : function() {
		var seed = new Date().getTime();
		seed = ((seed * 9301 + 49297) % 233280);
		
		return (seed / (233280.0));
	},
	
	rand : function(number) {
		return Math.ceil(DTech.Functions.rnd() * number);
	},

	map: function() {
		var domains = new Array(
			new Array('www.brooksfuneral.com', 'ABQIAAAAMdZp_NFg_FtI0G6h5LKbORQFnsnQb0_p8rQsWSzkTLM1mTBKHxQv-76mUp4rRubzVKFYhMh4WF0eOQ')
		);
		
		DT.Maps.insert(domains);
	}
	
};

DTech.Functions.init();