	$(document).ready(function(){
            
		//$(document).pngFix()
        
		$('div.grantee')
            .gmap('init', {mapDivId:'map_canvas'})
            	.filter('.video')
					.gmap('add', {
						iconUrl:'http://ajws.org/hunger/images/map_video.png',
						iconSize: new google.maps.Size(24,24),
						iconAnchor: new google.maps.Point(8,12),
						zIndex: 3,
						onLoad: function(){
							$('#map_control').appendTo('#map_canvas').show();
						}
					})
					.gmap('mouseover', switchGrantee)
					.gmap('click', function(){
						location.href = $(this).find('a,h1').attr('href')
					})
					.end()
				.filter('.featured:not(.video)')
                    .gmap('add', {
                        iconUrl:'http://www.ajws.org/hunger/images/feature_marker.png',
                        zIndex: 2
                    })
					.gmap('mouseover', switchGrantee)
					.gmap('click', function(){
						location.href = $(this).find('a,h1').attr('href')
					})
                    .end()
				.filter(':not(.featured)')
					.gmap('add', {
                        iconUrl:'http://ajws.org/hunger/images/grantee_marker.png',
                        zIndex: 1
                    })
					.gmap('mouseover', switchGrantee)
					.end()
					
		function switchGrantee(){
			if ($(this).find('a,h1').text() != $('a, h1', 'div.grantee:visible').text()){
				$('div.grantee:visible, div#intro', 'div#grantees').hide()
				$(this).fadeIn()
			}
		}

		$('input#signup').focus(function(){$(this).attr('value','')})
		
		$('#map_control input').click(function(e){
			$cell = $(e.target)
			var markerset = $cell.val()
			if (markerset == 'video') 
				$('div.grantee.video').gmap('toggle')
			else if (markerset == 'featured') 
				$('div.grantee.featured:not(.video)').gmap('toggle')
			else
				$('div.grantee:not(.featured)').gmap('toggle')
		})
		
		addDonateListener()
	})

