var tooltip;
function createMarker(point,name,message,file,tip,type){
        //create an icon using the png files in roadWx/images.
        var icon = new GIcon();
        //icon.image = "/slc/gmap/precipIcons/"+file+".png";
        icon.image = "http://www.wrh.noaa.gov/slc/gmap/aIcon.php?num="+file+"&type="+type;
        //icon.shadow = "http://www.slc.noaa.gov/slc/roadWx/boxs.png";
        icon.iconSize = new GSize(32 ,32);
        //icon.shadowSize = new GSize(25, 25);
        icon.iconAnchor = new GPoint(11, 30);
        icon.infoWindowAnchor = new GPoint(11, 1);

        var marker=new GMarker(point,icon);
        GEvent.addListener(marker,"click",function(){
                map.openInfoWindowHtml(point,message);
                //panToPoint(point,message);
        });
        //enableToolTip(marker,tip,tooltip);
        return marker;
}

function enableToolTip(marker,text,tooltip){

	function placeTooltip(mousePosition){
		currtype = map.getCurrentMapType().getProjection();
		startPoint = currtype.fromLatLngToPixel(map.fromDivPixelToLatLng(new GPoint(50, 60), true), map.getZoom());
		var offset = currtype.fromLatLngToPixel(mousePosition, map.getZoom());
		var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(offset.x - startPoint.x, offset.y - startPoint.y));
		pos.apply(tooltip);
	}
	tooltip=document.createElement("div");
	tooltip.className="tooltip";
	tooltip.id="tooltip";
	tooltip.innerHTML=text;
	tooltip.style.display="none";
	map.getPane(G_MAP_FLOAT_PANE).appendChild(tooltip);
	GEvent.addListener(map, 'mousemove', placeTooltip);

	var inPolys=false;
	GEvent.addListener(marker, 'mouseover', function(){
		tooltip.style.display="block";
		inPolys=true;
	});
	GEvent.addListener(marker, 'mouseout', function(){
		inPolys=false;
		if (!inPolys)
			tooltip.style.display="none";
	});
}
