function initdashbuttons() {
	var container = MM_findObj('dashboardlinks');
	var boxes = container.getElementsByTagName('h2');
	var i;
	for (i=0; i<boxes.length; i++) {
		if (boxes[i].id.substr(0,10) == 'dashbutton') {
			boxes[i].onclick = function () { dashbuttonclick(this) };
			boxes[i].title = 'click to expand';
		}
	}
}

function dashbuttonclick(which, e) {
	var o = MM_findObj('dashcontent' + which.id.substr(10,1));
	if (which.className == 'contracted') {
		which.title = 'click to contract';
		which.className = 'expanded';
		o.style.visibility = 'visible';
		o.style.display = 'block';
	} else {
		which.title = 'click to expand';
		which.className = 'contracted';
		o.style.visibility = 'hidden';
		o.style.display = 'none';
	}
}

function GoogleMap() {
	var t = MM_findObj('nationalfeaturetop');
	var n = MM_findObj('topsubnav');
	var c = MM_findObj('topcontent');
	var l = MM_findObj('GoogleMapStateClose');
	if (!window.marketfeatureHTML) {
		window.marketfeatureHTML = t.innerHTML;
		window.mapison = 0;
		BuildGoogleMap();
	}
	if (window.mapison == 0) {
		window.mapison = 1;
		t.innerHTML = '<div style="width:700px;height:390px;"></div>';
		MM_showHideLayers('GoogleMapStateContainer', '', 'show');
		MM_showHideLayers('GoogleMapStateClose', '', 'show');
		n.className = 'clear';
		c.className = 'clear';
		l.innerHTML = '<a href="" onClick="return GoogleMap()">CLOSE MAP</a>';
	} else {
		window.mapison = 0;
		t.innerHTML = window.marketfeatureHTML;
		MM_showHideLayers('GoogleMapStateContainer', '', 'hide');
		MM_showHideLayers('GoogleMapStateClose', '', 'hide');
		n.className = '';
		c.className = '';
		initnationalfeature();
	}
	return false;
}

addLoadEvent(initdashbuttons);
