(function($){
$.fn.overlabel = function() {
    this.each(function(index) {
        var label = $(this); var field;
        var id = this.htmlFor || label.attr('for');
		if (id && (field = document.getElementById(id))) {
            var control = $(field);
			label.addClass("overlabel-apply");
            if (field.value !== '') {
                label.css("text-indent", "-1000px");
            }
            control.focus(function () {label.css("text-indent", "-1000px");}).blur(function () {
                if (this.value === '') {
                    label.css("text-indent", "0px");
                }
            });
            label.click(function() {
                var label = $(this); var field;
                var id = this.htmlFor || label.attr('for');
                if (id && (field = document.getElementById(id))) {
                    field.focus();
                }
            });
        }
    });
}
})(jQuery);

$(document).ready(function() {
	$("label.overlabel").overlabel();
	
	var mapdiv = $('#usamapdiv');
	
	// nav buttons: text replaced with img
	$('#n1 a').html(
	'<img src="' + basehref + 'img/nav1.png" width="120" height="40" border="0" alt="">');
	$('#n3 a').html(
	'<img src="' + basehref + 'img/nav3.png" width="120" height="40" border="0" alt="">')
		.click( function() { mapdiv.slideToggle("slow"); return false; } );
	$('#n4 a').html(
	'<img src="' + basehref + 'img/nav4.png" width="120" height="40" border="0" alt="">');
	
	$('#usamapdiv .closebtn').click( function() { mapdiv.slideToggle("slow"); } ); 
});
