
function regionZoom(feature) {

	if (feature == 'mv') {
		_map.setCenter(new OpenLayers.LonLat(-13034796, 3866868), 15);
	}
	else if (feature == 'cv') {
		_map.setCenter(new OpenLayers.LonLat(-13049616,3888170), 15);
	}
	else if (feature == 'sr') {
		_map.setCenter(new OpenLayers.LonLat(-13037290,3884109), 15);
	}

}

function layerSwitch(id) {

	if (id == 'res') {
		var vis = _solar_res.getVisibility();
		switch(vis) {
			case true:
				_solar_res.setVisibility(false);
				document.getElementById(id).src = "img/unchecked.png";
				break;
			case false:
				_solar_res.setVisibility(true);
				document.getElementById(id).src = "img/checked.png";
				break;
		}
	}
	else if (id == 'oth') {
		var vis = _solar_oth.getVisibility();
		switch(vis) {
			case true:
				_solar_oth.setVisibility(false);
				document.getElementById(id).src = "img/unchecked.png";
				break;
			case false:
				_solar_oth.setVisibility(true);
				document.getElementById(id).src = "img/checked.png";
				break;
		}
	}
	else if (id == 'safe') {
		var vis = _solar_safe.getVisibility();
		switch(vis) {
			case true:
				_solar_safe.setVisibility(false);
				_solar_poly.setVisibility(false);
				document.getElementById(id).src = "img/unchecked.png";
				break;
			case false:
				_solar_poly.setVisibility(true);
				_solar_safe.setVisibility(true);
				document.getElementById(id).src = "img/checked.png";
				break;
		}
	}
	else if (id == 'zipcode') {
		var vis = _solar_zip.getVisibility();
		switch(vis) {
			case true:
				_solar_zip.setVisibility(false);
				document.getElementById(id).src = "img/unchecked.png";
				break;
			case false:
				_solar_zip.setVisibility(true);
				document.getElementById(id).src = "img/checked.png";
				break;
		}
	}
}

function isURL(url) {
	if(url != undefined) {
		if (url != 'undefined') {
			window.open(url,'Solar Installer');
		}
	}

}

function switchBaseLayer(baselayer) {

	switch (baselayer) {
		case 'hyb':
			_map.setBaseLayer(ghyb);
			break;
		case 'sat':
			_map.setBaseLayer(gsat);
			break;	
		case 'map':
			_map.setBaseLayer(gmap);
			break;
		case 'ter':
			_map.setBaseLayer(gphy);
			break;
	}

}