function zoomControl(inout){
	cw=true;
	var mapZoomLevel=map.getZoom(),max_zoom=(true)?17:15,min_zoom=6;
	if((inout=='in')&&(mapZoomLevel<max_zoom))
		map.zoomIn();
	else if((inout=='out')&&(mapZoomLevel>=min_zoom))
		map.zoomOut();
		changeZoomImage(mapZoomLevel);
	};

function setZoomLevel(zl,state){
	if(state=='out'){
		var aa=map.getZoom();state='hi';
		if(zl>aa)
			state='un';
	};
	xb_get_element("zoom_"+zl).src="http://static.weddingwire.com/static/6.0.2/images/mapicons/zl_"+zl+"_"+state+".gif";
	if(state=='click'){
		changeZoomImage(zl);
		map.setZoom(zl);
	};
};
function changeZoomImage(mapZoomLevel){
	for(var i=17;i>=5;i=i-2){
		if(i>mapZoomLevel){
			var state='un';
		}else {
			var state='hi';
		};
	xb_get_element("zoom_"+i).src="http://static.weddingwire.com/static/6.0.2/images/mapicons/zl_"+i+"_"+state+".gif";
	};
};
function xb_get_element(id)
{
  var el = document.all ? document.all[id] : document.getElementById(id);
  if (el)
    return el;
  else
    return null;
}

function setMapType(p){
	if(p=="G_MAP_TYPE"){
		map.setMapType(G_NORMAL_MAP);
	}else if(p=="G_SATELLITE_TYPE"){
		map.setMapType(G_SATELLITE_MAP);
	}else if(p=="G_HYBRID_TYPE"){
		map.setMapType(G_HYBRID_MAP);
	};
	changeMapTypeImage(p);
};

function changeMapTypeImage(mapType){
	if(!mapType){
		if(xb_get_element('G_MAP_TYPE')){
			xb_get_element('G_MAP_TYPE').src='http://static.weddingwire.com/static/6.0.2/images/mapicons/mapnav_street_view_on.gif';
		};
	}else{
		var db={'G_MAP_TYPE':'mapnav_street_view_','G_SATELLITE_TYPE':'mapnav_satellite_view_','G_HYBRID_TYPE':'mapnav_hybrid_view_'};
		for(mtype in db){
			if(xb_get_element(mtype)){
				if(mtype==mapType){
					xb_get_element(mtype).src='http://static.weddingwire.com/static/6.0.2/images/mapicons/'+db[mtype]+'on.gif';
				}
				else{
					xb_get_element(mtype).src='http://static.weddingwire.com/static/6.0.2/images/mapicons/'+db[mtype]+'off.gif';
				};
			};
		};
	};
};
