function openFrontpageFile(sID, sField2)
{
	var queryString;
	queryString  = escape(sID);
	var queryDirectory;
	queryDirectory  = escape(sField2);	
	var newWin = window.open("http://www.bostonphotonics.org/files/" + queryDirectory + "/" + queryString);
	return false;
}

//function openFrontpageFile(sID)
//{
//	var queryString;
//	//queryString  = '?ID=' + escape(sID);
//	queryString  = escape(sID);	
//	// var newWin = window.open("http://www.bostonphotonics.org/getfile.asp" + queryString);
//	var newWin = window.open("http://www.bostonphotonics.org/files/" + queryString);
//	return false;
//}

function ShowMap() {
	// Creating Icons
    //
    // Creates a new type of icon, using the
    // <a href="http://labs.google.com/ridefinder/">Google Ride Finder</a> "mini"
    // markers as an example. We have to specify the foreground image, the shadow
    // image, and the points at which we anchor the icon to the map and anchor the
    // info window to the icon.
    
    // Create our "tiny" marker icon
    var icon = new GIcon();
    icon.image = 'images/mm_20_red.png';
    icon.shadow = 'images/mm_20_shadow.png';
    icon.iconSize = new GSize(12, 20);
    icon.shadowSize = new GSize(22, 20);
    icon.iconAnchor = new GPoint(6, 20);
    icon.infoWindowAnchor = new GPoint(5, 1);
      
    // Create our 'tiny' marker icon
    var iconAirport = new GIcon();
    iconAirport.image = 'images/mm_20_red_airport.png';
    iconAirport.shadow = 'images/mm_20_shadow.png';
    iconAirport.iconSize = new GSize(12, 20);
    iconAirport.shadowSize = new GSize(22, 20);
    iconAirport.iconAnchor = new GPoint(6, 20);
    iconAirport.infoWindowAnchor = new GPoint(5, 1);
      
    // Create our 'tiny' marker icon
    var iconOurhouse = new GIcon();
    iconOurhouse.image = 'images/mm_20_red_our.png';
    iconOurhouse.shadow = 'images/mm_20_shadow.png';
    iconOurhouse.iconSize = new GSize(12, 20);
    iconOurhouse.shadowSize = new GSize(22, 20);
    iconOurhouse.iconAnchor = new GPoint(6, 20);
    iconOurhouse.infoWindowAnchor = new GPoint(5, 1);
      
    // Create our 'tiny' marker icon
    var iconVenue = new GIcon();
    iconVenue.image = 'images/mm_20_red_venue.png';
    iconVenue.shadow = 'images/mm_20_shadow.png';
    iconVenue.iconSize = new GSize(12, 20);
    iconVenue.shadowSize = new GSize(22, 20);
    iconVenue.iconAnchor = new GPoint(6, 20);
    iconVenue.infoWindowAnchor = new GPoint(5, 1);
      
    // Create our 'tiny' marker icon
    var iconHotel = new GIcon();
    iconHotel.image = 'images/mm_20_red_hotel.png';
    iconHotel.shadow = 'images/mm_20_shadow.png';
    iconHotel.iconSize = new GSize(12, 20);
    iconHotel.shadowSize = new GSize(22, 20);
    iconHotel.iconAnchor = new GPoint(6, 20);
    iconHotel.infoWindowAnchor = new GPoint(5, 1);
      
    var iconbig = new GIcon();
    iconbig.image = 'images/marker_34_red.png';
    iconbig.shadow = 'images/shadow50.png';
    iconbig.iconSize = new GSize(20, 34);
    iconbig.shadowSize = new GSize(37, 34);
    iconbig.iconAnchor = new GPoint(6, 34);
    iconbig.infoWindowAnchor = new GPoint(5, 1);

    // Center the map on Palo Alto
    //var map = new GMap(document.getElementById("map"));
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(42.349297, -71.106696), 14);
     
    // Creates one of our tiny markers at the given point
    function createMarkerSM(point,strHtml,iconType) {
	    var marker = new GMarker(point, iconType);
	    map.addOverlay(marker);
	    GEvent.addListener(marker, "click", function() {
		    marker.openInfoWindowHtml(strHtml);
	    });
    }
    function createMarker(point,strHtml) {
	    var marker = new GMarker(point, iconbig);
	    map.addOverlay(marker);
	    GEvent.addListener(marker, "click", function() {
		    marker.openInfoWindowHtml(strHtml);
	    });
    }

	// Create marker by address
	//var mapaddress = new GMap2(document.getElementById("map"));
	var geocoder = new GClientGeocoder();
	
	function showAddressSM(address,strHtml,iconType) {
	  geocoder.getLatLng(
	    address,
	    function(point) {
	      if (!point) {
	        alert(address + " not found");
	      } else {
	        var marker = new GMarker(point, iconType);
	        map.addOverlay(marker);
		    GEvent.addListener(marker, "click", function() {
			    marker.openInfoWindowHtml(strHtml);
		    });
	      }
	    }
	  );
	}
	
    // Place the icons randomly in the map viewport
	// The Photonics Center
	var dest= '8 Saint Marys Street, Boston, MA 02215'
	var strHtml='<p style="font-size:12pt;"><b><i><a href="http://www.bu.edu/photonics/">Boston University Photonics Center</a></i></b><br/>'+
			    dest+'<br/>'+
			    'Phone: (617) 353-8899</p>'+
				'<form action="http://maps.google.com/maps" method="get">'+
				'<label for="saddr"><span style="font-size:10pt;">Your Address:</span></label><br>'+
				'<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>'+
				'<INPUT ID="SUBMIT" TYPE="SUBMIT" VALUE="Get directions to here.">'+
				'<input type="hidden" name="daddr" value="'+dest+'" />'+
				'<input type="hidden" name="hl" value="en" /></form>';
	//createMarkerSM(new GPoint(-70.837526, 42.669794),strHtml,iconVenue);
	showAddressSM(dest,strHtml,iconVenue);
}
