 function load(strAddress1,strAddress2,strAddress3,map,info) 
 {
	if (GBrowserIsCompatible()) 
	{
		var map = new GMap2(map);
		//controls
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		
		//If the icon want to be customize, check commentary 2
		
		geocoder = new GClientGeocoder();
		if (geocoder) 
		{
			//try with address 1
			//------------
			geocoder.getLatLng(
			strAddress1,
			function(point) {
					if (!point) 
					{
						//strAddress 1 not found
						strAddress1 = replaceChars(strAddress1)
						strAddress1 = strAddress1.substring(0,strAddress1.search(","));
						
						// alert(strAddress1 + " not found");
						
						//try with strAddress 2
						//------------
						geocoder.getLatLng(strAddress2,
						function(point) {
								if (!point) 
								{
									//strAddress 2 not found
									strAddress2 = replaceChars(strAddress2)
									strAddress2 = strAddress2.substring(0,strAddress2.search(","));
									
									// alert(strAddress2 + " not found");
									
									//try with strAddress 3
									//------------
									geocoder.getLatLng(
									strAddress3,
									function(point) {
											if (!point) 
											{
												//strAddress 3 not found
												strAddress3 = replaceChars(strAddress3)
												strAddress3 = strAddress3.substring(0,strAddress3.search(","));
												// alert(strAddress3 + " not found");
												//more addresses...add here comentary 1
											}
											else
											{
												drawPoint(map,point,info)
											}
									}
									);
									//------------
								}
								else
								{
									drawPoint(map,point,info)
								}
						}
						);
						//------------
					}
					else
					{
						drawPoint(map,point,info)
					}
			}
			);
			//------------
		} 
	}
}

function drawPoint(map,point,info)
{
	var marker = new GMarker(point);
	map.setCenter(point, 14);
	map.addOverlay(marker);
	marker.openInfoWindowHtml(info);
}


function replaceChars(entry) 
{
	out = "%20"; // replace this
	add = " "; // with this
	temp = "" + entry; // temporary holder

	while (temp.indexOf(out)>-1) {
	pos= temp.indexOf(out);
	temp = "" + (temp.substring(0, pos) + add + 
	temp.substring((pos + out.length), temp.length));
	}
	return temp;
}

function sub(address)
{
	geocoder.getLatLng(
address,
function(point) {
		if (!point) 
		{
			//address 3 not found
			address = replaceChars(address)
			address = address.substring(0,address.search(","));
			//more addresses...add here comentary 1
		}
		else
		{
			drawPoint(map,point,info)
		}
}
);	
}

//--------------------------
//commentary 1
//this code below is the one that have to be added, in case is wanted to ad more possibilities to search.
/*
//the variable strAddress3 must be chamged for the one is going to be matched

geocoder.getLatLng(
strAddress3,
function(point) {
		if (!point) 
		{
			//strAddress3 not found
			strAddress3 = replaceChars(address3)
			strAddress3 = strAddress3.substring(0,strAddress3.search(","));
			//more addresses...add here comentary 1
		}
		else
		{
			drawPoint(map,point,info)
		}
}
);


//--------------------------
//commentary 2
//customize icon
//Note: the href for the image msut be the one wanted
var icon = new GIcon();
icon.image = "pic_logo-housenet.gif";
icon.shadow = "pic_logo-housenet.gif";
icon.iconSize = new GSize(32, 31);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
*/
									




