// JavaScript Document

var textsize;
var fontmax = 1;
var fontmin = 0.65;
var fontdefault = 0.75;

function show_answer(answer) {
	if(!document.getElementById) return false;
	if(!document.getElementsByTagName) return false;

	var find_all = document.getElementsByTagName("dd");
	var show = document.getElementById("answer" + answer);

	for(x=1; x<=find_all.length; x++) {
		document.getElementById("answer" + x).style.display = "none";
	}
	
	show.style.display = (show.style.display=="none") ?  "block" : "none";

}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	window.document.cookie = name+"="+value+expires+"; path=/";
	return false;
}
function changetextsize(dir){
	if(dir=='up'){
		window.document.body.style.fontSize = fontmax+"em";
		createCookie("textsizestyle", fontmax, 365);
	}else if(dir == 'default'){
		window.document.body.style.fontSize = fontdefault+"em";
		createCookie("textsizestyle", fontdefault, 365);
	}else{
		window.document.body.style.fontSize = fontmin+"em";
		createCookie("textsizestyle", fontmin, 365);
	}
	return false;
}

function showAddress(address) {
	if (geocoder) 
	{
		geocoder.getLatLng(address,
		function(point) 
		{
			if (!point) 
			{
				alert(address + " not found");
			} 
			else 
			{
				map.setCenter(point, 12);
				var marker = new GMarker(point);
				map.addOverlay(marker);
			}
		});
	}
}

function filterByCounty() {
	location.href = document.getElementById('county').value;	
}