function createMap( iconPath, logoPath )
{
    /*specify new map: parameter is the dom element wear you want the map to go*/
    var map = new GMap2(document.getElementById("map"));
    var centermap = new GLatLng(39.752772, -86.099296);
    var zoomlevel = 13;
    //initializes the map object: you must do this to start.
    //first parameter is the latitude and longitude of the map.
    //second parameter is the zoom lvl of the map.
    map.setCenter( centermap, zoomlevel );
	map.setMapType(G_HYBRID_MAP);
    
    //define coordinates
    var locationOne = new customIcon();
        locationOne.latitude = 39.752772;
        locationOne.longitude = -86.099296;
        locationOne.imagePath = iconPath;
        locationOne.imageWidth = 50;
        locationOne.imageHeight = 25;
        locationOne.iconAnchorHeight = 0;
        locationOne.iconAnchorWidth = 0;
        locationOne.infoAnchorWidth = 0;
        locationOne.infoAnchorHeight = 0;
        locationOne.infoWindowHTML = '<span style="color:#000000; display:block;"><b>F.A. Wilhelm Construction, Inc.</b><br />3914 Prospect Street<br />Indianapolis, IN 46203<br />Phone: 317.359.5411<br /><br /></span>';
        locationOne.addToMap( map );
        locationOne.addPointLink( 'locationOne' );
	
    /*map controls*/
    var mapTypeControl = new GMapTypeControl();
    var typeTopRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(4, 4));

    var mapSmallZoomControl = new GSmallZoomControl3D();
    var zoomTopRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(4, 25));

    map.addControl( mapSmallZoomControl, zoomTopRight );
    map.addControl( mapTypeControl, typeTopRight );
}

/**
 * Event Workaround for IE and [Insert standards compliant browser here]
 * @source Scott Andrew
 */
function addEvent( domObject , szEvent, funcHandler, bUseCapture) 
{
    if( bUseCapture == null )
    {
        bUseCapture = true;
    }

    //FF
    if( domObject.addEventListener )
    {
        switch( szEvent )
        {
            case 'onclick':
                szEvent = 'click';
            break;
        }
		
        domObject.addEventListener( szEvent, funcHandler, bUseCapture );
		return true;
    }
    else if ( domObject.attachEvent )
    {
        switch( szEvent )
        {
            case 'click':
                szEvent = 'onclick';
            break;
        }
		
        var r = domObject.attachEvent( szEvent, funcHandler );
		return r;
    }
	else 
    {
		domObject[szEvent] = funcHandler;
	}

	return true;
}

function customIcon()
{
    this.mapObject;
    this.latitude;
    this.longitude;
    this.imagePath;
    this.imageWidth;
    this.imageHeight;
    this.iconAnchorWidth;
    this.iconAnchorHeight;
    this.infoAnchorWidth;
    this.infoAnchorHeight;
    this.infoWindowHTML;
    this.marker;

    this.addToMap = function( mapObject )
    {

        var point = new GLatLng( this.latitude, this.longitude );
        //create the new icon object
        var icon = new GIcon(null, this.imagePath );
        //the size of the icon
        icon.iconSize = new GSize( this.imageWidth, this.imageHeight );
        //where the icon is anchored to
        icon.iconAnchor = new GPoint( this.iconAnchorWidth, this.iconAnchorHeight);
        //where the information box is anchored to
        icon.infoWindowAnchor = new GPoint( this.infoAnchorWidth, this.infoAnchorHeight);
        //create the marker object
        var marker = new GMarker( point, { 'icon':icon } );
        var html = this.infoWindowHTML;
        GEvent.addListener( marker, "click", function() { marker.openInfoWindowHtml( html ) });
        //add to map
        mapObject.addOverlay( marker );
        this.marker = marker;
    }

    this.addPointLink = function ( idDomElement )
    {
        var element = document.getElementById( idDomElement );
        var marker = this.marker;
        var html = this.infoWindowHTML;
        addEvent( element, 'click', function() { marker.openInfoWindowHtml( html ); }, true ); 
    }
}

