
function myIdentify(pos){
		    var pixel = new OpenLayers.Pixel(pos.x,pos.y);
		    var lonlat = map.getLonLatFromPixel(pixel);
                getDetails(lonlat.lat,lonlat.lon);
}
function changeOpacity(byOpacity) {
      var maxOpacity = 0.9;
      var minOpacity = 0.1;
      var newOpacity = (parseFloat(document.getElementById('hOpacity').value) + byOpacity).toFixed(1);
      newOpacity = Math.min(maxOpacity,Math.max(minOpacity, newOpacity));
	document.getElementById('hOpacity').value = newOpacity
	document.getElementById('txtopacity').innerHTML = newOpacity
	CreateThematicMap()
}
function changeOpacity2() {
	document.getElementById('mapOpacity').options[document.getElementById('mapOpacity').selectedIndex].value
	document.getElementById('hOpacity').value = document.getElementById('mapOpacity').selectedIndex
	CreateThematicMap()
}
function ZoomCounty(name){
  zoomcountySelect = document.getElementById(name)
  myString = zoomcountySelect.options[zoomcountySelect.selectedIndex].value
  var mySplitResult = myString.split(",");
  var val1 = parseInt(parseInt(mySplitResult[0]) + parseInt(-40000))
  var val2 = parseInt(parseInt(mySplitResult[1]) + parseInt(40000))
  var val3 = parseInt(parseInt(mySplitResult[2]) + parseInt(40000))
  var val4 = parseInt(parseInt(mySplitResult[3]) + parseInt(-40000))
  var usBounds = new OpenLayers.Bounds(val1, val2, val3, val4)
  map.zoomToExtent(usBounds);


}
function FullExtent(){
            var usBounds = new OpenLayers.Bounds(mapExtent[0], mapExtent[1], mapExtent[2], mapExtent[3]);
		map.zoomToExtent(usBounds);
}
function MapReset(varname){

if (map.getNumLayers() == 13){map.removeLayer(thethematic)};
	var divlegendEl = document.getElementById(varname);
	divlegendEl.style.display = 'none';
	iswms = false;
	FullExtent()
}

function layerOnOff(id){
if (id == 'selected'){
	if (selected){}
	else{return}
}
map.getLayersByName(id)[0].setVisibility(document.getElementById(id).checked) 
//mapLayerActivateDeactivate(id,thecheckbox.checked) 		
}
function setHiddenValsLabels(jlayer, thehidden){
	if (document.getElementById(jlayer).checked != true)
		document.getElementById(thehidden).value = "yes"
	else
		document.getElementById(thehidden).value = "no"
}
function addremoveLabelChecker(thecheckbox, layer, layerwlabel, thecheckboxLabel){
var visLayer = layer.getVisibility()
var visLayerLabel = layerwlabel.getVisibility()
		if (document.getElementById(thecheckbox).checked == true){
			if (document.getElementById(thecheckboxLabel).checked == true){
				layer.setVisibility(false)
				layerwlabel.setVisibility(true)
			}else{
				layer.setVisibility(true)
				layerwlabel.setVisibility(false)
			}
		}else{
			layer.setVisibility(false)
			layerwlabel.setVisibility(false)
		}
}



