/* --- GOOGLE MAPS WRAPPERS --- */
/* ============================ */

//function GetMarkerImage(type)
//{	
	//if (type == 0) return "02_hotels.png";
	//if (type == 1) return "05_outdoors.png";
	//if (type == 2) return "04_shopping.png";
	//if (type == 3) return "03_dining.png";
//	
//	
	//return "06_general.png"
//}

function setRenderPause(rWait) 
{		
	window.setTimeout(function() {}, rWait); 
}

function GetMarkerHtml(unit)
{
    var html = null;
    
    html = "<iframe src='/popup/location.aspx?location=" + unit.ID + "' width='210' height='80' scrolling='no' frameborder='0' class='segFrame' id='mapWin'></iframe>";
    		
	return html;
}

function CreateMarker(unit) 
{
    var point = new GLatLng(unit.Lat, unit.Long);
	//var icon = new GIcon();
	//icon.shadow =  "/holidays/images/icons/shadow.png";
	//icon.iconSize = new GSize(23, 30);
	//icon.shadowSize = new GSize(46, 31);
	//icon.iconAnchor = new GPoint(6, 38);
	//icon.image = "/holidays/images/icons/" + GetMarkerImage(unit.Type);	
	//icon.infoWindowAnchor = new GPoint(10, 10);
				
	var marker = new GMarker(point,{ title: unit.Name } );
	//var marker = new GMarker(point,{ icon: icon, title: unit.Name } );
	var html = GetMarkerHtml(unit);
	
	if (html == null) return marker;
		
	GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); } );

    return marker;
}

function CreateStartMarker(name, latitude, longitude)
{
    var point = new GLatLng(latitude, longitude);
	var icon = new GIcon();	
	icon.image = "http://maps.google.com/mapfiles/kml/pal2/icon10.png";
	icon.iconSize = new GSize(32, 32);
	icon.shadow =  "http://maps.google.com/mapfiles/kml/pal2/icon10s.png";
	icon.shadowSize = new GSize(56,32);		
	icon.iconAnchor = new GPoint(16, 32);	
	icon.infoWindowAnchor = new GPoint(16, 0);	
	   	
	//var marker = new GMarker(point,{ title: name } );
	var marker = new GMarker(point,{ icon: icon, title: name } );
	
    return marker;
}