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

DTech.Functions = {
	
	init : function() {
		Event.onDOMReady(function() {
			DTech.Functions.formatNavigation();
			DTech.Functions.formatLists();
		});
	},
	
	formatNavigation : function() {
		if ($('content_right')) {
			if ($A($('content_right').classNames()).length > 0) {
				$('nav' + $A($('content_right').classNames())[0].split('-')[1]).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('rlist');
					}
					
					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('www.foresightfamily.org', 'ABQIAAAAWwHQNOdQluzbXjRqAxpjbBTpJxxew_AJRa_1EoxV-NZ73cKtpRRZApJr0XwaLuKAnBwyCzKSqd3QIw');
				new Array('foresightfamily.org', 'ABQIAAAAWwHQNOdQluzbXjRqAxpjbBSriL3KPZ4p3WFmilh1XxxuW_4LkBShbG8gKlKxbhjLcLEqSDLEMkIi0A');
		
		DT.Maps.insert(domains);
	}
	
};

DTech.Functions.init();
