All pastes #207516 Raw Edit

line

public javascript v1 · immutable
#207516 ·published 2006-10-18 01:46 UTC
rendered paste body
<script type="text/javascript">//<![CDATA[		var tooltip = document.createElement("div");		tooltip.setAttribute("id","div_marker_tooltip");		tooltip.style.border="1px #555555 solid";		tooltip.style.backgroundColor="#ffffff";		tooltip.style.fontWeight="bold";		tooltip.style.fontFamily="Verdana, Arial, Helvetica, sans-serif";		tooltip.style.fontSize="9px";		tooltip.style.opacity="0.7";		tooltip.style.filter="alpha(opacity=70)";		tooltip.style.padding="2px 1ex";		tooltip.style.whiteSpace="nowrap";		tooltip.style.margin="0";		document.getElementById("map").appendChild(tooltip);		tooltip.style.visibility="hidden";    	function load() {      	if (GBrowserIsCompatible()) {		      	var map = new GMap2(document.getElementById("map"));		map.addControl(new GLargeMapControl());        map.addControl(new GMapTypeControl());		map.addControl(new GScaleControl());        map.setCenter(new GLatLng ', $dbrow['geocode'], ', 12);		// Custom Icons		var icon = new GIcon();        icon.image = "images/icon.png";		icon.shadow = null;		icon.iconSize = new GSize(25, 27);		icon.iconAnchor = new GPoint(10, 10);		icon.infoWindowAnchor = new GPoint(10, 10);		        // Marker Creation			var style = "<span style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 9px;color: black">";	var WINDOW_HTML = style+"<img src="../images/tube_logo3.gif" border="0"> <b>" + name+"</b><br>";	z = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zone: "+zone+"<br>";	WINDOW_HTML = WINDOW_HTML + "&nbsp;" +z + "</span>";	t = "<table cellpadding="0" cellspacing="1">";	WINDOW_HTML = WINDOW_HTML + t;	for (i=0, len = line.length; i < len; i++) {		lt = "<tr><td bgcolor="+lc[line.charAt(i)]+">&nbsp;&nbsp;</td><td>&nbsp;"+style+"<b>This bay is located in:<br><br>', $dbrow['bay_title'],' </b><br><br><b><a title="To get directions to this street please click your left mouse button now" href="http://maps.google.co.uk/maps?f=q&hl=en&q=', $dbrow[postcode_plus], '&ie=UTF8&om=1">To get directions to this road!</a></b><br><br>More Stuff Here....<br><br><b><a href="daysout.php">Link To Local Information</a><br><br><a href="test.php?quicks_postcode=', $dbrow[bay_postcode], '">Search for other bays in this area</a></b></span></td></tr>";		lt2 = "<tr><td bgcolor="+lc[line.charAt(i)]+">&nbsp;&nbsp;</td><td>&nbsp;" + ln[line.charAt(i)]+"</td></tr>";		WINDOW_HTML = WINDOW_HTML + lt; 	}	WINDOW_HTML = WINDOW_HTML + "</table>";				var marker = new GMarker(point, icon);		var point = new GLatLng', $dbrow['geocode'], ';		marker.tooltip = html;				map.addOverlay(marker);		GEvent.addListener(marker, "click", function() {		tooltip.style.visibility="hidden";		marker.openInfoWindowHtml(WINDOW_HTML);		});		GEvent.addListener(marker,"mouseover", function() {		showTooltip(marker);		});       		GEvent.addListener(marker,"mouseout", function() {		tooltip.style.visibility="hidden"		});  			return marker; }}function showTooltip(marker) {	tooltip.innerHTML = marker.tooltip;	var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),map.getZoom());	var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.point,map.getZoom());	var anchor=marker.icon.iconAnchor;	var width=marker.icon.iconSize.width;	var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y)); 	pos.apply(tooltip);	tooltip.style.visibility="visible";}    //]]>       </script>