var infoWindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById("map_canvas"));
var point765 = new google.maps.LatLng(42.740118, -90.486722);
var point775 = new google.maps.LatLng(42.740199, -90.487038);
var ridge = new google.maps.LatLng(42.739383, -90.488672);
var pine = new google.maps.LatLng(42.733965, -90.482057);
var court = new google.maps.LatLng(42.739099, -90.487703);
var bluff = new google.maps.LatLng(42.727830, -90.477347);
var wash570 = new google.maps.LatLng(42.739767, -90.485904);
var wash538 = new google.maps.LatLng(42.739298, -90.485936);
var pine_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: pine,
    title: 'Pine Street Village\n330 W. Pine St'
});
var point765_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: point765,
    title: '765 Pioneer Point\n765 W. Madison St'
});
var point775_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: point775,
    title: '775 Pioneer Point\n775 W. Madison St'
});
var ridge_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: ridge,
    title: 'Pioneer Ridge\n880 Union St'
}); 
var court_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: court,
    title: 'Pioneer Court\n830 Union St'
});
var bluff_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: bluff,
    title: 'Pioneer Bluff\n90 E. Gridley Ave'
});
var wash570_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: wash570,
    title: '570 N. Washington St Duplex'
});
var wash538_marker = new google.maps.Marker({
    map:map,
    animation: google.maps.Animation.DROP,
    position: wash538,
    title: '538-540 N. Washington St Duplex'
});
var pine_content = '<div class="infowindow"><h1>Pine Street Village</h1><img src="images/pinemain.jpg" /><ul><li>1 and 2 bedroom apartments</li><li>Laundry on each floor</li><li>Air Conditioning</li><li>Handicap Accessible</li><li><a href="pine.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';
var point765_content = '<div class="infowindow"><h1>765 Pioneer Point</h1><img src="images/765.jpg" /><ul><li>4/2 or 2/1 apartments</li><li>On-site Laundry</li><li>Air Conditioning</li><li>Handicap Accessible</li><li><a href="point765.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';
var point775_content = '<div class="infowindow"><h1>775 Pioneer Point</h1><img src="images/775.jpg" /><ul><li>4/2 or 2/1 apartments</li><li>On-site Laundry</li><li>Air Conditioning</li><li>Handicap Accessible</li><li><a href="point765.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';
var ridge_content = '<div class="infowindow"><h1>Pioneer Ridge</h1><img src="images/ridgemain.jpg" /><ul><li>4 bedroom/2 bathroom</li><li>On-site Laundry</li><li>Air Conditioning</li><li>Handicap Accessible</li><li><a href="ridge.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';
var court_content = '<div class="infowindow"><h1>Pioneer Court</h1><img src="images/courtmain.jpg" /><ul><li>4 bedroom/2 bathroom</li><li>On-site Laundry</li><li>Air Conditioning</li><li>Handicap Accessible</li><li><a href="court.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';
var bluff_content = '<div class="infowindow"><h1>Pioneer Bluff</h1><img src="images/bluffmain.jpg" /><ul><li>4/2 or 2/1 apartments</li><li>On-site Laundry</li><li>Air Conditioning</li><li>Handicap Accessible</li><li><a href="bluff.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';
var wash570_content = '<div class="infowindow"><h1>570 N. Washington Duplex</h1><img src="images/duplexmain.jpg" /><ul><li>2 or 4 bedroom</li><li>On-site Laundry</li><li>Air Conditioning</li><li>Parking &amp; Storage</li><li><a href="duplex.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';
var wash538_content = '<div class="infowindow"><h1>538-540 N. Washington Duplex</h1><img src="images/540538nwash2.jpg" /><ul><li>2 or 4 bedroom</li><li>On-site Laundry</li><li>Air Conditioning</li><li>Off-street Parking</li><li><a href="538wash.php">See More...</a></li></ul><div style="clear:both;height:0px;">&nbsp;</div></div>';

function initialize() {
    var zoom=14;
    var center = new google.maps.LatLng(42.73326, -90.48841);
    var options = {
        zoom: zoom,
        center: center,
        mapTypeId: google.maps.MapTypeId.HYBRID
    };
    map.setOptions(options);
    
    google.maps.event.addListener(infoWindow, 'closeclick', function(){map.panTo(center);map.setZoom(zoom);});
    google.maps.event.addListener(point765_marker, 'click', function(){infoBox("point765");});
    google.maps.event.addListener(point775_marker, 'click', function(){infoBox("point775");});
    google.maps.event.addListener(ridge_marker, 'click', function(){infoBox("ridge");});
    google.maps.event.addListener(pine_marker, 'click', function(){infoBox("pine");});
    google.maps.event.addListener(pine_marker, 'click', function(){infoBox("pine");});
    google.maps.event.addListener(court_marker, 'click', function(){infoBox("court");});
    google.maps.event.addListener(bluff_marker, 'click', function(){infoBox("bluff");});
    google.maps.event.addListener(wash570_marker, 'click', function(){infoBox("wash570");});
    google.maps.event.addListener(wash538_marker, 'click', function(){infoBox("wash538");});
}

function infoBox(which){
    infoWindow.close();
    infoWindow.setContent(eval(which+"_content"));
    map.panTo(eval(which));
    map.setZoom(17);
    infoWindow.open(map, eval(which+"_marker"));
}
