// init function will be executed when dom is ready
function init() {
if (GBrowserIsCompatible()) {
// Create a new google map
var map = new GMap2(document.getElementById('map_sample1'));
// Center on the world
map.setCenter(new GLatLng(47, 1), 4);
// Add controls
map.addControl(new GSmallMapControl());
// Attach maptimize service
window.maptimizeMap = new Maptimize.Map(map);
}
}
// Code based on Prototype. Of course you can use any JavaScript framework
// like jQuery for example : $(document).ready(init);
//
// Or use window onload event : window.onload = init;
document.observe('dom:loaded', init);