//this adds a marker, and uses the "createIcon" function to define an icon
//Variables are: mLat, mLong - Latitude and Longitude respectively
//map - the name of the map to which to add the marker
//message - the popup message
//iconRef - a reference for the icon
function addMarker(mLat, mLong, map, message, iconRef)//
	{
	var latlng = new GLatLng(mLat, mLong);//creates single variable for latitude and longitude 
		iconName = createIcon(iconRef);//defines the icon used
	var marker = new GMarker(latlng, iconName);// Creates marker variable 
     	GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(message);});//adds listener function to marker
	  	mark = map.addOverlay(marker);//creates code to add marker to map
    	
	return mark;//returns the code which adds the marker to the map
	
	}	
	

//this creates an icon	
//the address of the reference needs to be changed manually for each site
//icons must be stored as png files
//the icon shadow name must be the same as the icon name with "Shadow" appended (note that case matters)
//icon size should be standard within a site and is set manually
function createIcon(iconSource)
	{
	
	var icon = new GIcon(G_DEFAULT_ICON);
        icon.image = "http://svpca.org/images/icons/"+iconSource+".png";
		icon.shadow =  "http://svpca.org/images/icons/"+iconSource+"Shadow.png";
        icon.iconSize = new GSize(45, 34);//This sets the icon to a non-standard size
        icon.shadowSize = new GSize(45, 34);//This sets the shadow to a non-standard size
		
	return icon;	
	
		}


function runAlert(){alert("This is an alert");}
