Hi,
I am trying to add custom Control to my map, but for some reason , the browser is showing myMap.controls as undefined

here is my code>>>>
var myMap;
function HomeControl()
{
homeControl=$("<div id='mapHomeControl'></div>");
$(homeControl).css("background-image",".\images\gui\homeIcon24.png");

google.maps.event.addDomListener(homeControl, 'click', function() {
myMap.setCenter(myLatLng);
});

}
function addHomeControl()
{

HomeControl();
homeControl.index = 1;

myMap.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(homeControl);

}

function displayMap(lat,lng,zoomLevel)
{setMapProperties(lat,lng,zoomLevel);
createMap();

}
function createMap()
{
var map=document.getElementById('myMap');
myMap= new google.maps.Map( map,
mapOptions);
addHomeControl();
}


If anyone can please help me as to where I am going wrong .

Thanks