var map;var centerLatitude = 37.996163;var centerLongitude = 15; var startZoom = 2;var deselectCurrent = function() {};var icon;var icon_fidelitybiosciences= new GIcon();icon_fidelitybiosciences.image = "images/icon/icon_fidelity.png";icon_fidelitybiosciences.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";icon_fidelitybiosciences.iconSize = new GSize(25, 25);icon_fidelitybiosciences.shadowSize = new GSize(25, 25);icon_fidelitybiosciences.iconAnchor = new GPoint(5, 12);icon_fidelitybiosciences.infoWindowAnchor = new GPoint(12, 25);var icon_therapeutics = new GIcon();icon_therapeutics.image = "http://labs.google.com/ridefinder/images/mm_20_yellow.png";icon_therapeutics.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";icon_therapeutics.iconSize = new GSize(12, 20);icon_therapeutics.shadowSize = new GSize(25, 25);icon_therapeutics.iconAnchor = new GPoint(5, 12);icon_therapeutics.infoWindowAnchor = new GPoint(5, 10);var icon_devices = new GIcon();icon_devices.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";icon_devices.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";icon_devices.iconSize = new GSize(12, 20);icon_devices.shadowSize = new GSize(25, 25);icon_devices.iconAnchor = new GPoint(5, 12);icon_devices.infoWindowAnchor = new GPoint(5, 10);var icon_pharma = new GIcon();icon_pharma.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";icon_pharma.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";icon_pharma.iconSize = new GSize(12, 20);icon_pharma.shadowSize = new GSize(25, 25);icon_pharma.iconAnchor = new GPoint(5, 12);icon_pharma.infoWindowAnchor = new GPoint(5, 10);/* [listing 6-20] */function initializePoint(pointData) {	var point = new GLatLng(pointData.latitude, pointData.longitude);	if (pointData.type == 'Fidelity Biosciences'){		icon = icon_fv;			} else if (pointData.type == 'Therapeutics'){		icon = icon_therapeutics;	} else if (pointData.type == 'Medical Devices and Tools'){		icon = icon_devices;	} else if (pointData.type == 'Pharma'){		icon = icon_pharma;	}	var marker = new GMarker(point, icon);	var listItem = document.createElement('li');	var listItemLink = listItem.appendChild(document.createElement('a'));	var visible = false;		/* SIDEBAR LISTING */	listItemLink.href = "#";	/*	listItemLink.innerHTML = '<strong>' + pointData.name + ' </strong><span><br />' + pointData.address + '<br />' + pointData.city + ' ' + pointData.state + ' ' + pointData.country + '<br />' + pointData.description;	*/	listItemLink.innerHTML = '<strong>' + pointData.name + ' </strong><span><br />' + pointData.description;		var focusPoint = function() {		deselectCurrent();		listItem.className = 'current';		deselectCurrent = function() { listItem.className = ''; }		/* IN-MAP WINDOW LISTING */		marker.openInfoWindowHtml('<div id="window"><h3>' + pointData.name + ' </h3><span>' + pointData.description + '</div>');		map.panTo(point);		return false;	}	GEvent.addListener(marker, 'click', focusPoint);		listItemLink.onclick = focusPoint;	pointData.show = function() {		if (!visible) {			document.getElementById('sidebar-list').appendChild(listItem);			map.addOverlay(marker);			visible = true;		}	}	pointData.hide = function() {		if (visible) {			document.getElementById('sidebar-list').removeChild(listItem);			map.removeOverlay(marker);			visible = false;		}	}			pointData.show();}function initializeSortTab(type) {	var listItem = document.createElement('li');	var listItemLink = listItem.appendChild(document.createElement('a'));	listItemLink.href = "#";	listItemLink.innerHTML = "<span class='"+type+"_tab'>"+type+"</span>";	listItemLink.onclick = function() {		changeBodyClass('standby', 'loading');		for(id in markers) {			if (markers[id].type == type || 'All' == type)				markers[id].show();			else				markers[id].hide();			}		changeBodyClass('loading', 'standby');		return false;	}	document.getElementById('filters').appendChild(listItem);}/* [listing 6-22 end] */function windowHeight() {	// Standard browsers (Mozilla, Safari, etc.)	if (self.innerHeight)		return self.innerHeight;	// IE 6	if (document.documentElement && document.documentElement.clientHeight)		return document.documentElement.clientHeight;	// IE 5	if (document.body)		return document.body.clientHeight;	// Just in case.	return 0;}/*function handleResize() {	var height = windowHeight() - document.getElementById('toolbar').offsetHeight - 30;	document.getElementById('map').style.height = height + 'px';	document.getElementById('sidebar').style.height = height + 'px';}*/function changeBodyClass(from, to) {	document.body.className = document.body.className.replace(from, to);	return false;}function init() {	var type;	var allTypes = { 'All':[] };			document.getElementById('button-sidebar-show').onclick = function() { return changeBodyClass('nosidebar', 'sidebar-right'); };	document.getElementById('button-sidebar-hide').onclick = function() { return changeBodyClass('sidebar-right', 'nosidebar'); };	/*	handleResize();	*/	map = new GMap2(document.getElementById("map"));	map.addControl(new GSmallMapControl());	map.addControl(new GMapTypeControl());	/*	map.addControl(new google.maps.LocalSearch());	map.addOverlay(new GTrafficOverlay());	*/http://www.fidelityventures.com/mashup/index.phphttp://www.fidelityventures.com/mashup/index.php		map.setCenter(new GLatLng(centerLatitude, centerLongitude), startZoom);		/* [listing 6-21] */	for(id in markers) {		initializePoint(markers[id]);		allTypes[markers[id].type] = true;	}	for(type in allTypes) {		initializeSortTab(type);	}	/* [listing 6-21 end] */	changeBodyClass('loading', 'standby');}/*window.onresize = handleResize;*/window.onload = init;