function mapState()
{
	// set document elements to state-level info
	$("progress").innerHTML = "";
	// document.getElementById("ad1").innerHTML = '<h4>Real estate in Florida</h4><p><a href="javascript:contact();">Your ad here!</a></p><h4>Private schools in Florida</h4><p><a href="javascript:contact();">Your ad here!</a></p>';
	
	// hide markers if any, center and zoom map to show entire state for most screen resolutions
	// 31.118794,-87.769775
	// 24.29704,-79.683838
	map.clearOverlays();
	markers = [];
	
	var stateBounds = new GLatLngBounds();
	stateBounds.extend(new GLatLng(31.2, -87.9));
	stateBounds.extend(new GLatLng(24.2, -79.6));
	
	map.setCenter(stateBounds.getCenter(), map.getBoundsZoomLevel(stateBounds));

}

function updateAds()
{
	/* 
	if (map.getZoom() < 8 || topCity == '')
	{
		document.getElementById("ad1").innerHTML = '<h4>Real estate in Florida</h4><p><a href="javascript:contact();">Your ad here!</a></p><h4>Private schools in Florida</h4><p><a href="javascript:contact();">Your ad here!</a></p>';
	}
	else
	{
		document.getElementById("ad1").innerHTML = '<h4>Real estate in the ' + topCity + ' area</h4><p><a href="javascript:contact();">Your ad here!</a></p><h4>Private schools in the ' + topCity + ' area</h4><p><a href="javascript:contact();">Your ad here!</a></p>';
	}
	*/
}

function getSchoolTypeCode()
// compile school type criteria from checkboxes
{
	var stc = "0";
	if ($("elementary").checked) stc = "1";
	if ($("middle").checked)
	{
		if (stc == "0")
			stc = "2";
		else
			stc += ",2";
	}
	if ($("high").checked)
	{
		if (stc == "0")
			stc = "3";
		else
			stc += ",3";
	}
	if ($("other").checked)
	{
		if (stc == "0")
			stc = "4";
		else
			stc += ",4";
	}
	return stc;
}

function createSchoolMarker(location,cds,nces,district,school,rankinfo,avgrank)
{
	var marker = new GMarker(location, {icon: (avgrank == 1 ? icon01 : (avgrank == 2 ? icon02 : (avgrank == 3 ? icon03 : (avgrank == 4 ? icon04 : (avgrank == 5 ? icon05 : (avgrank == 6 ? icon06 : (avgrank == 7 ? icon07 : (avgrank == 8 ? icon08 : (avgrank == 9 ? icon09 : (avgrank == 10 ? icon10 : icon00)))))))))), title: school});
	
	var testresults = rankinfo.split(",");

	if (nces == 0)
	{
		var html = '<strong>' + school + '</strong><br />' + district + '<br />' +
		'<table class="testresults"><tr><th>Year:</th><th>2004</th><th>2005</th><th>2006</th></tr>' +
		'<tr><th>Grade:</th><td class="rank' + testresults[0] + '">' + testresults[0] + '</td><td class="rank' + testresults[1] + '">' + testresults[1] + '</td><td class="rank' + testresults[2] + '">' + testresults[2] + '</td></tr></table>' +
		'More info: <a href="http://schoolgrades.fldoe.org/default.asp?action=verifySelectionSchool&amp;report=RC&amp;districts=' + cds.substr(2,2) + '&amp;schoolYear=2005-2006&amp;level=School&amp;schoolNumbers=' + cds.substr(2,6) + '" target="_blank">FL Report Card</a>';
	}
	else
	{
		var html = '<strong>' + school + '</strong><br />' + district + '<br />' +
		'<table class="testresults"><tr><th>Year:</th><th>2004</th><th>2005</th><th>2006</th></tr>' +
		'<tr><th>Grade:</th><td class="rank' + testresults[0] + '">' + testresults[0] + '</td><td class="rank' + testresults[1] + '">' + testresults[1] + '</td><td class="rank' + testresults[2] + '">' + testresults[2] + '</td></tr></table>' +
		'More info: <a href="http://schoolgrades.fldoe.org/default.asp?action=verifySelectionSchool&amp;report=RC&amp;districts=' + cds.substr(2,2) + '&amp;schoolYear=2005-2006&amp;level=School&amp;schoolNumbers=' + cds.substr(2,6) + '" target="_blank">FL Report Card</a>&nbsp;&nbsp;<a href="http://nces.ed.gov/ccd/schoolsearch/school_detail.asp?ID=' + nces + '" target="_blank">US NCES</a>';
	}
	
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(html);
	});
	return marker;
}
