$(function() {
// modify global settings
	$.extend($.fn.Tooltip.defaults, {
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - "
	});
		$('area').Tooltip();
});
$(document).ready(function(){
	$('#chvnw area, #chvne area, #chvic area, #chvsw area, #chvse area, #chvch area ').click( function() {
		$("#mapForm #neghsubdname").val($(this).attr("toolTipText"));
		$("#mapForm").submit();
	});

	$("#userForm").validate({
		event: "keyup", event2: "change", event3: "click",
		errorContainer: $("#userForm div.container"),
		rules: {
			userneghsubdname: {
				required: true
			}
		},
		messages: {
			userneghsubdname: {
				required: "Error! You must select a Community to Continue"
			}
		}
	});
});
function changeMap(map){
	$("#chvmaps div").hide();
	$(map).show();
}

var imgCount = 0;

function countImg(){
	imgCount++;
	checkReadyState();
}
function checkReadyState(){
	if(imgCount == 6){
		$("#chvloading").hide();
		$("#chvcore").show();	
	}
}